@nexus-cross/dapp-ui 1.1.2-beta.1 → 1.1.3-beta.1

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.cjs CHANGED
@@ -1,16 +1,16 @@
1
- "use strict";var Si=Object.create;var gn=Object.defineProperty;var Ii=Object.getOwnPropertyDescriptor;var Mi=Object.getOwnPropertyNames;var _i=Object.getPrototypeOf,Ai=Object.prototype.hasOwnProperty;var Oi=(e,t)=>{for(var o in t)gn(e,o,{get:t[o],enumerable:!0})},_o=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Mi(t))!Ai.call(e,r)&&r!==o&&gn(e,r,{get:()=>t[r],enumerable:!(n=Ii(t,r))||n.enumerable});return e};var U=(e,t,o)=>(o=e!=null?Si(_i(e)):{},_o(t||!e||!e.__esModule?gn(o,"default",{value:e,enumerable:!0}):o,e)),Fi=e=>_o(gn({},"__esModule",{value:!0}),e);var Ja={};Oi(Ja,{APPLE_ICON:()=>ln,AppLauncher:()=>jn,AppLauncherContent:()=>Zn,AppLauncherTrigger:()=>qn,BINANCE_ICON:()=>an,CONNECTOR_REGISTRY:()=>Ut,CROSSX_ICON:()=>on,ConnectButton:()=>Io,ConnectorId:()=>kn,GOOGLE_ICON:()=>sn,METAMASK_ICON:()=>rn,SendPage:()=>Kt,TOKEN_STATS_QUERY_KEY:()=>En,USER_BALANCE_QUERY_KEY:()=>Ln,WALLET_REGISTRY:()=>Vn,WalletConnectModal:()=>So,WalletInfo:()=>Rt,WalletPortfolio:()=>Eo,WalletPortfolioBody:()=>Ct,resolveEnvironment:()=>ue,useGlobalMenu:()=>zt,useTokenBalance:()=>vt,useTokenStats:()=>kt,useWalletDetect:()=>en});module.exports=Fi(Ja);function ue(e){if(e)return Ao(e);let t=typeof process<"u"?process.env?.NEXT_PUBLIC_CROSSX_ENVIRONMENT:void 0;return Ao(t)}function Ao(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var It=U(require("react"),1),Oo=U(require("@radix-ui/react-popover"),1),Fo=require("vaul");var wn=require("react"),Un=(0,wn.createContext)(null);function hn(){let e=(0,wn.useContext)(Un);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var bn=require("react");function St(e){let[t,o]=(0,bn.useState)(!1);return(0,bn.useEffect)(()=>{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 O(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))}O(`[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
- `);O(`.al-trigger-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border:none;background:transparent;border-radius:8px;cursor:pointer;transition:background-color .15s ease}.al-trigger-btn[data-theme=dark]{color:#edf1f3}.al-trigger-btn[data-theme=light]{color:#1e232e}
3
- `);O(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
- `);O(`.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:24px 4px;box-sizing:border-box}.al-popover-content .al-grid{grid-template-columns:repeat(4,100px);row-gap:24px;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:8px;padding:8px 0;width:100px;min-width:0;border-radius:10px}.al-popover-content .al-grid-item-left{flex-direction:column;align-items:center;gap:8px;width:100%;overflow:visible}.al-popover-content .al-grid-item-icon{width:54px;height:54px;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;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:16px}.al-drawer-content .al-grid-item{width:100%;max-width:100%;gap:8px;padding:16px 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:36px;height:36px;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.5;letter-spacing:-.16px;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:-.16px;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:-.16px;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:-.1px;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
- `);O("");var xn=require("react/jsx-runtime");function jn({env:e,theme:t="dark",mobileBreakpoint:o=768,domain:n,children:r}){let i=St(`(max-width: ${o}px)`),[l,p]=It.useState(!1),m=It.useCallback(()=>p(!1),[]),d=ue(e),c=It.useMemo(()=>({env:d,theme:t,isMobile:i,open:l,domain:n,close:m}),[d,t,i,l,n,m]);return(0,xn.jsx)(Un.Provider,{value:c,children:i?(0,xn.jsx)(Fo.Drawer.Root,{direction:"right",open:l,onOpenChange:p,noBodyStyles:!0,children:r},"drawer"):(0,xn.jsx)(Oo.Root,{open:l,onOpenChange:p,children:r},"popover")})}var $o=U(require("@radix-ui/react-popover"),1),Vo=require("vaul");var ae=require("react/jsx-runtime");function Do({size:e=18}){return(0,ae.jsxs)("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,ae.jsx)("rect",{width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function Wo(){return(0,ae.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ae.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Bo(){return(0,ae.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ae.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Gt=require("react/jsx-runtime");function qn({asChild:e,children:t}){let{isMobile:o,theme:n}=hn(),r=t!=null,i=e??!0,l=r?t:(0,Gt.jsx)("button",{type:"button",className:"al-trigger-btn","data-theme":n,children:(0,Gt.jsx)(Do,{size:o?12:18})});return o?(0,Gt.jsx)(Vo.Drawer.Trigger,{asChild:i,children:l}):(0,Gt.jsx)($o.Trigger,{asChild:i,children:l})}var wt=U(require("react"),1),vn=U(require("@radix-ui/react-popover"),1),gt=require("vaul");var zo=require("@tanstack/react-query");var Ho={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 Di="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Wi="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Fe(e,t){return`${e==="production"?Wi:Di}/${t}.png`}function Go(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:"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 zt(e){let t=ue(e);return(0,zo.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:o})=>{try{let n=await fetch(Ho[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 Go(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function Y(...e){return e.filter(Boolean).join(" ")}var q=require("react/jsx-runtime");function Zn({align:e="end",sideOffset:t=12,className:o}){let{env:n,theme:r,isMobile:i,domain:l,close:p}=hn(),{data:m}=zt(n),d=wt.useMemo(()=>(m?.items??[]).sort((h,P)=>h.order-P.order),[m]),c=8,u=wt.useRef(null),y=wt.useCallback(h=>{u.current={x:h.clientX,y:h.clientY}},[]),b=typeof window<"u"?window.location.pathname:"",g=wt.useCallback((h,P)=>{if(u.current){let N=h.clientX-u.current.x,G=h.clientY-u.current.y;if(u.current=null,Math.abs(N)>c||Math.abs(G)>c)return}let A=P.url[n]??P.url.production,I=Uo(A,l);if(!I)try{let N=new URL(A).pathname;if(b===N||b.startsWith(N+"/")){p();return}}catch{}I?window.open(A,"_blank","noopener,noreferrer"):window.location.href=A,p()},[n,l,p,b]),w=(0,q.jsx)("div",{className:"al-grid","data-theme":r,children:d.map(h=>{let P=h.url[n]??h.url.production,A=Uo(P,l),I=!1;if(!A)try{let N=new URL(P).pathname;I=b===N||b.startsWith(N+"/")}catch{I=!1}return(0,q.jsxs)("button",{type:"button",className:"al-grid-item","data-active":I||void 0,onPointerDown:y,onClick:N=>g(N,h),children:[(0,q.jsxs)("div",{className:"al-grid-item-left",children:[(0,q.jsx)("div",{className:"al-grid-item-icon",children:(0,q.jsx)("img",{src:h.iconUrl,alt:h.label,width:24,height:24,loading:"lazy"})}),(0,q.jsx)("span",{className:"al-grid-item-label",children:h.label}),h.isNew&&(0,q.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,q.jsx)("div",{className:"al-grid-item-right",children:h.badge&&(0,q.jsx)("span",{className:"al-badge",children:h.badge})})]},h.id)})});return i?(0,q.jsxs)(gt.Drawer.Portal,{children:[(0,q.jsx)(gt.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,q.jsxs)(gt.Drawer.Content,{className:Y("al-drawer-content",o),"data-theme":r,children:[(0,q.jsxs)("div",{className:"al-drawer-header",children:[(0,q.jsx)(gt.Drawer.Close,{className:"al-drawer-close",children:(0,q.jsx)(Wo,{})}),(0,q.jsx)(gt.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,q.jsx)(gt.Drawer.Close,{className:"al-drawer-close",children:(0,q.jsx)(Bo,{})})]}),(0,q.jsx)("div",{className:"al-drawer-body",children:w})]})]}):(0,q.jsx)(vn.Portal,{children:(0,q.jsx)(vn.Content,{align:e,sideOffset:t,className:Y("al-popover-content",o),"data-theme":r,children:w})})}function Uo(e,t){try{let o=new URL(e).hostname;return typeof window>"u"?!0:o!==(t??window.location.hostname)}catch{return!1}}var pe=U(require("react"),1),fi=U(require("@radix-ui/react-popover"),1),gi=require("vaul");var yn=require("react"),Kn=(0,yn.createContext)(null);function Je(){let e=(0,yn.useContext)(Kn);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var kn=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(kn||{}),Ut={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"}};var R=U(require("react"),1);var et=U(require("bignumber.js"),1);function Bi(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 ht(e,t){if(!e||e==="0")return"0.00";let o=new et.default(e).shiftedBy(-t),n=o.isGreaterThanOrEqualTo(1)?2:4;return o.toFormat(n,et.default.ROUND_DOWN)}function Ne(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Yn(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 jo(e,t,o){let r=new et.default(e).shiftedBy(-t).multipliedBy(new et.default(o));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(et.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,et.default.ROUND_DOWN):r.decimalPlaces(4,et.default.ROUND_DOWN)).toFormat()}`}function qo(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 l=Number(o);if(!Number.isFinite(l)||l===0)return{displayValue:"0",isLowerBound:!1};o=Bi(l.toFixed(18))}let[n="0",r=""]=o.split(".");if(Number(n)>=1){let l=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${l}`,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 Le={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},fe={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var Qn={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"},Zo={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Xn(e,t){let o=fe[e];if(t===o.cross)return Zo.cross;if(t===o.bsc)return Zo.bsc}var $i={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function bt(e,t,o={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:r,format:i="png"}=o,l=$i[e],p=r?`&bg=${r}`:"";return`${l}/portrait/evm/${t}.${i}?size=${n}${p}`}var D=require("react/jsx-runtime");function Ko({size:e=16,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("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"}),(0,D.jsx)("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 Jn({size:e=16,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("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 jt({size:e=16,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function eo({size:e=24,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Yo({size:e=20,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("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"}),(0,D.jsx)("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 Qo({size:e=20,className:t}){return(0,D.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,D.jsx)("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 Xo({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Jo({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function er({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function tr({size:e=16,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("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"}),(0,D.jsx)("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 nr({size:e=16,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("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"}),(0,D.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function or({size:e=42,className:t}){return(0,D.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,D.jsx)("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})})}var rr=require("react"),ir=require("@tanstack/react-query");var Vi="send:chain-info";function Hi(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 to(e,...t){let o=e.replace(/\/+$/,""),n=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[o,...n].join("/")}function Gi(e,t,o,n){if(n)return t===fe[e].cross?ar(t,n):o?.explorer_url?to(o.explorer_url,o.explorer_postfix?.transaction??"tx",n):zi(e,t,n)}function ar(e,t){return to("https://explorer.crosstoken.io",String(e),"tx",t)}function zi(e,t,o){let n=fe[e];if(t===n.cross)return ar(t,o);if(t===n.bsc)return to(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",o)}function sr(e,t,o,n=!0){let r=Le[e],i=(0,ir.useQuery)({queryKey:[Vi,e,t],queryFn:async({signal:m})=>{let d=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:m});if(!d.ok)throw new Error(`Failed to fetch chain info: ${d.status}`);let c=await d.json();if("code"in c&&c.code!==void 0&&c.code!==200)throw new Error(`Chain info API error: ${c.code}`);return Hi(c)},enabled:n,staleTime:300*1e3}),l=i.data;return{transactionUrl:(0,rr.useMemo)(()=>Gi(e,t,l,o),[t,l,e,o]),chainInfo:l,...i}}var lr="0x0000000000000000000000000000000000000001";var Ui="0xa9059cbb",ji=/^0x[a-fA-F0-9]{40}$/,qi="nexus-cross:dapp-ui:send:recent:",cr=10;function Zi(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function qt(e){return e.toLowerCase()}function Zt(e){return ji.test(e)}function no(e){return qt(e.address)===lr}function oo(e){return`${qi}${e.toLowerCase()}`}function Mt(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(oo(e));if(!t)return[];let o=JSON.parse(t);return Array.isArray(o)?o.filter(n=>n!==null&&typeof n=="object"&&Zt(n.address)&&typeof n.updatedAt=="number").slice(0,cr):[]}catch{return[]}}function ro(e,t){if(typeof window>"u")return[];let o=qt(t),n=[{address:o,updatedAt:Date.now()},...Mt(e).filter(r=>r.address!==o)].slice(0,cr);try{window.localStorage.setItem(oo(e),JSON.stringify(n))}catch{return Mt(e)}return n}function io(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(oo(e))}catch{}}function ao(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"),l=r.padEnd(t,"0"),p=l?BigInt(l):0n,m=10n**BigInt(t),d=i*m+p;return d<=0n?{error:"Amount must be greater than 0."}:{value:d}}function so(e,t){let o=BigInt(e||"0"),n=10n**BigInt(t),r=o/n,i=o%n;if(i===0n)return r.toString();let l=Zi(i.toString().padStart(t,"0"));return`${r.toString()}.${l}`}function lo(e,t){let o=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${Ui}${o}${n}`}var Ki=2000000000n,Yi=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 Nn(e){return BigInt(e)}function Qi(e){return`0x${e.toString(16)}`}function Xi(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Qi(e.value)),e.data&&(t.data=e.data),t}function Ji(e){return e===56||e===97}async function dr(e){try{let t=await Cn(e,"eth_gasPrice",[]);return{gasPrice:Nn(t)}}catch{return{gasPrice:Ki}}}async function ea(e,t){let o=Yi;try{let n=await Cn(e,"eth_maxPriorityFeePerGas",[]);o=Nn(n)}catch{}return{maxFeePerGas:t+o,maxPriorityFeePerGas:o}}async function ta(e,t){if(t)return dr(e);let o;try{o=(await Cn(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return o?ea(e,Nn(o)):dr(e)}async function pr(e,t){let o=Ji(t.chainId),n=Xi(t),[r,i]=await Promise.all([Cn(e,"eth_estimateGas",[n]),ta(e,o)]);return{gasLimit:Nn(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function mr(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(mr(o.cause,t+1)),n.join(`
6
- `).toLowerCase()}function na(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 co(e,t={},o="Failed to send transaction."){let n=mr(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 l=i?` on ${i}`:"";return`Not enough ${r}${l} to cover the gas fee. Top up ${r} 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.":na(e)||o}O(`.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
- `);var a=require("react/jsx-runtime"),oa=1500,ra=120;function po(e){return`${e.chainId}:${e.address.toLowerCase()}`}function ur(e,t){return e.name||`Account ${(e.index??t)+1}`}function fr(e){return e.trim().slice(0,1).toUpperCase()||"A"}function ia(e){return new Promise(t=>setTimeout(t,e))}function aa(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}function sa(e){return!!(e.token||e.recipient||e.amount)}function fo(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 p=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(o,t)));return p=p.replace(/0+$/,""),p?`${r.toString()}.${p}`:r.toString()}function mo(e,t){return fo(e,t,6)}function uo(e){return fo(e,9,2)}function la(e){return e.toLocaleString("en-US")}function ca(e){return e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function da(e){return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function pa(){return(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("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"}),(0,a.jsx)("path",{d:"M4.5 14.5C4.5 13.67 5.17 13 6 13h9.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),(0,a.jsx)("path",{d:"M8 6.5h4M8 9h3",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function ma(){return(0,a.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--wi-primary)"}),(0,a.jsx)("path",{d:"M17 28.5L24.2 35.5L39 20.5",stroke:"var(--wi-primary-contrast, #001410)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Kt({env:e,theme:t="dark",walletAddress:o,accountName:n,accounts:r=[],token:i,tokens:l=[],onTokenChange:p,sendTransaction:m,getTransactionReceipt:d,estimateGas:c,onSuccess:u,onConfirmSuccess:y,onOutlink:b}){let[g,w]=R.useState(""),[h,P]=R.useState(""),[A,I]=R.useState(""),[N,G]=R.useState({}),[v,E]=R.useState(""),[H,k]=R.useState(!1),[j,Z]=R.useState(!1),[be,at]=R.useState(!1),[le,Ve]=R.useState("account"),Re=R.useRef(void 0),X=R.useRef(void 0),Ze=R.useRef(null),Ke=R.useRef(null),[ge,Ye]=R.useState(()=>Mt(o)),[xe,te]=R.useState("idle"),[K,_e]=R.useState(null),[ce,Ae]=R.useState(!1),[ve,me]=R.useState(""),ye=R.useRef(0),[ne,Ee]=R.useState(null),[re,st]=R.useState(""),ke=no(i),Qe=R.useMemo(()=>BigInt(i.quantity.numeric||"0"),[i.quantity.numeric]),He=R.useMemo(()=>ht(i.quantity.numeric,i.quantity.decimals),[i.quantity.numeric,i.quantity.decimals]),Ge=R.useMemo(()=>r.filter(f=>f.address.toLowerCase()!==o.toLowerCase()),[r,o]),lt=R.useMemo(()=>{let f=new Map;return Ge.forEach((L,M)=>{f.set(L.address.toLowerCase(),{account:L,index:M})}),f},[Ge]),Te=Ge.length>0,ze=R.useMemo(()=>ue(e),[e]),Pe=t==="dark"?"1A1A2E":"F3F6F8",Xe=l.length>0?l:[i],Ue=Xe.length>1&&!!p,{transactionUrl:Se,chainInfo:we}=sr(ze,i.chainId,v||void 0,!0),Ie=we?.currency_symbol??"",Ce=we?.name??`Chain ID ${i.chainId}`;R.useEffect(()=>{I(""),G({}),E(""),te("idle"),_e(null),me(""),Ae(!1),ye.current+=1},[i.address,i.chainId,g,h]),R.useEffect(()=>{P(""),k(!1)},[i.address,i.chainId]),R.useEffect(()=>{Ye(Mt(o))},[o]),R.useEffect(()=>()=>{clearTimeout(Re.current),clearTimeout(X.current)},[]),R.useEffect(()=>{!Te&&le==="account"&&Ve("recent")},[le,Te]),R.useEffect(()=>{let f=window.visualViewport,L=Ze.current;if(!f||!L)return;let M=()=>{let de=document.activeElement;return L.contains(de)&&(de instanceof HTMLInputElement||de instanceof HTMLTextAreaElement)},S=48,z=()=>{L.style.paddingBottom=""},ie=()=>{if(!M()){z();return}let de=Math.max(0,window.innerHeight-f.height-f.offsetTop);de>0?L.style.paddingBottom=`${de+S}px`:z();let mt=document.activeElement;mt instanceof HTMLElement&&requestAnimationFrame(()=>{let $t=mt.getBoundingClientRect(),un=L.getBoundingClientRect().bottom-de-S,Ht=$t.bottom-un;Ht>0&&L.scrollBy({top:Ht,behavior:"smooth"})})},pt=()=>{setTimeout(()=>{M()||z()},0)};return f.addEventListener("resize",ie),window.addEventListener("resize",ie),L.addEventListener("focusout",pt),()=>{f.removeEventListener("resize",ie),window.removeEventListener("resize",ie),L.removeEventListener("focusout",pt),z()}},[]);let Oe=R.useCallback(()=>{clearTimeout(X.current),X.current=setTimeout(()=>{Ke.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},10)},[]),Hn=R.useCallback(()=>{P(so(i.quantity.numeric,i.quantity.decimals))},[i.quantity.numeric,i.quantity.decimals]),cn=R.useCallback(f=>{w(f),Z(!1)},[]),dn=R.useCallback(()=>{let f={},L=g.trim(),M=ao(h,i.quantity.decimals),S;return L?Zt(L)||(f.recipient="Enter a valid EVM recipient address."):f.recipient="Enter a recipient address.","error"in M?f.amount=M.error:(S=M.value,S>Qe&&(f.amount="Amount exceeds available balance.")),!ke&&!Zt(i.address)&&(f.token="Token contract address is invalid."),{errors:f,rawAmount:S,trimmedRecipient:L}},[h,Qe,ke,g,i.address,i.quantity.decimals]),pn=R.useCallback(async()=>{if(v)try{await navigator.clipboard.writeText(v),at(!0),clearTimeout(Re.current),Re.current=setTimeout(()=>at(!1),2e3)}catch{}},[v]),ct=R.useCallback(()=>{if(!Se||!v)return;let f=S=>{typeof window>"u"||window.open(S,"_blank","noopener,noreferrer")};if(!b){f(Se);return}let L=b(Se,{category:"send",origin:"send-transaction",payload:{chainId:i.chainId,txHash:v}});if(L&&(typeof L=="object"||typeof L=="function")&&typeof L.then=="function"){let S=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;L.then(z=>{if(z===null){S?.close();return}let ie=z??Se;if(S)try{S.location.href=ie}catch{S.close(),f(ie)}else f(ie)});return}let M=L;M!==null&&f(M??Se)},[b,i.chainId,Se,v]),dt=R.useCallback((f,L)=>ke?{to:f,value:L,chainId:i.chainId,from:o}:{to:qt(i.address),data:lo(f,L),value:0n,chainId:i.chainId,from:o},[ke,i.address,i.chainId,o]),Tt=R.useCallback(async(f,L,M)=>{if(!c&&!M)return;let S=++ye.current;Ae(!0),me("");try{let z=dt(f,L),ie=c?await c(z):await pr(M,z);if(ye.current!==S)return;_e(ie)}catch(z){if(ye.current!==S)return;me(co(z,{nativeSymbol:Ie||void 0,networkName:Ce,tokenSymbol:i.symbol},"Failed to estimate gas."))}finally{ye.current===S&&Ae(!1)}},[dt,c,Ie,Ce,i.symbol]),mn=R.useCallback(f=>{if(f.preventDefault(),I(""),E(""),!m){te("error"),I("Sending is not available for this wallet.");return}let{errors:L,rawAmount:M,trimmedRecipient:S}=dn();if(G(L),sa(L)||M===void 0){te("error");return}let z=S;Ee(M),st(z),_e(null),me(""),te("review")},[m,dn]);R.useEffect(()=>{xe==="review"&&(!re||ne===null||K===null&&(ce||ve||!c&&!we?.rpc||Tt(re,ne,we?.rpc)))},[we?.rpc,c,Tt,K,ve,ce,ne,re,xe]);let Wt=R.useCallback(async()=>{if(!(!m||!re||ne===null)){I(""),E("");try{te("submitting");let f=await m(dt(re,ne));if(E(f),te("confirming"),Ye(ro(o,re)),u?.(f),!d){te("success");return}for(let L=0;L<ra;L+=1){let M=await d({hash:f,chainId:i.chainId}).catch(()=>null);if(M){if(aa(M)){te("error"),I("Transaction reverted on-chain.");return}te("success");return}await ia(oa)}te("error"),I("Transaction receipt was not found. Please check again later.")}catch(f){te("error"),I(co(f,{nativeSymbol:Ie||void 0,networkName:Ce,tokenSymbol:i.symbol}))}}},[dt,d,Ie,Ce,u,ne,re,m,i.chainId,i.symbol,o]),Gn=R.useCallback(()=>{ye.current+=1,_e(null),me(""),Ae(!1),I(""),te("idle")},[]),Bt=Qe<=0n||!g.trim()||!h.trim();if(xe==="review"||xe==="submitting"){let f=xe==="submitting",L=ne!==null?fo(ne,i.quantity.decimals):h.trim(),M=n?.trim()||`Account ${(r[0]?.index??0)+1}`,S="\u2014",z=Ie||(ke?i.symbol:""),ie=we?.currency_decimals??(ke?i.quantity.decimals:18),pt=K?ca(K):null,de=K?da(K):null,mt=de!==null&&z?`${mo(de,ie)} ${z}`:S,$t=K?la(K.gasLimit):S,Vt=K?.maxPriorityFeePerGas!==void 0?`${uo(K.maxPriorityFeePerGas)} Gwei`:S,un=K?.maxFeePerGas!==void 0?`${uo(K.maxFeePerGas)} Gwei`:S,Ht=K?.gasPrice!==void 0?`${uo(K.gasPrice)} Gwei`:S,Mo=`${L} ${i.symbol}`,fn=(()=>{if(!K||de===null)return S;if(ke&&ne!==null){let Pt=ne+de;return`${mo(Pt,ie)} ${z||i.symbol}`}return z?`${mo(de,ie)} ${z}`:S})();return(0,a.jsxs)("div",{className:"send-page send-page--review",children:[(0,a.jsxs)("div",{className:"send-scroll send-review-scroll","data-vaul-no-drag":!0,children:[(0,a.jsxs)("div",{className:"send-review-amount",children:[(0,a.jsx)("img",{className:"send-review-amount-icon",src:i.icon_url,alt:"",width:32,height:32,draggable:!1,onError:Pt=>{Pt.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,a.jsxs)("span",{className:"send-review-amount-value",children:[L," ",i.symbol]})]}),(0,a.jsxs)("div",{className:"send-review-parties",children:[(0,a.jsxs)("div",{className:"send-review-party",children:[(0,a.jsx)("span",{className:"send-review-party-label",children:"From"}),(0,a.jsxs)("div",{className:"send-review-party-info",children:[(0,a.jsx)("span",{className:"send-review-party-name",children:M}),(0,a.jsx)("span",{className:"send-review-party-addr",children:o})]})]}),(0,a.jsxs)("div",{className:"send-review-party",children:[(0,a.jsx)("span",{className:"send-review-party-label",children:"To"}),(0,a.jsx)("div",{className:"send-review-party-info",children:(0,a.jsx)("span",{className:"send-review-party-addr",children:re})})]})]}),(0,a.jsxs)("section",{className:"send-review-section",children:[(0,a.jsx)("h3",{className:"send-review-section-title",children:"Summary"}),(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Network"}),(0,a.jsxs)("span",{className:"send-review-row-value send-review-network",children:[(0,a.jsx)("span",{className:"send-review-network-dot","aria-hidden":!0}),Ce]})]}),(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Est. Tx Fee"}),(0,a.jsx)("span",{className:"send-review-row-value",children:ce?"\u2026":mt})]}),pt==="dynamic"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Max Priority Fee"}),(0,a.jsx)("span",{className:"send-review-row-value",children:ce?"\u2026":Vt})]}),(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Max Gas Fee"}),(0,a.jsx)("span",{className:"send-review-row-value",children:ce?"\u2026":un})]})]}):pt==="legacy"?(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Gas Price"}),(0,a.jsx)("span",{className:"send-review-row-value",children:ce?"\u2026":Ht})]}):null,(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Gas Limit"}),(0,a.jsx)("span",{className:"send-review-row-value",children:ce?"\u2026":$t})]})]}),(0,a.jsxs)("section",{className:"send-review-section",children:[(0,a.jsx)("h3",{className:"send-review-section-title",children:"Total"}),(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Total Amount"}),(0,a.jsx)("span",{className:"send-review-row-value",children:Mo})]}),(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Max. Total Amount"}),(0,a.jsx)("span",{className:"send-review-row-value",children:ce?"\u2026":fn})]})]}),ve&&(0,a.jsx)("div",{className:"send-message send-message--error",role:"alert",children:ve}),A&&(0,a.jsx)("div",{className:"send-message send-message--error",role:"alert",children:A})]}),(0,a.jsxs)("div",{className:"send-footer send-footer--review",children:[(0,a.jsx)("button",{type:"button",className:"send-review-btn send-review-btn--cancel",onClick:Gn,disabled:f,children:"Cancel"}),(0,a.jsx)("button",{type:"button",className:"send-review-btn send-review-btn--confirm",onClick:Wt,disabled:f,children:f?"Sending...":"Send"})]})]})}if((xe==="confirming"||xe==="success")&&v){let f=xe==="success";return(0,a.jsxs)("div",{className:"send-page send-page--success",children:[(0,a.jsxs)("div",{className:"send-success-body","data-vaul-no-drag":!0,children:[(0,a.jsx)("div",{className:"send-success-icon","data-pending":!f||void 0,children:f?(0,a.jsx)(ma,{}):(0,a.jsx)("span",{className:"send-success-spinner"})}),(0,a.jsxs)("div",{className:"send-success-copy",children:[(0,a.jsx)("h3",{className:"send-success-title",children:f?"Transaction Complete":"Transaction in Progress"}),(0,a.jsx)("p",{className:"send-success-desc",children:f?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),(0,a.jsxs)("div",{className:"send-success-hash-card",children:[(0,a.jsx)("span",{className:"send-success-hash-label",children:"Transaction Hash"}),(0,a.jsxs)("div",{className:"send-success-hash-row","data-vaul-no-drag":!0,children:[(0,a.jsx)("button",{type:"button",className:"send-success-hash-link",onClick:ct,"aria-label":"Open transaction in explorer",children:Ne(v)}),(0,a.jsx)("button",{type:"button",className:"send-success-copy-btn",onClick:pn,"aria-label":"Copy transaction hash",children:be?(0,a.jsx)(jt,{size:16}):"Copy"})]})]})]}),(0,a.jsx)("div",{className:"send-footer",children:(0,a.jsx)("button",{type:"button",className:"send-submit-btn",onClick:y,disabled:!f,children:f?"All done":"Sending..."})})]})}return(0,a.jsxs)("form",{className:"send-page",onSubmit:mn,children:[(0,a.jsxs)("div",{className:"send-scroll","data-vaul-no-drag":!0,ref:Ze,children:[(0,a.jsxs)("section",{className:"send-section","aria-label":"Select token to send",children:[(0,a.jsx)("span",{className:"send-label",children:"Token"}),(0,a.jsxs)("button",{type:"button",className:"send-asset-card",onClick:()=>{Ue&&k(f=>!f)},disabled:!Ue,"aria-expanded":Ue?H:void 0,children:[(0,a.jsxs)("span",{className:"send-asset-left",children:[(0,a.jsx)("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"}}),(0,a.jsxs)("span",{className:"send-asset-info",children:[(0,a.jsx)("span",{className:"send-asset-symbol",children:i.symbol}),(0,a.jsx)("span",{className:"send-asset-name",children:i.name})]})]}),(0,a.jsxs)("span",{className:"send-asset-balance",children:[(0,a.jsx)("span",{className:"send-balance-label",children:"Available"}),(0,a.jsxs)("span",{className:"send-balance-value",children:[He," ",i.symbol]})]})]}),Ue&&H&&(0,a.jsx)("div",{className:"send-token-list",role:"listbox",children:Xe.map(f=>{let L=po(f)===po(i);return(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":L,className:"send-token-option","data-selected":L||void 0,onClick:()=>p?.(f),children:[(0,a.jsxs)("span",{className:"send-asset-left",children:[(0,a.jsx)("img",{className:"send-token-option-icon",src:f.icon_url,alt:f.symbol,width:28,height:28,draggable:!1,onError:M=>{M.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,a.jsxs)("span",{className:"send-asset-info",children:[(0,a.jsx)("span",{className:"send-token-option-symbol",children:f.symbol}),(0,a.jsx)("span",{className:"send-asset-name",children:f.name})]})]}),(0,a.jsx)("span",{className:"send-token-option-balance",children:ht(f.quantity.numeric,f.quantity.decimals)})]},po(f))})}),N.token&&(0,a.jsx)("p",{className:"send-field-error",role:"alert",children:N.token})]}),(0,a.jsxs)("section",{className:"send-field","aria-label":"Recipient address",children:[(0,a.jsx)("span",{className:"send-label",children:"To"}),(0,a.jsxs)("div",{className:"send-address-wrap","data-invalid":N.recipient||void 0,children:[(0,a.jsx)("input",{className:"send-input send-input--address",value:g,onChange:f=>w(f.target.value),placeholder:"0x...",autoComplete:"off",spellCheck:!1,"aria-invalid":!!N.recipient,"aria-describedby":N.recipient?"send-recipient-error":void 0}),(0,a.jsx)("button",{type:"button",className:"send-address-book-btn",onClick:()=>Z(f=>!f),"aria-label":"Open address book","aria-expanded":j,children:(0,a.jsx)(pa,{})})]}),N.recipient&&(0,a.jsx)("p",{id:"send-recipient-error",className:"send-field-error",role:"alert",children:N.recipient}),j&&(0,a.jsxs)("div",{className:"send-address-picker",children:[(0,a.jsxs)("div",{className:"send-address-tabs",role:"tablist",children:[Te&&(0,a.jsx)("button",{type:"button",role:"tab",className:"send-address-tab","data-active":le==="account"||void 0,"aria-selected":le==="account",onClick:()=>Ve("account"),children:"My Account"}),(0,a.jsx)("button",{type:"button",role:"tab",className:"send-address-tab","data-active":le==="recent"||void 0,"aria-selected":le==="recent",onClick:()=>Ve("recent"),children:"Recent"})]}),Te&&le==="account"?(0,a.jsx)("div",{className:"send-address-list",children:Ge.map((f,L)=>{let M=ur(f,L),S=bt(ze,f.address,{size:56,bg:Pe});return(0,a.jsxs)("button",{type:"button",className:"send-address-option",onClick:()=>cn(f.address),children:[(0,a.jsxs)("span",{className:"send-address-avatar","aria-hidden":!0,children:[S&&(0,a.jsx)("img",{className:"send-address-avatar-img",src:S,alt:"",width:36,height:36,draggable:!1,onError:z=>{z.currentTarget.style.display="none"}}),(0,a.jsx)("span",{className:"send-address-avatar-fallback",children:fr(M)})]}),(0,a.jsxs)("span",{className:"send-address-copy",children:[(0,a.jsx)("span",{className:"send-address-name",children:M}),(0,a.jsx)("span",{className:"send-address-value",children:Ne(f.address)})]})]},f.address)})}):ge.length>0?(0,a.jsx)("div",{className:"send-address-list",children:ge.map(f=>{let L=lt.get(f.address.toLowerCase()),M=L?ur(L.account,L.index):void 0,S=bt(ze,f.address,{size:56,bg:Pe});return(0,a.jsxs)("button",{type:"button",className:"send-address-option",onClick:()=>cn(f.address),children:[(0,a.jsxs)("span",{className:"send-address-avatar","aria-hidden":!0,children:[S&&(0,a.jsx)("img",{className:"send-address-avatar-img",src:S,alt:"",width:36,height:36,draggable:!1,onError:z=>{z.currentTarget.style.display="none"}}),(0,a.jsx)("span",{className:"send-address-avatar-fallback",children:M?fr(M):f.address.slice(2,4).toUpperCase()})]}),(0,a.jsxs)("span",{className:"send-address-copy",children:[(0,a.jsx)("span",{className:"send-address-name",children:M??Ne(f.address)}),(0,a.jsx)("span",{className:"send-address-value",children:L?Ne(L.account.address):"Recently sent"})]})]},f.address)})}):(0,a.jsx)("div",{className:"send-address-empty",children:"No Send History"})]})]}),(0,a.jsxs)("section",{className:"send-field","aria-labelledby":"send-amount-label",children:[(0,a.jsxs)("span",{className:"send-label-row",children:[(0,a.jsx)("span",{id:"send-amount-label",className:"send-label",children:"Amount"}),(0,a.jsx)("button",{type:"button",className:"send-max-btn",onClick:Hn,disabled:Qe<=0n,children:"Max"})]}),(0,a.jsxs)("div",{className:"send-amount-wrap","data-invalid":N.amount||void 0,children:[(0,a.jsx)("input",{ref:Ke,className:"send-input send-input--amount",value:h,onChange:f=>P(f.target.value),onFocus:Oe,placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-labelledby":"send-amount-label","aria-invalid":!!N.amount,"aria-describedby":N.amount?"send-amount-error":void 0}),(0,a.jsx)("span",{className:"send-amount-symbol",children:i.symbol})]}),N.amount&&(0,a.jsx)("p",{id:"send-amount-error",className:"send-field-error",role:"alert",children:N.amount})]}),(0,a.jsxs)("div",{className:"send-meta",children:[(0,a.jsx)("span",{children:"From"}),(0,a.jsx)("span",{children:Ne(o)})]}),(0,a.jsxs)("div",{className:"send-meta",children:[(0,a.jsx)("span",{children:"Network"}),(0,a.jsxs)("span",{children:["Chain ID ",i.chainId]})]}),A&&(0,a.jsx)("div",{className:"send-message send-message--error",role:"alert",children:A})]}),(0,a.jsx)("div",{className:"send-footer",children:(0,a.jsx)("button",{type:"submit",className:"send-submit-btn","data-disabled":Bt||void 0,"aria-disabled":Bt,children:"Send"})})]})}var gr=U(require("@radix-ui/react-popover"),1),wr=require("vaul");var xt=require("react/jsx-runtime");function hr({asChild:e,className:t,children:o}){let{isMobile:n,theme:r,walletAddress:i}=Je(),l=o!=null,p=e??!0,m=l?o:(0,xt.jsxs)("button",{type:"button",className:Y("wi-trigger-btn",t),"data-theme":r,"data-mobile":n||void 0,children:[(0,xt.jsx)(Ko,{size:n?14:16}),(0,xt.jsx)("span",{className:"wi-trigger-address",children:Ne(i)})]});return n?(0,xt.jsx)(wr.Drawer.Trigger,{asChild:p,children:m}):(0,xt.jsx)(gr.Trigger,{asChild:p,children:m})}var V=U(require("react"),1),Fn=U(require("@radix-ui/react-popover"),1),Xt=require("vaul");var Ot=U(require("bignumber.js"),1);var br=require("@tanstack/react-query"),xr=require("react");var Ln="user-balance";async function ua(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 l=await i.json();if(l.code!==200)throw new Error(`Token balance API error: ${l.code}`);return l.data}function vt(e,t,o=!0){let n=Le[e],r=fe[e],i=[r.cross,r.bsc],l=(0,br.useQueries)({queries:i.map(c=>({queryKey:[Ln,e,t,c],queryFn:({signal:u})=>ua(n,c,t,u),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1}))}),p=l.some(c=>c.isLoading),m=l.some(c=>c.isError);return{tokens:(0,xr.useMemo)(()=>{let c=[];for(let u of l)u.data&&c.push(...u.data);return c},[l]),isLoading:p,isError:m}}var Rn=require("@tanstack/react-query"),vr=require("react");var fa="forge-holdings",ga="forge-token-image";async function wa(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 ha(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 yr(e,t,o=!0){let n=Qn[e],{data:r,...i}=(0,Rn.useQuery)({queryKey:[fa,e,t],queryFn:({signal:l})=>wa(n,t,l),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1});return{holdings:r??[],...i}}function kr(e,t,o=!0){let n=Qn[e],r=(0,Rn.useQueries)({queries:t.map(l=>({queryKey:[ga,e,l],queryFn:({signal:p})=>ha(n,l,p),enabled:o,staleTime:1/0}))});return{imageMap:(0,vr.useMemo)(()=>{let l=new Map;for(let p of r)p.data&&l.set(p.data.address,p.data.image_url);return l},[r])}}var Cr=require("@tanstack/react-query"),Nr=require("react");var En="token-stats";function yt(e,t){return`${e}:${t.toLowerCase()}`}function kt(e,t=!0){let o=Le[e],{data:n,...r}=(0,Cr.useQuery)({queryKey:[En,e],queryFn:async({signal:l})=>{let p=await fetch(`${o}/v1/public/token/stats`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Failed to fetch token stats: ${p.status}`);let m=await p.json();if(m.code!==200)throw new Error(`Token stats API error: ${m.code}`);return m},enabled:t,staleTime:3e4});return{statsMap:(0,Nr.useMemo)(()=>{let l=new Map;if(!n?.data)return l;for(let p of n.data){let m=yt(p.chain_id,p.address);l.set(m,p)}return l},[n]),...r}}var Lr=require("@tanstack/react-query"),Rr=require("react");var ba="token-info";function go(e,t){return`${t.toLowerCase()}_${e}`}function Er(e,t=!0){let o=Le[e],{data:n,...r}=(0,Lr.useQuery)({queryKey:[ba,e],queryFn:async({signal:l})=>{let p=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Failed to fetch token info: ${p.status}`);let m=await p.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:1/0});return{categoryMap:(0,Rr.useMemo)(()=>{let l=new Map;if(!n?.data)return l;for(let p of n.data){let m=go(p.chain_id,p.address);l.set(m,p.category)}return l},[n]),...r}}var Tr=require("react"),Tn=U(require("bignumber.js"),1);function Pr(e,t,o){let{tokens:n,isLoading:r}=vt(e,t,o),{statsMap:i}=kt(e,o);return(0,Tr.useMemo)(()=>{let l=new Tn.default(0);for(let c of n){let u=i.get(yt(c.chainId,c.address));if(!u)continue;let b=new Tn.default(c.quantity.numeric).shiftedBy(-c.quantity.decimals).multipliedBy(new Tn.default(u.price));b.isNaN()||(l=l.plus(b))}let p=l.toFixed(),{displayValue:m,isLowerBound:d}=qo(p);return{totalUsd:p,displayValue:m,isLowerBound:d,isLoading:r}},[n,i,r])}var li=require("qrcode.react");function De(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(d){console.error("[dapp-ui] onOutlink threw:",d);return}let i=d=>{typeof window>"u"||window.open(d,"_blank","noopener,noreferrer")};if((d=>!!d&&(typeof d=="object"||typeof d=="function")&&typeof d.then=="function")(r)){let d=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,c=u=>{if(u===null){d?.close();return}let y=u??t;if(d)try{d.location.href=y}catch{d.close(),i(y)}else i(y)};r.then(c,u=>{console.error("[dapp-ui] onOutlink rejected:",u),d?.close()});return}let p=r;if(p===null)return;i(p??t)}var Lt=U(require("react"),1),si=require("vaul");var Pn=require("react"),Yt=(0,Pn.createContext)(null);function se(){let e=(0,Pn.useContext)(Yt);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var Sr=require("vaul");var wo=require("react/jsx-runtime");function Ir({asChild:e,children:t}){let{walletAddress:o}=se(),n=t!=null,r=e??!0,i=n?t:(0,wo.jsx)("button",{type:"button",children:Ne(o)});return(0,wo.jsx)(Sr.Drawer.Trigger,{asChild:r,children:i})}var Qt=require("vaul");var Me=U(require("react"),1),ii=require("@tanstack/react-query");var Br=require("react"),An=U(require("bignumber.js"),1);var Ar=require("@tanstack/react-query"),ho=require("react");var Sn={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"},Mr={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},In={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"},tt={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},We={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"},_r={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 xa="wp:reward-pools";function Mn(e,t=!0){let o=Sn[e],{data:n,...r}=(0,Ar.useQuery)({queryKey:[xa,e],queryFn:async({signal:p})=>{let m=await fetch(`${o}/v1/pools`,{cache:"no-store",signal:p});if(!m.ok)throw new Error(`Failed to fetch pools: ${m.status}`);let d=await m.json();if(d.code!==200)throw new Error(`Pools API error: ${d.code}`);return d},enabled:t,staleTime:0}),i=(0,ho.useMemo)(()=>n?.data.pools.filter(p=>p.pool_type==="CrossPool")??[],[n]),l=(0,ho.useMemo)(()=>n?.data.pools.filter(p=>p.pool_type==="GamePool")??[],[n]);return{crossPools:i,gamePools:l,allPools:n?.data.pools??[],...r}}var Or=require("@tanstack/react-query"),Fr=require("react");var va="wp:user-deposits";function _n(e,t,o=!0){let n=Sn[e],r=o&&!!t,{data:i,...l}=(0,Or.useQuery)({queryKey:[va,e,t],queryFn:async({signal:m})=>{let d=await fetch(`${n}/v1/users/${t}/deposits`,{cache:"no-store",signal:m});if(!d.ok)throw new Error(`Deposits fetch failed: ${d.status}`);let c=await d.json();if(c.code!==200)throw new Error(`Deposits API error: ${c.code}`);return c},enabled:r,staleTime:0});return{depositMap:(0,Fr.useMemo)(()=>{let m=new Map;if(!i?.data.user_deposits)return m;for(let d of i.data.user_deposits)m.set(d.pool_address.toLowerCase(),d);return m},[i]),deposits:i?.data.user_deposits??[],...l}}var bo=require("@tanstack/react-query"),xo=require("react");function Be(e,t,o,n=!0){let r=_r[e][t],i=n&&!!o,{data:l,...p}=(0,bo.useQuery)({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:g})=>{let w=await fetch(`${r}/pair-info`,{cache:"no-store",signal:g});if(!w.ok)throw new Error(`pair-info fetch failed: ${w.status}`);let h=await w.json();if(h.code!==200)throw new Error(`pair-info API error: ${h.code}`);return h},enabled:n,staleTime:0}),m=l?.data??[],d=(0,xo.useMemo)(()=>{let g=new Map;for(let w of m)g.set(w.pair_address.toLowerCase(),w);return g},[m]),{data:c,...u}=(0,bo.useQuery)({queryKey:["wp:dex-orders",e,t,o],queryFn:async({signal:g})=>{let w=Math.floor(Date.now()/1e3),h=new URLSearchParams({owner:o,size:"200",start_date:"0",end_date:String(w)}),P=await fetch(`${r}/open-order?${h}`,{cache:"no-store",signal:g});if(!P.ok)throw new Error(`open-order fetch failed: ${P.status}`);let A=await P.json();if(A.code!==200)throw new Error(`open-order API error: ${A.code}`);return A.data?.data??[]},enabled:i,staleTime:0}),y=c??[],b=(0,xo.useMemo)(()=>{let g=new Map;for(let w of y){let h=w.pair.toLowerCase();g.has(h)||g.set(h,{buys:[],sells:[]});let P=g.get(h);w.order_side===1?P.buys.push(w):P.sells.push(w)}return g},[y]);return{allPairs:m,pairMap:d,orders:y,ordersByPair:b,isEmpty:y.length===0,isLoading:p.isLoading||u.isLoading}}var ya=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],Dr="var(--wp-green)",Wr=4;function $r(e,t,o=!0){let n=o&&!!t,{allPools:r}=Mn(e,n),{depositMap:i}=_n(e,t,n),{allPairs:l,pairMap:p,ordersByPair:m}=Be(e,"cross",t,n),{allPairs:d,pairMap:c,ordersByPair:u}=Be(e,"crossd",t,n),{allPairs:y,pairMap:b,ordersByPair:g}=Be(e,"forge",t,n);return(0,Br.useMemo)(()=>{let w=new Map,h=new Map,P=(v,E)=>{!Number.isFinite(E)||E<=0||h.set(v,(h.get(v)??0)+E)};for(let v of r){let E=Number(v.deposit_token.price);E>0&&w.set(v.deposit_token.symbol,E);for(let H of v.reward_tokens){let k=Number(H.price);k>0&&w.set(H.symbol,k)}}for(let v of[...l,...d,...y]){let E=w.get(v.quote_symbol),H=Number(v.billboard?.price);E&&H>0&&!w.has(v.base_symbol)&&w.set(v.base_symbol,H*E)}for(let v of r){let E=i.get(v.pool_address.toLowerCase());if(!E)continue;let H=new An.default(E.deposited_amount).shiftedBy(-v.deposit_token.decimals).toNumber();if(P(v.deposit_token.symbol,H),v.reward_tokens.length>0){let k=v.reward_tokens[0],j=new An.default(E.claimable_reward).shiftedBy(-k.decimals).toNumber();P(k.symbol,j)}}let A=[{pairMap:p,ordersByPair:m},{pairMap:c,ordersByPair:u},{pairMap:b,ordersByPair:g}];for(let{pairMap:v,ordersByPair:E}of A)for(let[H,k]of E){let j=v.get(H);if(j){for(let Z of k.buys){let be=Number(Z.amount)-Number(Z.filled);P(j.quote_symbol,be*Number(Z.price))}for(let Z of k.sells){let be=Number(Z.amount)-Number(Z.filled);P(j.base_symbol,be)}}}let I=[],N=0;for(let[v,E]of h){let H=w.get(v)??0,k=E*H;k>0&&(I.push({symbol:v,usdValue:k}),N+=k)}I.sort((v,E)=>E.usdValue-v.usdValue);let G=[];if(N>0){let v=I.slice(0,Wr),E=I.slice(Wr);for(let k=0;k<v.length;k++)G.push({symbol:v[k].symbol,usdValue:v[k].usdValue,percentage:Math.round(v[k].usdValue/N*100),color:ya[k]??Dr});if(E.length>0){let k=E.reduce((j,Z)=>j+Z.usdValue,0);G.push({symbol:"Others",usdValue:k,percentage:Math.round(k/N*100),color:Dr})}let H=G.reduce((k,j)=>k+j.percentage,0);H!==100&&G.length>0&&(G[0].percentage+=100-H)}return{totalUsd:N,formattedTotal:N>0?`$${new An.default(N).toFormat(2)}`:"$0.00",segments:G}},[r,i,l,p,m,d,c,u,y,b,g])}var je=require("react/jsx-runtime");function Vr({size:e=22,className:t}){return(0,je.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,je.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Hr({size:e=22,className:t}){return(0,je.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,je.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,je.jsx)("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 Gr({size:e=12,className:t}){return(0,je.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,je.jsx)("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}var zr=require("@tanstack/react-query"),Ur=require("react");var ka="wp:token-info";function nt(e,t=!0){let o=Le[e],n=fe[e].cross,{data:r,...i}=(0,zr.useQuery)({queryKey:[ka,e],queryFn:async({signal:d})=>{let c=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:d});if(!c.ok)throw new Error(`Failed to fetch token info: ${c.status}`);let u=await c.json();if(u.code!==200)throw new Error(`Token info API error: ${u.code}`);return u},enabled:t,staleTime:300*1e3}),{byChainAddr:l,byChainSym:p}=(0,Ur.useMemo)(()=>{let d=new Map,c=new Map;if(!r?.data)return{byChainAddr:d,byChainSym:c};for(let u of r.data){let y=u.address.toLowerCase();d.set(`${u.chain_id}:${y}`,u),d.set(y,u);let b=u.symbol.replace(/^t/,"").toUpperCase(),g=`${u.chain_id}:${b}`;c.has(g)||c.set(g,u),c.has(b)||c.set(b,u)}return{byChainAddr:d,byChainSym:c}},[r]);return{getTokenImage:(d,c)=>{let u=d.toLowerCase(),y=l.get(`${n}:${u}`);if(y?.image)return y.image;let b=l.get(u);if(b?.image)return b.image;if(c){let g=c.replace(/^t/,"").toUpperCase(),w=p.get(`${n}:${g}`);if(w?.image)return w.image;let h=p.get(g);if(h?.image)return h.image}return""},...i}}var ot=require("react/jsx-runtime");function $e({title:e,icon:t,iconFit:o="cover",isEmpty:n,children:r}){return(0,ot.jsxs)("div",{className:"wp-svc-card",children:[(0,ot.jsxs)("div",{className:"wp-svc-card-head",children:[(0,ot.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:o}}),(0,ot.jsx)("span",{className:"wp-svc-card-title",children:e})]}),n?(0,ot.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,ot.jsx)("div",{className:"wp-svc-items",children:r})]})}var _t=U(require("bignumber.js"),1),ee=require("react/jsx-runtime"),Ca="CROSS Rewards";function jr(e,t){let o=new _t.default(e).shiftedBy(-t);return o.isZero()?"0":o.isGreaterThanOrEqualTo(1)?o.toFormat(2,_t.default.ROUND_DOWN):o.toFormat(4,_t.default.ROUND_DOWN)}function qr(){let{env:e,walletAddress:t,onOutlink:o}=se(),n=!!t,{allPools:r}=Mn(e,n),{depositMap:i}=_n(e,t,n),{getTokenImage:l}=nt(e,n),p=c=>`${Mr[e]}/rewards/${c.pool_address}?action=withdraw`,m=`${We[e]}/reward.png`,d=r.filter(c=>{let u=i.get(c.pool_address.toLowerCase()),y=u?.deposited_amount??"0",b=u?.claimable_reward??"0";return!(new _t.default(y).isZero()&&new _t.default(b).isZero())});return(0,ee.jsx)($e,{title:Ca,icon:m,isEmpty:d.length===0,children:d.map(c=>{let u=i.get(c.pool_address.toLowerCase()),y=u?.deposited_amount??"0",b=p(c);return(0,ee.jsxs)("a",{className:"wp-item","data-side":"reward",href:b,target:"_blank",rel:"noopener noreferrer",onClick:g=>De(g,b,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:c,userDeposit:u}},o),children:[(0,ee.jsxs)("div",{className:"wp-item-body",children:[(0,ee.jsxs)("div",{className:"wp-item-field",children:[(0,ee.jsxs)("span",{className:"wp-item-label",children:["Deposited (",c.deposit_token.symbol,")"]}),(0,ee.jsxs)("div",{className:"wp-svc-token",children:[l(c.deposit_token.address,c.deposit_token.symbol)&&(0,ee.jsx)("img",{className:"wp-svc-token-icon",src:l(c.deposit_token.address,c.deposit_token.symbol),alt:""}),(0,ee.jsx)("span",{children:jr(y,c.deposit_token.decimals)})]})]}),(0,ee.jsxs)("div",{className:"wp-item-field",children:[(0,ee.jsxs)("span",{className:"wp-item-label",children:["Rewards (",c.reward_tokens.map(g=>g.symbol).join(", "),")"]}),c.reward_tokens.map(g=>{let w=l(g.address,g.symbol);return(0,ee.jsxs)("div",{className:"wp-svc-token",children:[w&&(0,ee.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),(0,ee.jsx)("span",{children:u?jr(u.claimable_reward,g.decimals):"0"})]},g.address)})]})]}),(0,ee.jsxs)("div",{className:"wp-item-badges",children:[(0,ee.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Claim"}),(0,ee.jsx)("span",{className:"wp-badge wp-badge--muted",children:"Withdraw"})]})]},c.pool_address)})})}var yo=U(require("bignumber.js"),1);var _=require("react/jsx-runtime");function vo(e){let t=new yo.default(e);if(t.isNaN())return e;let o=t.decimalPlaces()??0;return t.toFormat(o)}function Zr(e){let t=new yo.default(e.amount).minus(e.filled);return vo(t.toString())}function At({market:e,pairMap:t,ordersByPair:o,getDexUrl:n,getTokenImage:r}){let{onOutlink:i}=se(),l=[];for(let[p,m]of o){let d=t.get(p),c=d?r(d.base_address,d.base_symbol):"",u=d?r(d.quote_address,d.quote_symbol):"",y=n(p);for(let b of m.buys)l.push((0,_.jsxs)("a",{className:"wp-item","data-side":"buy",href:y,target:"_blank",rel:"noopener noreferrer",onClick:g=>De(g,y,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"buy",order:b,pair:d}},i),children:[(0,_.jsxs)("div",{className:"wp-item-body",children:[(0,_.jsxs)("div",{className:"wp-item-field",children:[(0,_.jsxs)("span",{className:"wp-item-label wp-item-label--buy",children:["Buy",d?.base_symbol?` (${d.base_symbol})`:""]}),(0,_.jsxs)("div",{className:"wp-svc-token",children:[c&&(0,_.jsx)("img",{className:"wp-svc-token-icon",src:c,alt:""}),(0,_.jsx)("span",{children:Zr(b)})]})]}),(0,_.jsxs)("div",{className:"wp-item-field",children:[(0,_.jsxs)("span",{className:"wp-item-label",children:["Price",d?.quote_symbol?` (${d.quote_symbol})`:""]}),(0,_.jsxs)("div",{className:"wp-svc-token",children:[u&&(0,_.jsx)("img",{className:"wp-svc-token-icon",src:u,alt:""}),(0,_.jsx)("span",{children:vo(b.price)})]})]})]}),(0,_.jsx)("div",{className:"wp-item-badges",children:(0,_.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`buy-${b.order_id}`));for(let b of m.sells)l.push((0,_.jsxs)("a",{className:"wp-item","data-side":"sell",href:y,target:"_blank",rel:"noopener noreferrer",onClick:g=>De(g,y,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"sell",order:b,pair:d}},i),children:[(0,_.jsxs)("div",{className:"wp-item-body",children:[(0,_.jsxs)("div",{className:"wp-item-field",children:[(0,_.jsxs)("span",{className:"wp-item-label wp-item-label--sell",children:["Sell",d?.base_symbol?` (${d.base_symbol})`:""]}),(0,_.jsxs)("div",{className:"wp-svc-token",children:[c&&(0,_.jsx)("img",{className:"wp-svc-token-icon",src:c,alt:""}),(0,_.jsx)("span",{children:Zr(b)})]})]}),(0,_.jsxs)("div",{className:"wp-item-field",children:[(0,_.jsxs)("span",{className:"wp-item-label",children:["Price",d?.quote_symbol?` (${d.quote_symbol})`:""]}),(0,_.jsxs)("div",{className:"wp-svc-token",children:[u&&(0,_.jsx)("img",{className:"wp-svc-token-icon",src:u,alt:""}),(0,_.jsx)("span",{children:vo(b.price)})]})]})]}),(0,_.jsx)("div",{className:"wp-item-badges",children:(0,_.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`sell-${b.order_id}`))}return(0,_.jsx)(_.Fragment,{children:l})}var ko=require("react/jsx-runtime"),Na="Gametoken - CROSS";function Kr(){let{env:e,walletAddress:t}=se(),o=!!t,{pairMap:n,ordersByPair:r,isEmpty:i}=Be(e,"cross",t,o),{getTokenImage:l}=nt(e,o),p=d=>{let c=n.get(d.toLowerCase());return`${tt[e]}/gametoken/cross/${c?.base_symbol??""}`},m=`${We[e]}/dex.png`;return(0,ko.jsx)($e,{title:Na,icon:m,isEmpty:i,children:(0,ko.jsx)(At,{market:"cross",pairMap:n,ordersByPair:r,getDexUrl:p,getTokenImage:l})})}var Co=require("react/jsx-runtime"),La="Gametoken - CROSSD";function Yr(){let{env:e,walletAddress:t}=se(),o=!!t,{pairMap:n,ordersByPair:r,isEmpty:i}=Be(e,"crossd",t,o),{getTokenImage:l}=nt(e,o),p=d=>{let c=n.get(d.toLowerCase());return`${tt[e]}/gametoken/crossd/${c?.base_symbol??""}`},m=`${We[e]}/dex.png`;return(0,Co.jsx)($e,{title:La,icon:m,isEmpty:i,children:(0,Co.jsx)(At,{market:"crossd",pairMap:n,ordersByPair:r,getDexUrl:p,getTokenImage:l})})}var No=require("react/jsx-runtime"),Ra="Gametoken - Forge";function Qr(){let{env:e,walletAddress:t}=se(),o=!!t,{pairMap:n,ordersByPair:r,isEmpty:i}=Be(e,"forge",t,o),{getTokenImage:l}=nt(e,o);if(i)return null;let p=d=>{let c=n.get(d.toLowerCase());return`${tt[e]}/gametoken/forge/${c?.base_symbol??""}`},m=`${We[e]}/dex.png`;return(0,No.jsx)($e,{title:Ra,icon:m,isEmpty:i,children:(0,No.jsx)(At,{market:"forge",pairMap:n,ordersByPair:r,getDexUrl:p,getTokenImage:l})})}var On=U(require("bignumber.js"),1),oi=require("react");var Xr=require("@tanstack/react-query");var Ea="wp:forge-pools";function Jr(e,t,o=!0){let n=In[e],r=o&&!!t,{data:i,...l}=(0,Xr.useQuery)({queryKey:[Ea,e,t],queryFn:async()=>{let m=await fetch(`${n}/v1/users/${t}/pools`,{cache:"no-store"});if(!m.ok)throw new Error(`forge pools fetch failed: ${m.status}`);return(await m.json()).data?.items??[]},enabled:r,staleTime:0}),p=i??[];return{pools:p,isEmpty:p.length===0,...l}}var ei=require("@tanstack/react-query"),ti=require("react");var Ta="wp:forge-token-detail";async function Pa(e,t){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return o.ok?(await o.json())?.data?.token??null:null}function ni(e,t,o=!0){let n=In[e],r=(0,ei.useQueries)({queries:t.map(p=>({queryKey:[Ta,e,p],queryFn:()=>Pa(n,p),enabled:o&&!!p,staleTime:3e4}))}),i=(0,ti.useMemo)(()=>{let p=new Map;for(let m=0;m<r.length;m++){let d=r[m]?.data,c=t[m];d&&c&&p.set(c.toLowerCase(),d)}return p},[r,t]),l=r.some(p=>p.isLoading);return{detailMap:i,isLoading:l}}var Q=require("react/jsx-runtime"),Sa="Forge",Ia=18,Ma="https://contents.crosstoken.io/wallet/token/images/FT.png";function _a(e){if(!e||e==="0")return"0";let t=new On.default(e).shiftedBy(-Ia);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,On.default.ROUND_DOWN):t.toFormat(4,On.default.ROUND_DOWN)}function Aa(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 ri(){let{env:e,walletAddress:t,onOutlink:o}=se(),n=!!t,{pools:r,isEmpty:i}=Jr(e,t,n),l=(0,oi.useMemo)(()=>r.map(c=>c.token.address),[r]),{detailMap:p}=ni(e,l,n&&l.length>0),m=c=>`${tt[e]}/forge/token/${c.token.address}`,d=`${We[e]}/forge.png`;return(0,Q.jsx)($e,{title:Sa,icon:d,iconFit:"contain",isEmpty:i,children:r.map(c=>{let u=p.get(c.token.address.toLowerCase()),y=u?.image_url||u?.image||c.token.image||Ma,b=u?.symbol||c.token.symbol,g=m(c);return(0,Q.jsxs)("a",{className:"wp-item","data-side":"lp",href:g,target:"_blank",rel:"noopener noreferrer",onClick:w=>De(w,g,{category:"portfolio",origin:"portfolio-forge",payload:{pool:c,tokenDetail:u}},o),children:[(0,Q.jsxs)("div",{className:"wp-item-body",children:[(0,Q.jsxs)("div",{className:"wp-item-field",children:[(0,Q.jsxs)("span",{className:"wp-item-label",children:["Pair (",b,")"]}),(0,Q.jsx)("div",{className:"wp-svc-token",children:(0,Q.jsx)("img",{className:"wp-svc-token-icon",src:y,alt:""})})]}),(0,Q.jsxs)("div",{className:"wp-item-field",children:[(0,Q.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,Q.jsx)("div",{className:"wp-svc-token",children:(0,Q.jsx)("span",{children:_a(c.lp_balance)})})]}),(0,Q.jsxs)("div",{className:"wp-item-field",children:[(0,Q.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,Q.jsx)("div",{className:"wp-svc-token",children:(0,Q.jsx)("span",{children:Aa(c.pool_ownership)})})]})]}),(0,Q.jsx)("div",{className:"wp-item-badges",children:(0,Q.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Withdraw"})})]},c.pair_address)})})}O(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--cck-surface-bg, #202530);--wp-card: var(--cck-surface-default, #292f40);--wp-border: var(--cck-border-default, #313b51);--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-mint: #00d4aa;--wp-green: var(--cck-primary, #019d92);--wp-red: var(--cck-error, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: var(--cck-surface-bg, #f5f6f8);--wp-card: var(--cck-surface-default, #ffffff);--wp-border: var(--cck-border-default, #e2e5ea);--wp-text: var(--cck-texticon-primary, #202530);--wp-text-60: var(--cck-texticon-secondary, #49556e);--wp-text-40: #8c97ad;--wp-text-30: var(--cck-texticon-tertiary, #a0a9b8);--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-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;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-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-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-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:16px 16px 128px;display:flex;flex-direction:column;gap:20px}.wp-svc-card{display:flex;flex-direction:column;gap:8px}.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:14px;font-weight:600;line-height:1.3;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:10px}.wp-item{position:relative;background:var(--wp-card);border-radius:12px;padding:14px 40px 14px 16px;display:flex;flex-direction:column;gap:6px;box-shadow:0 1px 3px #00000014,0 2px 8px #0000000a;overflow:hidden;text-decoration:none;cursor:pointer;transition:box-shadow .2s ease,transform .15s ease}.wp-item:hover{box-shadow:0 2px 6px #0000001f,0 4px 14px #0000000f;transform:translateY(-1px)}.wp-item:active{transform:translateY(0);box-shadow:0 1px 3px #00000014}.wp-item:before{content:"";position:absolute;top:0;left:0;width:3px;height:100%;border-radius:3px 0 0 3px;background:var(--wp-border)}.wp-item:after{content:"";position:absolute;right:14px;top:50%;transform:translateY(-50%);width:12px;height:12px;background:currentColor;opacity:.25;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 1.5h7v7M10.5 1.5L1.5 10.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 1.5h7v7M10.5 1.5L1.5 10.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;transition:opacity .15s}.wp-item:hover:after{opacity:.5}.wp-item[data-side=buy]:before{background:var(--wp-green)}.wp-item[data-side=sell]:before{background:var(--wp-red)}.wp-item[data-side=reward]:before{background:var(--wp-mint)}.wp-item[data-side=lp]:before{background:var(--wp-purple)}.wp-item-body{display:flex;gap:12px}.wp-item-field{flex:1;display:flex;flex-direction:column;gap:4px;min-width:0}.wp-item-label{font-size:11px;font-weight:500;line-height:1.3;color:var(--wp-text-40);letter-spacing:.03em;text-transform:uppercase}.wp-item-label--buy{color:var(--wp-green)}.wp-item-label--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-svc-token>span{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:22px;height:22px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-svc-buy{color:var(--wp-green)}.wp-svc-sell{color:var(--wp-red)}.wp-badge{display:inline-flex;align-items:center;font-size:10px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;padding:2px 7px;border-radius:4px;border:1px solid transparent;pointer-events:none}.wp-badge--mint{color:var(--wp-mint);background:#00d4aa1a;border-color:#00d4aa40}.wp-badge--muted{color:var(--wp-text-40);background:#8c97ad14;border-color:#8c97ad2e}.wp-badge--red{color:var(--wp-red);background:#e7007714;border-color:#e7007733}.wp-item-badges{display:flex;align-items:center;gap:6px}.wp-svc-empty{display:flex;align-items:center;justify-content:center;height:56px;background:var(--wp-card);border-radius:12px;font-size:13px;font-weight:400;color:var(--wp-text-30);box-shadow:0 1px 3px #00000014}@media(max-width:375px){.wp-header{gap:12px;padding:0 12px}.wp-top{padding:0 12px 12px;gap:12px}.wp-total{font-size:22px}.wp-legend{gap:10px}.wp-legend-label{font-size:11px}.wp-body-inner{padding:12px 12px 128px;gap:14px}.wp-svc-items{gap:8px}.wp-item{padding:12px 36px 12px 14px;gap:6px;border-radius:10px}.wp-item:after{right:10px;width:11px;height:11px}.wp-item-body{gap:10px}.wp-svc-token{gap:6px}.wp-svc-token>span{font-size:13px}.wp-svc-token-icon{width:20px;height:20px}}.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
- `);var T=require("react/jsx-runtime"),Lo=5,Oa="wp:";function Ct({env:e,theme:t="dark",walletAddress:o,walletName:n,onBack:r,showHeader:i=!0,variant:l="embed",className:p,sendTransaction:m,getTransactionReceipt:d,onOutlink:c}){let u=ue(e),y=!!o,b=(0,ii.useQueryClient)(),{segments:g}=$r(u,o,y),[w,h]=Me.useState(Lo),[P,A]=Me.useState(!1),I=Me.useCallback(()=>{b.invalidateQueries({predicate:k=>typeof k.queryKey[0]=="string"&&k.queryKey[0].startsWith(Oa)})},[b]),N=Me.useCallback(()=>{I(),A(!0),setTimeout(()=>A(!1),600),h(Lo)},[I]);Me.useEffect(()=>{if(!y)return;let k=setInterval(()=>{h(j=>j<=1?(N(),Lo):j-1)},1e3);return()=>clearInterval(k)},[y,N]);let G=Me.useCallback(()=>{r?.()},[r]),v=y?bt(u,o,{size:64}):void 0,E=Me.useMemo(()=>({env:u,theme:t,open:!0,walletAddress:o,close:G,sendTransaction:m,getTransactionReceipt:d,onOutlink:c}),[u,t,o,G,m,d,c]),H=(0,T.jsxs)(T.Fragment,{children:[i&&(0,T.jsxs)("div",{className:"wp-header",children:[(0,T.jsxs)("div",{className:"wp-header-account",children:[r?(0,T.jsx)("button",{type:"button",className:"wp-header-btn",onClick:r,children:(0,T.jsx)(Vr,{})}):(0,T.jsx)("span",{className:"wp-header-avatar","aria-hidden":!0,children:v&&(0,T.jsx)("img",{src:v,alt:"",className:"wp-header-avatar-img",draggable:!1})}),n&&(0,T.jsx)("span",{className:"wp-header-wallet-name",title:n,children:n})]}),(0,T.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:N,children:[(0,T.jsx)(Hr,{className:P?"wp-spin-once":void 0}),y&&(0,T.jsx)("span",{className:"wp-refresh-badge",children:w})]})]}),(0,T.jsx)("div",{className:"wp-top",children:g.length>0&&(0,T.jsxs)("div",{className:"wp-asset",children:[(0,T.jsxs)("div",{className:"wp-asset-head",children:[(0,T.jsx)("span",{className:"wp-asset-head-label",children:"Consolidated Asset"}),(0,T.jsx)("span",{className:"wp-asset-head-icon",children:(0,T.jsx)(Gr,{})})]}),(0,T.jsx)("div",{className:"wp-bar",children:g.map(k=>(0,T.jsx)("div",{className:"wp-bar-seg",style:{flex:`${k.percentage} 0 0`,background:k.color},children:k.percentage>=5&&(0,T.jsxs)("span",{className:"wp-bar-seg-pct",children:[k.percentage,"%"]})},k.symbol))}),(0,T.jsx)("div",{className:"wp-legend",children:g.map(k=>(0,T.jsxs)("div",{className:"wp-legend-item",children:[(0,T.jsx)("span",{className:"wp-legend-dot",style:{background:k.color}}),(0,T.jsx)("span",{className:"wp-legend-label",children:k.symbol})]},k.symbol))})]})}),(0,T.jsx)("div",{className:"wp-body",children:(0,T.jsxs)("div",{className:"wp-body-inner",children:[(0,T.jsx)(qr,{}),(0,T.jsx)(Kr,{}),(0,T.jsx)(Yr,{}),(0,T.jsx)(Qr,{}),(0,T.jsx)(ri,{})]})})]});return(0,T.jsx)(Yt.Provider,{value:E,children:l==="none"?H:(0,T.jsx)("div",{className:Y(l==="fullscreen"?"wp-fullscreen":"wp-embed",p),"data-theme":t,children:H})})}var Nt=require("react/jsx-runtime");function ai({className:e}){let{env:t,theme:o,walletAddress:n,close:r,sendTransaction:i}=se();return(0,Nt.jsxs)(Qt.Drawer.Portal,{children:[(0,Nt.jsx)(Qt.Drawer.Overlay,{className:"wp-overlay"}),(0,Nt.jsxs)(Qt.Drawer.Content,{className:Y("wp-fullscreen",e),"data-theme":o,children:[(0,Nt.jsx)(Qt.Drawer.Title,{className:"wp-sr-only",children:"My Portfolio"}),(0,Nt.jsx)(Ct,{env:t,theme:o,walletAddress:n,onBack:r,variant:"none",sendTransaction:i})]})]})}var Ro=require("react/jsx-runtime");function Fa({env:e,theme:t="dark",walletAddress:o,open:n,onOpenChange:r,sendTransaction:i,onOutlink:l,children:p}){let m=ue(e),d=n!==void 0,[c,u]=Lt.useState(!1),y=d?n:c,b=Lt.useCallback(h=>{d||u(h),r?.(h)},[d,r]),g=Lt.useCallback(()=>b(!1),[b]),w=Lt.useMemo(()=>({env:m,theme:t,open:y,walletAddress:o,close:g,sendTransaction:i,onOutlink:l}),[m,t,y,o,g,i,l]);return(0,Ro.jsx)(Yt.Provider,{value:w,children:(0,Ro.jsx)(si.Drawer.Root,{direction:"bottom",open:y,onOpenChange:b,noBodyStyles:!0,children:p})})}var Eo=Object.assign(Fa,{Trigger:Ir,Content:ai});var s=require("react/jsx-runtime");function To(e,t,o){let n=fe[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 Da(e){return parseInt(e.split(":")[1],10)}function Wa(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Ba(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 ci({align:e="end",sideOffset:t=12,className:o,children:n}){let{env:r,theme:i,isMobile:l,open:p,drawerDirection:m,modal:d,showBalance:c,showForgeToken:u,showGameToken:y,showQR:b,qrLogoSrc:g,walletAddress:w,accountName:h,sendAccounts:P,profileImageUrl:A,preferredTokens:I,close:N,onSelectWallet:G,onCopyAddress:v,onDisconnect:E,disconnectLabel:H,termsUrl:k,termsLabel:j,privacyUrl:Z,privacyLabel:be,portalStyle:at,navContent:le,navPosition:Ve,footerContent:Re,view:X,setView:Ze,selectedSendToken:Ke,setSelectedSendToken:ge,showPortfolio:Ye,portfolioTitle:xe,showTotalAssets:te,totalAssetsLabel:K,sendTransaction:_e,getTransactionReceipt:ce,estimateGas:Ae,onOutlink:ve}=Je(),{tokens:me,isLoading:ye}=vt(r,w,p&&c),{statsMap:ne}=kt(r,c),{categoryMap:Ee}=Er(r,c),re=c&&te,{displayValue:st,isLowerBound:ke,isLoading:Qe}=Pr(r,w,p&&re),[He,Ge]=V.useState(!1),lt=V.useRef(null),[Te,ze]=V.useState(0),{holdings:Pe,isLoading:Xe}=yr(r,w,p&&c&&u),Ue=V.useMemo(()=>Pe.map(x=>x.token),[Pe]),{imageMap:Se}=kr(r,Ue,u&&Pe.length>0),we=V.useMemo(()=>{let x=[],W=[],$=[],oe=new Map((I??[]).map((B,J)=>[`${Da(B.chainId)}:${B.address.toLowerCase()}`,J]));for(let B of me){let J=To(r,B.chainId,B.symbol)!==void 0,ut=`${B.chainId}:${B.address.toLowerCase()}`,ft=oe.get(ut),zn=new Ot.default(B.quantity.numeric).shiftedBy(-B.quantity.decimals);if(J)x.push(B);else if(ft!==void 0)W.push(B);else if(zn.isGreaterThan(0)){if(!y&&Ee.get(go(B.chainId,B.address))==="game")continue;$.push(B)}}return x.sort((B,J)=>{let ut=To(r,B.chainId,B.symbol)??99,ft=To(r,J.chainId,J.symbol)??99;return ut-ft}),W.sort((B,J)=>{let ut=oe.get(`${B.chainId}:${B.address.toLowerCase()}`)??99,ft=oe.get(`${J.chainId}:${J.address.toLowerCase()}`)??99;return ut-ft}),$.sort((B,J)=>{let ut=ne.get(yt(B.chainId,B.address)),ft=ne.get(yt(J.chainId,J.address)),zn=new Ot.default(B.quantity.numeric).shiftedBy(-B.quantity.decimals).multipliedBy(ut?.price??0);return new Ot.default(J.quantity.numeric).shiftedBy(-J.quantity.decimals).multipliedBy(ft?.price??0).minus(zn).toNumber()}),[...x,...W,...$]},[me,r,ne,y,Ee,I]),Ie=V.useMemo(()=>{if(!u)return[];let x=new Set(me.map(W=>W.address.toLowerCase()));return[...Pe].filter(W=>!x.has(W.token.toLowerCase())).sort((W,$)=>{let oe=new Ot.default(W.value);return new Ot.default($.value).minus(oe).toNumber()})},[Pe,u,me]),Ce=V.useRef(!1),Oe=V.useCallback(x=>{Ce.current=!0,Ze(x)},[Ze]),Hn=V.useCallback(()=>{ge(null),Oe("wallet")},[ge,Oe]),cn=V.useCallback(x=>{ge(x),Oe("send")},[ge,Oe]),dn=V.useCallback(()=>{ge(null),Oe("wallet")},[ge,Oe]);V.useEffect(()=>{p||(Ce.current=!1)},[p]);let pn=V.useRef(null);V.useEffect(()=>{let x=pn.current;if(!x||!l)return;let W=$=>{$.pointerType==="touch"&&$.stopPropagation()};return x.addEventListener("pointerdown",W),()=>x.removeEventListener("pointerdown",W)},[l]);let[ct,dt]=V.useState(!1),Tt=V.useRef(void 0);V.useEffect(()=>()=>clearTimeout(Tt.current),[]),V.useEffect(()=>{let x=lt.current;if(!x||Re===null){ze(0);return}let W=()=>{ze(x.offsetHeight)};if(W(),typeof ResizeObserver>"u")return;let $=new ResizeObserver(W);return $.observe(x),()=>$.disconnect()},[Re]);let mn=V.useCallback(async()=>{if(!ct)try{await navigator.clipboard.writeText(w),dt(!0),clearTimeout(Tt.current),Tt.current=setTimeout(()=>dt(!1),2e3),v?.(w,!0)}catch{v?.(w,!1)}},[w,v,ct]),Wt=V.useCallback(x=>{x.currentTarget.setAttribute("data-loaded","true")},[]),Gn=V.useMemo(()=>({background:Ba(w)}),[w]),Bt=V.useMemo(()=>A||bt(r,w,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[A,r,w,i]),f=V.useMemo(()=>Wa(st),[st]),L=k||Z?(0,s.jsxs)("div",{className:"wi-legal-links",children:[k&&(0,s.jsx)("a",{className:"wi-legal-link",href:k,target:"_blank",rel:"noopener noreferrer",onClick:x=>De(x,k,{category:"terms",origin:"terms"},ve),children:j}),k&&Z&&(0,s.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),Z&&(0,s.jsx)("a",{className:"wi-legal-link",href:Z,target:"_blank",rel:"noopener noreferrer",onClick:x=>De(x,Z,{category:"privacy",origin:"privacy"},ve),children:be})]}):null,M=E?(0,s.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{E(),N()},children:[(0,s.jsx)(Yo,{size:12}),(0,s.jsx)("span",{className:"wi-disconnect-label",children:H})]}):null,S=(0,s.jsxs)("div",{className:Y("wi-view-inner",Ce.current&&"wi-view-wallet"),children:[re&&(()=>{let x=Ye;return(0,s.jsxs)(x?"button":"div",{...x?{type:"button",onClick:()=>Oe("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":x||void 0,children:[(0,s.jsxs)("div",{className:"wi-total-head",children:[(0,s.jsx)("span",{className:"wi-total-label",children:K}),(0,s.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:$=>{$.stopPropagation(),Ge(oe=>!oe)},onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),$.stopPropagation(),Ge(oe=>!oe))},"aria-label":He?"Show balance":"Hide balance",children:He?(0,s.jsx)(nr,{}):(0,s.jsx)(tr,{})})]}),(0,s.jsxs)("div",{className:"wi-total-body",children:[Qe?(0,s.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):(0,s.jsx)("div",{className:"wi-total-value","data-hidden":He||void 0,children:He?(0,s.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,s.jsxs)(s.Fragment,{children:[ke&&(0,s.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,s.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,s.jsx)("span",{className:"wi-total-amount",children:f.main}),f.decimal&&(0,s.jsx)("span",{className:"wi-total-decimal",children:f.decimal})]})}),x&&(0,s.jsx)("span",{className:"wi-total-chevron","aria-hidden":!0,children:(0,s.jsx)(Jo,{size:18})})]})]})})(),Ve==="top"&&le&&(0,s.jsx)("div",{className:"wi-nav-fixed",children:le}),c&&(0,s.jsx)("div",{ref:pn,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,s.jsxs)("div",{className:"wi-token-list",children:[ye&&Array.from({length:5},(x,W)=>(0,s.jsxs)("div",{className:"wi-skeleton-item",children:[(0,s.jsxs)("div",{className:"wi-skeleton-left",children:[(0,s.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,s.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,s.jsxs)("div",{className:"wi-skeleton-right",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},W)),!ye&&we.length===0&&!u&&(0,s.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),we.map(x=>{let W=ne.get(yt(x.chainId,x.address)),$=W?parseFloat(W.percent_change_24h):null,oe=$!==null&&$>=0,B=Xn(r,x.chainId);return(0,s.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>cn(x),"aria-label":`Send ${x.symbol}`,children:[(0,s.jsxs)("div",{className:"wi-token-left",children:[(0,s.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,s.jsx)("img",{src:x.icon_url,alt:x.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Wt,onError:J=>{J.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),B&&(0,s.jsx)("img",{src:B,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:J=>{J.currentTarget.style.display="none"}})]}),(0,s.jsxs)("div",{className:"wi-token-info",children:[(0,s.jsx)("span",{className:"wi-token-name",children:x.symbol}),W&&(0,s.jsxs)("div",{className:"wi-token-price-row",children:[(0,s.jsx)("span",{className:"wi-token-price",children:Yn(W.price)}),(0,s.jsx)("span",{className:"wi-token-change","data-positive":oe,"data-zero":$===0||void 0,children:$!==null&&($===0?"0%":`${oe?"+":"-"}${(oe?Math.floor:Math.ceil)(Math.abs($)*100)/100}%`)})]})]})]}),(0,s.jsxs)("div",{className:"wi-token-right",children:[(0,s.jsx)("span",{className:"wi-token-balance",children:ht(x.quantity.numeric,x.quantity.decimals)}),W&&(0,s.jsx)("span",{className:"wi-token-value",children:jo(x.quantity.numeric,x.quantity.decimals,W.price)})]})]},`${x.address}-${x.chainId}`)}),u&&Xe&&Array.from({length:3},(x,W)=>(0,s.jsxs)("div",{className:"wi-skeleton-item",children:[(0,s.jsxs)("div",{className:"wi-skeleton-left",children:[(0,s.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,s.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,s.jsxs)("div",{className:"wi-skeleton-right",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${W}`)),u&&!Xe&&!ye&&we.length===0&&Ie.length===0&&(0,s.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),u&&Ie.map(x=>{let W=Se.get(x.token)||"",$=Xn(r,fe[r].cross);return(0,s.jsxs)("div",{className:"wi-token-item",children:[(0,s.jsxs)("div",{className:"wi-token-left",children:[(0,s.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,s.jsx)("img",{src:W||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:x.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Wt,onError:oe=>{oe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),$&&(0,s.jsx)("img",{src:$,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:oe=>{oe.currentTarget.style.display="none"}})]}),(0,s.jsxs)("div",{className:"wi-token-info",children:[(0,s.jsx)("span",{className:"wi-token-name",children:x.token_name}),(0,s.jsx)("div",{className:"wi-token-price-row",children:(0,s.jsxs)("span",{className:"wi-token-price",children:[ht(x.current_price,18)," CROSS"]})})]})]}),(0,s.jsxs)("div",{className:"wi-token-right",children:[(0,s.jsx)("span",{className:"wi-token-balance",children:ht(x.balance,18)}),(0,s.jsx)("span",{className:"wi-token-value",children:Yn(x.current_value_usd)})]})]},`forge-${x.token}`)})]})}),Ve==="bottom"&&le&&(0,s.jsx)("div",{className:"wi-nav-fixed",children:le}),M&&(0,s.jsx)("div",{className:"wi-wallet-disconnect-row",children:M})]},"wallet"),z=Ye?(0,s.jsx)("div",{className:Y("wi-view-inner wi-portfolio-body",Ce.current&&"wi-view-portfolio"),children:(0,s.jsx)(Ct,{env:r,theme:i,walletAddress:w,showHeader:!1,sendTransaction:_e,getTransactionReceipt:ce,onOutlink:ve})},"portfolio"):null,ie=Ke?(0,s.jsx)("div",{className:Y("wi-view-inner wi-send-body",Ce.current&&"wi-view-send"),children:(0,s.jsx)(Kt,{env:r,theme:i,walletAddress:w,accountName:h,accounts:P,token:Ke,tokens:we,onTokenChange:ge,sendTransaction:_e,getTransactionReceipt:ce,estimateGas:Ae,onConfirmSuccess:dn,onOutlink:ve})},"send"):null,pt=(0,s.jsx)("div",{className:Y("wi-view-inner wi-qr-body",Ce.current&&"wi-view-qr"),children:(0,s.jsxs)("div",{className:"wi-qr-section",children:[(0,s.jsxs)("div",{className:"wi-qr-card",children:[(0,s.jsxs)("div",{className:"wi-qr-code",children:[(0,s.jsx)(li.QRCodeSVG,{value:w,size:180,level:"H",marginSize:2,...g&&{imageSettings:{src:g,height:33,width:33,excavate:!0}}}),!g&&(0,s.jsx)("div",{className:"wi-qr-logo",children:(0,s.jsx)(or,{size:33})})]}),(0,s.jsx)("p",{className:"wi-qr-address",children:w}),(0,s.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:mn,children:[(0,s.jsx)("span",{className:"wi-qr-copy-icon",children:ct?(0,s.jsx)(jt,{size:16}):(0,s.jsx)(Jn,{size:16})}),(0,s.jsx)("span",{className:"wi-qr-copy-text",children:ct?"Copied!":"Copy address"})]})]}),L]})},"qr"),de=X==="qr"||X==="portfolio"||X==="send",mt=Re!==null?(0,s.jsx)("div",{className:"wi-builtin-footer",children:Re}):null,$t=!!G&&h?.trim().toLowerCase()!=="my wallet",Vt=(0,s.jsxs)("div",{className:"wi-account-text",children:[$t?(0,s.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:G,"aria-label":"Switch account",children:[(0,s.jsx)("span",{className:"wi-account-name",children:h??"Account 1"}),(0,s.jsx)("span",{className:"wi-account-switch","aria-hidden":"true",children:(0,s.jsx)(er,{size:12})})]}):(0,s.jsx)("div",{className:"wi-account-row",children:(0,s.jsx)("span",{className:"wi-account-name",children:h??"Account 1"})}),(0,s.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:mn,"aria-label":"Copy address",children:[(0,s.jsx)("span",{className:"wi-account-address",children:Ne(w)}),(0,s.jsx)("span",{className:"wi-account-copy",children:ct?(0,s.jsx)(jt,{size:14}):(0,s.jsx)(Jn,{size:14})})]})]}),fn=(0,s.jsxs)(s.Fragment,{children:[n,de?(0,s.jsxs)("div",{className:"wi-sticky-header",children:[(0,s.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,s.jsx)("button",{type:"button",className:"wi-header-back",onClick:Hn,"aria-label":"Back",children:(0,s.jsx)(Xo,{})}),(0,s.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:Vt}),(0,s.jsx)("button",{type:"button",className:"wi-header-action",onClick:N,"aria-label":"Close",children:(0,s.jsx)(eo,{size:24})})]}),(0,s.jsx)("hr",{className:"wi-divider"})]}):(0,s.jsxs)("div",{className:"wi-sticky-header",children:[(0,s.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,s.jsxs)("div",{className:"wi-account-block",children:[(0,s.jsxs)("div",{className:"wi-avatar",children:[(0,s.jsx)("div",{className:"wi-avatar-fallback",style:Gn}),Bt&&(0,s.jsx)("img",{src:Bt,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:Wt,onError:x=>{x.currentTarget.style.display="none"}})]}),Vt]}),(0,s.jsxs)("div",{className:"wi-header-actions",children:[b&&(0,s.jsx)("button",{type:"button",className:"wi-header-action",onClick:()=>Oe("qr"),"aria-label":"Show QR code",children:(0,s.jsx)(Qo,{size:20})}),(0,s.jsx)("button",{type:"button",className:"wi-header-action",onClick:N,"aria-label":"Close",children:(0,s.jsx)(eo,{size:24})})]})]}),(0,s.jsx)("hr",{className:"wi-divider"})]}),(0,s.jsxs)("div",{className:"wi-view-container",children:[X==="wallet"&&S,X==="qr"&&pt,X==="portfolio"&&z,X==="send"&&ie]}),mt&&X!=="portfolio"&&X!=="send"&&(0,s.jsx)("div",{className:"wi-sticky-footer",children:(0,s.jsx)("div",{className:"wi-footer",ref:lt,children:mt})})]}),Pt={...at,...Te>0?{"--wi-footer-height":`${Te}px`}:null};return l?(0,s.jsxs)(Xt.Drawer.Portal,{children:[d&&(0,s.jsx)(Xt.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,s.jsxs)(Xt.Drawer.Content,{className:Y("wi-drawer-content",o),"data-theme":i,style:Pt,"data-direction":m,"data-no-balance":!c||void 0,"data-has-footer":Te>0||void 0,"data-view":X,children:[(0,s.jsx)(Xt.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),fn]})]}):(0,s.jsxs)(s.Fragment,{children:[d&&p&&(0,s.jsx)("div",{className:"wi-drawer-overlay",onClick:N}),(0,s.jsx)(Fn.Portal,{children:(0,s.jsx)(Fn.Content,{align:e,sideOffset:t,className:Y("wi-popover-content",o),"data-theme":i,style:Pt,"data-no-balance":!c||void 0,"data-has-footer":Te>0||void 0,"data-view":X,children:fn})})]})}var di=U(require("react"),1);function pi({position:e="top",children:t}){let{setNavContent:o,setNavPosition:n}=Je();return di.useEffect(()=>(o(t),n(e),()=>o(null)),[t,e,o,n]),null}var mi=U(require("react"),1);function ui({children:e}){let{setFooterContent:t}=Je();return mi.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}O(`[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
- `);O(`.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
- `);O(`@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
- `);O(`.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
- `);O(`.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
- `);var Dn=require("react/jsx-runtime"),$a="https://terms.crosstoken.io/docs/cross-terms-of-use",Va="https://terms.crosstoken.io/docs/nexus-privacy-policy";function Ha({env:e,theme:t="dark",mobileBreakpoint:o=768,drawerDirection:n,modal:r,showBalance:i=!1,showForgeToken:l=!1,showGameToken:p=!0,showQR:m=!0,qrLogoSrc:d,walletAddress:c,accountName:u,sendAccounts:y,profileImageUrl:b,connectorId:g,connectorName:w,connectorIconUrl:h,preferredTokens:P=[],onSelectWallet:A,onCopyAddress:I,onDisconnect:N,disconnectLabel:G="Disconnect",termsUrl:v=$a,termsLabel:E="Terms of Service",privacyUrl:H=Va,privacyLabel:k="Privacy Policy",open:j,onOpenChange:Z,showPortfolio:be=!1,portfolioTitle:at="My Portfolio",showTotalAssets:le=!0,totalAssetsLabel:Ve="Total Assets USD",sendTransaction:Re,getTransactionReceipt:X,estimateGas:Ze,onOutlink:Ke,style:ge,children:Ye}){let xe=ue(e),te=g?Ut[g]:void 0,K=w??te?.name,_e=h??te?.iconUrl,ce=St(`(max-width: ${o}px)`),Ae=n??(i?"right":"bottom"),ve=r??!1,me=j!==void 0,[ye,ne]=pe.useState(!1),Ee=me?j:ye,re=pe.useCallback(Ie=>{me||ne(Ie),Z?.(Ie)},[me,Z]),st=pe.useCallback(()=>re(!1),[re]),[ke,Qe]=pe.useState(null),[He,Ge]=pe.useState("top"),[lt,Te]=pe.useState(null),[ze,Pe]=pe.useState("wallet"),[Xe,Ue]=pe.useState(null);pe.useEffect(()=>{Ee||(Pe("wallet"),Ue(null))},[Ee]);let Se=pe.useCallback(()=>{io(c),N?.()},[N,c]),we=pe.useMemo(()=>({env:xe,theme:t,isMobile:ce,open:Ee,drawerDirection:Ae,modal:ve,showBalance:i,showForgeToken:l,showGameToken:p,showQR:m,qrLogoSrc:d,walletAddress:c,accountName:u,sendAccounts:y,profileImageUrl:b,connectorName:K,connectorIconUrl:_e,preferredTokens:P,close:st,onSelectWallet:A,onCopyAddress:I,onDisconnect:N?Se:void 0,disconnectLabel:G,termsUrl:v,termsLabel:E,privacyUrl:H,privacyLabel:k,portalStyle:ge,navContent:ke,navPosition:He,setNavContent:Qe,setNavPosition:Ge,footerContent:lt,setFooterContent:Te,view:ze,setView:Pe,selectedSendToken:Xe,setSelectedSendToken:Ue,showPortfolio:be,portfolioTitle:at,showTotalAssets:le,totalAssetsLabel:Ve,sendTransaction:Re,getTransactionReceipt:X,estimateGas:Ze,onOutlink:Ke}),[xe,t,ce,Ee,Ae,ve,i,l,p,m,d,c,u,y,b,K,_e,P,st,A,I,N,Se,G,v,E,H,k,ge,ke,He,lt,ze,Xe,be,at,le,Ve,Re,X,Ze,Ke]);return(0,Dn.jsx)(Kn.Provider,{value:we,children:ce?(0,Dn.jsx)(gi.Drawer.Root,{direction:Ae,open:Ee,onOpenChange:re,noBodyStyles:!0,repositionInputs:!1,children:Ye},"drawer"):(0,Dn.jsx)(fi.Root,{open:Ee,onOpenChange:re,children:Ye},"popover")})}var Rt=Object.assign(Ha,{Trigger:hr,Content:ci,Nav:pi,Footer:ui});var qe=U(require("react"),1),Ri=U(require("@radix-ui/react-dialog"),1),Ei=require("vaul");var Wn=require("react"),Bn=(0,Wn.createContext)(null);function Jt(){let e=(0,Wn.useContext)(Bn);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var Et=require("react");function en(){let[e,t]=(0,Et.useState)([]),[o,n]=(0,Et.useState)(!0);(0,Et.useEffect)(()=>{if(typeof window>"u"){n(!1);return}let i=[],l=m=>{let{info:d}=m.detail;d?.rdns&&!i.some(c=>c.rdns===d.rdns)&&(i.push({rdns:d.rdns,name:d.name,icon:d.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",l),window.addEventListener("eip6963:crossAnnounceProvider",l),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let p=setTimeout(()=>n(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",l),window.removeEventListener("eip6963:crossAnnounceProvider",l),clearTimeout(p)}},[]);let r=(0,Et.useCallback)(i=>e.some(l=>l.rdns===i),[e]);return{wallets:e,isDetected:r,isLoading:o}}var wi=U(require("@radix-ui/react-dialog"),1),hi=require("vaul");var Po=require("react/jsx-runtime");function bi({asChild:e,children:t}){let{isMobile:o}=Jt(),n=o?hi.Drawer.Trigger:wi.Trigger;return(0,Po.jsx)(n,{asChild:e??t!=null,children:t??(0,Po.jsx)("button",{type:"button",children:"Connect Wallet"})})}var rt=U(require("@radix-ui/react-dialog"),1),tn=require("vaul");var F=require("react/jsx-runtime");function $n(){return(0,F.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,F.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,F.jsx)("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 xi(){return(0,F.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,F.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,F.jsx)("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"}),(0,F.jsx)("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"}),(0,F.jsx)("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"}),(0,F.jsx)("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"}),(0,F.jsx)("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"}),(0,F.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,F.jsx)("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"})]}),(0,F.jsx)("defs",{children:(0,F.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,F.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function vi(){return(0,F.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,F.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,F.jsx)("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"}),(0,F.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,F.jsx)("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 yi(){return(0,F.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,F.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,F.jsx)("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"}),(0,F.jsx)("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"})]}),(0,F.jsx)("defs",{children:(0,F.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,F.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function ki(){return(0,F.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,F.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Vn={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:$n,featured:!0},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:$n},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:$n,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:xi,rdns:"io.metamask"},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:vi,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:yi,badge:"For SHOP"}};function Ft(e){return Vn[e]}var C=require("react/jsx-runtime");function Ci({wallet:e,detected:t,onConnect:o}){let n=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}o()},r=e.icon;return(0,C.jsxs)("button",{type:"button",className:"wcm-wallet-item",onClick:n,children:[(0,C.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,C.jsx)("div",{className:"wcm-wallet-icon",children:(0,C.jsx)(r,{})}),(0,C.jsxs)("div",{className:"wcm-wallet-info",children:[(0,C.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,C.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,C.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]}),(0,C.jsx)("span",{className:"wcm-wallet-desc",children:e.description})]})]}),e.installUrl&&(t?(0,C.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,C.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function Ni(){let{wallets:e,activeWalletIds:t,isDetected:o,close:n,isMobile:r}=Jt(),i=t.filter(m=>{let d=Ft(m).visibility;return!d||d==="always"?!0:d==="desktop-only"?!r:d==="mobile-only"?r:!0}),l=i.filter(m=>Ft(m).featured),p=i.filter(m=>!Ft(m).featured);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{className:"wcm-header",children:[(0,C.jsxs)("div",{className:"wcm-header-text",children:[(0,C.jsx)("h2",{className:"wcm-title",children:"Connect Wallet"}),(0,C.jsx)("p",{className:"wcm-subtitle",children:"Connect with one of our available wallet providers to continue."})]}),(0,C.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:n,children:(0,C.jsx)(ki,{})})]}),(0,C.jsx)("div",{className:"wcm-divider"}),(0,C.jsxs)("div",{className:"wcm-body",children:[l.map(m=>{let d=Ft(m),c=d.rdns?o(d.rdns):!1;return(0,C.jsx)(Ci,{wallet:d,detected:c,onConnect:()=>{e[m]?.(),n()}},m)}),l.length>0&&p.length>0&&(0,C.jsxs)("div",{className:"wcm-separator",children:[(0,C.jsx)("div",{className:"wcm-separator-line"}),(0,C.jsx)("span",{className:"wcm-separator-text",children:"or"}),(0,C.jsx)("div",{className:"wcm-separator-line"})]}),(0,C.jsx)("div",{className:"wcm-wallet-list",children:p.map(m=>{let d=Ft(m),c=d.rdns?o(d.rdns):!1;return(0,C.jsx)(Ci,{wallet:d,detected:c,onConnect:()=>{e[m]?.(),n()}},m)})}),(0,C.jsxs)("div",{className:"wcm-help",children:[(0,C.jsx)("p",{className:"wcm-help-title",children:"Wallet not detected?"}),(0,C.jsxs)("ul",{className:"wcm-help-list",children:[(0,C.jsx)("li",{children:"Ensure your wallet extension is installed and unlocked"}),(0,C.jsx)("li",{children:"Try refreshing the page"}),(0,C.jsx)("li",{children:"Some wallets may require you to first open the extension"}),(0,C.jsx)("li",{children:"You can try clicking the wallet anyway"})]})]}),(0,C.jsx)("div",{className:"wcm-divider"}),(0,C.jsx)("p",{className:"wcm-terms",children:"By connecting your wallet and accessing this service, you acknowledge and agree to be bound by the applicable terms and conditions."})]})]})}function Li({className:e}){let{isMobile:t,theme:o,portalStyle:n}=Jt();return t?(0,C.jsxs)(tn.Drawer.Portal,{children:[(0,C.jsx)(tn.Drawer.Overlay,{className:"wcm-overlay"}),(0,C.jsxs)(tn.Drawer.Content,{className:Y("wcm-drawer-content",e),"data-theme":o,style:n,children:[(0,C.jsx)(tn.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,C.jsx)("div",{className:"wcm-drawer-handle"}),(0,C.jsx)("div",{className:"wcm-drawer-body",children:(0,C.jsx)(Ni,{})})]})]}):(0,C.jsxs)(rt.Portal,{children:[(0,C.jsx)(rt.Overlay,{className:"wcm-overlay"}),(0,C.jsxs)(rt.Content,{className:Y("wcm-dialog-content",e),"data-theme":o,style:n,children:[(0,C.jsx)(rt.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,C.jsx)("div",{className:"wcm-dialog-body",children:(0,C.jsx)(Ni,{})})]})]})}O(`[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
- `);O(`.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:4px 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-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%;padding:16px;background:var(--wcm-surface-default);border:1px solid transparent;border-radius:20px;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:40px;height:40px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg{width:40px;height:40px}.wcm-wallet-info{display:flex;flex-direction:column;justify-content:center;min-width:0}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px}.wcm-wallet-name{font-family:inherit;font-weight:700;font-size:18px;line-height:1.3;color:var(--wcm-texticon-primary);white-space:nowrap}.wcm-wallet-desc{font-family:inherit;font-weight:400;font-size:14px;line-height:1.4;color:var(--wcm-texticon-secondary)}.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-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-help{display:flex;flex-direction:column;gap:4px}.wcm-help-title{font-family:inherit;font-weight:600;font-size:14px;line-height:1.4;color:var(--wcm-texticon-primary);margin:0}.wcm-help-list{list-style:none;padding:0;margin:0}.wcm-help-list li{display:flex;align-items:center;gap:8px;font-family:inherit;font-weight:400;font-size:14px;line-height:1.4;color:var(--wcm-texticon-secondary)}.wcm-help-list li:before{content:"";display:block;flex-shrink:0;width:4px;height:4px;min-width:4px;min-height:4px;background:var(--wcm-texticon-secondary)}.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
- `);O(`@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
- `);var Dt=require("react/jsx-runtime");function Ga({wallets:e,theme:t="dark",mobileBreakpoint:o=768,drawerDirection:n="bottom",dialogWidth:r,drawerMaxWidth:i,drawerMinWidth:l,style:p,open:m,onOpenChange:d,children:c}){let u=St(`(max-width: ${o}px)`),[y,b]=qe.useState(!1),g=m!==void 0,w=g?m:y,h=qe.useCallback(E=>{g||b(E),d?.(E)},[g,d]),P=qe.useCallback(()=>h(!1),[h]),{isDetected:A}=en(),I=qe.useMemo(()=>Object.keys(e),[e]),N=qe.useMemo(()=>{let E={};return r&&(E["--wcm-dialog-width"]=r),i&&(E["--wcm-drawer-max-width"]=i),l&&(E["--wcm-drawer-min-width"]=l),{...E,...p}},[r,i,l,p]),G=qe.useMemo(()=>({theme:t,isMobile:u,open:w,setOpen:h,close:P,wallets:e,activeWalletIds:I,isDetected:A,portalStyle:N}),[t,u,w,h,P,e,I,A,N]),v=(0,Dt.jsx)("div",{"data-theme":t,style:N,children:c});return u?(0,Dt.jsx)(Bn.Provider,{value:G,children:(0,Dt.jsx)(Ei.Drawer.Root,{direction:n,open:w,onOpenChange:h,noBodyStyles:!0,children:v},"drawer")}):(0,Dt.jsx)(Bn.Provider,{value:G,children:(0,Dt.jsx)(Ri.Root,{open:w,onOpenChange:h,children:v})})}var So=Object.assign(Ga,{Trigger:bi,Content:Li});var za='<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>',Ua='<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>',ja='<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>',qa='<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>',Za='<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 nn(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var on=nn(za),rn=nn(Ua),an=nn(ja),sn=nn(qa),ln=nn(Za);var he=require("react/jsx-runtime");function Io({isConnecting:e,address:t,provider:o,providerName:n,accountName:r,sendAccounts:i,onConnect:l,onDisconnect:p,onCopy:m,onSelectWallet:d,label:c="Connect Wallet",connectingLabel:u="Connecting...",disconnectLabel:y,className:b,theme:g="dark",env:w,showBalance:h=!0,showPortfolio:P,drawerDirection:A,modal:I,connectorId:N,style:G,sendTransaction:v,getTransactionReceipt:E,estimateGas:H}){if(e)return(0,he.jsxs)("button",{type:"button",disabled:!0,className:b,style:b?void 0:{...it.button,...it.buttonLoading},"aria-busy":"true",children:[(0,he.jsx)("style",{children:Xa}),(0,he.jsx)("span",{style:it.spinner,"aria-hidden":"true"}),u]});if(t){let k=n??Qa(o),j=o?Ka[o]:void 0;return(0,he.jsxs)(Rt,{env:w,theme:g,drawerDirection:A,modal:I,showBalance:h,showPortfolio:P,walletAddress:t,accountName:r,sendAccounts:i,connectorId:N,onSelectWallet:d,onCopyAddress:m?(Z,be)=>{be&&m()}:void 0,onDisconnect:p,disconnectLabel:y,style:G,sendTransaction:v,getTransactionReceipt:E,estimateGas:H,children:[(0,he.jsx)(Rt.Trigger,{asChild:!0,children:(0,he.jsxs)("button",{type:"button",className:b,style:b?void 0:it.connectedBtn,"aria-label":`Connected with ${k}: ${Ti(t)}`,children:[j?(0,he.jsx)("img",{src:j,alt:"",width:20,height:20,style:it.connectedIcon}):(0,he.jsx)("span",{style:it.connectedIconPlaceholder,"aria-hidden":"true"}),(0,he.jsx)("span",{style:it.connectedAddress,children:Ti(t)})]})}),(0,he.jsx)(Rt.Content,{align:"end",sideOffset:8})]})}return(0,he.jsx)("button",{type:"button",onClick:l,className:b,style:b?void 0:it.button,children:c})}var Ka={google:sn,apple:ln,cross:on,metamask:rn,binance:an},Ya={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Qa(e){return e?Ya[e]:"Wallet"}function Ti(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Xa="@keyframes cross-cb-spin{to{transform:rotate(360deg)}}",it={button:{padding:"10px 24px",borderRadius:"12px",border:"none",background:"#00D5AA",color:"#000",fontWeight:700,fontSize:"14px",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.15s",fontFamily:"inherit"},buttonLoading:{opacity:.7,cursor:"default"},spinner:{display:"inline-block",width:"14px",height:"14px",border:"2px solid #00000030",borderTopColor:"#000",borderRadius:"50%",animation:"cross-cb-spin 0.6s linear infinite"},connectedBtn:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"8px 14px",borderRadius:"999px",border:"1px solid var(--wi-border-default, #2a2d3a)",background:"var(--wi-surface-default, #1e232e)",color:"var(--wi-texticon-primary, #ffffff)",fontWeight:600,fontSize:"14px",cursor:"pointer",fontFamily:"inherit"},connectedIcon:{width:"20px",height:"20px",borderRadius:"50%",objectFit:"contain",flexShrink:0,background:"transparent"},connectedIconPlaceholder:{display:"inline-block",width:"20px",height:"20px",borderRadius:"50%",background:"var(--wi-surface-subtle, #2a2d3a)",flexShrink:0},connectedAddress:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"13px",letterSpacing:"0.02em"}};0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,GOOGLE_ICON,METAMASK_ICON,SendPage,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});
1
+ "use strict";var Fi=Object.create;var mn=Object.defineProperty;var Di=Object.getOwnPropertyDescriptor;var Wi=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty;var $i=(e,t)=>{for(var o in t)mn(e,o,{get:t[o],enumerable:!0})},_o=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Wi(t))!zi.call(e,r)&&r!==o&&mn(e,r,{get:()=>t[r],enumerable:!(n=Di(t,r))||n.enumerable});return e};var U=(e,t,o)=>(o=e!=null?Fi(Bi(e)):{},_o(t||!e||!e.__esModule?mn(o,"default",{value:e,enumerable:!0}):o,e)),Vi=e=>_o(mn({},"__esModule",{value:!0}),e);var ps={};$i(ps,{APPLE_ICON:()=>rn,AppLauncher:()=>qn,AppLauncherContent:()=>Yn,AppLauncherTrigger:()=>Zn,BINANCE_ICON:()=>nn,CONNECTOR_REGISTRY:()=>Vt,CROSSX_ICON:()=>en,ConnectButton:()=>Mo,ConnectorId:()=>bn,GOOGLE_ICON:()=>on,METAMASK_ICON:()=>tn,SOCIAL_REGISTRY:()=>Vn,SendPage:()=>Ut,TOKEN_STATS_QUERY_KEY:()=>Nn,USER_BALANCE_QUERY_KEY:()=>kn,WALLET_REGISTRY:()=>$n,WalletConnectModal:()=>To,WalletInfo:()=>Ct,WalletPortfolio:()=>Eo,WalletPortfolioBody:()=>vt,resolveEnvironment:()=>fe,useGlobalMenu:()=>$t,useTokenBalance:()=>wt,useTokenStats:()=>xt,useWalletDetect:()=>Qt});module.exports=Vi(ps);function fe(e){if(e)return Oo(e);let t=typeof process<"u"?process.env?.NEXT_PUBLIC_CROSSX_ENVIRONMENT:void 0;return Oo(t)}function Oo(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var Pt=U(require("react"),1),Fo=U(require("@radix-ui/react-popover"),1),Do=require("vaul");var fn=require("react"),Un=(0,fn.createContext)(null);function un(){let e=(0,fn.useContext)(Un);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var gn=require("react");function Et(e){let[t,o]=(0,gn.useState)(!1);return(0,gn.useEffect)(()=>{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 F(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))}F(`[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
+ `);F(`.al-trigger-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border:none;background:transparent;border-radius:8px;cursor:pointer;transition:background-color .15s ease}.al-trigger-btn[data-theme=dark]{color:#edf1f3}.al-trigger-btn[data-theme=light]{color:#1e232e}
3
+ `);F(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
+ `);F(`.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
+ `);F("");var wn=require("react/jsx-runtime");function qn({env:e,theme:t="dark",mobileBreakpoint:o=768,domain:n,children:r}){let i=Et(`(max-width: ${o}px)`),[c,d]=Pt.useState(!1),m=Pt.useCallback(()=>d(!1),[]),p=fe(e),l=Pt.useMemo(()=>({env:p,theme:t,isMobile:i,open:c,domain:n,close:m}),[p,t,i,c,n,m]);return(0,wn.jsx)(Un.Provider,{value:l,children:i?(0,wn.jsx)(Do.Drawer.Root,{direction:"right",open:c,onOpenChange:d,noBodyStyles:!0,children:r},"drawer"):(0,wn.jsx)(Fo.Root,{open:c,onOpenChange:d,children:r},"popover")})}var $o=U(require("@radix-ui/react-popover"),1),Vo=require("vaul");var ae=require("react/jsx-runtime");function Wo({size:e=18}){return(0,ae.jsxs)("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,ae.jsx)("rect",{width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),(0,ae.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function Bo(){return(0,ae.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ae.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function zo(){return(0,ae.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ae.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var zt=require("react/jsx-runtime");function Zn({asChild:e,children:t}){let{isMobile:o,theme:n}=un(),r=t!=null,i=e??!0,c=r?t:(0,zt.jsx)("button",{type:"button",className:"al-trigger-btn","data-theme":n,children:(0,zt.jsx)(Wo,{size:o?12:18})});return o?(0,zt.jsx)(Vo.Drawer.Trigger,{asChild:i,children:c}):(0,zt.jsx)($o.Trigger,{asChild:i,children:c})}var mt=U(require("react"),1),hn=U(require("@radix-ui/react-popover"),1),pt=require("vaul");var Go=require("@tanstack/react-query");var Ho={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 Hi="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",ji="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Fe(e,t){return`${e==="production"?ji:Hi}/${t}.png`}function jo(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:"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 $t(e){let t=fe(e);return(0,Go.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:o})=>{try{let n=await fetch(Ho[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 jo(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function X(...e){return e.filter(Boolean).join(" ")}var Y=require("react/jsx-runtime");function Gi(e){return e.id==="cross-staking"||e.type==="cross-staking"}function Yn({align:e="end",sideOffset:t=12,className:o}){let{env:n,theme:r,isMobile:i,domain:c,close:d}=un(),{data:m}=$t(n),p=mt.useMemo(()=>(m?.items??[]).sort((w,L)=>w.order-L.order),[m]),l=8,f=mt.useRef(null),x=mt.useCallback(w=>{f.current={x:w.clientX,y:w.clientY}},[]),h=typeof window<"u"?window.location.pathname:"",y=mt.useCallback((w,L)=>{if(f.current){let N=w.clientX-f.current.x,H=w.clientY-f.current.y;if(f.current=null,Math.abs(N)>l||Math.abs(H)>l)return}let M=L.url[n]??L.url.production,T=Uo(M,c);if(!T)try{let N=new URL(M).pathname;if(h===N||h.startsWith(N+"/")){d();return}}catch{}T?window.open(M,"_blank","noopener,noreferrer"):window.location.href=M,d()},[n,c,d,h]),g=(0,Y.jsx)("div",{className:"al-grid","data-theme":r,children:p.map(w=>{let L=w.url[n]??w.url.production,M=Uo(L,c),T=!1;if(!M)try{let N=new URL(L).pathname;T=h===N||h.startsWith(N+"/")}catch{T=!1}return(0,Y.jsxs)("button",{type:"button",className:"al-grid-item","data-active":T||void 0,onPointerDown:x,onClick:N=>y(N,w),children:[(0,Y.jsxs)("div",{className:"al-grid-item-left",children:[(0,Y.jsx)("div",{className:"al-grid-item-icon",children:(0,Y.jsx)("img",{src:w.iconUrl,alt:w.label,width:24,height:24,loading:"lazy"})}),(0,Y.jsx)("span",{className:"al-grid-item-label",children:w.label}),w.isNew&&(0,Y.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,Y.jsx)("div",{className:"al-grid-item-right",children:w.badge&&!Gi(w)&&(0,Y.jsx)("span",{className:"al-badge",children:w.badge})})]},w.id)})});return i?(0,Y.jsxs)(pt.Drawer.Portal,{children:[(0,Y.jsx)(pt.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,Y.jsxs)(pt.Drawer.Content,{className:X("al-drawer-content",o),"data-theme":r,children:[(0,Y.jsxs)("div",{className:"al-drawer-header",children:[(0,Y.jsx)(pt.Drawer.Close,{className:"al-drawer-close",children:(0,Y.jsx)(Bo,{})}),(0,Y.jsx)(pt.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,Y.jsx)(pt.Drawer.Close,{className:"al-drawer-close",children:(0,Y.jsx)(zo,{})})]}),(0,Y.jsx)("div",{className:"al-drawer-body",children:g})]})]}):(0,Y.jsx)(hn.Portal,{children:(0,Y.jsx)(hn.Content,{align:e,sideOffset:t,className:X("al-popover-content",o),"data-theme":r,children:g})})}function Uo(e,t){try{let o=new URL(e).hostname;return typeof window>"u"?!0:o!==(t??window.location.hostname)}catch{return!1}}var de=U(require("react"),1),wi=U(require("@radix-ui/react-popover"),1),hi=require("vaul");var xn=require("react"),Kn=(0,xn.createContext)(null);function Qe(){let e=(0,xn.useContext)(Kn);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var bn=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(bn||{}),Vt={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"}};var E=U(require("react"),1);var Xe=U(require("bignumber.js"),1);function Ui(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 ft(e,t){if(!e||e==="0")return"0.00";let o=new Xe.default(e).shiftedBy(-t),n=o.isGreaterThanOrEqualTo(1)?2:4;return o.toFormat(n,Xe.default.ROUND_DOWN)}function Le(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Qn(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 qo(e,t,o){let r=new Xe.default(e).shiftedBy(-t).multipliedBy(new Xe.default(o));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(Xe.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,Xe.default.ROUND_DOWN):r.decimalPlaces(4,Xe.default.ROUND_DOWN)).toFormat()}`}function Zo(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 c=Number(o);if(!Number.isFinite(c)||c===0)return{displayValue:"0",isLowerBound:!1};o=Ui(c.toFixed(18))}let[n="0",r=""]=o.split(".");if(Number(n)>=1){let c=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${c}`,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 Re={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},ue={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var Xn={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"},Yo={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Jn(e,t){let o=ue[e];if(t===o.cross)return Yo.cross;if(t===o.bsc)return Yo.bsc}var qi={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function ut(e,t,o={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:r,format:i="png"}=o,c=qi[e],d=r?`&bg=${r}`:"";return`${c}/portrait/evm/${t}.${i}?size=${n}${d}`}var D=require("react/jsx-runtime");function Ko({size:e=16,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("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"}),(0,D.jsx)("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 eo({size:e=16,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("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 Ht({size:e=16,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function to({size:e=24,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Qo({size:e=20,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("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"}),(0,D.jsx)("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 Xo({size:e=20,className:t}){return(0,D.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,D.jsx)("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 Jo({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function er({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function tr({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function nr({size:e=16,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("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"}),(0,D.jsx)("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 or({size:e=16,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("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"}),(0,D.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function rr({size:e=42,className:t}){return(0,D.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,D.jsx)("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})})}var ir=require("react"),ar=require("@tanstack/react-query");var Zi="send:chain-info";function Yi(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 no(e,...t){let o=e.replace(/\/+$/,""),n=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[o,...n].join("/")}function Ki(e,t,o,n){if(n)return t===ue[e].cross?sr(t,n):o?.explorer_url?no(o.explorer_url,o.explorer_postfix?.transaction??"tx",n):Qi(e,t,n)}function sr(e,t){return no("https://explorer.crosstoken.io",String(e),"tx",t)}function Qi(e,t,o){let n=ue[e];if(t===n.cross)return sr(t,o);if(t===n.bsc)return no(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",o)}function lr(e,t,o,n=!0){let r=Re[e],i=(0,ar.useQuery)({queryKey:[Zi,e,t],queryFn:async({signal:m})=>{let p=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:m});if(!p.ok)throw new Error(`Failed to fetch chain info: ${p.status}`);let l=await p.json();if("code"in l&&l.code!==void 0&&l.code!==200)throw new Error(`Chain info API error: ${l.code}`);return Yi(l)},enabled:n,staleTime:300*1e3}),c=i.data;return{transactionUrl:(0,ir.useMemo)(()=>Ki(e,t,c,o),[t,c,e,o]),chainInfo:c,...i}}var cr="0x0000000000000000000000000000000000000001";var Xi="0xa9059cbb",Ji=/^0x[a-fA-F0-9]{40}$/,ea="nexus-cross:dapp-ui:send:recent:",dr=10;function ta(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function jt(e){return e.toLowerCase()}function Gt(e){return Ji.test(e)}function oo(e){return jt(e.address)===cr}function ro(e){return`${ea}${e.toLowerCase()}`}function St(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(ro(e));if(!t)return[];let o=JSON.parse(t);return Array.isArray(o)?o.filter(n=>n!==null&&typeof n=="object"&&Gt(n.address)&&typeof n.updatedAt=="number").slice(0,dr):[]}catch{return[]}}function io(e,t){if(typeof window>"u")return[];let o=jt(t),n=[{address:o,updatedAt:Date.now()},...St(e).filter(r=>r.address!==o)].slice(0,dr);try{window.localStorage.setItem(ro(e),JSON.stringify(n))}catch{return St(e)}return n}function ao(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(ro(e))}catch{}}function so(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"),c=r.padEnd(t,"0"),d=c?BigInt(c):0n,m=10n**BigInt(t),p=i*m+d;return p<=0n?{error:"Amount must be greater than 0."}:{value:p}}function lo(e,t){let o=BigInt(e||"0"),n=10n**BigInt(t),r=o/n,i=o%n;if(i===0n)return r.toString();let c=ta(i.toString().padStart(t,"0"));return`${r.toString()}.${c}`}function co(e,t){let o=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${Xi}${o}${n}`}var na=2000000000n,oa=1000000000n;async function vn(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 yn(e){return BigInt(e)}function ra(e){return`0x${e.toString(16)}`}function ia(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=ra(e.value)),e.data&&(t.data=e.data),t}function aa(e){return e===56||e===97}async function pr(e){try{let t=await vn(e,"eth_gasPrice",[]);return{gasPrice:yn(t)}}catch{return{gasPrice:na}}}async function sa(e,t){let o=oa;try{let n=await vn(e,"eth_maxPriorityFeePerGas",[]);o=yn(n)}catch{}return{maxFeePerGas:t+o,maxPriorityFeePerGas:o}}async function la(e,t){if(t)return pr(e);let o;try{o=(await vn(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return o?sa(e,yn(o)):pr(e)}async function mr(e,t){let o=aa(t.chainId),n=ia(t),[r,i]=await Promise.all([vn(e,"eth_estimateGas",[n]),la(e,o)]);return{gasLimit:yn(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function fr(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(fr(o.cause,t+1)),n.join(`
6
+ `).toLowerCase()}function ca(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 po(e,t={},o="Failed to send transaction."){let n=fr(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 c=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.":ca(e)||o}F(`.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
+ `);var a=require("react/jsx-runtime"),da=1500,pa=120;function mo(e){return`${e.chainId}:${e.address.toLowerCase()}`}function ur(e,t){return e.name||`Account ${(e.index??t)+1}`}function gr(e){return e.trim().slice(0,1).toUpperCase()||"A"}function ma(e){return new Promise(t=>setTimeout(t,e))}function fa(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}function ua(e){return!!(e.token||e.recipient||e.amount)}function go(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 d=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(o,t)));return d=d.replace(/0+$/,""),d?`${r.toString()}.${d}`:r.toString()}function fo(e,t){return go(e,t,6)}function uo(e){return go(e,9,2)}function ga(e){return e.toLocaleString("en-US")}function wa(e){return e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function ha(e){return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function xa(){return(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("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"}),(0,a.jsx)("path",{d:"M4.5 14.5C4.5 13.67 5.17 13 6 13h9.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),(0,a.jsx)("path",{d:"M8 6.5h4M8 9h3",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function ba(){return(0,a.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--wi-primary)"}),(0,a.jsx)("path",{d:"M17 28.5L24.2 35.5L39 20.5",stroke:"var(--wi-primary-contrast, #001410)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ut({env:e,theme:t="dark",walletAddress:o,accountName:n,accounts:r=[],token:i,tokens:c=[],onTokenChange:d,sendTransaction:m,getTransactionReceipt:p,estimateGas:l,onSuccess:f,onConfirmSuccess:x,onOutlink:h}){let[y,g]=E.useState(""),[w,L]=E.useState(""),[M,T]=E.useState(""),[N,H]=E.useState({}),[k,I]=E.useState(""),[P,C]=E.useState(!1),[Z,B]=E.useState(!1),[be,nt]=E.useState(!1),[se,ze]=E.useState("account"),Pe=E.useRef(void 0),J=E.useRef(void 0),Ue=E.useRef(null),qe=E.useRef(null),[ge,Ze]=E.useState(()=>St(o)),[ve,te]=E.useState("idle"),[Q,$e]=E.useState(null),[pe,_e]=E.useState(!1),[ye,me]=E.useState(""),ke=E.useRef(0),[ne,Se]=E.useState(null),[re,ot]=E.useState(""),Ce=oo(i),Ye=E.useMemo(()=>BigInt(i.quantity.numeric||"0"),[i.quantity.numeric]),Ve=E.useMemo(()=>ft(i.quantity.numeric,i.quantity.decimals),[i.quantity.numeric,i.quantity.decimals]),He=E.useMemo(()=>r.filter(u=>u.address.toLowerCase()!==o.toLowerCase()),[r,o]),rt=E.useMemo(()=>{let u=new Map;return He.forEach((R,O)=>{u.set(R.address.toLowerCase(),{account:R,index:O})}),u},[He]),Ie=He.length>0,je=E.useMemo(()=>fe(e),[e]),Te=t==="dark"?"1A1A2E":"F3F6F8",Ke=c.length>0?c:[i],Ge=Ke.length>1&&!!d,{transactionUrl:Me,chainInfo:we}=lr(je,i.chainId,k||void 0,!0),Ae=we?.currency_symbol??"",Ne=we?.name??`Chain ID ${i.chainId}`;E.useEffect(()=>{T(""),H({}),I(""),te("idle"),$e(null),me(""),_e(!1),ke.current+=1},[i.address,i.chainId,y,w]),E.useEffect(()=>{L(""),C(!1)},[i.address,i.chainId]),E.useEffect(()=>{Ze(St(o))},[o]),E.useEffect(()=>()=>{clearTimeout(Pe.current),clearTimeout(J.current)},[]),E.useEffect(()=>{!Ie&&se==="account"&&ze("recent")},[se,Ie]),E.useEffect(()=>{let u=window.visualViewport,R=Ue.current;if(!u||!R)return;let O=()=>{let le=document.activeElement;return R.contains(le)&&(le instanceof HTMLInputElement||le instanceof HTMLTextAreaElement)},_=48,q=()=>{R.style.paddingBottom=""},ie=()=>{if(!O()){q();return}let le=Math.max(0,window.innerHeight-u.height-u.offsetTop);le>0?R.style.paddingBottom=`${le+_}px`:q();let lt=document.activeElement;lt instanceof HTMLElement&&requestAnimationFrame(()=>{let Dt=lt.getBoundingClientRect(),dn=R.getBoundingClientRect().bottom-le-_,Bt=Dt.bottom-dn;Bt>0&&R.scrollBy({top:Bt,behavior:"smooth"})})},st=()=>{setTimeout(()=>{O()||q()},0)};return u.addEventListener("resize",ie),window.addEventListener("resize",ie),R.addEventListener("focusout",st),()=>{u.removeEventListener("resize",ie),window.removeEventListener("resize",ie),R.removeEventListener("focusout",st),q()}},[]);let Oe=E.useCallback(()=>{clearTimeout(J.current),J.current=setTimeout(()=>{qe.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},10)},[]),Hn=E.useCallback(()=>{L(lo(i.quantity.numeric,i.quantity.decimals))},[i.quantity.numeric,i.quantity.decimals]),an=E.useCallback(u=>{g(u),B(!1)},[]),sn=E.useCallback(()=>{let u={},R=y.trim(),O=so(w,i.quantity.decimals),_;return R?Gt(R)||(u.recipient="Enter a valid EVM recipient address."):u.recipient="Enter a recipient address.","error"in O?u.amount=O.error:(_=O.value,_>Ye&&(u.amount="Amount exceeds available balance.")),!Ce&&!Gt(i.address)&&(u.token="Token contract address is invalid."),{errors:u,rawAmount:_,trimmedRecipient:R}},[w,Ye,Ce,y,i.address,i.quantity.decimals]),ln=E.useCallback(async()=>{if(k)try{await navigator.clipboard.writeText(k),nt(!0),clearTimeout(Pe.current),Pe.current=setTimeout(()=>nt(!1),2e3)}catch{}},[k]),it=E.useCallback(()=>{if(!Me||!k)return;let u=_=>{typeof window>"u"||window.open(_,"_blank","noopener,noreferrer")};if(!h){u(Me);return}let R=h(Me,{category:"send",origin:"send-transaction",payload:{chainId:i.chainId,txHash:k}});if(R&&(typeof R=="object"||typeof R=="function")&&typeof R.then=="function"){let _=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;R.then(q=>{if(q===null){_?.close();return}let ie=q??Me;if(_)try{_.location.href=ie}catch{_.close(),u(ie)}else u(ie)});return}let O=R;O!==null&&u(O??Me)},[h,i.chainId,Me,k]),at=E.useCallback((u,R)=>Ce?{to:u,value:R,chainId:i.chainId,from:o}:{to:jt(i.address),data:co(u,R),value:0n,chainId:i.chainId,from:o},[Ce,i.address,i.chainId,o]),Lt=E.useCallback(async(u,R,O)=>{if(!l&&!O)return;let _=++ke.current;_e(!0),me("");try{let q=at(u,R),ie=l?await l(q):await mr(O,q);if(ke.current!==_)return;$e(ie)}catch(q){if(ke.current!==_)return;me(po(q,{nativeSymbol:Ae||void 0,networkName:Ne,tokenSymbol:i.symbol},"Failed to estimate gas."))}finally{ke.current===_&&_e(!1)}},[at,l,Ae,Ne,i.symbol]),cn=E.useCallback(u=>{if(u.preventDefault(),T(""),I(""),!m){te("error"),T("Sending is not available for this wallet.");return}let{errors:R,rawAmount:O,trimmedRecipient:_}=sn();if(H(R),ua(R)||O===void 0){te("error");return}let q=_;Se(O),ot(q),$e(null),me(""),te("review")},[m,sn]);E.useEffect(()=>{ve==="review"&&(!re||ne===null||Q===null&&(pe||ye||!l&&!we?.rpc||Lt(re,ne,we?.rpc)))},[we?.rpc,l,Lt,Q,ye,pe,ne,re,ve]);let Ot=E.useCallback(async()=>{if(!(!m||!re||ne===null)){T(""),I("");try{te("submitting");let u=await m(at(re,ne));if(I(u),te("confirming"),Ze(io(o,re)),f?.(u),!p){te("success");return}for(let R=0;R<pa;R+=1){let O=await p({hash:u,chainId:i.chainId}).catch(()=>null);if(O){if(fa(O)){te("error"),T("Transaction reverted on-chain.");return}te("success");return}await ma(da)}te("error"),T("Transaction receipt was not found. Please check again later.")}catch(u){te("error"),T(po(u,{nativeSymbol:Ae||void 0,networkName:Ne,tokenSymbol:i.symbol}))}}},[at,p,Ae,Ne,f,ne,re,m,i.chainId,i.symbol,o]),jn=E.useCallback(()=>{ke.current+=1,$e(null),me(""),_e(!1),T(""),te("idle")},[]),Ft=Ye<=0n||!y.trim()||!w.trim();if(ve==="review"||ve==="submitting"){let u=ve==="submitting",R=ne!==null?go(ne,i.quantity.decimals):w.trim(),O=n?.trim()||`Account ${(r[0]?.index??0)+1}`,_="\u2014",q=Ae||(Ce?i.symbol:""),ie=we?.currency_decimals??(Ce?i.quantity.decimals:18),st=Q?wa(Q):null,le=Q?ha(Q):null,lt=le!==null&&q?`${fo(le,ie)} ${q}`:_,Dt=Q?ga(Q.gasLimit):_,Wt=Q?.maxPriorityFeePerGas!==void 0?`${uo(Q.maxPriorityFeePerGas)} Gwei`:_,dn=Q?.maxFeePerGas!==void 0?`${uo(Q.maxFeePerGas)} Gwei`:_,Bt=Q?.gasPrice!==void 0?`${uo(Q.gasPrice)} Gwei`:_,Ao=`${R} ${i.symbol}`,pn=(()=>{if(!Q||le===null)return _;if(Ce&&ne!==null){let Rt=ne+le;return`${fo(Rt,ie)} ${q||i.symbol}`}return q?`${fo(le,ie)} ${q}`:_})();return(0,a.jsxs)("div",{className:"send-page send-page--review",children:[(0,a.jsxs)("div",{className:"send-scroll send-review-scroll","data-vaul-no-drag":!0,children:[(0,a.jsxs)("div",{className:"send-review-amount",children:[(0,a.jsx)("img",{className:"send-review-amount-icon",src:i.icon_url,alt:"",width:32,height:32,draggable:!1,onError:Rt=>{Rt.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,a.jsxs)("span",{className:"send-review-amount-value",children:[R," ",i.symbol]})]}),(0,a.jsxs)("div",{className:"send-review-parties",children:[(0,a.jsxs)("div",{className:"send-review-party",children:[(0,a.jsx)("span",{className:"send-review-party-label",children:"From"}),(0,a.jsxs)("div",{className:"send-review-party-info",children:[(0,a.jsx)("span",{className:"send-review-party-name",children:O}),(0,a.jsx)("span",{className:"send-review-party-addr",children:o})]})]}),(0,a.jsxs)("div",{className:"send-review-party",children:[(0,a.jsx)("span",{className:"send-review-party-label",children:"To"}),(0,a.jsx)("div",{className:"send-review-party-info",children:(0,a.jsx)("span",{className:"send-review-party-addr",children:re})})]})]}),(0,a.jsxs)("section",{className:"send-review-section",children:[(0,a.jsx)("h3",{className:"send-review-section-title",children:"Summary"}),(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Network"}),(0,a.jsxs)("span",{className:"send-review-row-value send-review-network",children:[(0,a.jsx)("span",{className:"send-review-network-dot","aria-hidden":!0}),Ne]})]}),(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Est. Tx Fee"}),(0,a.jsx)("span",{className:"send-review-row-value",children:pe?"\u2026":lt})]}),st==="dynamic"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Max Priority Fee"}),(0,a.jsx)("span",{className:"send-review-row-value",children:pe?"\u2026":Wt})]}),(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Max Gas Fee"}),(0,a.jsx)("span",{className:"send-review-row-value",children:pe?"\u2026":dn})]})]}):st==="legacy"?(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Gas Price"}),(0,a.jsx)("span",{className:"send-review-row-value",children:pe?"\u2026":Bt})]}):null,(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Gas Limit"}),(0,a.jsx)("span",{className:"send-review-row-value",children:pe?"\u2026":Dt})]})]}),(0,a.jsxs)("section",{className:"send-review-section",children:[(0,a.jsx)("h3",{className:"send-review-section-title",children:"Total"}),(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Total Amount"}),(0,a.jsx)("span",{className:"send-review-row-value",children:Ao})]}),(0,a.jsxs)("div",{className:"send-review-row",children:[(0,a.jsx)("span",{className:"send-review-row-label",children:"Max. Total Amount"}),(0,a.jsx)("span",{className:"send-review-row-value",children:pe?"\u2026":pn})]})]}),ye&&(0,a.jsx)("div",{className:"send-message send-message--error",role:"alert",children:ye}),M&&(0,a.jsx)("div",{className:"send-message send-message--error",role:"alert",children:M})]}),(0,a.jsxs)("div",{className:"send-footer send-footer--review",children:[(0,a.jsx)("button",{type:"button",className:"send-review-btn send-review-btn--cancel",onClick:jn,disabled:u,children:"Cancel"}),(0,a.jsx)("button",{type:"button",className:"send-review-btn send-review-btn--confirm",onClick:Ot,disabled:u,children:u?"Sending...":"Send"})]})]})}if((ve==="confirming"||ve==="success")&&k){let u=ve==="success";return(0,a.jsxs)("div",{className:"send-page send-page--success",children:[(0,a.jsxs)("div",{className:"send-success-body","data-vaul-no-drag":!0,children:[(0,a.jsx)("div",{className:"send-success-icon","data-pending":!u||void 0,children:u?(0,a.jsx)(ba,{}):(0,a.jsx)("span",{className:"send-success-spinner"})}),(0,a.jsxs)("div",{className:"send-success-copy",children:[(0,a.jsx)("h3",{className:"send-success-title",children:u?"Transaction Complete":"Transaction in Progress"}),(0,a.jsx)("p",{className:"send-success-desc",children:u?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),(0,a.jsxs)("div",{className:"send-success-hash-card",children:[(0,a.jsx)("span",{className:"send-success-hash-label",children:"Transaction Hash"}),(0,a.jsxs)("div",{className:"send-success-hash-row","data-vaul-no-drag":!0,children:[(0,a.jsx)("button",{type:"button",className:"send-success-hash-link",onClick:it,"aria-label":"Open transaction in explorer",children:Le(k)}),(0,a.jsx)("button",{type:"button",className:"send-success-copy-btn",onClick:ln,"aria-label":"Copy transaction hash",children:be?(0,a.jsx)(Ht,{size:16}):"Copy"})]})]})]}),(0,a.jsx)("div",{className:"send-footer",children:(0,a.jsx)("button",{type:"button",className:"send-submit-btn",onClick:x,disabled:!u,children:u?"All done":"Sending..."})})]})}return(0,a.jsxs)("form",{className:"send-page",onSubmit:cn,children:[(0,a.jsxs)("div",{className:"send-scroll","data-vaul-no-drag":!0,ref:Ue,children:[(0,a.jsxs)("section",{className:"send-section","aria-label":"Select token to send",children:[(0,a.jsx)("span",{className:"send-label",children:"Token"}),(0,a.jsxs)("button",{type:"button",className:"send-asset-card",onClick:()=>{Ge&&C(u=>!u)},disabled:!Ge,"aria-expanded":Ge?P:void 0,children:[(0,a.jsxs)("span",{className:"send-asset-left",children:[(0,a.jsx)("img",{className:"send-asset-icon",src:i.icon_url,alt:i.symbol,width:40,height:40,draggable:!1,onError:u=>{u.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,a.jsxs)("span",{className:"send-asset-info",children:[(0,a.jsx)("span",{className:"send-asset-symbol",children:i.symbol}),(0,a.jsx)("span",{className:"send-asset-name",children:i.name})]})]}),(0,a.jsxs)("span",{className:"send-asset-balance",children:[(0,a.jsx)("span",{className:"send-balance-label",children:"Available"}),(0,a.jsxs)("span",{className:"send-balance-value",children:[Ve," ",i.symbol]})]})]}),Ge&&P&&(0,a.jsx)("div",{className:"send-token-list",role:"listbox",children:Ke.map(u=>{let R=mo(u)===mo(i);return(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":R,className:"send-token-option","data-selected":R||void 0,onClick:()=>d?.(u),children:[(0,a.jsxs)("span",{className:"send-asset-left",children:[(0,a.jsx)("img",{className:"send-token-option-icon",src:u.icon_url,alt:u.symbol,width:28,height:28,draggable:!1,onError:O=>{O.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,a.jsxs)("span",{className:"send-asset-info",children:[(0,a.jsx)("span",{className:"send-token-option-symbol",children:u.symbol}),(0,a.jsx)("span",{className:"send-asset-name",children:u.name})]})]}),(0,a.jsx)("span",{className:"send-token-option-balance",children:ft(u.quantity.numeric,u.quantity.decimals)})]},mo(u))})}),N.token&&(0,a.jsx)("p",{className:"send-field-error",role:"alert",children:N.token})]}),(0,a.jsxs)("section",{className:"send-field","aria-label":"Recipient address",children:[(0,a.jsx)("span",{className:"send-label",children:"To"}),(0,a.jsxs)("div",{className:"send-address-wrap","data-invalid":N.recipient||void 0,children:[(0,a.jsx)("input",{className:"send-input send-input--address",value:y,onChange:u=>g(u.target.value),placeholder:"0x...",autoComplete:"off",spellCheck:!1,"aria-invalid":!!N.recipient,"aria-describedby":N.recipient?"send-recipient-error":void 0}),(0,a.jsx)("button",{type:"button",className:"send-address-book-btn",onClick:()=>B(u=>!u),"aria-label":"Open address book","aria-expanded":Z,children:(0,a.jsx)(xa,{})})]}),N.recipient&&(0,a.jsx)("p",{id:"send-recipient-error",className:"send-field-error",role:"alert",children:N.recipient}),Z&&(0,a.jsxs)("div",{className:"send-address-picker",children:[(0,a.jsxs)("div",{className:"send-address-tabs",role:"tablist",children:[Ie&&(0,a.jsx)("button",{type:"button",role:"tab",className:"send-address-tab","data-active":se==="account"||void 0,"aria-selected":se==="account",onClick:()=>ze("account"),children:"My Account"}),(0,a.jsx)("button",{type:"button",role:"tab",className:"send-address-tab","data-active":se==="recent"||void 0,"aria-selected":se==="recent",onClick:()=>ze("recent"),children:"Recent"})]}),Ie&&se==="account"?(0,a.jsx)("div",{className:"send-address-list",children:He.map((u,R)=>{let O=ur(u,R),_=ut(je,u.address,{size:56,bg:Te});return(0,a.jsxs)("button",{type:"button",className:"send-address-option",onClick:()=>an(u.address),children:[(0,a.jsxs)("span",{className:"send-address-avatar","aria-hidden":!0,children:[_&&(0,a.jsx)("img",{className:"send-address-avatar-img",src:_,alt:"",width:36,height:36,draggable:!1,onError:q=>{q.currentTarget.style.display="none"}}),(0,a.jsx)("span",{className:"send-address-avatar-fallback",children:gr(O)})]}),(0,a.jsxs)("span",{className:"send-address-copy",children:[(0,a.jsx)("span",{className:"send-address-name",children:O}),(0,a.jsx)("span",{className:"send-address-value",children:Le(u.address)})]})]},u.address)})}):ge.length>0?(0,a.jsx)("div",{className:"send-address-list",children:ge.map(u=>{let R=rt.get(u.address.toLowerCase()),O=R?ur(R.account,R.index):void 0,_=ut(je,u.address,{size:56,bg:Te});return(0,a.jsxs)("button",{type:"button",className:"send-address-option",onClick:()=>an(u.address),children:[(0,a.jsxs)("span",{className:"send-address-avatar","aria-hidden":!0,children:[_&&(0,a.jsx)("img",{className:"send-address-avatar-img",src:_,alt:"",width:36,height:36,draggable:!1,onError:q=>{q.currentTarget.style.display="none"}}),(0,a.jsx)("span",{className:"send-address-avatar-fallback",children:O?gr(O):u.address.slice(2,4).toUpperCase()})]}),(0,a.jsxs)("span",{className:"send-address-copy",children:[(0,a.jsx)("span",{className:"send-address-name",children:O??Le(u.address)}),(0,a.jsx)("span",{className:"send-address-value",children:R?Le(R.account.address):"Recently sent"})]})]},u.address)})}):(0,a.jsx)("div",{className:"send-address-empty",children:"No Send History"})]})]}),(0,a.jsxs)("section",{className:"send-field","aria-labelledby":"send-amount-label",children:[(0,a.jsxs)("span",{className:"send-label-row",children:[(0,a.jsx)("span",{id:"send-amount-label",className:"send-label",children:"Amount"}),(0,a.jsx)("button",{type:"button",className:"send-max-btn",onClick:Hn,disabled:Ye<=0n,children:"Max"})]}),(0,a.jsxs)("div",{className:"send-amount-wrap","data-invalid":N.amount||void 0,children:[(0,a.jsx)("input",{ref:qe,className:"send-input send-input--amount",value:w,onChange:u=>L(u.target.value),onFocus:Oe,placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-labelledby":"send-amount-label","aria-invalid":!!N.amount,"aria-describedby":N.amount?"send-amount-error":void 0}),(0,a.jsx)("span",{className:"send-amount-symbol",children:i.symbol})]}),N.amount&&(0,a.jsx)("p",{id:"send-amount-error",className:"send-field-error",role:"alert",children:N.amount})]}),(0,a.jsxs)("div",{className:"send-meta",children:[(0,a.jsx)("span",{children:"From"}),(0,a.jsx)("span",{children:Le(o)})]}),(0,a.jsxs)("div",{className:"send-meta",children:[(0,a.jsx)("span",{children:"Network"}),(0,a.jsxs)("span",{children:["Chain ID ",i.chainId]})]}),M&&(0,a.jsx)("div",{className:"send-message send-message--error",role:"alert",children:M})]}),(0,a.jsx)("div",{className:"send-footer",children:(0,a.jsx)("button",{type:"submit",className:"send-submit-btn","data-disabled":Ft||void 0,"aria-disabled":Ft,children:"Send"})})]})}var wr=U(require("@radix-ui/react-popover"),1),hr=require("vaul");var gt=require("react/jsx-runtime");function xr({asChild:e,className:t,children:o}){let{isMobile:n,theme:r,walletAddress:i}=Qe(),c=o!=null,d=e??!0,m=c?o:(0,gt.jsxs)("button",{type:"button",className:X("wi-trigger-btn",t),"data-theme":r,"data-mobile":n||void 0,children:[(0,gt.jsx)(Ko,{size:n?14:16}),(0,gt.jsx)("span",{className:"wi-trigger-address",children:Le(i)})]});return n?(0,gt.jsx)(hr.Drawer.Trigger,{asChild:d,children:m}):(0,gt.jsx)(wr.Trigger,{asChild:d,children:m})}var G=U(require("react"),1),Fn=U(require("@radix-ui/react-popover"),1),Yt=require("vaul");var At=U(require("bignumber.js"),1);var br=require("@tanstack/react-query"),vr=require("react");var kn="user-balance";async function va(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 c=await i.json();if(c.code!==200)throw new Error(`Token balance API error: ${c.code}`);return c.data}function wt(e,t,o=!0){let n=Re[e],r=ue[e],i=[r.cross,r.bsc],c=(0,br.useQueries)({queries:i.map(l=>({queryKey:[kn,e,t,l],queryFn:({signal:f})=>va(n,l,t,f),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1}))}),d=c.some(l=>l.isLoading),m=c.some(l=>l.isError);return{tokens:(0,vr.useMemo)(()=>{let l=[];for(let f of c)f.data&&l.push(...f.data);return l},[c]),isLoading:d,isError:m}}var Cn=require("@tanstack/react-query"),yr=require("react");var ya="forge-holdings",ka="forge-token-image";async function Ca(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 Na(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 kr(e,t,o=!0){let n=Xn[e],{data:r,...i}=(0,Cn.useQuery)({queryKey:[ya,e,t],queryFn:({signal:c})=>Ca(n,t,c),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1});return{holdings:r??[],...i}}function Cr(e,t,o=!0){let n=Xn[e],r=(0,Cn.useQueries)({queries:t.map(c=>({queryKey:[ka,e,c],queryFn:({signal:d})=>Na(n,c,d),enabled:o,staleTime:1/0}))});return{imageMap:(0,yr.useMemo)(()=>{let c=new Map;for(let d of r)d.data&&c.set(d.data.address,d.data.image_url);return c},[r])}}var Nr=require("@tanstack/react-query"),Lr=require("react");var Nn="token-stats";function ht(e,t){return`${e}:${t.toLowerCase()}`}function xt(e,t=!0){let o=Re[e],{data:n,...r}=(0,Nr.useQuery)({queryKey:[Nn,e],queryFn:async({signal:c})=>{let d=await fetch(`${o}/v1/public/token/stats`,{cache:"no-store",signal:c});if(!d.ok)throw new Error(`Failed to fetch token stats: ${d.status}`);let m=await d.json();if(m.code!==200)throw new Error(`Token stats API error: ${m.code}`);return m},enabled:t,staleTime:3e4});return{statsMap:(0,Lr.useMemo)(()=>{let c=new Map;if(!n?.data)return c;for(let d of n.data){let m=ht(d.chain_id,d.address);c.set(m,d)}return c},[n]),...r}}var Rr=require("@tanstack/react-query"),Er=require("react");var La="token-info";function wo(e,t){return`${t.toLowerCase()}_${e}`}function Pr(e,t=!0){let o=Re[e],{data:n,...r}=(0,Rr.useQuery)({queryKey:[La,e],queryFn:async({signal:c})=>{let d=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:c});if(!d.ok)throw new Error(`Failed to fetch token info: ${d.status}`);let m=await d.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:1/0});return{categoryMap:(0,Er.useMemo)(()=>{let c=new Map;if(!n?.data)return c;for(let d of n.data){let m=wo(d.chain_id,d.address);c.set(m,d.category)}return c},[n]),...r}}var Sr=require("react"),Ln=U(require("bignumber.js"),1);function Ir(e,t,o){let{tokens:n,isLoading:r}=wt(e,t,o),{statsMap:i}=xt(e,o);return(0,Sr.useMemo)(()=>{let c=new Ln.default(0);for(let l of n){let f=i.get(ht(l.chainId,l.address));if(!f)continue;let h=new Ln.default(l.quantity.numeric).shiftedBy(-l.quantity.decimals).multipliedBy(new Ln.default(f.price));h.isNaN()||(c=c.plus(h))}let d=c.toFixed(),{displayValue:m,isLowerBound:p}=Zo(d);return{totalUsd:d,displayValue:m,isLowerBound:p,isLoading:r}},[n,i,r])}var di=require("qrcode.react");function De(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(p){console.error("[dapp-ui] onOutlink threw:",p);return}let i=p=>{typeof window>"u"||window.open(p,"_blank","noopener,noreferrer")};if((p=>!!p&&(typeof p=="object"||typeof p=="function")&&typeof p.then=="function")(r)){let p=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,l=f=>{if(f===null){p?.close();return}let x=f??t;if(p)try{p.location.href=x}catch{p.close(),i(x)}else i(x)};r.then(l,f=>{console.error("[dapp-ui] onOutlink rejected:",f),p?.close()});return}let d=r;if(d===null)return;i(d??t)}var kt=U(require("react"),1),ci=require("vaul");var Rn=require("react"),qt=(0,Rn.createContext)(null);function Ee(){let e=(0,Rn.useContext)(qt);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var Tr=require("vaul");var ho=require("react/jsx-runtime");function Mr({asChild:e,children:t}){let{walletAddress:o}=Ee(),n=t!=null,r=e??!0,i=n?t:(0,ho.jsx)("button",{type:"button",children:Le(o)});return(0,ho.jsx)(Tr.Drawer.Trigger,{asChild:r,children:i})}var Zt=require("vaul");var he=U(require("react"),1),si=require("@tanstack/react-query");var zr=require("react"),Mn=U(require("bignumber.js"),1);var Or=require("@tanstack/react-query"),xo=require("react");var En={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"},Ar={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},Pn={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"},Sn={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"},_r={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 In(e,t=!0){let o=En[e],{data:n,...r}=(0,Or.useQuery)({queryKey:[Ra,e],queryFn:async({signal:d})=>{let m=await fetch(`${o}/v1/pools`,{cache:"no-store",signal:d});if(!m.ok)throw new Error(`Failed to fetch pools: ${m.status}`);let p=await m.json();if(p.code!==200)throw new Error(`Pools API error: ${p.code}`);return p},enabled:t,staleTime:0}),i=(0,xo.useMemo)(()=>n?.data.pools.filter(d=>d.pool_type==="CrossPool")??[],[n]),c=(0,xo.useMemo)(()=>n?.data.pools.filter(d=>d.pool_type==="GamePool")??[],[n]);return{crossPools:i,gamePools:c,allPools:n?.data.pools??[],...r}}var Fr=require("@tanstack/react-query"),Dr=require("react");var Ea="wp:user-deposits";function Tn(e,t,o=!0){let n=En[e],r=o&&!!t,{data:i,...c}=(0,Fr.useQuery)({queryKey:[Ea,e,t],queryFn:async({signal:m})=>{let p=await fetch(`${n}/v1/users/${t}/deposits`,{cache:"no-store",signal:m});if(!p.ok)throw new Error(`Deposits fetch failed: ${p.status}`);let l=await p.json();if(l.code!==200)throw new Error(`Deposits API error: ${l.code}`);return l},enabled:r,staleTime:0});return{depositMap:(0,Dr.useMemo)(()=>{let m=new Map;if(!i?.data.user_deposits)return m;for(let p of i.data.user_deposits)m.set(p.pool_address.toLowerCase(),p);return m},[i]),deposits:i?.data.user_deposits??[],...c}}var bo=require("@tanstack/react-query"),vo=require("react");function Je(e,t,o,n=!0){let r=_r[e][t],i=n&&!!o,{data:c,...d}=(0,bo.useQuery)({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:y})=>{let g=await fetch(`${r}/pair-info`,{cache:"no-store",signal:y});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}),m=c?.data??[],p=(0,vo.useMemo)(()=>{let y=new Map;for(let g of m)y.set(g.pair_address.toLowerCase(),g);return y},[m]),{data:l,...f}=(0,bo.useQuery)({queryKey:["wp:dex-orders",e,t,o],queryFn:async({signal:y})=>{let g=Math.floor(Date.now()/1e3),w=new URLSearchParams({owner:o,size:"200",start_date:"0",end_date:String(g)}),L=await fetch(`${r}/open-order?${w}`,{cache:"no-store",signal:y});if(!L.ok)throw new Error(`open-order fetch failed: ${L.status}`);let M=await L.json();if(M.code!==200)throw new Error(`open-order API error: ${M.code}`);return M.data?.data??[]},enabled:i,staleTime:0}),x=l??[],h=(0,vo.useMemo)(()=>{let y=new Map;for(let g of x){let w=g.pair.toLowerCase();y.has(w)||y.set(w,{buys:[],sells:[]});let L=y.get(w);g.order_side===1?L.buys.push(g):L.sells.push(g)}return y},[x]);return{allPairs:m,pairMap:p,orders:x,ordersByPair:h,isEmpty:x.length===0,isLoading:d.isLoading||f.isLoading}}var Pa=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],Wr="var(--wp-green)",Br=4;function $r(e,t,o=!0){let n=o&&!!t,{allPools:r}=In(e,n),{depositMap:i}=Tn(e,t,n),{allPairs:c,pairMap:d,ordersByPair:m}=Je(e,"cross",t,n),{allPairs:p,pairMap:l,ordersByPair:f}=Je(e,"crossd",t,n),{allPairs:x,pairMap:h,ordersByPair:y}=Je(e,"forge",t,n);return(0,zr.useMemo)(()=>{let g=new Map,w=new Map,L=(k,I)=>{!Number.isFinite(I)||I<=0||w.set(k,(w.get(k)??0)+I)};for(let k of r){let I=Number(k.deposit_token.price);I>0&&g.set(k.deposit_token.symbol,I);for(let P of k.reward_tokens){let C=Number(P.price);C>0&&g.set(P.symbol,C)}}for(let k of[...c,...p,...x]){let I=g.get(k.quote_symbol),P=Number(k.billboard?.price);I&&P>0&&!g.has(k.base_symbol)&&g.set(k.base_symbol,P*I)}for(let k of r){let I=i.get(k.pool_address.toLowerCase());if(!I)continue;let P=new Mn.default(I.deposited_amount).shiftedBy(-k.deposit_token.decimals).toNumber();if(L(k.deposit_token.symbol,P),k.reward_tokens.length>0){let C=k.reward_tokens[0],Z=new Mn.default(I.claimable_reward).shiftedBy(-C.decimals).toNumber();L(C.symbol,Z)}}let M=[{pairMap:d,ordersByPair:m},{pairMap:l,ordersByPair:f},{pairMap:h,ordersByPair:y}];for(let{pairMap:k,ordersByPair:I}of M)for(let[P,C]of I){let Z=k.get(P);if(Z){for(let B of C.buys){let be=Number(B.amount)-Number(B.filled);L(Z.quote_symbol,be*Number(B.price))}for(let B of C.sells){let be=Number(B.amount)-Number(B.filled);L(Z.base_symbol,be)}}}let T=[],N=0;for(let[k,I]of w){let P=g.get(k)??0,C=I*P;C>0&&(T.push({symbol:k,usdValue:C}),N+=C)}T.sort((k,I)=>I.usdValue-k.usdValue);let H=[];if(N>0){let k=T.slice(0,Br),I=T.slice(Br);for(let C=0;C<k.length;C++)H.push({symbol:k[C].symbol,usdValue:k[C].usdValue,percentage:Math.round(k[C].usdValue/N*100),color:Pa[C]??Wr});if(I.length>0){let C=I.reduce((Z,B)=>Z+B.usdValue,0);H.push({symbol:"Others",usdValue:C,percentage:Math.round(C/N*100),color:Wr})}let P=H.reduce((C,Z)=>C+Z.percentage,0);P!==100&&H.length>0&&(H[0].percentage+=100-P)}return{totalUsd:N,formattedTotal:N>0?`$${new Mn.default(N).toFormat(2)}`:"$0.00",segments:H}},[r,i,c,d,m,p,l,f,x,h,y])}var ce=require("react/jsx-runtime");function Vr({size:e=22,className:t}){return(0,ce.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ce.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Hr({size:e=22,className:t}){return(0,ce.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,ce.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,ce.jsx)("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 jr({size:e=12,className:t}){return(0,ce.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ce.jsx)("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function Gr({size:e=6,className:t}){return(0,ce.jsx)("svg",{width:e,height:e*4/6,viewBox:"0 0 6 4",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ce.jsx)("path",{d:"M1 1l2 2 2-2",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function bt({size:e=12,className:t}){return(0,ce.jsxs)("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:[(0,ce.jsx)("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"}),(0,ce.jsx)("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,ce.jsx)("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}var An=U(require("bignumber.js"),1),yo={included:["CROSS Rewards deposited assets","CROSS Rewards claimable rewards","Gametoken open buy/sell orders"],excluded:["Forge LP value","Wallet balances outside Portfolio"]};function Ur(e){return e!=="production"}function qr(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function ko(e,t){let o=new An.default(e).shiftedBy(-t);return!o.isFinite()||o.isZero()?"0":o.isGreaterThanOrEqualTo(1)?o.toFormat(2,An.default.ROUND_DOWN):o.toFormat(4,An.default.ROUND_DOWN)}var Zr=require("@tanstack/react-query"),Yr=require("react");var Sa="wp:token-info";function _n(e,t=!0){let o=Re[e],n=ue[e].cross,{data:r,...i}=(0,Zr.useQuery)({queryKey:[Sa,e],queryFn:async({signal:p})=>{let l=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:p});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let f=await l.json();if(f.code!==200)throw new Error(`Token info API error: ${f.code}`);return f},enabled:t,staleTime:300*1e3}),{byChainAddr:c,byChainSym:d}=(0,Yr.useMemo)(()=>{let p=new Map,l=new Map;if(!r?.data)return{byChainAddr:p,byChainSym:l};for(let f of r.data){let x=f.address.toLowerCase();p.set(`${f.chain_id}:${x}`,f),p.set(x,f);let h=f.symbol.replace(/^t/,"").toUpperCase(),y=`${f.chain_id}:${h}`;l.has(y)||l.set(y,f),l.has(h)||l.set(h,f)}return{byChainAddr:p,byChainSym:l}},[r]);return{getTokenImage:(p,l)=>{let f=p.toLowerCase(),x=c.get(`${n}:${f}`);if(x?.image)return x.image;let h=c.get(f);if(h?.image)return h.image;if(l){let y=l.replace(/^t/,"").toUpperCase(),g=d.get(`${n}:${y}`);if(g?.image)return g.image;let w=d.get(y);if(w?.image)return w.image}return""},...i}}var et=require("react/jsx-runtime");function Tt({title:e,icon:t,iconFit:o="cover",isEmpty:n,children:r}){return(0,et.jsxs)("div",{className:"wp-svc-card",children:[(0,et.jsxs)("div",{className:"wp-svc-card-head",children:[(0,et.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:o}}),(0,et.jsx)("span",{className:"wp-svc-card-title",children:e})]}),n?(0,et.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,et.jsx)("div",{className:"wp-svc-items",children:r})]})}var Mt=U(require("bignumber.js"),1),W=require("react/jsx-runtime"),Ia="CROSS Rewards";function Ta(e){return new Mt.default(e||"0").isGreaterThan(0)}function Ma(e,t,o){let n=new Mt.default(e||"0").shiftedBy(-t).times(o||"0");return!n.isFinite()||n.isZero()?"$0.00":`$${n.toFormat(2,Mt.default.ROUND_DOWN)}`}function Kr(){let{env:e,walletAddress:t,onOutlink:o}=Ee(),n=!!t,{allPools:r}=In(e,n),{depositMap:i}=Tn(e,t,n),{getTokenImage:c}=_n(e,n),d=(l,f)=>`${Ar[e]}/rewards/${l.pool_address}?action=${f}`,m=`${It[e]}/reward.png`,p=r.filter(l=>{let f=i.get(l.pool_address.toLowerCase()),x=f?.deposited_amount??"0",h=f?.claimable_reward??"0";return!(new Mt.default(x).isZero()&&new Mt.default(h).isZero())});return(0,W.jsx)(Tt,{title:Ia,icon:m,isEmpty:p.length===0,children:p.map(l=>{let f=i.get(l.pool_address.toLowerCase()),x=f?.deposited_amount??"0",h=f?.claimable_reward??"0",y=d(l,"withdraw"),g=d(l,"claim"),w=c(l.deposit_token.address,l.deposit_token.symbol),L=l.reward_tokens[0],M=L?c(L.address,L.symbol):"",T=l.reward_tokens.map(C=>C.symbol),N=T.length>0?`${l.deposit_token.symbol}-${T.join("/")}`:l.deposit_token.symbol,H=L?ko(h,L.decimals):"0",k=L?.symbol??"Reward",I=L?Ma(h,L.decimals,L.price):"$0.00",P=!!f&&Ta(h);return(0,W.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,W.jsxs)("div",{className:"wp-item-body",children:[(0,W.jsxs)("div",{className:"wp-item-line",children:[(0,W.jsx)("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),(0,W.jsxs)("div",{className:"wp-svc-token",children:[(0,W.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&(0,W.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),M&&(0,W.jsx)("img",{className:"wp-svc-token-icon",src:M,alt:""})]}),(0,W.jsx)("span",{children:N})]})]}),(0,W.jsxs)("div",{className:"wp-item-line",children:[(0,W.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,W.jsxs)("div",{className:"wp-svc-token",children:[w&&(0,W.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),(0,W.jsx)("span",{children:ko(x,l.deposit_token.decimals)})]})]}),(0,W.jsxs)("div",{className:"wp-item-line",children:[(0,W.jsxs)("span",{className:"wp-item-label",children:["Claimable (",k,")"]}),(0,W.jsxs)("div",{className:"wp-svc-token",children:[M&&(0,W.jsx)("img",{className:"wp-svc-token-icon",src:M,alt:""}),(0,W.jsx)("span",{children:H}),(0,W.jsx)("span",{className:"wp-item-usd",children:I})]})]})]}),(0,W.jsxs)("div",{className:"wp-item-tags",children:[(0,W.jsxs)("a",{className:"wp-tag wp-tag--muted",href:y,target:"_blank",rel:"noopener noreferrer",onClick:C=>De(C,y,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:l,userDeposit:f}},o),children:[(0,W.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,W.jsx)(bt,{size:12,className:"wp-tag-icon"})]}),(0,W.jsxs)("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:C=>{if(!P){C.preventDefault();return}De(C,g,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:l,userDeposit:f}},o)},children:[(0,W.jsx)("span",{className:"wp-tag-label",children:"Claim"}),(0,W.jsx)(bt,{size:12,className:"wp-tag-icon"})]})]})]},l.pool_address)})})}var Co=U(require("bignumber.js"),1);var V=require("react/jsx-runtime");function Qr(e){let t=new Co.default(e);if(t.isNaN())return e;let o=t.decimalPlaces()??0;return t.toFormat(o)}function Aa(e){let t=new Co.default(e.amount).minus(e.filled);return Qr(t.toString())}function Xr({market:e,pairMap:t,ordersByPair:o,getDexUrl:n,getTokenImage:r}){let{onOutlink:i}=Ee(),c=[];for(let[d,m]of o){let p=t.get(d),l=p?r(p.base_address,p.base_symbol):"",f=p?r(p.quote_address,p.quote_symbol):"",x=n(d),h=p?`${p.base_symbol}/${p.quote_symbol}`:"Unknown Pair",y=(g,w)=>(0,V.jsxs)("a",{className:"wp-item","data-side":w,href:x,target:"_blank",rel:"noopener noreferrer",onClick:L=>De(L,x,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:w,order:g,pair:p}},i),children:[(0,V.jsxs)("div",{className:"wp-item-body",children:[(0,V.jsx)("div",{className:"wp-order-head",children:(0,V.jsxs)("div",{className:"wp-svc-token",children:[l&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:l,alt:""}),(0,V.jsx)("span",{children:p?.base_symbol??"Token"}),(0,V.jsx)("span",{className:"wp-token-subtle",children:h})]})}),(0,V.jsxs)("div",{className:"wp-item-line",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Price"}),(0,V.jsxs)("div",{className:"wp-svc-token",children:[f&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:f,alt:""}),(0,V.jsx)("span",{children:Qr(g.price)})]})]}),(0,V.jsxs)("div",{className:"wp-item-line",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Amount"}),(0,V.jsxs)("div",{className:"wp-svc-token",children:[l&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:l,alt:""}),(0,V.jsx)("span",{children:Aa(g)})]})]}),(0,V.jsxs)("div",{className:"wp-item-line",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Type"}),(0,V.jsx)("span",{className:`wp-order-side wp-order-side--${w}`,children:w==="buy"?"Buy":"Sell"})]})]}),(0,V.jsx)("div",{className:"wp-item-tags",children:(0,V.jsxs)("span",{className:"wp-tag wp-tag--muted",children:[(0,V.jsx)("span",{className:"wp-tag-label",children:"Cancel"}),(0,V.jsx)(bt,{size:12,className:"wp-tag-icon"})]})})]},`${w}-${g.order_id}`);for(let g of m.buys)c.push(y(g,"buy"));for(let g of m.sells)c.push(y(g,"sell"))}return(0,V.jsx)(V.Fragment,{children:c})}var No=require("react/jsx-runtime"),_a="Gametoken";function Oa(e){return e==="cross"?"cross":e==="crossd"?"crossd":"forge"}function Jr(){let{env:e,walletAddress:t}=Ee(),o=!!t,n=Je(e,"cross",t,o),r=Je(e,"crossd",t,o),i=Je(e,"forge",t,o),{getTokenImage:c}=_n(e,o),d=`${It[e]}/dex.png`,m=[{market:"cross",data:n},{market:"crossd",data:r},{market:"forge",data:i}],p=m.every(({data:l})=>l.isEmpty);return(0,No.jsx)(Tt,{title:_a,icon:d,isEmpty:p,children:m.map(({market:l,data:f})=>(0,No.jsx)(Xr,{market:l,pairMap:f.pairMap,ordersByPair:f.ordersByPair,getDexUrl:x=>{let h=f.pairMap.get(x.toLowerCase());return`${Sn[e]}/gametoken/${Oa(l)}/${h?.base_symbol??""}`},getTokenImage:c},l))})}var On=U(require("bignumber.js"),1),ii=require("react");var ei=require("@tanstack/react-query");var Fa="wp:forge-pools";function ti(e,t,o=!0){let n=Pn[e],r=o&&!!t,{data:i,...c}=(0,ei.useQuery)({queryKey:[Fa,e,t],queryFn:async()=>{let m=await fetch(`${n}/v1/users/${t}/pools`,{cache:"no-store"});if(!m.ok)throw new Error(`forge pools fetch failed: ${m.status}`);return(await m.json()).data?.items??[]},enabled:r,staleTime:0}),d=i??[];return{pools:d,isEmpty:d.length===0,...c}}var ni=require("@tanstack/react-query"),oi=require("react");var Da="wp:forge-token-detail";async function Wa(e,t){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return o.ok?(await o.json())?.data?.token??null:null}function ri(e,t,o=!0){let n=Pn[e],r=(0,ni.useQueries)({queries:t.map(d=>({queryKey:[Da,e,d],queryFn:()=>Wa(n,d),enabled:o&&!!d,staleTime:3e4}))}),i=(0,oi.useMemo)(()=>{let d=new Map;for(let m=0;m<r.length;m++){let p=r[m]?.data,l=t[m];p&&l&&d.set(l.toLowerCase(),p)}return d},[r,t]),c=r.some(d=>d.isLoading);return{detailMap:i,isLoading:c}}var K=require("react/jsx-runtime"),Ba="Forge",za=18,$a="https://contents.crosstoken.io/wallet/token/images/FT.png";function Va(e){if(!e||e==="0")return"0";let t=new On.default(e).shiftedBy(-za);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,On.default.ROUND_DOWN):t.toFormat(4,On.default.ROUND_DOWN)}function Ha(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 ai(){let{env:e,walletAddress:t,onOutlink:o}=Ee(),n=!!t,{pools:r,isEmpty:i}=ti(e,t,n),c=(0,ii.useMemo)(()=>r.map(l=>l.token.address),[r]),{detailMap:d}=ri(e,c,n&&c.length>0),m=l=>`${Sn[e]}/forge/token/${l.token.address}`,p=`${It[e]}/forge.png`;return(0,K.jsx)(Tt,{title:Ba,icon:p,iconFit:"contain",isEmpty:i,children:r.map(l=>{let f=d.get(l.token.address.toLowerCase()),x=f?.image_url||f?.image||l.token.image||$a,h=f?.symbol||l.token.symbol,y=m(l);return(0,K.jsxs)("a",{className:"wp-item","data-side":"lp",href:y,target:"_blank",rel:"noopener noreferrer",onClick:g=>De(g,y,{category:"portfolio",origin:"portfolio-forge",payload:{pool:l,tokenDetail:f}},o),children:[(0,K.jsxs)("div",{className:"wp-item-body",children:[(0,K.jsxs)("div",{className:"wp-item-line",children:[(0,K.jsx)("span",{className:"wp-item-label",children:"Asset"}),(0,K.jsxs)("div",{className:"wp-svc-token",children:[(0,K.jsx)("img",{className:"wp-svc-token-icon",src:x,alt:""}),(0,K.jsx)("span",{children:h}),f?.name&&(0,K.jsx)("span",{className:"wp-token-subtle",children:f.name})]})]}),(0,K.jsxs)("div",{className:"wp-item-line",children:[(0,K.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,K.jsx)("div",{className:"wp-svc-token",children:(0,K.jsx)("span",{children:Va(l.lp_balance)})})]}),(0,K.jsxs)("div",{className:"wp-item-line",children:[(0,K.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,K.jsx)("span",{className:"wp-line-value",children:Ha(l.pool_ownership)})]})]}),(0,K.jsx)("div",{className:"wp-item-tags",children:(0,K.jsxs)("span",{className:"wp-tag wp-tag--muted",children:[(0,K.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,K.jsx)(bt,{size:12,className:"wp-tag-icon"})]})})]},l.pair_address)})})}F(`.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
+ `);var A=require("react/jsx-runtime"),Lo=5,ja="wp:";function vt({env:e,theme:t="dark",walletAddress:o,walletName:n,onBack:r,showHeader:i=!0,variant:c="embed",className:d,onOutlink:m}){let p=fe(e),l=!!o,f=(0,si.useQueryClient)(),x=he.useId(),h=Ur(p),{formattedTotal:y}=$r(p,o,l),[,g]=he.useState(Lo),[w,L]=he.useState(!1),M=he.useCallback(()=>{f.invalidateQueries({predicate:P=>typeof P.queryKey[0]=="string"&&P.queryKey[0].startsWith(ja)})},[f]),T=he.useCallback(()=>{M(),L(!0),setTimeout(()=>L(!1),600),g(Lo)},[M]);he.useEffect(()=>{if(!l)return;let P=setInterval(()=>{g(C=>C<=1?(T(),Lo):C-1)},1e3);return()=>clearInterval(P)},[l,T]);let N=he.useCallback(()=>{r?.()},[r]),H=l?ut(p,o,{size:64}):void 0,k=he.useMemo(()=>({env:p,theme:t,open:!0,walletAddress:o,close:N,onOutlink:m}),[p,t,o,N,m]),I=(0,A.jsxs)(A.Fragment,{children:[i&&(0,A.jsxs)("div",{className:"wp-header",children:[(0,A.jsxs)("div",{className:"wp-header-account",children:[r?(0,A.jsx)("button",{type:"button",className:"wp-header-btn",onClick:r,children:(0,A.jsx)(Vr,{})}):(0,A.jsx)("span",{className:"wp-header-avatar","aria-hidden":!0,children:H&&(0,A.jsx)("img",{src:H,alt:"",className:"wp-header-avatar-img",draggable:!1})}),n&&(0,A.jsx)("span",{className:"wp-header-wallet-name",title:n,children:n})]}),(0,A.jsx)("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:T,children:(0,A.jsx)(Hr,{className:w?"wp-spin-once":void 0})})]}),(0,A.jsx)("div",{className:"wp-body",children:(0,A.jsxs)("div",{className:"wp-body-inner",children:[(0,A.jsxs)("section",{className:"wp-summary-card","aria-label":"Estimated portfolio value",children:[(0,A.jsxs)("div",{className:"wp-summary-head",children:[(0,A.jsxs)("div",{className:"wp-address",children:[(0,A.jsx)("span",{className:"wp-address-avatar","aria-hidden":!0}),(0,A.jsx)("span",{className:"wp-address-label",children:qr(o)}),(0,A.jsx)(Gr,{className:"wp-address-chevron"})]}),(0,A.jsxs)("div",{className:"wp-summary-estimate",children:[(0,A.jsx)("span",{className:"wp-summary-badge",children:"Estimated"}),h&&(0,A.jsxs)("button",{type:"button",className:"wp-estimate-info","aria-label":"USD estimate details","aria-describedby":x,children:[(0,A.jsx)(jr,{size:14}),(0,A.jsxs)("span",{id:x,role:"tooltip",className:"wp-estimate-tooltip",children:[(0,A.jsx)("span",{className:"wp-estimate-tooltip-title",children:"USD estimate includes"}),(0,A.jsx)("span",{className:"wp-estimate-tooltip-group",children:yo.included.map(P=>(0,A.jsx)("span",{className:"wp-estimate-tooltip-item",children:P},P))}),(0,A.jsx)("span",{className:"wp-estimate-tooltip-title",children:"Not included"}),(0,A.jsx)("span",{className:"wp-estimate-tooltip-group",children:yo.excluded.map(P=>(0,A.jsx)("span",{className:"wp-estimate-tooltip-item",children:P},P))})]})]})]})]}),(0,A.jsx)("p",{className:"wp-total",children:y})]}),(0,A.jsx)(Kr,{}),(0,A.jsx)(Jr,{}),(0,A.jsx)(ai,{})]})})]});return(0,A.jsx)(qt.Provider,{value:k,children:c==="none"?I:(0,A.jsx)("div",{className:X(c==="fullscreen"?"wp-fullscreen":"wp-embed",d),"data-theme":t,children:I})})}var yt=require("react/jsx-runtime");function li({className:e}){let{env:t,theme:o,walletAddress:n,close:r,onOutlink:i}=Ee();return(0,yt.jsxs)(Zt.Drawer.Portal,{children:[(0,yt.jsx)(Zt.Drawer.Overlay,{className:"wp-overlay"}),(0,yt.jsxs)(Zt.Drawer.Content,{className:X("wp-fullscreen",e),"data-theme":o,children:[(0,yt.jsx)(Zt.Drawer.Title,{className:"wp-sr-only",children:"My Portfolio"}),(0,yt.jsx)(vt,{env:t,theme:o,walletAddress:n,onBack:r,variant:"none",onOutlink:i})]})]})}var Ro=require("react/jsx-runtime");function Ga({env:e,theme:t="dark",walletAddress:o,open:n,onOpenChange:r,onOutlink:i,children:c}){let d=fe(e),m=n!==void 0,[p,l]=kt.useState(!1),f=m?n:p,x=kt.useCallback(g=>{m||l(g),r?.(g)},[m,r]),h=kt.useCallback(()=>x(!1),[x]),y=kt.useMemo(()=>({env:d,theme:t,open:f,walletAddress:o,close:h,onOutlink:i}),[d,t,f,o,h,i]);return(0,Ro.jsx)(qt.Provider,{value:y,children:(0,Ro.jsx)(ci.Drawer.Root,{direction:"bottom",open:f,onOpenChange:x,noBodyStyles:!0,children:c})})}var Eo=Object.assign(Ga,{Trigger:Mr,Content:li});var s=require("react/jsx-runtime");function Po(e,t,o){let n=ue[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 Ua(e){return parseInt(e.split(":")[1],10)}function qa(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Za(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 pi({align:e="end",sideOffset:t=12,className:o,children:n}){let{env:r,theme:i,isMobile:c,open:d,drawerDirection:m,modal:p,showBalance:l,showForgeToken:f,showGameToken:x,showQR:h,qrLogoSrc:y,walletAddress:g,accountName:w,sendAccounts:L,profileImageUrl:M,preferredTokens:T,close:N,onSelectWallet:H,onCopyAddress:k,onDisconnect:I,disconnectLabel:P,termsUrl:C,termsLabel:Z,privacyUrl:B,privacyLabel:be,portalStyle:nt,navContent:se,navPosition:ze,footerContent:Pe,view:J,setView:Ue,selectedSendToken:qe,setSelectedSendToken:ge,showPortfolio:Ze,portfolioTitle:ve,showTotalAssets:te,totalAssetsLabel:Q,sendTransaction:$e,getTransactionReceipt:pe,estimateGas:_e,onOutlink:ye}=Qe(),{tokens:me,isLoading:ke}=wt(r,g,d&&l),{statsMap:ne}=xt(r,l),{categoryMap:Se}=Pr(r,l),re=l&&te,{displayValue:ot,isLowerBound:Ce,isLoading:Ye}=Ir(r,g,d&&re),[Ve,He]=G.useState(!1),rt=G.useRef(null),[Ie,je]=G.useState(0),{holdings:Te,isLoading:Ke}=kr(r,g,d&&l&&f),Ge=G.useMemo(()=>Te.map(b=>b.token),[Te]),{imageMap:Me}=Cr(r,Ge,f&&Te.length>0),we=G.useMemo(()=>{let b=[],z=[],j=[],oe=new Map((T??[]).map(($,ee)=>[`${Ua($.chainId)}:${$.address.toLowerCase()}`,ee]));for(let $ of me){let ee=Po(r,$.chainId,$.symbol)!==void 0,ct=`${$.chainId}:${$.address.toLowerCase()}`,dt=oe.get(ct),Gn=new At.default($.quantity.numeric).shiftedBy(-$.quantity.decimals);if(ee)b.push($);else if(dt!==void 0)z.push($);else if(Gn.isGreaterThan(0)){if(!x&&Se.get(wo($.chainId,$.address))==="game")continue;j.push($)}}return b.sort(($,ee)=>{let ct=Po(r,$.chainId,$.symbol)??99,dt=Po(r,ee.chainId,ee.symbol)??99;return ct-dt}),z.sort(($,ee)=>{let ct=oe.get(`${$.chainId}:${$.address.toLowerCase()}`)??99,dt=oe.get(`${ee.chainId}:${ee.address.toLowerCase()}`)??99;return ct-dt}),j.sort(($,ee)=>{let ct=ne.get(ht($.chainId,$.address)),dt=ne.get(ht(ee.chainId,ee.address)),Gn=new At.default($.quantity.numeric).shiftedBy(-$.quantity.decimals).multipliedBy(ct?.price??0);return new At.default(ee.quantity.numeric).shiftedBy(-ee.quantity.decimals).multipliedBy(dt?.price??0).minus(Gn).toNumber()}),[...b,...z,...j]},[me,r,ne,x,Se,T]),Ae=G.useMemo(()=>{if(!f)return[];let b=new Set(me.map(z=>z.address.toLowerCase()));return[...Te].filter(z=>!b.has(z.token.toLowerCase())).sort((z,j)=>{let oe=new At.default(z.value);return new At.default(j.value).minus(oe).toNumber()})},[Te,f,me]),Ne=G.useRef(!1),Oe=G.useCallback(b=>{Ne.current=!0,Ue(b)},[Ue]),Hn=G.useCallback(()=>{ge(null),Oe("wallet")},[ge,Oe]),an=G.useCallback(b=>{ge(b),Oe("send")},[ge,Oe]),sn=G.useCallback(()=>{ge(null),Oe("wallet")},[ge,Oe]);G.useEffect(()=>{d||(Ne.current=!1)},[d]);let ln=G.useRef(null);G.useEffect(()=>{let b=ln.current;if(!b||!c)return;let z=j=>{j.pointerType==="touch"&&j.stopPropagation()};return b.addEventListener("pointerdown",z),()=>b.removeEventListener("pointerdown",z)},[c]);let[it,at]=G.useState(!1),Lt=G.useRef(void 0);G.useEffect(()=>()=>clearTimeout(Lt.current),[]),G.useEffect(()=>{let b=rt.current;if(!b||Pe===null){je(0);return}let z=()=>{je(b.offsetHeight)};if(z(),typeof ResizeObserver>"u")return;let j=new ResizeObserver(z);return j.observe(b),()=>j.disconnect()},[Pe]);let cn=G.useCallback(async()=>{if(!it)try{await navigator.clipboard.writeText(g),at(!0),clearTimeout(Lt.current),Lt.current=setTimeout(()=>at(!1),2e3),k?.(g,!0)}catch{k?.(g,!1)}},[g,k,it]),Ot=G.useCallback(b=>{b.currentTarget.setAttribute("data-loaded","true")},[]),jn=G.useMemo(()=>({background:Za(g)}),[g]),Ft=G.useMemo(()=>M||ut(r,g,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[M,r,g,i]),u=G.useMemo(()=>qa(ot),[ot]),R=C||B?(0,s.jsxs)("div",{className:"wi-legal-links",children:[C&&(0,s.jsx)("a",{className:"wi-legal-link",href:C,target:"_blank",rel:"noopener noreferrer",onClick:b=>De(b,C,{category:"terms",origin:"terms"},ye),children:Z}),C&&B&&(0,s.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),B&&(0,s.jsx)("a",{className:"wi-legal-link",href:B,target:"_blank",rel:"noopener noreferrer",onClick:b=>De(b,B,{category:"privacy",origin:"privacy"},ye),children:be})]}):null,O=I?(0,s.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{I(),N()},children:[(0,s.jsx)(Qo,{size:12}),(0,s.jsx)("span",{className:"wi-disconnect-label",children:P})]}):null,_=(0,s.jsxs)("div",{className:X("wi-view-inner",Ne.current&&"wi-view-wallet"),children:[re&&(()=>{let b=Ze;return(0,s.jsxs)(b?"button":"div",{...b?{type:"button",onClick:()=>Oe("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":b||void 0,children:[(0,s.jsxs)("div",{className:"wi-total-head",children:[(0,s.jsx)("span",{className:"wi-total-label",children:Q}),(0,s.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:j=>{j.stopPropagation(),He(oe=>!oe)},onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),j.stopPropagation(),He(oe=>!oe))},"aria-label":Ve?"Show balance":"Hide balance",children:Ve?(0,s.jsx)(or,{}):(0,s.jsx)(nr,{})})]}),(0,s.jsxs)("div",{className:"wi-total-body",children:[Ye?(0,s.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):(0,s.jsx)("div",{className:"wi-total-value","data-hidden":Ve||void 0,children:Ve?(0,s.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,s.jsxs)(s.Fragment,{children:[Ce&&(0,s.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,s.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,s.jsx)("span",{className:"wi-total-amount",children:u.main}),u.decimal&&(0,s.jsx)("span",{className:"wi-total-decimal",children:u.decimal})]})}),b&&(0,s.jsx)("span",{className:"wi-total-chevron","aria-hidden":!0,children:(0,s.jsx)(er,{size:18})})]})]})})(),ze==="top"&&se&&(0,s.jsx)("div",{className:"wi-nav-fixed",children:se}),l&&(0,s.jsx)("div",{ref:ln,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,s.jsxs)("div",{className:"wi-token-list",children:[ke&&Array.from({length:5},(b,z)=>(0,s.jsxs)("div",{className:"wi-skeleton-item",children:[(0,s.jsxs)("div",{className:"wi-skeleton-left",children:[(0,s.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,s.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,s.jsxs)("div",{className:"wi-skeleton-right",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},z)),!ke&&we.length===0&&!f&&(0,s.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),we.map(b=>{let z=ne.get(ht(b.chainId,b.address)),j=z?parseFloat(z.percent_change_24h):null,oe=j!==null&&j>=0,$=Jn(r,b.chainId);return(0,s.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>an(b),"aria-label":`Send ${b.symbol}`,children:[(0,s.jsxs)("div",{className:"wi-token-left",children:[(0,s.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,s.jsx)("img",{src:b.icon_url,alt:b.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Ot,onError:ee=>{ee.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),$&&(0,s.jsx)("img",{src:$,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:ee=>{ee.currentTarget.style.display="none"}})]}),(0,s.jsxs)("div",{className:"wi-token-info",children:[(0,s.jsx)("span",{className:"wi-token-name",children:b.symbol}),z&&(0,s.jsxs)("div",{className:"wi-token-price-row",children:[(0,s.jsx)("span",{className:"wi-token-price",children:Qn(z.price)}),(0,s.jsx)("span",{className:"wi-token-change","data-positive":oe,"data-zero":j===0||void 0,children:j!==null&&(j===0?"0%":`${oe?"+":"-"}${(oe?Math.floor:Math.ceil)(Math.abs(j)*100)/100}%`)})]})]})]}),(0,s.jsxs)("div",{className:"wi-token-right",children:[(0,s.jsx)("span",{className:"wi-token-balance",children:ft(b.quantity.numeric,b.quantity.decimals)}),z&&(0,s.jsx)("span",{className:"wi-token-value",children:qo(b.quantity.numeric,b.quantity.decimals,z.price)})]})]},`${b.address}-${b.chainId}`)}),f&&Ke&&Array.from({length:3},(b,z)=>(0,s.jsxs)("div",{className:"wi-skeleton-item",children:[(0,s.jsxs)("div",{className:"wi-skeleton-left",children:[(0,s.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,s.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,s.jsxs)("div",{className:"wi-skeleton-right",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${z}`)),f&&!Ke&&!ke&&we.length===0&&Ae.length===0&&(0,s.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),f&&Ae.map(b=>{let z=Me.get(b.token)||"",j=Jn(r,ue[r].cross);return(0,s.jsxs)("div",{className:"wi-token-item",children:[(0,s.jsxs)("div",{className:"wi-token-left",children:[(0,s.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,s.jsx)("img",{src:z||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:b.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Ot,onError:oe=>{oe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),j&&(0,s.jsx)("img",{src:j,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:oe=>{oe.currentTarget.style.display="none"}})]}),(0,s.jsxs)("div",{className:"wi-token-info",children:[(0,s.jsx)("span",{className:"wi-token-name",children:b.token_name}),(0,s.jsx)("div",{className:"wi-token-price-row",children:(0,s.jsxs)("span",{className:"wi-token-price",children:[ft(b.current_price,18)," CROSS"]})})]})]}),(0,s.jsxs)("div",{className:"wi-token-right",children:[(0,s.jsx)("span",{className:"wi-token-balance",children:ft(b.balance,18)}),(0,s.jsx)("span",{className:"wi-token-value",children:Qn(b.current_value_usd)})]})]},`forge-${b.token}`)})]})}),ze==="bottom"&&se&&(0,s.jsx)("div",{className:"wi-nav-fixed",children:se}),O&&(0,s.jsx)("div",{className:"wi-wallet-disconnect-row",children:O})]},"wallet"),q=Ze?(0,s.jsx)("div",{className:X("wi-view-inner wi-portfolio-body",Ne.current&&"wi-view-portfolio"),children:(0,s.jsx)(vt,{env:r,theme:i,walletAddress:g,showHeader:!1,onOutlink:ye})},"portfolio"):null,ie=qe?(0,s.jsx)("div",{className:X("wi-view-inner wi-send-body",Ne.current&&"wi-view-send"),children:(0,s.jsx)(Ut,{env:r,theme:i,walletAddress:g,accountName:w,accounts:L,token:qe,tokens:we,onTokenChange:ge,sendTransaction:$e,getTransactionReceipt:pe,estimateGas:_e,onConfirmSuccess:sn,onOutlink:ye})},"send"):null,st=(0,s.jsx)("div",{className:X("wi-view-inner wi-qr-body",Ne.current&&"wi-view-qr"),children:(0,s.jsxs)("div",{className:"wi-qr-section",children:[(0,s.jsxs)("div",{className:"wi-qr-card",children:[(0,s.jsxs)("div",{className:"wi-qr-code",children:[(0,s.jsx)(di.QRCodeSVG,{value:g,size:180,level:"H",marginSize:2,...y&&{imageSettings:{src:y,height:33,width:33,excavate:!0}}}),!y&&(0,s.jsx)("div",{className:"wi-qr-logo",children:(0,s.jsx)(rr,{size:33})})]}),(0,s.jsx)("p",{className:"wi-qr-address",children:g}),(0,s.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:cn,children:[(0,s.jsx)("span",{className:"wi-qr-copy-icon",children:it?(0,s.jsx)(Ht,{size:16}):(0,s.jsx)(eo,{size:16})}),(0,s.jsx)("span",{className:"wi-qr-copy-text",children:it?"Copied!":"Copy address"})]})]}),R]})},"qr"),le=J==="qr"||J==="portfolio"||J==="send",lt=Pe!==null?(0,s.jsx)("div",{className:"wi-builtin-footer",children:Pe}):null,Dt=!!H&&w?.trim().toLowerCase()!=="my wallet",Wt=(0,s.jsxs)("div",{className:"wi-account-text",children:[Dt?(0,s.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:H,"aria-label":"Switch account",children:[(0,s.jsx)("span",{className:"wi-account-name",children:w??"Account 1"}),(0,s.jsx)("span",{className:"wi-account-switch","aria-hidden":"true",children:(0,s.jsx)(tr,{size:12})})]}):(0,s.jsx)("div",{className:"wi-account-row",children:(0,s.jsx)("span",{className:"wi-account-name",children:w??"Account 1"})}),(0,s.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:cn,"aria-label":"Copy address",children:[(0,s.jsx)("span",{className:"wi-account-address",children:Le(g)}),(0,s.jsx)("span",{className:"wi-account-copy",children:it?(0,s.jsx)(Ht,{size:14}):(0,s.jsx)(eo,{size:14})})]})]}),pn=(0,s.jsxs)(s.Fragment,{children:[n,le?(0,s.jsxs)("div",{className:"wi-sticky-header",children:[(0,s.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,s.jsx)("button",{type:"button",className:"wi-header-back",onClick:Hn,"aria-label":"Back",children:(0,s.jsx)(Jo,{})}),(0,s.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:Wt}),(0,s.jsx)("button",{type:"button",className:"wi-header-action",onClick:N,"aria-label":"Close",children:(0,s.jsx)(to,{size:24})})]}),(0,s.jsx)("hr",{className:"wi-divider"})]}):(0,s.jsxs)("div",{className:"wi-sticky-header",children:[(0,s.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,s.jsxs)("div",{className:"wi-account-block",children:[(0,s.jsxs)("div",{className:"wi-avatar",children:[(0,s.jsx)("div",{className:"wi-avatar-fallback",style:jn}),Ft&&(0,s.jsx)("img",{src:Ft,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:Ot,onError:b=>{b.currentTarget.style.display="none"}})]}),Wt]}),(0,s.jsxs)("div",{className:"wi-header-actions",children:[h&&(0,s.jsx)("button",{type:"button",className:"wi-header-action",onClick:()=>Oe("qr"),"aria-label":"Show QR code",children:(0,s.jsx)(Xo,{size:20})}),(0,s.jsx)("button",{type:"button",className:"wi-header-action",onClick:N,"aria-label":"Close",children:(0,s.jsx)(to,{size:24})})]})]}),(0,s.jsx)("hr",{className:"wi-divider"})]}),(0,s.jsxs)("div",{className:"wi-view-container",children:[J==="wallet"&&_,J==="qr"&&st,J==="portfolio"&&q,J==="send"&&ie]}),lt&&J!=="portfolio"&&J!=="send"&&(0,s.jsx)("div",{className:"wi-sticky-footer",children:(0,s.jsx)("div",{className:"wi-footer",ref:rt,children:lt})})]}),Rt={...nt,...Ie>0?{"--wi-footer-height":`${Ie}px`}:null};return c?(0,s.jsxs)(Yt.Drawer.Portal,{children:[p&&(0,s.jsx)(Yt.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,s.jsxs)(Yt.Drawer.Content,{className:X("wi-drawer-content",o),"data-theme":i,style:Rt,"data-direction":m,"data-no-balance":!l||void 0,"data-has-footer":Ie>0||void 0,"data-view":J,children:[(0,s.jsx)(Yt.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),pn]})]}):(0,s.jsxs)(s.Fragment,{children:[p&&d&&(0,s.jsx)("div",{className:"wi-drawer-overlay",onClick:N}),(0,s.jsx)(Fn.Portal,{children:(0,s.jsx)(Fn.Content,{align:e,sideOffset:t,className:X("wi-popover-content",o),"data-theme":i,style:Rt,"data-no-balance":!l||void 0,"data-has-footer":Ie>0||void 0,"data-view":J,children:pn})})]})}var mi=U(require("react"),1);function fi({position:e="top",children:t}){let{setNavContent:o,setNavPosition:n}=Qe();return mi.useEffect(()=>(o(t),n(e),()=>o(null)),[t,e,o,n]),null}var ui=U(require("react"),1);function gi({children:e}){let{setFooterContent:t}=Qe();return ui.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}F(`[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
+ `);F(`.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
+ `);F(`@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
+ `);F(`.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
+ `);F(`.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
+ `);var Dn=require("react/jsx-runtime"),Ya="https://terms.crosstoken.io/docs/cross-terms-of-use",Ka="https://terms.crosstoken.io/docs/nexus-privacy-policy";function Qa({env:e,theme:t="dark",mobileBreakpoint:o=768,drawerDirection:n,modal:r,showBalance:i=!1,showForgeToken:c=!1,showGameToken:d=!0,showQR:m=!0,qrLogoSrc:p,walletAddress:l,accountName:f,sendAccounts:x,profileImageUrl:h,connectorId:y,connectorName:g,connectorIconUrl:w,preferredTokens:L=[],onSelectWallet:M,onCopyAddress:T,onDisconnect:N,disconnectLabel:H="Disconnect",termsUrl:k=Ya,termsLabel:I="Terms of Service",privacyUrl:P=Ka,privacyLabel:C="Privacy Policy",open:Z,onOpenChange:B,showPortfolio:be=!1,portfolioTitle:nt="My Portfolio",showTotalAssets:se=!0,totalAssetsLabel:ze="Total Assets USD",sendTransaction:Pe,getTransactionReceipt:J,estimateGas:Ue,onOutlink:qe,style:ge,children:Ze}){let ve=fe(e),te=y?Vt[y]:void 0,Q=g??te?.name,$e=w??te?.iconUrl,pe=Et(`(max-width: ${o}px)`),_e=n??(i?"right":"bottom"),ye=r??!1,me=Z!==void 0,[ke,ne]=de.useState(!1),Se=me?Z:ke,re=de.useCallback(Ae=>{me||ne(Ae),B?.(Ae)},[me,B]),ot=de.useCallback(()=>re(!1),[re]),[Ce,Ye]=de.useState(null),[Ve,He]=de.useState("top"),[rt,Ie]=de.useState(null),[je,Te]=de.useState("wallet"),[Ke,Ge]=de.useState(null);de.useEffect(()=>{Se||(Te("wallet"),Ge(null))},[Se]);let Me=de.useCallback(()=>{ao(l),N?.()},[N,l]),we=de.useMemo(()=>({env:ve,theme:t,isMobile:pe,open:Se,drawerDirection:_e,modal:ye,showBalance:i,showForgeToken:c,showGameToken:d,showQR:m,qrLogoSrc:p,walletAddress:l,accountName:f,sendAccounts:x,profileImageUrl:h,connectorName:Q,connectorIconUrl:$e,preferredTokens:L,close:ot,onSelectWallet:M,onCopyAddress:T,onDisconnect:N?Me:void 0,disconnectLabel:H,termsUrl:k,termsLabel:I,privacyUrl:P,privacyLabel:C,portalStyle:ge,navContent:Ce,navPosition:Ve,setNavContent:Ye,setNavPosition:He,footerContent:rt,setFooterContent:Ie,view:je,setView:Te,selectedSendToken:Ke,setSelectedSendToken:Ge,showPortfolio:be,portfolioTitle:nt,showTotalAssets:se,totalAssetsLabel:ze,sendTransaction:Pe,getTransactionReceipt:J,estimateGas:Ue,onOutlink:qe}),[ve,t,pe,Se,_e,ye,i,c,d,m,p,l,f,x,h,Q,$e,L,ot,M,T,N,Me,H,k,I,P,C,ge,Ce,Ve,rt,je,Ke,be,nt,se,ze,Pe,J,Ue,qe]);return(0,Dn.jsx)(Kn.Provider,{value:we,children:pe?(0,Dn.jsx)(hi.Drawer.Root,{direction:_e,open:Se,onOpenChange:re,noBodyStyles:!0,repositionInputs:!1,children:Ze},"drawer"):(0,Dn.jsx)(wi.Root,{open:Se,onOpenChange:re,children:Ze},"popover")})}var Ct=Object.assign(Qa,{Trigger:xr,Content:pi,Nav:fi,Footer:gi});var Be=U(require("react"),1),Mi=U(require("@radix-ui/react-dialog"),1),Ai=require("vaul");var Wn=require("react"),Bn=(0,Wn.createContext)(null);function Kt(){let e=(0,Wn.useContext)(Bn);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var Nt=require("react");function Qt(){let[e,t]=(0,Nt.useState)([]),[o,n]=(0,Nt.useState)(!0);(0,Nt.useEffect)(()=>{if(typeof window>"u"){n(!1);return}let i=[],c=m=>{let{info:p}=m.detail;p?.rdns&&!i.some(l=>l.rdns===p.rdns)&&(i.push({rdns:p.rdns,name:p.name,icon:p.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",c),window.addEventListener("eip6963:crossAnnounceProvider",c),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let d=setTimeout(()=>n(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",c),window.removeEventListener("eip6963:crossAnnounceProvider",c),clearTimeout(d)}},[]);let r=(0,Nt.useCallback)(i=>e.some(c=>c.rdns===i),[e]);return{wallets:e,isDetected:r,isLoading:o}}var xi=U(require("@radix-ui/react-dialog"),1),bi=require("vaul");var So=require("react/jsx-runtime");function vi({asChild:e,children:t}){let{isMobile:o}=Kt(),n=o?bi.Drawer.Trigger:xi.Trigger;return(0,So.jsx)(n,{asChild:e??t!=null,children:t??(0,So.jsx)("button",{type:"button",children:"Connect Wallet"})})}var We=U(require("@radix-ui/react-dialog"),1),Xt=require("vaul");var S=require("react/jsx-runtime");function zn(){return(0,S.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,S.jsx)("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 yi(){return(0,S.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,S.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,S.jsx)("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"}),(0,S.jsx)("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"}),(0,S.jsx)("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"}),(0,S.jsx)("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"}),(0,S.jsx)("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"}),(0,S.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,S.jsx)("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"})]}),(0,S.jsx)("defs",{children:(0,S.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,S.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function ki(){return(0,S.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsx)("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),(0,S.jsx)("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),(0,S.jsx)("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),(0,S.jsx)("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),(0,S.jsx)("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 Ci(){return(0,S.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,S.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,S.jsx)("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"}),(0,S.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,S.jsx)("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 Ni(){return(0,S.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,S.jsx)("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"}),(0,S.jsx)("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"})]}),(0,S.jsx)("defs",{children:(0,S.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,S.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function Li(){return(0,S.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsx)("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"}),(0,S.jsx)("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"}),(0,S.jsx)("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"}),(0,S.jsx)("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 Ri(){return(0,S.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,S.jsx)("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 Ei(){return(0,S.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,S.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var $n={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:zn},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:zn,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:zn,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:yi,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:ki},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Ci,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Ni,badge:"For SHOP"}};function Io(e){return $n[e]}var Vn={google:{id:"google",name:"Google",icon:Li},apple:{id:"apple",name:"Apple",icon:Ri}};function Pi(e){return Vn[e]}var v=require("react/jsx-runtime");function Xa({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(0,v.jsxs)("button",{type:"button",className:X("wcm-wallet-item",i&&"wcm-wallet-item--featured"),onClick:n,children:[(0,v.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,v.jsx)("div",{className:"wcm-wallet-icon",children:(0,v.jsx)(r,{})}),(0,v.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,v.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,v.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?(0,v.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,v.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function Ja({social:e,onSignIn:t}){let o=e.icon,n=`Sign in with ${e.name}`;return(0,v.jsxs)("button",{type:"button",className:"wcm-social-item",onClick:t,"aria-label":n,children:[(0,v.jsx)("span",{className:"wcm-social-icon",children:(0,v.jsx)(o,{})}),(0,v.jsx)("span",{className:"wcm-social-name",children:n})]})}function Si(){let{wallets:e,activeWalletIds:t,socialProviders:o,activeSocialIds:n,termsUrl:r,privacyUrl:i,isDetected:c,close:d,isMobile:m}=Kt(),p=t.filter(x=>{let h=Io(x).visibility;return!h||h==="always"?!0:h==="desktop-only"?!m:h==="mobile-only"?m:!0}),l=n.length>0,f=p.length>0;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{className:"wcm-header",children:[(0,v.jsxs)("div",{className:"wcm-header-text",children:[(0,v.jsx)("h2",{className:"wcm-title",children:"CROSS Wallet"}),!m&&(0,v.jsx)("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),(0,v.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:d,"aria-label":"Close",children:(0,v.jsx)(Ei,{})})]}),(0,v.jsx)("div",{className:"wcm-divider"}),(0,v.jsxs)("div",{className:"wcm-body",children:[l&&(0,v.jsxs)(v.Fragment,{children:[!m&&(0,v.jsxs)("div",{className:"wcm-section-header",children:[(0,v.jsx)("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),(0,v.jsx)("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),(0,v.jsx)("div",{className:"wcm-social-grid",children:n.map(x=>{let h=Pi(x);return(0,v.jsx)(Ja,{social:h,onSignIn:()=>{o[x]?.(),d()}},x)})}),f&&(0,v.jsxs)("div",{className:"wcm-separator",children:[(0,v.jsx)("div",{className:"wcm-separator-line"}),(0,v.jsx)("span",{className:"wcm-separator-text",children:"Other Wallets"}),(0,v.jsx)("div",{className:"wcm-separator-line"})]})]}),f&&(0,v.jsx)("div",{className:"wcm-wallet-list",children:p.map(x=>{let h=Io(x),y=h.rdns?c(h.rdns):!1;return(0,v.jsx)(Xa,{wallet:h,detected:y,onConnect:()=>{e[x]?.(),d()}},x)})}),(0,v.jsxs)("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",(0,v.jsx)(Ii,{href:r,children:"Terms of Service"})," and consent to its ",(0,v.jsx)(Ii,{href:i,children:"Privacy Policy"}),"."]})]})]})}function Ii({href:e,children:t}){return e?(0,v.jsx)("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):(0,v.jsx)("span",{className:"wcm-terms-link",children:t})}function Ti({className:e}){let{isMobile:t,theme:o,portalStyle:n}=Kt();return t?(0,v.jsxs)(Xt.Drawer.Portal,{children:[(0,v.jsx)(Xt.Drawer.Overlay,{className:"wcm-overlay"}),(0,v.jsxs)(Xt.Drawer.Content,{className:X("wcm-drawer-content",e),"data-theme":o,style:n,children:[(0,v.jsx)(Xt.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,v.jsx)("div",{className:"wcm-drawer-handle"}),(0,v.jsx)("div",{className:"wcm-drawer-body",children:(0,v.jsx)(Si,{})})]})]}):(0,v.jsxs)(We.Portal,{children:[(0,v.jsx)(We.Overlay,{className:"wcm-overlay"}),(0,v.jsxs)(We.Content,{className:X("wcm-dialog-content",e),"data-theme":o,style:n,children:[(0,v.jsx)(We.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,v.jsx)(We.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),(0,v.jsx)("div",{className:"wcm-dialog-body",children:(0,v.jsx)(Si,{})})]})]})}F(`[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
+ `);F(`.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,.wcm-wallet-item--featured{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
+ `);F(`@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
+ `);var _t=require("react/jsx-runtime"),es={};function ts({wallets:e,socialProviders:t=es,termsUrl:o,privacyUrl:n,theme:r="dark",mobileBreakpoint:i=768,drawerDirection:c="bottom",dialogWidth:d,drawerMaxWidth:m,drawerMinWidth:p,style:l,open:f,onOpenChange:x,children:h}){let y=Et(`(max-width: ${i}px)`),[g,w]=Be.useState(!1),L=f!==void 0,M=L?f:g,T=Be.useCallback(B=>{L||w(B),x?.(B)},[L,x]),N=Be.useCallback(()=>T(!1),[T]),{isDetected:H}=Qt(),k=Be.useMemo(()=>Object.keys(e),[e]),I=Be.useMemo(()=>Object.keys(t),[t]),P=Be.useMemo(()=>{let B={};return d&&(B["--wcm-dialog-width"]=d),m&&(B["--wcm-drawer-max-width"]=m),p&&(B["--wcm-drawer-min-width"]=p),{...B,...l}},[d,m,p,l]),C=Be.useMemo(()=>({theme:r,isMobile:y,open:M,setOpen:T,close:N,wallets:e,activeWalletIds:k,socialProviders:t,activeSocialIds:I,termsUrl:o,privacyUrl:n,isDetected:H,portalStyle:P}),[r,y,M,T,N,e,k,t,I,o,n,H,P]),Z=(0,_t.jsx)("div",{"data-theme":r,style:P,children:h});return y?(0,_t.jsx)(Bn.Provider,{value:C,children:(0,_t.jsx)(Ai.Drawer.Root,{direction:c,open:M,onOpenChange:T,noBodyStyles:!0,children:Z},"drawer")}):(0,_t.jsx)(Bn.Provider,{value:C,children:(0,_t.jsx)(Mi.Root,{open:M,onOpenChange:T,children:Z})})}var To=Object.assign(ts,{Trigger:vi,Content:Ti});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>',os='<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>',is='<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>',as='<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 Jt(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var en=Jt(ns),tn=Jt(os),nn=Jt(rs),on=Jt(is),rn=Jt(as);var xe=require("react/jsx-runtime");function Mo({isConnecting:e,address:t,provider:o,providerName:n,accountName:r,sendAccounts:i,onConnect:c,onDisconnect:d,onCopy:m,onSelectWallet:p,label:l="Connect Wallet",connectingLabel:f="Connecting...",disconnectLabel:x,className:h,theme:y="dark",env:g,showBalance:w=!0,showPortfolio:L,drawerDirection:M,modal:T,connectorId:N,style:H,sendTransaction:k,getTransactionReceipt:I,estimateGas:P}){if(e)return(0,xe.jsxs)("button",{type:"button",disabled:!0,className:h,style:h?void 0:{...tt.button,...tt.buttonLoading},"aria-busy":"true",children:[(0,xe.jsx)("style",{children:ds}),(0,xe.jsx)("span",{style:tt.spinner,"aria-hidden":"true"}),f]});if(t){let C=n??cs(o),Z=o?ss[o]:void 0;return(0,xe.jsxs)(Ct,{env:g,theme:y,drawerDirection:M,modal:T,showBalance:w,showPortfolio:L,walletAddress:t,accountName:r,sendAccounts:i,connectorId:N,onSelectWallet:p,onCopyAddress:m?(B,be)=>{be&&m()}:void 0,onDisconnect:d,disconnectLabel:x,style:H,sendTransaction:k,getTransactionReceipt:I,estimateGas:P,children:[(0,xe.jsx)(Ct.Trigger,{asChild:!0,children:(0,xe.jsxs)("button",{type:"button",className:h,style:h?void 0:tt.connectedBtn,"aria-label":`Connected with ${C}: ${_i(t)}`,children:[Z?(0,xe.jsx)("img",{src:Z,alt:"",width:20,height:20,style:tt.connectedIcon}):(0,xe.jsx)("span",{style:tt.connectedIconPlaceholder,"aria-hidden":"true"}),(0,xe.jsx)("span",{style:tt.connectedAddress,children:_i(t)})]})}),(0,xe.jsx)(Ct.Content,{align:"end",sideOffset:8})]})}return(0,xe.jsx)("button",{type:"button",onClick:c,className:h,style:h?void 0:tt.button,children:l})}var ss={google:on,apple:rn,cross:en,metamask:tn,binance:nn},ls={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function cs(e){return e?ls[e]:"Wallet"}function _i(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var ds="@keyframes cross-cb-spin{to{transform:rotate(360deg)}}",tt={button:{padding:"10px 24px",borderRadius:"12px",border:"none",background:"#00D5AA",color:"#000",fontWeight:700,fontSize:"14px",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.15s",fontFamily:"inherit"},buttonLoading:{opacity:.7,cursor:"default"},spinner:{display:"inline-block",width:"14px",height:"14px",border:"2px solid #00000030",borderTopColor:"#000",borderRadius:"50%",animation:"cross-cb-spin 0.6s linear infinite"},connectedBtn:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"8px 14px",borderRadius:"999px",border:"1px solid var(--wi-border-default, #2a2d3a)",background:"var(--wi-surface-default, #1e232e)",color:"var(--wi-texticon-primary, #ffffff)",fontWeight:600,fontSize:"14px",cursor:"pointer",fontFamily:"inherit"},connectedIcon:{width:"20px",height:"20px",borderRadius:"50%",objectFit:"contain",flexShrink:0,background:"transparent"},connectedIconPlaceholder:{display:"inline-block",width:"20px",height:"20px",borderRadius:"50%",background:"var(--wi-surface-subtle, #2a2d3a)",flexShrink:0},connectedAddress:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"13px",letterSpacing:"0.02em"}};0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,GOOGLE_ICON,METAMASK_ICON,SOCIAL_REGISTRY,SendPage,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});