@nexus-cross/dapp-ui 1.1.3-beta.4 → 1.1.3-beta.5

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.js CHANGED
@@ -1,20 +1,20 @@
1
- function ge(e){if(e)return Co(e);let t=typeof process<"u"?process.env?.NEXT_PUBLIC_CROSSX_ENVIRONMENT:void 0;return Co(t)}function Co(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as Lt from"react";import*as No from"@radix-ui/react-popover";import{Drawer as bi}from"vaul";import{createContext as ui,useContext as gi}from"react";var On=ui(null);function nn(){let e=gi(On);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import{useState as wi,useEffect as hi}from"react";function Nt(e){let[t,o]=wi(!1);return hi(()=>{let n=window.matchMedia(e);o(n.matches);let r=i=>o(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[e]),t}function A(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}A(`[data-theme=dark]{--al-bg: var(--cck-surface-bg, #1e232e);--al-bg-hover: var(--cck-surface-default, #252b39);--al-text: var(--cck-texticon-primary, hsla(200, 19%, 94%, 1));--al-text-secondary: var(--cck-texticon-secondary, hsla(200, 10%, 70%, 1));--al-border: var(--cck-border-subtle, #3b4153);--al-shadow: 0 2px 8px -1px rgba(0, 0, 0, .15);--al-badge-bg: #123f3c;--al-badge-text: hsla(168, 85%, 47%, 1);--al-badge-new-text: #000;--al-drawer-overlay: rgba(0, 0, 0, .6)}[data-theme=light]{--al-bg: var(--cck-surface-bg, #fff);--al-bg-hover: var(--cck-surface-default, #f3f6f8);--al-text: var(--cck-texticon-primary, hsla(221, 21%, 15%, 1));--al-text-secondary: var(--cck-texticon-secondary, hsla(220, 10%, 40%, 1));--al-border: var(--cck-border-subtle, #ecf0f2);--al-shadow: 0 2px 8px -1px rgba(0, 0, 0, .15);--al-badge-bg: #cdf4ed;--al-badge-text: hsla(170, 82%, 32%, 1);--al-badge-new-text: #fff;--al-drawer-overlay: rgba(0, 0, 0, .4)}
1
+ function ge(e){if(e)return No(e);let t=typeof process<"u"?process.env?.NEXT_PUBLIC_CROSSX_ENVIRONMENT:void 0;return No(t)}function No(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as Lt from"react";import*as Lo from"@radix-ui/react-popover";import{Drawer as xi}from"vaul";import{createContext as gi,useContext as wi}from"react";var On=gi(null);function nn(){let e=wi(On);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import{useState as hi,useEffect as bi}from"react";function Nt(e){let[t,o]=hi(!1);return bi(()=>{let n=window.matchMedia(e);o(n.matches);let r=i=>o(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[e]),t}function A(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}A(`[data-theme=dark]{--al-bg: var(--cck-surface-bg, #1e232e);--al-bg-hover: var(--cck-surface-default, #252b39);--al-text: var(--cck-texticon-primary, hsla(200, 19%, 94%, 1));--al-text-secondary: var(--cck-texticon-secondary, hsla(200, 10%, 70%, 1));--al-border: var(--cck-border-subtle, #3b4153);--al-shadow: 0 2px 8px -1px rgba(0, 0, 0, .15);--al-badge-bg: #123f3c;--al-badge-text: hsla(168, 85%, 47%, 1);--al-badge-new-text: #000;--al-drawer-overlay: rgba(0, 0, 0, .6)}[data-theme=light]{--al-bg: var(--cck-surface-bg, #fff);--al-bg-hover: var(--cck-surface-default, #f3f6f8);--al-text: var(--cck-texticon-primary, hsla(221, 21%, 15%, 1));--al-text-secondary: var(--cck-texticon-secondary, hsla(220, 10%, 40%, 1));--al-border: var(--cck-border-subtle, #ecf0f2);--al-shadow: 0 2px 8px -1px rgba(0, 0, 0, .15);--al-badge-bg: #cdf4ed;--al-badge-text: hsla(170, 82%, 32%, 1);--al-badge-new-text: #fff;--al-drawer-overlay: rgba(0, 0, 0, .4)}
2
2
  `);A(`.al-trigger-btn{--at-bg: transparent;--at-bg-hover: var(--cck-surface-default, transparent);--at-color: currentColor;--at-border: none;--at-border-radius: 8px;--at-size: 36px;--at-padding: 0;--at-press-scale: .95;--at-transition: background-color .15s ease;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--at-size);height:var(--at-size);padding:var(--at-padding);border:var(--at-border);background:var(--at-bg);border-radius:var(--at-border-radius);color:var(--at-color);cursor:pointer;transition:var(--at-transition)}.al-trigger-btn:hover{background:var(--at-bg-hover)}.al-trigger-btn:active:not(:disabled){transform:scale(var(--at-press-scale))}.al-trigger-btn[data-theme=dark]{--at-color: var(--cck-texticon-primary, hsla(200, 19%, 94%, 1))}.al-trigger-btn[data-theme=light]{--at-color: var(--cck-texticon-primary, hsla(221, 21%, 15%, 1))}
3
3
  `);A(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
4
  `);A(`.al-popover-content{z-index:100001;border-radius:16px;background:var(--al-bg);border:1px solid var(--al-popover-border, var(--al-border));box-shadow:var(--al-popover-shadow, var(--al-shadow));animation:al-fade-in .15s ease-out;max-height:80vh;overflow-x:hidden;overflow-y:auto;padding:20px 4px;box-sizing:border-box}.al-popover-content .al-grid{grid-template-columns:repeat(4,100px);row-gap:16px;column-gap:0;padding:0;justify-content:center}.al-popover-content .al-grid-item{flex-direction:column;justify-content:flex-start;align-items:center;gap:6px;padding:6px 0;width:100px;min-width:0;border-radius:10px}.al-popover-content .al-grid-item-left{flex-direction:column;align-items:center;gap:6px;width:100%;overflow:visible}.al-popover-content .al-grid-item-icon{width:50px;height:50px;border-radius:10.125px;overflow:hidden}.al-popover-content .al-grid-item-icon img{object-fit:cover}.al-popover-content .al-grid-item-label{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:1.1;letter-spacing:0;text-align:center;color:var(--al-text);max-width:100%;white-space:normal;overflow-wrap:anywhere}.al-popover-content .al-grid-item-right,.al-popover-content .al-badge-new{display:none}.al-drawer-overlay{position:fixed;inset:0;z-index:100000;background:var(--al-drawer-overlay)}.al-drawer-content{position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;background:var(--al-bg);overflow-x:hidden;overflow-y:hidden;display:flex;flex-direction:column;box-sizing:border-box}.al-drawer-body{flex:1;overflow-y:auto;overscroll-behavior-y:contain;min-height:0}.al-drawer-content .al-grid{display:flex;flex-direction:column;grid-template-columns:none;max-width:100%;overflow:hidden;flex-shrink:0;gap:0;row-gap:0;column-gap:0;padding:8px 16px}.al-drawer-content .al-grid-item{width:100%;max-width:100%;gap:8px;padding:10px 12px;border-radius:8px;overflow:hidden;background:transparent}.al-drawer-content .al-grid-item:hover,.al-drawer-content .al-grid-item[data-active=true]{background:var(--al-bg-hover)}.al-drawer-content .al-grid-item-left{gap:8px;flex:1 1 auto;min-width:0}.al-drawer-content .al-grid-item-icon{width:32px;height:32px;border-radius:6.75px;overflow:hidden}.al-drawer-content .al-grid-item-icon img{width:100%;height:100%;object-fit:cover;border-radius:6.75px}.al-drawer-content .al-grid-item-label{font-size:16px;line-height:1.35;letter-spacing:0;font-weight:400}.al-drawer-content .al-grid-item[data-active=true] .al-grid-item-label{font-weight:500}.al-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0}.al-drawer-title{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--al-text);margin:0}.al-drawer-close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--al-text);transition:opacity .15s ease}.al-drawer-close:hover{opacity:.7}.al-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:4px;padding:8px}.al-grid-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 12px;border:none;background:transparent;border-radius:8px;cursor:pointer;transition:background-color .15s ease;color:var(--al-text);text-align:left;font-family:Inter,sans-serif;flex-shrink:0}.al-grid-item:hover,.al-grid-item[data-active=true]{background:var(--al-bg-hover)}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden}.al-grid-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain}.al-grid-item-label{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:150%;letter-spacing:0;color:var(--al-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.al-badge{display:flex;padding:1px 4px 2px;justify-content:center;align-items:center;gap:2px;border-radius:3px;background:var(--al-badge-bg);color:var(--al-badge-text);font-family:Pretendard,Inter,sans-serif;font-size:10px;font-weight:600;line-height:150%;letter-spacing:0;white-space:nowrap;flex-shrink:0}.al-badge-new{display:flex;width:16px;height:16px;justify-content:center;align-items:center;aspect-ratio:1/1;border-radius:12px;background:#7346f3;color:var(--al-badge-new-text);font-family:Pretendard,Inter,sans-serif;font-size:9px;font-weight:700;flex-shrink:0}
5
- `);A("");import{jsx as Fn}from"react/jsx-runtime";function Lo({env:e,theme:t="dark",mobileBreakpoint:o=768,domain:n,children:r}){let i=Nt(`(max-width: ${o}px)`),[s,l]=Lt.useState(!1),d=Lt.useCallback(()=>l(!1),[]),c=ge(e),a=Lt.useMemo(()=>({env:c,theme:t,isMobile:i,open:s,domain:n,close:d}),[c,t,i,s,n,d]);return Fn(On.Provider,{value:a,children:i?Fn(bi.Root,{direction:"right",open:s,onOpenChange:l,noBodyStyles:!0,children:r},"drawer"):Fn(No.Root,{open:s,onOpenChange:l,children:r},"popover")})}import*as Po from"@radix-ui/react-popover";import{Drawer as vi}from"vaul";import{jsx as we,jsxs as xi}from"react/jsx-runtime";function Ro({size:e=18}){return xi("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[we("rect",{width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),we("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),we("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function So(){return we("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:we("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Eo(){return we("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:we("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as on}from"react/jsx-runtime";function Io({asChild:e,children:t,className:o,style:n}){let{isMobile:r,theme:i}=nn(),s=t!=null,l=e??!0,d=o?`al-trigger-btn ${o}`:"al-trigger-btn",c=s?t:on("button",{type:"button",className:d,"data-theme":i,style:n,children:on(Ro,{size:r?12:18})});return r?on(vi.Trigger,{asChild:l,children:c}):on(Po.Trigger,{asChild:l,children:c})}import*as ft from"react";import*as an from"@radix-ui/react-popover";import{Drawer as Rt}from"vaul";import{useQuery as Ci}from"@tanstack/react-query";var To={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json"};var yi="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",ki="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Fe(e,t){return`${e==="production"?ki:yi}/${t}.png`}function Mo(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://dev-x.crosstoken.io/gametoken/CROSS",stage:"https://stg-x.crosstoken.io/gametoken/CROSS",production:"https://x.crosstoken.io/gametoken/CROSS"},iconUrl:Fe(t,"dex"),order:1e3,type:"gametoken",badge:null,isNew:!1},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg-x.crosstoken.io/forge",stage:"https://stg-x.crosstoken.io/forge",production:"https://x.crosstoken.io/forge"},iconUrl:Fe(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0},{id:"crossd",label:"Bridge (CROSSD)",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:Fe(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:Fe(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg-x.crosstoken.io/rewards",stage:"https://stg-x.crosstoken.io/rewards",production:"https://x.crosstoken.io/rewards"},iconUrl:Fe(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:Fe(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1},{id:"play",label:"Play",description:"Discover and play games on CROSS.",url:{dev:"https://stg-play.cross.nexus",stage:"https://stg-play.cross.nexus",production:"https://play.cross.nexus"},iconUrl:Fe(t,"play"),order:8500,type:"play",badge:null,isNew:!0},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://www.dev.cross.shop/",stage:"https://www.stage.cross.shop/",production:"https://www.cross.shop/"},iconUrl:Fe(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg-x.crosstoken.io/points",stage:"https://stg-x.crosstoken.io/points",production:"https://x.crosstoken.io/points"},iconUrl:Fe(t,"point"),order:1e4,type:"points",badge:null,isNew:!1},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg-wave.crosstoken.io/en",stage:"https://stg-wave.crosstoken.io/en",production:"https://wave.crosstoken.io/en"},iconUrl:Fe(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.crosstoken.io/612055",stage:"https://stg-explorer.crosstoken.io/612055",production:"https://explorer.crosstoken.io/612055"},iconUrl:Fe(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1}]}}function rn(e){let t=ge(e);return Ci({queryKey:["global-menu",t],queryFn:async({signal:o})=>{try{let n=await fetch(To[t],{cache:"no-store",signal:o});if(!n.ok)throw new Error(`Failed to fetch global menu: ${n.status}`);return n.json()}catch(n){if(o.aborted)throw n;return Mo(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function Y(...e){return e.filter(Boolean).join(" ")}import{jsx as re,jsxs as Bt}from"react/jsx-runtime";function Ni(e){return e.id==="cross-staking"||e.type==="cross-staking"}function _o({align:e="end",sideOffset:t=12,className:o}){let{env:n,theme:r,isMobile:i,domain:s,close:l}=nn(),{data:d}=rn(n),c=ft.useMemo(()=>(d?.items??[]).sort((w,C)=>w.order-C.order),[d]),a=8,p=ft.useRef(null),b=ft.useCallback(w=>{p.current={x:w.clientX,y:w.clientY}},[]),h=typeof window<"u"?window.location.pathname:"",x=ft.useCallback((w,C)=>{if(p.current){let L=w.clientX-p.current.x,W=w.clientY-p.current.y;if(p.current=null,Math.abs(L)>a||Math.abs(W)>a)return}let M=C.url[n]??C.url.production,T=Ao(M,s);if(!T)try{let L=new URL(M).pathname;if(h===L||h.startsWith(L+"/")){l();return}}catch{}T?window.open(M,"_blank","noopener,noreferrer"):window.location.href=M,l()},[n,s,l,h]),g=re("div",{className:"al-grid","data-theme":r,children:c.map(w=>{let C=w.url[n]??w.url.production,M=Ao(C,s),T=!1;if(!M)try{let L=new URL(C).pathname;T=h===L||h.startsWith(L+"/")}catch{T=!1}return Bt("button",{type:"button",className:"al-grid-item","data-active":T||void 0,onPointerDown:b,onClick:L=>x(L,w),children:[Bt("div",{className:"al-grid-item-left",children:[re("div",{className:"al-grid-item-icon",children:re("img",{src:w.iconUrl,alt:w.label,width:24,height:24,loading:"lazy"})}),re("span",{className:"al-grid-item-label",children:w.label}),w.isNew&&re("span",{className:"al-badge-new",children:"N"})]}),re("div",{className:"al-grid-item-right",children:w.badge&&!Ni(w)&&re("span",{className:"al-badge",children:w.badge})})]},w.id)})});return i?Bt(Rt.Portal,{children:[re(Rt.Overlay,{className:"al-drawer-overlay"}),Bt(Rt.Content,{className:Y("al-drawer-content",o),"data-theme":r,children:[Bt("div",{className:"al-drawer-header",children:[re(Rt.Close,{className:"al-drawer-close",children:re(So,{})}),re(Rt.Title,{className:"al-drawer-title",children:"CROSS Services"}),re(Rt.Close,{className:"al-drawer-close",children:re(Eo,{})})]}),re("div",{className:"al-drawer-body",children:g})]})]}):re(an.Portal,{children:re(an.Content,{align:e,sideOffset:t,className:Y("al-popover-content",o),"data-theme":r,children:g})})}function Ao(e,t){try{let o=new URL(e).hostname;return typeof window>"u"?!0:o!==(t??window.location.hostname)}catch{return!1}}import*as ce from"react";import*as jr from"@radix-ui/react-popover";import{Drawer as cs}from"vaul";import{createContext as Li,useContext as Ri}from"react";var Dn=Li(null);function nt(){let e=Ri(Dn);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Wn=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(Wn||{}),sn={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};import*as S from"react";import ut from"bignumber.js";function Si(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return t>0&&e.charCodeAt(t-1)===46&&t--,e.slice(0,t)}function gt(e,t){if(!e||e==="0")return"0.00";let o=new ut(e).shiftedBy(-t),n=o.isGreaterThanOrEqualTo(1)?2:4;return o.toFormat(n,ut.ROUND_DOWN)}function Re(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Bn(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let o=t>=1?2:4,n=Math.pow(10,o);return`$${(Math.floor(t*n)/n).toLocaleString("en-US",{minimumFractionDigits:o,maximumFractionDigits:o})}`}function Oo(e,t,o){let r=new ut(e).shiftedBy(-t).multipliedBy(new ut(o));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(ut.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,ut.ROUND_DOWN):r.decimalPlaces(4,ut.ROUND_DOWN)).toFormat()}`}function Fo(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let o=t;if(o.includes("e")||o.includes("E")){let s=Number(o);if(!Number.isFinite(s)||s===0)return{displayValue:"0",isLowerBound:!1};o=Si(s.toFixed(18))}let[n="0",r=""]=o.split(".");if(Number(n)>=1){let s=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${s}`,isLowerBound:!1}}return r.length<4?{displayValue:`${n}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}var Se={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},me={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var zn={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},Do={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function $n(e,t){let o=me[e];if(t===o.cross)return Do.cross;if(t===o.bsc)return Do.bsc}var Ei={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function wt(e,t,o={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:r,format:i="png"}=o,s=Ei[e],l=r?`&bg=${r}`:"";return`${s}/portrait/evm/${t}.${i}?size=${n}${l}`}import{jsx as U,jsxs as ln}from"react/jsx-runtime";function Wo({size:e=16,className:t}){return ln("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[U("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),U("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Vn({size:e=16,className:t}){return U("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function zt({size:e=16,className:t}){return U("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Hn({size:e=24,className:t}){return U("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Bo({size:e=20,className:t}){return ln("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[U("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),U("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function zo({size:e=20,className:t}){return U("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:U("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function $o({size:e=20,className:t}){return U("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Vo({size:e=20,className:t}){return U("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ho({size:e=20,className:t}){return U("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function jo({size:e=16,className:t}){return ln("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[U("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),U("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Go({size:e=16,className:t}){return ln("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[U("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),U("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Uo({size:e=42,className:t}){return U("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:U("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}import{useMemo as Pi}from"react";import{useQuery as Ii}from"@tanstack/react-query";var Ti="send:chain-info";function Mi(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let o=t[0];if(!o)throw new Error("Chain info payload is empty.");return o}return t}return e}function jn(e,...t){let o=e.replace(/\/+$/,""),n=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[o,...n].join("/")}function Ai(e,t,o,n){if(n)return t===me[e].cross?qo(t,n):o?.explorer_url?jn(o.explorer_url,o.explorer_postfix?.transaction??"tx",n):_i(e,t,n)}function qo(e,t){return jn("https://explorer.crosstoken.io",String(e),"tx",t)}function _i(e,t,o){let n=me[e];if(t===n.cross)return qo(t,o);if(t===n.bsc)return jn(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",o)}function Zo(e,t,o,n=!0){let r=Se[e],i=Ii({queryKey:[Ti,e,t],queryFn:async({signal:d})=>{let c=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:d});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let a=await c.json();if("code"in a&&a.code!==void 0&&a.code!==200)throw new Error(`Chain info API error: ${a.code}`);return Mi(a)},enabled:n,staleTime:300*1e3}),s=i.data;return{transactionUrl:Pi(()=>Ai(e,t,s,o),[t,s,e,o]),chainInfo:s,...i}}var Yo="0x0000000000000000000000000000000000000001";var Oi="0xa9059cbb",Fi=/^0x[a-fA-F0-9]{40}$/,Di="nexus-cross:dapp-ui:send:recent:",Ko=10;function Wi(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function $t(e){return e.toLowerCase()}function Vt(e){return Fi.test(e)}function Gn(e){return $t(e.address)===Yo}function Un(e){return`${Di}${e.toLowerCase()}`}function St(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Un(e));if(!t)return[];let o=JSON.parse(t);return Array.isArray(o)?o.filter(n=>n!==null&&typeof n=="object"&&Vt(n.address)&&typeof n.updatedAt=="number").slice(0,Ko):[]}catch{return[]}}function qn(e,t){if(typeof window>"u")return[];let o=$t(t),n=[{address:o,updatedAt:Date.now()},...St(e).filter(r=>r.address!==o)].slice(0,Ko);try{window.localStorage.setItem(Un(e),JSON.stringify(n))}catch{return St(e)}return n}function Zn(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Un(e))}catch{}}function Yn(e,t){let o=e.trim();if(!o)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(o))return{error:"Enter a valid amount."};let[n="0",r=""]=o.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let i=BigInt(n||"0"),s=r.padEnd(t,"0"),l=s?BigInt(s):0n,d=10n**BigInt(t),c=i*d+l;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function Kn(e,t){let o=BigInt(e||"0"),n=10n**BigInt(t),r=o/n,i=o%n;if(i===0n)return r.toString();let s=Wi(i.toString().padStart(t,"0"));return`${r.toString()}.${s}`}function Qn(e,t){let o=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${Oi}${o}${n}`}var Bi=2000000000n,zi=1000000000n;async function cn(e,t,o){let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:o})});if(!n.ok)throw new Error(`RPC ${t} HTTP ${n.status}`);let r=await n.json();if(r.error)throw new Error(`RPC ${t}: ${r.error.message}`);if(r.result===void 0)throw new Error(`RPC ${t}: empty result`);return r.result}function dn(e){return BigInt(e)}function $i(e){return`0x${e.toString(16)}`}function Vi(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=$i(e.value)),e.data&&(t.data=e.data),t}function Hi(e){return e===56||e===97}async function Qo(e){try{let t=await cn(e,"eth_gasPrice",[]);return{gasPrice:dn(t)}}catch{return{gasPrice:Bi}}}async function ji(e,t){let o=zi;try{let n=await cn(e,"eth_maxPriorityFeePerGas",[]);o=dn(n)}catch{}return{maxFeePerGas:t+o,maxPriorityFeePerGas:o}}async function Gi(e,t){if(t)return Qo(e);let o;try{o=(await cn(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return o?ji(e,dn(o)):Qo(e)}async function Xo(e,t){let o=Hi(t.chainId),n=Vi(t),[r,i]=await Promise.all([cn(e,"eth_estimateGas",[n]),Gi(e,o)]);return{gasLimit:dn(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function Jo(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let o=e,n=[];return typeof o.name=="string"&&n.push(o.name),typeof o.shortMessage=="string"&&n.push(o.shortMessage),typeof o.message=="string"&&n.push(o.message),typeof o.details=="string"&&n.push(o.details),o.cause!==void 0&&n.push(Jo(o.cause,t+1)),n.join(`
6
- `).toLowerCase()}function Ui(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;if(e&&typeof e=="object"){let t=e;if(typeof t.shortMessage=="string")return t.shortMessage;if(typeof t.message=="string")return t.message}return""}function Xn(e,t={},o="Failed to send transaction."){let n=Jo(e);if(!n)return o;let r=t.nativeSymbol?.trim()||"gas token",i=t.networkName?.trim();if(n.includes("user rejected")||n.includes("userrejected")||n.includes("user denied")||n.includes("user cancelled")||n.includes("user canceled")||n.includes("action_rejected")||n.includes("rejected by user"))return"Transaction was cancelled.";if(n.includes("insufficientfunds")||n.includes("insufficient funds")||n.includes("exceeds the balance of the account")||n.includes("insufficient balance for transfer")){let s=i?` on ${i}`:"";return`Not enough ${r} to cover the gas fee.Please top up your ${r} balance and try again.`}return n.includes("transaction underpriced")||n.includes("replacement transaction underpriced")||n.includes("fee too low")?"Gas fee was too low for the network. Please try again.":n.includes("nonce too low")||n.includes("nonce has already been used")||n.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":n.includes("execution reverted")||n.includes("contractfunctionrevertederror")||n.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":n.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":n.includes("http request failed")||n.includes("failed to fetch")||n.includes("network request failed")||n.includes("timeout")||n.includes("econnreset")||n.includes("rpc error")||n.includes("429")?"Network connection failed. Check your internet and try again.":n.includes("estimategas")||n.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":Ui(e)||o}A(`.wi-token-item--button{position:relative;width:100%;border:none;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;border-radius:12px;padding:6px 8px;margin:-2px -8px;transition:background-color .15s ease,transform .15s ease}.wi-token-item--button:before{content:"";position:absolute;inset:-6px -16px;border-radius:16px}.wi-token-item--button:active{transform:scale(.99)}.wi-token-item--button:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.wi-view-send{animation:wi-slide-in-right .25s ease-out}.wi-send-body{flex:1;min-height:0;overflow:hidden}.wi-drawer-content[data-direction=bottom][data-view=send]{max-height:100dvh}.send-page{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.send-scroll{flex:1;min-height:0;display:flex;flex-direction:column;gap:16px;overflow-y:auto;overflow-x:hidden;padding:16px 24px 18px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .send-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.send-scroll::-webkit-scrollbar{width:4px}.send-scroll::-webkit-scrollbar-track{background:transparent}.send-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}[data-theme=light] .send-scroll::-webkit-scrollbar-thumb{background:#0000001f}.send-section{display:flex;flex-direction:column;gap:8px}.send-asset-card{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default);color:inherit;font:inherit;text-align:left;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.send-asset-card:disabled{cursor:default}.send-asset-card:not(:disabled):hover,.send-asset-card[aria-expanded=true]{border-color:var(--wi-primary);background:var(--wi-surface-subtle)}.send-token-list{display:flex;flex-direction:column;gap:6px;max-height:180px;overflow-y:auto;padding:6px;border:1px solid var(--wi-border-subtle);border-radius:16px;background:var(--wi-surface-default)}.send-token-option{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:48px;border:none;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;padding:8px;cursor:pointer}.send-token-option:hover,.send-token-option[data-selected]{background:var(--wi-surface-subtle)}.send-token-option:focus-visible,.send-asset-card:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-token-option-icon{flex-shrink:0;width:28px;height:28px;object-fit:contain;background:transparent}.send-token-option-symbol{color:var(--wi-texticon-primary);font-size:13px;font-weight:700;line-height:1.3}.send-token-option-balance{color:var(--wi-texticon-secondary);font-size:12px;font-weight:600;line-height:1.3;white-space:nowrap}.send-asset-left{display:flex;align-items:center;gap:12px;min-width:0}.send-asset-icon{flex-shrink:0;width:40px;height:40px;object-fit:contain;background:transparent}.send-asset-info,.send-asset-balance{min-width:0;display:flex;flex-direction:column}.send-asset-symbol{color:var(--wi-texticon-primary);font-size:15px;font-weight:700;line-height:1.3}.send-asset-name,.send-balance-label{color:var(--wi-texticon-tertiary);font-size:12px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.send-asset-balance{align-items:flex-end;text-align:right}.send-balance-value{color:var(--wi-texticon-primary);font-size:13px;font-weight:600;line-height:1.35;white-space:nowrap}.send-form{display:flex;flex-direction:column;gap:14px}.send-field{display:flex;flex-direction:column;gap:8px}.send-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.send-label{color:var(--wi-texticon-secondary);font-size:13px;font-weight:600;line-height:1.3}.send-input,.send-amount-wrap{width:100%;box-sizing:border-box;border:1px solid var(--wi-border-subtle);border-radius:14px;background:var(--wi-surface-default);color:var(--wi-texticon-primary);font:inherit}.send-input{min-height:46px;padding:0 14px;font-size:16px;outline:none;transition:border-color .15s ease,box-shadow .15s ease}.send-input:focus{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-address-wrap[data-invalid],.send-amount-wrap[data-invalid]{border-color:#ff6b6b}.send-address-wrap[data-invalid]:focus-within,.send-amount-wrap[data-invalid]:focus-within{border-color:#ff6b6b;box-shadow:0 0 0 3px #ff6b6b29}.send-input::placeholder{color:var(--wi-texticon-tertiary)}.send-address-wrap{display:flex;align-items:center;width:100%;box-sizing:border-box;border:1px solid var(--wi-border-subtle);border-radius:14px;background:var(--wi-surface-default);transition:border-color .15s ease,box-shadow .15s ease}.send-address-wrap:focus-within{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input--address{flex:1;min-width:0;border:none;background:transparent;box-shadow:none}.send-input--address:focus{box-shadow:none}.send-address-book-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;margin-right:2px;border:none;border-radius:12px;background:transparent;color:var(--wi-texticon-tertiary);cursor:pointer;transition:background-color .15s ease,color .15s ease}.send-address-book-btn:hover,.send-address-book-btn[aria-expanded=true]{background:var(--wi-surface-subtle);color:var(--wi-primary)}.send-address-book-btn:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-address-picker{display:flex;flex-direction:column;gap:12px;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default)}.send-address-tabs{display:flex;align-items:center;gap:22px;border-bottom:1px solid var(--wi-border-subtle)}.send-address-tab{position:relative;border:none;background:transparent;color:var(--wi-texticon-tertiary);font:inherit;font-size:14px;font-weight:800;line-height:1.3;padding:0 0 12px;cursor:pointer}.send-address-tab[data-active]{color:var(--wi-primary)}.send-address-tab[data-active]:after{content:"";position:absolute;left:50%;bottom:-1px;width:34px;height:4px;border-radius:999px;background:var(--wi-primary);transform:translate(-50%)}.send-address-list{display:flex;flex-direction:column;gap:10px;max-height:224px;overflow-y:auto;padding-right:10px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}[data-theme=light] .send-address-list{scrollbar-color:rgba(0,0,0,.14) transparent}.send-address-list::-webkit-scrollbar{width:3px}.send-address-list::-webkit-scrollbar-track{background:transparent}.send-address-list::-webkit-scrollbar-thumb{background:#ffffff2e;border-radius:999px}[data-theme=light] .send-address-list::-webkit-scrollbar-thumb{background:#00000024}.send-address-option{display:flex;align-items:center;gap:12px;width:100%;min-height:54px;border:none;border-radius:14px;background:transparent;color:inherit;font:inherit;text-align:left;padding:8px;cursor:pointer;transition:background-color .15s ease}.send-address-option:hover{background:var(--wi-surface-subtle)}.send-address-option:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-address-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--wi-surface-subtle);color:var(--wi-primary);font-size:12px;font-weight:800;overflow:hidden}.send-address-avatar-img{position:relative;z-index:1;width:36px;height:36px;border-radius:50%;object-fit:cover}.send-address-avatar-fallback{position:absolute;inset:0;display:inline-flex;align-items:center;justify-content:center}.send-address-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.send-address-name{color:var(--wi-texticon-primary);font-size:14px;font-weight:800;line-height:1.3}.send-address-value{color:var(--wi-texticon-tertiary);font-size:12px;font-weight:600;line-height:1.3}.send-address-empty{display:flex;align-items:center;justify-content:center;min-height:120px;color:var(--wi-texticon-tertiary);font-size:14px;font-weight:700}.send-amount-wrap{display:flex;align-items:center;padding-right:12px}.send-amount-wrap:focus-within{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input--amount{border:none;background:transparent;box-shadow:none;flex:1;min-width:0}.send-input--amount:focus{box-shadow:none}.send-amount-symbol{color:var(--wi-texticon-secondary);font-size:13px;font-weight:700}.send-field-error{margin:-2px 0 0;color:#ff6b6b;font-size:12px;font-weight:600;line-height:1.35}.send-max-btn{border:none;border-radius:999px;background:var(--wi-surface-subtle);color:var(--wi-primary);font:inherit;font-size:12px;font-weight:700;padding:4px 10px;cursor:pointer}.send-max-btn:disabled{cursor:not-allowed;opacity:.45}.send-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--wi-texticon-tertiary);font-size:12px;line-height:1.4}.send-meta span:last-child{color:var(--wi-texticon-secondary);font-weight:600}.send-message{border-radius:14px;padding:10px 12px;font-size:12px;line-height:1.45}.send-message--error{background:#ff50501f;color:#ff6b6b}.send-message--success{background:color-mix(in srgb,var(--wi-primary) 12%,transparent);color:var(--wi-primary)}.send-message span{font-weight:700}.send-submit-btn{width:100%;min-height:48px;border:none;border-radius:999px;background:var(--wi-primary);color:var(--wi-primary-contrast, #001410);font:inherit;font-size:15px;font-weight:800;cursor:pointer;transition:opacity .15s ease,transform .15s ease}.send-submit-btn:hover:not(:disabled):not([data-disabled]){transform:translateY(-1px)}.send-submit-btn:disabled,.send-submit-btn[data-disabled]{cursor:not-allowed;opacity:.45}.send-footer{flex-shrink:0;padding:14px 24px 24px;border-top:1px solid var(--wi-border-subtle);background:var(--wi-surface-bg)}.send-page--success{background:var(--wi-surface-bg)}.send-success-body{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:32px 24px;text-align:center}.send-success-icon{display:inline-flex;align-items:center;justify-content:center}.send-success-icon[data-pending]{width:56px;height:56px;border-radius:50%;background:color-mix(in srgb,var(--wi-primary) 14%,transparent)}.send-success-spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--wi-primary) 22%,transparent);border-top-color:var(--wi-primary);border-radius:50%;animation:cross-send-spin .8s linear infinite}.send-success-copy{display:flex;flex-direction:column;gap:8px}.send-success-title{margin:0;color:var(--wi-texticon-primary);font-size:22px;font-weight:800;line-height:1.25}.send-success-desc{margin:0;color:var(--wi-texticon-tertiary);font-size:14px;font-weight:600;line-height:1.45}.send-success-hash-card{width:100%;display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default);box-sizing:border-box}.send-success-hash-label{color:var(--wi-texticon-tertiary);font-size:12px;font-weight:700;line-height:1.3;text-align:left}.send-success-hash-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;border:none;border-radius:12px;background:var(--wi-surface-subtle);color:var(--wi-texticon-primary);font:inherit;font-size:14px;font-weight:800;padding:12px}.send-success-hash-link{flex:1;display:inline-flex;align-items:center;align-self:stretch;min-width:0;border:none;background:transparent;color:inherit;font:inherit;font-weight:inherit;padding:0;text-align:left;text-decoration:none;cursor:pointer;user-select:none}.send-success-hash-link:hover{color:var(--wi-primary)}.send-success-hash-link:focus-visible,.send-success-copy-btn:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-success-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:32px;border:none;background:transparent;color:var(--wi-primary);font:inherit;font-size:12px;font-weight:800;padding:0;cursor:pointer}@keyframes cross-send-spin{to{transform:rotate(360deg)}}.send-page--review{background:var(--wi-surface-bg)}.send-review-scroll{gap:16px;padding-top:12px}.send-review-amount{display:flex;align-items:center;justify-content:center;gap:4px;padding:12px 0}.send-review-amount-icon{width:32px;height:32px;object-fit:contain;flex-shrink:0}.send-review-amount-value{color:var(--wi-texticon-primary);font-size:26px;font-weight:800;line-height:1.3;letter-spacing:-.01em}.send-review-parties{display:flex;flex-direction:column;gap:4px;width:100%}.send-review-party{display:flex;align-items:flex-start;gap:8px;padding:16px;border-radius:8px;background:var(--wi-surface-subtle)}.send-review-party-label{flex-shrink:0;width:80px;color:var(--wi-texticon-tertiary);font-size:14px;line-height:1.4}.send-review-party-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;align-items:flex-end;text-align:right}.send-review-party-name{color:var(--wi-texticon-primary);font-size:14px;font-weight:700;line-height:1.3}.send-review-party-addr{width:100%;color:var(--wi-texticon-primary);font-size:12px;line-height:1.4;word-break:break-all}.send-review-section{display:flex;flex-direction:column;gap:8px;width:100%}.send-review-section-title{margin:0;color:var(--wi-texticon-primary);font-size:15px;font-weight:700;line-height:1.6}.send-review-row{display:flex;align-items:flex-start;gap:20px;padding:2px 0}.send-review-row-label{flex-shrink:0;min-width:100px;color:var(--wi-texticon-tertiary);font-size:13px;line-height:1.3;white-space:nowrap}.send-review-row-value{flex:1;min-width:0;color:var(--wi-texticon-primary);font-size:13px;line-height:1.3;text-align:right;word-break:break-all}.send-review-row-value--accent{color:var(--wi-primary)}.send-review-network{display:inline-flex;align-items:center;gap:4px;justify-content:flex-end}.send-review-network-dot{width:6px;height:6px;border-radius:999px;background:var(--wi-primary);flex-shrink:0}.send-footer--review{display:flex;gap:8px}.send-review-btn{flex:1;min-width:0;min-height:48px;padding:12px 16px;border-radius:12px;font:inherit;font-size:16px;font-weight:700;line-height:1.3;cursor:pointer;transition:opacity .15s ease,transform .15s ease}.send-review-btn:disabled{cursor:not-allowed;opacity:.55}.send-review-btn--cancel{background:transparent;border:1px solid var(--wi-primary);color:var(--wi-primary)}.send-review-btn--confirm{background:var(--wi-primary);border:1px solid var(--wi-primary);color:var(--wi-primary-contrast, #001410)}.send-review-btn:not(:disabled):hover{transform:translateY(-1px)}
7
- `);import{Fragment as oa,jsx as u,jsxs as k}from"react/jsx-runtime";var qi=1500,Zi=120;function Jn(e){return`${e.chainId}:${e.address.toLowerCase()}`}function er(e,t){return e.name||`Account ${(e.index??t)+1}`}function tr(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Yi(e){return new Promise(t=>setTimeout(t,e))}function Ki(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}function Qi(e){return!!(e.token||e.recipient||e.amount)}function no(e,t,o=10){if(t<=0)return e.toString();let n=10n**BigInt(t),r=e/n,i=e%n;if(i===0n)return r.toString();let l=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(o,t)));return l=l.replace(/0+$/,""),l?`${r.toString()}.${l}`:r.toString()}function eo(e,t){return no(e,t,6)}function to(e){return no(e,9,2)}function Xi(e){return e.toLocaleString("en-US")}function Ji(e){return e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function ea(e){return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function ta(){return k("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[u("path",{d:"M4.5 4.5C4.5 3.67 5.17 3 6 3h8.25c.69 0 1.25.56 1.25 1.25V16.5H6A1.5 1.5 0 0 1 4.5 15V4.5Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),u("path",{d:"M4.5 14.5C4.5 13.67 5.17 13 6 13h9.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),u("path",{d:"M8 6.5h4M8 9h3",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function na(){return k("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none","aria-hidden":"true",children:[u("circle",{cx:"28",cy:"28",r:"28",fill:"var(--wi-primary)"}),u("path",{d:"M17 28.5L24.2 35.5L39 20.5",stroke:"var(--wi-primary-contrast, #001410)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function pn({env:e,theme:t="dark",walletAddress:o,accountName:n,accounts:r=[],token:i,tokens:s=[],onTokenChange:l,sendTransaction:d,getTransactionReceipt:c,estimateGas:a,onSuccess:p,onConfirmSuccess:b,onOutlink:h}){let[x,g]=S.useState(""),[w,C]=S.useState(""),[M,T]=S.useState(""),[L,W]=S.useState({}),[y,I]=S.useState(""),[P,N]=S.useState(!1),[q,B]=S.useState(!1),[ve,We]=S.useState(!1),[te,Pe]=S.useState("account"),Ie=S.useRef(void 0),K=S.useRef(void 0),Qe=S.useRef(null),Xe=S.useRef(null),[fe,Je]=S.useState(()=>St(o)),[ye,X]=S.useState("idle"),[Z,Ge]=S.useState(null),[de,Be]=S.useState(!1),[ke,pe]=S.useState(""),Ce=S.useRef(0),[J,Te]=S.useState(null),[ne,it]=S.useState(""),Ne=Gn(i),et=S.useMemo(()=>BigInt(i.quantity.numeric||"0"),[i.quantity.numeric]),Ue=S.useMemo(()=>gt(i.quantity.numeric,i.quantity.decimals),[i.quantity.numeric,i.quantity.decimals]),qe=S.useMemo(()=>r.filter(f=>f.address.toLowerCase()!==o.toLowerCase()),[r,o]),at=S.useMemo(()=>{let f=new Map;return qe.forEach((R,F)=>{f.set(R.address.toLowerCase(),{account:R,index:F})}),f},[qe]),Me=qe.length>0,Ze=S.useMemo(()=>ge(e),[e]),Ae=t==="dark"?"1A1A2E":"F3F6F8",tt=s.length>0?s:[i],Ye=tt.length>1&&!!l,{transactionUrl:_e,chainInfo:ue}=Zo(Ze,i.chainId,y||void 0,!0),Oe=ue?.currency_symbol??"",Le=ue?.name??`Chain ID ${i.chainId}`;S.useEffect(()=>{T(""),W({}),I(""),X("idle"),Ge(null),pe(""),Be(!1),Ce.current+=1},[i.address,i.chainId,x,w]),S.useEffect(()=>{C(""),N(!1)},[i.address,i.chainId]),S.useEffect(()=>{Je(St(o))},[o]),S.useEffect(()=>()=>{clearTimeout(Ie.current),clearTimeout(K.current)},[]),S.useEffect(()=>{!Me&&te==="account"&&Pe("recent")},[te,Me]),S.useEffect(()=>{let f=window.visualViewport,R=Qe.current;if(!f||!R)return;let F=()=>{let se=document.activeElement;return R.contains(se)&&(se instanceof HTMLInputElement||se instanceof HTMLTextAreaElement)},O=48,j=()=>{R.style.paddingBottom=""},oe=()=>{if(!F()){j();return}let se=Math.max(0,window.innerHeight-f.height-f.offsetTop);se>0?R.style.paddingBottom=`${se+O}px`:j();let dt=document.activeElement;dt instanceof HTMLElement&&requestAnimationFrame(()=>{let Ft=dt.getBoundingClientRect(),en=R.getBoundingClientRect().bottom-se-O,Wt=Ft.bottom-en;Wt>0&&R.scrollBy({top:Wt,behavior:"smooth"})})},ct=()=>{setTimeout(()=>{F()||j()},0)};return f.addEventListener("resize",oe),window.addEventListener("resize",oe),R.addEventListener("focusout",ct),()=>{f.removeEventListener("resize",oe),window.removeEventListener("resize",oe),R.removeEventListener("focusout",ct),j()}},[]);let ze=S.useCallback(()=>{clearTimeout(K.current),K.current=setTimeout(()=>{Xe.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},10)},[]),Mn=S.useCallback(()=>{C(Kn(i.quantity.numeric,i.quantity.decimals))},[i.quantity.numeric,i.quantity.decimals]),Kt=S.useCallback(f=>{g(f),B(!1)},[]),Qt=S.useCallback(()=>{let f={},R=x.trim(),F=Yn(w,i.quantity.decimals),O;return R?Vt(R)||(f.recipient="Enter a valid EVM recipient address."):f.recipient="Enter a recipient address.","error"in F?f.amount=F.error:(O=F.value,O>et&&(f.amount="Amount exceeds available balance.")),!Ne&&!Vt(i.address)&&(f.token="Token contract address is invalid."),{errors:f,rawAmount:O,trimmedRecipient:R}},[w,et,Ne,x,i.address,i.quantity.decimals]),Xt=S.useCallback(async()=>{if(y)try{await navigator.clipboard.writeText(y),We(!0),clearTimeout(Ie.current),Ie.current=setTimeout(()=>We(!1),2e3)}catch{}},[y]),st=S.useCallback(()=>{if(!_e||!y)return;let f=O=>{typeof window>"u"||window.open(O,"_blank","noopener,noreferrer")};if(!h){f(_e);return}let R=h(_e,{category:"send",origin:"send-transaction",payload:{chainId:i.chainId,txHash:y}});if(R&&(typeof R=="object"||typeof R=="function")&&typeof R.then=="function"){let O=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;R.then(j=>{if(j===null){O?.close();return}let oe=j??_e;if(O)try{O.location.href=oe}catch{O.close(),f(oe)}else f(oe)});return}let F=R;F!==null&&f(F??_e)},[h,i.chainId,_e,y]),lt=S.useCallback((f,R)=>Ne?{to:f,value:R,chainId:i.chainId,from:o}:{to:$t(i.address),data:Qn(f,R),value:0n,chainId:i.chainId,from:o},[Ne,i.address,i.chainId,o]),kt=S.useCallback(async(f,R,F)=>{if(!a&&!F)return;let O=++Ce.current;Be(!0),pe("");try{let j=lt(f,R),oe=a?await a(j):await Xo(F,j);if(Ce.current!==O)return;Ge(oe)}catch(j){if(Ce.current!==O)return;pe(Xn(j,{nativeSymbol:Oe||void 0,networkName:Le,tokenSymbol:i.symbol},"Failed to estimate gas."))}finally{Ce.current===O&&Be(!1)}},[lt,a,Oe,Le,i.symbol]),Jt=S.useCallback(f=>{if(f.preventDefault(),T(""),I(""),!d){X("error"),T("Sending is not available for this wallet.");return}let{errors:R,rawAmount:F,trimmedRecipient:O}=Qt();if(W(R),Qi(R)||F===void 0){X("error");return}let j=O;Te(F),it(j),Ge(null),pe(""),X("review")},[d,Qt]);S.useEffect(()=>{ye==="review"&&(!ne||J===null||Z===null&&(de||ke||!a&&!ue?.rpc||kt(ne,J,ue?.rpc)))},[ue?.rpc,a,kt,Z,ke,de,J,ne,ye]);let _t=S.useCallback(async()=>{if(!(!d||!ne||J===null)){T(""),I("");try{X("submitting");let f=await d(lt(ne,J));if(I(f),X("confirming"),Je(qn(o,ne)),p?.(f),!c){X("success");return}for(let R=0;R<Zi;R+=1){let F=await c({hash:f,chainId:i.chainId}).catch(()=>null);if(F){if(Ki(F)){X("error"),T("Transaction reverted on-chain.");return}X("success");return}await Yi(qi)}X("error"),T("Transaction receipt was not found. Please check again later.")}catch(f){X("error"),T(Xn(f,{nativeSymbol:Oe||void 0,networkName:Le,tokenSymbol:i.symbol}))}}},[lt,c,Oe,Le,p,J,ne,d,i.chainId,i.symbol,o]),An=S.useCallback(()=>{Ce.current+=1,Ge(null),pe(""),Be(!1),T(""),X("idle")},[]),Ot=et<=0n||!x.trim()||!w.trim();if(ye==="review"||ye==="submitting"){let f=ye==="submitting",R=J!==null?no(J,i.quantity.decimals):w.trim(),F=n?.trim()||`Account ${(r[0]?.index??0)+1}`,O="\u2014",j=Oe||(Ne?i.symbol:""),oe=ue?.currency_decimals??(Ne?i.quantity.decimals:18),ct=Z?Ji(Z):null,se=Z?ea(Z):null,dt=se!==null&&j?`${eo(se,oe)} ${j}`:O,Ft=Z?Xi(Z.gasLimit):O,Dt=Z?.maxPriorityFeePerGas!==void 0?`${to(Z.maxPriorityFeePerGas)} Gwei`:O,en=Z?.maxFeePerGas!==void 0?`${to(Z.maxFeePerGas)} Gwei`:O,Wt=Z?.gasPrice!==void 0?`${to(Z.gasPrice)} Gwei`:O,ko=`${R} ${i.symbol}`,tn=(()=>{if(!Z||se===null)return O;if(Ne&&J!==null){let Ct=J+se;return`${eo(Ct,oe)} ${j||i.symbol}`}return j?`${eo(se,oe)} ${j}`:O})();return k("div",{className:"send-page send-page--review",children:[k("div",{className:"send-scroll send-review-scroll","data-vaul-no-drag":!0,children:[k("div",{className:"send-review-amount",children:[u("img",{className:"send-review-amount-icon",src:i.icon_url,alt:"",width:32,height:32,draggable:!1,onError:Ct=>{Ct.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),k("span",{className:"send-review-amount-value",children:[R," ",i.symbol]})]}),k("div",{className:"send-review-parties",children:[k("div",{className:"send-review-party",children:[u("span",{className:"send-review-party-label",children:"From"}),k("div",{className:"send-review-party-info",children:[u("span",{className:"send-review-party-name",children:F}),u("span",{className:"send-review-party-addr",children:o})]})]}),k("div",{className:"send-review-party",children:[u("span",{className:"send-review-party-label",children:"To"}),u("div",{className:"send-review-party-info",children:u("span",{className:"send-review-party-addr",children:ne})})]})]}),k("section",{className:"send-review-section",children:[u("h3",{className:"send-review-section-title",children:"Summary"}),k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Network"}),k("span",{className:"send-review-row-value send-review-network",children:[u("span",{className:"send-review-network-dot","aria-hidden":!0}),Le]})]}),k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Est. Tx Fee"}),u("span",{className:"send-review-row-value",children:de?"\u2026":dt})]}),ct==="dynamic"?k(oa,{children:[k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Max Priority Fee"}),u("span",{className:"send-review-row-value",children:de?"\u2026":Dt})]}),k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Max Gas Fee"}),u("span",{className:"send-review-row-value",children:de?"\u2026":en})]})]}):ct==="legacy"?k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Gas Price"}),u("span",{className:"send-review-row-value",children:de?"\u2026":Wt})]}):null,k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Gas Limit"}),u("span",{className:"send-review-row-value",children:de?"\u2026":Ft})]})]}),k("section",{className:"send-review-section",children:[u("h3",{className:"send-review-section-title",children:"Total"}),k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Total Amount"}),u("span",{className:"send-review-row-value",children:ko})]}),k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Max. Total Amount"}),u("span",{className:"send-review-row-value",children:de?"\u2026":tn})]})]}),ke&&u("div",{className:"send-message send-message--error",role:"alert",children:ke}),M&&u("div",{className:"send-message send-message--error",role:"alert",children:M})]}),k("div",{className:"send-footer send-footer--review",children:[u("button",{type:"button",className:"send-review-btn send-review-btn--cancel",onClick:An,disabled:f,children:"Cancel"}),u("button",{type:"button",className:"send-review-btn send-review-btn--confirm",onClick:_t,disabled:f,children:f?"Sending...":"Send"})]})]})}if((ye==="confirming"||ye==="success")&&y){let f=ye==="success";return k("div",{className:"send-page send-page--success",children:[k("div",{className:"send-success-body","data-vaul-no-drag":!0,children:[u("div",{className:"send-success-icon","data-pending":!f||void 0,children:f?u(na,{}):u("span",{className:"send-success-spinner"})}),k("div",{className:"send-success-copy",children:[u("h3",{className:"send-success-title",children:f?"Transaction Complete":"Transaction in Progress"}),u("p",{className:"send-success-desc",children:f?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),k("div",{className:"send-success-hash-card",children:[u("span",{className:"send-success-hash-label",children:"Transaction Hash"}),k("div",{className:"send-success-hash-row","data-vaul-no-drag":!0,children:[u("button",{type:"button",className:"send-success-hash-link",onClick:st,"aria-label":"Open transaction in explorer",children:Re(y)}),u("button",{type:"button",className:"send-success-copy-btn",onClick:Xt,"aria-label":"Copy transaction hash",children:ve?u(zt,{size:16}):"Copy"})]})]})]}),u("div",{className:"send-footer",children:u("button",{type:"button",className:"send-submit-btn",onClick:b,disabled:!f,children:f?"All done":"Sending..."})})]})}return k("form",{className:"send-page",onSubmit:Jt,children:[k("div",{className:"send-scroll","data-vaul-no-drag":!0,ref:Qe,children:[k("section",{className:"send-section","aria-label":"Select token to send",children:[u("span",{className:"send-label",children:"Token"}),k("button",{type:"button",className:"send-asset-card",onClick:()=>{Ye&&N(f=>!f)},disabled:!Ye,"aria-expanded":Ye?P:void 0,children:[k("span",{className:"send-asset-left",children:[u("img",{className:"send-asset-icon",src:i.icon_url,alt:i.symbol,width:40,height:40,draggable:!1,onError:f=>{f.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),k("span",{className:"send-asset-info",children:[u("span",{className:"send-asset-symbol",children:i.symbol}),u("span",{className:"send-asset-name",children:i.name})]})]}),k("span",{className:"send-asset-balance",children:[u("span",{className:"send-balance-label",children:"Available"}),k("span",{className:"send-balance-value",children:[Ue," ",i.symbol]})]})]}),Ye&&P&&u("div",{className:"send-token-list",role:"listbox",children:tt.map(f=>{let R=Jn(f)===Jn(i);return k("button",{type:"button",role:"option","aria-selected":R,className:"send-token-option","data-selected":R||void 0,onClick:()=>l?.(f),children:[k("span",{className:"send-asset-left",children:[u("img",{className:"send-token-option-icon",src:f.icon_url,alt:f.symbol,width:28,height:28,draggable:!1,onError:F=>{F.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),k("span",{className:"send-asset-info",children:[u("span",{className:"send-token-option-symbol",children:f.symbol}),u("span",{className:"send-asset-name",children:f.name})]})]}),u("span",{className:"send-token-option-balance",children:gt(f.quantity.numeric,f.quantity.decimals)})]},Jn(f))})}),L.token&&u("p",{className:"send-field-error",role:"alert",children:L.token})]}),k("section",{className:"send-field","aria-label":"Recipient address",children:[u("span",{className:"send-label",children:"To"}),k("div",{className:"send-address-wrap","data-invalid":L.recipient||void 0,children:[u("input",{className:"send-input send-input--address",value:x,onChange:f=>g(f.target.value),placeholder:"0x...",autoComplete:"off",spellCheck:!1,"aria-invalid":!!L.recipient,"aria-describedby":L.recipient?"send-recipient-error":void 0}),u("button",{type:"button",className:"send-address-book-btn",onClick:()=>B(f=>!f),"aria-label":"Open address book","aria-expanded":q,children:u(ta,{})})]}),L.recipient&&u("p",{id:"send-recipient-error",className:"send-field-error",role:"alert",children:L.recipient}),q&&k("div",{className:"send-address-picker",children:[k("div",{className:"send-address-tabs",role:"tablist",children:[Me&&u("button",{type:"button",role:"tab",className:"send-address-tab","data-active":te==="account"||void 0,"aria-selected":te==="account",onClick:()=>Pe("account"),children:"My Account"}),u("button",{type:"button",role:"tab",className:"send-address-tab","data-active":te==="recent"||void 0,"aria-selected":te==="recent",onClick:()=>Pe("recent"),children:"Recent"})]}),Me&&te==="account"?u("div",{className:"send-address-list",children:qe.map((f,R)=>{let F=er(f,R),O=wt(Ze,f.address,{size:56,bg:Ae});return k("button",{type:"button",className:"send-address-option",onClick:()=>Kt(f.address),children:[k("span",{className:"send-address-avatar","aria-hidden":!0,children:[O&&u("img",{className:"send-address-avatar-img",src:O,alt:"",width:36,height:36,draggable:!1,onError:j=>{j.currentTarget.style.display="none"}}),u("span",{className:"send-address-avatar-fallback",children:tr(F)})]}),k("span",{className:"send-address-copy",children:[u("span",{className:"send-address-name",children:F}),u("span",{className:"send-address-value",children:Re(f.address)})]})]},f.address)})}):fe.length>0?u("div",{className:"send-address-list",children:fe.map(f=>{let R=at.get(f.address.toLowerCase()),F=R?er(R.account,R.index):void 0,O=wt(Ze,f.address,{size:56,bg:Ae});return k("button",{type:"button",className:"send-address-option",onClick:()=>Kt(f.address),children:[k("span",{className:"send-address-avatar","aria-hidden":!0,children:[O&&u("img",{className:"send-address-avatar-img",src:O,alt:"",width:36,height:36,draggable:!1,onError:j=>{j.currentTarget.style.display="none"}}),u("span",{className:"send-address-avatar-fallback",children:F?tr(F):f.address.slice(2,4).toUpperCase()})]}),k("span",{className:"send-address-copy",children:[u("span",{className:"send-address-name",children:F??Re(f.address)}),u("span",{className:"send-address-value",children:R?Re(R.account.address):"Recently sent"})]})]},f.address)})}):u("div",{className:"send-address-empty",children:"No Send History"})]})]}),k("section",{className:"send-field","aria-labelledby":"send-amount-label",children:[k("span",{className:"send-label-row",children:[u("span",{id:"send-amount-label",className:"send-label",children:"Amount"}),u("button",{type:"button",className:"send-max-btn",onClick:Mn,disabled:et<=0n,children:"Max"})]}),k("div",{className:"send-amount-wrap","data-invalid":L.amount||void 0,children:[u("input",{ref:Xe,className:"send-input send-input--amount",value:w,onChange:f=>C(f.target.value),onFocus:ze,placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-labelledby":"send-amount-label","aria-invalid":!!L.amount,"aria-describedby":L.amount?"send-amount-error":void 0}),u("span",{className:"send-amount-symbol",children:i.symbol})]}),L.amount&&u("p",{id:"send-amount-error",className:"send-field-error",role:"alert",children:L.amount})]}),k("div",{className:"send-meta",children:[u("span",{children:"From"}),u("span",{children:Re(o)})]}),k("div",{className:"send-meta",children:[u("span",{children:"Network"}),k("span",{children:["Chain ID ",i.chainId]})]}),M&&u("div",{className:"send-message send-message--error",role:"alert",children:M})]}),u("div",{className:"send-footer",children:u("button",{type:"submit",className:"send-submit-btn","data-disabled":Ot||void 0,"aria-disabled":Ot,children:"Send"})})]})}import*as nr from"@radix-ui/react-popover";import{Drawer as ra}from"vaul";import{jsx as mn,jsxs as ia}from"react/jsx-runtime";function or({asChild:e,className:t,children:o}){let{isMobile:n,theme:r,walletAddress:i}=nt(),s=o!=null,l=e??!0,d=s?o:ia("button",{type:"button",className:Y("wi-trigger-btn",t),"data-theme":r,"data-mobile":n||void 0,children:[mn(Wo,{size:n?14:16}),mn("span",{className:"wi-trigger-address",children:Re(i)})]});return n?mn(ra.Trigger,{asChild:l,children:d}):mn(nr.Trigger,{asChild:l,children:d})}import*as H from"react";import*as kn from"@radix-ui/react-popover";import{Drawer as yn}from"vaul";import Gt from"bignumber.js";import{useQueries as aa}from"@tanstack/react-query";import{useMemo as sa}from"react";var oo="user-balance";async function la(e,t,o,n){let r=new URLSearchParams({networkId:`eip155:${t}`,account:o}),i=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:n});if(!i.ok)throw new Error(`Failed to fetch token balance: ${i.status}`);let s=await i.json();if(s.code!==200)throw new Error(`Token balance API error: ${s.code}`);return s.data}function Et(e,t,o=!0){let n=Se[e],r=me[e],i=[r.cross,r.bsc],s=aa({queries:i.map(a=>({queryKey:[oo,e,t,a],queryFn:({signal:p})=>la(n,a,t,p),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1}))}),l=s.some(a=>a.isLoading),d=s.some(a=>a.isError);return{tokens:sa(()=>{let a=[];for(let p of s)p.data&&a.push(...p.data);return a},[s]),isLoading:l,isError:d}}import{useQuery as ca,useQueries as da}from"@tanstack/react-query";import{useMemo as pa}from"react";var ma="forge-holdings",fa="forge-token-image";async function ua(e,t,o){let n=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:o});if(!n.ok)throw new Error(`Failed to fetch forge holdings: ${n.status}`);let r=await n.json();if(!r.success)throw new Error("Forge holdings API error");return r.data.items}async function ga(e,t,o){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:o});if(!n.ok)return{address:t,image_url:""};let r=await n.json();return r.success?{address:t,image_url:r.data.token.image_url}:{address:t,image_url:""}}function rr(e,t,o=!0){let n=zn[e],{data:r,...i}=ca({queryKey:[ma,e,t],queryFn:({signal:s})=>ua(n,t,s),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1});return{holdings:r??[],...i}}function ir(e,t,o=!0){let n=zn[e],r=da({queries:t.map(s=>({queryKey:[fa,e,s],queryFn:({signal:l})=>ga(n,s,l),enabled:o,staleTime:1/0}))});return{imageMap:pa(()=>{let s=new Map;for(let l of r)l.data&&s.set(l.data.address,l.data.image_url);return s},[r])}}import{useQuery as wa}from"@tanstack/react-query";import{useMemo as ha}from"react";var ro="token-stats";function ht(e,t){return`${e}:${t.toLowerCase()}`}function Pt(e,t=!0){let o=Se[e],{data:n,...r}=wa({queryKey:[ro,e],queryFn:async({signal:s})=>{let l=await fetch(`${o}/v1/public/token/stats`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Failed to fetch token stats: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token stats API error: ${d.code}`);return d},enabled:t,staleTime:3e4});return{statsMap:ha(()=>{let s=new Map;if(!n?.data)return s;for(let l of n.data){let d=ht(l.chain_id,l.address);s.set(d,l)}return s},[n]),...r}}import{useQuery as ba}from"@tanstack/react-query";import{useMemo as xa}from"react";var va="token-info";function io(e,t){return`${t.toLowerCase()}_${e}`}function ar(e,t=!0){let o=Se[e],{data:n,...r}=ba({queryKey:[va,e],queryFn:async({signal:s})=>{let l=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token info API error: ${d.code}`);return d},enabled:t,staleTime:1/0});return{categoryMap:xa(()=>{let s=new Map;if(!n?.data)return s;for(let l of n.data){let d=io(l.chain_id,l.address);s.set(d,l.category)}return s},[n]),...r}}import{useMemo as ya}from"react";import ao from"bignumber.js";function sr(e,t,o){let{tokens:n,isLoading:r}=Et(e,t,o),{statsMap:i}=Pt(e,o);return ya(()=>{let s=new ao(0);for(let a of n){let p=i.get(ht(a.chainId,a.address));if(!p)continue;let h=new ao(a.quantity.numeric).shiftedBy(-a.quantity.decimals).multipliedBy(new ao(p.price));h.isNaN()||(s=s.plus(h))}let l=s.toFixed(),{displayValue:d,isLowerBound:c}=Fo(l);return{totalUsd:l,displayValue:d,isLowerBound:c,isLoading:r}},[n,i,r])}import{QRCodeSVG as is}from"qrcode.react";function $e(e,t,o,n){if(!n||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let r;try{r=n(t,o)}catch(c){console.error("[dapp-ui] onOutlink threw:",c);return}let i=c=>{typeof window>"u"||window.open(c,"_blank","noopener,noreferrer")};if((c=>!!c&&(typeof c=="object"||typeof c=="function")&&typeof c.then=="function")(r)){let c=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,a=p=>{if(p===null){c?.close();return}let b=p??t;if(c)try{c.location.href=b}catch{c.close(),i(b)}else i(b)};r.then(a,p=>{console.error("[dapp-ui] onOutlink rejected:",p),c?.close()});return}let l=r;if(l===null)return;i(l??t)}import*as vt from"react";import{Drawer as os}from"vaul";import{createContext as ka,useContext as Ca}from"react";var Ht=ka(null);function Ee(){let e=Ca(Ht);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}import{Drawer as Na}from"vaul";import{jsx as lr}from"react/jsx-runtime";function cr({asChild:e,children:t}){let{walletAddress:o}=Ee(),n=t!=null,r=e??!0,i=n?t:lr("button",{type:"button",children:Re(o)});return lr(Na.Trigger,{asChild:r,children:i})}import{Drawer as vn}from"vaul";import*as xe from"react";import{useQueryClient as es}from"@tanstack/react-query";import{useMemo as Ia}from"react";import so from"bignumber.js";import{useQuery as La}from"@tanstack/react-query";import{useMemo as mr}from"react";var fn={dev:"https://stg-cross-game-reward-api.crosstoken.io/api",stage:"https://stg-cross-game-reward-api.crosstoken.io/api",production:"https://cross-game-reward-api.crosstoken.io/api"},dr={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},un={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},gn={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},It={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"},pr={dev:{cross:"https://stg-dex-api.crosstoken.io/dex",crossd:"https://stg-crossd-dex-api.crosstoken.io/dex",forge:"https://stg-forge-dex-api.crosstoken.io/dex"},stage:{cross:"https://stg-dex-api.crosstoken.io/dex",crossd:"https://stg-crossd-dex-api.crosstoken.io/dex",forge:"https://stg-forge-dex-api.crosstoken.io/dex"},production:{cross:"https://dex-api.crosstoken.io/dex",crossd:"https://crossd-dex-api.crosstoken.io/dex",forge:"https://forge-dex-api.crosstoken.io/dex"}};var Ra="wp:reward-pools";function wn(e,t=!0){let o=fn[e],{data:n,...r}=La({queryKey:[Ra,e],queryFn:async({signal:l})=>{let d=await fetch(`${o}/v1/pools`,{cache:"no-store",signal:l});if(!d.ok)throw new Error(`Failed to fetch pools: ${d.status}`);let c=await d.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),i=mr(()=>n?.data.pools.filter(l=>l.pool_type==="CrossPool")??[],[n]),s=mr(()=>n?.data.pools.filter(l=>l.pool_type==="GamePool")??[],[n]);return{crossPools:i,gamePools:s,allPools:n?.data.pools??[],...r}}import{useQuery as Sa}from"@tanstack/react-query";import{useMemo as Ea}from"react";var Pa="wp:user-deposits";function hn(e,t,o=!0){let n=fn[e],r=o&&!!t,{data:i,...s}=Sa({queryKey:[Pa,e,t],queryFn:async({signal:d})=>{let c=await fetch(`${n}/v1/users/${t}/deposits`,{cache:"no-store",signal:d});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let a=await c.json();if(a.code!==200)throw new Error(`Deposits API error: ${a.code}`);return a},enabled:r,staleTime:0});return{depositMap:Ea(()=>{let d=new Map;if(!i?.data.user_deposits)return d;for(let c of i.data.user_deposits)d.set(c.pool_address.toLowerCase(),c);return d},[i]),deposits:i?.data.user_deposits??[],...s}}import{useQuery as fr}from"@tanstack/react-query";import{useMemo as ur}from"react";function ot(e,t,o,n=!0){let r=pr[e][t],i=n&&!!o,{data:s,...l}=fr({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:x})=>{let g=await fetch(`${r}/pair-info`,{cache:"no-store",signal:x});if(!g.ok)throw new Error(`pair-info fetch failed: ${g.status}`);let w=await g.json();if(w.code!==200)throw new Error(`pair-info API error: ${w.code}`);return w},enabled:n,staleTime:0}),d=s?.data??[],c=ur(()=>{let x=new Map;for(let g of d)x.set(g.pair_address.toLowerCase(),g);return x},[d]),{data:a,...p}=fr({queryKey:["wp:dex-orders",e,t,o],queryFn:async({signal:x})=>{let g=Math.floor(Date.now()/1e3),w=new URLSearchParams({owner:o,size:"200",start_date:"0",end_date:String(g)}),C=await fetch(`${r}/open-order?${w}`,{cache:"no-store",signal:x});if(!C.ok)throw new Error(`open-order fetch failed: ${C.status}`);let M=await C.json();if(M.code!==200)throw new Error(`open-order API error: ${M.code}`);return M.data?.data??[]},enabled:i,staleTime:0}),b=a??[],h=ur(()=>{let x=new Map;for(let g of b){let w=g.pair.toLowerCase();x.has(w)||x.set(w,{buys:[],sells:[]});let C=x.get(w);g.order_side===1?C.buys.push(g):C.sells.push(g)}return x},[b]);return{allPairs:d,pairMap:c,orders:b,ordersByPair:h,isEmpty:b.length===0,isLoading:l.isLoading||p.isLoading}}var Ta=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],gr="var(--wp-green)",wr=4;function hr(e,t,o=!0){let n=o&&!!t,{allPools:r}=wn(e,n),{depositMap:i}=hn(e,t,n),{allPairs:s,pairMap:l,ordersByPair:d}=ot(e,"cross",t,n),{allPairs:c,pairMap:a,ordersByPair:p}=ot(e,"crossd",t,n),{allPairs:b,pairMap:h,ordersByPair:x}=ot(e,"forge",t,n);return Ia(()=>{let g=new Map,w=new Map,C=(y,I)=>{!Number.isFinite(I)||I<=0||w.set(y,(w.get(y)??0)+I)};for(let y of r){let I=Number(y.deposit_token.price);I>0&&g.set(y.deposit_token.symbol,I);for(let P of y.reward_tokens){let N=Number(P.price);N>0&&g.set(P.symbol,N)}}for(let y of[...s,...c,...b]){let I=g.get(y.quote_symbol),P=Number(y.billboard?.price);I&&P>0&&!g.has(y.base_symbol)&&g.set(y.base_symbol,P*I)}for(let y of r){let I=i.get(y.pool_address.toLowerCase());if(!I)continue;let P=new so(I.deposited_amount).shiftedBy(-y.deposit_token.decimals).toNumber();if(C(y.deposit_token.symbol,P),y.reward_tokens.length>0){let N=y.reward_tokens[0],q=new so(I.claimable_reward).shiftedBy(-N.decimals).toNumber();C(N.symbol,q)}}let M=[{pairMap:l,ordersByPair:d},{pairMap:a,ordersByPair:p},{pairMap:h,ordersByPair:x}];for(let{pairMap:y,ordersByPair:I}of M)for(let[P,N]of I){let q=y.get(P);if(q){for(let B of N.buys){let ve=Number(B.amount)-Number(B.filled);C(q.quote_symbol,ve*Number(B.price))}for(let B of N.sells){let ve=Number(B.amount)-Number(B.filled);C(q.base_symbol,ve)}}}let T=[],L=0;for(let[y,I]of w){let P=g.get(y)??0,N=I*P;N>0&&(T.push({symbol:y,usdValue:N}),L+=N)}T.sort((y,I)=>I.usdValue-y.usdValue);let W=[];if(L>0){let y=T.slice(0,wr),I=T.slice(wr);for(let N=0;N<y.length;N++)W.push({symbol:y[N].symbol,usdValue:y[N].usdValue,percentage:Math.round(y[N].usdValue/L*100),color:Ta[N]??gr});if(I.length>0){let N=I.reduce((q,B)=>q+B.usdValue,0);W.push({symbol:"Others",usdValue:N,percentage:Math.round(N/L*100),color:gr})}let P=W.reduce((N,q)=>N+q.percentage,0);P!==100&&W.length>0&&(W[0].percentage+=100-P)}return{totalUsd:L,formattedTotal:L>0?`$${new so(L).toFormat(2)}`:"$0.00",segments:W}},[r,i,s,l,d,c,a,p,b,h,x])}import{jsx as De,jsxs as kr}from"react/jsx-runtime";function br({size:e=22,className:t}){return De("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:De("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function xr({size:e=22,className:t}){return kr("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[De("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),De("path",{d:"M16.17 13.75a7.333 7.333 0 11-1.54-7.59L18.333 9.167",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"})]})}function vr({size:e=12,className:t}){return De("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:De("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function yr({size:e=6,className:t}){return De("svg",{width:e,height:e*4/6,viewBox:"0 0 6 4",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:De("path",{d:"M1 1l2 2 2-2",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function bt({size:e=12,className:t}){return kr("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[De("path",{d:"M5 2H2.5A1.5 1.5 0 0 0 1 3.5V9.5A1.5 1.5 0 0 0 2.5 11H8.5A1.5 1.5 0 0 0 10 9.5V7",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),De("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),De("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import lo from"bignumber.js";var co={included:["CROSS Rewards deposited assets","CROSS Rewards claimable rewards","Gametoken open buy/sell orders"],excluded:["Forge LP value","Wallet balances outside Portfolio"]};function Cr(e){return e!=="production"}function Nr(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function po(e,t){let o=new lo(e).shiftedBy(-t);return!o.isFinite()||o.isZero()?"0":o.isGreaterThanOrEqualTo(1)?o.toFormat(2,lo.ROUND_DOWN):o.toFormat(4,lo.ROUND_DOWN)}import{useQuery as Ma}from"@tanstack/react-query";import{useMemo as Aa}from"react";var _a="wp:token-info";function bn(e,t=!0){let o=Se[e],n=me[e].cross,{data:r,...i}=Ma({queryKey:[_a,e],queryFn:async({signal:c})=>{let a=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:c});if(!a.ok)throw new Error(`Failed to fetch token info: ${a.status}`);let p=await a.json();if(p.code!==200)throw new Error(`Token info API error: ${p.code}`);return p},enabled:t,staleTime:300*1e3}),{byChainAddr:s,byChainSym:l}=Aa(()=>{let c=new Map,a=new Map;if(!r?.data)return{byChainAddr:c,byChainSym:a};for(let p of r.data){let b=p.address.toLowerCase();c.set(`${p.chain_id}:${b}`,p),c.set(b,p);let h=p.symbol.replace(/^t/,"").toUpperCase(),x=`${p.chain_id}:${h}`;a.has(x)||a.set(x,p),a.has(h)||a.set(h,p)}return{byChainAddr:c,byChainSym:a}},[r]);return{getTokenImage:(c,a)=>{let p=c.toLowerCase(),b=s.get(`${n}:${p}`);if(b?.image)return b.image;let h=s.get(p);if(h?.image)return h.image;if(a){let x=a.replace(/^t/,"").toUpperCase(),g=l.get(`${n}:${x}`);if(g?.image)return g.image;let w=l.get(x);if(w?.image)return w.image}return""},...i}}import{jsx as xn,jsxs as Lr}from"react/jsx-runtime";function Tt({title:e,icon:t,iconFit:o="cover",isEmpty:n,children:r}){return Lr("div",{className:"wp-svc-card",children:[Lr("div",{className:"wp-svc-card-head",children:[xn("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:o}}),xn("span",{className:"wp-svc-card-title",children:e})]}),n?xn("div",{className:"wp-svc-empty",children:"No assets yet"}):xn("div",{className:"wp-svc-items",children:r})]})}import jt from"bignumber.js";import{jsx as le,jsxs as he}from"react/jsx-runtime";var Oa="CROSS Rewards";function Fa(e){return new jt(e||"0").isGreaterThan(0)}function Da(e,t,o){let n=new jt(e||"0").shiftedBy(-t).times(o||"0");return!n.isFinite()||n.isZero()?"$0.00":`$${n.toFormat(2,jt.ROUND_DOWN)}`}function Rr(){let{env:e,walletAddress:t,onOutlink:o}=Ee(),n=!!t,{allPools:r}=wn(e,n),{depositMap:i}=hn(e,t,n),{getTokenImage:s}=bn(e,n),l=(a,p)=>`${dr[e]}/rewards/${a.pool_address}?action=${p}`,d=`${It[e]}/reward.png`,c=r.filter(a=>{let p=i.get(a.pool_address.toLowerCase()),b=p?.deposited_amount??"0",h=p?.claimable_reward??"0";return!(new jt(b).isZero()&&new jt(h).isZero())});return le(Tt,{title:Oa,icon:d,isEmpty:c.length===0,children:c.map(a=>{let p=i.get(a.pool_address.toLowerCase()),b=p?.deposited_amount??"0",h=p?.claimable_reward??"0",x=l(a,"withdraw"),g=l(a,"claim"),w=s(a.deposit_token.address,a.deposit_token.symbol),C=a.reward_tokens[0],M=C?s(C.address,C.symbol):"",T=a.reward_tokens.map(N=>N.symbol),L=T.length>0?`${a.deposit_token.symbol}-${T.join("/")}`:a.deposit_token.symbol,W=C?po(h,C.decimals):"0",y=C?.symbol??"Reward",I=C?Da(h,C.decimals,C.price):"$0.00",P=!!p&&Fa(h);return he("article",{className:"wp-item","data-side":"reward",children:[he("div",{className:"wp-item-body",children:[he("div",{className:"wp-item-line",children:[le("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),he("div",{className:"wp-svc-token",children:[he("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&le("img",{className:"wp-svc-token-icon",src:w,alt:""}),M&&le("img",{className:"wp-svc-token-icon",src:M,alt:""})]}),le("span",{children:L})]})]}),he("div",{className:"wp-item-line",children:[le("span",{className:"wp-item-label",children:"Deposited"}),he("div",{className:"wp-svc-token",children:[w&&le("img",{className:"wp-svc-token-icon",src:w,alt:""}),le("span",{children:po(b,a.deposit_token.decimals)})]})]}),he("div",{className:"wp-item-line",children:[he("span",{className:"wp-item-label",children:["Claimable (",y,")"]}),he("div",{className:"wp-svc-token",children:[M&&le("img",{className:"wp-svc-token-icon",src:M,alt:""}),le("span",{children:W}),le("span",{className:"wp-item-usd",children:I})]})]})]}),he("div",{className:"wp-item-tags",children:[he("a",{className:"wp-tag wp-tag--muted",href:x,target:"_blank",rel:"noopener noreferrer",onClick:N=>$e(N,x,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:a,userDeposit:p}},o),children:[le("span",{className:"wp-tag-label",children:"Withdraw"}),le(bt,{size:12,className:"wp-tag-icon"})]}),he("a",{className:"wp-tag wp-tag--mint","data-disabled":!P||void 0,"aria-disabled":!P||void 0,href:P?g:void 0,target:P?"_blank":void 0,rel:P?"noopener noreferrer":void 0,onClick:N=>{if(!P){N.preventDefault();return}$e(N,g,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:a,userDeposit:p}},o)},children:[le("span",{className:"wp-tag-label",children:"Claim"}),le(bt,{size:12,className:"wp-tag-icon"})]})]})]},a.pool_address)})})}import Sr from"bignumber.js";import{Fragment as Ba,jsx as ie,jsxs as Ke}from"react/jsx-runtime";function Er(e){let t=new Sr(e);if(t.isNaN())return e;let o=t.decimalPlaces()??0;return t.toFormat(o)}function Wa(e){let t=new Sr(e.amount).minus(e.filled);return Er(t.toString())}function Pr({market:e,pairMap:t,ordersByPair:o,getDexUrl:n,getTokenImage:r}){let{onOutlink:i}=Ee(),s=[];for(let[l,d]of o){let c=t.get(l),a=c?r(c.base_address,c.base_symbol):"",p=c?r(c.quote_address,c.quote_symbol):"",b=n(l),h=c?`${c.base_symbol}/${c.quote_symbol}`:"Unknown Pair",x=(g,w)=>Ke("a",{className:"wp-item","data-side":w,href:b,target:"_blank",rel:"noopener noreferrer",onClick:C=>$e(C,b,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:w,order:g,pair:c}},i),children:[Ke("div",{className:"wp-item-body",children:[ie("div",{className:"wp-order-head",children:Ke("div",{className:"wp-svc-token",children:[a&&ie("img",{className:"wp-svc-token-icon",src:a,alt:""}),ie("span",{children:c?.base_symbol??"Token"}),ie("span",{className:"wp-token-subtle",children:h})]})}),Ke("div",{className:"wp-item-line",children:[ie("span",{className:"wp-item-label",children:"Price"}),Ke("div",{className:"wp-svc-token",children:[p&&ie("img",{className:"wp-svc-token-icon",src:p,alt:""}),ie("span",{children:Er(g.price)})]})]}),Ke("div",{className:"wp-item-line",children:[ie("span",{className:"wp-item-label",children:"Amount"}),Ke("div",{className:"wp-svc-token",children:[a&&ie("img",{className:"wp-svc-token-icon",src:a,alt:""}),ie("span",{children:Wa(g)})]})]}),Ke("div",{className:"wp-item-line",children:[ie("span",{className:"wp-item-label",children:"Type"}),ie("span",{className:`wp-order-side wp-order-side--${w}`,children:w==="buy"?"Buy":"Sell"})]})]}),ie("div",{className:"wp-item-tags",children:Ke("span",{className:"wp-tag wp-tag--muted",children:[ie("span",{className:"wp-tag-label",children:"Cancel"}),ie(bt,{size:12,className:"wp-tag-icon"})]})})]},`${w}-${g.order_id}`);for(let g of d.buys)s.push(x(g,"buy"));for(let g of d.sells)s.push(x(g,"sell"))}return ie(Ba,{children:s})}import{jsx as Ir}from"react/jsx-runtime";var za="Gametoken";function $a(e){return e==="cross"?"cross":e==="crossd"?"crossd":"forge"}function Tr(){let{env:e,walletAddress:t}=Ee(),o=!!t,n=ot(e,"cross",t,o),r=ot(e,"crossd",t,o),i=ot(e,"forge",t,o),{getTokenImage:s}=bn(e,o),l=`${It[e]}/dex.png`,d=[{market:"cross",data:n},{market:"crossd",data:r},{market:"forge",data:i}],c=d.every(({data:a})=>a.isEmpty);return Ir(Tt,{title:za,icon:l,isEmpty:c,children:d.map(({market:a,data:p})=>Ir(Pr,{market:a,pairMap:p.pairMap,ordersByPair:p.ordersByPair,getDexUrl:b=>{let h=p.pairMap.get(b.toLowerCase());return`${gn[e]}/gametoken/${$a(a)}/${h?.base_symbol??""}`},getTokenImage:s},a))})}import mo from"bignumber.js";import{useMemo as Za}from"react";import{useQuery as Va}from"@tanstack/react-query";var Ha="wp:forge-pools";function Mr(e,t,o=!0){let n=un[e],r=o&&!!t,{data:i,...s}=Va({queryKey:[Ha,e,t],queryFn:async()=>{let d=await fetch(`${n}/v1/users/${t}/pools`,{cache:"no-store"});if(!d.ok)throw new Error(`forge pools fetch failed: ${d.status}`);return(await d.json()).data?.items??[]},enabled:r,staleTime:0}),l=i??[];return{pools:l,isEmpty:l.length===0,...s}}import{useQueries as ja}from"@tanstack/react-query";import{useMemo as Ga}from"react";var Ua="wp:forge-token-detail";async function qa(e,t){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return o.ok?(await o.json())?.data?.token??null:null}function Ar(e,t,o=!0){let n=un[e],r=ja({queries:t.map(l=>({queryKey:[Ua,e,l],queryFn:()=>qa(n,l),enabled:o&&!!l,staleTime:3e4}))}),i=Ga(()=>{let l=new Map;for(let d=0;d<r.length;d++){let c=r[d]?.data,a=t[d];c&&a&&l.set(a.toLowerCase(),c)}return l},[r,t]),s=r.some(l=>l.isLoading);return{detailMap:i,isLoading:s}}import{jsx as be,jsxs as xt}from"react/jsx-runtime";var Ya="Forge",Ka=18,Qa="https://contents.crosstoken.io/wallet/token/images/FT.png";function Xa(e){if(!e||e==="0")return"0";let t=new mo(e).shiftedBy(-Ka);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,mo.ROUND_DOWN):t.toFormat(4,mo.ROUND_DOWN)}function Ja(e){let t=Number(e);return!Number.isFinite(t)||t<=0?"0%":t>=1?`${(Math.floor(t*100)/100).toFixed(2)}%`:`${(Math.floor(t*1e4)/1e4).toFixed(4)}%`}function _r(){let{env:e,walletAddress:t,onOutlink:o}=Ee(),n=!!t,{pools:r,isEmpty:i}=Mr(e,t,n),s=Za(()=>r.map(a=>a.token.address),[r]),{detailMap:l}=Ar(e,s,n&&s.length>0),d=a=>`${gn[e]}/forge/token/${a.token.address}`,c=`${It[e]}/forge.png`;return be(Tt,{title:Ya,icon:c,iconFit:"contain",isEmpty:i,children:r.map(a=>{let p=l.get(a.token.address.toLowerCase()),b=p?.image_url||p?.image||a.token.image||Qa,h=p?.symbol||a.token.symbol,x=d(a);return xt("a",{className:"wp-item","data-side":"lp",href:x,target:"_blank",rel:"noopener noreferrer",onClick:g=>$e(g,x,{category:"portfolio",origin:"portfolio-forge",payload:{pool:a,tokenDetail:p}},o),children:[xt("div",{className:"wp-item-body",children:[xt("div",{className:"wp-item-line",children:[be("span",{className:"wp-item-label",children:"Asset"}),xt("div",{className:"wp-svc-token",children:[be("img",{className:"wp-svc-token-icon",src:b,alt:""}),be("span",{children:h}),p?.name&&be("span",{className:"wp-token-subtle",children:p.name})]})]}),xt("div",{className:"wp-item-line",children:[be("span",{className:"wp-item-label",children:"LP Balance"}),be("div",{className:"wp-svc-token",children:be("span",{children:Xa(a.lp_balance)})})]}),xt("div",{className:"wp-item-line",children:[be("span",{className:"wp-item-label",children:"Ownership"}),be("span",{className:"wp-line-value",children:Ja(a.pool_ownership)})]})]}),be("div",{className:"wp-item-tags",children:xt("span",{className:"wp-tag wp-tag--muted",children:[be("span",{className:"wp-tag-label",children:"Withdraw"}),be(bt,{size:12,className:"wp-tag-icon"})]})})]},a.pair_address)})})}A(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--cck-surface-bg, #202530);--wp-card: var(--cck-surface-default, #252b39);--wp-control: #292f40;--wp-border: var(--cck-border-default, #292f40);--wp-text: var(--cck-texticon-primary, #ffffff);--wp-text-60: var(--cck-texticon-secondary, #d3d7df);--wp-text-40: #8c97ad;--wp-text-30: var(--cck-texticon-tertiary, #717d97);--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: #00d4aa;--wp-green: var(--cck-primary, #019d92);--wp-red: var(--cck-error, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #9b8cef;--wp-claim-primary-text: #202530;--wp-claim-secondary-bg: var(--wp-control);--wp-claim-success: #00d4aa;--wp-claim-success-soft: rgba(0, 212, 170, .18);--wp-claim-error: #ff3aa3;--wp-claim-error-soft: rgba(255, 58, 163, .16)}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: #e6edf4;--wp-card: #ffffff;--wp-control: #edf2f6;--wp-border: #d6dee8;--wp-text: var(--cck-texticon-primary, #192023);--wp-text-60: var(--cck-texticon-secondary, #4c5863);--wp-text-40: #8c97ad;--wp-text-30: var(--cck-texticon-tertiary, #a0a9b8);--wp-chrome-text: var(--cck-texticon-primary, #192023);--wp-card-shadow: 0 1px 2px rgba(25, 32, 35, .04), 0 8px 24px rgba(25, 32, 35, .05);--wp-tooltip-bg: #192023;--wp-tooltip-text: #ffffff;--wp-mint: #00d4aa;--wp-green: var(--cck-primary, #019d92);--wp-red: var(--cck-error, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #7346f3;--wp-claim-primary-text: #ffffff;--wp-claim-secondary-bg: #ffffff;--wp-claim-success: #019d92;--wp-claim-success-soft: rgba(1, 157, 146, .15);--wp-claim-error: #e70077;--wp-claim-error-soft: rgba(231, 0, 119, .12)}.wp-fullscreen{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:center;gap:20px;height:60px;padding:0 20px;flex-shrink:0}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-chrome-text);flex-shrink:0}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: hsl(221.3 24.6% 25.5%)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:16px;font-weight:600;line-height:24px;letter-spacing:.15px;text-align:center;color:var(--wp-chrome-text);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-wallet-name{flex:1;min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:160%;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-top{flex-shrink:0;padding:0 16px 16px;display:flex;flex-direction:column;gap:16px}.wp-identity{display:flex;flex-direction:column;gap:8px}.wp-address{display:inline-flex;align-items:center;gap:8px}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40)}.wp-total{font-size:28px;font-weight:600;line-height:1.3;color:var(--wp-text);margin:0}.wp-asset{display:flex;flex-direction:column;gap:8px}.wp-asset-head{display:flex;align-items:center;gap:4px}.wp-asset-head-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-asset-head-icon{display:inline-flex;color:var(--wp-text-40)}.wp-bar{display:flex;height:20px;border-radius:4px;overflow:hidden}.wp-bar-seg{display:flex;align-items:center;justify-content:center;min-width:8px}.wp-bar-seg-pct{font-size:10px;font-weight:400;line-height:1.3;color:#fff;white-space:nowrap}.wp-legend{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}.wp-legend-item{display:flex;align-items:center;gap:4px}.wp-legend-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.wp-legend-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-tabs{flex-shrink:0;padding:8px 16px}.wp-tabs-inner{display:flex;align-items:center;padding:0 2px}.wp-tabs-list{display:flex;gap:20px;flex:1}.wp-tab{display:flex;flex-direction:column;align-items:center;justify-content:space-between;height:44px;padding-top:12px;background:transparent;border:none;cursor:pointer}.wp-tab-text{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text-30);white-space:nowrap}.wp-tab[data-active=true] .wp-tab-text{color:var(--wp-mint)}.wp-tab-bar{width:20px;height:4px;border-radius:2px;background:var(--wp-mint);opacity:0}.wp-tab[data-active=true] .wp-tab-bar{opacity:1}.wp-tabs-filter-wrap{position:relative;display:flex;align-items:center;width:44px;height:44px;flex-shrink:0}.wp-tabs-filter-grad{position:absolute;inset:0;background:linear-gradient(to left,var(--wp-bg) 74%,transparent);pointer-events:none}.wp-tabs-filter{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text-40)}.wp-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.08) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:#ffffff14;border-radius:4px}.wp-body-inner{padding:0 16px 128px;display:flex;flex-direction:column;gap:24px}.wp-summary-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box}.wp-summary-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.wp-address{display:inline-flex;align-items:center;gap:8px;min-width:0}.wp-address-avatar{width:16px;height:16px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 68% 34%,#ff78d1 0 18%,transparent 19%),radial-gradient(circle at 34% 66%,#00d4aa 0 20%,transparent 21%),linear-gradient(135deg,#7346f3,#0488fc)}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40);flex-shrink:0}.wp-summary-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;background:#019d921a;color:var(--wp-mint);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;white-space:nowrap}.wp-summary-estimate{position:relative;display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.wp-estimate-info{position:relative;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--wp-text-40);cursor:help}.wp-estimate-tooltip{position:absolute;top:calc(100% + 8px);right:0;z-index:3;display:flex;flex-direction:column;gap:8px;width:min(280px,calc(100vw - 48px));padding:12px;border-radius:8px;background:var(--wp-tooltip-bg);box-shadow:0 12px 32px #0000003d;color:var(--wp-tooltip-text);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-estimate-tooltip-title{display:block;font-size:12px;font-weight:600;line-height:1.3}.wp-estimate-tooltip-group{display:flex;flex-direction:column;gap:4px}.wp-estimate-tooltip-item{display:block;color:#ffffffc7}.wp-estimate-tooltip-item:before{content:"- "}.wp-estimate-info:hover .wp-estimate-tooltip,.wp-estimate-info:focus .wp-estimate-tooltip,.wp-estimate-info:focus-visible .wp-estimate-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-total{font-size:28px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text);margin:0}.wp-svc-card{display:flex;flex-direction:column;gap:12px}.wp-svc-card-head{display:flex;align-items:center;gap:8px}.wp-svc-card-icon{width:20px;height:20px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:16px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:20px;width:100%;padding:20px 16px;border-radius:8px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box}.wp-item{position:relative;display:flex;flex-direction:column;gap:16px;color:inherit;text-decoration:none;cursor:pointer;outline:none;transition:opacity .15s ease}.wp-item+.wp-item{padding-top:20px;border-top:1px solid var(--wp-control)}.wp-item:hover{opacity:.88}.wp-item-body{display:flex;flex-direction:column;gap:8px;min-width:0}.wp-order-head{display:flex;align-items:center;width:100%}.wp-item-line{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-height:18px;min-width:0}.wp-item-label{flex-shrink:0;font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-line-value,.wp-order-side{font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text);white-space:nowrap}.wp-order-side--buy{color:var(--wp-mint)}.wp-order-side--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;min-height:20px}.wp-svc-token>span{font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:16px;height:16px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-token-stack{display:inline-flex;align-items:center;justify-content:flex-end;width:29px;min-width:29px;overflow:visible}.wp-token-stack .wp-svc-token-icon+.wp-svc-token-icon{margin-left:-3.5px}.wp-token-subtle{color:var(--wp-text-40)!important}.wp-order-head .wp-svc-token{justify-content:flex-start}.wp-order-head .wp-svc-token>span:first-of-type{font-size:14px}.wp-item-tags{display:flex;align-items:stretch;gap:8px;width:100%}.wp-tag{appearance:none;display:inline-flex;flex:1 1 0;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:34px;padding:8px 12px;border-radius:999px;border:1px solid var(--wp-border);background:transparent;font-family:inherit;font-size:14px;font-weight:500;line-height:1.3;letter-spacing:0;color:var(--wp-text-40);text-align:center;text-decoration:none;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}a.wp-tag,button.wp-tag{cursor:pointer}.wp-tag:hover{background:var(--wp-control);transform:translateY(-1px)}.wp-tag:focus-visible{outline:2px solid var(--wp-mint);outline-offset:2px}.wp-tag[aria-disabled=true],.wp-tag[data-disabled]{cursor:default;opacity:.48;pointer-events:none}.wp-tag-label{display:inline-flex;align-items:center}.wp-tag-icon{flex-shrink:0;opacity:.85;transition:transform .15s ease,opacity .15s ease}.wp-tag:hover .wp-tag-icon{opacity:1;transform:translate(1px,-1px)}.wp-tag--mint{color:var(--wp-mint);border-color:color-mix(in srgb,var(--wp-mint) 45%,transparent);background:color-mix(in srgb,var(--wp-mint) 10%,transparent)}.wp-tag--mint:hover{background:color-mix(in srgb,var(--wp-mint) 18%,transparent);border-color:var(--wp-mint)}.wp-tag--muted{color:var(--wp-text-40)}.wp-svc-empty{display:flex;align-items:center;justify-content:center;min-height:74px;padding:20px 16px;background:var(--wp-card);border-radius:8px;box-shadow:var(--wp-card-shadow, none);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-30);box-sizing:border-box}.wp-claim-overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:flex-end;justify-content:center;background:#00000094;box-sizing:border-box}.wp-claim-sheet{display:flex;flex-direction:column;width:100%;max-width:375px;max-height:calc(100% - 24px);overflow:hidden;border-radius:24px 24px 0 0;background:var(--wp-bg);color:var(--wp-text);box-shadow:0 -18px 48px #00000042;animation:wp-claim-slide-up .22s ease-out}@keyframes wp-claim-slide-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.wp-claim-grabber{display:flex;align-items:flex-start;justify-content:center;height:38px;min-height:38px;padding-top:12px;box-sizing:border-box}.wp-claim-grabber span{display:block;width:52px;height:5px;border-radius:999px;background:var(--wp-control)}.wp-claim-content{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;padding:20px;box-sizing:border-box}.wp-claim-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;flex-shrink:0}.wp-claim-icon--success{background:var(--wp-claim-success-soft);color:var(--wp-claim-success)}.wp-claim-icon--pending{background:#9b8cef29;color:var(--wp-claim-primary)}.wp-claim-icon--error{background:var(--wp-claim-error-soft);color:var(--wp-claim-error);font-size:30px;font-weight:600;line-height:1}.wp-claim-icon--token{background:#00d4aa29}.wp-claim-icon--token img{width:48px;height:48px;border-radius:50%;object-fit:cover}.wp-claim-icon--token span{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;background:var(--wp-mint);color:#101820;font-size:18px;font-weight:600}.wp-claim-spinner{width:36px;height:36px;border-radius:50%;border:3px solid rgba(155,140,239,.28);border-top-color:var(--wp-claim-primary);animation:wp-claim-spin .8s linear infinite}@keyframes wp-claim-spin{to{transform:rotate(360deg)}}.wp-claim-copy{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;text-align:center}.wp-claim-title{margin:0;font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text)}.wp-claim-desc{max-width:335px;margin:0;font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-40)}.wp-claim-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.wp-claim-error-message{margin:0;color:var(--wp-claim-error);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0}.wp-claim-reward-card{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:60px;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-reward-token{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-claim-reward-token img{width:28px;height:28px;object-fit:cover}.wp-claim-reward-token span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-claim-reward-symbol{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wp-text);font-size:18px;font-weight:600;line-height:1.3;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-reward-amount{flex-shrink:0;color:var(--wp-text);font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-account-row{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-height:40px}.wp-claim-account-row>span{flex-shrink:0;color:var(--wp-text-40);font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account{display:flex;align-items:center;gap:8px;min-width:0}.wp-claim-account strong{overflow:hidden;color:var(--wp-text);font-size:15px;font-weight:600;line-height:1.6;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-account-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 30% 28%,#d87aff 0 12%,transparent 13%),radial-gradient(circle at 68% 28%,#f0a1ff 0 12%,transparent 13%),radial-gradient(circle at 32% 70%,#b561e7 0 13%,transparent 14%),radial-gradient(circle at 70% 70%,#d4a2ff 0 13%,transparent 14%),radial-gradient(circle at 50% 50%,#8c4fc4 0 18%,transparent 19%),#4a315f;box-shadow:inset 0 0 0 3.37px var(--wp-control)}.wp-claim-divider{display:block;width:100%;height:1px;background:var(--wp-border)}.wp-claim-detail-list{display:flex;flex-direction:column;gap:8px;width:100%}.wp-claim-detail-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:20px}.wp-claim-detail-row>span{min-width:0;color:var(--wp-text-40);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-detail-row--sub>span:before{content:"";display:inline-block;width:3px;height:3px;margin:0 8px 3px;background:currentColor}.wp-claim-detail-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list{display:flex;flex-direction:column;gap:8px;width:100%;padding-bottom:8px}.wp-claim-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-list-item>span{flex-shrink:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--wp-text-40);white-space:nowrap}.wp-claim-list-item strong{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;overflow:hidden;color:var(--wp-text);font-size:14px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list-item img{width:16px;height:16px;border-radius:50%;flex-shrink:0}.wp-claim-hash{appearance:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);cursor:pointer;font:inherit}.wp-claim-hash svg{flex-shrink:0;color:var(--wp-text-60)}.wp-claim-gas-card{display:flex;flex-direction:column;gap:4px;width:100%;padding:14px 16px;border-radius:8px;border:1px solid var(--wp-border);background:var(--wp-card);box-sizing:border-box}.wp-claim-gas-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:28px}.wp-claim-gas-row>span{min-width:0;font-size:12px;font-weight:400;line-height:1.3;color:var(--wp-text-40)}.wp-claim-gas-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:12px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-gas-row--primary{min-height:32px}.wp-claim-gas-row--primary>span,.wp-claim-gas-row--primary strong{font-size:14px;color:var(--wp-text)}.wp-claim-fee-label{position:relative;display:inline-flex;align-items:center;text-decoration:underline dotted;text-underline-offset:3px;cursor:help;overflow:visible!important}.wp-claim-fee-tooltip{position:absolute;left:0;bottom:calc(100% + 8px);z-index:2;width:min(260px,calc(100vw - 64px));padding:10px 12px;border-radius:8px;background:var(--wp-tooltip-bg);color:var(--wp-tooltip-text);box-shadow:0 12px 32px #0000003d;font-size:11px;font-weight:400;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-claim-fee-label:hover .wp-claim-fee-tooltip,.wp-claim-fee-label:focus .wp-claim-fee-tooltip,.wp-claim-fee-label:focus-visible .wp-claim-fee-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-claim-actions{display:flex;align-items:center;gap:8px;width:100%}.wp-claim-primary,.wp-claim-secondary{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;height:52px;padding:0 24px;border:none;border-radius:40px;font-family:inherit;font-size:15px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap;cursor:pointer}.wp-claim-primary{background:var(--wp-claim-primary);color:var(--wp-claim-primary-text)}.wp-claim-primary:disabled{cursor:default;opacity:.72}.wp-claim-secondary{background:var(--wp-claim-secondary-bg, var(--wp-control));color:var(--wp-claim-primary)}.wp-claim-actions[data-count="2"] .wp-claim-primary{flex:1 1 0}.wp-claim-actions[data-count="2"] .wp-claim-secondary{flex:0 0 120px}.wp-claim-button-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(32,37,48,.28);border-top-color:var(--wp-claim-primary-text);animation:wp-claim-spin .8s linear infinite}.wp-claim-home-indicator{display:flex;align-items:flex-end;justify-content:center;height:34px;min-height:34px;padding-bottom:8px;box-sizing:border-box}.wp-claim-home-indicator span{display:block;width:134px;height:5px;border-radius:16px;background:var(--wp-text-40)}@media(max-width:359px){.wp-header{gap:12px;padding:0 12px}.wp-total{font-size:24px}.wp-body-inner{padding:0 12px 128px;gap:20px}.wp-svc-items,.wp-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
8
- `);import{Fragment as ns,jsx as G,jsxs as Ve}from"react/jsx-runtime";var fo=5,ts="wp:";function Mt({env:e,theme:t="dark",walletAddress:o,walletName:n,onBack:r,showHeader:i=!0,variant:s="embed",className:l,onOutlink:d}){let c=ge(e),a=!!o,p=es(),b=xe.useId(),h=Cr(c),{formattedTotal:x}=hr(c,o,a),[,g]=xe.useState(fo),[w,C]=xe.useState(!1),M=xe.useCallback(()=>{p.invalidateQueries({predicate:P=>typeof P.queryKey[0]=="string"&&P.queryKey[0].startsWith(ts)})},[p]),T=xe.useCallback(()=>{M(),C(!0),setTimeout(()=>C(!1),600),g(fo)},[M]);xe.useEffect(()=>{if(!a)return;let P=setInterval(()=>{g(N=>N<=1?(T(),fo):N-1)},1e3);return()=>clearInterval(P)},[a,T]);let L=xe.useCallback(()=>{r?.()},[r]),W=a?wt(c,o,{size:64}):void 0,y=xe.useMemo(()=>({env:c,theme:t,open:!0,walletAddress:o,close:L,onOutlink:d}),[c,t,o,L,d]),I=Ve(ns,{children:[i&&Ve("div",{className:"wp-header",children:[Ve("div",{className:"wp-header-account",children:[r?G("button",{type:"button",className:"wp-header-btn",onClick:r,children:G(br,{})}):G("span",{className:"wp-header-avatar","aria-hidden":!0,children:W&&G("img",{src:W,alt:"",className:"wp-header-avatar-img",draggable:!1})}),n&&G("span",{className:"wp-header-wallet-name",title:n,children:n})]}),G("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:T,children:G(xr,{className:w?"wp-spin-once":void 0})})]}),G("div",{className:"wp-body",children:Ve("div",{className:"wp-body-inner",children:[Ve("section",{className:"wp-summary-card","aria-label":"Estimated portfolio value",children:[Ve("div",{className:"wp-summary-head",children:[Ve("div",{className:"wp-address",children:[G("span",{className:"wp-address-avatar","aria-hidden":!0}),G("span",{className:"wp-address-label",children:Nr(o)}),G(yr,{className:"wp-address-chevron"})]}),Ve("div",{className:"wp-summary-estimate",children:[G("span",{className:"wp-summary-badge",children:"Estimated"}),h&&Ve("button",{type:"button",className:"wp-estimate-info","aria-label":"USD estimate details","aria-describedby":b,children:[G(vr,{size:14}),Ve("span",{id:b,role:"tooltip",className:"wp-estimate-tooltip",children:[G("span",{className:"wp-estimate-tooltip-title",children:"USD estimate includes"}),G("span",{className:"wp-estimate-tooltip-group",children:co.included.map(P=>G("span",{className:"wp-estimate-tooltip-item",children:P},P))}),G("span",{className:"wp-estimate-tooltip-title",children:"Not included"}),G("span",{className:"wp-estimate-tooltip-group",children:co.excluded.map(P=>G("span",{className:"wp-estimate-tooltip-item",children:P},P))})]})]})]})]}),G("p",{className:"wp-total",children:x})]}),G(Rr,{}),G(Tr,{}),G(_r,{})]})})]});return G(Ht.Provider,{value:y,children:s==="none"?I:G("div",{className:Y(s==="fullscreen"?"wp-fullscreen":"wp-embed",l),"data-theme":t,children:I})})}import{jsx as uo,jsxs as Or}from"react/jsx-runtime";function Fr({className:e}){let{env:t,theme:o,walletAddress:n,close:r,onOutlink:i}=Ee();return Or(vn.Portal,{children:[uo(vn.Overlay,{className:"wp-overlay"}),Or(vn.Content,{className:Y("wp-fullscreen",e),"data-theme":o,children:[uo(vn.Title,{className:"wp-sr-only",children:"My Portfolio"}),uo(Mt,{env:t,theme:o,walletAddress:n,onBack:r,variant:"none",onOutlink:i})]})]})}import{jsx as Dr}from"react/jsx-runtime";function rs({env:e,theme:t="dark",walletAddress:o,open:n,onOpenChange:r,onOutlink:i,children:s}){let l=ge(e),d=n!==void 0,[c,a]=vt.useState(!1),p=d?n:c,b=vt.useCallback(g=>{d||a(g),r?.(g)},[d,r]),h=vt.useCallback(()=>b(!1),[b]),x=vt.useMemo(()=>({env:l,theme:t,open:p,walletAddress:o,close:h,onOutlink:i}),[l,t,p,o,h,i]);return Dr(Ht.Provider,{value:x,children:Dr(os.Root,{direction:"bottom",open:p,onOpenChange:b,noBodyStyles:!0,children:s})})}var Wr=Object.assign(rs,{Trigger:cr,Content:Fr});import{Fragment as wo,jsx as m,jsxs as E}from"react/jsx-runtime";function go(e,t,o){let n=me[e],r=o.toUpperCase();if(t===n.cross&&r.includes("CROSSD"))return 0;if(t===n.cross&&r==="CROSS")return 1;if(t===n.bsc&&r==="CROSS")return 2}function as(e){return parseInt(e.split(":")[1],10)}function ss(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function ls(e){let t=e.toLowerCase().replace(/^0x/,""),o=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),n=parseInt(o.slice(0,4),16)%360,r=(n+60+parseInt(o.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${n} 85% 65%), hsl(${r} 80% 55%))`}function Br({align:e="end",sideOffset:t=12,className:o,children:n}){let{env:r,theme:i,isMobile:s,open:l,drawerDirection:d,modal:c,showBalance:a,showForgeToken:p,showGameToken:b,showQR:h,qrLogoSrc:x,walletAddress:g,accountName:w,sendAccounts:C,profileImageUrl:M,preferredTokens:T,close:L,onSelectWallet:W,onCopyAddress:y,onDisconnect:I,disconnectLabel:P,termsUrl:N,termsLabel:q,privacyUrl:B,privacyLabel:ve,portalStyle:We,navContent:te,navPosition:Pe,footerContent:Ie,view:K,setView:Qe,selectedSendToken:Xe,setSelectedSendToken:fe,showPortfolio:Je,portfolioTitle:ye,showTotalAssets:X,totalAssetsLabel:Z,sendTransaction:Ge,getTransactionReceipt:de,estimateGas:Be,onOutlink:ke}=nt(),{tokens:pe,isLoading:Ce}=Et(r,g,l&&a),{statsMap:J}=Pt(r,a),{categoryMap:Te}=ar(r,a),ne=a&&X,{displayValue:it,isLowerBound:Ne,isLoading:et}=sr(r,g,l&&ne),[Ue,qe]=H.useState(!1),at=H.useRef(null),[Me,Ze]=H.useState(0),{holdings:Ae,isLoading:tt}=rr(r,g,l&&a&&p),Ye=H.useMemo(()=>Ae.map(v=>v.token),[Ae]),{imageMap:_e}=ir(r,Ye,p&&Ae.length>0),ue=H.useMemo(()=>{let v=[],z=[],V=[],ee=new Map((T??[]).map(($,Q)=>[`${as($.chainId)}:${$.address.toLowerCase()}`,Q]));for(let $ of pe){let Q=go(r,$.chainId,$.symbol)!==void 0,pt=`${$.chainId}:${$.address.toLowerCase()}`,mt=ee.get(pt),_n=new Gt($.quantity.numeric).shiftedBy(-$.quantity.decimals);if(Q)v.push($);else if(mt!==void 0)z.push($);else if(_n.isGreaterThan(0)){if(!b&&Te.get(io($.chainId,$.address))==="game")continue;V.push($)}}return v.sort(($,Q)=>{let pt=go(r,$.chainId,$.symbol)??99,mt=go(r,Q.chainId,Q.symbol)??99;return pt-mt}),z.sort(($,Q)=>{let pt=ee.get(`${$.chainId}:${$.address.toLowerCase()}`)??99,mt=ee.get(`${Q.chainId}:${Q.address.toLowerCase()}`)??99;return pt-mt}),V.sort(($,Q)=>{let pt=J.get(ht($.chainId,$.address)),mt=J.get(ht(Q.chainId,Q.address)),_n=new Gt($.quantity.numeric).shiftedBy(-$.quantity.decimals).multipliedBy(pt?.price??0);return new Gt(Q.quantity.numeric).shiftedBy(-Q.quantity.decimals).multipliedBy(mt?.price??0).minus(_n).toNumber()}),[...v,...z,...V]},[pe,r,J,b,Te,T]),Oe=H.useMemo(()=>{if(!p)return[];let v=new Set(pe.map(z=>z.address.toLowerCase()));return[...Ae].filter(z=>!v.has(z.token.toLowerCase())).sort((z,V)=>{let ee=new Gt(z.value);return new Gt(V.value).minus(ee).toNumber()})},[Ae,p,pe]),Le=H.useRef(!1),ze=H.useCallback(v=>{Le.current=!0,Qe(v)},[Qe]),Mn=H.useCallback(()=>{fe(null),ze("wallet")},[fe,ze]),Kt=H.useCallback(v=>{fe(v),ze("send")},[fe,ze]),Qt=H.useCallback(()=>{fe(null),ze("wallet")},[fe,ze]);H.useEffect(()=>{l||(Le.current=!1)},[l]);let Xt=H.useRef(null);H.useEffect(()=>{let v=Xt.current;if(!v||!s)return;let z=V=>{V.pointerType==="touch"&&V.stopPropagation()};return v.addEventListener("pointerdown",z),()=>v.removeEventListener("pointerdown",z)},[s]);let[st,lt]=H.useState(!1),kt=H.useRef(void 0);H.useEffect(()=>()=>clearTimeout(kt.current),[]),H.useEffect(()=>{let v=at.current;if(!v||Ie===null){Ze(0);return}let z=()=>{Ze(v.offsetHeight)};if(z(),typeof ResizeObserver>"u")return;let V=new ResizeObserver(z);return V.observe(v),()=>V.disconnect()},[Ie]);let Jt=H.useCallback(async()=>{if(!st)try{await navigator.clipboard.writeText(g),lt(!0),clearTimeout(kt.current),kt.current=setTimeout(()=>lt(!1),2e3),y?.(g,!0)}catch{y?.(g,!1)}},[g,y,st]),_t=H.useCallback(v=>{v.currentTarget.setAttribute("data-loaded","true")},[]),An=H.useMemo(()=>({background:ls(g)}),[g]),Ot=H.useMemo(()=>M||wt(r,g,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[M,r,g,i]),f=H.useMemo(()=>ss(it),[it]),R=N||B?E("div",{className:"wi-legal-links",children:[N&&m("a",{className:"wi-legal-link",href:N,target:"_blank",rel:"noopener noreferrer",onClick:v=>$e(v,N,{category:"terms",origin:"terms"},ke),children:q}),N&&B&&m("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),B&&m("a",{className:"wi-legal-link",href:B,target:"_blank",rel:"noopener noreferrer",onClick:v=>$e(v,B,{category:"privacy",origin:"privacy"},ke),children:ve})]}):null,F=I?E("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{I(),L()},children:[m(Bo,{size:12}),m("span",{className:"wi-disconnect-label",children:P})]}):null,O=E("div",{className:Y("wi-view-inner",Le.current&&"wi-view-wallet"),children:[ne&&(()=>{let v=Je;return E(v?"button":"div",{...v?{type:"button",onClick:()=>ze("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":v||void 0,children:[E("div",{className:"wi-total-head",children:[m("span",{className:"wi-total-label",children:Z}),m("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:V=>{V.stopPropagation(),qe(ee=>!ee)},onKeyDown:V=>{(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),V.stopPropagation(),qe(ee=>!ee))},"aria-label":Ue?"Show balance":"Hide balance",children:Ue?m(Go,{}):m(jo,{})})]}),E("div",{className:"wi-total-body",children:[et?m("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):m("div",{className:"wi-total-value","data-hidden":Ue||void 0,children:Ue?m("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):E(wo,{children:[Ne&&m("span",{className:"wi-total-lte",children:"\u2264"}),m("span",{className:"wi-total-currency",children:"$"}),m("span",{className:"wi-total-amount",children:f.main}),f.decimal&&m("span",{className:"wi-total-decimal",children:f.decimal})]})}),v&&m("span",{className:"wi-total-chevron","aria-hidden":!0,children:m(Vo,{size:18})})]})]})})(),Pe==="top"&&te&&m("div",{className:"wi-nav-fixed",children:te}),a&&m("div",{ref:Xt,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:E("div",{className:"wi-token-list",children:[Ce&&Array.from({length:5},(v,z)=>E("div",{className:"wi-skeleton-item",children:[E("div",{className:"wi-skeleton-left",children:[m("div",{className:"wi-skeleton-block wi-skeleton-icon"}),E("div",{className:"wi-skeleton-lines",children:[m("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),m("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),E("div",{className:"wi-skeleton-right",children:[m("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),m("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},z)),!Ce&&ue.length===0&&!p&&m("div",{className:"wi-empty",children:"No Tokens Found"}),ue.map(v=>{let z=J.get(ht(v.chainId,v.address)),V=z?parseFloat(z.percent_change_24h):null,ee=V!==null&&V>=0,$=$n(r,v.chainId);return E("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>Kt(v),"aria-label":`Send ${v.symbol}`,children:[E("div",{className:"wi-token-left",children:[E("div",{className:"wi-token-icon-wrap",children:[m("img",{src:v.icon_url,alt:v.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:_t,onError:Q=>{Q.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),$&&m("img",{src:$,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Q=>{Q.currentTarget.style.display="none"}})]}),E("div",{className:"wi-token-info",children:[m("span",{className:"wi-token-name",children:v.symbol}),z&&E("div",{className:"wi-token-price-row",children:[m("span",{className:"wi-token-price",children:Bn(z.price)}),m("span",{className:"wi-token-change","data-positive":ee,"data-zero":V===0||void 0,children:V!==null&&(V===0?"0%":`${ee?"+":"-"}${(ee?Math.floor:Math.ceil)(Math.abs(V)*100)/100}%`)})]})]})]}),E("div",{className:"wi-token-right",children:[m("span",{className:"wi-token-balance",children:gt(v.quantity.numeric,v.quantity.decimals)}),z&&m("span",{className:"wi-token-value",children:Oo(v.quantity.numeric,v.quantity.decimals,z.price)})]})]},`${v.address}-${v.chainId}`)}),p&&tt&&Array.from({length:3},(v,z)=>E("div",{className:"wi-skeleton-item",children:[E("div",{className:"wi-skeleton-left",children:[m("div",{className:"wi-skeleton-block wi-skeleton-icon"}),E("div",{className:"wi-skeleton-lines",children:[m("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),m("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),E("div",{className:"wi-skeleton-right",children:[m("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),m("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${z}`)),p&&!tt&&!Ce&&ue.length===0&&Oe.length===0&&m("div",{className:"wi-empty",children:"No Tokens Found"}),p&&Oe.map(v=>{let z=_e.get(v.token)||"",V=$n(r,me[r].cross);return E("div",{className:"wi-token-item",children:[E("div",{className:"wi-token-left",children:[E("div",{className:"wi-token-icon-wrap",children:[m("img",{src:z||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:v.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:_t,onError:ee=>{ee.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),V&&m("img",{src:V,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:ee=>{ee.currentTarget.style.display="none"}})]}),E("div",{className:"wi-token-info",children:[m("span",{className:"wi-token-name",children:v.token_name}),m("div",{className:"wi-token-price-row",children:E("span",{className:"wi-token-price",children:[gt(v.current_price,18)," CROSS"]})})]})]}),E("div",{className:"wi-token-right",children:[m("span",{className:"wi-token-balance",children:gt(v.balance,18)}),m("span",{className:"wi-token-value",children:Bn(v.current_value_usd)})]})]},`forge-${v.token}`)})]})}),Pe==="bottom"&&te&&m("div",{className:"wi-nav-fixed",children:te}),F&&m("div",{className:"wi-wallet-disconnect-row",children:F})]},"wallet"),j=Je?m("div",{className:Y("wi-view-inner wi-portfolio-body",Le.current&&"wi-view-portfolio"),children:m(Mt,{env:r,theme:i,walletAddress:g,showHeader:!1,onOutlink:ke})},"portfolio"):null,oe=Xe?m("div",{className:Y("wi-view-inner wi-send-body",Le.current&&"wi-view-send"),children:m(pn,{env:r,theme:i,walletAddress:g,accountName:w,accounts:C,token:Xe,tokens:ue,onTokenChange:fe,sendTransaction:Ge,getTransactionReceipt:de,estimateGas:Be,onConfirmSuccess:Qt,onOutlink:ke})},"send"):null,ct=m("div",{className:Y("wi-view-inner wi-qr-body",Le.current&&"wi-view-qr"),children:E("div",{className:"wi-qr-section",children:[E("div",{className:"wi-qr-card",children:[E("div",{className:"wi-qr-code",children:[m(is,{value:g,size:180,level:"H",marginSize:2,...x&&{imageSettings:{src:x,height:33,width:33,excavate:!0}}}),!x&&m("div",{className:"wi-qr-logo",children:m(Uo,{size:33})})]}),m("p",{className:"wi-qr-address",children:g}),E("button",{type:"button",className:"wi-qr-copy-btn",onClick:Jt,children:[m("span",{className:"wi-qr-copy-icon",children:st?m(zt,{size:16}):m(Vn,{size:16})}),m("span",{className:"wi-qr-copy-text",children:st?"Copied!":"Copy address"})]})]}),R]})},"qr"),se=K==="qr"||K==="portfolio"||K==="send",dt=Ie!==null?m("div",{className:"wi-builtin-footer",children:Ie}):null,Ft=!!W&&w?.trim().toLowerCase()!=="my wallet",Dt=E("div",{className:"wi-account-text",children:[Ft?E("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:W,"aria-label":"Switch account",children:[m("span",{className:"wi-account-name",children:w??"Account 1"}),m("span",{className:"wi-account-switch","aria-hidden":"true",children:m(Ho,{size:12})})]}):m("div",{className:"wi-account-row",children:m("span",{className:"wi-account-name",children:w??"Account 1"})}),E("button",{type:"button",className:"wi-address-row-btn",onClick:Jt,"aria-label":"Copy address",children:[m("span",{className:"wi-account-address",children:Re(g)}),m("span",{className:"wi-account-copy",children:st?m(zt,{size:14}):m(Vn,{size:14})})]})]}),tn=E(wo,{children:[n,se?E("div",{className:"wi-sticky-header",children:[E("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[m("button",{type:"button",className:"wi-header-back",onClick:Mn,"aria-label":"Back",children:m($o,{})}),m("div",{className:"wi-account-block wi-account-block--sub-account",children:Dt}),m("button",{type:"button",className:"wi-header-action",onClick:L,"aria-label":"Close",children:m(Hn,{size:24})})]}),m("hr",{className:"wi-divider"})]}):E("div",{className:"wi-sticky-header",children:[E("div",{className:"wi-header wi-header--wallet",children:[E("div",{className:"wi-account-block",children:[E("div",{className:"wi-avatar",children:[m("div",{className:"wi-avatar-fallback",style:An}),Ot&&m("img",{src:Ot,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:_t,onError:v=>{v.currentTarget.style.display="none"}})]}),Dt]}),E("div",{className:"wi-header-actions",children:[h&&m("button",{type:"button",className:"wi-header-action",onClick:()=>ze("qr"),"aria-label":"Show QR code",children:m(zo,{size:20})}),m("button",{type:"button",className:"wi-header-action",onClick:L,"aria-label":"Close",children:m(Hn,{size:24})})]})]}),m("hr",{className:"wi-divider"})]}),E("div",{className:"wi-view-container",children:[K==="wallet"&&O,K==="qr"&&ct,K==="portfolio"&&j,K==="send"&&oe]}),dt&&K!=="portfolio"&&K!=="send"&&m("div",{className:"wi-sticky-footer",children:m("div",{className:"wi-footer",ref:at,children:dt})})]}),Ct={...We,...Me>0?{"--wi-footer-height":`${Me}px`}:null};return s?E(yn.Portal,{children:[c&&m(yn.Overlay,{className:"wi-drawer-overlay"}),E(yn.Content,{className:Y("wi-drawer-content",o),"data-theme":i,style:Ct,"data-direction":d,"data-no-balance":!a||void 0,"data-has-footer":Me>0||void 0,"data-view":K,children:[m(yn.Title,{className:"wi-sr-only",children:"My Wallet"}),tn]})]}):E(wo,{children:[c&&l&&m("div",{className:"wi-drawer-overlay",onClick:L}),m(kn.Portal,{children:m(kn.Content,{align:e,sideOffset:t,className:Y("wi-popover-content",o),"data-theme":i,style:Ct,"data-no-balance":!a||void 0,"data-has-footer":Me>0||void 0,"data-view":K,children:tn})})]})}import*as zr from"react";function $r({position:e="top",children:t}){let{setNavContent:o,setNavPosition:n}=nt();return zr.useEffect(()=>(o(t),n(e),()=>o(null)),[t,e,o,n]),null}import*as Vr from"react";function Hr({children:e}){let{setFooterContent:t}=nt();return Vr.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}A(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--cck-primary, #019d92);--wi-secondary: var(--cck-secondary, #e70077);--wi-surface-bg: var(--cck-surface-bg, #121212);--wi-surface-default: var(--cck-surface-default, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--cck-surface-subtle, rgba(255, 255, 255, .1));--wi-border-default: var(--cck-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--cck-border-subtle, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--cck-texticon-primary, #ffffff);--wi-texticon-secondary: var(--cck-texticon-secondary, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--cck-texticon-tertiary, rgba(255, 255, 255, .5));--wi-on-primary: var(--cck-on-primary, #ffffff);--wi-error: var(--cck-error, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--cck-primary, #019d92);--wi-secondary: var(--cck-secondary, #e70077);--wi-surface-bg: var(--cck-surface-bg, #ffffff);--wi-surface-default: var(--cck-surface-default, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--cck-surface-subtle, rgba(18, 18, 18, .1));--wi-border-default: var(--cck-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--cck-border-subtle, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--cck-texticon-primary, #121212);--wi-texticon-secondary: var(--cck-texticon-secondary, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--cck-texticon-tertiary, rgba(18, 18, 18, .5));--wi-on-primary: var(--cck-on-primary, #ffffff);--wi-error: var(--cck-error, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
5
+ `);A("");import{jsx as Fn}from"react/jsx-runtime";function Ro({env:e,theme:t="dark",mobileBreakpoint:o=768,domain:n,children:r}){let i=Nt(`(max-width: ${o}px)`),[s,l]=Lt.useState(!1),d=Lt.useCallback(()=>l(!1),[]),c=ge(e),a=Lt.useMemo(()=>({env:c,theme:t,isMobile:i,open:s,domain:n,close:d}),[c,t,i,s,n,d]);return Fn(On.Provider,{value:a,children:i?Fn(xi.Root,{direction:"right",open:s,onOpenChange:l,noBodyStyles:!0,children:r},"drawer"):Fn(Lo.Root,{open:s,onOpenChange:l,children:r},"popover")})}import*as Io from"@radix-ui/react-popover";import{Drawer as yi}from"vaul";import{jsx as we,jsxs as vi}from"react/jsx-runtime";function So({size:e=18}){return vi("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[we("rect",{width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),we("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),we("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),we("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function Eo(){return we("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:we("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Po(){return we("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:we("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as on}from"react/jsx-runtime";function To({asChild:e,children:t,className:o,style:n}){let{isMobile:r,theme:i}=nn(),s=t!=null,l=e??!0,d=o?`al-trigger-btn ${o}`:"al-trigger-btn",c=s?t:on("button",{type:"button",className:d,"data-theme":i,style:n,children:on(So,{size:r?12:18})});return r?on(yi.Trigger,{asChild:l,children:c}):on(Io.Trigger,{asChild:l,children:c})}import*as ft from"react";import*as an from"@radix-ui/react-popover";import{Drawer as Rt}from"vaul";import{useQuery as Ni}from"@tanstack/react-query";var Mo={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json"};var ki="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Ci="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Fe(e,t){return`${e==="production"?Ci:ki}/${t}.png`}function Ao(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://dev-x.crosstoken.io/gametoken/CROSS",stage:"https://stg-x.crosstoken.io/gametoken/CROSS",production:"https://x.crosstoken.io/gametoken/CROSS"},iconUrl:Fe(t,"dex"),order:1e3,type:"gametoken",badge:null,isNew:!1},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg-x.crosstoken.io/forge",stage:"https://stg-x.crosstoken.io/forge",production:"https://x.crosstoken.io/forge"},iconUrl:Fe(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0},{id:"crossd",label:"Bridge (CROSSD)",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:Fe(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:Fe(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg-x.crosstoken.io/rewards",stage:"https://stg-x.crosstoken.io/rewards",production:"https://x.crosstoken.io/rewards"},iconUrl:Fe(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:Fe(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1},{id:"play",label:"Play",description:"Discover and play games on CROSS.",url:{dev:"https://stg-play.cross.nexus",stage:"https://stg-play.cross.nexus",production:"https://play.cross.nexus"},iconUrl:Fe(t,"play"),order:8500,type:"play",badge:null,isNew:!0},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://www.dev.cross.shop/",stage:"https://www.stage.cross.shop/",production:"https://www.cross.shop/"},iconUrl:Fe(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg-x.crosstoken.io/points",stage:"https://stg-x.crosstoken.io/points",production:"https://x.crosstoken.io/points"},iconUrl:Fe(t,"point"),order:1e4,type:"points",badge:null,isNew:!1},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg-wave.crosstoken.io/en",stage:"https://stg-wave.crosstoken.io/en",production:"https://wave.crosstoken.io/en"},iconUrl:Fe(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.crosstoken.io/612055",stage:"https://stg-explorer.crosstoken.io/612055",production:"https://explorer.crosstoken.io/612055"},iconUrl:Fe(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1}]}}function rn(e){let t=ge(e);return Ni({queryKey:["global-menu",t],queryFn:async({signal:o})=>{try{let n=await fetch(Mo[t],{cache:"no-store",signal:o});if(!n.ok)throw new Error(`Failed to fetch global menu: ${n.status}`);return n.json()}catch(n){if(o.aborted)throw n;return Ao(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function K(...e){return e.filter(Boolean).join(" ")}import{jsx as re,jsxs as Bt}from"react/jsx-runtime";function Li(e){return e.id==="cross-staking"||e.type==="cross-staking"}function Oo({align:e="end",sideOffset:t=12,className:o}){let{env:n,theme:r,isMobile:i,domain:s,close:l}=nn(),{data:d}=rn(n),c=ft.useMemo(()=>(d?.items??[]).sort((w,C)=>w.order-C.order),[d]),a=8,p=ft.useRef(null),b=ft.useCallback(w=>{p.current={x:w.clientX,y:w.clientY}},[]),h=typeof window<"u"?window.location.pathname:"",x=ft.useCallback((w,C)=>{if(p.current){let L=w.clientX-p.current.x,W=w.clientY-p.current.y;if(p.current=null,Math.abs(L)>a||Math.abs(W)>a)return}let M=C.url[n]??C.url.production,T=_o(M,s);if(!T)try{let L=new URL(M).pathname;if(h===L||h.startsWith(L+"/")){l();return}}catch{}T?window.open(M,"_blank","noopener,noreferrer"):window.location.href=M,l()},[n,s,l,h]),g=re("div",{className:"al-grid","data-theme":r,children:c.map(w=>{let C=w.url[n]??w.url.production,M=_o(C,s),T=!1;if(!M)try{let L=new URL(C).pathname;T=h===L||h.startsWith(L+"/")}catch{T=!1}return Bt("button",{type:"button",className:"al-grid-item","data-active":T||void 0,onPointerDown:b,onClick:L=>x(L,w),children:[Bt("div",{className:"al-grid-item-left",children:[re("div",{className:"al-grid-item-icon",children:re("img",{src:w.iconUrl,alt:w.label,width:24,height:24,loading:"lazy"})}),re("span",{className:"al-grid-item-label",children:w.label}),w.isNew&&re("span",{className:"al-badge-new",children:"N"})]}),re("div",{className:"al-grid-item-right",children:w.badge&&!Li(w)&&re("span",{className:"al-badge",children:w.badge})})]},w.id)})});return i?Bt(Rt.Portal,{children:[re(Rt.Overlay,{className:"al-drawer-overlay"}),Bt(Rt.Content,{className:K("al-drawer-content",o),"data-theme":r,children:[Bt("div",{className:"al-drawer-header",children:[re(Rt.Close,{className:"al-drawer-close",children:re(Eo,{})}),re(Rt.Title,{className:"al-drawer-title",children:"CROSS Services"}),re(Rt.Close,{className:"al-drawer-close",children:re(Po,{})})]}),re("div",{className:"al-drawer-body",children:g})]})]}):re(an.Portal,{children:re(an.Content,{align:e,sideOffset:t,className:K("al-popover-content",o),"data-theme":r,children:g})})}function _o(e,t){try{let o=new URL(e).hostname;return typeof window>"u"?!0:o!==(t??window.location.hostname)}catch{return!1}}import*as ce from"react";import*as Gr from"@radix-ui/react-popover";import{Drawer as ds}from"vaul";import{createContext as Ri,useContext as Si}from"react";var Dn=Ri(null);function nt(){let e=Si(Dn);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Wn=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(Wn||{}),sn={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};import*as S from"react";import ut from"bignumber.js";function Ei(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return t>0&&e.charCodeAt(t-1)===46&&t--,e.slice(0,t)}function gt(e,t){if(!e||e==="0")return"0.00";let o=new ut(e).shiftedBy(-t),n=o.isGreaterThanOrEqualTo(1)?2:4;return o.toFormat(n,ut.ROUND_DOWN)}function Re(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Bn(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let o=t>=1?2:4,n=Math.pow(10,o);return`$${(Math.floor(t*n)/n).toLocaleString("en-US",{minimumFractionDigits:o,maximumFractionDigits:o})}`}function Fo(e,t,o){let r=new ut(e).shiftedBy(-t).multipliedBy(new ut(o));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(ut.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,ut.ROUND_DOWN):r.decimalPlaces(4,ut.ROUND_DOWN)).toFormat()}`}function Do(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let o=t;if(o.includes("e")||o.includes("E")){let s=Number(o);if(!Number.isFinite(s)||s===0)return{displayValue:"0",isLowerBound:!1};o=Ei(s.toFixed(18))}let[n="0",r=""]=o.split(".");if(Number(n)>=1){let s=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${s}`,isLowerBound:!1}}return r.length<4?{displayValue:`${n}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}var Se={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},me={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var zn={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},Wo={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function $n(e,t){let o=me[e];if(t===o.cross)return Wo.cross;if(t===o.bsc)return Wo.bsc}var Pi={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function wt(e,t,o={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:r,format:i="png"}=o,s=Pi[e],l=r?`&bg=${r}`:"";return`${s}/portrait/evm/${t}.${i}?size=${n}${l}`}import{jsx as U,jsxs as ln}from"react/jsx-runtime";function Bo({size:e=16,className:t}){return ln("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[U("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),U("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Hn({size:e=16,className:t}){return U("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function zt({size:e=16,className:t}){return U("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Vn({size:e=24,className:t}){return U("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function zo({size:e=20,className:t}){return ln("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[U("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),U("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function $o({size:e=20,className:t}){return U("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:U("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function Ho({size:e=20,className:t}){return U("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Vo({size:e=20,className:t}){return U("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function jo({size:e=20,className:t}){return U("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:U("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Go({size:e=16,className:t}){return ln("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[U("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),U("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Uo({size:e=16,className:t}){return ln("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[U("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),U("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function qo({size:e=42,className:t}){return U("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:U("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}import{useMemo as Ii}from"react";import{useQuery as Ti}from"@tanstack/react-query";var Mi="send:chain-info";function Ai(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let o=t[0];if(!o)throw new Error("Chain info payload is empty.");return o}return t}return e}function jn(e,...t){let o=e.replace(/\/+$/,""),n=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[o,...n].join("/")}function _i(e,t,o,n){if(n)return t===me[e].cross?Zo(t,n):o?.explorer_url?jn(o.explorer_url,o.explorer_postfix?.transaction??"tx",n):Oi(e,t,n)}function Zo(e,t){return jn("https://explorer.crosstoken.io",String(e),"tx",t)}function Oi(e,t,o){let n=me[e];if(t===n.cross)return Zo(t,o);if(t===n.bsc)return jn(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",o)}function Ko(e,t,o,n=!0){let r=Se[e],i=Ti({queryKey:[Mi,e,t],queryFn:async({signal:d})=>{let c=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:d});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let a=await c.json();if("code"in a&&a.code!==void 0&&a.code!==200)throw new Error(`Chain info API error: ${a.code}`);return Ai(a)},enabled:n,staleTime:300*1e3}),s=i.data;return{transactionUrl:Ii(()=>_i(e,t,s,o),[t,s,e,o]),chainInfo:s,...i}}var Yo="0x0000000000000000000000000000000000000001";var Fi="0xa9059cbb",Di=/^0x[a-fA-F0-9]{40}$/,Wi="nexus-cross:dapp-ui:send:recent:",Qo=10;function Bi(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function $t(e){return e.toLowerCase()}function Ht(e){return Di.test(e)}function Gn(e){return $t(e.address)===Yo}function Un(e){return`${Wi}${e.toLowerCase()}`}function St(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Un(e));if(!t)return[];let o=JSON.parse(t);return Array.isArray(o)?o.filter(n=>n!==null&&typeof n=="object"&&Ht(n.address)&&typeof n.updatedAt=="number").slice(0,Qo):[]}catch{return[]}}function qn(e,t){if(typeof window>"u")return[];let o=$t(t),n=[{address:o,updatedAt:Date.now()},...St(e).filter(r=>r.address!==o)].slice(0,Qo);try{window.localStorage.setItem(Un(e),JSON.stringify(n))}catch{return St(e)}return n}function Zn(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Un(e))}catch{}}function Kn(e,t){let o=e.trim();if(!o)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(o))return{error:"Enter a valid amount."};let[n="0",r=""]=o.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let i=BigInt(n||"0"),s=r.padEnd(t,"0"),l=s?BigInt(s):0n,d=10n**BigInt(t),c=i*d+l;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function Yn(e,t){let o=BigInt(e||"0"),n=10n**BigInt(t),r=o/n,i=o%n;if(i===0n)return r.toString();let s=Bi(i.toString().padStart(t,"0"));return`${r.toString()}.${s}`}function Qn(e,t){let o=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${Fi}${o}${n}`}var zi=2000000000n,$i=1000000000n;async function cn(e,t,o){let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:o})});if(!n.ok)throw new Error(`RPC ${t} HTTP ${n.status}`);let r=await n.json();if(r.error)throw new Error(`RPC ${t}: ${r.error.message}`);if(r.result===void 0)throw new Error(`RPC ${t}: empty result`);return r.result}function dn(e){return BigInt(e)}function Hi(e){return`0x${e.toString(16)}`}function Vi(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Hi(e.value)),e.data&&(t.data=e.data),t}function ji(e){return e===56||e===97}async function Xo(e){try{let t=await cn(e,"eth_gasPrice",[]);return{gasPrice:dn(t)}}catch{return{gasPrice:zi}}}async function Gi(e,t){let o=$i;try{let n=await cn(e,"eth_maxPriorityFeePerGas",[]);o=dn(n)}catch{}return{maxFeePerGas:t+o,maxPriorityFeePerGas:o}}async function Ui(e,t){if(t)return Xo(e);let o;try{o=(await cn(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return o?Gi(e,dn(o)):Xo(e)}async function Jo(e,t){let o=ji(t.chainId),n=Vi(t),[r,i]=await Promise.all([cn(e,"eth_estimateGas",[n]),Ui(e,o)]);return{gasLimit:dn(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function er(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let o=e,n=[];return typeof o.name=="string"&&n.push(o.name),typeof o.shortMessage=="string"&&n.push(o.shortMessage),typeof o.message=="string"&&n.push(o.message),typeof o.details=="string"&&n.push(o.details),o.cause!==void 0&&n.push(er(o.cause,t+1)),n.join(`
6
+ `).toLowerCase()}function qi(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;if(e&&typeof e=="object"){let t=e;if(typeof t.shortMessage=="string")return t.shortMessage;if(typeof t.message=="string")return t.message}return""}function Xn(e,t={},o="Failed to send transaction."){let n=er(e);if(!n)return o;let r=t.nativeSymbol?.trim()||"gas token",i=t.networkName?.trim();if(n.includes("user rejected")||n.includes("userrejected")||n.includes("user denied")||n.includes("user cancelled")||n.includes("user canceled")||n.includes("action_rejected")||n.includes("rejected by user"))return"Transaction was cancelled.";if(n.includes("insufficientfunds")||n.includes("insufficient funds")||n.includes("exceeds the balance of the account")||n.includes("insufficient balance for transfer")){let s=i?` on ${i}`:"";return`Not enough ${r} to cover the gas fee.Please top up your ${r} balance and try again.`}return n.includes("transaction underpriced")||n.includes("replacement transaction underpriced")||n.includes("fee too low")?"Gas fee was too low for the network. Please try again.":n.includes("nonce too low")||n.includes("nonce has already been used")||n.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":n.includes("execution reverted")||n.includes("contractfunctionrevertederror")||n.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":n.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":n.includes("http request failed")||n.includes("failed to fetch")||n.includes("network request failed")||n.includes("timeout")||n.includes("econnreset")||n.includes("rpc error")||n.includes("429")?"Network connection failed. Check your internet and try again.":n.includes("estimategas")||n.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":qi(e)||o}A(`.wi-token-item--button{position:relative;width:100%;border:none;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;border-radius:12px;padding:6px 8px;margin:-2px -8px;transition:background-color .15s ease,transform .15s ease}.wi-token-item--button:before{content:"";position:absolute;inset:-6px -16px;border-radius:16px}.wi-token-item--button:active{transform:scale(.99)}.wi-token-item--button:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.wi-view-send{animation:wi-slide-in-right .25s ease-out}.wi-send-body{flex:1;min-height:0;overflow:hidden}.wi-drawer-content[data-direction=bottom][data-view=send]{max-height:100dvh}.send-page{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.send-scroll{flex:1;min-height:0;display:flex;flex-direction:column;gap:16px;overflow-y:auto;overflow-x:hidden;padding:16px 24px 18px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .send-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.send-scroll::-webkit-scrollbar{width:4px}.send-scroll::-webkit-scrollbar-track{background:transparent}.send-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}[data-theme=light] .send-scroll::-webkit-scrollbar-thumb{background:#0000001f}.send-section{display:flex;flex-direction:column;gap:8px}.send-asset-card{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default);color:inherit;font:inherit;text-align:left;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.send-asset-card:disabled{cursor:default}.send-asset-card:not(:disabled):hover,.send-asset-card[aria-expanded=true]{border-color:var(--wi-primary);background:var(--wi-surface-subtle)}.send-token-list{display:flex;flex-direction:column;gap:6px;max-height:180px;overflow-y:auto;padding:6px;border:1px solid var(--wi-border-subtle);border-radius:16px;background:var(--wi-surface-default)}.send-token-option{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:48px;border:none;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;padding:8px;cursor:pointer}.send-token-option:hover,.send-token-option[data-selected]{background:var(--wi-surface-subtle)}.send-token-option:focus-visible,.send-asset-card:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-token-option-icon{flex-shrink:0;width:28px;height:28px;object-fit:contain;background:transparent}.send-token-option-symbol{color:var(--wi-texticon-primary);font-size:13px;font-weight:700;line-height:1.3}.send-token-option-balance{color:var(--wi-texticon-secondary);font-size:12px;font-weight:600;line-height:1.3;white-space:nowrap}.send-asset-left{display:flex;align-items:center;gap:12px;min-width:0}.send-asset-icon{flex-shrink:0;width:40px;height:40px;object-fit:contain;background:transparent}.send-asset-info,.send-asset-balance{min-width:0;display:flex;flex-direction:column}.send-asset-symbol{color:var(--wi-texticon-primary);font-size:15px;font-weight:700;line-height:1.3}.send-asset-name,.send-balance-label{color:var(--wi-texticon-tertiary);font-size:12px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.send-asset-balance{align-items:flex-end;text-align:right}.send-balance-value{color:var(--wi-texticon-primary);font-size:13px;font-weight:600;line-height:1.35;white-space:nowrap}.send-form{display:flex;flex-direction:column;gap:14px}.send-field{display:flex;flex-direction:column;gap:8px}.send-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.send-label{color:var(--wi-texticon-secondary);font-size:13px;font-weight:600;line-height:1.3}.send-input,.send-amount-wrap{width:100%;box-sizing:border-box;border:1px solid var(--wi-border-subtle);border-radius:14px;background:var(--wi-surface-default);color:var(--wi-texticon-primary);font:inherit}.send-input{min-height:46px;padding:0 14px;font-size:16px;outline:none;transition:border-color .15s ease,box-shadow .15s ease}.send-input:focus{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-address-wrap[data-invalid],.send-amount-wrap[data-invalid]{border-color:#ff6b6b}.send-address-wrap[data-invalid]:focus-within,.send-amount-wrap[data-invalid]:focus-within{border-color:#ff6b6b;box-shadow:0 0 0 3px #ff6b6b29}.send-input::placeholder{color:var(--wi-texticon-tertiary)}.send-address-wrap{display:flex;align-items:center;width:100%;box-sizing:border-box;border:1px solid var(--wi-border-subtle);border-radius:14px;background:var(--wi-surface-default);transition:border-color .15s ease,box-shadow .15s ease}.send-address-wrap:focus-within{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input--address{flex:1;min-width:0;border:none;background:transparent;box-shadow:none}.send-input--address:focus{box-shadow:none}.send-address-book-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;margin-right:2px;border:none;border-radius:12px;background:transparent;color:var(--wi-texticon-tertiary);cursor:pointer;transition:background-color .15s ease,color .15s ease}.send-address-book-btn:hover,.send-address-book-btn[aria-expanded=true]{background:var(--wi-surface-subtle);color:var(--wi-primary)}.send-address-book-btn:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-address-picker{display:flex;flex-direction:column;gap:12px;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default)}.send-address-tabs{display:flex;align-items:center;gap:22px;border-bottom:1px solid var(--wi-border-subtle)}.send-address-tab{position:relative;border:none;background:transparent;color:var(--wi-texticon-tertiary);font:inherit;font-size:14px;font-weight:800;line-height:1.3;padding:0 0 12px;cursor:pointer}.send-address-tab[data-active]{color:var(--wi-primary)}.send-address-tab[data-active]:after{content:"";position:absolute;left:50%;bottom:-1px;width:34px;height:4px;border-radius:999px;background:var(--wi-primary);transform:translate(-50%)}.send-address-list{display:flex;flex-direction:column;gap:10px;max-height:224px;overflow-y:auto;padding-right:10px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}[data-theme=light] .send-address-list{scrollbar-color:rgba(0,0,0,.14) transparent}.send-address-list::-webkit-scrollbar{width:3px}.send-address-list::-webkit-scrollbar-track{background:transparent}.send-address-list::-webkit-scrollbar-thumb{background:#ffffff2e;border-radius:999px}[data-theme=light] .send-address-list::-webkit-scrollbar-thumb{background:#00000024}.send-address-option{display:flex;align-items:center;gap:12px;width:100%;min-height:54px;border:none;border-radius:14px;background:transparent;color:inherit;font:inherit;text-align:left;padding:8px;cursor:pointer;transition:background-color .15s ease}.send-address-option:hover{background:var(--wi-surface-subtle)}.send-address-option:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-address-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--wi-surface-subtle);color:var(--wi-primary);font-size:12px;font-weight:800;overflow:hidden}.send-address-avatar-img{position:relative;z-index:1;width:36px;height:36px;border-radius:50%;object-fit:cover}.send-address-avatar-fallback{position:absolute;inset:0;display:inline-flex;align-items:center;justify-content:center}.send-address-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.send-address-name{color:var(--wi-texticon-primary);font-size:14px;font-weight:800;line-height:1.3}.send-address-value{color:var(--wi-texticon-tertiary);font-size:12px;font-weight:600;line-height:1.3}.send-address-empty{display:flex;align-items:center;justify-content:center;min-height:120px;color:var(--wi-texticon-tertiary);font-size:14px;font-weight:700}.send-amount-wrap{display:flex;align-items:center;padding-right:12px}.send-amount-wrap:focus-within{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input--amount{border:none;background:transparent;box-shadow:none;flex:1;min-width:0}.send-input--amount:focus{box-shadow:none}.send-amount-symbol{color:var(--wi-texticon-secondary);font-size:13px;font-weight:700}.send-field-error{margin:-2px 0 0;color:#ff6b6b;font-size:12px;font-weight:600;line-height:1.35}.send-max-btn{border:none;border-radius:999px;background:var(--wi-surface-subtle);color:var(--wi-primary);font:inherit;font-size:12px;font-weight:700;padding:4px 10px;cursor:pointer}.send-max-btn:disabled{cursor:not-allowed;opacity:.45}.send-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--wi-texticon-tertiary);font-size:12px;line-height:1.4}.send-meta span:last-child{color:var(--wi-texticon-secondary);font-weight:600}.send-message{border-radius:14px;padding:10px 12px;font-size:12px;line-height:1.45}.send-message--error{background:#ff50501f;color:#ff6b6b}.send-message--success{background:color-mix(in srgb,var(--wi-primary) 12%,transparent);color:var(--wi-primary)}.send-message span{font-weight:700}.send-submit-btn{width:100%;min-height:48px;border:none;border-radius:999px;background:var(--wi-primary);color:var(--wi-primary-contrast, #001410);font:inherit;font-size:15px;font-weight:800;cursor:pointer;transition:opacity .15s ease,transform .15s ease}.send-submit-btn:hover:not(:disabled):not([data-disabled]){transform:translateY(-1px)}.send-submit-btn:disabled,.send-submit-btn[data-disabled]{cursor:not-allowed;opacity:.45}.send-footer{flex-shrink:0;padding:14px 24px 24px;border-top:1px solid var(--wi-border-subtle);background:var(--wi-surface-bg)}.send-page--success{background:var(--wi-surface-bg)}.send-success-body{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:32px 24px;text-align:center}.send-success-icon{display:inline-flex;align-items:center;justify-content:center}.send-success-icon[data-pending]{width:56px;height:56px;border-radius:50%;background:color-mix(in srgb,var(--wi-primary) 14%,transparent)}.send-success-spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--wi-primary) 22%,transparent);border-top-color:var(--wi-primary);border-radius:50%;animation:cross-send-spin .8s linear infinite}.send-success-copy{display:flex;flex-direction:column;gap:8px}.send-success-title{margin:0;color:var(--wi-texticon-primary);font-size:22px;font-weight:800;line-height:1.25}.send-success-desc{margin:0;color:var(--wi-texticon-tertiary);font-size:14px;font-weight:600;line-height:1.45}.send-success-hash-card{width:100%;display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default);box-sizing:border-box}.send-success-hash-label{color:var(--wi-texticon-tertiary);font-size:12px;font-weight:700;line-height:1.3;text-align:left}.send-success-hash-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;border:none;border-radius:12px;background:var(--wi-surface-subtle);color:var(--wi-texticon-primary);font:inherit;font-size:14px;font-weight:800;padding:12px}.send-success-hash-link{flex:1;display:inline-flex;align-items:center;align-self:stretch;min-width:0;border:none;background:transparent;color:inherit;font:inherit;font-weight:inherit;padding:0;text-align:left;text-decoration:none;cursor:pointer;user-select:none}.send-success-hash-link:hover{color:var(--wi-primary)}.send-success-hash-link:focus-visible,.send-success-copy-btn:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-success-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:32px;border:none;background:transparent;color:var(--wi-primary);font:inherit;font-size:12px;font-weight:800;padding:0;cursor:pointer}@keyframes cross-send-spin{to{transform:rotate(360deg)}}.send-page--review{background:var(--wi-surface-bg)}.send-review-scroll{gap:16px;padding-top:12px}.send-review-amount{display:flex;align-items:center;justify-content:center;gap:4px;padding:12px 0}.send-review-amount-icon{width:32px;height:32px;object-fit:contain;flex-shrink:0}.send-review-amount-value{color:var(--wi-texticon-primary);font-size:26px;font-weight:800;line-height:1.3;letter-spacing:-.01em}.send-review-parties{display:flex;flex-direction:column;gap:4px;width:100%}.send-review-party{display:flex;align-items:flex-start;gap:8px;padding:16px;border-radius:8px;background:var(--wi-surface-subtle)}.send-review-party-label{flex-shrink:0;width:80px;color:var(--wi-texticon-tertiary);font-size:14px;line-height:1.4}.send-review-party-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;align-items:flex-end;text-align:right}.send-review-party-name{color:var(--wi-texticon-primary);font-size:14px;font-weight:700;line-height:1.3}.send-review-party-addr{width:100%;color:var(--wi-texticon-primary);font-size:12px;line-height:1.4;word-break:break-all}.send-review-section{display:flex;flex-direction:column;gap:8px;width:100%}.send-review-section-title{margin:0;color:var(--wi-texticon-primary);font-size:15px;font-weight:700;line-height:1.6}.send-review-row{display:flex;align-items:flex-start;gap:20px;padding:2px 0}.send-review-row-label{flex-shrink:0;min-width:100px;color:var(--wi-texticon-tertiary);font-size:13px;line-height:1.3;white-space:nowrap}.send-review-row-value{flex:1;min-width:0;color:var(--wi-texticon-primary);font-size:13px;line-height:1.3;text-align:right;word-break:break-all}.send-review-row-value--accent{color:var(--wi-primary)}.send-review-network{display:inline-flex;align-items:center;gap:4px;justify-content:flex-end}.send-review-network-dot{width:6px;height:6px;border-radius:999px;background:var(--wi-primary);flex-shrink:0}.send-footer--review{display:flex;gap:8px}.send-review-btn{flex:1;min-width:0;min-height:48px;padding:12px 16px;border-radius:12px;font:inherit;font-size:16px;font-weight:700;line-height:1.3;cursor:pointer;transition:opacity .15s ease,transform .15s ease}.send-review-btn:disabled{cursor:not-allowed;opacity:.55}.send-review-btn--cancel{background:transparent;border:1px solid var(--wi-primary);color:var(--wi-primary)}.send-review-btn--confirm{background:var(--wi-primary);border:1px solid var(--wi-primary);color:var(--wi-primary-contrast, #001410)}.send-review-btn:not(:disabled):hover{transform:translateY(-1px)}
7
+ `);import{Fragment as ra,jsx as u,jsxs as k}from"react/jsx-runtime";var Zi=1500,Ki=120;function Jn(e){return`${e.chainId}:${e.address.toLowerCase()}`}function tr(e,t){return e.name||`Account ${(e.index??t)+1}`}function nr(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Yi(e){return new Promise(t=>setTimeout(t,e))}function Qi(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}function Xi(e){return!!(e.token||e.recipient||e.amount)}function no(e,t,o=10){if(t<=0)return e.toString();let n=10n**BigInt(t),r=e/n,i=e%n;if(i===0n)return r.toString();let l=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(o,t)));return l=l.replace(/0+$/,""),l?`${r.toString()}.${l}`:r.toString()}function eo(e,t){return no(e,t,6)}function to(e){return no(e,9,2)}function Ji(e){return e.toLocaleString("en-US")}function ea(e){return e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function ta(e){return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function na(){return k("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[u("path",{d:"M4.5 4.5C4.5 3.67 5.17 3 6 3h8.25c.69 0 1.25.56 1.25 1.25V16.5H6A1.5 1.5 0 0 1 4.5 15V4.5Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),u("path",{d:"M4.5 14.5C4.5 13.67 5.17 13 6 13h9.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),u("path",{d:"M8 6.5h4M8 9h3",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function oa(){return k("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none","aria-hidden":"true",children:[u("circle",{cx:"28",cy:"28",r:"28",fill:"var(--wi-primary)"}),u("path",{d:"M17 28.5L24.2 35.5L39 20.5",stroke:"var(--wi-primary-contrast, #001410)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function pn({env:e,theme:t="dark",walletAddress:o,accountName:n,accounts:r=[],token:i,tokens:s=[],onTokenChange:l,sendTransaction:d,getTransactionReceipt:c,estimateGas:a,onSuccess:p,onConfirmSuccess:b,onOutlink:h}){let[x,g]=S.useState(""),[w,C]=S.useState(""),[M,T]=S.useState(""),[L,W]=S.useState({}),[y,I]=S.useState(""),[P,N]=S.useState(!1),[q,B]=S.useState(!1),[ve,We]=S.useState(!1),[te,Pe]=S.useState("account"),Ie=S.useRef(void 0),Y=S.useRef(void 0),Qe=S.useRef(null),Xe=S.useRef(null),[fe,Je]=S.useState(()=>St(o)),[ye,X]=S.useState("idle"),[Z,Ge]=S.useState(null),[de,Be]=S.useState(!1),[ke,pe]=S.useState(""),Ce=S.useRef(0),[J,Te]=S.useState(null),[ne,it]=S.useState(""),Ne=Gn(i),et=S.useMemo(()=>BigInt(i.quantity.numeric||"0"),[i.quantity.numeric]),Ue=S.useMemo(()=>gt(i.quantity.numeric,i.quantity.decimals),[i.quantity.numeric,i.quantity.decimals]),qe=S.useMemo(()=>r.filter(f=>f.address.toLowerCase()!==o.toLowerCase()),[r,o]),at=S.useMemo(()=>{let f=new Map;return qe.forEach((R,F)=>{f.set(R.address.toLowerCase(),{account:R,index:F})}),f},[qe]),Me=qe.length>0,Ze=S.useMemo(()=>ge(e),[e]),Ae=t==="dark"?"1A1A2E":"F3F6F8",tt=s.length>0?s:[i],Ke=tt.length>1&&!!l,{transactionUrl:_e,chainInfo:ue}=Ko(Ze,i.chainId,y||void 0,!0),Oe=ue?.currency_symbol??"",Le=ue?.name??`Chain ID ${i.chainId}`;S.useEffect(()=>{T(""),W({}),I(""),X("idle"),Ge(null),pe(""),Be(!1),Ce.current+=1},[i.address,i.chainId,x,w]),S.useEffect(()=>{C(""),N(!1)},[i.address,i.chainId]),S.useEffect(()=>{Je(St(o))},[o]),S.useEffect(()=>()=>{clearTimeout(Ie.current),clearTimeout(Y.current)},[]),S.useEffect(()=>{!Me&&te==="account"&&Pe("recent")},[te,Me]),S.useEffect(()=>{let f=window.visualViewport,R=Qe.current;if(!f||!R)return;let F=()=>{let se=document.activeElement;return R.contains(se)&&(se instanceof HTMLInputElement||se instanceof HTMLTextAreaElement)},O=48,j=()=>{R.style.paddingBottom=""},oe=()=>{if(!F()){j();return}let se=Math.max(0,window.innerHeight-f.height-f.offsetTop);se>0?R.style.paddingBottom=`${se+O}px`:j();let dt=document.activeElement;dt instanceof HTMLElement&&requestAnimationFrame(()=>{let Ft=dt.getBoundingClientRect(),en=R.getBoundingClientRect().bottom-se-O,Wt=Ft.bottom-en;Wt>0&&R.scrollBy({top:Wt,behavior:"smooth"})})},ct=()=>{setTimeout(()=>{F()||j()},0)};return f.addEventListener("resize",oe),window.addEventListener("resize",oe),R.addEventListener("focusout",ct),()=>{f.removeEventListener("resize",oe),window.removeEventListener("resize",oe),R.removeEventListener("focusout",ct),j()}},[]);let ze=S.useCallback(()=>{clearTimeout(Y.current),Y.current=setTimeout(()=>{Xe.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},10)},[]),Mn=S.useCallback(()=>{C(Yn(i.quantity.numeric,i.quantity.decimals))},[i.quantity.numeric,i.quantity.decimals]),Yt=S.useCallback(f=>{g(f),B(!1)},[]),Qt=S.useCallback(()=>{let f={},R=x.trim(),F=Kn(w,i.quantity.decimals),O;return R?Ht(R)||(f.recipient="Enter a valid EVM recipient address."):f.recipient="Enter a recipient address.","error"in F?f.amount=F.error:(O=F.value,O>et&&(f.amount="Amount exceeds available balance.")),!Ne&&!Ht(i.address)&&(f.token="Token contract address is invalid."),{errors:f,rawAmount:O,trimmedRecipient:R}},[w,et,Ne,x,i.address,i.quantity.decimals]),Xt=S.useCallback(async()=>{if(y)try{await navigator.clipboard.writeText(y),We(!0),clearTimeout(Ie.current),Ie.current=setTimeout(()=>We(!1),2e3)}catch{}},[y]),st=S.useCallback(()=>{if(!_e||!y)return;let f=O=>{typeof window>"u"||window.open(O,"_blank","noopener,noreferrer")};if(!h){f(_e);return}let R=h(_e,{category:"send",origin:"send-transaction",payload:{chainId:i.chainId,txHash:y}});if(R&&(typeof R=="object"||typeof R=="function")&&typeof R.then=="function"){let O=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;R.then(j=>{if(j===null){O?.close();return}let oe=j??_e;if(O)try{O.location.href=oe}catch{O.close(),f(oe)}else f(oe)});return}let F=R;F!==null&&f(F??_e)},[h,i.chainId,_e,y]),lt=S.useCallback((f,R)=>Ne?{to:f,value:R,chainId:i.chainId,from:o}:{to:$t(i.address),data:Qn(f,R),value:0n,chainId:i.chainId,from:o},[Ne,i.address,i.chainId,o]),kt=S.useCallback(async(f,R,F)=>{if(!a&&!F)return;let O=++Ce.current;Be(!0),pe("");try{let j=lt(f,R),oe=a?await a(j):await Jo(F,j);if(Ce.current!==O)return;Ge(oe)}catch(j){if(Ce.current!==O)return;pe(Xn(j,{nativeSymbol:Oe||void 0,networkName:Le,tokenSymbol:i.symbol},"Failed to estimate gas."))}finally{Ce.current===O&&Be(!1)}},[lt,a,Oe,Le,i.symbol]),Jt=S.useCallback(f=>{if(f.preventDefault(),T(""),I(""),!d){X("error"),T("Sending is not available for this wallet.");return}let{errors:R,rawAmount:F,trimmedRecipient:O}=Qt();if(W(R),Xi(R)||F===void 0){X("error");return}let j=O;Te(F),it(j),Ge(null),pe(""),X("review")},[d,Qt]);S.useEffect(()=>{ye==="review"&&(!ne||J===null||Z===null&&(de||ke||!a&&!ue?.rpc||kt(ne,J,ue?.rpc)))},[ue?.rpc,a,kt,Z,ke,de,J,ne,ye]);let _t=S.useCallback(async()=>{if(!(!d||!ne||J===null)){T(""),I("");try{X("submitting");let f=await d(lt(ne,J));if(I(f),X("confirming"),Je(qn(o,ne)),p?.(f),!c){X("success");return}for(let R=0;R<Ki;R+=1){let F=await c({hash:f,chainId:i.chainId}).catch(()=>null);if(F){if(Qi(F)){X("error"),T("Transaction reverted on-chain.");return}X("success");return}await Yi(Zi)}X("error"),T("Transaction receipt was not found. Please check again later.")}catch(f){X("error"),T(Xn(f,{nativeSymbol:Oe||void 0,networkName:Le,tokenSymbol:i.symbol}))}}},[lt,c,Oe,Le,p,J,ne,d,i.chainId,i.symbol,o]),An=S.useCallback(()=>{Ce.current+=1,Ge(null),pe(""),Be(!1),T(""),X("idle")},[]),Ot=et<=0n||!x.trim()||!w.trim();if(ye==="review"||ye==="submitting"){let f=ye==="submitting",R=J!==null?no(J,i.quantity.decimals):w.trim(),F=n?.trim()||`Account ${(r[0]?.index??0)+1}`,O="\u2014",j=Oe||(Ne?i.symbol:""),oe=ue?.currency_decimals??(Ne?i.quantity.decimals:18),ct=Z?ea(Z):null,se=Z?ta(Z):null,dt=se!==null&&j?`${eo(se,oe)} ${j}`:O,Ft=Z?Ji(Z.gasLimit):O,Dt=Z?.maxPriorityFeePerGas!==void 0?`${to(Z.maxPriorityFeePerGas)} Gwei`:O,en=Z?.maxFeePerGas!==void 0?`${to(Z.maxFeePerGas)} Gwei`:O,Wt=Z?.gasPrice!==void 0?`${to(Z.gasPrice)} Gwei`:O,Co=`${R} ${i.symbol}`,tn=(()=>{if(!Z||se===null)return O;if(Ne&&J!==null){let Ct=J+se;return`${eo(Ct,oe)} ${j||i.symbol}`}return j?`${eo(se,oe)} ${j}`:O})();return k("div",{className:"send-page send-page--review",children:[k("div",{className:"send-scroll send-review-scroll","data-vaul-no-drag":!0,children:[k("div",{className:"send-review-amount",children:[u("img",{className:"send-review-amount-icon",src:i.icon_url,alt:"",width:32,height:32,draggable:!1,onError:Ct=>{Ct.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),k("span",{className:"send-review-amount-value",children:[R," ",i.symbol]})]}),k("div",{className:"send-review-parties",children:[k("div",{className:"send-review-party",children:[u("span",{className:"send-review-party-label",children:"From"}),k("div",{className:"send-review-party-info",children:[u("span",{className:"send-review-party-name",children:F}),u("span",{className:"send-review-party-addr",children:o})]})]}),k("div",{className:"send-review-party",children:[u("span",{className:"send-review-party-label",children:"To"}),u("div",{className:"send-review-party-info",children:u("span",{className:"send-review-party-addr",children:ne})})]})]}),k("section",{className:"send-review-section",children:[u("h3",{className:"send-review-section-title",children:"Summary"}),k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Network"}),k("span",{className:"send-review-row-value send-review-network",children:[u("span",{className:"send-review-network-dot","aria-hidden":!0}),Le]})]}),k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Est. Tx Fee"}),u("span",{className:"send-review-row-value",children:de?"\u2026":dt})]}),ct==="dynamic"?k(ra,{children:[k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Max Priority Fee"}),u("span",{className:"send-review-row-value",children:de?"\u2026":Dt})]}),k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Max Gas Fee"}),u("span",{className:"send-review-row-value",children:de?"\u2026":en})]})]}):ct==="legacy"?k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Gas Price"}),u("span",{className:"send-review-row-value",children:de?"\u2026":Wt})]}):null,k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Gas Limit"}),u("span",{className:"send-review-row-value",children:de?"\u2026":Ft})]})]}),k("section",{className:"send-review-section",children:[u("h3",{className:"send-review-section-title",children:"Total"}),k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Total Amount"}),u("span",{className:"send-review-row-value",children:Co})]}),k("div",{className:"send-review-row",children:[u("span",{className:"send-review-row-label",children:"Max. Total Amount"}),u("span",{className:"send-review-row-value",children:de?"\u2026":tn})]})]}),ke&&u("div",{className:"send-message send-message--error",role:"alert",children:ke}),M&&u("div",{className:"send-message send-message--error",role:"alert",children:M})]}),k("div",{className:"send-footer send-footer--review",children:[u("button",{type:"button",className:"send-review-btn send-review-btn--cancel",onClick:An,disabled:f,children:"Cancel"}),u("button",{type:"button",className:"send-review-btn send-review-btn--confirm",onClick:_t,disabled:f,children:f?"Sending...":"Send"})]})]})}if((ye==="confirming"||ye==="success")&&y){let f=ye==="success";return k("div",{className:"send-page send-page--success",children:[k("div",{className:"send-success-body","data-vaul-no-drag":!0,children:[u("div",{className:"send-success-icon","data-pending":!f||void 0,children:f?u(oa,{}):u("span",{className:"send-success-spinner"})}),k("div",{className:"send-success-copy",children:[u("h3",{className:"send-success-title",children:f?"Transaction Complete":"Transaction in Progress"}),u("p",{className:"send-success-desc",children:f?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),k("div",{className:"send-success-hash-card",children:[u("span",{className:"send-success-hash-label",children:"Transaction Hash"}),k("div",{className:"send-success-hash-row","data-vaul-no-drag":!0,children:[u("button",{type:"button",className:"send-success-hash-link",onClick:st,"aria-label":"Open transaction in explorer",children:Re(y)}),u("button",{type:"button",className:"send-success-copy-btn",onClick:Xt,"aria-label":"Copy transaction hash",children:ve?u(zt,{size:16}):"Copy"})]})]})]}),u("div",{className:"send-footer",children:u("button",{type:"button",className:"send-submit-btn",onClick:b,disabled:!f,children:f?"All done":"Sending..."})})]})}return k("form",{className:"send-page",onSubmit:Jt,children:[k("div",{className:"send-scroll","data-vaul-no-drag":!0,ref:Qe,children:[k("section",{className:"send-section","aria-label":"Select token to send",children:[u("span",{className:"send-label",children:"Token"}),k("button",{type:"button",className:"send-asset-card",onClick:()=>{Ke&&N(f=>!f)},disabled:!Ke,"aria-expanded":Ke?P:void 0,children:[k("span",{className:"send-asset-left",children:[u("img",{className:"send-asset-icon",src:i.icon_url,alt:i.symbol,width:40,height:40,draggable:!1,onError:f=>{f.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),k("span",{className:"send-asset-info",children:[u("span",{className:"send-asset-symbol",children:i.symbol}),u("span",{className:"send-asset-name",children:i.name})]})]}),k("span",{className:"send-asset-balance",children:[u("span",{className:"send-balance-label",children:"Available"}),k("span",{className:"send-balance-value",children:[Ue," ",i.symbol]})]})]}),Ke&&P&&u("div",{className:"send-token-list",role:"listbox",children:tt.map(f=>{let R=Jn(f)===Jn(i);return k("button",{type:"button",role:"option","aria-selected":R,className:"send-token-option","data-selected":R||void 0,onClick:()=>l?.(f),children:[k("span",{className:"send-asset-left",children:[u("img",{className:"send-token-option-icon",src:f.icon_url,alt:f.symbol,width:28,height:28,draggable:!1,onError:F=>{F.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),k("span",{className:"send-asset-info",children:[u("span",{className:"send-token-option-symbol",children:f.symbol}),u("span",{className:"send-asset-name",children:f.name})]})]}),u("span",{className:"send-token-option-balance",children:gt(f.quantity.numeric,f.quantity.decimals)})]},Jn(f))})}),L.token&&u("p",{className:"send-field-error",role:"alert",children:L.token})]}),k("section",{className:"send-field","aria-label":"Recipient address",children:[u("span",{className:"send-label",children:"To"}),k("div",{className:"send-address-wrap","data-invalid":L.recipient||void 0,children:[u("input",{className:"send-input send-input--address",value:x,onChange:f=>g(f.target.value),placeholder:"0x...",autoComplete:"off",spellCheck:!1,"aria-invalid":!!L.recipient,"aria-describedby":L.recipient?"send-recipient-error":void 0}),u("button",{type:"button",className:"send-address-book-btn",onClick:()=>B(f=>!f),"aria-label":"Open address book","aria-expanded":q,children:u(na,{})})]}),L.recipient&&u("p",{id:"send-recipient-error",className:"send-field-error",role:"alert",children:L.recipient}),q&&k("div",{className:"send-address-picker",children:[k("div",{className:"send-address-tabs",role:"tablist",children:[Me&&u("button",{type:"button",role:"tab",className:"send-address-tab","data-active":te==="account"||void 0,"aria-selected":te==="account",onClick:()=>Pe("account"),children:"My Account"}),u("button",{type:"button",role:"tab",className:"send-address-tab","data-active":te==="recent"||void 0,"aria-selected":te==="recent",onClick:()=>Pe("recent"),children:"Recent"})]}),Me&&te==="account"?u("div",{className:"send-address-list",children:qe.map((f,R)=>{let F=tr(f,R),O=wt(Ze,f.address,{size:56,bg:Ae});return k("button",{type:"button",className:"send-address-option",onClick:()=>Yt(f.address),children:[k("span",{className:"send-address-avatar","aria-hidden":!0,children:[O&&u("img",{className:"send-address-avatar-img",src:O,alt:"",width:36,height:36,draggable:!1,onError:j=>{j.currentTarget.style.display="none"}}),u("span",{className:"send-address-avatar-fallback",children:nr(F)})]}),k("span",{className:"send-address-copy",children:[u("span",{className:"send-address-name",children:F}),u("span",{className:"send-address-value",children:Re(f.address)})]})]},f.address)})}):fe.length>0?u("div",{className:"send-address-list",children:fe.map(f=>{let R=at.get(f.address.toLowerCase()),F=R?tr(R.account,R.index):void 0,O=wt(Ze,f.address,{size:56,bg:Ae});return k("button",{type:"button",className:"send-address-option",onClick:()=>Yt(f.address),children:[k("span",{className:"send-address-avatar","aria-hidden":!0,children:[O&&u("img",{className:"send-address-avatar-img",src:O,alt:"",width:36,height:36,draggable:!1,onError:j=>{j.currentTarget.style.display="none"}}),u("span",{className:"send-address-avatar-fallback",children:F?nr(F):f.address.slice(2,4).toUpperCase()})]}),k("span",{className:"send-address-copy",children:[u("span",{className:"send-address-name",children:F??Re(f.address)}),u("span",{className:"send-address-value",children:R?Re(R.account.address):"Recently sent"})]})]},f.address)})}):u("div",{className:"send-address-empty",children:"No Send History"})]})]}),k("section",{className:"send-field","aria-labelledby":"send-amount-label",children:[k("span",{className:"send-label-row",children:[u("span",{id:"send-amount-label",className:"send-label",children:"Amount"}),u("button",{type:"button",className:"send-max-btn",onClick:Mn,disabled:et<=0n,children:"Max"})]}),k("div",{className:"send-amount-wrap","data-invalid":L.amount||void 0,children:[u("input",{ref:Xe,className:"send-input send-input--amount",value:w,onChange:f=>C(f.target.value),onFocus:ze,placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-labelledby":"send-amount-label","aria-invalid":!!L.amount,"aria-describedby":L.amount?"send-amount-error":void 0}),u("span",{className:"send-amount-symbol",children:i.symbol})]}),L.amount&&u("p",{id:"send-amount-error",className:"send-field-error",role:"alert",children:L.amount})]}),k("div",{className:"send-meta",children:[u("span",{children:"From"}),u("span",{children:Re(o)})]}),k("div",{className:"send-meta",children:[u("span",{children:"Network"}),k("span",{children:["Chain ID ",i.chainId]})]}),M&&u("div",{className:"send-message send-message--error",role:"alert",children:M})]}),u("div",{className:"send-footer",children:u("button",{type:"submit",className:"send-submit-btn","data-disabled":Ot||void 0,"aria-disabled":Ot,children:"Send"})})]})}import*as or from"@radix-ui/react-popover";import{Drawer as ia}from"vaul";import{jsx as mn,jsxs as aa}from"react/jsx-runtime";function rr({asChild:e,className:t,children:o}){let{isMobile:n,theme:r,walletAddress:i}=nt(),s=o!=null,l=e??!0,d=s?o:aa("button",{type:"button",className:K("wi-trigger-btn",t),"data-theme":r,"data-mobile":n||void 0,children:[mn(Bo,{size:n?14:16}),mn("span",{className:"wi-trigger-address",children:Re(i)})]});return n?mn(ia.Trigger,{asChild:l,children:d}):mn(or.Trigger,{asChild:l,children:d})}import*as V from"react";import*as kn from"@radix-ui/react-popover";import{Drawer as yn}from"vaul";import Gt from"bignumber.js";import{useQueries as sa}from"@tanstack/react-query";import{useMemo as la}from"react";var oo="user-balance";async function ca(e,t,o,n){let r=new URLSearchParams({networkId:`eip155:${t}`,account:o}),i=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:n});if(!i.ok)throw new Error(`Failed to fetch token balance: ${i.status}`);let s=await i.json();if(s.code!==200)throw new Error(`Token balance API error: ${s.code}`);return s.data}function Et(e,t,o=!0){let n=Se[e],r=me[e],i=[r.cross,r.bsc],s=sa({queries:i.map(a=>({queryKey:[oo,e,t,a],queryFn:({signal:p})=>ca(n,a,t,p),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1}))}),l=s.some(a=>a.isLoading),d=s.some(a=>a.isError);return{tokens:la(()=>{let a=[];for(let p of s)p.data&&a.push(...p.data);return a},[s]),isLoading:l,isError:d}}import{useQuery as da,useQueries as pa}from"@tanstack/react-query";import{useMemo as ma}from"react";var fa="forge-holdings",ua="forge-token-image";async function ga(e,t,o){let n=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:o});if(!n.ok)throw new Error(`Failed to fetch forge holdings: ${n.status}`);let r=await n.json();if(!r.success)throw new Error("Forge holdings API error");return r.data.items}async function wa(e,t,o){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:o});if(!n.ok)return{address:t,image_url:""};let r=await n.json();return r.success?{address:t,image_url:r.data.token.image_url}:{address:t,image_url:""}}function ir(e,t,o=!0){let n=zn[e],{data:r,...i}=da({queryKey:[fa,e,t],queryFn:({signal:s})=>ga(n,t,s),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1});return{holdings:r??[],...i}}function ar(e,t,o=!0){let n=zn[e],r=pa({queries:t.map(s=>({queryKey:[ua,e,s],queryFn:({signal:l})=>wa(n,s,l),enabled:o,staleTime:1/0}))});return{imageMap:ma(()=>{let s=new Map;for(let l of r)l.data&&s.set(l.data.address,l.data.image_url);return s},[r])}}import{useQuery as ha}from"@tanstack/react-query";import{useMemo as ba}from"react";var ro="token-stats";function ht(e,t){return`${e}:${t.toLowerCase()}`}function Pt(e,t=!0){let o=Se[e],{data:n,...r}=ha({queryKey:[ro,e],queryFn:async({signal:s})=>{let l=await fetch(`${o}/v1/public/token/stats`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Failed to fetch token stats: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token stats API error: ${d.code}`);return d},enabled:t,staleTime:3e4});return{statsMap:ba(()=>{let s=new Map;if(!n?.data)return s;for(let l of n.data){let d=ht(l.chain_id,l.address);s.set(d,l)}return s},[n]),...r}}import{useQuery as xa}from"@tanstack/react-query";import{useMemo as va}from"react";var ya="token-info";function io(e,t){return`${t.toLowerCase()}_${e}`}function sr(e,t=!0){let o=Se[e],{data:n,...r}=xa({queryKey:[ya,e],queryFn:async({signal:s})=>{let l=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token info API error: ${d.code}`);return d},enabled:t,staleTime:1/0});return{categoryMap:va(()=>{let s=new Map;if(!n?.data)return s;for(let l of n.data){let d=io(l.chain_id,l.address);s.set(d,l.category)}return s},[n]),...r}}import{useMemo as ka}from"react";import ao from"bignumber.js";function lr(e,t,o){let{tokens:n,isLoading:r}=Et(e,t,o),{statsMap:i}=Pt(e,o);return ka(()=>{let s=new ao(0);for(let a of n){let p=i.get(ht(a.chainId,a.address));if(!p)continue;let h=new ao(a.quantity.numeric).shiftedBy(-a.quantity.decimals).multipliedBy(new ao(p.price));h.isNaN()||(s=s.plus(h))}let l=s.toFixed(),{displayValue:d,isLowerBound:c}=Do(l);return{totalUsd:l,displayValue:d,isLowerBound:c,isLoading:r}},[n,i,r])}import{QRCodeSVG as as}from"qrcode.react";function $e(e,t,o,n){if(!n||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let r;try{r=n(t,o)}catch(c){console.error("[dapp-ui] onOutlink threw:",c);return}let i=c=>{typeof window>"u"||window.open(c,"_blank","noopener,noreferrer")};if((c=>!!c&&(typeof c=="object"||typeof c=="function")&&typeof c.then=="function")(r)){let c=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,a=p=>{if(p===null){c?.close();return}let b=p??t;if(c)try{c.location.href=b}catch{c.close(),i(b)}else i(b)};r.then(a,p=>{console.error("[dapp-ui] onOutlink rejected:",p),c?.close()});return}let l=r;if(l===null)return;i(l??t)}import*as vt from"react";import{Drawer as rs}from"vaul";import{createContext as Ca,useContext as Na}from"react";var Vt=Ca(null);function Ee(){let e=Na(Vt);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}import{Drawer as La}from"vaul";import{jsx as cr}from"react/jsx-runtime";function dr({asChild:e,children:t}){let{walletAddress:o}=Ee(),n=t!=null,r=e??!0,i=n?t:cr("button",{type:"button",children:Re(o)});return cr(La.Trigger,{asChild:r,children:i})}import{Drawer as vn}from"vaul";import*as xe from"react";import{useQueryClient as ts}from"@tanstack/react-query";import{useMemo as Ta}from"react";import so from"bignumber.js";import{useQuery as Ra}from"@tanstack/react-query";import{useMemo as fr}from"react";var fn={dev:"https://stg-cross-game-reward-api.crosstoken.io/api",stage:"https://stg-cross-game-reward-api.crosstoken.io/api",production:"https://cross-game-reward-api.crosstoken.io/api"},pr={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},un={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},gn={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},It={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"},mr={dev:{cross:"https://stg-dex-api.crosstoken.io/dex",crossd:"https://stg-crossd-dex-api.crosstoken.io/dex",forge:"https://stg-forge-dex-api.crosstoken.io/dex"},stage:{cross:"https://stg-dex-api.crosstoken.io/dex",crossd:"https://stg-crossd-dex-api.crosstoken.io/dex",forge:"https://stg-forge-dex-api.crosstoken.io/dex"},production:{cross:"https://dex-api.crosstoken.io/dex",crossd:"https://crossd-dex-api.crosstoken.io/dex",forge:"https://forge-dex-api.crosstoken.io/dex"}};var Sa="wp:reward-pools";function wn(e,t=!0){let o=fn[e],{data:n,...r}=Ra({queryKey:[Sa,e],queryFn:async({signal:l})=>{let d=await fetch(`${o}/v1/pools`,{cache:"no-store",signal:l});if(!d.ok)throw new Error(`Failed to fetch pools: ${d.status}`);let c=await d.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),i=fr(()=>n?.data.pools.filter(l=>l.pool_type==="CrossPool")??[],[n]),s=fr(()=>n?.data.pools.filter(l=>l.pool_type==="GamePool")??[],[n]);return{crossPools:i,gamePools:s,allPools:n?.data.pools??[],...r}}import{useQuery as Ea}from"@tanstack/react-query";import{useMemo as Pa}from"react";var Ia="wp:user-deposits";function hn(e,t,o=!0){let n=fn[e],r=o&&!!t,{data:i,...s}=Ea({queryKey:[Ia,e,t],queryFn:async({signal:d})=>{let c=await fetch(`${n}/v1/users/${t}/deposits`,{cache:"no-store",signal:d});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let a=await c.json();if(a.code!==200)throw new Error(`Deposits API error: ${a.code}`);return a},enabled:r,staleTime:0});return{depositMap:Pa(()=>{let d=new Map;if(!i?.data.user_deposits)return d;for(let c of i.data.user_deposits)d.set(c.pool_address.toLowerCase(),c);return d},[i]),deposits:i?.data.user_deposits??[],...s}}import{useQuery as ur}from"@tanstack/react-query";import{useMemo as gr}from"react";function ot(e,t,o,n=!0){let r=mr[e][t],i=n&&!!o,{data:s,...l}=ur({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:x})=>{let g=await fetch(`${r}/pair-info`,{cache:"no-store",signal:x});if(!g.ok)throw new Error(`pair-info fetch failed: ${g.status}`);let w=await g.json();if(w.code!==200)throw new Error(`pair-info API error: ${w.code}`);return w},enabled:n,staleTime:0}),d=s?.data??[],c=gr(()=>{let x=new Map;for(let g of d)x.set(g.pair_address.toLowerCase(),g);return x},[d]),{data:a,...p}=ur({queryKey:["wp:dex-orders",e,t,o],queryFn:async({signal:x})=>{let g=Math.floor(Date.now()/1e3),w=new URLSearchParams({owner:o,size:"200",start_date:"0",end_date:String(g)}),C=await fetch(`${r}/open-order?${w}`,{cache:"no-store",signal:x});if(!C.ok)throw new Error(`open-order fetch failed: ${C.status}`);let M=await C.json();if(M.code!==200)throw new Error(`open-order API error: ${M.code}`);return M.data?.data??[]},enabled:i,staleTime:0}),b=a??[],h=gr(()=>{let x=new Map;for(let g of b){let w=g.pair.toLowerCase();x.has(w)||x.set(w,{buys:[],sells:[]});let C=x.get(w);g.order_side===1?C.buys.push(g):C.sells.push(g)}return x},[b]);return{allPairs:d,pairMap:c,orders:b,ordersByPair:h,isEmpty:b.length===0,isLoading:l.isLoading||p.isLoading}}var Ma=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],wr="var(--wp-green)",hr=4;function br(e,t,o=!0){let n=o&&!!t,{allPools:r}=wn(e,n),{depositMap:i}=hn(e,t,n),{allPairs:s,pairMap:l,ordersByPair:d}=ot(e,"cross",t,n),{allPairs:c,pairMap:a,ordersByPair:p}=ot(e,"crossd",t,n),{allPairs:b,pairMap:h,ordersByPair:x}=ot(e,"forge",t,n);return Ta(()=>{let g=new Map,w=new Map,C=(y,I)=>{!Number.isFinite(I)||I<=0||w.set(y,(w.get(y)??0)+I)};for(let y of r){let I=Number(y.deposit_token.price);I>0&&g.set(y.deposit_token.symbol,I);for(let P of y.reward_tokens){let N=Number(P.price);N>0&&g.set(P.symbol,N)}}for(let y of[...s,...c,...b]){let I=g.get(y.quote_symbol),P=Number(y.billboard?.price);I&&P>0&&!g.has(y.base_symbol)&&g.set(y.base_symbol,P*I)}for(let y of r){let I=i.get(y.pool_address.toLowerCase());if(!I)continue;let P=new so(I.deposited_amount).shiftedBy(-y.deposit_token.decimals).toNumber();if(C(y.deposit_token.symbol,P),y.reward_tokens.length>0){let N=y.reward_tokens[0],q=new so(I.claimable_reward).shiftedBy(-N.decimals).toNumber();C(N.symbol,q)}}let M=[{pairMap:l,ordersByPair:d},{pairMap:a,ordersByPair:p},{pairMap:h,ordersByPair:x}];for(let{pairMap:y,ordersByPair:I}of M)for(let[P,N]of I){let q=y.get(P);if(q){for(let B of N.buys){let ve=Number(B.amount)-Number(B.filled);C(q.quote_symbol,ve*Number(B.price))}for(let B of N.sells){let ve=Number(B.amount)-Number(B.filled);C(q.base_symbol,ve)}}}let T=[],L=0;for(let[y,I]of w){let P=g.get(y)??0,N=I*P;N>0&&(T.push({symbol:y,usdValue:N}),L+=N)}T.sort((y,I)=>I.usdValue-y.usdValue);let W=[];if(L>0){let y=T.slice(0,hr),I=T.slice(hr);for(let N=0;N<y.length;N++)W.push({symbol:y[N].symbol,usdValue:y[N].usdValue,percentage:Math.round(y[N].usdValue/L*100),color:Ma[N]??wr});if(I.length>0){let N=I.reduce((q,B)=>q+B.usdValue,0);W.push({symbol:"Others",usdValue:N,percentage:Math.round(N/L*100),color:wr})}let P=W.reduce((N,q)=>N+q.percentage,0);P!==100&&W.length>0&&(W[0].percentage+=100-P)}return{totalUsd:L,formattedTotal:L>0?`$${new so(L).toFormat(2)}`:"$0.00",segments:W}},[r,i,s,l,d,c,a,p,b,h,x])}import{jsx as De,jsxs as Cr}from"react/jsx-runtime";function xr({size:e=22,className:t}){return De("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:De("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function vr({size:e=22,className:t}){return Cr("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[De("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),De("path",{d:"M16.17 13.75a7.333 7.333 0 11-1.54-7.59L18.333 9.167",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"})]})}function yr({size:e=12,className:t}){return De("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:De("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function kr({size:e=6,className:t}){return De("svg",{width:e,height:e*4/6,viewBox:"0 0 6 4",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:De("path",{d:"M1 1l2 2 2-2",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function bt({size:e=12,className:t}){return Cr("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[De("path",{d:"M5 2H2.5A1.5 1.5 0 0 0 1 3.5V9.5A1.5 1.5 0 0 0 2.5 11H8.5A1.5 1.5 0 0 0 10 9.5V7",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),De("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),De("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import lo from"bignumber.js";var co={included:["CROSS Rewards deposited assets","CROSS Rewards claimable rewards","Gametoken open buy/sell orders"],excluded:["Forge LP value","Wallet balances outside Portfolio"]};function Nr(e){return e!=="production"}function Lr(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function po(e,t){let o=new lo(e).shiftedBy(-t);return!o.isFinite()||o.isZero()?"0":o.isGreaterThanOrEqualTo(1)?o.toFormat(2,lo.ROUND_DOWN):o.toFormat(4,lo.ROUND_DOWN)}import{useQuery as Aa}from"@tanstack/react-query";import{useMemo as _a}from"react";var Oa="wp:token-info";function bn(e,t=!0){let o=Se[e],n=me[e].cross,{data:r,...i}=Aa({queryKey:[Oa,e],queryFn:async({signal:c})=>{let a=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:c});if(!a.ok)throw new Error(`Failed to fetch token info: ${a.status}`);let p=await a.json();if(p.code!==200)throw new Error(`Token info API error: ${p.code}`);return p},enabled:t,staleTime:300*1e3}),{byChainAddr:s,byChainSym:l}=_a(()=>{let c=new Map,a=new Map;if(!r?.data)return{byChainAddr:c,byChainSym:a};for(let p of r.data){let b=p.address.toLowerCase();c.set(`${p.chain_id}:${b}`,p),c.set(b,p);let h=p.symbol.replace(/^t/,"").toUpperCase(),x=`${p.chain_id}:${h}`;a.has(x)||a.set(x,p),a.has(h)||a.set(h,p)}return{byChainAddr:c,byChainSym:a}},[r]);return{getTokenImage:(c,a)=>{let p=c.toLowerCase(),b=s.get(`${n}:${p}`);if(b?.image)return b.image;let h=s.get(p);if(h?.image)return h.image;if(a){let x=a.replace(/^t/,"").toUpperCase(),g=l.get(`${n}:${x}`);if(g?.image)return g.image;let w=l.get(x);if(w?.image)return w.image}return""},...i}}import{jsx as xn,jsxs as Rr}from"react/jsx-runtime";function Tt({title:e,icon:t,iconFit:o="cover",isEmpty:n,children:r}){return Rr("div",{className:"wp-svc-card",children:[Rr("div",{className:"wp-svc-card-head",children:[xn("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:o}}),xn("span",{className:"wp-svc-card-title",children:e})]}),n?xn("div",{className:"wp-svc-empty",children:"No assets yet"}):xn("div",{className:"wp-svc-items",children:r})]})}import jt from"bignumber.js";import{jsx as le,jsxs as he}from"react/jsx-runtime";var Fa="CROSS Rewards";function Da(e){return new jt(e||"0").isGreaterThan(0)}function Wa(e,t,o){let n=new jt(e||"0").shiftedBy(-t).times(o||"0");return!n.isFinite()||n.isZero()?"$0.00":`$${n.toFormat(2,jt.ROUND_DOWN)}`}function Sr(){let{env:e,walletAddress:t,onOutlink:o}=Ee(),n=!!t,{allPools:r}=wn(e,n),{depositMap:i}=hn(e,t,n),{getTokenImage:s}=bn(e,n),l=(a,p)=>`${pr[e]}/rewards/${a.pool_address}?action=${p}`,d=`${It[e]}/reward.png`,c=r.filter(a=>{let p=i.get(a.pool_address.toLowerCase()),b=p?.deposited_amount??"0",h=p?.claimable_reward??"0";return!(new jt(b).isZero()&&new jt(h).isZero())});return le(Tt,{title:Fa,icon:d,isEmpty:c.length===0,children:c.map(a=>{let p=i.get(a.pool_address.toLowerCase()),b=p?.deposited_amount??"0",h=p?.claimable_reward??"0",x=l(a,"withdraw"),g=l(a,"claim"),w=s(a.deposit_token.address,a.deposit_token.symbol),C=a.reward_tokens[0],M=C?s(C.address,C.symbol):"",T=a.reward_tokens.map(N=>N.symbol),L=T.length>0?`${a.deposit_token.symbol}-${T.join("/")}`:a.deposit_token.symbol,W=C?po(h,C.decimals):"0",y=C?.symbol??"Reward",I=C?Wa(h,C.decimals,C.price):"$0.00",P=!!p&&Da(h);return he("article",{className:"wp-item","data-side":"reward",children:[he("div",{className:"wp-item-body",children:[he("div",{className:"wp-item-line",children:[le("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),he("div",{className:"wp-svc-token",children:[he("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&le("img",{className:"wp-svc-token-icon",src:w,alt:""}),M&&le("img",{className:"wp-svc-token-icon",src:M,alt:""})]}),le("span",{children:L})]})]}),he("div",{className:"wp-item-line",children:[le("span",{className:"wp-item-label",children:"Deposited"}),he("div",{className:"wp-svc-token",children:[w&&le("img",{className:"wp-svc-token-icon",src:w,alt:""}),le("span",{children:po(b,a.deposit_token.decimals)})]})]}),he("div",{className:"wp-item-line",children:[he("span",{className:"wp-item-label",children:["Claimable (",y,")"]}),he("div",{className:"wp-svc-token",children:[M&&le("img",{className:"wp-svc-token-icon",src:M,alt:""}),le("span",{children:W}),le("span",{className:"wp-item-usd",children:I})]})]})]}),he("div",{className:"wp-item-tags",children:[he("a",{className:"wp-tag wp-tag--muted",href:x,target:"_blank",rel:"noopener noreferrer",onClick:N=>$e(N,x,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:a,userDeposit:p}},o),children:[le("span",{className:"wp-tag-label",children:"Withdraw"}),le(bt,{size:12,className:"wp-tag-icon"})]}),he("a",{className:"wp-tag wp-tag--mint","data-disabled":!P||void 0,"aria-disabled":!P||void 0,href:P?g:void 0,target:P?"_blank":void 0,rel:P?"noopener noreferrer":void 0,onClick:N=>{if(!P){N.preventDefault();return}$e(N,g,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:a,userDeposit:p}},o)},children:[le("span",{className:"wp-tag-label",children:"Claim"}),le(bt,{size:12,className:"wp-tag-icon"})]})]})]},a.pool_address)})})}import Er from"bignumber.js";import{Fragment as za,jsx as ie,jsxs as Ye}from"react/jsx-runtime";function Pr(e){let t=new Er(e);if(t.isNaN())return e;let o=t.decimalPlaces()??0;return t.toFormat(o)}function Ba(e){let t=new Er(e.amount).minus(e.filled);return Pr(t.toString())}function Ir({market:e,pairMap:t,ordersByPair:o,getDexUrl:n,getTokenImage:r}){let{onOutlink:i}=Ee(),s=[];for(let[l,d]of o){let c=t.get(l),a=c?r(c.base_address,c.base_symbol):"",p=c?r(c.quote_address,c.quote_symbol):"",b=n(l),h=c?`${c.base_symbol}/${c.quote_symbol}`:"Unknown Pair",x=(g,w)=>Ye("a",{className:"wp-item","data-side":w,href:b,target:"_blank",rel:"noopener noreferrer",onClick:C=>$e(C,b,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:w,order:g,pair:c}},i),children:[Ye("div",{className:"wp-item-body",children:[ie("div",{className:"wp-order-head",children:Ye("div",{className:"wp-svc-token",children:[a&&ie("img",{className:"wp-svc-token-icon",src:a,alt:""}),ie("span",{children:c?.base_symbol??"Token"}),ie("span",{className:"wp-token-subtle",children:h})]})}),Ye("div",{className:"wp-item-line",children:[ie("span",{className:"wp-item-label",children:"Price"}),Ye("div",{className:"wp-svc-token",children:[p&&ie("img",{className:"wp-svc-token-icon",src:p,alt:""}),ie("span",{children:Pr(g.price)})]})]}),Ye("div",{className:"wp-item-line",children:[ie("span",{className:"wp-item-label",children:"Amount"}),Ye("div",{className:"wp-svc-token",children:[a&&ie("img",{className:"wp-svc-token-icon",src:a,alt:""}),ie("span",{children:Ba(g)})]})]}),Ye("div",{className:"wp-item-line",children:[ie("span",{className:"wp-item-label",children:"Type"}),ie("span",{className:`wp-order-side wp-order-side--${w}`,children:w==="buy"?"Buy":"Sell"})]})]}),ie("div",{className:"wp-item-tags",children:Ye("span",{className:"wp-tag wp-tag--muted",children:[ie("span",{className:"wp-tag-label",children:"Cancel"}),ie(bt,{size:12,className:"wp-tag-icon"})]})})]},`${w}-${g.order_id}`);for(let g of d.buys)s.push(x(g,"buy"));for(let g of d.sells)s.push(x(g,"sell"))}return ie(za,{children:s})}import{jsx as Tr}from"react/jsx-runtime";var $a="Gametoken";function Ha(e){return e==="cross"?"cross":e==="crossd"?"crossd":"forge"}function Mr(){let{env:e,walletAddress:t}=Ee(),o=!!t,n=ot(e,"cross",t,o),r=ot(e,"crossd",t,o),i=ot(e,"forge",t,o),{getTokenImage:s}=bn(e,o),l=`${It[e]}/dex.png`,d=[{market:"cross",data:n},{market:"crossd",data:r},{market:"forge",data:i}],c=d.every(({data:a})=>a.isEmpty);return Tr(Tt,{title:$a,icon:l,isEmpty:c,children:d.map(({market:a,data:p})=>Tr(Ir,{market:a,pairMap:p.pairMap,ordersByPair:p.ordersByPair,getDexUrl:b=>{let h=p.pairMap.get(b.toLowerCase());return`${gn[e]}/gametoken/${Ha(a)}/${h?.base_symbol??""}`},getTokenImage:s},a))})}import mo from"bignumber.js";import{useMemo as Ka}from"react";import{useQuery as Va}from"@tanstack/react-query";var ja="wp:forge-pools";function Ar(e,t,o=!0){let n=un[e],r=o&&!!t,{data:i,...s}=Va({queryKey:[ja,e,t],queryFn:async()=>{let d=await fetch(`${n}/v1/users/${t}/pools`,{cache:"no-store"});if(!d.ok)throw new Error(`forge pools fetch failed: ${d.status}`);return(await d.json()).data?.items??[]},enabled:r,staleTime:0}),l=i??[];return{pools:l,isEmpty:l.length===0,...s}}import{useQueries as Ga}from"@tanstack/react-query";import{useMemo as Ua}from"react";var qa="wp:forge-token-detail";async function Za(e,t){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return o.ok?(await o.json())?.data?.token??null:null}function _r(e,t,o=!0){let n=un[e],r=Ga({queries:t.map(l=>({queryKey:[qa,e,l],queryFn:()=>Za(n,l),enabled:o&&!!l,staleTime:3e4}))}),i=Ua(()=>{let l=new Map;for(let d=0;d<r.length;d++){let c=r[d]?.data,a=t[d];c&&a&&l.set(a.toLowerCase(),c)}return l},[r,t]),s=r.some(l=>l.isLoading);return{detailMap:i,isLoading:s}}import{jsx as be,jsxs as xt}from"react/jsx-runtime";var Ya="Forge",Qa=18,Xa="https://contents.crosstoken.io/wallet/token/images/FT.png";function Ja(e){if(!e||e==="0")return"0";let t=new mo(e).shiftedBy(-Qa);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,mo.ROUND_DOWN):t.toFormat(4,mo.ROUND_DOWN)}function es(e){let t=Number(e);return!Number.isFinite(t)||t<=0?"0%":t>=1?`${(Math.floor(t*100)/100).toFixed(2)}%`:`${(Math.floor(t*1e4)/1e4).toFixed(4)}%`}function Or(){let{env:e,walletAddress:t,onOutlink:o}=Ee(),n=!!t,{pools:r,isEmpty:i}=Ar(e,t,n),s=Ka(()=>r.map(a=>a.token.address),[r]),{detailMap:l}=_r(e,s,n&&s.length>0),d=a=>`${gn[e]}/forge/token/${a.token.address}`,c=`${It[e]}/forge.png`;return be(Tt,{title:Ya,icon:c,iconFit:"contain",isEmpty:i,children:r.map(a=>{let p=l.get(a.token.address.toLowerCase()),b=p?.image_url||p?.image||a.token.image||Xa,h=p?.symbol||a.token.symbol,x=d(a);return xt("a",{className:"wp-item","data-side":"lp",href:x,target:"_blank",rel:"noopener noreferrer",onClick:g=>$e(g,x,{category:"portfolio",origin:"portfolio-forge",payload:{pool:a,tokenDetail:p}},o),children:[xt("div",{className:"wp-item-body",children:[xt("div",{className:"wp-item-line",children:[be("span",{className:"wp-item-label",children:"Asset"}),xt("div",{className:"wp-svc-token",children:[be("img",{className:"wp-svc-token-icon",src:b,alt:""}),be("span",{children:h}),p?.name&&be("span",{className:"wp-token-subtle",children:p.name})]})]}),xt("div",{className:"wp-item-line",children:[be("span",{className:"wp-item-label",children:"LP Balance"}),be("div",{className:"wp-svc-token",children:be("span",{children:Ja(a.lp_balance)})})]}),xt("div",{className:"wp-item-line",children:[be("span",{className:"wp-item-label",children:"Ownership"}),be("span",{className:"wp-line-value",children:es(a.pool_ownership)})]})]}),be("div",{className:"wp-item-tags",children:xt("span",{className:"wp-tag wp-tag--muted",children:[be("span",{className:"wp-tag-label",children:"Withdraw"}),be(bt,{size:12,className:"wp-tag-icon"})]})})]},a.pair_address)})})}A(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--cck-surface-bg, #202530);--wp-card: var(--cck-surface-default, #252b39);--wp-control: #292f40;--wp-border: var(--cck-border-default, #292f40);--wp-text: var(--cck-texticon-primary, #ffffff);--wp-text-60: var(--cck-texticon-secondary, #d3d7df);--wp-text-40: #8c97ad;--wp-text-30: var(--cck-texticon-tertiary, #717d97);--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: #00d4aa;--wp-green: var(--cck-primary, #019d92);--wp-red: var(--cck-error, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #9b8cef;--wp-claim-primary-text: #202530;--wp-claim-secondary-bg: var(--wp-control);--wp-claim-success: #00d4aa;--wp-claim-success-soft: rgba(0, 212, 170, .18);--wp-claim-error: #ff3aa3;--wp-claim-error-soft: rgba(255, 58, 163, .16)}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: #e6edf4;--wp-card: #ffffff;--wp-control: #edf2f6;--wp-border: #d6dee8;--wp-text: var(--cck-texticon-primary, #192023);--wp-text-60: var(--cck-texticon-secondary, #4c5863);--wp-text-40: #8c97ad;--wp-text-30: var(--cck-texticon-tertiary, #a0a9b8);--wp-chrome-text: var(--cck-texticon-primary, #192023);--wp-card-shadow: 0 1px 2px rgba(25, 32, 35, .04), 0 8px 24px rgba(25, 32, 35, .05);--wp-tooltip-bg: #192023;--wp-tooltip-text: #ffffff;--wp-mint: #00d4aa;--wp-green: var(--cck-primary, #019d92);--wp-red: var(--cck-error, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #7346f3;--wp-claim-primary-text: #ffffff;--wp-claim-secondary-bg: #ffffff;--wp-claim-success: #019d92;--wp-claim-success-soft: rgba(1, 157, 146, .15);--wp-claim-error: #e70077;--wp-claim-error-soft: rgba(231, 0, 119, .12)}.wp-fullscreen{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:center;gap:20px;height:60px;padding:0 20px;flex-shrink:0}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-chrome-text);flex-shrink:0}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: hsl(221.3 24.6% 25.5%)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:16px;font-weight:600;line-height:24px;letter-spacing:.15px;text-align:center;color:var(--wp-chrome-text);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-wallet-name{flex:1;min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:160%;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-top{flex-shrink:0;padding:0 16px 16px;display:flex;flex-direction:column;gap:16px}.wp-identity{display:flex;flex-direction:column;gap:8px}.wp-address{display:inline-flex;align-items:center;gap:8px}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40)}.wp-total{font-size:28px;font-weight:600;line-height:1.3;color:var(--wp-text);margin:0}.wp-asset{display:flex;flex-direction:column;gap:8px}.wp-asset-head{display:flex;align-items:center;gap:4px}.wp-asset-head-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-asset-head-icon{display:inline-flex;color:var(--wp-text-40)}.wp-bar{display:flex;height:20px;border-radius:4px;overflow:hidden}.wp-bar-seg{display:flex;align-items:center;justify-content:center;min-width:8px}.wp-bar-seg-pct{font-size:10px;font-weight:400;line-height:1.3;color:#fff;white-space:nowrap}.wp-legend{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}.wp-legend-item{display:flex;align-items:center;gap:4px}.wp-legend-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.wp-legend-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-tabs{flex-shrink:0;padding:8px 16px}.wp-tabs-inner{display:flex;align-items:center;padding:0 2px}.wp-tabs-list{display:flex;gap:20px;flex:1}.wp-tab{display:flex;flex-direction:column;align-items:center;justify-content:space-between;height:44px;padding-top:12px;background:transparent;border:none;cursor:pointer}.wp-tab-text{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text-30);white-space:nowrap}.wp-tab[data-active=true] .wp-tab-text{color:var(--wp-mint)}.wp-tab-bar{width:20px;height:4px;border-radius:2px;background:var(--wp-mint);opacity:0}.wp-tab[data-active=true] .wp-tab-bar{opacity:1}.wp-tabs-filter-wrap{position:relative;display:flex;align-items:center;width:44px;height:44px;flex-shrink:0}.wp-tabs-filter-grad{position:absolute;inset:0;background:linear-gradient(to left,var(--wp-bg) 74%,transparent);pointer-events:none}.wp-tabs-filter{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text-40)}.wp-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.08) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:#ffffff14;border-radius:4px}.wp-body-inner{padding:0 16px 128px;display:flex;flex-direction:column;gap:24px}.wp-summary-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box}.wp-summary-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.wp-address{display:inline-flex;align-items:center;gap:8px;min-width:0}.wp-address-avatar{width:16px;height:16px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 68% 34%,#ff78d1 0 18%,transparent 19%),radial-gradient(circle at 34% 66%,#00d4aa 0 20%,transparent 21%),linear-gradient(135deg,#7346f3,#0488fc)}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40);flex-shrink:0}.wp-summary-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;background:#019d921a;color:var(--wp-mint);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;white-space:nowrap}.wp-summary-estimate{position:relative;display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.wp-estimate-info{position:relative;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--wp-text-40);cursor:help}.wp-estimate-tooltip{position:absolute;top:calc(100% + 8px);right:0;z-index:3;display:flex;flex-direction:column;gap:8px;width:min(280px,calc(100vw - 48px));padding:12px;border-radius:8px;background:var(--wp-tooltip-bg);box-shadow:0 12px 32px #0000003d;color:var(--wp-tooltip-text);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-estimate-tooltip-title{display:block;font-size:12px;font-weight:600;line-height:1.3}.wp-estimate-tooltip-group{display:flex;flex-direction:column;gap:4px}.wp-estimate-tooltip-item{display:block;color:#ffffffc7}.wp-estimate-tooltip-item:before{content:"- "}.wp-estimate-info:hover .wp-estimate-tooltip,.wp-estimate-info:focus .wp-estimate-tooltip,.wp-estimate-info:focus-visible .wp-estimate-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-total{font-size:28px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text);margin:0}.wp-svc-card{display:flex;flex-direction:column;gap:12px}.wp-svc-card-head{display:flex;align-items:center;gap:8px}.wp-svc-card-icon{width:20px;height:20px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:16px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:20px;width:100%;padding:20px 16px;border-radius:8px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box}.wp-item{position:relative;display:flex;flex-direction:column;gap:16px;color:inherit;text-decoration:none;cursor:pointer;outline:none;transition:opacity .15s ease}.wp-item+.wp-item{padding-top:20px;border-top:1px solid var(--wp-control)}.wp-item:hover{opacity:.88}.wp-item-body{display:flex;flex-direction:column;gap:8px;min-width:0}.wp-order-head{display:flex;align-items:center;width:100%}.wp-item-line{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-height:18px;min-width:0}.wp-item-label{flex-shrink:0;font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-line-value,.wp-order-side{font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text);white-space:nowrap}.wp-order-side--buy{color:var(--wp-mint)}.wp-order-side--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;min-height:20px}.wp-svc-token>span{font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:16px;height:16px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-token-stack{display:inline-flex;align-items:center;justify-content:flex-end;width:29px;min-width:29px;overflow:visible}.wp-token-stack .wp-svc-token-icon+.wp-svc-token-icon{margin-left:-3.5px}.wp-token-subtle{color:var(--wp-text-40)!important}.wp-order-head .wp-svc-token{justify-content:flex-start}.wp-order-head .wp-svc-token>span:first-of-type{font-size:14px}.wp-item-tags{display:flex;align-items:stretch;gap:8px;width:100%}.wp-tag{appearance:none;display:inline-flex;flex:1 1 0;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:34px;padding:8px 12px;border-radius:999px;border:1px solid var(--wp-border);background:transparent;font-family:inherit;font-size:14px;font-weight:500;line-height:1.3;letter-spacing:0;color:var(--wp-text-40);text-align:center;text-decoration:none;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}a.wp-tag,button.wp-tag{cursor:pointer}.wp-tag:hover{background:var(--wp-control);transform:translateY(-1px)}.wp-tag:focus-visible{outline:2px solid var(--wp-mint);outline-offset:2px}.wp-tag[aria-disabled=true],.wp-tag[data-disabled]{cursor:default;opacity:.48;pointer-events:none}.wp-tag-label{display:inline-flex;align-items:center}.wp-tag-icon{flex-shrink:0;opacity:.85;transition:transform .15s ease,opacity .15s ease}.wp-tag:hover .wp-tag-icon{opacity:1;transform:translate(1px,-1px)}.wp-tag--mint{color:var(--wp-mint);border-color:color-mix(in srgb,var(--wp-mint) 45%,transparent);background:color-mix(in srgb,var(--wp-mint) 10%,transparent)}.wp-tag--mint:hover{background:color-mix(in srgb,var(--wp-mint) 18%,transparent);border-color:var(--wp-mint)}.wp-tag--muted{color:var(--wp-text-40)}.wp-svc-empty{display:flex;align-items:center;justify-content:center;min-height:74px;padding:20px 16px;background:var(--wp-card);border-radius:8px;box-shadow:var(--wp-card-shadow, none);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-30);box-sizing:border-box}.wp-claim-overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:flex-end;justify-content:center;background:#00000094;box-sizing:border-box}.wp-claim-sheet{display:flex;flex-direction:column;width:100%;max-width:375px;max-height:calc(100% - 24px);overflow:hidden;border-radius:24px 24px 0 0;background:var(--wp-bg);color:var(--wp-text);box-shadow:0 -18px 48px #00000042;animation:wp-claim-slide-up .22s ease-out}@keyframes wp-claim-slide-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.wp-claim-grabber{display:flex;align-items:flex-start;justify-content:center;height:38px;min-height:38px;padding-top:12px;box-sizing:border-box}.wp-claim-grabber span{display:block;width:52px;height:5px;border-radius:999px;background:var(--wp-control)}.wp-claim-content{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;padding:20px;box-sizing:border-box}.wp-claim-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;flex-shrink:0}.wp-claim-icon--success{background:var(--wp-claim-success-soft);color:var(--wp-claim-success)}.wp-claim-icon--pending{background:#9b8cef29;color:var(--wp-claim-primary)}.wp-claim-icon--error{background:var(--wp-claim-error-soft);color:var(--wp-claim-error);font-size:30px;font-weight:600;line-height:1}.wp-claim-icon--token{background:#00d4aa29}.wp-claim-icon--token img{width:48px;height:48px;border-radius:50%;object-fit:cover}.wp-claim-icon--token span{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;background:var(--wp-mint);color:#101820;font-size:18px;font-weight:600}.wp-claim-spinner{width:36px;height:36px;border-radius:50%;border:3px solid rgba(155,140,239,.28);border-top-color:var(--wp-claim-primary);animation:wp-claim-spin .8s linear infinite}@keyframes wp-claim-spin{to{transform:rotate(360deg)}}.wp-claim-copy{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;text-align:center}.wp-claim-title{margin:0;font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text)}.wp-claim-desc{max-width:335px;margin:0;font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-40)}.wp-claim-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.wp-claim-error-message{margin:0;color:var(--wp-claim-error);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0}.wp-claim-reward-card{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:60px;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-reward-token{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-claim-reward-token img{width:28px;height:28px;object-fit:cover}.wp-claim-reward-token span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-claim-reward-symbol{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wp-text);font-size:18px;font-weight:600;line-height:1.3;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-reward-amount{flex-shrink:0;color:var(--wp-text);font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-account-row{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-height:40px}.wp-claim-account-row>span{flex-shrink:0;color:var(--wp-text-40);font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account{display:flex;align-items:center;gap:8px;min-width:0}.wp-claim-account strong{overflow:hidden;color:var(--wp-text);font-size:15px;font-weight:600;line-height:1.6;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-account-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 30% 28%,#d87aff 0 12%,transparent 13%),radial-gradient(circle at 68% 28%,#f0a1ff 0 12%,transparent 13%),radial-gradient(circle at 32% 70%,#b561e7 0 13%,transparent 14%),radial-gradient(circle at 70% 70%,#d4a2ff 0 13%,transparent 14%),radial-gradient(circle at 50% 50%,#8c4fc4 0 18%,transparent 19%),#4a315f;box-shadow:inset 0 0 0 3.37px var(--wp-control)}.wp-claim-divider{display:block;width:100%;height:1px;background:var(--wp-border)}.wp-claim-detail-list{display:flex;flex-direction:column;gap:8px;width:100%}.wp-claim-detail-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:20px}.wp-claim-detail-row>span{min-width:0;color:var(--wp-text-40);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-detail-row--sub>span:before{content:"";display:inline-block;width:3px;height:3px;margin:0 8px 3px;background:currentColor}.wp-claim-detail-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list{display:flex;flex-direction:column;gap:8px;width:100%;padding-bottom:8px}.wp-claim-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-list-item>span{flex-shrink:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--wp-text-40);white-space:nowrap}.wp-claim-list-item strong{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;overflow:hidden;color:var(--wp-text);font-size:14px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list-item img{width:16px;height:16px;border-radius:50%;flex-shrink:0}.wp-claim-hash{appearance:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);cursor:pointer;font:inherit}.wp-claim-hash svg{flex-shrink:0;color:var(--wp-text-60)}.wp-claim-gas-card{display:flex;flex-direction:column;gap:4px;width:100%;padding:14px 16px;border-radius:8px;border:1px solid var(--wp-border);background:var(--wp-card);box-sizing:border-box}.wp-claim-gas-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:28px}.wp-claim-gas-row>span{min-width:0;font-size:12px;font-weight:400;line-height:1.3;color:var(--wp-text-40)}.wp-claim-gas-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:12px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-gas-row--primary{min-height:32px}.wp-claim-gas-row--primary>span,.wp-claim-gas-row--primary strong{font-size:14px;color:var(--wp-text)}.wp-claim-fee-label{position:relative;display:inline-flex;align-items:center;text-decoration:underline dotted;text-underline-offset:3px;cursor:help;overflow:visible!important}.wp-claim-fee-tooltip{position:absolute;left:0;bottom:calc(100% + 8px);z-index:2;width:min(260px,calc(100vw - 64px));padding:10px 12px;border-radius:8px;background:var(--wp-tooltip-bg);color:var(--wp-tooltip-text);box-shadow:0 12px 32px #0000003d;font-size:11px;font-weight:400;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-claim-fee-label:hover .wp-claim-fee-tooltip,.wp-claim-fee-label:focus .wp-claim-fee-tooltip,.wp-claim-fee-label:focus-visible .wp-claim-fee-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-claim-actions{display:flex;align-items:center;gap:8px;width:100%}.wp-claim-primary,.wp-claim-secondary{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;height:52px;padding:0 24px;border:none;border-radius:40px;font-family:inherit;font-size:15px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap;cursor:pointer}.wp-claim-primary{background:var(--wp-claim-primary);color:var(--wp-claim-primary-text)}.wp-claim-primary:disabled{cursor:default;opacity:.72}.wp-claim-secondary{background:var(--wp-claim-secondary-bg, var(--wp-control));color:var(--wp-claim-primary)}.wp-claim-actions[data-count="2"] .wp-claim-primary{flex:1 1 0}.wp-claim-actions[data-count="2"] .wp-claim-secondary{flex:0 0 120px}.wp-claim-button-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(32,37,48,.28);border-top-color:var(--wp-claim-primary-text);animation:wp-claim-spin .8s linear infinite}.wp-claim-home-indicator{display:flex;align-items:flex-end;justify-content:center;height:34px;min-height:34px;padding-bottom:8px;box-sizing:border-box}.wp-claim-home-indicator span{display:block;width:134px;height:5px;border-radius:16px;background:var(--wp-text-40)}@media(max-width:359px){.wp-header{gap:12px;padding:0 12px}.wp-total{font-size:24px}.wp-body-inner{padding:0 12px 128px;gap:20px}.wp-svc-items,.wp-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
8
+ `);import{Fragment as os,jsx as G,jsxs as He}from"react/jsx-runtime";var fo=5,ns="wp:";function Mt({env:e,theme:t="dark",walletAddress:o,walletName:n,onBack:r,showHeader:i=!0,variant:s="embed",className:l,onOutlink:d}){let c=ge(e),a=!!o,p=ts(),b=xe.useId(),h=Nr(c),{formattedTotal:x}=br(c,o,a),[,g]=xe.useState(fo),[w,C]=xe.useState(!1),M=xe.useCallback(()=>{p.invalidateQueries({predicate:P=>typeof P.queryKey[0]=="string"&&P.queryKey[0].startsWith(ns)})},[p]),T=xe.useCallback(()=>{M(),C(!0),setTimeout(()=>C(!1),600),g(fo)},[M]);xe.useEffect(()=>{if(!a)return;let P=setInterval(()=>{g(N=>N<=1?(T(),fo):N-1)},1e3);return()=>clearInterval(P)},[a,T]);let L=xe.useCallback(()=>{r?.()},[r]),W=a?wt(c,o,{size:64}):void 0,y=xe.useMemo(()=>({env:c,theme:t,open:!0,walletAddress:o,close:L,onOutlink:d}),[c,t,o,L,d]),I=He(os,{children:[i&&He("div",{className:"wp-header",children:[He("div",{className:"wp-header-account",children:[r?G("button",{type:"button",className:"wp-header-btn",onClick:r,children:G(xr,{})}):G("span",{className:"wp-header-avatar","aria-hidden":!0,children:W&&G("img",{src:W,alt:"",className:"wp-header-avatar-img",draggable:!1})}),n&&G("span",{className:"wp-header-wallet-name",title:n,children:n})]}),G("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:T,children:G(vr,{className:w?"wp-spin-once":void 0})})]}),G("div",{className:"wp-body",children:He("div",{className:"wp-body-inner",children:[He("section",{className:"wp-summary-card","aria-label":"Estimated portfolio value",children:[He("div",{className:"wp-summary-head",children:[He("div",{className:"wp-address",children:[G("span",{className:"wp-address-avatar","aria-hidden":!0}),G("span",{className:"wp-address-label",children:Lr(o)}),G(kr,{className:"wp-address-chevron"})]}),He("div",{className:"wp-summary-estimate",children:[G("span",{className:"wp-summary-badge",children:"Estimated"}),h&&He("button",{type:"button",className:"wp-estimate-info","aria-label":"USD estimate details","aria-describedby":b,children:[G(yr,{size:14}),He("span",{id:b,role:"tooltip",className:"wp-estimate-tooltip",children:[G("span",{className:"wp-estimate-tooltip-title",children:"USD estimate includes"}),G("span",{className:"wp-estimate-tooltip-group",children:co.included.map(P=>G("span",{className:"wp-estimate-tooltip-item",children:P},P))}),G("span",{className:"wp-estimate-tooltip-title",children:"Not included"}),G("span",{className:"wp-estimate-tooltip-group",children:co.excluded.map(P=>G("span",{className:"wp-estimate-tooltip-item",children:P},P))})]})]})]})]}),G("p",{className:"wp-total",children:x})]}),G(Sr,{}),G(Mr,{}),G(Or,{})]})})]});return G(Vt.Provider,{value:y,children:s==="none"?I:G("div",{className:K(s==="fullscreen"?"wp-fullscreen":"wp-embed",l),"data-theme":t,children:I})})}import{jsx as uo,jsxs as Fr}from"react/jsx-runtime";function Dr({className:e}){let{env:t,theme:o,walletAddress:n,close:r,onOutlink:i}=Ee();return Fr(vn.Portal,{children:[uo(vn.Overlay,{className:"wp-overlay"}),Fr(vn.Content,{className:K("wp-fullscreen",e),"data-theme":o,children:[uo(vn.Title,{className:"wp-sr-only",children:"My Portfolio"}),uo(Mt,{env:t,theme:o,walletAddress:n,onBack:r,variant:"none",onOutlink:i})]})]})}import{jsx as Wr}from"react/jsx-runtime";function is({env:e,theme:t="dark",walletAddress:o,open:n,onOpenChange:r,onOutlink:i,children:s}){let l=ge(e),d=n!==void 0,[c,a]=vt.useState(!1),p=d?n:c,b=vt.useCallback(g=>{d||a(g),r?.(g)},[d,r]),h=vt.useCallback(()=>b(!1),[b]),x=vt.useMemo(()=>({env:l,theme:t,open:p,walletAddress:o,close:h,onOutlink:i}),[l,t,p,o,h,i]);return Wr(Vt.Provider,{value:x,children:Wr(rs.Root,{direction:"bottom",open:p,onOpenChange:b,noBodyStyles:!0,children:s})})}var Br=Object.assign(is,{Trigger:dr,Content:Dr});import{Fragment as wo,jsx as m,jsxs as E}from"react/jsx-runtime";function go(e,t,o){let n=me[e],r=o.toUpperCase();if(t===n.cross&&r.includes("CROSSD"))return 0;if(t===n.cross&&r==="CROSS")return 1;if(t===n.bsc&&r==="CROSS")return 2}function ss(e){return parseInt(e.split(":")[1],10)}function ls(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function cs(e){let t=e.toLowerCase().replace(/^0x/,""),o=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),n=parseInt(o.slice(0,4),16)%360,r=(n+60+parseInt(o.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${n} 85% 65%), hsl(${r} 80% 55%))`}function zr({align:e="end",sideOffset:t=12,className:o,children:n}){let{env:r,theme:i,isMobile:s,open:l,drawerDirection:d,modal:c,showBalance:a,showForgeToken:p,showGameToken:b,showQR:h,qrLogoSrc:x,walletAddress:g,accountName:w,sendAccounts:C,profileImageUrl:M,preferredTokens:T,close:L,onSelectWallet:W,onCopyAddress:y,onDisconnect:I,disconnectLabel:P,termsUrl:N,termsLabel:q,privacyUrl:B,privacyLabel:ve,portalStyle:We,navContent:te,navPosition:Pe,footerContent:Ie,view:Y,setView:Qe,selectedSendToken:Xe,setSelectedSendToken:fe,showPortfolio:Je,portfolioTitle:ye,showTotalAssets:X,totalAssetsLabel:Z,sendTransaction:Ge,getTransactionReceipt:de,estimateGas:Be,onOutlink:ke}=nt(),{tokens:pe,isLoading:Ce}=Et(r,g,l&&a),{statsMap:J}=Pt(r,a),{categoryMap:Te}=sr(r,a),ne=a&&X,{displayValue:it,isLowerBound:Ne,isLoading:et}=lr(r,g,l&&ne),[Ue,qe]=V.useState(!1),at=V.useRef(null),[Me,Ze]=V.useState(0),{holdings:Ae,isLoading:tt}=ir(r,g,l&&a&&p),Ke=V.useMemo(()=>Ae.map(v=>v.token),[Ae]),{imageMap:_e}=ar(r,Ke,p&&Ae.length>0),ue=V.useMemo(()=>{let v=[],z=[],H=[],ee=new Map((T??[]).map(($,Q)=>[`${ss($.chainId)}:${$.address.toLowerCase()}`,Q]));for(let $ of pe){let Q=go(r,$.chainId,$.symbol)!==void 0,pt=`${$.chainId}:${$.address.toLowerCase()}`,mt=ee.get(pt),_n=new Gt($.quantity.numeric).shiftedBy(-$.quantity.decimals);if(Q)v.push($);else if(mt!==void 0)z.push($);else if(_n.isGreaterThan(0)){if(!b&&Te.get(io($.chainId,$.address))==="game")continue;H.push($)}}return v.sort(($,Q)=>{let pt=go(r,$.chainId,$.symbol)??99,mt=go(r,Q.chainId,Q.symbol)??99;return pt-mt}),z.sort(($,Q)=>{let pt=ee.get(`${$.chainId}:${$.address.toLowerCase()}`)??99,mt=ee.get(`${Q.chainId}:${Q.address.toLowerCase()}`)??99;return pt-mt}),H.sort(($,Q)=>{let pt=J.get(ht($.chainId,$.address)),mt=J.get(ht(Q.chainId,Q.address)),_n=new Gt($.quantity.numeric).shiftedBy(-$.quantity.decimals).multipliedBy(pt?.price??0);return new Gt(Q.quantity.numeric).shiftedBy(-Q.quantity.decimals).multipliedBy(mt?.price??0).minus(_n).toNumber()}),[...v,...z,...H]},[pe,r,J,b,Te,T]),Oe=V.useMemo(()=>{if(!p)return[];let v=new Set(pe.map(z=>z.address.toLowerCase()));return[...Ae].filter(z=>!v.has(z.token.toLowerCase())).sort((z,H)=>{let ee=new Gt(z.value);return new Gt(H.value).minus(ee).toNumber()})},[Ae,p,pe]),Le=V.useRef(!1),ze=V.useCallback(v=>{Le.current=!0,Qe(v)},[Qe]),Mn=V.useCallback(()=>{fe(null),ze("wallet")},[fe,ze]),Yt=V.useCallback(v=>{fe(v),ze("send")},[fe,ze]),Qt=V.useCallback(()=>{fe(null),ze("wallet")},[fe,ze]);V.useEffect(()=>{l||(Le.current=!1)},[l]);let Xt=V.useRef(null);V.useEffect(()=>{let v=Xt.current;if(!v||!s)return;let z=H=>{H.pointerType==="touch"&&H.stopPropagation()};return v.addEventListener("pointerdown",z),()=>v.removeEventListener("pointerdown",z)},[s]);let[st,lt]=V.useState(!1),kt=V.useRef(void 0);V.useEffect(()=>()=>clearTimeout(kt.current),[]),V.useEffect(()=>{let v=at.current;if(!v||Ie===null){Ze(0);return}let z=()=>{Ze(v.offsetHeight)};if(z(),typeof ResizeObserver>"u")return;let H=new ResizeObserver(z);return H.observe(v),()=>H.disconnect()},[Ie]);let Jt=V.useCallback(async()=>{if(!st)try{await navigator.clipboard.writeText(g),lt(!0),clearTimeout(kt.current),kt.current=setTimeout(()=>lt(!1),2e3),y?.(g,!0)}catch{y?.(g,!1)}},[g,y,st]),_t=V.useCallback(v=>{v.currentTarget.setAttribute("data-loaded","true")},[]),An=V.useMemo(()=>({background:cs(g)}),[g]),Ot=V.useMemo(()=>M||wt(r,g,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[M,r,g,i]),f=V.useMemo(()=>ls(it),[it]),R=N||B?E("div",{className:"wi-legal-links",children:[N&&m("a",{className:"wi-legal-link",href:N,target:"_blank",rel:"noopener noreferrer",onClick:v=>$e(v,N,{category:"terms",origin:"terms"},ke),children:q}),N&&B&&m("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),B&&m("a",{className:"wi-legal-link",href:B,target:"_blank",rel:"noopener noreferrer",onClick:v=>$e(v,B,{category:"privacy",origin:"privacy"},ke),children:ve})]}):null,F=I?E("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{I(),L()},children:[m(zo,{size:12}),m("span",{className:"wi-disconnect-label",children:P})]}):null,O=E("div",{className:K("wi-view-inner",Le.current&&"wi-view-wallet"),children:[ne&&(()=>{let v=Je;return E(v?"button":"div",{...v?{type:"button",onClick:()=>ze("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":v||void 0,children:[E("div",{className:"wi-total-head",children:[m("span",{className:"wi-total-label",children:Z}),m("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:H=>{H.stopPropagation(),qe(ee=>!ee)},onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),H.stopPropagation(),qe(ee=>!ee))},"aria-label":Ue?"Show balance":"Hide balance",children:Ue?m(Uo,{}):m(Go,{})})]}),E("div",{className:"wi-total-body",children:[et?m("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):m("div",{className:"wi-total-value","data-hidden":Ue||void 0,children:Ue?m("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):E(wo,{children:[Ne&&m("span",{className:"wi-total-lte",children:"\u2264"}),m("span",{className:"wi-total-currency",children:"$"}),m("span",{className:"wi-total-amount",children:f.main}),f.decimal&&m("span",{className:"wi-total-decimal",children:f.decimal})]})}),v&&m("span",{className:"wi-total-chevron","aria-hidden":!0,children:m(Vo,{size:18})})]})]})})(),Pe==="top"&&te&&m("div",{className:"wi-nav-fixed",children:te}),a&&m("div",{ref:Xt,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:E("div",{className:"wi-token-list",children:[Ce&&Array.from({length:5},(v,z)=>E("div",{className:"wi-skeleton-item",children:[E("div",{className:"wi-skeleton-left",children:[m("div",{className:"wi-skeleton-block wi-skeleton-icon"}),E("div",{className:"wi-skeleton-lines",children:[m("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),m("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),E("div",{className:"wi-skeleton-right",children:[m("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),m("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},z)),!Ce&&ue.length===0&&!p&&m("div",{className:"wi-empty",children:"No Tokens Found"}),ue.map(v=>{let z=J.get(ht(v.chainId,v.address)),H=z?parseFloat(z.percent_change_24h):null,ee=H!==null&&H>=0,$=$n(r,v.chainId);return E("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>Yt(v),"aria-label":`Send ${v.symbol}`,children:[E("div",{className:"wi-token-left",children:[E("div",{className:"wi-token-icon-wrap",children:[m("img",{src:v.icon_url,alt:v.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:_t,onError:Q=>{Q.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),$&&m("img",{src:$,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Q=>{Q.currentTarget.style.display="none"}})]}),E("div",{className:"wi-token-info",children:[m("span",{className:"wi-token-name",children:v.symbol}),z&&E("div",{className:"wi-token-price-row",children:[m("span",{className:"wi-token-price",children:Bn(z.price)}),m("span",{className:"wi-token-change","data-positive":ee,"data-zero":H===0||void 0,children:H!==null&&(H===0?"0%":`${ee?"+":"-"}${(ee?Math.floor:Math.ceil)(Math.abs(H)*100)/100}%`)})]})]})]}),E("div",{className:"wi-token-right",children:[m("span",{className:"wi-token-balance",children:gt(v.quantity.numeric,v.quantity.decimals)}),z&&m("span",{className:"wi-token-value",children:Fo(v.quantity.numeric,v.quantity.decimals,z.price)})]})]},`${v.address}-${v.chainId}`)}),p&&tt&&Array.from({length:3},(v,z)=>E("div",{className:"wi-skeleton-item",children:[E("div",{className:"wi-skeleton-left",children:[m("div",{className:"wi-skeleton-block wi-skeleton-icon"}),E("div",{className:"wi-skeleton-lines",children:[m("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),m("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),E("div",{className:"wi-skeleton-right",children:[m("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),m("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${z}`)),p&&!tt&&!Ce&&ue.length===0&&Oe.length===0&&m("div",{className:"wi-empty",children:"No Tokens Found"}),p&&Oe.map(v=>{let z=_e.get(v.token)||"",H=$n(r,me[r].cross);return E("div",{className:"wi-token-item",children:[E("div",{className:"wi-token-left",children:[E("div",{className:"wi-token-icon-wrap",children:[m("img",{src:z||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:v.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:_t,onError:ee=>{ee.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),H&&m("img",{src:H,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:ee=>{ee.currentTarget.style.display="none"}})]}),E("div",{className:"wi-token-info",children:[m("span",{className:"wi-token-name",children:v.token_name}),m("div",{className:"wi-token-price-row",children:E("span",{className:"wi-token-price",children:[gt(v.current_price,18)," CROSS"]})})]})]}),E("div",{className:"wi-token-right",children:[m("span",{className:"wi-token-balance",children:gt(v.balance,18)}),m("span",{className:"wi-token-value",children:Bn(v.current_value_usd)})]})]},`forge-${v.token}`)})]})}),Pe==="bottom"&&te&&m("div",{className:"wi-nav-fixed",children:te}),F&&m("div",{className:"wi-wallet-disconnect-row",children:F})]},"wallet"),j=Je?m("div",{className:K("wi-view-inner wi-portfolio-body",Le.current&&"wi-view-portfolio"),children:m(Mt,{env:r,theme:i,walletAddress:g,showHeader:!1,onOutlink:ke})},"portfolio"):null,oe=Xe?m("div",{className:K("wi-view-inner wi-send-body",Le.current&&"wi-view-send"),children:m(pn,{env:r,theme:i,walletAddress:g,accountName:w,accounts:C,token:Xe,tokens:ue,onTokenChange:fe,sendTransaction:Ge,getTransactionReceipt:de,estimateGas:Be,onConfirmSuccess:Qt,onOutlink:ke})},"send"):null,ct=m("div",{className:K("wi-view-inner wi-qr-body",Le.current&&"wi-view-qr"),children:E("div",{className:"wi-qr-section",children:[E("div",{className:"wi-qr-card",children:[E("div",{className:"wi-qr-code",children:[m(as,{value:g,size:180,level:"H",marginSize:2,...x&&{imageSettings:{src:x,height:33,width:33,excavate:!0}}}),!x&&m("div",{className:"wi-qr-logo",children:m(qo,{size:33})})]}),m("p",{className:"wi-qr-address",children:g}),E("button",{type:"button",className:"wi-qr-copy-btn",onClick:Jt,children:[m("span",{className:"wi-qr-copy-icon",children:st?m(zt,{size:16}):m(Hn,{size:16})}),m("span",{className:"wi-qr-copy-text",children:st?"Copied!":"Copy address"})]})]}),R]})},"qr"),se=Y==="qr"||Y==="portfolio"||Y==="send",dt=Ie!==null?m("div",{className:"wi-builtin-footer",children:Ie}):null,Ft=!!W&&w?.trim().toLowerCase()!=="my wallet",Dt=E("div",{className:"wi-account-text",children:[Ft?E("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:W,"aria-label":"Switch account",children:[m("span",{className:"wi-account-name",children:w??"Account 1"}),m("span",{className:"wi-account-switch","aria-hidden":"true",children:m(jo,{size:12})})]}):m("div",{className:"wi-account-row",children:m("span",{className:"wi-account-name",children:w??"Account 1"})}),E("button",{type:"button",className:"wi-address-row-btn",onClick:Jt,"aria-label":"Copy address",children:[m("span",{className:"wi-account-address",children:Re(g)}),m("span",{className:"wi-account-copy",children:st?m(zt,{size:14}):m(Hn,{size:14})})]})]}),tn=E(wo,{children:[n,se?E("div",{className:"wi-sticky-header",children:[E("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[m("button",{type:"button",className:"wi-header-back",onClick:Mn,"aria-label":"Back",children:m(Ho,{})}),m("div",{className:"wi-account-block wi-account-block--sub-account",children:Dt}),m("button",{type:"button",className:"wi-header-action",onClick:L,"aria-label":"Close",children:m(Vn,{size:24})})]}),m("hr",{className:"wi-divider"})]}):E("div",{className:"wi-sticky-header",children:[E("div",{className:"wi-header wi-header--wallet",children:[E("div",{className:"wi-account-block",children:[E("div",{className:"wi-avatar",children:[m("div",{className:"wi-avatar-fallback",style:An}),Ot&&m("img",{src:Ot,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:_t,onError:v=>{v.currentTarget.style.display="none"}})]}),Dt]}),E("div",{className:"wi-header-actions",children:[h&&m("button",{type:"button",className:"wi-header-action",onClick:()=>ze("qr"),"aria-label":"Show QR code",children:m($o,{size:20})}),m("button",{type:"button",className:"wi-header-action",onClick:L,"aria-label":"Close",children:m(Vn,{size:24})})]})]}),m("hr",{className:"wi-divider"})]}),E("div",{className:"wi-view-container",children:[Y==="wallet"&&O,Y==="qr"&&ct,Y==="portfolio"&&j,Y==="send"&&oe]}),dt&&Y!=="portfolio"&&Y!=="send"&&m("div",{className:"wi-sticky-footer",children:m("div",{className:"wi-footer",ref:at,children:dt})})]}),Ct={...We,...Me>0?{"--wi-footer-height":`${Me}px`}:null};return s?E(yn.Portal,{children:[c&&m(yn.Overlay,{className:"wi-drawer-overlay"}),E(yn.Content,{className:K("wi-drawer-content",o),"data-theme":i,style:Ct,"data-direction":d,"data-no-balance":!a||void 0,"data-has-footer":Me>0||void 0,"data-view":Y,children:[m(yn.Title,{className:"wi-sr-only",children:"My Wallet"}),tn]})]}):E(wo,{children:[c&&l&&m("div",{className:"wi-drawer-overlay",onClick:L}),m(kn.Portal,{children:m(kn.Content,{align:e,sideOffset:t,className:K("wi-popover-content",o),"data-theme":i,style:Ct,"data-no-balance":!a||void 0,"data-has-footer":Me>0||void 0,"data-view":Y,children:tn})})]})}import*as $r from"react";function Hr({position:e="top",children:t}){let{setNavContent:o,setNavPosition:n}=nt();return $r.useEffect(()=>(o(t),n(e),()=>o(null)),[t,e,o,n]),null}import*as Vr from"react";function jr({children:e}){let{setFooterContent:t}=nt();return Vr.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}A(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--cck-primary, #019d92);--wi-secondary: var(--cck-secondary, #e70077);--wi-surface-bg: var(--cck-surface-bg, #121212);--wi-surface-default: var(--cck-surface-default, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--cck-surface-subtle, rgba(255, 255, 255, .1));--wi-border-default: var(--cck-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--cck-border-subtle, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--cck-texticon-primary, #ffffff);--wi-texticon-secondary: var(--cck-texticon-secondary, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--cck-texticon-tertiary, rgba(255, 255, 255, .5));--wi-on-primary: var(--cck-on-primary, #ffffff);--wi-error: var(--cck-error, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--cck-primary, #019d92);--wi-secondary: var(--cck-secondary, #e70077);--wi-surface-bg: var(--cck-surface-bg, #ffffff);--wi-surface-default: var(--cck-surface-default, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--cck-surface-subtle, rgba(18, 18, 18, .1));--wi-border-default: var(--cck-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--cck-border-subtle, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--cck-texticon-primary, #121212);--wi-texticon-secondary: var(--cck-texticon-secondary, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--cck-texticon-tertiary, rgba(18, 18, 18, .5));--wi-on-primary: var(--cck-on-primary, #ffffff);--wi-error: var(--cck-error, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
9
9
  `);A(`.wi-trigger-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border:1px solid rgba(255,255,255,.2);background:#1a2332;border-radius:9999px;cursor:pointer;color:#fff;font-family:inherit;font-size:16px;font-weight:500;line-height:24px;letter-spacing:-.3125px;transition:opacity .15s ease}.wi-trigger-btn:hover{opacity:.85}.wi-trigger-btn[data-theme=light]{background:#f3f6f8;border-color:#1212121a;color:#121212}.wi-trigger-btn[data-mobile]{font-size:14px;padding:6px 12px;gap:6px;line-height:20px}.wi-trigger-address{white-space:nowrap}.wi-divider{height:1px;background:var(--wi-border-default);margin:0;border:none;flex-shrink:0}[data-theme=light] .wi-divider{background:#1212121a}[data-theme=dark] .wi-divider{background:#ffffff1a}
10
10
  `);A(`@keyframes wi-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes wi-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@keyframes wi-slide-in-right{0%{transform:translate(40px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes wi-slide-in-left{0%{transform:translate(-40px);opacity:0}to{transform:translate(0);opacity:1}}
11
11
  `);A(`.wi-popover-content{z-index:100001;width:343px;border-radius:24px;border:1px solid var(--wi-border-default);background:var(--wi-surface-bg);box-shadow:var(--wi-shadow);animation:wi-fade-in .15s ease-out;height:552px;overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(552px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:0;left:0;right:0;width:100%;max-height:100dvh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:100dvh}.wi-popover-content[data-view=qr]{height:auto;max-height:calc(100dvh - 32px);overflow-y:auto}.wi-drawer-content[data-view=qr]{overflow-y:auto}.wi-sticky-header{flex-shrink:0}.wi-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:20px 24px}.wi-header--wallet{align-items:flex-start}.wi-header--sub-account{align-items:center}.wi-header--sub-account .wi-header-back{width:32px;height:38px}.wi-header--sub-account .wi-header-action{flex-shrink:0}.wi-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wi-account-block--sub-account{align-items:center}.wi-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;padding:4px;border-radius:50%;background:var(--wi-surface-bg);box-sizing:border-box;overflow:hidden}.wi-avatar-fallback{position:absolute;inset:4px;border-radius:50%;z-index:0}.wi-avatar-img{position:relative;z-index:1;width:30px;height:30px;border-radius:50%;object-fit:cover;background:transparent}.wi-account-text{display:flex;flex-direction:column;gap:2px;min-width:0}.wi-account-row{display:flex;align-items:center;gap:8px;min-width:0}.wi-account-row--btn{padding:2px 4px;margin:-2px -4px;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;border-radius:6px;transition:background-color .15s ease,opacity .15s ease}.wi-account-row--btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .06))}.wi-account-row--btn:focus-visible{outline:2px solid var(--wi-primary, #00d5aa);outline-offset:2px}.wi-account-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.4;color:var(--wi-texticon-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-switch{display:inline-flex;align-items:center;justify-content:center;padding:2px;border:none;background:transparent;color:var(--wi-texticon-tertiary);border-radius:4px;flex-shrink:0}.wi-address-row-btn{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;text-align:left;min-width:0;transition:opacity .15s ease}.wi-address-row-btn:hover{opacity:.7}.wi-account-address{font-family:inherit;font-size:12px;font-weight:400;line-height:1.4;color:var(--wi-texticon-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-copy{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:var(--wi-texticon-tertiary);flex-shrink:0}.wi-header-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.wi-header-action{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--wi-texticon-primary);flex-shrink:0;transition:opacity .15s ease,background .15s ease}.wi-header-action:hover{opacity:.75}.wi-header-info{flex:1;display:flex;flex-direction:column;gap:8px;min-width:0}.wi-header-title{font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);margin:0}.wi-header-close{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--wi-texticon-primary);transition:opacity .15s ease}.wi-header-close:hover{opacity:.7}.wi-total-section{margin:16px 24px 0;padding:0;flex-shrink:0;display:flex;flex-direction:column;gap:8px;border:none;background:transparent;border-radius:12px;color:inherit;font:inherit;text-align:left;width:auto}button.wi-total-section{cursor:pointer;transition:opacity .15s ease}button.wi-total-section:hover,button.wi-total-section:focus-visible{outline:none;opacity:.85}.wi-total-head{display:flex;align-items:center;gap:4px}.wi-total-body{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.wi-total-chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--wi-texticon-tertiary);flex-shrink:0;transition:transform .15s ease,color .15s ease}button.wi-total-section:hover .wi-total-chevron,button.wi-total-section:focus-visible .wi-total-chevron{color:var(--wi-texticon-primary);transform:translate(2px)}.wi-total-label{font-family:inherit;font-size:12px;font-weight:400;line-height:1.4;color:var(--wi-texticon-tertiary)}.wi-total-eye{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:var(--wi-texticon-tertiary);cursor:pointer;transition:opacity .15s ease;border-radius:4px}.wi-total-eye:hover{opacity:.7}.wi-total-eye:focus-visible{outline:1px solid var(--wi-texticon-secondary);outline-offset:2px}.wi-total-value{display:flex;align-items:baseline;gap:0;font-family:inherit;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);font-variant-numeric:tabular-nums;min-height:36px;white-space:nowrap}.wi-total-currency,.wi-total-amount{font-size:28px}.wi-total-decimal{font-size:20px;color:var(--wi-texticon-primary)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:20px;color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:28px;color:var(--wi-texticon-secondary)}.wi-total-skeleton{border-radius:6px}.wi-scrollable-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:16px 24px 0;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}.wi-drawer-content .wi-scrollable-body{touch-action:pan-y}[data-theme=light] .wi-scrollable-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-scrollable-body::-webkit-scrollbar{width:4px}.wi-scrollable-body::-webkit-scrollbar-track{background:transparent}.wi-scrollable-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#0003}.wi-nav-fixed{flex-shrink:0;padding:0 24px}.wi-token-list{display:flex;flex-direction:column;gap:12px}.wi-token-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-token-left{display:flex;align-items:center;gap:12px;min-width:0}.wi-token-icon-wrap{position:relative;width:32px;height:32px;flex-shrink:0}.wi-token-icon{width:28px;height:28px;object-fit:contain;opacity:0;transition:opacity .2s ease}.wi-token-icon[data-loaded=true]{opacity:1}.wi-token-chain-badge{position:absolute;right:0;bottom:0;width:14px;height:14px;border-radius:50%;background:var(--wi-surface-bg);box-shadow:0 0 0 1.5px var(--wi-surface-bg);object-fit:contain}.wi-token-info{display:flex;flex-direction:column;min-width:0}.wi-token-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);white-space:nowrap}.wi-token-price-row{display:flex;align-items:center;gap:4px}.wi-token-price{font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;color:var(--wi-texticon-secondary);white-space:nowrap}.wi-token-change{font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;white-space:nowrap}.wi-token-change[data-positive=true]{color:var(--wi-primary)}.wi-token-change[data-positive=false]{color:var(--wi-secondary)}.wi-token-change[data-zero]{opacity:.8}.wi-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.wi-token-balance{font-family:inherit;font-size:14px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);white-space:nowrap}.wi-token-value{font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;color:var(--wi-texticon-secondary);white-space:nowrap}.wi-sticky-footer{flex-shrink:0}.wi-footer{padding:16px 24px 24px}.wi-builtin-footer{display:flex;flex-direction:column;gap:8px;align-items:stretch}.wi-wallet-disconnect-row{display:flex;justify-content:flex-end;flex-shrink:0;padding:8px 24px 16px}.wi-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:16px;padding:0;border:none;background:transparent;color:var(--wi-texticon-tertiary);font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;cursor:pointer;transition:opacity .15s ease}.wi-disconnect-btn:hover{opacity:.75}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;flex-shrink:0;margin-top:16px;font-family:inherit;font-size:10px;font-weight:400;line-height:1.3;color:var(--wi-texticon-tertiary)}.wi-legal-link{color:inherit;text-decoration:underline;text-underline-offset:2px;transition:opacity .15s ease}.wi-legal-link:hover{opacity:.75}.wi-legal-sep{color:inherit}.wi-empty{display:flex;align-items:center;justify-content:center;padding:32px 0;font-family:inherit;font-size:16px;color:var(--wi-texticon-secondary)}.wi-skeleton-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-skeleton-left{display:flex;align-items:center;gap:12px}.wi-skeleton-block{border-radius:6px;background:var(--wi-border-default);position:relative;overflow:hidden}.wi-skeleton-block:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.06) 50%,transparent 100%);animation:wi-shimmer 1.5s ease-in-out infinite}[data-theme=light] .wi-skeleton-block:after{background:linear-gradient(90deg,transparent 0%,rgba(0,0,0,.04) 50%,transparent 100%)}.wi-skeleton-icon{width:32px;height:32px;border-radius:50%;flex-shrink:0}.wi-skeleton-lines{display:flex;flex-direction:column;gap:6px}.wi-skeleton-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.wi-header-back{display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wi-texticon-primary);flex-shrink:0;transition:opacity .15s ease}.wi-header-back:hover{opacity:.7}.wi-view-container{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-popover-content[data-view=qr] .wi-view-container,.wi-drawer-content[data-view=qr] .wi-view-container{flex:0 0 auto;min-height:424px;overflow:visible}.wi-view-inner{display:flex;flex-direction:column;flex:1;min-height:0}.wi-view-wallet{animation:wi-slide-in-left .25s ease-out}.wi-view-qr,.wi-view-portfolio{animation:wi-slide-in-right .25s ease-out}.wi-qr-body{flex:1;min-height:0;display:flex;flex-direction:column}.wi-portfolio-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-portfolio-body>.wp-embed{flex:1;min-height:0}.wi-portfolio-body .wp-top{padding:16px 20px;gap:14px}.wi-portfolio-body .wp-body-inner{padding:4px 20px 24px;gap:16px}.wi-qr-section{flex:0 0 auto;min-height:424px;display:flex;flex-direction:column;overflow:visible;padding:16px 24px}.wi-qr-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;flex:0 0 auto;min-height:356px;padding:32px 24px;background:var(--wi-border-default);border:1px solid var(--wi-border-default);border-radius:12px}.wi-qr-code{position:relative;display:flex;align-items:center;justify-content:center}.wi-qr-logo{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none}.wi-qr-address{font-family:inherit;font-size:14px;font-weight:400;line-height:1.3;color:var(--wi-texticon-primary);text-align:center;word-break:break-all;max-width:247px;margin:0}.wi-qr-copy-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px;border:1px solid var(--wi-border-subtle);background:var(--wi-surface-default);border-radius:8px;cursor:pointer;transition:opacity .15s ease}.wi-qr-copy-btn:hover{opacity:.7}.wi-qr-copy-icon{display:inline-flex;color:var(--wi-texticon-secondary)}.wi-qr-copy-text{font-family:inherit;font-size:12px;font-weight:600;line-height:1.3;color:var(--wi-texticon-secondary);white-space:nowrap}
12
12
  `);A(`.wi-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
13
- `);import{jsx as ho}from"react/jsx-runtime";var ds="https://terms.crosstoken.io/docs/cross-terms-of-use",ps="https://terms.crosstoken.io/docs/nexus-privacy-policy";function ms({env:e,theme:t="dark",mobileBreakpoint:o=768,drawerDirection:n,modal:r,showBalance:i=!1,showForgeToken:s=!1,showGameToken:l=!0,showQR:d=!0,qrLogoSrc:c,walletAddress:a,accountName:p,sendAccounts:b,profileImageUrl:h,connectorId:x,connectorName:g,connectorIconUrl:w,preferredTokens:C=[],onSelectWallet:M,onCopyAddress:T,onDisconnect:L,disconnectLabel:W="Disconnect",termsUrl:y=ds,termsLabel:I="Terms of Service",privacyUrl:P=ps,privacyLabel:N="Privacy Policy",open:q,onOpenChange:B,showPortfolio:ve=!1,portfolioTitle:We="My Portfolio",showTotalAssets:te=!0,totalAssetsLabel:Pe="Total Assets USD",sendTransaction:Ie,getTransactionReceipt:K,estimateGas:Qe,onOutlink:Xe,style:fe,children:Je}){let ye=ge(e),X=x?sn[x]:void 0,Z=g??X?.name,Ge=w??X?.iconUrl,de=Nt(`(max-width: ${o}px)`),Be=n??(i?"right":"bottom"),ke=r??!1,pe=q!==void 0,[Ce,J]=ce.useState(!1),Te=pe?q:Ce,ne=ce.useCallback(Oe=>{pe||J(Oe),B?.(Oe)},[pe,B]),it=ce.useCallback(()=>ne(!1),[ne]),[Ne,et]=ce.useState(null),[Ue,qe]=ce.useState("top"),[at,Me]=ce.useState(null),[Ze,Ae]=ce.useState("wallet"),[tt,Ye]=ce.useState(null);ce.useEffect(()=>{Te||(Ae("wallet"),Ye(null))},[Te]);let _e=ce.useCallback(()=>{Zn(a),L?.()},[L,a]),ue=ce.useMemo(()=>({env:ye,theme:t,isMobile:de,open:Te,drawerDirection:Be,modal:ke,showBalance:i,showForgeToken:s,showGameToken:l,showQR:d,qrLogoSrc:c,walletAddress:a,accountName:p,sendAccounts:b,profileImageUrl:h,connectorName:Z,connectorIconUrl:Ge,preferredTokens:C,close:it,onSelectWallet:M,onCopyAddress:T,onDisconnect:L?_e:void 0,disconnectLabel:W,termsUrl:y,termsLabel:I,privacyUrl:P,privacyLabel:N,portalStyle:fe,navContent:Ne,navPosition:Ue,setNavContent:et,setNavPosition:qe,footerContent:at,setFooterContent:Me,view:Ze,setView:Ae,selectedSendToken:tt,setSelectedSendToken:Ye,showPortfolio:ve,portfolioTitle:We,showTotalAssets:te,totalAssetsLabel:Pe,sendTransaction:Ie,getTransactionReceipt:K,estimateGas:Qe,onOutlink:Xe}),[ye,t,de,Te,Be,ke,i,s,l,d,c,a,p,b,h,Z,Ge,C,it,M,T,L,_e,W,y,I,P,N,fe,Ne,Ue,at,Ze,tt,ve,We,te,Pe,Ie,K,Qe,Xe]);return ho(Dn.Provider,{value:ue,children:de?ho(cs.Root,{direction:Be,open:Te,onOpenChange:ne,noBodyStyles:!0,repositionInputs:!1,children:Je},"drawer"):ho(jr.Root,{open:Te,onOpenChange:ne,children:Je},"popover")})}var At=Object.assign(ms,{Trigger:or,Content:Br,Nav:$r,Footer:Hr});import*as je from"react";import*as si from"@radix-ui/react-dialog";import{Drawer as vs}from"vaul";import{createContext as fs,useContext as us}from"react";var Cn=fs(null);function Ut(){let e=us(Cn);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}import{useState as Gr,useEffect as gs,useCallback as ws}from"react";function Nn(){let[e,t]=Gr([]),[o,n]=Gr(!0);gs(()=>{if(typeof window>"u"){n(!1);return}let i=[],s=d=>{let{info:c}=d.detail;c?.rdns&&!i.some(a=>a.rdns===c.rdns)&&(i.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",s),window.addEventListener("eip6963:crossAnnounceProvider",s),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let l=setTimeout(()=>n(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",s),window.removeEventListener("eip6963:crossAnnounceProvider",s),clearTimeout(l)}},[]);let r=ws(i=>e.some(s=>s.rdns===i),[e]);return{wallets:e,isDetected:r,isLoading:o}}import*as qr from"@radix-ui/react-dialog";import{Drawer as hs}from"vaul";import{jsx as Ur}from"react/jsx-runtime";function Zr({asChild:e,children:t}){let{isMobile:o}=Ut(),n=o?hs.Trigger:qr.Trigger;return Ur(n,{asChild:e??t!=null,children:t??Ur("button",{type:"button",children:"Connect Wallet"})})}import*as He from"@radix-ui/react-dialog";import{Drawer as Rn}from"vaul";import{jsx as D,jsxs as rt}from"react/jsx-runtime";function Ln(){return rt("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),D("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function Yr(){return rt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[rt("g",{clipPath:"url(#clip0_1331_27065)",children:[D("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),D("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),D("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),D("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),D("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),D("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),D("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),D("defs",{children:D("clipPath",{id:"clip0_1331_27065",children:D("rect",{width:"40",height:"40",fill:"white"})})})]})}function Kr(){return rt("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),D("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),D("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),D("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),D("path",{d:"M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z",fill:"#F3BA2F"})]})}function Qr(){return rt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[D("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),D("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),D("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),D("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function Xr(){return rt("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[rt("g",{clipPath:"url(#clip0_1185_7785)",children:[D("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),D("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),D("defs",{children:D("clipPath",{id:"clip0_1185_7785",children:D("rect",{width:"28",height:"28",fill:"white"})})})]})}function Jr(){return rt("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[D("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"}),D("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"}),D("path",{fill:"#4CAF50",d:"M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"}),D("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"})]})}function ei(){return D("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:D("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})})}function ti(){return D("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:D("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var bo={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:Ln},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:Ln,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:Ln,rdns:"nexus.to.crosswallet.desktop",installUrl:"https://chromewebstore.google.com/detail/crossx/nninbdadmocnokibpaaohnoepbnpdgcg",visibility:"desktop-only"},metamask:{id:"metamask",name:"MetaMask",description:"Browser extension approval is required",icon:Yr,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:Kr},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Qr,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Xr,badge:"For SHOP"}};function xo(e){return bo[e]}var vo={google:{id:"google",name:"Google",icon:Jr},apple:{id:"apple",name:"Apple",icon:ei}};function ni(e){return vo[e]}import{Fragment as ii,jsx as _,jsxs as ae}from"react/jsx-runtime";function bs({wallet:e,detected:t,onConnect:o}){let n=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}o()},r=e.icon,i=e.featured===!0;return ae("button",{type:"button",className:Y("wcm-wallet-item",i&&"wcm-wallet-item--featured"),onClick:n,children:[ae("div",{className:"wcm-wallet-item-left",children:[_("div",{className:"wcm-wallet-icon",children:_(r,{})}),ae("div",{className:"wcm-wallet-name-row",children:[_("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&_("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?_("span",{className:"wcm-installed-label",children:"Installed"}):_("span",{className:"wcm-install-btn",children:"Install"}))]})}function xs({social:e,onSignIn:t}){let o=e.icon,n=`Sign in with ${e.name}`;return ae("button",{type:"button",className:"wcm-social-item",onClick:t,"aria-label":n,children:[_("span",{className:"wcm-social-icon",children:_(o,{})}),_("span",{className:"wcm-social-name",children:n})]})}function oi(){let{wallets:e,activeWalletIds:t,socialProviders:o,activeSocialIds:n,termsUrl:r,privacyUrl:i,isDetected:s,close:l,isMobile:d}=Ut(),c=t.filter(b=>{let h=xo(b).visibility;return!h||h==="always"?!0:h==="desktop-only"?!d:h==="mobile-only"?d:!0}),a=n.length>0,p=c.length>0;return ae(ii,{children:[ae("div",{className:"wcm-header",children:[ae("div",{className:"wcm-header-text",children:[_("h2",{className:"wcm-title",children:"CROSS Wallet"}),!d&&_("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),_("button",{type:"button",className:"wcm-close-btn",onClick:l,"aria-label":"Close",children:_(ti,{})})]}),_("div",{className:"wcm-divider"}),ae("div",{className:"wcm-body",children:[a&&ae(ii,{children:[!d&&ae("div",{className:"wcm-section-header",children:[_("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),_("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),_("div",{className:"wcm-social-grid",children:n.map(b=>{let h=ni(b);return _(xs,{social:h,onSignIn:()=>{o[b]?.(),l()}},b)})}),p&&ae("div",{className:"wcm-separator",children:[_("div",{className:"wcm-separator-line"}),_("span",{className:"wcm-separator-text",children:"Other Wallets"}),_("div",{className:"wcm-separator-line"})]})]}),p&&_("div",{className:"wcm-wallet-list",children:c.map(b=>{let h=xo(b),x=h.rdns?s(h.rdns):!1;return _(bs,{wallet:h,detected:x,onConnect:()=>{e[b]?.(),l()}},b)})}),ae("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",_(ri,{href:r,children:"Terms of Service"})," and consent to its ",_(ri,{href:i,children:"Privacy Policy"}),"."]})]})]})}function ri({href:e,children:t}){return e?_("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):_("span",{className:"wcm-terms-link",children:t})}function ai({className:e}){let{isMobile:t,theme:o,portalStyle:n}=Ut();return t?ae(Rn.Portal,{children:[_(Rn.Overlay,{className:"wcm-overlay"}),ae(Rn.Content,{className:Y("wcm-drawer-content",e),"data-theme":o,style:n,children:[_(Rn.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),_("div",{className:"wcm-drawer-handle"}),_("div",{className:"wcm-drawer-body",children:_(oi,{})})]})]}):ae(He.Portal,{children:[_(He.Overlay,{className:"wcm-overlay"}),ae(He.Content,{className:Y("wcm-dialog-content",e),"data-theme":o,style:n,children:[_(He.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),_(He.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),_("div",{className:"wcm-dialog-body",children:_(oi,{})})]})]})}A(`[data-theme=dark]{--wcm-primary: var(--cck-primary, #9b8cef);--wcm-secondary: var(--cck-secondary, #ff3aa3);--wcm-surface-bg: var(--cck-surface-bg, #202530);--wcm-surface-default: var(--cck-surface-default, #292f40);--wcm-surface-subtle: var(--cck-surface-subtle, #313b51);--wcm-border-default: var(--cck-border-default, #313b51);--wcm-border-subtle: var(--cck-border-subtle, #49556e);--wcm-texticon-primary: var(--cck-texticon-primary, #ffffff);--wcm-texticon-secondary: var(--cck-texticon-secondary, #eff0f4);--wcm-texticon-tertiary: var(--cck-texticon-tertiary, #717d97)}[data-theme=light]{--wcm-primary: var(--cck-primary, #019d92);--wcm-secondary: var(--cck-secondary, #e70077);--wcm-surface-bg: var(--cck-surface-bg, #ffffff);--wcm-surface-default: var(--cck-surface-default, rgba(18, 18, 18, .05));--wcm-surface-subtle: var(--cck-surface-subtle, rgba(18, 18, 18, .1));--wcm-border-default: var(--cck-border-default, rgba(18, 18, 18, .05));--wcm-border-subtle: var(--cck-border-subtle, rgba(18, 18, 18, .1));--wcm-texticon-primary: var(--cck-texticon-primary, #121212);--wcm-texticon-secondary: var(--cck-texticon-secondary, rgba(18, 18, 18, .7));--wcm-texticon-tertiary: var(--cck-texticon-tertiary, rgba(18, 18, 18, .5))}
13
+ `);import{jsx as ho}from"react/jsx-runtime";var ps="https://terms.crosstoken.io/docs/cross-terms-of-use",ms="https://terms.crosstoken.io/docs/nexus-privacy-policy";function fs({env:e,theme:t="dark",mobileBreakpoint:o=768,drawerDirection:n,modal:r,showBalance:i=!1,showForgeToken:s=!1,showGameToken:l=!0,showQR:d=!0,qrLogoSrc:c,walletAddress:a,accountName:p,sendAccounts:b,profileImageUrl:h,connectorId:x,connectorName:g,connectorIconUrl:w,preferredTokens:C=[],onSelectWallet:M,onCopyAddress:T,onDisconnect:L,disconnectLabel:W="Disconnect",termsUrl:y=ps,termsLabel:I="Terms of Service",privacyUrl:P=ms,privacyLabel:N="Privacy Policy",open:q,onOpenChange:B,showPortfolio:ve=!1,portfolioTitle:We="My Portfolio",showTotalAssets:te=!0,totalAssetsLabel:Pe="Total Assets USD",sendTransaction:Ie,getTransactionReceipt:Y,estimateGas:Qe,onOutlink:Xe,style:fe,children:Je}){let ye=ge(e),X=x?sn[x]:void 0,Z=g??X?.name,Ge=w??X?.iconUrl,de=Nt(`(max-width: ${o}px)`),Be=n??(i?"right":"bottom"),ke=r??!1,pe=q!==void 0,[Ce,J]=ce.useState(!1),Te=pe?q:Ce,ne=ce.useCallback(Oe=>{pe||J(Oe),B?.(Oe)},[pe,B]),it=ce.useCallback(()=>ne(!1),[ne]),[Ne,et]=ce.useState(null),[Ue,qe]=ce.useState("top"),[at,Me]=ce.useState(null),[Ze,Ae]=ce.useState("wallet"),[tt,Ke]=ce.useState(null);ce.useEffect(()=>{Te||(Ae("wallet"),Ke(null))},[Te]);let _e=ce.useCallback(()=>{Zn(a),L?.()},[L,a]),ue=ce.useMemo(()=>({env:ye,theme:t,isMobile:de,open:Te,drawerDirection:Be,modal:ke,showBalance:i,showForgeToken:s,showGameToken:l,showQR:d,qrLogoSrc:c,walletAddress:a,accountName:p,sendAccounts:b,profileImageUrl:h,connectorName:Z,connectorIconUrl:Ge,preferredTokens:C,close:it,onSelectWallet:M,onCopyAddress:T,onDisconnect:L?_e:void 0,disconnectLabel:W,termsUrl:y,termsLabel:I,privacyUrl:P,privacyLabel:N,portalStyle:fe,navContent:Ne,navPosition:Ue,setNavContent:et,setNavPosition:qe,footerContent:at,setFooterContent:Me,view:Ze,setView:Ae,selectedSendToken:tt,setSelectedSendToken:Ke,showPortfolio:ve,portfolioTitle:We,showTotalAssets:te,totalAssetsLabel:Pe,sendTransaction:Ie,getTransactionReceipt:Y,estimateGas:Qe,onOutlink:Xe}),[ye,t,de,Te,Be,ke,i,s,l,d,c,a,p,b,h,Z,Ge,C,it,M,T,L,_e,W,y,I,P,N,fe,Ne,Ue,at,Ze,tt,ve,We,te,Pe,Ie,Y,Qe,Xe]);return ho(Dn.Provider,{value:ue,children:de?ho(ds.Root,{direction:Be,open:Te,onOpenChange:ne,noBodyStyles:!0,repositionInputs:!1,children:Je},"drawer"):ho(Gr.Root,{open:Te,onOpenChange:ne,children:Je},"popover")})}var At=Object.assign(fs,{Trigger:rr,Content:zr,Nav:Hr,Footer:jr});import*as je from"react";import*as li from"@radix-ui/react-dialog";import{Drawer as ys}from"vaul";import{createContext as us,useContext as gs}from"react";var Cn=us(null);function Ut(){let e=gs(Cn);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}import{useState as Ur,useEffect as ws,useCallback as hs}from"react";function Nn(){let[e,t]=Ur([]),[o,n]=Ur(!0);ws(()=>{if(typeof window>"u"){n(!1);return}let i=[],s=d=>{let{info:c}=d.detail;c?.rdns&&!i.some(a=>a.rdns===c.rdns)&&(i.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",s),window.addEventListener("eip6963:crossAnnounceProvider",s),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let l=setTimeout(()=>n(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",s),window.removeEventListener("eip6963:crossAnnounceProvider",s),clearTimeout(l)}},[]);let r=hs(i=>e.some(s=>s.rdns===i),[e]);return{wallets:e,isDetected:r,isLoading:o}}import*as Zr from"@radix-ui/react-dialog";import{Drawer as bs}from"vaul";import{jsx as qr}from"react/jsx-runtime";function Kr({asChild:e,children:t}){let{isMobile:o}=Ut(),n=o?bs.Trigger:Zr.Trigger;return qr(n,{asChild:e??t!=null,children:t??qr("button",{type:"button",children:"Connect Wallet"})})}import*as Ve from"@radix-ui/react-dialog";import{Drawer as Rn}from"vaul";import{jsx as D,jsxs as rt}from"react/jsx-runtime";function Ln(){return rt("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),D("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function Yr(){return rt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[rt("g",{clipPath:"url(#clip0_1331_27065)",children:[D("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),D("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),D("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),D("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),D("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),D("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),D("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),D("defs",{children:D("clipPath",{id:"clip0_1331_27065",children:D("rect",{width:"40",height:"40",fill:"white"})})})]})}function Qr(){return rt("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),D("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),D("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),D("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),D("path",{d:"M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z",fill:"#F3BA2F"})]})}function Xr(){return rt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[D("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),D("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),D("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),D("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function Jr(){return rt("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[rt("g",{clipPath:"url(#clip0_1185_7785)",children:[D("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),D("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),D("defs",{children:D("clipPath",{id:"clip0_1185_7785",children:D("rect",{width:"28",height:"28",fill:"white"})})})]})}function ei(){return rt("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[D("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"}),D("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"}),D("path",{fill:"#4CAF50",d:"M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"}),D("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"})]})}function ti(){return D("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:D("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})})}function ni(){return D("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:D("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var bo={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:Ln},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:Ln,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:Ln,rdns:"nexus.to.crosswallet.desktop",installUrl:"https://chromewebstore.google.com/detail/crossx/nninbdadmocnokibpaaohnoepbnpdgcg",visibility:"desktop-only"},metamask:{id:"metamask",name:"MetaMask",description:"Browser extension approval is required",icon:Yr,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:Qr},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Xr,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Jr,badge:"For SHOP"}};function xo(e){return bo[e]}var vo={google:{id:"google",name:"Google",icon:ei},apple:{id:"apple",name:"Apple",icon:ti}};function oi(e){return vo[e]}import{Fragment as ai,jsx as _,jsxs as ae}from"react/jsx-runtime";function xs({wallet:e,detected:t,onConnect:o}){let n=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}o()},r=e.icon,i=e.featured===!0;return ae("button",{type:"button",className:K("wcm-wallet-item",i&&"wcm-wallet-item--featured"),onClick:n,children:[ae("div",{className:"wcm-wallet-item-left",children:[_("div",{className:"wcm-wallet-icon",children:_(r,{})}),ae("div",{className:"wcm-wallet-name-row",children:[_("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&_("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?_("span",{className:"wcm-installed-label",children:"Installed"}):_("span",{className:"wcm-install-btn",children:"Install"}))]})}function vs({social:e,onSignIn:t}){let o=e.icon,n=`Sign in with ${e.name}`;return ae("button",{type:"button",className:"wcm-social-item",onClick:t,"aria-label":n,children:[_("span",{className:"wcm-social-icon",children:_(o,{})}),_("span",{className:"wcm-social-name",children:n})]})}function ri(){let{wallets:e,activeWalletIds:t,socialProviders:o,activeSocialIds:n,termsUrl:r,privacyUrl:i,isDetected:s,close:l,isMobile:d}=Ut(),c=t.filter(b=>{let h=xo(b).visibility;return!h||h==="always"?!0:h==="desktop-only"?!d:h==="mobile-only"?d:!0}),a=n.length>0,p=c.length>0;return ae(ai,{children:[ae("div",{className:"wcm-header",children:[ae("div",{className:"wcm-header-text",children:[_("h2",{className:"wcm-title",children:"CROSS Wallet"}),!d&&_("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),_("button",{type:"button",className:"wcm-close-btn",onClick:l,"aria-label":"Close",children:_(ni,{})})]}),_("div",{className:"wcm-divider"}),ae("div",{className:"wcm-body",children:[a&&ae(ai,{children:[!d&&ae("div",{className:"wcm-section-header",children:[_("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),_("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),_("div",{className:"wcm-social-grid",children:n.map(b=>{let h=oi(b);return _(vs,{social:h,onSignIn:()=>{o[b]?.(),l()}},b)})}),p&&ae("div",{className:"wcm-separator",children:[_("div",{className:"wcm-separator-line"}),_("span",{className:"wcm-separator-text",children:"Other Wallets"}),_("div",{className:"wcm-separator-line"})]})]}),p&&_("div",{className:"wcm-wallet-list",children:c.map(b=>{let h=xo(b),x=h.rdns?s(h.rdns):!1;return _(xs,{wallet:h,detected:x,onConnect:()=>{e[b]?.(),l()}},b)})}),ae("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",_(ii,{href:r,children:"Terms of Service"})," and consent to its ",_(ii,{href:i,children:"Privacy Policy"}),"."]})]})]})}function ii({href:e,children:t}){return e?_("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):_("span",{className:"wcm-terms-link",children:t})}function si({className:e}){let{isMobile:t,theme:o,portalStyle:n}=Ut();return t?ae(Rn.Portal,{children:[_(Rn.Overlay,{className:"wcm-overlay"}),ae(Rn.Content,{className:K("wcm-drawer-content",e),"data-theme":o,style:n,children:[_(Rn.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),_("div",{className:"wcm-drawer-handle"}),_("div",{className:"wcm-drawer-body",children:_(ri,{})})]})]}):ae(Ve.Portal,{children:[_(Ve.Overlay,{className:"wcm-overlay"}),ae(Ve.Content,{className:K("wcm-dialog-content",e),"data-theme":o,style:n,children:[_(Ve.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),_(Ve.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),_("div",{className:"wcm-dialog-body",children:_(ri,{})})]})]})}A(`[data-theme=dark]{--wcm-primary: var(--cck-primary, #9b8cef);--wcm-secondary: var(--cck-secondary, #ff3aa3);--wcm-surface-bg: var(--cck-surface-bg, #202530);--wcm-surface-default: var(--cck-surface-default, #292f40);--wcm-surface-subtle: var(--cck-surface-subtle, #313b51);--wcm-border-default: var(--cck-border-default, #313b51);--wcm-border-subtle: var(--cck-border-subtle, #49556e);--wcm-texticon-primary: var(--cck-texticon-primary, #ffffff);--wcm-texticon-secondary: var(--cck-texticon-secondary, #eff0f4);--wcm-texticon-tertiary: var(--cck-texticon-tertiary, #717d97)}[data-theme=light]{--wcm-primary: var(--cck-primary, #019d92);--wcm-secondary: var(--cck-secondary, #e70077);--wcm-surface-bg: var(--cck-surface-bg, #ffffff);--wcm-surface-default: var(--cck-surface-default, rgba(18, 18, 18, .05));--wcm-surface-subtle: var(--cck-surface-subtle, rgba(18, 18, 18, .1));--wcm-border-default: var(--cck-border-default, rgba(18, 18, 18, .05));--wcm-border-subtle: var(--cck-border-subtle, rgba(18, 18, 18, .1));--wcm-texticon-primary: var(--cck-texticon-primary, #121212);--wcm-texticon-secondary: var(--cck-texticon-secondary, rgba(18, 18, 18, .7));--wcm-texticon-tertiary: var(--cck-texticon-tertiary, rgba(18, 18, 18, .5))}
14
14
  `);A(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wcm-dialog-content{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--wcm-dialog-width, 480px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;background:var(--wcm-surface-bg);border:1px solid var(--wcm-border-default);border-radius:24px;outline:none;animation:wcm-dialog-show .2s ease-out;font-family:inherit}.wcm-dialog-content[data-state=closed]{animation:wcm-dialog-hide .15s ease-in}.wcm-dialog-body,.wcm-drawer-body{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .wcm-dialog-body,[data-theme=light] .wcm-drawer-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wcm-dialog-body::-webkit-scrollbar,.wcm-drawer-body::-webkit-scrollbar{width:4px}.wcm-dialog-body::-webkit-scrollbar-track,.wcm-drawer-body::-webkit-scrollbar-track{background:transparent}.wcm-dialog-body::-webkit-scrollbar-thumb,.wcm-drawer-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wcm-dialog-body::-webkit-scrollbar-thumb:hover,.wcm-drawer-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wcm-dialog-body::-webkit-scrollbar-thumb,[data-theme=light] .wcm-drawer-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wcm-dialog-body::-webkit-scrollbar-thumb:hover,[data-theme=light] .wcm-drawer-body::-webkit-scrollbar-thumb:hover{background:#0003}.wcm-drawer-content{position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--wcm-drawer-max-width, none);min-width:var(--wcm-drawer-min-width, 0);max-height:85dvh;margin:0 auto;display:flex;flex-direction:column;background:var(--wcm-surface-bg);border-top-left-radius:24px;border-top-right-radius:24px;outline:none;font-family:inherit;box-sizing:border-box}.wcm-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:24px 0 0 24px}.wcm-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:0 24px 24px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 24px 24px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--wcm-border-subtle);margin:12px auto 8px;flex-shrink:0}.wcm-drawer-content[data-vaul-drawer-direction=left] .wcm-drawer-handle,.wcm-drawer-content[data-vaul-drawer-direction=right] .wcm-drawer-handle{display:none}.wcm-dialog-body,.wcm-drawer-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.wcm-drawer-body{overscroll-behavior:contain}.wcm-header{position:relative;display:flex;flex-direction:column;align-items:center;padding:24px 24px 20px}.wcm-header-text{display:flex;flex-direction:column;gap:4px;width:100%;padding-right:48px}.wcm-title{font-family:inherit;font-weight:600;font-size:22px;line-height:1.3;color:var(--wcm-texticon-primary);margin:0}.wcm-subtitle{font-family:inherit;font-weight:400;font-size:14px;line-height:1.3;color:var(--wcm-texticon-secondary);margin:0}.wcm-section-header{display:flex;align-items:center;gap:8px;width:100%}.wcm-section-title{font-family:inherit;font-weight:600;font-size:18px;line-height:1.3;color:var(--wcm-texticon-primary)}.wcm-recommended-badge{display:inline-flex;align-items:center;justify-content:center;height:24px;padding:0 8px;background:var(--wcm-primary);border-radius:8px;font-family:inherit;font-weight:600;font-size:14px;line-height:1.4;color:#fff;white-space:nowrap}.wcm-close-btn{position:absolute;top:12px;right:12px;display:flex;align-items:center;justify-content:center;width:48px;height:48px;border:none;border-radius:999px;background:transparent;color:var(--wcm-texticon-primary);cursor:pointer;padding:0}.wcm-close-btn:hover{color:var(--wcm-texticon-secondary)}.wcm-divider{width:100%;height:1px;background:var(--wcm-border-default);border:none;margin:0}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:20px 24px 24px}.wcm-wallet-item{display:flex;align-items:center;gap:8px;width:100%;height:75px;padding:16px;background:var(--wcm-surface-default);border:1px solid var(--wcm-border-default);border-radius:12px;cursor:pointer;text-align:left;transition:border-color .15s;font-family:inherit}.wcm-wallet-item:hover{border-color:var(--wcm-primary)}.wcm-wallet-item-left{display:flex;align-items:center;gap:16px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg{width:32px;height:32px}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px;min-width:0}.wcm-wallet-name{font-family:inherit;font-weight:600;font-size:18px;line-height:1.3;color:var(--wcm-texticon-primary);white-space:nowrap}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;height:20px;padding:0 8px;border:1px solid var(--wcm-secondary);border-radius:999px;font-family:inherit;font-weight:700;font-size:12px;line-height:1.3;color:var(--wcm-secondary);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;background:var(--wcm-primary);border-radius:12px;font-family:inherit;font-weight:600;font-size:14px;line-height:1.4;color:var(--wcm-surface-bg);white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;background:var(--wcm-surface-subtle);border-radius:12px;font-family:inherit;font-weight:600;font-size:14px;line-height:1.4;color:var(--wcm-texticon-secondary);white-space:nowrap}.wcm-terms-link{color:var(--wcm-primary);text-decoration:none}.wcm-terms-link:hover{text-decoration:underline}.wcm-social-grid{display:grid;gap:8px;width:100%}.wcm-dialog-body .wcm-social-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wcm-drawer-body .wcm-social-grid{grid-template-columns:1fr}.wcm-social-item{display:flex;background:var(--wcm-surface-default);border:1px solid var(--wcm-border-default);border-radius:12px;cursor:pointer;transition:border-color .15s;font-family:inherit;color:var(--wcm-texticon-primary)}.wcm-social-item:hover{border-color:var(--wcm-primary)}.wcm-dialog-body .wcm-social-item{flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;height:111px;padding:24px 16px}.wcm-drawer-body .wcm-social-item{flex-direction:row;align-items:center;justify-content:flex-start;gap:16px;padding:16px;min-height:60px}.wcm-social-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.wcm-social-icon>svg{width:32px;height:32px}.wcm-social-name{font-family:inherit;font-weight:600;font-size:18px;line-height:1.3;color:var(--wcm-texticon-primary);white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:16px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--wcm-border-default)}.wcm-separator-text{font-family:inherit;font-weight:400;font-size:16px;line-height:1.3;color:var(--wcm-texticon-tertiary);white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-terms{font-family:inherit;font-weight:400;font-size:12px;line-height:1.3;color:var(--wcm-texticon-secondary);text-align:center;margin:0}.wcm-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
15
15
  `);A(`@keyframes wcm-overlay-show{0%{opacity:0}to{opacity:1}}@keyframes wcm-overlay-hide{0%{opacity:1}to{opacity:0}}@keyframes wcm-dialog-show{0%{opacity:0;transform:translate(-50%,-48%) scale(.96)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes wcm-dialog-hide{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-48%) scale(.96)}}
16
- `);import{jsx as qt}from"react/jsx-runtime";var ys={};function ks({wallets:e,socialProviders:t=ys,termsUrl:o,privacyUrl:n,theme:r="dark",mobileBreakpoint:i=768,drawerDirection:s="bottom",dialogWidth:l,drawerMaxWidth:d,drawerMinWidth:c,style:a,open:p,onOpenChange:b,children:h}){let x=Nt(`(max-width: ${i}px)`),[g,w]=je.useState(!1),C=p!==void 0,M=C?p:g,T=je.useCallback(B=>{C||w(B),b?.(B)},[C,b]),L=je.useCallback(()=>T(!1),[T]),{isDetected:W}=Nn(),y=je.useMemo(()=>Object.keys(e),[e]),I=je.useMemo(()=>Object.keys(t),[t]),P=je.useMemo(()=>{let B={};return l&&(B["--wcm-dialog-width"]=l),d&&(B["--wcm-drawer-max-width"]=d),c&&(B["--wcm-drawer-min-width"]=c),{...B,...a}},[l,d,c,a]),N=je.useMemo(()=>({theme:r,isMobile:x,open:M,setOpen:T,close:L,wallets:e,activeWalletIds:y,socialProviders:t,activeSocialIds:I,termsUrl:o,privacyUrl:n,isDetected:W,portalStyle:P}),[r,x,M,T,L,e,y,t,I,o,n,W,P]),q=qt("div",{"data-theme":r,style:P,children:h});return x?qt(Cn.Provider,{value:N,children:qt(vs.Root,{direction:s,open:M,onOpenChange:T,noBodyStyles:!0,children:q},"drawer")}):qt(Cn.Provider,{value:N,children:qt(si.Root,{open:M,onOpenChange:T,children:q})})}var li=Object.assign(ks,{Trigger:Zr,Content:ai});A(`.cb-button{--cb-bg: var(--cck-primary, #00D5AA);--cb-bg-hover: var(--cb-bg);--cb-color: var(--cck-on-primary, #000);--cb-border: none;--cb-radius: 8px;--cb-height: 36px;--cb-padding: 0 20px;--cb-font-family: inherit;--cb-font-size: 14px;--cb-font-weight: 700;--cb-gap: 8px;--cb-transition: opacity .15s;--cb-loading-opacity: .7;--cb-press-scale: .95;--cb-spinner-size: 14px;--cb-spinner-thumb: currentColor;--cb-spinner-track: color-mix(in srgb, currentColor 20%, transparent)}.cb-pill{--cb-pill-bg: var(--cck-surface-default, #1e232e);--cb-pill-bg-hover: var(--cb-pill-bg);--cb-pill-color: var(--cck-texticon-primary, #ffffff);--cb-pill-border: 1px solid var(--cck-border-default, #2a2d3a);--cb-pill-radius: 8px;--cb-pill-height: 36px;--cb-pill-padding: 0 12px;--cb-pill-press-scale: .95;--cb-pill-font-family: inherit;--cb-pill-font-size: 14px;--cb-pill-font-weight: 600;--cb-pill-gap: 8px;--cb-pill-icon-size: 20px;--cb-pill-icon-placeholder-bg: var(--cck-surface-subtle, #2a2d3a);--cb-pill-address-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;--cb-pill-address-font-size: 13px;--cb-pill-address-letter-spacing: .02em}
16
+ `);import{jsx as qt}from"react/jsx-runtime";var ks={};function Cs({wallets:e,socialProviders:t=ks,termsUrl:o,privacyUrl:n,theme:r="dark",mobileBreakpoint:i=768,drawerDirection:s="bottom",dialogWidth:l,drawerMaxWidth:d,drawerMinWidth:c,style:a,open:p,onOpenChange:b,children:h}){let x=Nt(`(max-width: ${i}px)`),[g,w]=je.useState(!1),C=p!==void 0,M=C?p:g,T=je.useCallback(B=>{C||w(B),b?.(B)},[C,b]),L=je.useCallback(()=>T(!1),[T]),{isDetected:W}=Nn(),y=je.useMemo(()=>Object.keys(e),[e]),I=je.useMemo(()=>Object.keys(t),[t]),P=je.useMemo(()=>{let B={};return l&&(B["--wcm-dialog-width"]=l),d&&(B["--wcm-drawer-max-width"]=d),c&&(B["--wcm-drawer-min-width"]=c),{...B,...a}},[l,d,c,a]),N=je.useMemo(()=>({theme:r,isMobile:x,open:M,setOpen:T,close:L,wallets:e,activeWalletIds:y,socialProviders:t,activeSocialIds:I,termsUrl:o,privacyUrl:n,isDetected:W,portalStyle:P}),[r,x,M,T,L,e,y,t,I,o,n,W,P]),q=qt("div",{"data-theme":r,style:P,children:h});return x?qt(Cn.Provider,{value:N,children:qt(ys.Root,{direction:s,open:M,onOpenChange:T,noBodyStyles:!0,children:q},"drawer")}):qt(Cn.Provider,{value:N,children:qt(li.Root,{open:M,onOpenChange:T,children:q})})}var ci=Object.assign(Cs,{Trigger:Kr,Content:si});A(`.cb-button{--cb-bg: var(--cck-primary, #00D5AA);--cb-bg-hover: var(--cb-bg);--cb-color: var(--cck-on-primary, #000);--cb-border: none;--cb-radius: 8px;--cb-height: 36px;--cb-padding: 0 20px;--cb-font-family: inherit;--cb-font-size: 14px;--cb-font-weight: 700;--cb-gap: 8px;--cb-transition: opacity .15s;--cb-loading-opacity: .7;--cb-press-scale: .95;--cb-spinner-size: 14px;--cb-spinner-thumb: currentColor;--cb-spinner-track: color-mix(in srgb, currentColor 20%, transparent)}.cb-pill{--cb-pill-bg: var(--cck-surface-default, #1e232e);--cb-pill-bg-hover: var(--cb-pill-bg);--cb-pill-color: var(--cck-texticon-primary, #ffffff);--cb-pill-border: 1px solid var(--cck-border-default, #2a2d3a);--cb-pill-radius: 8px;--cb-pill-height: 36px;--cb-pill-padding: 0 12px;--cb-pill-press-scale: .95;--cb-pill-font-family: inherit;--cb-pill-font-size: 14px;--cb-pill-font-weight: 600;--cb-pill-gap: 8px;--cb-pill-icon-size: 20px;--cb-pill-icon-placeholder-bg: var(--cck-surface-subtle, #2a2d3a);--cb-pill-address-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;--cb-pill-address-font-size: 13px;--cb-pill-address-letter-spacing: .02em}
17
17
  `);A(`.cb-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-height);gap:var(--cb-gap);padding:var(--cb-padding);border-radius:var(--cb-radius);border:var(--cb-border);background:var(--cb-bg);color:var(--cb-color);font-family:var(--cb-font-family);font-size:var(--cb-font-size);font-weight:var(--cb-font-weight);cursor:pointer;transition:var(--cb-transition)}.cb-button:hover:not(:disabled){background:var(--cb-bg-hover)}.cb-button:active:not(:disabled){transform:scale(var(--cb-press-scale))}.cb-button:disabled,.cb-button[aria-busy=true]{cursor:default;opacity:var(--cb-loading-opacity)}.cb-spinner{display:inline-block;width:var(--cb-spinner-size);height:var(--cb-spinner-size);border:2px solid var(--cb-spinner-track);border-top-color:var(--cb-spinner-thumb);border-radius:50%;animation:cb-spin .6s linear infinite;flex-shrink:0}.cb-pill{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--cb-pill-height);gap:var(--cb-pill-gap);padding:var(--cb-pill-padding);border-radius:var(--cb-pill-radius);border:var(--cb-pill-border);background:var(--cb-pill-bg);color:var(--cb-pill-color);font-family:var(--cb-pill-font-family);font-size:var(--cb-pill-font-size);font-weight:var(--cb-pill-font-weight);cursor:pointer}.cb-pill:hover{background:var(--cb-pill-bg-hover)}.cb-pill:active:not(:disabled){transform:scale(var(--cb-pill-press-scale))}.cb-pill-icon{width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;object-fit:contain;flex-shrink:0;background:transparent}.cb-pill-icon-placeholder{display:inline-block;width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;background:var(--cb-pill-icon-placeholder-bg);flex-shrink:0}.cb-pill-address{font-family:var(--cb-pill-address-font);font-size:var(--cb-pill-address-font-size);letter-spacing:var(--cb-pill-address-letter-spacing)}@keyframes cb-spin{to{transform:rotate(360deg)}}
18
- `);var Cs='<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#c0)"><path d="M18 36C27.9411 36 36 27.9411 36 18C36 8.05887 27.9411 0 18 0C8.05887 0 0 8.05887 0 18C0 27.9411 8.05887 36 18 36Z" fill="#00D5AA"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.2903 2.57169L21.3525 5.63385V10.6471L25.3058 6.69381L29.6364 11.0244L25.7226 14.9381H18.2903C16.5992 14.9381 15.2283 16.309 15.2283 18.0003C15.2283 19.6915 16.5992 21.0624 18.2903 21.0624H25.6836L29.6365 25.0154L25.3059 29.3459L21.3525 25.3925V30.3666L18.2903 33.4288L15.2283 30.3666V25.4326L11.3148 29.3459L6.98426 25.0154L10.9372 21.0624H5.92394L2.86178 18.0003L5.92394 14.9381H10.8981L6.98437 11.0244L11.3149 6.69383L15.2283 10.6071V5.63385L18.2903 2.57169Z" fill="#000"/></g><defs><clipPath id="c0"><rect width="36" height="36" fill="#fff"/></clipPath></defs></svg>',Ns='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 28 28" fill="none"><g clip-path="url(#m0)"><path d="M26.07 26.93L20.06 25.07L15.53 27.88L12.37 27.88L7.83 25.07L1.83 26.93L0 20.53L1.83 13.44L0 7.44L1.83 0L11.21 5.81H16.69L26.07 0L27.9 7.44L26.07 13.44L27.9 20.53Z" fill="#FF5C16"/><path d="M7.83 20.54L11.96 23.8L7.83 25.07V20.54Z" fill="#FF5C16"/><path d="M20.06 20.54L15.93 23.8L20.06 25.07L20.06 20.54Z" fill="#FF5C16"/><path d="M11.63 15.14L12.78 22.85L11.19 18.56L5.77 17.17L7.83 15.14H11.63Z" fill="#E34807"/><path d="M16.27 15.14L15.12 22.85L16.71 18.56L22.13 17.17L20.07 15.14H16.27Z" fill="#E34807"/><path d="M0 20.53L1.83 13.44H5.76L5.77 17.17L11.19 18.56L12.78 22.85L11.96 23.79L7.83 20.53H0Z" fill="#FF8D5D"/><path d="M27.9 20.53L26.07 13.44H22.14L22.13 17.17L16.71 18.56L15.12 22.85L15.94 23.79L20.07 20.53H27.9Z" fill="#FF8D5D"/><path d="M16.69 5.81H11.21L10.84 9.81L12.78 22.85H15.12L17.06 9.81L16.69 5.81Z" fill="#FF8D5D"/><path d="M15.53 25.34V27.88H12.37V25.34H15.53Z" fill="#C0C4CD"/><path d="M7.83 25.07L12.37 27.88V25.34L11.96 23.79L7.83 25.07Z" fill="#E7EBF6"/><path d="M20.07 25.07L15.53 27.88V25.34L15.94 23.79L20.07 25.07Z" fill="#E7EBF6"/></g><defs><clipPath id="m0"><rect width="28" height="28" fill="#fff"/></clipPath></defs></svg>',Ls='<svg width="100%" height="100%" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z" fill="#F3BA2F"/><path d="M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z" fill="#F3BA2F"/><path d="M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z" fill="#F3BA2F"/><path d="M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z" fill="#F3BA2F"/><path d="M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z" fill="#F3BA2F"/></svg>',Rs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"/><path fill="#FF3D00" d="M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"/><path fill="#4CAF50" d="M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"/><path fill="#1976D2" d="M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"/></svg>',Ss='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/></svg>';function Zt(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var Sn=Zt(Cs),En=Zt(Ns),Pn=Zt(Ls),In=Zt(Rs),Tn=Zt(Ss);import{jsx as yt,jsxs as yo}from"react/jsx-runtime";function di({isConnecting:e,address:t,provider:o,providerName:n,accountName:r,sendAccounts:i,onConnect:s,onDisconnect:l,onCopy:d,onSelectWallet:c,label:a="Connect Wallet",connectingLabel:p="Connecting...",disconnectLabel:b,className:h,theme:x="dark",env:g,showBalance:w=!0,showPortfolio:C,drawerDirection:M,modal:T,connectorId:L,style:W,walletInfoStyle:y,sendTransaction:I,getTransactionReceipt:P,estimateGas:N}){let q=h?`cb-button ${h}`:"cb-button",B=h?`cb-pill ${h}`:"cb-pill";if(e)return yo("button",{type:"button",disabled:!0,className:q,style:W,"aria-busy":"true",children:[yt("span",{className:"cb-spinner","aria-hidden":"true"}),p]});if(t){let ve=n??Is(o),We=o?Es[o]:void 0;return yo(At,{env:g,theme:x,drawerDirection:M,modal:T,showBalance:w,showPortfolio:C,walletAddress:t,accountName:r,sendAccounts:i,connectorId:L,onSelectWallet:c,onCopyAddress:d?(te,Pe)=>{Pe&&d()}:void 0,onDisconnect:l,disconnectLabel:b,style:y,sendTransaction:I,getTransactionReceipt:P,estimateGas:N,children:[yt(At.Trigger,{asChild:!0,children:yo("button",{type:"button",className:B,style:W,"aria-label":`Connected with ${ve}: ${ci(t)}`,children:[We?yt("img",{src:We,alt:"",width:20,height:20,className:"cb-pill-icon"}):yt("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),yt("span",{className:"cb-pill-address",children:ci(t)})]})}),yt(At.Content,{align:"end",sideOffset:8})]})}return yt("button",{type:"button",onClick:s,className:q,style:W,children:a})}var Es={google:In,apple:Tn,cross:Sn,metamask:En,binance:Pn},Ps={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Is(e){return e?Ps[e]:"Wallet"}function ci(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}import*as pi from"react";A(`.sb-button{--sb-bg: var(--cck-surface-subtle, rgba(255, 255, 255, .08));--sb-border: var(--cck-border-default, rgba(255, 255, 255, .15));--sb-border-hover: rgba(255, 255, 255, .3);--sb-color: rgba(0, 0, 0, .6);--sb-color-hover: rgba(0, 0, 0, 1);--sb-radius: 8px;--sb-height: 36px;--sb-padding: 0 12px;--sb-gap: 6px;--sb-font-size: 12px;--sb-font-weight: 500;--sb-line-height: 1.5;--sb-letter-spacing: -.01em;--sb-blur: 35px;--sb-border-width: 1px;--sb-icon-size: 16px;--sb-icon-hover-rotation: 180deg;--sb-spinner-size: 12px;--sb-spinner-thumb: currentColor;--sb-spinner-track: color-mix(in srgb, currentColor 20%, transparent);--sb-disabled-opacity: .6;--sb-press-scale: .95;--sb-hover-duration: .2s;--sb-icon-duration: .3s;--sb-easing: ease}.sb-button[data-theme=dark]{--sb-color: color-mix(in srgb, var(--cck-texticon-primary, #ffffff) 60%, transparent);--sb-color-hover: var(--cck-texticon-primary, #ffffff)}.sb-button[data-theme=light]{--sb-color: color-mix(in srgb, var(--cck-texticon-primary, #000000) 60%, transparent);--sb-color-hover: var(--cck-texticon-primary, #000000)}
18
+ `);var Ns='<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#c0)"><path d="M18 36C27.9411 36 36 27.9411 36 18C36 8.05887 27.9411 0 18 0C8.05887 0 0 8.05887 0 18C0 27.9411 8.05887 36 18 36Z" fill="#00D5AA"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.2903 2.57169L21.3525 5.63385V10.6471L25.3058 6.69381L29.6364 11.0244L25.7226 14.9381H18.2903C16.5992 14.9381 15.2283 16.309 15.2283 18.0003C15.2283 19.6915 16.5992 21.0624 18.2903 21.0624H25.6836L29.6365 25.0154L25.3059 29.3459L21.3525 25.3925V30.3666L18.2903 33.4288L15.2283 30.3666V25.4326L11.3148 29.3459L6.98426 25.0154L10.9372 21.0624H5.92394L2.86178 18.0003L5.92394 14.9381H10.8981L6.98437 11.0244L11.3149 6.69383L15.2283 10.6071V5.63385L18.2903 2.57169Z" fill="#000"/></g><defs><clipPath id="c0"><rect width="36" height="36" fill="#fff"/></clipPath></defs></svg>',Ls='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 28 28" fill="none"><g clip-path="url(#m0)"><path d="M26.07 26.93L20.06 25.07L15.53 27.88L12.37 27.88L7.83 25.07L1.83 26.93L0 20.53L1.83 13.44L0 7.44L1.83 0L11.21 5.81H16.69L26.07 0L27.9 7.44L26.07 13.44L27.9 20.53Z" fill="#FF5C16"/><path d="M7.83 20.54L11.96 23.8L7.83 25.07V20.54Z" fill="#FF5C16"/><path d="M20.06 20.54L15.93 23.8L20.06 25.07L20.06 20.54Z" fill="#FF5C16"/><path d="M11.63 15.14L12.78 22.85L11.19 18.56L5.77 17.17L7.83 15.14H11.63Z" fill="#E34807"/><path d="M16.27 15.14L15.12 22.85L16.71 18.56L22.13 17.17L20.07 15.14H16.27Z" fill="#E34807"/><path d="M0 20.53L1.83 13.44H5.76L5.77 17.17L11.19 18.56L12.78 22.85L11.96 23.79L7.83 20.53H0Z" fill="#FF8D5D"/><path d="M27.9 20.53L26.07 13.44H22.14L22.13 17.17L16.71 18.56L15.12 22.85L15.94 23.79L20.07 20.53H27.9Z" fill="#FF8D5D"/><path d="M16.69 5.81H11.21L10.84 9.81L12.78 22.85H15.12L17.06 9.81L16.69 5.81Z" fill="#FF8D5D"/><path d="M15.53 25.34V27.88H12.37V25.34H15.53Z" fill="#C0C4CD"/><path d="M7.83 25.07L12.37 27.88V25.34L11.96 23.79L7.83 25.07Z" fill="#E7EBF6"/><path d="M20.07 25.07L15.53 27.88V25.34L15.94 23.79L20.07 25.07Z" fill="#E7EBF6"/></g><defs><clipPath id="m0"><rect width="28" height="28" fill="#fff"/></clipPath></defs></svg>',Rs='<svg width="100%" height="100%" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z" fill="#F3BA2F"/><path d="M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z" fill="#F3BA2F"/><path d="M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z" fill="#F3BA2F"/><path d="M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z" fill="#F3BA2F"/><path d="M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z" fill="#F3BA2F"/></svg>',Ss='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"/><path fill="#FF3D00" d="M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"/><path fill="#4CAF50" d="M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"/><path fill="#1976D2" d="M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"/></svg>',Es='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/></svg>';function Zt(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var Sn=Zt(Ns),En=Zt(Ls),Pn=Zt(Rs),In=Zt(Ss),Tn=Zt(Es);import{jsx as yt,jsxs as yo}from"react/jsx-runtime";function pi({isConnecting:e,address:t,provider:o,providerName:n,accountName:r,sendAccounts:i,onConnect:s,onDisconnect:l,onCopy:d,onSelectWallet:c,label:a="Connect Wallet",connectingLabel:p="Connecting...",disconnectLabel:b,className:h,theme:x="dark",env:g,showBalance:w=!0,showPortfolio:C,drawerDirection:M,modal:T,connectorId:L,style:W,walletInfoStyle:y,sendTransaction:I,getTransactionReceipt:P,estimateGas:N}){let q=h?`cb-button ${h}`:"cb-button",B=h?`cb-pill ${h}`:"cb-pill";if(e)return yo("button",{type:"button",disabled:!0,className:q,style:W,"aria-busy":"true",children:[yt("span",{className:"cb-spinner","aria-hidden":"true"}),p]});if(t){let ve=n??Ts(o),We=o?Ps[o]:void 0;return yo(At,{env:g,theme:x,drawerDirection:M,modal:T,showBalance:w,showPortfolio:C,walletAddress:t,accountName:r,sendAccounts:i,connectorId:L,onSelectWallet:c,onCopyAddress:d?(te,Pe)=>{Pe&&d()}:void 0,onDisconnect:l,disconnectLabel:b,style:y,sendTransaction:I,getTransactionReceipt:P,estimateGas:N,children:[yt(At.Trigger,{asChild:!0,children:yo("button",{type:"button",className:B,style:W,"aria-label":`Connected with ${ve}: ${di(t)}`,children:[We?yt("img",{src:We,alt:"",width:20,height:20,className:"cb-pill-icon"}):yt("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),yt("span",{className:"cb-pill-address",children:di(t)})]})}),yt(At.Content,{align:"end",sideOffset:8})]})}return yt("button",{type:"button",onClick:s,className:q,style:W,children:a})}var Ps={google:In,apple:Tn,cross:Sn,metamask:En,binance:Pn},Is={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Ts(e){return e?Is[e]:"Wallet"}function di(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}import*as mi from"react";A(`.sb-button{--sb-bg: var(--cck-surface-subtle, rgba(255, 255, 255, .08));--sb-border: var(--cck-border-default, rgba(255, 255, 255, .15));--sb-border-hover: rgba(255, 255, 255, .3);--sb-color: rgba(0, 0, 0, .6);--sb-color-hover: rgba(0, 0, 0, 1);--sb-radius: 8px;--sb-height: 36px;--sb-padding: 0 12px;--sb-gap: 6px;--sb-font-size: 14px;--sb-font-weight: 500;--sb-line-height: 1.5;--sb-letter-spacing: -.01em;--sb-blur: 35px;--sb-border-width: 1px;--sb-icon-size: 16px;--sb-icon-hover-rotation: 180deg;--sb-spinner-size: 12px;--sb-spinner-thumb: currentColor;--sb-spinner-track: color-mix(in srgb, currentColor 20%, transparent);--sb-disabled-opacity: .6;--sb-press-scale: .95;--sb-hover-duration: .2s;--sb-icon-duration: .3s;--sb-easing: ease}.sb-button[data-theme=dark]{--sb-color: color-mix(in srgb, var(--cck-texticon-primary, #ffffff) 60%, transparent);--sb-color-hover: var(--cck-texticon-primary, #ffffff)}.sb-button[data-theme=light]{--sb-color: color-mix(in srgb, var(--cck-texticon-primary, #000000) 60%, transparent);--sb-color-hover: var(--cck-texticon-primary, #000000)}
19
19
  `);A(`.sb-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--sb-height);gap:var(--sb-gap);padding:var(--sb-padding);border-radius:var(--sb-radius);border:var(--sb-border-width) solid var(--sb-border);background:var(--sb-bg);backdrop-filter:blur(var(--sb-blur));-webkit-backdrop-filter:blur(var(--sb-blur));color:var(--sb-color);font-family:Inter,system-ui,-apple-system,sans-serif;font-weight:var(--sb-font-weight);font-size:var(--sb-font-size);line-height:var(--sb-line-height);letter-spacing:var(--sb-letter-spacing);cursor:pointer;transition:border-color var(--sb-hover-duration) var(--sb-easing),color var(--sb-hover-duration) var(--sb-easing)}@media(hover:hover){.sb-button:hover:not(:disabled){border-color:var(--sb-border-hover);color:var(--sb-color-hover)}.sb-button:hover:not(:disabled) .sb-button-icon{transform:rotate(var(--sb-icon-hover-rotation))}}.sb-button:active:not(:disabled){transform:scale(var(--sb-press-scale))}.sb-button:disabled,.sb-button[aria-busy=true]{cursor:default;opacity:var(--sb-disabled-opacity)}.sb-button-icon{width:var(--sb-icon-size);height:var(--sb-icon-size);flex-shrink:0;color:inherit;transition:transform var(--sb-icon-duration) var(--sb-easing),color var(--sb-icon-duration) var(--sb-easing)}.sb-spinner{display:inline-block;width:var(--sb-spinner-size);height:var(--sb-spinner-size);border:2px solid var(--sb-spinner-track);border-top-color:var(--sb-spinner-thumb);border-radius:50%;animation:sb-spin .6s linear infinite;flex-shrink:0}.sb-label{white-space:nowrap}@keyframes sb-spin{to{transform:rotate(360deg)}}
20
- `);import{jsx as Yt,jsxs as Ms}from"react/jsx-runtime";function mi({label:e="Skills",href:t,onClick:o,className:n,style:r,theme:i,disabled:s=!1,isLoading:l=!1,loadingLabel:d="Loading...",openInNewTab:c=!1,type:a="button"}){let[p,b]=pi.useState(!1),h=async M=>{if(t&&!o){c?window.open(t,"_blank","noopener,noreferrer"):window.location.href=t;return}if(o)try{b(!0),await o()}finally{b(!1)}},x=s||l||p,g=l||p,w=g?d:e,C=n?`sb-button ${n}`:"sb-button";return Ms("button",{type:a,onClick:h,disabled:x,className:C,"data-theme":i,style:r,"aria-busy":g,children:[g?Yt("span",{className:"sb-spinner","aria-hidden":"true"}):Yt(Ts,{}),Yt("span",{className:"sb-label",children:w})]})}function Ts(){return Yt("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:Yt("path",{d:"M15.5879 3.95142C16.0211 2.78097 17.6761 2.78099 18.1094 3.95142L19.6221 8.03833C20.6569 10.8348 22.8618 13.0396 25.6582 14.0745L29.7451 15.5872C30.9157 16.0204 30.9157 17.6754 29.7451 18.1086L25.6582 19.6213C22.8618 20.6562 20.657 22.861 19.6221 25.6575L18.1094 29.7444C17.6762 30.9149 16.0211 30.9149 15.5879 29.7444L14.0752 25.6575C13.0403 22.861 10.8355 20.6562 8.03906 19.6213L3.95215 18.1086C2.78172 17.6754 2.7817 16.0204 3.95215 15.5872L8.03906 14.0745C10.8355 13.0396 13.0403 10.8348 14.0752 8.03833L15.5879 3.95142Z",stroke:"currentColor",strokeWidth:"1.93556"})})}export{Tn as APPLE_ICON,Lo as AppLauncher,_o as AppLauncherContent,Io as AppLauncherTrigger,Pn as BINANCE_ICON,sn as CONNECTOR_REGISTRY,Sn as CROSSX_ICON,di as ConnectButton,Wn as ConnectorId,In as GOOGLE_ICON,En as METAMASK_ICON,vo as SOCIAL_REGISTRY,pn as SendPage,mi as SkillsButton,ro as TOKEN_STATS_QUERY_KEY,oo as USER_BALANCE_QUERY_KEY,bo as WALLET_REGISTRY,li as WalletConnectModal,At as WalletInfo,Wr as WalletPortfolio,Mt as WalletPortfolioBody,ge as resolveEnvironment,rn as useGlobalMenu,Et as useTokenBalance,Pt as useTokenStats,Nn as useWalletDetect};
20
+ `);import{jsx as Kt,jsxs as As}from"react/jsx-runtime";var ko="https://skills.cross.nexus";function fi({label:e="Skills",href:t=ko,onClick:o,className:n,style:r,theme:i,disabled:s=!1,isLoading:l=!1,loadingLabel:d="Loading...",openInNewTab:c=!1,type:a="button"}){let[p,b]=mi.useState(!1),h=async M=>{if(t&&!o){c?window.open(t,"_blank","noopener,noreferrer"):window.location.href=t;return}if(o)try{b(!0),await o()}finally{b(!1)}},x=s||l||p,g=l||p,w=g?d:e,C=n?`sb-button ${n}`:"sb-button";return As("button",{type:a,onClick:h,disabled:x,className:C,"data-theme":i,style:r,"aria-busy":g,children:[g?Kt("span",{className:"sb-spinner","aria-hidden":"true"}):Kt(Ms,{}),Kt("span",{className:"sb-label",children:w})]})}function Ms(){return Kt("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:Kt("path",{d:"M15.5879 3.95142C16.0211 2.78097 17.6761 2.78099 18.1094 3.95142L19.6221 8.03833C20.6569 10.8348 22.8618 13.0396 25.6582 14.0745L29.7451 15.5872C30.9157 16.0204 30.9157 17.6754 29.7451 18.1086L25.6582 19.6213C22.8618 20.6562 20.657 22.861 19.6221 25.6575L18.1094 29.7444C17.6762 30.9149 16.0211 30.9149 15.5879 29.7444L14.0752 25.6575C13.0403 22.861 10.8355 20.6562 8.03906 19.6213L3.95215 18.1086C2.78172 17.6754 2.7817 16.0204 3.95215 15.5872L8.03906 14.0745C10.8355 13.0396 13.0403 10.8348 14.0752 8.03833L15.5879 3.95142Z",stroke:"currentColor",strokeWidth:"1.93556"})})}export{Tn as APPLE_ICON,Ro as AppLauncher,Oo as AppLauncherContent,To as AppLauncherTrigger,Pn as BINANCE_ICON,sn as CONNECTOR_REGISTRY,Sn as CROSSX_ICON,pi as ConnectButton,Wn as ConnectorId,ko as DEFAULT_SKILLS_HREF,In as GOOGLE_ICON,En as METAMASK_ICON,vo as SOCIAL_REGISTRY,pn as SendPage,fi as SkillsButton,ro as TOKEN_STATS_QUERY_KEY,oo as USER_BALANCE_QUERY_KEY,bo as WALLET_REGISTRY,ci as WalletConnectModal,At as WalletInfo,Br as WalletPortfolio,Mt as WalletPortfolioBody,ge as resolveEnvironment,rn as useGlobalMenu,Et as useTokenBalance,Pt as useTokenStats,Nn as useWalletDetect};