@edgex-web/components 0.1.0-beta.15 → 0.1.0-beta.17
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 +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -100,5 +100,5 @@ React keys must be passed directly to JSX without using spread:
|
|
|
100
100
|
* @license qrcode.react
|
|
101
101
|
* Copyright (c) Paul O'Shannessy
|
|
102
102
|
* SPDX-License-Identifier: ISC
|
|
103
|
-
*/var Qf={L:$t.QrCode.Ecc.LOW,M:$t.QrCode.Ecc.MEDIUM,Q:$t.QrCode.Ecc.QUARTILE,H:$t.QrCode.Ecc.HIGH},ts=128,ns="L",rs="#FFFFFF",os="#000000",is=!1,ss=1,Xf=4,Jf=0,Zf=.1;function ls(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(u,a){if(!u&&s!==null){n.push(`M${s+t} ${o+t}h${a-s}v1H${s+t}z`),s=null;return}if(a===r.length-1){if(!u)return;s===null?n.push(`M${a+t},${o+t} h1v1H${a+t}z`):n.push(`M${s+t},${o+t} h${a+1-s}v1H${s+t}z`);return}u&&s===null&&(s=a)})}),n.join("")}function as(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function ed(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*Zf),u=o/t,a=(r.width||s)*u,i=(r.height||s)*u,l=r.x==null?e.length/2-a/2:r.x*u,c=r.y==null?e.length/2-i/2:r.y*u,p=r.opacity==null?1:r.opacity;let m=null;if(r.excavate){let b=Math.floor(l),y=Math.floor(c),N=Math.ceil(a+l-b),I=Math.ceil(i+c-y);m={x:b,y,w:N,h:I}}const f=r.crossOrigin;return{x:l,y:c,h:i,w:a,excavation:m,opacity:p,crossOrigin:f}}function td(e,t){return t!=null?Math.max(Math.floor(t),0):e?Xf:Jf}function us({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:u,boostLevel:a}){let i=d.useMemo(()=>{const b=(Array.isArray(e)?e:[e]).reduce((y,N)=>(y.push(...$t.QrSegment.makeSegments(N)),y),[]);return $t.QrCode.encodeSegments(b,Qf[t],n,void 0,void 0,a)},[e,t,n,a]);const{cells:l,margin:c,numCells:p,calculatedImageSettings:m}=d.useMemo(()=>{let f=i.getModules();const b=td(r,o),y=f.length+b*2,N=ed(f,u,b,s);return{cells:f,margin:b,numCells:y,calculatedImageSettings:N}},[i,u,s,r,o]);return{qrcode:i,margin:c,cells:l,numCells:p,calculatedImageSettings:m}}var nd=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),rd=d.forwardRef(function(t,n){const r=t,{value:o,size:s=ts,level:u=ns,bgColor:a=rs,fgColor:i=os,includeMargin:l=is,minVersion:c=ss,boostLevel:p,marginSize:m,imageSettings:f}=r,y=Mr(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:N}=y,I=Mr(y,["style"]),w=f==null?void 0:f.src,T=d.useRef(null),j=d.useRef(null),_=d.useCallback(P=>{T.current=P,typeof n=="function"?n(P):n&&(n.current=P)},[n]),[B,W]=d.useState(!1),{margin:h,cells:v,numCells:g,calculatedImageSettings:x}=us({value:o,level:u,minVersion:c,boostLevel:p,includeMargin:l,marginSize:m,imageSettings:f,size:s});d.useEffect(()=>{if(T.current!=null){const P=T.current,S=P.getContext("2d");if(!S)return;let $=v;const L=j.current,E=x!=null&&L!==null&&L.complete&&L.naturalHeight!==0&&L.naturalWidth!==0;E&&x.excavation!=null&&($=as(v,x.excavation));const D=window.devicePixelRatio||1;P.height=P.width=s*D;const F=s/g*D;S.scale(F,F),S.fillStyle=a,S.fillRect(0,0,g,g),S.fillStyle=i,nd?S.fill(new Path2D(ls($,h))):v.forEach(function(R,U){R.forEach(function(G,ee){G&&S.fillRect(ee+h,U+h,1,1)})}),x&&(S.globalAlpha=x.opacity),E&&S.drawImage(L,x.x+h,x.y+h,x.w,x.h)}}),d.useEffect(()=>{W(!1)},[w]);const C=Pr({height:s,width:s},N);let A=null;return w!=null&&(A=d.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{W(!0)},ref:j,crossOrigin:x==null?void 0:x.crossOrigin})),d.createElement(d.Fragment,null,d.createElement("canvas",Pr({style:C,height:s,width:s,ref:_,role:"img"},I)),A)});rd.displayName="QRCodeCanvas";var cs=d.forwardRef(function(t,n){const r=t,{value:o,size:s=ts,level:u=ns,bgColor:a=rs,fgColor:i=os,includeMargin:l=is,minVersion:c=ss,boostLevel:p,title:m,marginSize:f,imageSettings:b}=r,y=Mr(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:N,cells:I,numCells:w,calculatedImageSettings:T}=us({value:o,level:u,minVersion:c,boostLevel:p,includeMargin:l,marginSize:f,imageSettings:b,size:s});let j=I,_=null;b!=null&&T!=null&&(T.excavation!=null&&(j=as(I,T.excavation)),_=d.createElement("image",{href:b.src,height:T.h,width:T.w,x:T.x+N,y:T.y+N,preserveAspectRatio:"none",opacity:T.opacity,crossOrigin:T.crossOrigin}));const B=ls(j,N);return d.createElement("svg",Pr({height:s,width:s,viewBox:`0 0 ${w} ${w}`,ref:n,role:"img"},y),!!m&&d.createElement("title",null,m),d.createElement("path",{fill:a,d:`M0,0 h${w}v${w}H0z`,shapeRendering:"crispEdges"}),d.createElement("path",{fill:i,d:B,shapeRendering:"crispEdges"}),_)});cs.displayName="QRCodeSVG";const fs="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=",od=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const s=d.useMemo(()=>Nf(n||{}),[n]);return M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"flex justify-center mt-4 mb-3",children:M.jsx("div",{className:"bg-white rounded-lg",children:M.jsx(cs,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),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:e==null?void 0:e.getDisplayAddress()}),M.jsx(Kf,{onCopy:()=>{const a=(e==null?void 0:e.getDisplayAddress())||"";o&&o(a)},text:e==null?void 0:e.getDisplayAddress(),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:fs,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1",children:M.jsxs("p",{className:"text-xs text-functional-orange-1",children:["Only ",t," (",n==null?void 0:n.chain,") is supported for deposits to this address."]})})]}),s&&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:"When the deposit amount exceeds 250,000, there may be a delay in arrival. It is recommended to use the Ethereum network for deposits."})]})]}),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:"Arrival Time"}),M.jsxs("span",{className:"text-text-primary font-medium text-right underline decoration-dotted underline-offset-1",children:["≈"," ",Math.ceil(((n==null?void 0:n.blockTime)||12)*((n==null?void 0:n.txConfirm)||12)/60)," ","minutes"]})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[M.jsx("span",{className:"text-text-tertiary",children:"Minimum Deposit Amount"}),M.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((u=r==null?void 0:r.multiChain)==null?void 0:u.minDeposit)||10," ",t]})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[M.jsx("span",{className:"text-text-tertiary",children:"Maximum Deposit Amount"}),M.jsxs("span",{className:"text-text-primary font-medium text-right",children:["250,000 ",t]})]})]})]})},id=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:s,onCopy:u,onClose:a})=>{var b;const[i,l]=d.useState(()=>{var y;return!e||e.length===0?1:t||((y=e[0])==null?void 0:y.chainId)||1}),[c,p]=d.useState(()=>{var w;if(!e||e.length===0)return"";const y=t||((w=e[0])==null?void 0:w.chainId),N=e.find(T=>T.chainId===y);if(!N||!N.tokenList||N.tokenList.length===0)return"";const I=N.tokenList.find(T=>T.tokenAddress===n)||N.tokenList[0];return(I==null?void 0:I.token)||""}),m=e&&e.length>0?e.find(y=>y.chainId===i)||e[0]:null,f=(b=m==null?void 0:m.tokenList)==null?void 0:b.find(y=>y.token===c);return!e||e.length===0?M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"No chains available"})}):m?M.jsxs(M.Fragment,{children:[M.jsx(wr,{currentActiveChain:m,chainList:e,onChainChange:l,curSelectToken:c,onTokenChange:p,walletType:"mpc"}),M.jsx(od,{walletAdapter:r,curSelectToken:c,currentActiveChain:m,metadata:o,onCopy:u}),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:()=>{s&&s({amount:"",chainId:i,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:c}),a()},children:"Deposit"})]}):M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"Loading..."})})};var sd=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Lr=Math.ceil,Ie=Math.floor,Ce="[BigNumber Error] ",ds=Ce+"Number primitive has more than 15 significant digits: ",Ve=1e14,K=14,Ir=9007199254740991,Dr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ut=1e7,ge=1e9;function ps(e){var t,n,r,o=w.prototype={constructor:w,toString:null,valueOf:null},s=new w(1),u=20,a=4,i=-7,l=21,c=-1e7,p=1e7,m=!1,f=1,b=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},N="0123456789abcdefghijklmnopqrstuvwxyz",I=!0;function w(h,v){var g,x,C,A,P,S,$,L,E=this;if(!(E instanceof w))return new w(h,v);if(v==null){if(h&&h._isBigNumber===!0){E.s=h.s,!h.c||h.e>p?E.c=E.e=null:h.e<c?E.c=[E.e=0]:(E.e=h.e,E.c=h.c.slice());return}if((S=typeof h=="number")&&h*0==0){if(E.s=1/h<0?(h=-h,-1):1,h===~~h){for(A=0,P=h;P>=10;P/=10,A++);A>p?E.c=E.e=null:(E.e=A,E.c=[h]);return}L=String(h)}else{if(!sd.test(L=String(h)))return r(E,L,S);E.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(A=L.indexOf("."))>-1&&(L=L.replace(".","")),(P=L.search(/e/i))>0?(A<0&&(A=P),A+=+L.slice(P+1),L=L.substring(0,P)):A<0&&(A=L.length)}else{if(ue(v,2,N.length,"Base"),v==10&&I)return E=new w(h),B(E,u+E.e+1,a);if(L=String(h),S=typeof h=="number"){if(h*0!=0)return r(E,L,S,v);if(E.s=1/h<0?(L=L.slice(1),-1):1,w.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(ds+h)}else E.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(g=N.slice(0,v),A=P=0,$=L.length;P<$;P++)if(g.indexOf(x=L.charAt(P))<0){if(x=="."){if(P>A){A=$;continue}}else if(!C&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){C=!0,P=-1,A=0;continue}return r(E,String(h),S,v)}S=!1,L=n(L,v,10,E.s),(A=L.indexOf("."))>-1?L=L.replace(".",""):A=L.length}for(P=0;L.charCodeAt(P)===48;P++);for($=L.length;L.charCodeAt(--$)===48;);if(L=L.slice(P,++$)){if($-=P,S&&w.DEBUG&&$>15&&(h>Ir||h!==Ie(h)))throw Error(ds+E.s*h);if((A=A-P-1)>p)E.c=E.e=null;else if(A<c)E.c=[E.e=0];else{if(E.e=A,E.c=[],P=(A+1)%K,A<0&&(P+=K),P<$){for(P&&E.c.push(+L.slice(0,P)),$-=K;P<$;)E.c.push(+L.slice(P,P+=K));P=K-(L=L.slice(P)).length}else P-=$;for(;P--;L+="0");E.c.push(+L)}}else E.c=[E.e=0]}w.clone=ps,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(h){var v,g;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(v="DECIMAL_PLACES")&&(g=h[v],ue(g,0,ge,v),u=g),h.hasOwnProperty(v="ROUNDING_MODE")&&(g=h[v],ue(g,0,8,v),a=g),h.hasOwnProperty(v="EXPONENTIAL_AT")&&(g=h[v],g&&g.pop?(ue(g[0],-ge,0,v),ue(g[1],0,ge,v),i=g[0],l=g[1]):(ue(g,-ge,ge,v),i=-(l=g<0?-g:g))),h.hasOwnProperty(v="RANGE"))if(g=h[v],g&&g.pop)ue(g[0],-ge,-1,v),ue(g[1],1,ge,v),c=g[0],p=g[1];else if(ue(g,-ge,ge,v),g)c=-(p=g<0?-g:g);else throw Error(Ce+v+" cannot be zero: "+g);if(h.hasOwnProperty(v="CRYPTO"))if(g=h[v],g===!!g)if(g)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))m=g;else throw m=!g,Error(Ce+"crypto unavailable");else m=g;else throw Error(Ce+v+" not true or false: "+g);if(h.hasOwnProperty(v="MODULO_MODE")&&(g=h[v],ue(g,0,9,v),f=g),h.hasOwnProperty(v="POW_PRECISION")&&(g=h[v],ue(g,0,ge,v),b=g),h.hasOwnProperty(v="FORMAT"))if(g=h[v],typeof g=="object")y=g;else throw Error(Ce+v+" not an object: "+g);if(h.hasOwnProperty(v="ALPHABET"))if(g=h[v],typeof g=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(g))I=g.slice(0,10)=="0123456789",N=g;else throw Error(Ce+v+" invalid: "+g)}else throw Error(Ce+"Object expected: "+h);return{DECIMAL_PLACES:u,ROUNDING_MODE:a,EXPONENTIAL_AT:[i,l],RANGE:[c,p],CRYPTO:m,MODULO_MODE:f,POW_PRECISION:b,FORMAT:y,ALPHABET:N}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var v,g,x=h.c,C=h.e,A=h.s;e:if({}.toString.call(x)=="[object Array]"){if((A===1||A===-1)&&C>=-ge&&C<=ge&&C===Ie(C)){if(x[0]===0){if(C===0&&x.length===1)return!0;break e}if(v=(C+1)%K,v<1&&(v+=K),String(x[0]).length==v){for(v=0;v<x.length;v++)if(g=x[v],g<0||g>=Ve||g!==Ie(g))break e;if(g!==0)return!0}}}else if(x===null&&C===null&&(A===null||A===1||A===-1))return!0;throw Error(Ce+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return j(arguments,-1)},w.minimum=w.min=function(){return j(arguments,1)},w.random=function(){var h=9007199254740992,v=Math.random()*h&2097151?function(){return Ie(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(g){var x,C,A,P,S,$=0,L=[],E=new w(s);if(g==null?g=u:ue(g,0,ge),P=Lr(g/K),m)if(crypto.getRandomValues){for(x=crypto.getRandomValues(new Uint32Array(P*=2));$<P;)S=x[$]*131072+(x[$+1]>>>11),S>=9e15?(C=crypto.getRandomValues(new Uint32Array(2)),x[$]=C[0],x[$+1]=C[1]):(L.push(S%1e14),$+=2);$=P/2}else if(crypto.randomBytes){for(x=crypto.randomBytes(P*=7);$<P;)S=(x[$]&31)*281474976710656+x[$+1]*1099511627776+x[$+2]*4294967296+x[$+3]*16777216+(x[$+4]<<16)+(x[$+5]<<8)+x[$+6],S>=9e15?crypto.randomBytes(7).copy(x,$):(L.push(S%1e14),$+=7);$=P/7}else throw m=!1,Error(Ce+"crypto unavailable");if(!m)for(;$<P;)S=v(),S<9e15&&(L[$++]=S%1e14);for(P=L[--$],g%=K,P&&g&&(S=Dr[K-g],L[$]=Ie(P/S)*S);L[$]===0;L.pop(),$--);if($<0)L=[A=0];else{for(A=-1;L[0]===0;L.splice(0,1),A-=K);for($=1,S=L[0];S>=10;S/=10,$++);$<K&&(A-=K-$)}return E.e=A,E.c=L,E}}(),w.sum=function(){for(var h=1,v=arguments,g=new w(v[0]);h<v.length;)g=g.plus(v[h++]);return g},n=function(){var h="0123456789";function v(g,x,C,A){for(var P,S=[0],$,L=0,E=g.length;L<E;){for($=S.length;$--;S[$]*=x);for(S[0]+=A.indexOf(g.charAt(L++)),P=0;P<S.length;P++)S[P]>C-1&&(S[P+1]==null&&(S[P+1]=0),S[P+1]+=S[P]/C|0,S[P]%=C)}return S.reverse()}return function(g,x,C,A,P){var S,$,L,E,D,F,R,U,G=g.indexOf("."),ee=u,q=a;for(G>=0&&(E=b,b=0,g=g.replace(".",""),U=new w(x),F=U.pow(g.length-G),b=E,U.c=v(tt(Fe(F.c),F.e,"0"),10,C,h),U.e=U.c.length),R=v(g,x,C,P?(S=N,h):(S=h,N)),L=E=R.length;R[--E]==0;R.pop());if(!R[0])return S.charAt(0);if(G<0?--L:(F.c=R,F.e=L,F.s=A,F=t(F,U,ee,q,C),R=F.c,D=F.r,L=F.e),$=L+ee+1,G=R[$],E=C/2,D=D||$<0||R[$+1]!=null,D=q<4?(G!=null||D)&&(q==0||q==(F.s<0?3:2)):G>E||G==E&&(q==4||D||q==6&&R[$-1]&1||q==(F.s<0?8:7)),$<1||!R[0])g=D?tt(S.charAt(1),-ee,S.charAt(0)):S.charAt(0);else{if(R.length=$,D)for(--C;++R[--$]>C;)R[$]=0,$||(++L,R=[1].concat(R));for(E=R.length;!R[--E];);for(G=0,g="";G<=E;g+=S.charAt(R[G++]));g=tt(g,L,S.charAt(0))}return g}}(),t=function(){function h(x,C,A){var P,S,$,L,E=0,D=x.length,F=C%ut,R=C/ut|0;for(x=x.slice();D--;)$=x[D]%ut,L=x[D]/ut|0,P=R*$+L*F,S=F*$+P%ut*ut+E,E=(S/A|0)+(P/ut|0)+R*L,x[D]=S%A;return E&&(x=[E].concat(x)),x}function v(x,C,A,P){var S,$;if(A!=P)$=A>P?1:-1;else for(S=$=0;S<A;S++)if(x[S]!=C[S]){$=x[S]>C[S]?1:-1;break}return $}function g(x,C,A,P){for(var S=0;A--;)x[A]-=S,S=x[A]<C[A]?1:0,x[A]=S*P+x[A]-C[A];for(;!x[0]&&x.length>1;x.splice(0,1));}return function(x,C,A,P,S){var $,L,E,D,F,R,U,G,ee,q,X,z,re,de,_e,je,ct,Se=x.s==C.s?1:-1,ve=x.c,ie=C.c;if(!ve||!ve[0]||!ie||!ie[0])return new w(!x.s||!C.s||(ve?ie&&ve[0]==ie[0]:!ie)?NaN:ve&&ve[0]==0||!ie?Se*0:Se/0);for(G=new w(Se),ee=G.c=[],L=x.e-C.e,Se=A+L+1,S||(S=Ve,L=De(x.e/K)-De(C.e/K),Se=Se/K|0),E=0;ie[E]==(ve[E]||0);E++);if(ie[E]>(ve[E]||0)&&L--,Se<0)ee.push(1),D=!0;else{for(de=ve.length,je=ie.length,E=0,Se+=2,F=Ie(S/(ie[0]+1)),F>1&&(ie=h(ie,F,S),ve=h(ve,F,S),je=ie.length,de=ve.length),re=je,q=ve.slice(0,je),X=q.length;X<je;q[X++]=0);ct=ie.slice(),ct=[0].concat(ct),_e=ie[0],ie[1]>=S/2&&_e++;do{if(F=0,$=v(ie,q,je,X),$<0){if(z=q[0],je!=X&&(z=z*S+(q[1]||0)),F=Ie(z/_e),F>1)for(F>=S&&(F=S-1),R=h(ie,F,S),U=R.length,X=q.length;v(R,q,U,X)==1;)F--,g(R,je<U?ct:ie,U,S),U=R.length,$=1;else F==0&&($=F=1),R=ie.slice(),U=R.length;if(U<X&&(R=[0].concat(R)),g(q,R,X,S),X=q.length,$==-1)for(;v(ie,q,je,X)<1;)F++,g(q,je<X?ct:ie,X,S),X=q.length}else $===0&&(F++,q=[0]);ee[E++]=F,q[0]?q[X++]=ve[re]||0:(q=[ve[re]],X=1)}while((re++<de||q[0]!=null)&&Se--);D=q[0]!=null,ee[0]||ee.splice(0,1)}if(S==Ve){for(E=1,Se=ee[0];Se>=10;Se/=10,E++);B(G,A+(G.e=E+L*K-1)+1,P,D)}else G.e=L,G.r=+D;return G}}();function T(h,v,g,x){var C,A,P,S,$;if(g==null?g=a:ue(g,0,8),!h.c)return h.toString();if(C=h.c[0],P=h.e,v==null)$=Fe(h.c),$=x==1||x==2&&(P<=i||P>=l)?Sn($,P):tt($,P,"0");else if(h=B(new w(h),v,g),A=h.e,$=Fe(h.c),S=$.length,x==1||x==2&&(v<=A||A<=i)){for(;S<v;$+="0",S++);$=Sn($,A)}else if(v-=P+(x===2&&A>P),$=tt($,A,"0"),A+1>S){if(--v>0)for($+=".";v--;$+="0");}else if(v+=A-S,v>0)for(A+1==S&&($+=".");v--;$+="0");return h.s<0&&C?"-"+$:$}function j(h,v){for(var g,x,C=1,A=new w(h[0]);C<h.length;C++)x=new w(h[C]),(!x.s||(g=bt(A,x))===v||g===0&&A.s===v)&&(A=x);return A}function _(h,v,g){for(var x=1,C=v.length;!v[--C];v.pop());for(C=v[0];C>=10;C/=10,x++);return(g=x+g*K-1)>p?h.c=h.e=null:g<c?h.c=[h.e=0]:(h.e=g,h.c=v),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,v=/^([^.]+)\.$/,g=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(A,P,S,$){var L,E=S?P:P.replace(C,"");if(x.test(E))A.s=isNaN(E)?null:E<0?-1:1;else{if(!S&&(E=E.replace(h,function(D,F,R){return L=(R=R.toLowerCase())=="x"?16:R=="b"?2:8,!$||$==L?F:D}),$&&(L=$,E=E.replace(v,"$1").replace(g,"0.$1")),P!=E))return new w(E,L);if(w.DEBUG)throw Error(Ce+"Not a"+($?" base "+$:"")+" number: "+P);A.s=null}A.c=A.e=null}}();function B(h,v,g,x){var C,A,P,S,$,L,E,D=h.c,F=Dr;if(D){e:{for(C=1,S=D[0];S>=10;S/=10,C++);if(A=v-C,A<0)A+=K,P=v,$=D[L=0],E=Ie($/F[C-P-1]%10);else if(L=Lr((A+1)/K),L>=D.length)if(x){for(;D.length<=L;D.push(0));$=E=0,C=1,A%=K,P=A-K+1}else break e;else{for($=S=D[L],C=1;S>=10;S/=10,C++);A%=K,P=A-K+C,E=P<0?0:Ie($/F[C-P-1]%10)}if(x=x||v<0||D[L+1]!=null||(P<0?$:$%F[C-P-1]),x=g<4?(E||x)&&(g==0||g==(h.s<0?3:2)):E>5||E==5&&(g==4||x||g==6&&(A>0?P>0?$/F[C-P]:0:D[L-1])%10&1||g==(h.s<0?8:7)),v<1||!D[0])return D.length=0,x?(v-=h.e+1,D[0]=F[(K-v%K)%K],h.e=-v||0):D[0]=h.e=0,h;if(A==0?(D.length=L,S=1,L--):(D.length=L+1,S=F[K-A],D[L]=P>0?Ie($/F[C-P]%F[P])*S:0),x)for(;;)if(L==0){for(A=1,P=D[0];P>=10;P/=10,A++);for(P=D[0]+=S,S=1;P>=10;P/=10,S++);A!=S&&(h.e++,D[0]==Ve&&(D[0]=1));break}else{if(D[L]+=S,D[L]!=Ve)break;D[L--]=0,S=1}for(A=D.length;D[--A]===0;D.pop());}h.e>p?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function W(h){var v,g=h.e;return g===null?h.toString():(v=Fe(h.c),v=g<=i||g>=l?Sn(v,g):tt(v,g,"0"),h.s<0?"-"+v:v)}return o.absoluteValue=o.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},o.comparedTo=function(h,v){return bt(this,new w(h,v))},o.decimalPlaces=o.dp=function(h,v){var g,x,C,A=this;if(h!=null)return ue(h,0,ge),v==null?v=a:ue(v,0,8),B(new w(A),h+A.e+1,v);if(!(g=A.c))return null;if(x=((C=g.length-1)-De(this.e/K))*K,C=g[C])for(;C%10==0;C/=10,x--);return x<0&&(x=0),x},o.dividedBy=o.div=function(h,v){return t(this,new w(h,v),u,a)},o.dividedToIntegerBy=o.idiv=function(h,v){return t(this,new w(h,v),0,1)},o.exponentiatedBy=o.pow=function(h,v){var g,x,C,A,P,S,$,L,E,D=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Ce+"Exponent not an integer: "+W(h));if(v!=null&&(v=new w(v)),S=h.e>14,!D.c||!D.c[0]||D.c[0]==1&&!D.e&&D.c.length==1||!h.c||!h.c[0])return E=new w(Math.pow(+W(D),S?h.s*(2-Cn(h)):+W(h))),v?E.mod(v):E;if($=h.s<0,v){if(v.c?!v.c[0]:!v.s)return new w(NaN);x=!$&&D.isInteger()&&v.isInteger(),x&&(D=D.mod(v))}else{if(h.e>9&&(D.e>0||D.e<-1||(D.e==0?D.c[0]>1||S&&D.c[1]>=24e7:D.c[0]<8e13||S&&D.c[0]<=9999975e7)))return A=D.s<0&&Cn(h)?-0:0,D.e>-1&&(A=1/A),new w($?1/A:A);b&&(A=Lr(b/K+2))}for(S?(g=new w(.5),$&&(h.s=1),L=Cn(h)):(C=Math.abs(+W(h)),L=C%2),E=new w(s);;){if(L){if(E=E.times(D),!E.c)break;A?E.c.length>A&&(E.c.length=A):x&&(E=E.mod(v))}if(C){if(C=Ie(C/2),C===0)break;L=C%2}else if(h=h.times(g),B(h,h.e+1,1),h.e>14)L=Cn(h);else{if(C=+W(h),C===0)break;L=C%2}D=D.times(D),A?D.c&&D.c.length>A&&(D.c.length=A):x&&(D=D.mod(v))}return x?E:($&&(E=s.div(E)),v?E.mod(v):A?B(E,b,a,P):E)},o.integerValue=function(h){var v=new w(this);return h==null?h=a:ue(h,0,8),B(v,v.e+1,h)},o.isEqualTo=o.eq=function(h,v){return bt(this,new w(h,v))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(h,v){return bt(this,new w(h,v))>0},o.isGreaterThanOrEqualTo=o.gte=function(h,v){return(v=bt(this,new w(h,v)))===1||v===0},o.isInteger=function(){return!!this.c&&De(this.e/K)>this.c.length-2},o.isLessThan=o.lt=function(h,v){return bt(this,new w(h,v))<0},o.isLessThanOrEqualTo=o.lte=function(h,v){return(v=bt(this,new w(h,v)))===-1||v===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(h,v){var g,x,C,A,P=this,S=P.s;if(h=new w(h,v),v=h.s,!S||!v)return new w(NaN);if(S!=v)return h.s=-v,P.plus(h);var $=P.e/K,L=h.e/K,E=P.c,D=h.c;if(!$||!L){if(!E||!D)return E?(h.s=-v,h):new w(D?P:NaN);if(!E[0]||!D[0])return D[0]?(h.s=-v,h):new w(E[0]?P:a==3?-0:0)}if($=De($),L=De(L),E=E.slice(),S=$-L){for((A=S<0)?(S=-S,C=E):(L=$,C=D),C.reverse(),v=S;v--;C.push(0));C.reverse()}else for(x=(A=(S=E.length)<(v=D.length))?S:v,S=v=0;v<x;v++)if(E[v]!=D[v]){A=E[v]<D[v];break}if(A&&(C=E,E=D,D=C,h.s=-h.s),v=(x=D.length)-(g=E.length),v>0)for(;v--;E[g++]=0);for(v=Ve-1;x>S;){if(E[--x]<D[x]){for(g=x;g&&!E[--g];E[g]=v);--E[g],E[x]+=Ve}E[x]-=D[x]}for(;E[0]==0;E.splice(0,1),--L);return E[0]?_(h,E,L):(h.s=a==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,v){var g,x,C=this;return h=new w(h,v),!C.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||C.c&&!C.c[0]?new w(C):(f==9?(x=h.s,h.s=1,g=t(C,h,0,3),h.s=x,g.s*=x):g=t(C,h,0,f),h=C.minus(g.times(h)),!h.c[0]&&f==1&&(h.s=C.s),h)},o.multipliedBy=o.times=function(h,v){var g,x,C,A,P,S,$,L,E,D,F,R,U,G,ee,q=this,X=q.c,z=(h=new w(h,v)).c;if(!X||!z||!X[0]||!z[0])return!q.s||!h.s||X&&!X[0]&&!z||z&&!z[0]&&!X?h.c=h.e=h.s=null:(h.s*=q.s,!X||!z?h.c=h.e=null:(h.c=[0],h.e=0)),h;for(x=De(q.e/K)+De(h.e/K),h.s*=q.s,$=X.length,D=z.length,$<D&&(U=X,X=z,z=U,C=$,$=D,D=C),C=$+D,U=[];C--;U.push(0));for(G=Ve,ee=ut,C=D;--C>=0;){for(g=0,F=z[C]%ee,R=z[C]/ee|0,P=$,A=C+P;A>C;)L=X[--P]%ee,E=X[P]/ee|0,S=R*L+E*F,L=F*L+S%ee*ee+U[A]+g,g=(L/G|0)+(S/ee|0)+R*E,U[A--]=L%G;U[A]=g}return g?++x:U.splice(0,1),_(h,U,x)},o.negated=function(){var h=new w(this);return h.s=-h.s||null,h},o.plus=function(h,v){var g,x=this,C=x.s;if(h=new w(h,v),v=h.s,!C||!v)return new w(NaN);if(C!=v)return h.s=-v,x.minus(h);var A=x.e/K,P=h.e/K,S=x.c,$=h.c;if(!A||!P){if(!S||!$)return new w(C/0);if(!S[0]||!$[0])return $[0]?h:new w(S[0]?x:C*0)}if(A=De(A),P=De(P),S=S.slice(),C=A-P){for(C>0?(P=A,g=$):(C=-C,g=S),g.reverse();C--;g.push(0));g.reverse()}for(C=S.length,v=$.length,C-v<0&&(g=$,$=S,S=g,v=C),C=0;v;)C=(S[--v]=S[v]+$[v]+C)/Ve|0,S[v]=Ve===S[v]?0:S[v]%Ve;return C&&(S=[C].concat(S),++P),_(h,S,P)},o.precision=o.sd=function(h,v){var g,x,C,A=this;if(h!=null&&h!==!!h)return ue(h,1,ge),v==null?v=a:ue(v,0,8),B(new w(A),h,v);if(!(g=A.c))return null;if(C=g.length-1,x=C*K+1,C=g[C]){for(;C%10==0;C/=10,x--);for(C=g[0];C>=10;C/=10,x++);}return h&&A.e+1>x&&(x=A.e+1),x},o.shiftedBy=function(h){return ue(h,-Ir,Ir),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,v,g,x,C,A=this,P=A.c,S=A.s,$=A.e,L=u+4,E=new w("0.5");if(S!==1||!P||!P[0])return new w(!S||S<0&&(!P||P[0])?NaN:P?A:1/0);if(S=Math.sqrt(+W(A)),S==0||S==1/0?(v=Fe(P),(v.length+$)%2==0&&(v+="0"),S=Math.sqrt(+v),$=De(($+1)/2)-($<0||$%2),S==1/0?v="5e"+$:(v=S.toExponential(),v=v.slice(0,v.indexOf("e")+1)+$),g=new w(v)):g=new w(S+""),g.c[0]){for($=g.e,S=$+L,S<3&&(S=0);;)if(C=g,g=E.times(C.plus(t(A,C,L,1))),Fe(C.c).slice(0,S)===(v=Fe(g.c)).slice(0,S))if(g.e<$&&--S,v=v.slice(S-3,S+1),v=="9999"||!x&&v=="4999"){if(!x&&(B(C,C.e+u+2,0),C.times(C).eq(A))){g=C;break}L+=4,S+=4,x=1}else{(!+v||!+v.slice(1)&&v.charAt(0)=="5")&&(B(g,g.e+u+2,1),h=!g.times(g).eq(A));break}}return B(g,g.e+u+1,a,h)},o.toExponential=function(h,v){return h!=null&&(ue(h,0,ge),h++),T(this,h,v,1)},o.toFixed=function(h,v){return h!=null&&(ue(h,0,ge),h=h+this.e+1),T(this,h,v)},o.toFormat=function(h,v,g){var x,C=this;if(g==null)h!=null&&v&&typeof v=="object"?(g=v,v=null):h&&typeof h=="object"?(g=h,h=v=null):g=y;else if(typeof g!="object")throw Error(Ce+"Argument not an object: "+g);if(x=C.toFixed(h,v),C.c){var A,P=x.split("."),S=+g.groupSize,$=+g.secondaryGroupSize,L=g.groupSeparator||"",E=P[0],D=P[1],F=C.s<0,R=F?E.slice(1):E,U=R.length;if($&&(A=S,S=$,$=A,U-=A),S>0&&U>0){for(A=U%S||S,E=R.substr(0,A);A<U;A+=S)E+=L+R.substr(A,S);$>0&&(E+=L+R.slice(A)),F&&(E="-"+E)}x=D?E+(g.decimalSeparator||"")+(($=+g.fractionGroupSize)?D.replace(new RegExp("\\d{"+$+"}\\B","g"),"$&"+(g.fractionGroupSeparator||"")):D):E}return(g.prefix||"")+x+(g.suffix||"")},o.toFraction=function(h){var v,g,x,C,A,P,S,$,L,E,D,F,R=this,U=R.c;if(h!=null&&(S=new w(h),!S.isInteger()&&(S.c||S.s!==1)||S.lt(s)))throw Error(Ce+"Argument "+(S.isInteger()?"out of range: ":"not an integer: ")+W(S));if(!U)return new w(R);for(v=new w(s),L=g=new w(s),x=$=new w(s),F=Fe(U),A=v.e=F.length-R.e-1,v.c[0]=Dr[(P=A%K)<0?K+P:P],h=!h||S.comparedTo(v)>0?A>0?v:L:S,P=p,p=1/0,S=new w(F),$.c[0]=0;E=t(S,v,0,1),C=g.plus(E.times(x)),C.comparedTo(h)!=1;)g=x,x=C,L=$.plus(E.times(C=L)),$=C,v=S.minus(E.times(C=v)),S=C;return C=t(h.minus(g),x,0,1),$=$.plus(C.times(L)),g=g.plus(C.times(x)),$.s=L.s=R.s,A=A*2,D=t(L,x,A,a).minus(R).abs().comparedTo(t($,g,A,a).minus(R).abs())<1?[L,x]:[$,g],p=P,D},o.toNumber=function(){return+W(this)},o.toPrecision=function(h,v){return h!=null&&ue(h,1,ge),T(this,h,v,2)},o.toString=function(h){var v,g=this,x=g.s,C=g.e;return C===null?x?(v="Infinity",x<0&&(v="-"+v)):v="NaN":(h==null?v=C<=i||C>=l?Sn(Fe(g.c),C):tt(Fe(g.c),C,"0"):h===10&&I?(g=B(new w(g),u+C+1,a),v=tt(Fe(g.c),g.e,"0")):(ue(h,2,N.length,"Base"),v=n(tt(Fe(g.c),C,"0"),10,h,x,!0)),x<0&&g.c[0]&&(v="-"+v)),v},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function De(e){var t=e|0;return e>0||e===t?t:t-1}function Fe(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=K-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function bt(e,t){var n,r,o=e.c,s=t.c,u=e.s,a=t.s,i=e.e,l=t.e;if(!u||!a)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-a:u;if(u!=a)return u;if(n=u<0,r=i==l,!o||!s)return r?0:!o^n?1:-1;if(!r)return i>l^n?1:-1;for(a=(i=o.length)<(l=s.length)?i:l,u=0;u<a;u++)if(o[u]!=s[u])return o[u]>s[u]^n?1:-1;return i==l?0:i>l^n?1:-1}function ue(e,t,n,r){if(e<t||e>n||e!==Ie(e))throw Error(Ce+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Cn(e){var t=e.c.length-1;return De(e.e/K)==t&&e.c[t]%2!=0}function Sn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function tt(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var hs=ps();const ld=Object.values({MAINNET:1,SEPOLIA:11155111}),On=e=>ld.includes(+e),ad=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:s,amount:u,decimals:a,tokenBalance:i,platformBalance:l="0",onDepositAmountChange:c,onApprove:p})=>{const m=d.useMemo(()=>{if(On(o==null?void 0:o.chainId))return!1;try{const y=new hs(e||"0"),N=new hs("250000");return y.isNaN()||N.isNaN()?!1:y.gte(N)}catch{return!1}},[o,e]),f=y=>{const N=y.target.value,w=Er(N,i||"0");if(w.isValid)c(w.formattedValue),w.errorType;else return w.errorType==="exceed_balance",void 0},b=()=>{const y=parseFloat(i||"0"),N=parseFloat(e||"0");if(N>0){const I=y-N,w=Ue(Math.max(0,I).toString());return`${Ue(i||"0")} → ${w} ${t}`}return`${Ue(i||"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:"Amount",value:e,onChange:f,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:()=>{c(i||"0")},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:"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("span",{className:"text-text-tertiary text-xs leading-[14px]",children:"Available"}),M.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:b()})]})]}),m&&M.jsxs("div",{className:"flex mb-4 border-b border-dashed border-line-divider-secondary pb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:fs,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:"When the deposit amount exceeds 250,000, there may be a delay in arrival. It is recommended to use the Ethereum network for deposits."})]}),!r&&Sf(e||"0",0)&&M.jsxs("div",{className:"flex justify-center flex-col items-center",children:[M.jsxs("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:["Enable ",t," on ",o==null?void 0:o.chain]}),M.jsxs("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:["You must enable ",t," first before you can deposit on"," ",o==null?void 0:o.chain,"."]}),M.jsxs("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",onClick:p,children:["Enable ",t]})]}),M.jsx("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:M.jsxs("div",{className:"flex justify-between items-center",children:[M.jsx("span",{className:"text-sm leading-[18px] text-text-tertiary",children:"总资产"}),M.jsx("span",{className:"text-sm leading-[18px] text-text-primary font-medium",children:e?`${Ue(l)} → ${Ue((parseFloat(l)+parseFloat(e)).toString())} ${t}`:`${Ue(l)} ${t}`})]})})]})},ud=({token:e,account:t,chainId:n,contractAddress:r,wagmiHooks:o,onResult:s})=>{var i,l;const u=(i=o==null?void 0:o.useBalance)==null?void 0:i.call(o,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(o!=null&&o.useBalance)}}),a=(l=o==null?void 0:o.useReadContract)==null?void 0:l.call(o,{address:e.tokenAddress,abi:[{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],functionName:"allowance",args:[t,r],chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!r&&!!(o!=null&&o.useReadContract)}});return d.useEffect(()=>{s(e.tokenAddress,{balance:u,allowance:a})},[u,a,e.tokenAddress,s]),null},ms=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var b;const s=d.useMemo(()=>r.filter(y=>y.tokenAddress&&y.tokenAddress!=="0x0000000000000000000000000000000000000000"),[r]),[u,a]=d.useState({}),i=d.useCallback((y,N)=>{a(I=>({...I,[y]:N}))},[]),l=(b=o==null?void 0:o.useBalance)==null?void 0:b.call(o,{address:e,chainId:t,query:{enabled:!!e&&!!t&&!!(o!=null&&o.useBalance)}}),c=d.useMemo(()=>s.map(y=>d.createElement(ud,{key:y.tokenAddress,token:y,account:e,chainId:t,contractAddress:n,wagmiHooks:o,onResult:i})),[s,e,t,n,o,i]),p=d.useMemo(()=>{if(!(o!=null&&o.useBalance))return{balanceList:[],allowanceList:[],baseTokenBalance:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},combinedData:{}};const y=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"},N=s.map(T=>{const j=u[T.tokenAddress],_=j==null?void 0:j.balance,B=_==null?void 0:_.data;return{address:T.tokenAddress,value:(B==null?void 0:B.value)||BigInt(0),formatted:(B==null?void 0:B.formatted)||"0",decimals:(B==null?void 0:B.decimals)||T.decimals}}).filter(T=>T.address),I=s.map(T=>{const j=u[T.tokenAddress],_=j==null?void 0:j.allowance,B=_==null?void 0:_.data,W=BigInt(B?B.toString():0);return{address:T.tokenAddress,value:W,formatted:(W/BigInt(10)**BigInt(T.decimals)).toString(),decimals:T.decimals}}).filter(T=>T.address),w=N.reduce((T,j)=>{const _=I.find(B=>B.address===j.address);return{...T,[j.address]:{balance:j,allowance:_||{address:j.address,value:BigInt(0),formatted:"0",decimals:j.decimals}}}},{});return{balanceList:N,allowanceList:I,baseTokenBalance:y,combinedData:w}},[l,u,s,o==null?void 0:o.useBalance]),m=d.useCallback(async()=>p,[p]),f=d.useMemo(()=>{const y=(l==null?void 0:l.isLoading)||!1,N=Object.values(u).some(I=>{var w,T;return((w=I.balance)==null?void 0:w.isLoading)||((T=I.allowance)==null?void 0:T.isLoading)});return y||N},[l==null?void 0:l.isLoading,u]);return{multicallRun:m,multicallResult:p,validErcTokens:s,isLoading:f,queryComponents:c}},cd=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:s,currentEquity:u,platformBalance:a="0",wagmiHooks:i,approved:l,onApproved:c,onDeposit:p,onClose:m,onChainChange:f,onTokenChange:b})=>{var D;const[y,N]=d.useState(()=>{var F;return!e||e.length===0?1:t||((F=e[0])==null?void 0:F.chainId)||1}),[I,w]=d.useState(()=>{var G;if(!e||e.length===0)return"";const F=t||((G=e[0])==null?void 0:G.chainId),R=e.find(ee=>ee.chainId===F);if(!R||!R.tokenList||R.tokenList.length===0)return"";const U=R.tokenList.find(ee=>ee.tokenAddress===n)||R.tokenList[0];return(U==null?void 0:U.token)||""}),[T,j]=d.useState(r),_=d.useCallback(F=>{N(F),f==null||f(F)},[f]),B=d.useCallback(F=>{w(F),b==null||b(F)},[b]),W=d.useRef(!0),h=d.useRef(I),v=d.useRef(y);d.useEffect(()=>{if(W.current){W.current=!1,h.current=I,v.current=y;return}(h.current!==I||v.current!==y)&&(j(""),h.current=I,v.current=y)},[I,y]);const g=e&&e.length>0?e.find(F=>F.chainId===y)||e[0]:null,x=(D=g==null?void 0:g.tokenList)==null?void 0:D.find(F=>F.token===I),C=o==null?void 0:o.getDisplayAddress(),{multicallResult:A,queryComponents:P}=ms({account:C,chainId:y,contractAddress:void 0,tokens:(g==null?void 0:g.tokenList)||[],wagmiHooks:i}),S=d.useMemo(()=>{var R;if(!x)return;if(!x.tokenAddress||x.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return A.baseTokenBalance.formatted;const F=A.combinedData[x.tokenAddress];return((R=F==null?void 0:F.balance)==null?void 0:R.formatted)||"0"},[x,A]),$=l??!1,L=d.useMemo(()=>{const F=parseFloat(T||"0"),R=10,U=S||"0",G=Of(T,U,$);return!T||F===0?{text:"Confirm Deposit",disabled:!0}:$?F>parseFloat(U)?{text:"Insufficient Balance",disabled:!0}:F<R?{text:`Min Deposit ${R} ${I}`,disabled:!0}:{text:"Confirm Deposit",disabled:!G}:{text:"Confirm Deposit",disabled:!0}},[T,I,S,$]),E=d.useCallback(async()=>{p&&p({amount:T,chainId:y,tokenAddress:(x==null?void 0:x.tokenAddress)||"",tokenSymbol:I})},[p,T,y,x==null?void 0:x.tokenAddress,I]);return!(i!=null&&i.useBalance)||!(i!=null&&i.useReadContract)||!(i!=null&&i.useAccount)?M.jsxs("div",{className:"p-6 text-center",children:[M.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),M.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"No chains available"})}):g?M.jsxs(M.Fragment,{children:[P,M.jsx(wr,{currentActiveChain:g,chainList:e,onChainChange:_,curSelectToken:I,onTokenChange:B,walletType:"evm"}),M.jsx(ad,{depositAmount:T,curSelectToken:I,curSelectTokenData:{balance:x==null?void 0:x.balance,allowance:x==null?void 0:x.allowance},approved:$,currentActiveChain:g,currentEquity:u||0,amount:T,decimals:(x==null?void 0:x.decimals)||6,tokenBalance:S,platformBalance:a,onDepositAmountChange:j,onApprove:async()=>{c&&await c()}}),M.jsx("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors ${L.disabled?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:E,disabled:L.disabled,children:L.text})]}):M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"Loading..."})})},gs=({isOpen:e,onClose:t,config:n,currentActiveAccount:r=Cr,smartWallet:o=Sr,chains:s,defaultChainId:u,defaultTokenAddress:a,defaultAmount:i="",metadata:l=Or,currentEquity:c=5e3,platformBalance:p="0",wagmiHooks:m,approved:f,onApproved:b,onDeposit:y,onCopy:N,onChainChange:I,onTokenChange:w})=>{const T=d.useMemo(()=>{var _;return r?Yr(r,o,!1,(_=s[0])==null?void 0:_.chainId,"0","0"):null},[r,o,s]),j=(T==null?void 0:T.getWalletType())==="mpc";return e?xe.createPortal(M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{t()},"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:_=>{_.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:"Deposit"}),M.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:t,"aria-label":"Close",children:M.jsx(Hr,{className:"h-4 w-4"})})]}),j?M.jsx(id,{chains:s,defaultChainId:u,defaultTokenAddress:a,defaultAmount:i,walletAdapter:T,metadata:l,currentEquity:c,onDeposit:y,onCopy:N,onClose:t}):M.jsx(cd,{chains:s,defaultChainId:u,defaultTokenAddress:a,defaultAmount:i,walletAdapter:T,metadata:l,currentEquity:c,platformBalance:p,wagmiHooks:m,approved:f,onApproved:b,onDeposit:y,onClose:t,onChainChange:I,onTokenChange:w})]})})}),document.body):null};let Qe=null;const fd={symbol:"USDT"},vs=d.forwardRef((e,t)=>{const[n,r]=d.useState(!1),[o,s]=d.useState({chains:[]}),u=d.useCallback(c=>{s(c),r(!0)},[]),a=d.useCallback(c=>{s(p=>({...p,...c}))},[]),i=d.useCallback(()=>{r(!1),o.onClose&&o.onClose()},[o.onClose]),l=d.useCallback(()=>n,[n]);return d.useImperativeHandle(t,()=>({openDeposit:u,closeDeposit:i,updateDepositOptions:a,isOpen:l}),[u,i,a,l]),d.useEffect(()=>(Qe={openDeposit:u,closeDeposit:i,updateDepositOptions:a,isOpen:l},()=>{Qe=null}),[u,i,a,l]),M.jsx(gs,{isOpen:n,onClose:i,config:o.config||fd,currentActiveAccount:o.currentActiveAccount||Cr,smartWallet:o.smartWallet||Sr,chains:o.chains||$f,defaultChainId:o.defaultChainId,defaultTokenAddress:o.defaultTokenAddress,defaultAmount:o.defaultAmount,metadata:o.metadata||Or,currentEquity:o.currentEquity??5e3,platformBalance:o.platformBalance||"0",wagmiHooks:o.wagmiHooks,approved:o.approved,onApproved:o.onApproved,onDeposit:o.onDeposit,onCopy:o.onCopy,onChainChange:o.onChainChange,onTokenChange:o.onTokenChange})});vs.displayName="DepositManager";const bs=e=>{if(!Qe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Qe.openDeposit(e||{chains:[]})},ys=()=>{if(!Qe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Qe.closeDeposit()},xs=e=>{Qe&&Qe.updateDepositOptions(e)},dd=()=>Qe?Qe.isOpen():!1,pd=()=>({openDeposit:bs,closeDeposit:ys,updateDepositOptions:xs,isOpen:dd});d.createContext(null);const hd=({withdrawAmount:e,curSelectToken:t,currentActiveChain:n,platformBalance:r="0",walletType:o="evm",receiverAddress:s="",onWithdrawAmountChange:u,onReceiverAddressChange:a})=>{const i=p=>{const m=p.target.value,b=Er(m,r||"0");if(b.isValid)u(b.formattedValue),b.errorType;else return b.errorType==="exceed_balance",void 0},l=()=>{u(r)},c=()=>{const p=parseFloat(r||"0"),m=parseFloat(e||"0");if(m>0){const f=p-m,b=Ue(Math.max(0,f).toString());return`${Ue(r||"0")} → ${b} ${t}`}return`${Ue(r||"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:"Amount",value:e,onChange:i,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:l,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:"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("span",{className:"text-text-tertiary text-xs leading-[14px]",children:"Available"}),M.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:c()})]})]}),o==="mpc"&&!On(n==null?void 0:n.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:"Receiver Address",value:s,onChange:p=>a==null?void 0:a(p.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"})}),M.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:M.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this."})}),M.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[M.jsxs("div",{className:"flex items-center justify-between",children:[M.jsx("span",{className:"text-text-tertiary text-xs",children:"Speed"}),M.jsxs("div",{className:"flex items-center space-x-1",children:[M.jsx("span",{className:"text-theme-normal",children:"⚡"}),M.jsx("span",{className:"text-theme-normal",children:"⚡"}),M.jsx("span",{className:"text-theme-normal",children:"⚡"})]})]}),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:"Amount to receive"}),M.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Ue(e)," ",t]})]})]})]})},md=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:s,currentEquity:u,platformBalance:a="0",wagmiHooks:i,onWithdraw:l,onClose:c,onChainChange:p,onTokenChange:m})=>{var D;const[f,b]=d.useState(()=>{var F;return!e||e.length===0?1:t||((F=e[0])==null?void 0:F.chainId)||1}),[y,N]=d.useState(()=>{var G;if(!e||e.length===0)return"";const F=t||((G=e[0])==null?void 0:G.chainId),R=e.find(ee=>ee.chainId===F);if(!R||!R.tokenList||R.tokenList.length===0)return"";const U=R.tokenList.find(ee=>ee.tokenAddress===n)||R.tokenList[0];return(U==null?void 0:U.token)||""}),[I,w]=d.useState(r),[T,j]=d.useState(""),_=(o==null?void 0:o.getWalletType())||"evm",B=d.useCallback(F=>{b(F),p==null||p(F)},[p]),W=d.useCallback(F=>{N(F),m==null||m(F)},[m]),h=d.useRef(!0),v=d.useRef(y),g=d.useRef(f);d.useEffect(()=>{if(h.current){h.current=!1,v.current=y,g.current=f;return}(v.current!==y||g.current!==f)&&(w(""),v.current=y,g.current=f)},[y,f]);const x=e&&e.length>0?e.find(F=>F.chainId===f)||e[0]:null,C=(D=x==null?void 0:x.tokenList)==null?void 0:D.find(F=>F.token===y),A=o==null?void 0:o.getDisplayAddress(),{multicallResult:P,queryComponents:S}=ms({account:A,chainId:f,contractAddress:void 0,tokens:(x==null?void 0:x.tokenList)||[],wagmiHooks:i}),$=d.useMemo(()=>{var R;if(!C)return;if(!C.tokenAddress||C.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return P.baseTokenBalance.formatted;const F=P.combinedData[C.tokenAddress];return((R=F==null?void 0:F.balance)==null?void 0:R.formatted)||"0"},[C,P]),L=d.useMemo(()=>{const F=parseFloat(I||"0"),R=1,U=parseFloat(a||"0");return!I||F===0?{text:"Confirm Withdraw",disabled:!0}:_==="mpc"&&!On(f)&&!T.trim()?{text:"Enter Receiver Address",disabled:!0}:F>U?{text:"Insufficient Balance",disabled:!0}:F<R?{text:`Min Withdraw ${R} ${y}`,disabled:!0}:{text:"Confirm Withdraw",disabled:!1}},[I,y,a,_,T]),E=d.useCallback(async()=>{if(l){const F={amount:I,chainId:f,tokenAddress:(C==null?void 0:C.tokenAddress)||"",tokenSymbol:y};_==="mpc"&&!On(f)&&(F.receiverAddress=T),l(F)}},[l,I,f,C==null?void 0:C.tokenAddress,y,_,T]);return!(i!=null&&i.useBalance)||!(i!=null&&i.useReadContract)||!(i!=null&&i.useAccount)?M.jsxs("div",{className:"p-6 text-center",children:[M.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),M.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"No chains available"})}):x?M.jsxs(M.Fragment,{children:[S,M.jsx(wr,{currentActiveChain:x,chainList:e,onChainChange:B,curSelectToken:y,onTokenChange:W,walletType:"evm"}),M.jsx(hd,{withdrawAmount:I,curSelectToken:y,curSelectTokenData:{balance:C==null?void 0:C.balance,allowance:C==null?void 0:C.allowance},currentActiveChain:x,currentEquity:u||0,amount:I,decimals:(C==null?void 0:C.decimals)||6,tokenBalance:$,platformBalance:a,walletType:_,receiverAddress:T,onWithdrawAmountChange:w,onReceiverAddressChange:j}),M.jsx("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors ${L.disabled?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:E,disabled:L.disabled,children:L.text})]}):M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"Loading..."})})},ws=({isOpen:e,onClose:t,config:n,currentActiveAccount:r=Cr,smartWallet:o=Sr,chains:s,defaultChainId:u,defaultTokenAddress:a,defaultAmount:i="",metadata:l=Or,currentEquity:c=5e3,platformBalance:p="0",wagmiHooks:m,onWithdraw:f,onChainChange:b,onTokenChange:y})=>{const N=d.useMemo(()=>{var I;return r?Yr(r,o,!1,(I=s[0])==null?void 0:I.chainId,"0","0"):null},[r,o,s]);return e?xe.createPortal(M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{t()},"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:I=>{I.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:"Withdraw"}),M.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:t,"aria-label":"Close",children:M.jsx(Hr,{className:"h-4 w-4"})})]}),M.jsx(md,{chains:s,defaultChainId:u,defaultTokenAddress:a,defaultAmount:i,walletAdapter:N,metadata:l,currentEquity:c,platformBalance:p,wagmiHooks:m,onWithdraw:f,onClose:t,onChainChange:b,onTokenChange:y})]})})}),document.body):null},gd=[],vd={};let Xe=null;const Es=d.forwardRef((e,t)=>{const[n,r]=d.useState(!1),[o,s]=d.useState({chains:[]}),u=d.useCallback(c=>{s(c||{chains:[]}),r(!0)},[]),a=d.useCallback(c=>{s(p=>({...p,...c}))},[]),i=d.useCallback(()=>{r(!1),o.onClose&&o.onClose()},[o.onClose]),l=d.useCallback(()=>n,[n]);return d.useImperativeHandle(t,()=>({openWithdraw:u,closeWithdraw:i,updateWithdrawOptions:a,isOpen:l}),[u,i,a,l]),d.useEffect(()=>(Xe={openWithdraw:u,closeWithdraw:i,updateWithdrawOptions:a,isOpen:l},()=>{Xe=null}),[u,i,a,l]),M.jsx(ws,{isOpen:n,onClose:i,config:o.config||{symbol:"USDT"},currentActiveAccount:o.currentActiveAccount,smartWallet:o.smartWallet,chains:o.chains||gd,defaultChainId:o.defaultChainId,defaultTokenAddress:o.defaultTokenAddress,defaultAmount:o.defaultAmount,metadata:o.metadata||vd,currentEquity:o.currentEquity??5e3,platformBalance:o.platformBalance||"0",wagmiHooks:o.wagmiHooks,onWithdraw:o.onWithdraw,onChainChange:o.onChainChange,onTokenChange:o.onTokenChange})});Es.displayName="WithdrawManager";const Cs=e=>{if(!Xe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Xe.openWithdraw(e||{chains:[]})},Ss=()=>{if(!Xe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Xe.closeWithdraw()},Os=e=>{if(!Xe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Xe.updateWithdrawOptions(e)},bd=()=>Xe?Xe.isOpen():!1,yd=()=>({openWithdraw:Cs,closeWithdraw:Ss,updateWithdrawOptions:Os,isOpen:bd});oe.ComponentProvider=Hs,oe.Deposit=gs,oe.DepositManager=vs,oe.Withdraw=ws,oe.WithdrawManager=Es,oe.closeDeposit=ys,oe.closeWithdraw=Ss,oe.openDeposit=bs,oe.openWithdraw=Cs,oe.updateDepositOptions=xs,oe.updateWithdrawOptions=Os,oe.useDeposit=Gs,oe.useDepositManager=pd,oe.useWithdraw=Ys,oe.useWithdrawManager=yd,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});
|
|
103
|
+
*/var Qf={L:$t.QrCode.Ecc.LOW,M:$t.QrCode.Ecc.MEDIUM,Q:$t.QrCode.Ecc.QUARTILE,H:$t.QrCode.Ecc.HIGH},ts=128,ns="L",rs="#FFFFFF",os="#000000",is=!1,ss=1,Xf=4,Jf=0,Zf=.1;function ls(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(u,a){if(!u&&s!==null){n.push(`M${s+t} ${o+t}h${a-s}v1H${s+t}z`),s=null;return}if(a===r.length-1){if(!u)return;s===null?n.push(`M${a+t},${o+t} h1v1H${a+t}z`):n.push(`M${s+t},${o+t} h${a+1-s}v1H${s+t}z`);return}u&&s===null&&(s=a)})}),n.join("")}function as(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function ed(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*Zf),u=o/t,a=(r.width||s)*u,i=(r.height||s)*u,l=r.x==null?e.length/2-a/2:r.x*u,c=r.y==null?e.length/2-i/2:r.y*u,p=r.opacity==null?1:r.opacity;let m=null;if(r.excavate){let b=Math.floor(l),y=Math.floor(c),N=Math.ceil(a+l-b),I=Math.ceil(i+c-y);m={x:b,y,w:N,h:I}}const f=r.crossOrigin;return{x:l,y:c,h:i,w:a,excavation:m,opacity:p,crossOrigin:f}}function td(e,t){return t!=null?Math.max(Math.floor(t),0):e?Xf:Jf}function us({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:u,boostLevel:a}){let i=d.useMemo(()=>{const b=(Array.isArray(e)?e:[e]).reduce((y,N)=>(y.push(...$t.QrSegment.makeSegments(N)),y),[]);return $t.QrCode.encodeSegments(b,Qf[t],n,void 0,void 0,a)},[e,t,n,a]);const{cells:l,margin:c,numCells:p,calculatedImageSettings:m}=d.useMemo(()=>{let f=i.getModules();const b=td(r,o),y=f.length+b*2,N=ed(f,u,b,s);return{cells:f,margin:b,numCells:y,calculatedImageSettings:N}},[i,u,s,r,o]);return{qrcode:i,margin:c,cells:l,numCells:p,calculatedImageSettings:m}}var nd=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),rd=d.forwardRef(function(t,n){const r=t,{value:o,size:s=ts,level:u=ns,bgColor:a=rs,fgColor:i=os,includeMargin:l=is,minVersion:c=ss,boostLevel:p,marginSize:m,imageSettings:f}=r,y=Mr(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:N}=y,I=Mr(y,["style"]),w=f==null?void 0:f.src,T=d.useRef(null),j=d.useRef(null),_=d.useCallback(P=>{T.current=P,typeof n=="function"?n(P):n&&(n.current=P)},[n]),[B,W]=d.useState(!1),{margin:h,cells:v,numCells:g,calculatedImageSettings:x}=us({value:o,level:u,minVersion:c,boostLevel:p,includeMargin:l,marginSize:m,imageSettings:f,size:s});d.useEffect(()=>{if(T.current!=null){const P=T.current,S=P.getContext("2d");if(!S)return;let $=v;const L=j.current,E=x!=null&&L!==null&&L.complete&&L.naturalHeight!==0&&L.naturalWidth!==0;E&&x.excavation!=null&&($=as(v,x.excavation));const D=window.devicePixelRatio||1;P.height=P.width=s*D;const F=s/g*D;S.scale(F,F),S.fillStyle=a,S.fillRect(0,0,g,g),S.fillStyle=i,nd?S.fill(new Path2D(ls($,h))):v.forEach(function(R,U){R.forEach(function(G,ee){G&&S.fillRect(ee+h,U+h,1,1)})}),x&&(S.globalAlpha=x.opacity),E&&S.drawImage(L,x.x+h,x.y+h,x.w,x.h)}}),d.useEffect(()=>{W(!1)},[w]);const C=Pr({height:s,width:s},N);let A=null;return w!=null&&(A=d.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{W(!0)},ref:j,crossOrigin:x==null?void 0:x.crossOrigin})),d.createElement(d.Fragment,null,d.createElement("canvas",Pr({style:C,height:s,width:s,ref:_,role:"img"},I)),A)});rd.displayName="QRCodeCanvas";var cs=d.forwardRef(function(t,n){const r=t,{value:o,size:s=ts,level:u=ns,bgColor:a=rs,fgColor:i=os,includeMargin:l=is,minVersion:c=ss,boostLevel:p,title:m,marginSize:f,imageSettings:b}=r,y=Mr(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:N,cells:I,numCells:w,calculatedImageSettings:T}=us({value:o,level:u,minVersion:c,boostLevel:p,includeMargin:l,marginSize:f,imageSettings:b,size:s});let j=I,_=null;b!=null&&T!=null&&(T.excavation!=null&&(j=as(I,T.excavation)),_=d.createElement("image",{href:b.src,height:T.h,width:T.w,x:T.x+N,y:T.y+N,preserveAspectRatio:"none",opacity:T.opacity,crossOrigin:T.crossOrigin}));const B=ls(j,N);return d.createElement("svg",Pr({height:s,width:s,viewBox:`0 0 ${w} ${w}`,ref:n,role:"img"},y),!!m&&d.createElement("title",null,m),d.createElement("path",{fill:a,d:`M0,0 h${w}v${w}H0z`,shapeRendering:"crispEdges"}),d.createElement("path",{fill:i,d:B,shapeRendering:"crispEdges"}),_)});cs.displayName="QRCodeSVG";const fs="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=",od=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r,onCopy:o})=>{var u;const s=d.useMemo(()=>Nf(n||{}),[n]);return M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"flex justify-center mt-4 mb-3",children:M.jsx("div",{className:"bg-white rounded-lg",children:M.jsx(cs,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),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:e==null?void 0:e.getDisplayAddress()}),M.jsx(Kf,{onCopy:()=>{const a=(e==null?void 0:e.getDisplayAddress())||"";o&&o(a)},text:e==null?void 0:e.getDisplayAddress(),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:fs,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1",children:M.jsxs("p",{className:"text-xs text-functional-orange-1",children:["Only ",t," (",n==null?void 0:n.chain,") is supported for deposits to this address."]})})]}),s&&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:"When the deposit amount exceeds 250,000, there may be a delay in arrival. It is recommended to use the Ethereum network for deposits."})]})]}),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:"Arrival Time"}),M.jsxs("span",{className:"text-text-primary font-medium text-right underline decoration-dotted underline-offset-1",children:["≈"," ",Math.ceil(((n==null?void 0:n.blockTime)||12)*((n==null?void 0:n.txConfirm)||12)/60)," ","minutes"]})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[M.jsx("span",{className:"text-text-tertiary",children:"Minimum Deposit Amount"}),M.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((u=r==null?void 0:r.multiChain)==null?void 0:u.minDeposit)||10," ",t]})]}),M.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[M.jsx("span",{className:"text-text-tertiary",children:"Maximum Deposit Amount"}),M.jsxs("span",{className:"text-text-primary font-medium text-right",children:["250,000 ",t]})]})]})]})},id=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:s,onCopy:u,onClose:a})=>{var b;const[i,l]=d.useState(()=>{var y;return!e||e.length===0?1:t||((y=e[0])==null?void 0:y.chainId)||1}),[c,p]=d.useState(()=>{var w;if(!e||e.length===0)return"";const y=t||((w=e[0])==null?void 0:w.chainId),N=e.find(T=>T.chainId===y);if(!N||!N.tokenList||N.tokenList.length===0)return"";const I=N.tokenList.find(T=>T.tokenAddress===n)||N.tokenList[0];return(I==null?void 0:I.token)||""}),m=e&&e.length>0?e.find(y=>y.chainId===i)||e[0]:null,f=(b=m==null?void 0:m.tokenList)==null?void 0:b.find(y=>y.token===c);return!e||e.length===0?M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"No chains available"})}):m?M.jsxs(M.Fragment,{children:[M.jsx(wr,{currentActiveChain:m,chainList:e,onChainChange:l,curSelectToken:c,onTokenChange:p,walletType:"mpc"}),M.jsx(od,{walletAdapter:r,curSelectToken:c,currentActiveChain:m,metadata:o,onCopy:u}),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:()=>{s&&s({amount:"",chainId:i,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:c}),a()},children:"Deposit"})]}):M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"Loading..."})})};var sd=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Lr=Math.ceil,Ie=Math.floor,Ce="[BigNumber Error] ",ds=Ce+"Number primitive has more than 15 significant digits: ",Ve=1e14,K=14,Ir=9007199254740991,Dr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ut=1e7,ge=1e9;function ps(e){var t,n,r,o=w.prototype={constructor:w,toString:null,valueOf:null},s=new w(1),u=20,a=4,i=-7,l=21,c=-1e7,p=1e7,m=!1,f=1,b=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},N="0123456789abcdefghijklmnopqrstuvwxyz",I=!0;function w(h,v){var g,x,C,A,P,S,$,L,E=this;if(!(E instanceof w))return new w(h,v);if(v==null){if(h&&h._isBigNumber===!0){E.s=h.s,!h.c||h.e>p?E.c=E.e=null:h.e<c?E.c=[E.e=0]:(E.e=h.e,E.c=h.c.slice());return}if((S=typeof h=="number")&&h*0==0){if(E.s=1/h<0?(h=-h,-1):1,h===~~h){for(A=0,P=h;P>=10;P/=10,A++);A>p?E.c=E.e=null:(E.e=A,E.c=[h]);return}L=String(h)}else{if(!sd.test(L=String(h)))return r(E,L,S);E.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(A=L.indexOf("."))>-1&&(L=L.replace(".","")),(P=L.search(/e/i))>0?(A<0&&(A=P),A+=+L.slice(P+1),L=L.substring(0,P)):A<0&&(A=L.length)}else{if(ue(v,2,N.length,"Base"),v==10&&I)return E=new w(h),B(E,u+E.e+1,a);if(L=String(h),S=typeof h=="number"){if(h*0!=0)return r(E,L,S,v);if(E.s=1/h<0?(L=L.slice(1),-1):1,w.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(ds+h)}else E.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(g=N.slice(0,v),A=P=0,$=L.length;P<$;P++)if(g.indexOf(x=L.charAt(P))<0){if(x=="."){if(P>A){A=$;continue}}else if(!C&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){C=!0,P=-1,A=0;continue}return r(E,String(h),S,v)}S=!1,L=n(L,v,10,E.s),(A=L.indexOf("."))>-1?L=L.replace(".",""):A=L.length}for(P=0;L.charCodeAt(P)===48;P++);for($=L.length;L.charCodeAt(--$)===48;);if(L=L.slice(P,++$)){if($-=P,S&&w.DEBUG&&$>15&&(h>Ir||h!==Ie(h)))throw Error(ds+E.s*h);if((A=A-P-1)>p)E.c=E.e=null;else if(A<c)E.c=[E.e=0];else{if(E.e=A,E.c=[],P=(A+1)%K,A<0&&(P+=K),P<$){for(P&&E.c.push(+L.slice(0,P)),$-=K;P<$;)E.c.push(+L.slice(P,P+=K));P=K-(L=L.slice(P)).length}else P-=$;for(;P--;L+="0");E.c.push(+L)}}else E.c=[E.e=0]}w.clone=ps,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(h){var v,g;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(v="DECIMAL_PLACES")&&(g=h[v],ue(g,0,ge,v),u=g),h.hasOwnProperty(v="ROUNDING_MODE")&&(g=h[v],ue(g,0,8,v),a=g),h.hasOwnProperty(v="EXPONENTIAL_AT")&&(g=h[v],g&&g.pop?(ue(g[0],-ge,0,v),ue(g[1],0,ge,v),i=g[0],l=g[1]):(ue(g,-ge,ge,v),i=-(l=g<0?-g:g))),h.hasOwnProperty(v="RANGE"))if(g=h[v],g&&g.pop)ue(g[0],-ge,-1,v),ue(g[1],1,ge,v),c=g[0],p=g[1];else if(ue(g,-ge,ge,v),g)c=-(p=g<0?-g:g);else throw Error(Ce+v+" cannot be zero: "+g);if(h.hasOwnProperty(v="CRYPTO"))if(g=h[v],g===!!g)if(g)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))m=g;else throw m=!g,Error(Ce+"crypto unavailable");else m=g;else throw Error(Ce+v+" not true or false: "+g);if(h.hasOwnProperty(v="MODULO_MODE")&&(g=h[v],ue(g,0,9,v),f=g),h.hasOwnProperty(v="POW_PRECISION")&&(g=h[v],ue(g,0,ge,v),b=g),h.hasOwnProperty(v="FORMAT"))if(g=h[v],typeof g=="object")y=g;else throw Error(Ce+v+" not an object: "+g);if(h.hasOwnProperty(v="ALPHABET"))if(g=h[v],typeof g=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(g))I=g.slice(0,10)=="0123456789",N=g;else throw Error(Ce+v+" invalid: "+g)}else throw Error(Ce+"Object expected: "+h);return{DECIMAL_PLACES:u,ROUNDING_MODE:a,EXPONENTIAL_AT:[i,l],RANGE:[c,p],CRYPTO:m,MODULO_MODE:f,POW_PRECISION:b,FORMAT:y,ALPHABET:N}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var v,g,x=h.c,C=h.e,A=h.s;e:if({}.toString.call(x)=="[object Array]"){if((A===1||A===-1)&&C>=-ge&&C<=ge&&C===Ie(C)){if(x[0]===0){if(C===0&&x.length===1)return!0;break e}if(v=(C+1)%K,v<1&&(v+=K),String(x[0]).length==v){for(v=0;v<x.length;v++)if(g=x[v],g<0||g>=Ve||g!==Ie(g))break e;if(g!==0)return!0}}}else if(x===null&&C===null&&(A===null||A===1||A===-1))return!0;throw Error(Ce+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return j(arguments,-1)},w.minimum=w.min=function(){return j(arguments,1)},w.random=function(){var h=9007199254740992,v=Math.random()*h&2097151?function(){return Ie(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(g){var x,C,A,P,S,$=0,L=[],E=new w(s);if(g==null?g=u:ue(g,0,ge),P=Lr(g/K),m)if(crypto.getRandomValues){for(x=crypto.getRandomValues(new Uint32Array(P*=2));$<P;)S=x[$]*131072+(x[$+1]>>>11),S>=9e15?(C=crypto.getRandomValues(new Uint32Array(2)),x[$]=C[0],x[$+1]=C[1]):(L.push(S%1e14),$+=2);$=P/2}else if(crypto.randomBytes){for(x=crypto.randomBytes(P*=7);$<P;)S=(x[$]&31)*281474976710656+x[$+1]*1099511627776+x[$+2]*4294967296+x[$+3]*16777216+(x[$+4]<<16)+(x[$+5]<<8)+x[$+6],S>=9e15?crypto.randomBytes(7).copy(x,$):(L.push(S%1e14),$+=7);$=P/7}else throw m=!1,Error(Ce+"crypto unavailable");if(!m)for(;$<P;)S=v(),S<9e15&&(L[$++]=S%1e14);for(P=L[--$],g%=K,P&&g&&(S=Dr[K-g],L[$]=Ie(P/S)*S);L[$]===0;L.pop(),$--);if($<0)L=[A=0];else{for(A=-1;L[0]===0;L.splice(0,1),A-=K);for($=1,S=L[0];S>=10;S/=10,$++);$<K&&(A-=K-$)}return E.e=A,E.c=L,E}}(),w.sum=function(){for(var h=1,v=arguments,g=new w(v[0]);h<v.length;)g=g.plus(v[h++]);return g},n=function(){var h="0123456789";function v(g,x,C,A){for(var P,S=[0],$,L=0,E=g.length;L<E;){for($=S.length;$--;S[$]*=x);for(S[0]+=A.indexOf(g.charAt(L++)),P=0;P<S.length;P++)S[P]>C-1&&(S[P+1]==null&&(S[P+1]=0),S[P+1]+=S[P]/C|0,S[P]%=C)}return S.reverse()}return function(g,x,C,A,P){var S,$,L,E,D,F,R,U,G=g.indexOf("."),ee=u,q=a;for(G>=0&&(E=b,b=0,g=g.replace(".",""),U=new w(x),F=U.pow(g.length-G),b=E,U.c=v(tt(Fe(F.c),F.e,"0"),10,C,h),U.e=U.c.length),R=v(g,x,C,P?(S=N,h):(S=h,N)),L=E=R.length;R[--E]==0;R.pop());if(!R[0])return S.charAt(0);if(G<0?--L:(F.c=R,F.e=L,F.s=A,F=t(F,U,ee,q,C),R=F.c,D=F.r,L=F.e),$=L+ee+1,G=R[$],E=C/2,D=D||$<0||R[$+1]!=null,D=q<4?(G!=null||D)&&(q==0||q==(F.s<0?3:2)):G>E||G==E&&(q==4||D||q==6&&R[$-1]&1||q==(F.s<0?8:7)),$<1||!R[0])g=D?tt(S.charAt(1),-ee,S.charAt(0)):S.charAt(0);else{if(R.length=$,D)for(--C;++R[--$]>C;)R[$]=0,$||(++L,R=[1].concat(R));for(E=R.length;!R[--E];);for(G=0,g="";G<=E;g+=S.charAt(R[G++]));g=tt(g,L,S.charAt(0))}return g}}(),t=function(){function h(x,C,A){var P,S,$,L,E=0,D=x.length,F=C%ut,R=C/ut|0;for(x=x.slice();D--;)$=x[D]%ut,L=x[D]/ut|0,P=R*$+L*F,S=F*$+P%ut*ut+E,E=(S/A|0)+(P/ut|0)+R*L,x[D]=S%A;return E&&(x=[E].concat(x)),x}function v(x,C,A,P){var S,$;if(A!=P)$=A>P?1:-1;else for(S=$=0;S<A;S++)if(x[S]!=C[S]){$=x[S]>C[S]?1:-1;break}return $}function g(x,C,A,P){for(var S=0;A--;)x[A]-=S,S=x[A]<C[A]?1:0,x[A]=S*P+x[A]-C[A];for(;!x[0]&&x.length>1;x.splice(0,1));}return function(x,C,A,P,S){var $,L,E,D,F,R,U,G,ee,q,X,z,re,de,_e,je,ct,Se=x.s==C.s?1:-1,ve=x.c,ie=C.c;if(!ve||!ve[0]||!ie||!ie[0])return new w(!x.s||!C.s||(ve?ie&&ve[0]==ie[0]:!ie)?NaN:ve&&ve[0]==0||!ie?Se*0:Se/0);for(G=new w(Se),ee=G.c=[],L=x.e-C.e,Se=A+L+1,S||(S=Ve,L=De(x.e/K)-De(C.e/K),Se=Se/K|0),E=0;ie[E]==(ve[E]||0);E++);if(ie[E]>(ve[E]||0)&&L--,Se<0)ee.push(1),D=!0;else{for(de=ve.length,je=ie.length,E=0,Se+=2,F=Ie(S/(ie[0]+1)),F>1&&(ie=h(ie,F,S),ve=h(ve,F,S),je=ie.length,de=ve.length),re=je,q=ve.slice(0,je),X=q.length;X<je;q[X++]=0);ct=ie.slice(),ct=[0].concat(ct),_e=ie[0],ie[1]>=S/2&&_e++;do{if(F=0,$=v(ie,q,je,X),$<0){if(z=q[0],je!=X&&(z=z*S+(q[1]||0)),F=Ie(z/_e),F>1)for(F>=S&&(F=S-1),R=h(ie,F,S),U=R.length,X=q.length;v(R,q,U,X)==1;)F--,g(R,je<U?ct:ie,U,S),U=R.length,$=1;else F==0&&($=F=1),R=ie.slice(),U=R.length;if(U<X&&(R=[0].concat(R)),g(q,R,X,S),X=q.length,$==-1)for(;v(ie,q,je,X)<1;)F++,g(q,je<X?ct:ie,X,S),X=q.length}else $===0&&(F++,q=[0]);ee[E++]=F,q[0]?q[X++]=ve[re]||0:(q=[ve[re]],X=1)}while((re++<de||q[0]!=null)&&Se--);D=q[0]!=null,ee[0]||ee.splice(0,1)}if(S==Ve){for(E=1,Se=ee[0];Se>=10;Se/=10,E++);B(G,A+(G.e=E+L*K-1)+1,P,D)}else G.e=L,G.r=+D;return G}}();function T(h,v,g,x){var C,A,P,S,$;if(g==null?g=a:ue(g,0,8),!h.c)return h.toString();if(C=h.c[0],P=h.e,v==null)$=Fe(h.c),$=x==1||x==2&&(P<=i||P>=l)?Sn($,P):tt($,P,"0");else if(h=B(new w(h),v,g),A=h.e,$=Fe(h.c),S=$.length,x==1||x==2&&(v<=A||A<=i)){for(;S<v;$+="0",S++);$=Sn($,A)}else if(v-=P+(x===2&&A>P),$=tt($,A,"0"),A+1>S){if(--v>0)for($+=".";v--;$+="0");}else if(v+=A-S,v>0)for(A+1==S&&($+=".");v--;$+="0");return h.s<0&&C?"-"+$:$}function j(h,v){for(var g,x,C=1,A=new w(h[0]);C<h.length;C++)x=new w(h[C]),(!x.s||(g=bt(A,x))===v||g===0&&A.s===v)&&(A=x);return A}function _(h,v,g){for(var x=1,C=v.length;!v[--C];v.pop());for(C=v[0];C>=10;C/=10,x++);return(g=x+g*K-1)>p?h.c=h.e=null:g<c?h.c=[h.e=0]:(h.e=g,h.c=v),h}r=function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,v=/^([^.]+)\.$/,g=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(A,P,S,$){var L,E=S?P:P.replace(C,"");if(x.test(E))A.s=isNaN(E)?null:E<0?-1:1;else{if(!S&&(E=E.replace(h,function(D,F,R){return L=(R=R.toLowerCase())=="x"?16:R=="b"?2:8,!$||$==L?F:D}),$&&(L=$,E=E.replace(v,"$1").replace(g,"0.$1")),P!=E))return new w(E,L);if(w.DEBUG)throw Error(Ce+"Not a"+($?" base "+$:"")+" number: "+P);A.s=null}A.c=A.e=null}}();function B(h,v,g,x){var C,A,P,S,$,L,E,D=h.c,F=Dr;if(D){e:{for(C=1,S=D[0];S>=10;S/=10,C++);if(A=v-C,A<0)A+=K,P=v,$=D[L=0],E=Ie($/F[C-P-1]%10);else if(L=Lr((A+1)/K),L>=D.length)if(x){for(;D.length<=L;D.push(0));$=E=0,C=1,A%=K,P=A-K+1}else break e;else{for($=S=D[L],C=1;S>=10;S/=10,C++);A%=K,P=A-K+C,E=P<0?0:Ie($/F[C-P-1]%10)}if(x=x||v<0||D[L+1]!=null||(P<0?$:$%F[C-P-1]),x=g<4?(E||x)&&(g==0||g==(h.s<0?3:2)):E>5||E==5&&(g==4||x||g==6&&(A>0?P>0?$/F[C-P]:0:D[L-1])%10&1||g==(h.s<0?8:7)),v<1||!D[0])return D.length=0,x?(v-=h.e+1,D[0]=F[(K-v%K)%K],h.e=-v||0):D[0]=h.e=0,h;if(A==0?(D.length=L,S=1,L--):(D.length=L+1,S=F[K-A],D[L]=P>0?Ie($/F[C-P]%F[P])*S:0),x)for(;;)if(L==0){for(A=1,P=D[0];P>=10;P/=10,A++);for(P=D[0]+=S,S=1;P>=10;P/=10,S++);A!=S&&(h.e++,D[0]==Ve&&(D[0]=1));break}else{if(D[L]+=S,D[L]!=Ve)break;D[L--]=0,S=1}for(A=D.length;D[--A]===0;D.pop());}h.e>p?h.c=h.e=null:h.e<c&&(h.c=[h.e=0])}return h}function W(h){var v,g=h.e;return g===null?h.toString():(v=Fe(h.c),v=g<=i||g>=l?Sn(v,g):tt(v,g,"0"),h.s<0?"-"+v:v)}return o.absoluteValue=o.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},o.comparedTo=function(h,v){return bt(this,new w(h,v))},o.decimalPlaces=o.dp=function(h,v){var g,x,C,A=this;if(h!=null)return ue(h,0,ge),v==null?v=a:ue(v,0,8),B(new w(A),h+A.e+1,v);if(!(g=A.c))return null;if(x=((C=g.length-1)-De(this.e/K))*K,C=g[C])for(;C%10==0;C/=10,x--);return x<0&&(x=0),x},o.dividedBy=o.div=function(h,v){return t(this,new w(h,v),u,a)},o.dividedToIntegerBy=o.idiv=function(h,v){return t(this,new w(h,v),0,1)},o.exponentiatedBy=o.pow=function(h,v){var g,x,C,A,P,S,$,L,E,D=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Ce+"Exponent not an integer: "+W(h));if(v!=null&&(v=new w(v)),S=h.e>14,!D.c||!D.c[0]||D.c[0]==1&&!D.e&&D.c.length==1||!h.c||!h.c[0])return E=new w(Math.pow(+W(D),S?h.s*(2-Cn(h)):+W(h))),v?E.mod(v):E;if($=h.s<0,v){if(v.c?!v.c[0]:!v.s)return new w(NaN);x=!$&&D.isInteger()&&v.isInteger(),x&&(D=D.mod(v))}else{if(h.e>9&&(D.e>0||D.e<-1||(D.e==0?D.c[0]>1||S&&D.c[1]>=24e7:D.c[0]<8e13||S&&D.c[0]<=9999975e7)))return A=D.s<0&&Cn(h)?-0:0,D.e>-1&&(A=1/A),new w($?1/A:A);b&&(A=Lr(b/K+2))}for(S?(g=new w(.5),$&&(h.s=1),L=Cn(h)):(C=Math.abs(+W(h)),L=C%2),E=new w(s);;){if(L){if(E=E.times(D),!E.c)break;A?E.c.length>A&&(E.c.length=A):x&&(E=E.mod(v))}if(C){if(C=Ie(C/2),C===0)break;L=C%2}else if(h=h.times(g),B(h,h.e+1,1),h.e>14)L=Cn(h);else{if(C=+W(h),C===0)break;L=C%2}D=D.times(D),A?D.c&&D.c.length>A&&(D.c.length=A):x&&(D=D.mod(v))}return x?E:($&&(E=s.div(E)),v?E.mod(v):A?B(E,b,a,P):E)},o.integerValue=function(h){var v=new w(this);return h==null?h=a:ue(h,0,8),B(v,v.e+1,h)},o.isEqualTo=o.eq=function(h,v){return bt(this,new w(h,v))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(h,v){return bt(this,new w(h,v))>0},o.isGreaterThanOrEqualTo=o.gte=function(h,v){return(v=bt(this,new w(h,v)))===1||v===0},o.isInteger=function(){return!!this.c&&De(this.e/K)>this.c.length-2},o.isLessThan=o.lt=function(h,v){return bt(this,new w(h,v))<0},o.isLessThanOrEqualTo=o.lte=function(h,v){return(v=bt(this,new w(h,v)))===-1||v===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(h,v){var g,x,C,A,P=this,S=P.s;if(h=new w(h,v),v=h.s,!S||!v)return new w(NaN);if(S!=v)return h.s=-v,P.plus(h);var $=P.e/K,L=h.e/K,E=P.c,D=h.c;if(!$||!L){if(!E||!D)return E?(h.s=-v,h):new w(D?P:NaN);if(!E[0]||!D[0])return D[0]?(h.s=-v,h):new w(E[0]?P:a==3?-0:0)}if($=De($),L=De(L),E=E.slice(),S=$-L){for((A=S<0)?(S=-S,C=E):(L=$,C=D),C.reverse(),v=S;v--;C.push(0));C.reverse()}else for(x=(A=(S=E.length)<(v=D.length))?S:v,S=v=0;v<x;v++)if(E[v]!=D[v]){A=E[v]<D[v];break}if(A&&(C=E,E=D,D=C,h.s=-h.s),v=(x=D.length)-(g=E.length),v>0)for(;v--;E[g++]=0);for(v=Ve-1;x>S;){if(E[--x]<D[x]){for(g=x;g&&!E[--g];E[g]=v);--E[g],E[x]+=Ve}E[x]-=D[x]}for(;E[0]==0;E.splice(0,1),--L);return E[0]?_(h,E,L):(h.s=a==3?-1:1,h.c=[h.e=0],h)},o.modulo=o.mod=function(h,v){var g,x,C=this;return h=new w(h,v),!C.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||C.c&&!C.c[0]?new w(C):(f==9?(x=h.s,h.s=1,g=t(C,h,0,3),h.s=x,g.s*=x):g=t(C,h,0,f),h=C.minus(g.times(h)),!h.c[0]&&f==1&&(h.s=C.s),h)},o.multipliedBy=o.times=function(h,v){var g,x,C,A,P,S,$,L,E,D,F,R,U,G,ee,q=this,X=q.c,z=(h=new w(h,v)).c;if(!X||!z||!X[0]||!z[0])return!q.s||!h.s||X&&!X[0]&&!z||z&&!z[0]&&!X?h.c=h.e=h.s=null:(h.s*=q.s,!X||!z?h.c=h.e=null:(h.c=[0],h.e=0)),h;for(x=De(q.e/K)+De(h.e/K),h.s*=q.s,$=X.length,D=z.length,$<D&&(U=X,X=z,z=U,C=$,$=D,D=C),C=$+D,U=[];C--;U.push(0));for(G=Ve,ee=ut,C=D;--C>=0;){for(g=0,F=z[C]%ee,R=z[C]/ee|0,P=$,A=C+P;A>C;)L=X[--P]%ee,E=X[P]/ee|0,S=R*L+E*F,L=F*L+S%ee*ee+U[A]+g,g=(L/G|0)+(S/ee|0)+R*E,U[A--]=L%G;U[A]=g}return g?++x:U.splice(0,1),_(h,U,x)},o.negated=function(){var h=new w(this);return h.s=-h.s||null,h},o.plus=function(h,v){var g,x=this,C=x.s;if(h=new w(h,v),v=h.s,!C||!v)return new w(NaN);if(C!=v)return h.s=-v,x.minus(h);var A=x.e/K,P=h.e/K,S=x.c,$=h.c;if(!A||!P){if(!S||!$)return new w(C/0);if(!S[0]||!$[0])return $[0]?h:new w(S[0]?x:C*0)}if(A=De(A),P=De(P),S=S.slice(),C=A-P){for(C>0?(P=A,g=$):(C=-C,g=S),g.reverse();C--;g.push(0));g.reverse()}for(C=S.length,v=$.length,C-v<0&&(g=$,$=S,S=g,v=C),C=0;v;)C=(S[--v]=S[v]+$[v]+C)/Ve|0,S[v]=Ve===S[v]?0:S[v]%Ve;return C&&(S=[C].concat(S),++P),_(h,S,P)},o.precision=o.sd=function(h,v){var g,x,C,A=this;if(h!=null&&h!==!!h)return ue(h,1,ge),v==null?v=a:ue(v,0,8),B(new w(A),h,v);if(!(g=A.c))return null;if(C=g.length-1,x=C*K+1,C=g[C]){for(;C%10==0;C/=10,x--);for(C=g[0];C>=10;C/=10,x++);}return h&&A.e+1>x&&(x=A.e+1),x},o.shiftedBy=function(h){return ue(h,-Ir,Ir),this.times("1e"+h)},o.squareRoot=o.sqrt=function(){var h,v,g,x,C,A=this,P=A.c,S=A.s,$=A.e,L=u+4,E=new w("0.5");if(S!==1||!P||!P[0])return new w(!S||S<0&&(!P||P[0])?NaN:P?A:1/0);if(S=Math.sqrt(+W(A)),S==0||S==1/0?(v=Fe(P),(v.length+$)%2==0&&(v+="0"),S=Math.sqrt(+v),$=De(($+1)/2)-($<0||$%2),S==1/0?v="5e"+$:(v=S.toExponential(),v=v.slice(0,v.indexOf("e")+1)+$),g=new w(v)):g=new w(S+""),g.c[0]){for($=g.e,S=$+L,S<3&&(S=0);;)if(C=g,g=E.times(C.plus(t(A,C,L,1))),Fe(C.c).slice(0,S)===(v=Fe(g.c)).slice(0,S))if(g.e<$&&--S,v=v.slice(S-3,S+1),v=="9999"||!x&&v=="4999"){if(!x&&(B(C,C.e+u+2,0),C.times(C).eq(A))){g=C;break}L+=4,S+=4,x=1}else{(!+v||!+v.slice(1)&&v.charAt(0)=="5")&&(B(g,g.e+u+2,1),h=!g.times(g).eq(A));break}}return B(g,g.e+u+1,a,h)},o.toExponential=function(h,v){return h!=null&&(ue(h,0,ge),h++),T(this,h,v,1)},o.toFixed=function(h,v){return h!=null&&(ue(h,0,ge),h=h+this.e+1),T(this,h,v)},o.toFormat=function(h,v,g){var x,C=this;if(g==null)h!=null&&v&&typeof v=="object"?(g=v,v=null):h&&typeof h=="object"?(g=h,h=v=null):g=y;else if(typeof g!="object")throw Error(Ce+"Argument not an object: "+g);if(x=C.toFixed(h,v),C.c){var A,P=x.split("."),S=+g.groupSize,$=+g.secondaryGroupSize,L=g.groupSeparator||"",E=P[0],D=P[1],F=C.s<0,R=F?E.slice(1):E,U=R.length;if($&&(A=S,S=$,$=A,U-=A),S>0&&U>0){for(A=U%S||S,E=R.substr(0,A);A<U;A+=S)E+=L+R.substr(A,S);$>0&&(E+=L+R.slice(A)),F&&(E="-"+E)}x=D?E+(g.decimalSeparator||"")+(($=+g.fractionGroupSize)?D.replace(new RegExp("\\d{"+$+"}\\B","g"),"$&"+(g.fractionGroupSeparator||"")):D):E}return(g.prefix||"")+x+(g.suffix||"")},o.toFraction=function(h){var v,g,x,C,A,P,S,$,L,E,D,F,R=this,U=R.c;if(h!=null&&(S=new w(h),!S.isInteger()&&(S.c||S.s!==1)||S.lt(s)))throw Error(Ce+"Argument "+(S.isInteger()?"out of range: ":"not an integer: ")+W(S));if(!U)return new w(R);for(v=new w(s),L=g=new w(s),x=$=new w(s),F=Fe(U),A=v.e=F.length-R.e-1,v.c[0]=Dr[(P=A%K)<0?K+P:P],h=!h||S.comparedTo(v)>0?A>0?v:L:S,P=p,p=1/0,S=new w(F),$.c[0]=0;E=t(S,v,0,1),C=g.plus(E.times(x)),C.comparedTo(h)!=1;)g=x,x=C,L=$.plus(E.times(C=L)),$=C,v=S.minus(E.times(C=v)),S=C;return C=t(h.minus(g),x,0,1),$=$.plus(C.times(L)),g=g.plus(C.times(x)),$.s=L.s=R.s,A=A*2,D=t(L,x,A,a).minus(R).abs().comparedTo(t($,g,A,a).minus(R).abs())<1?[L,x]:[$,g],p=P,D},o.toNumber=function(){return+W(this)},o.toPrecision=function(h,v){return h!=null&&ue(h,1,ge),T(this,h,v,2)},o.toString=function(h){var v,g=this,x=g.s,C=g.e;return C===null?x?(v="Infinity",x<0&&(v="-"+v)):v="NaN":(h==null?v=C<=i||C>=l?Sn(Fe(g.c),C):tt(Fe(g.c),C,"0"):h===10&&I?(g=B(new w(g),u+C+1,a),v=tt(Fe(g.c),g.e,"0")):(ue(h,2,N.length,"Base"),v=n(tt(Fe(g.c),C,"0"),10,h,x,!0)),x<0&&g.c[0]&&(v="-"+v)),v},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function De(e){var t=e|0;return e>0||e===t?t:t-1}function Fe(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=K-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function bt(e,t){var n,r,o=e.c,s=t.c,u=e.s,a=t.s,i=e.e,l=t.e;if(!u||!a)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-a:u;if(u!=a)return u;if(n=u<0,r=i==l,!o||!s)return r?0:!o^n?1:-1;if(!r)return i>l^n?1:-1;for(a=(i=o.length)<(l=s.length)?i:l,u=0;u<a;u++)if(o[u]!=s[u])return o[u]>s[u]^n?1:-1;return i==l?0:i>l^n?1:-1}function ue(e,t,n,r){if(e<t||e>n||e!==Ie(e))throw Error(Ce+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Cn(e){var t=e.c.length-1;return De(e.e/K)==t&&e.c[t]%2!=0}function Sn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function tt(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var hs=ps();const ld=Object.values({MAINNET:1,SEPOLIA:11155111}),On=e=>ld.includes(+e),ad=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:s,amount:u,decimals:a,tokenBalance:i,platformBalance:l="0",onDepositAmountChange:c,onApprove:p})=>{const m=d.useMemo(()=>{if(On(o==null?void 0:o.chainId))return!1;try{const y=new hs(e||"0"),N=new hs("250000");return y.isNaN()||N.isNaN()?!1:y.gte(N)}catch{return!1}},[o,e]),f=y=>{const N=y.target.value,w=Er(N,i||"0");if(w.isValid)c(w.formattedValue),w.errorType;else return w.errorType==="exceed_balance",void 0},b=()=>{const y=parseFloat(i||"0"),N=parseFloat(e||"0");if(N>0){const I=y-N,w=Ue(Math.max(0,I).toString());return`${Ue(i||"0")} → ${w} ${t}`}return`${Ue(i||"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:"Amount",value:e,onChange:f,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:()=>{c(i||"0")},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:"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("span",{className:"text-text-tertiary text-xs leading-[14px]",children:"Available"}),M.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:b()})]})]}),!r&&Sf(e||"0",0)&&M.jsxs("div",{className:"flex justify-center flex-col items-center",children:[M.jsxs("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:["Enable ",t," on ",o==null?void 0:o.chain]}),M.jsxs("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:["You must enable ",t," first before you can deposit on"," ",o==null?void 0:o.chain,"."]}),M.jsxs("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",onClick:p,children:["Enable ",t]})]}),m&&M.jsxs("div",{className:"flex mb-4",children:[M.jsx("div",{className:"w-5",children:M.jsx("img",{src:fs,className:"w-4 h-4",alt:"Warning"})}),M.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:"When the deposit amount exceeds 250,000, there may be a delay in arrival. It is recommended to use the Ethereum network for deposits."})]}),M.jsx("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:M.jsxs("div",{className:"flex justify-between items-center",children:[M.jsx("span",{className:"text-sm leading-[18px] text-text-tertiary",children:"总资产"}),M.jsx("span",{className:"text-sm leading-[18px] text-text-primary font-medium",children:e?`${Ue(l)} → ${Ue((parseFloat(l)+parseFloat(e)).toString())} ${t}`:`${Ue(l)} ${t}`})]})})]})},ud=({token:e,account:t,chainId:n,contractAddress:r,wagmiHooks:o,onResult:s})=>{var i,l;const u=(i=o==null?void 0:o.useBalance)==null?void 0:i.call(o,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(o!=null&&o.useBalance)}}),a=(l=o==null?void 0:o.useReadContract)==null?void 0:l.call(o,{address:e.tokenAddress,abi:[{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],functionName:"allowance",args:[t,r],chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!r&&!!(o!=null&&o.useReadContract)}});return d.useEffect(()=>{s(e.tokenAddress,{balance:u,allowance:a})},[u,a,e.tokenAddress,s]),null},ms=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var b;const s=d.useMemo(()=>r.filter(y=>y.tokenAddress&&y.tokenAddress!=="0x0000000000000000000000000000000000000000"),[r]),[u,a]=d.useState({}),i=d.useCallback((y,N)=>{a(I=>({...I,[y]:N}))},[]),l=(b=o==null?void 0:o.useBalance)==null?void 0:b.call(o,{address:e,chainId:t,query:{enabled:!!e&&!!t&&!!(o!=null&&o.useBalance)}}),c=d.useMemo(()=>s.map(y=>d.createElement(ud,{key:y.tokenAddress,token:y,account:e,chainId:t,contractAddress:n,wagmiHooks:o,onResult:i})),[s,e,t,n,o,i]),p=d.useMemo(()=>{if(!(o!=null&&o.useBalance))return{balanceList:[],allowanceList:[],baseTokenBalance:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},combinedData:{}};const y=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"},N=s.map(T=>{const j=u[T.tokenAddress],_=j==null?void 0:j.balance,B=_==null?void 0:_.data;return{address:T.tokenAddress,value:(B==null?void 0:B.value)||BigInt(0),formatted:(B==null?void 0:B.formatted)||"0",decimals:(B==null?void 0:B.decimals)||T.decimals}}).filter(T=>T.address),I=s.map(T=>{const j=u[T.tokenAddress],_=j==null?void 0:j.allowance,B=_==null?void 0:_.data,W=BigInt(B?B.toString():0);return{address:T.tokenAddress,value:W,formatted:(W/BigInt(10)**BigInt(T.decimals)).toString(),decimals:T.decimals}}).filter(T=>T.address),w=N.reduce((T,j)=>{const _=I.find(B=>B.address===j.address);return{...T,[j.address]:{balance:j,allowance:_||{address:j.address,value:BigInt(0),formatted:"0",decimals:j.decimals}}}},{});return{balanceList:N,allowanceList:I,baseTokenBalance:y,combinedData:w}},[l,u,s,o==null?void 0:o.useBalance]),m=d.useCallback(async()=>p,[p]),f=d.useMemo(()=>{const y=(l==null?void 0:l.isLoading)||!1,N=Object.values(u).some(I=>{var w,T;return((w=I.balance)==null?void 0:w.isLoading)||((T=I.allowance)==null?void 0:T.isLoading)});return y||N},[l==null?void 0:l.isLoading,u]);return{multicallRun:m,multicallResult:p,validErcTokens:s,isLoading:f,queryComponents:c}},cd=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:s,currentEquity:u,platformBalance:a="0",wagmiHooks:i,approved:l,onApproved:c,onDeposit:p,onClose:m,onChainChange:f,onTokenChange:b})=>{var D;const[y,N]=d.useState(()=>{var F;return!e||e.length===0?1:t||((F=e[0])==null?void 0:F.chainId)||1}),[I,w]=d.useState(()=>{var G;if(!e||e.length===0)return"";const F=t||((G=e[0])==null?void 0:G.chainId),R=e.find(ee=>ee.chainId===F);if(!R||!R.tokenList||R.tokenList.length===0)return"";const U=R.tokenList.find(ee=>ee.tokenAddress===n)||R.tokenList[0];return(U==null?void 0:U.token)||""}),[T,j]=d.useState(r),_=d.useCallback(F=>{N(F),f==null||f(F)},[f]),B=d.useCallback(F=>{w(F),b==null||b(F)},[b]),W=d.useRef(!0),h=d.useRef(I),v=d.useRef(y);d.useEffect(()=>{if(W.current){W.current=!1,h.current=I,v.current=y;return}(h.current!==I||v.current!==y)&&(j(""),h.current=I,v.current=y)},[I,y]);const g=e&&e.length>0?e.find(F=>F.chainId===y)||e[0]:null,x=(D=g==null?void 0:g.tokenList)==null?void 0:D.find(F=>F.token===I),C=o==null?void 0:o.getDisplayAddress(),{multicallResult:A,queryComponents:P}=ms({account:C,chainId:y,contractAddress:void 0,tokens:(g==null?void 0:g.tokenList)||[],wagmiHooks:i}),S=d.useMemo(()=>{var R;if(!x)return;if(!x.tokenAddress||x.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return A.baseTokenBalance.formatted;const F=A.combinedData[x.tokenAddress];return((R=F==null?void 0:F.balance)==null?void 0:R.formatted)||"0"},[x,A]),$=l??!1,L=d.useMemo(()=>{const F=parseFloat(T||"0"),R=10,U=S||"0",G=Of(T,U,$);return!T||F===0?{text:"Confirm Deposit",disabled:!0}:$?F>parseFloat(U)?{text:"Insufficient Balance",disabled:!0}:F<R?{text:`Min Deposit ${R} ${I}`,disabled:!0}:{text:"Confirm Deposit",disabled:!G}:{text:"Confirm Deposit",disabled:!0}},[T,I,S,$]),E=d.useCallback(async()=>{p&&p({amount:T,chainId:y,tokenAddress:(x==null?void 0:x.tokenAddress)||"",tokenSymbol:I})},[p,T,y,x==null?void 0:x.tokenAddress,I]);return!(i!=null&&i.useBalance)||!(i!=null&&i.useReadContract)||!(i!=null&&i.useAccount)?M.jsxs("div",{className:"p-6 text-center",children:[M.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),M.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"No chains available"})}):g?M.jsxs(M.Fragment,{children:[P,M.jsx(wr,{currentActiveChain:g,chainList:e,onChainChange:_,curSelectToken:I,onTokenChange:B,walletType:"evm"}),M.jsx(ad,{depositAmount:T,curSelectToken:I,curSelectTokenData:{balance:x==null?void 0:x.balance,allowance:x==null?void 0:x.allowance},approved:$,currentActiveChain:g,currentEquity:u||0,amount:T,decimals:(x==null?void 0:x.decimals)||6,tokenBalance:S,platformBalance:a,onDepositAmountChange:j,onApprove:async()=>{c&&await c()}}),M.jsx("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors ${L.disabled?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:E,disabled:L.disabled,children:L.text})]}):M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"Loading..."})})},gs=({isOpen:e,onClose:t,config:n,currentActiveAccount:r=Cr,smartWallet:o=Sr,chains:s,defaultChainId:u,defaultTokenAddress:a,defaultAmount:i="",metadata:l=Or,currentEquity:c=5e3,platformBalance:p="0",wagmiHooks:m,approved:f,onApproved:b,onDeposit:y,onCopy:N,onChainChange:I,onTokenChange:w})=>{const T=d.useMemo(()=>{var _;return r?Yr(r,o,!1,(_=s[0])==null?void 0:_.chainId,"0","0"):null},[r,o,s]),j=(T==null?void 0:T.getWalletType())==="mpc";return e?xe.createPortal(M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{t()},"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:_=>{_.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:"Deposit"}),M.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:t,"aria-label":"Close",children:M.jsx(Hr,{className:"h-4 w-4"})})]}),j?M.jsx(id,{chains:s,defaultChainId:u,defaultTokenAddress:a,defaultAmount:i,walletAdapter:T,metadata:l,currentEquity:c,onDeposit:y,onCopy:N,onClose:t}):M.jsx(cd,{chains:s,defaultChainId:u,defaultTokenAddress:a,defaultAmount:i,walletAdapter:T,metadata:l,currentEquity:c,platformBalance:p,wagmiHooks:m,approved:f,onApproved:b,onDeposit:y,onClose:t,onChainChange:I,onTokenChange:w})]})})}),document.body):null};let Qe=null;const fd={symbol:"USDT"},vs=d.forwardRef((e,t)=>{const[n,r]=d.useState(!1),[o,s]=d.useState({chains:[]}),u=d.useCallback(c=>{s(c),r(!0)},[]),a=d.useCallback(c=>{s(p=>({...p,...c}))},[]),i=d.useCallback(()=>{r(!1),o.onClose&&o.onClose()},[o.onClose]),l=d.useCallback(()=>n,[n]);return d.useImperativeHandle(t,()=>({openDeposit:u,closeDeposit:i,updateDepositOptions:a,isOpen:l}),[u,i,a,l]),d.useEffect(()=>(Qe={openDeposit:u,closeDeposit:i,updateDepositOptions:a,isOpen:l},()=>{Qe=null}),[u,i,a,l]),M.jsx(gs,{isOpen:n,onClose:i,config:o.config||fd,currentActiveAccount:o.currentActiveAccount||Cr,smartWallet:o.smartWallet||Sr,chains:o.chains||$f,defaultChainId:o.defaultChainId,defaultTokenAddress:o.defaultTokenAddress,defaultAmount:o.defaultAmount,metadata:o.metadata||Or,currentEquity:o.currentEquity??5e3,platformBalance:o.platformBalance||"0",wagmiHooks:o.wagmiHooks,approved:o.approved,onApproved:o.onApproved,onDeposit:o.onDeposit,onCopy:o.onCopy,onChainChange:o.onChainChange,onTokenChange:o.onTokenChange})});vs.displayName="DepositManager";const bs=e=>{if(!Qe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Qe.openDeposit(e||{chains:[]})},ys=()=>{if(!Qe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Qe.closeDeposit()},xs=e=>{Qe&&Qe.updateDepositOptions(e)},dd=()=>Qe?Qe.isOpen():!1,pd=()=>({openDeposit:bs,closeDeposit:ys,updateDepositOptions:xs,isOpen:dd});d.createContext(null);const hd=({withdrawAmount:e,curSelectToken:t,currentActiveChain:n,platformBalance:r="0",walletType:o="evm",receiverAddress:s="",onWithdrawAmountChange:u,onReceiverAddressChange:a})=>{const i=p=>{const m=p.target.value,b=Er(m,r||"0");if(b.isValid)u(b.formattedValue),b.errorType;else return b.errorType==="exceed_balance",void 0},l=()=>{u(r)},c=()=>{const p=parseFloat(r||"0"),m=parseFloat(e||"0");if(m>0){const f=p-m,b=Ue(Math.max(0,f).toString());return`${Ue(r||"0")} → ${b} ${t}`}return`${Ue(r||"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:"Amount",value:e,onChange:i,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:l,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:"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("span",{className:"text-text-tertiary text-xs leading-[14px]",children:"Available"}),M.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:c()})]})]}),o==="mpc"&&!On(n==null?void 0:n.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:"Receiver Address",value:s,onChange:p=>a==null?void 0:a(p.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"})}),M.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:M.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this."})}),M.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[M.jsxs("div",{className:"flex items-center justify-between",children:[M.jsx("span",{className:"text-text-tertiary text-xs",children:"Speed"}),M.jsxs("div",{className:"flex items-center space-x-1",children:[M.jsx("span",{className:"text-theme-normal",children:"⚡"}),M.jsx("span",{className:"text-theme-normal",children:"⚡"}),M.jsx("span",{className:"text-theme-normal",children:"⚡"})]})]}),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:"Amount to receive"}),M.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Ue(e)," ",t]})]})]})]})},md=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:s,currentEquity:u,platformBalance:a="0",wagmiHooks:i,onWithdraw:l,onClose:c,onChainChange:p,onTokenChange:m})=>{var D;const[f,b]=d.useState(()=>{var F;return!e||e.length===0?1:t||((F=e[0])==null?void 0:F.chainId)||1}),[y,N]=d.useState(()=>{var G;if(!e||e.length===0)return"";const F=t||((G=e[0])==null?void 0:G.chainId),R=e.find(ee=>ee.chainId===F);if(!R||!R.tokenList||R.tokenList.length===0)return"";const U=R.tokenList.find(ee=>ee.tokenAddress===n)||R.tokenList[0];return(U==null?void 0:U.token)||""}),[I,w]=d.useState(r),[T,j]=d.useState(""),_=(o==null?void 0:o.getWalletType())||"evm",B=d.useCallback(F=>{b(F),p==null||p(F)},[p]),W=d.useCallback(F=>{N(F),m==null||m(F)},[m]),h=d.useRef(!0),v=d.useRef(y),g=d.useRef(f);d.useEffect(()=>{if(h.current){h.current=!1,v.current=y,g.current=f;return}(v.current!==y||g.current!==f)&&(w(""),v.current=y,g.current=f)},[y,f]);const x=e&&e.length>0?e.find(F=>F.chainId===f)||e[0]:null,C=(D=x==null?void 0:x.tokenList)==null?void 0:D.find(F=>F.token===y),A=o==null?void 0:o.getDisplayAddress(),{multicallResult:P,queryComponents:S}=ms({account:A,chainId:f,contractAddress:void 0,tokens:(x==null?void 0:x.tokenList)||[],wagmiHooks:i}),$=d.useMemo(()=>{var R;if(!C)return;if(!C.tokenAddress||C.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return P.baseTokenBalance.formatted;const F=P.combinedData[C.tokenAddress];return((R=F==null?void 0:F.balance)==null?void 0:R.formatted)||"0"},[C,P]),L=d.useMemo(()=>{const F=parseFloat(I||"0"),R=1,U=parseFloat(a||"0");return!I||F===0?{text:"Confirm Withdraw",disabled:!0}:_==="mpc"&&!On(f)&&!T.trim()?{text:"Enter Receiver Address",disabled:!0}:F>U?{text:"Insufficient Balance",disabled:!0}:F<R?{text:`Min Withdraw ${R} ${y}`,disabled:!0}:{text:"Confirm Withdraw",disabled:!1}},[I,y,a,_,T]),E=d.useCallback(async()=>{if(l){const F={amount:I,chainId:f,tokenAddress:(C==null?void 0:C.tokenAddress)||"",tokenSymbol:y};_==="mpc"&&!On(f)&&(F.receiverAddress=T),l(F)}},[l,I,f,C==null?void 0:C.tokenAddress,y,_,T]);return!(i!=null&&i.useBalance)||!(i!=null&&i.useReadContract)||!(i!=null&&i.useAccount)?M.jsxs("div",{className:"p-6 text-center",children:[M.jsx("p",{className:"text-red-500",children:"缺少必要的 wagmi hooks"}),M.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"请确保传入了 useBalance, useReadContract, useAccount"})]}):!e||e.length===0?M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"No chains available"})}):x?M.jsxs(M.Fragment,{children:[S,M.jsx(wr,{currentActiveChain:x,chainList:e,onChainChange:B,curSelectToken:y,onTokenChange:W,walletType:"evm"}),M.jsx(hd,{withdrawAmount:I,curSelectToken:y,curSelectTokenData:{balance:C==null?void 0:C.balance,allowance:C==null?void 0:C.allowance},currentActiveChain:x,currentEquity:u||0,amount:I,decimals:(C==null?void 0:C.decimals)||6,tokenBalance:$,platformBalance:a,walletType:_,receiverAddress:T,onWithdrawAmountChange:w,onReceiverAddressChange:j}),M.jsx("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors ${L.disabled?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:E,disabled:L.disabled,children:L.text})]}):M.jsx("div",{className:"text-center py-8",children:M.jsx("p",{className:"text-gray-400",children:"Loading..."})})},ws=({isOpen:e,onClose:t,config:n,currentActiveAccount:r=Cr,smartWallet:o=Sr,chains:s,defaultChainId:u,defaultTokenAddress:a,defaultAmount:i="",metadata:l=Or,currentEquity:c=5e3,platformBalance:p="0",wagmiHooks:m,onWithdraw:f,onChainChange:b,onTokenChange:y})=>{const N=d.useMemo(()=>{var I;return r?Yr(r,o,!1,(I=s[0])==null?void 0:I.chainId,"0","0"):null},[r,o,s]);return e?xe.createPortal(M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:49},children:M.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-49 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{t()},"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:I=>{I.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:"Withdraw"}),M.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:t,"aria-label":"Close",children:M.jsx(Hr,{className:"h-4 w-4"})})]}),M.jsx(md,{chains:s,defaultChainId:u,defaultTokenAddress:a,defaultAmount:i,walletAdapter:N,metadata:l,currentEquity:c,platformBalance:p,wagmiHooks:m,onWithdraw:f,onClose:t,onChainChange:b,onTokenChange:y})]})})}),document.body):null},gd=[],vd={};let Xe=null;const Es=d.forwardRef((e,t)=>{const[n,r]=d.useState(!1),[o,s]=d.useState({chains:[]}),u=d.useCallback(c=>{s(c||{chains:[]}),r(!0)},[]),a=d.useCallback(c=>{s(p=>({...p,...c}))},[]),i=d.useCallback(()=>{r(!1),o.onClose&&o.onClose()},[o.onClose]),l=d.useCallback(()=>n,[n]);return d.useImperativeHandle(t,()=>({openWithdraw:u,closeWithdraw:i,updateWithdrawOptions:a,isOpen:l}),[u,i,a,l]),d.useEffect(()=>(Xe={openWithdraw:u,closeWithdraw:i,updateWithdrawOptions:a,isOpen:l},()=>{Xe=null}),[u,i,a,l]),M.jsx(ws,{isOpen:n,onClose:i,config:o.config||{symbol:"USDT"},currentActiveAccount:o.currentActiveAccount,smartWallet:o.smartWallet,chains:o.chains||gd,defaultChainId:o.defaultChainId,defaultTokenAddress:o.defaultTokenAddress,defaultAmount:o.defaultAmount,metadata:o.metadata||vd,currentEquity:o.currentEquity??5e3,platformBalance:o.platformBalance||"0",wagmiHooks:o.wagmiHooks,onWithdraw:o.onWithdraw,onChainChange:o.onChainChange,onTokenChange:o.onTokenChange})});Es.displayName="WithdrawManager";const Cs=e=>{if(!Xe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Xe.openWithdraw(e||{chains:[]})},Ss=()=>{if(!Xe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Xe.closeWithdraw()},Os=e=>{if(!Xe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Xe.updateWithdrawOptions(e)},bd=()=>Xe?Xe.isOpen():!1,yd=()=>({openWithdraw:Cs,closeWithdraw:Ss,updateWithdrawOptions:Os,isOpen:bd});oe.ComponentProvider=Hs,oe.Deposit=gs,oe.DepositManager=vs,oe.Withdraw=ws,oe.WithdrawManager=Es,oe.closeDeposit=ys,oe.closeWithdraw=Ss,oe.openDeposit=bs,oe.openWithdraw=Cs,oe.updateDepositOptions=xs,oe.updateWithdrawOptions=Os,oe.useDeposit=Gs,oe.useDepositManager=pd,oe.useWithdraw=Ys,oe.useWithdrawManager=yd,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});
|
|
104
104
|
//# sourceMappingURL=index.umd.js.map
|