@nexus-cross/dapp-ui 1.0.1-beta.1 → 1.0.1-beta.2

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,14 +1,14 @@
1
- "use strict";var Pn=Object.create;var vt=Object.defineProperty;var Rn=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var En=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty;var Sn=(e,t)=>{for(var o in t)vt(e,o,{get:t[o],enumerable:!0})},Wo=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Tn(t))!Mn.call(e,n)&&n!==o&&vt(e,n,{get:()=>t[n],enumerable:!(r=Rn(t,n))||r.enumerable});return e};var D=(e,t,o)=>(o=e!=null?Pn(En(e)):{},Wo(t||!e||!e.__esModule?vt(o,"default",{value:e,enumerable:!0}):o,e)),_n=e=>Wo(vt({},"__esModule",{value:!0}),e);var Ni={};Sn(Ni,{APPLE_ICON:()=>dt,AppLauncher:()=>eo,AppLauncherContent:()=>oo,AppLauncherTrigger:()=>to,BINANCE_ICON:()=>ct,CONNECTOR_REGISTRY:()=>Je,CROSSX_ICON:()=>st,ConnectButton:()=>Po,ConnectorId:()=>Pt,GOOGLE_ICON:()=>pt,METAMASK_ICON:()=>lt,TOKEN_STATS_QUERY_KEY:()=>Mt,USER_BALANCE_QUERY_KEY:()=>Tt,WALLET_REGISTRY:()=>jt,WalletConnectModal:()=>Io,WalletInfo:()=>Me,WalletPortfolio:()=>Co,WalletPortfolioBody:()=>Re,useGlobalMenu:()=>Xe,useTokenBalance:()=>Ne,useTokenStats:()=>Pe,useWalletDetect:()=>nt});module.exports=_n(Ni);var Oe=D(require("react"),1),Do=D(require("@radix-ui/react-popover"),1),Ao=require("vaul");var yt=require("react"),Jt=(0,yt.createContext)(null);function kt(){let e=(0,yt.useContext)(Jt);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var Ct=require("react");function Ae(e){let[t,o]=(0,Ct.useState)(!1);return(0,Ct.useEffect)(()=>{let r=window.matchMedia(e);o(r.matches);let n=c=>o(c.matches);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[e]),t}function E(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}E(`[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
- `);E(`.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
- `);E(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
- `);E(`.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
- `);E("");var Lt=require("react/jsx-runtime");function eo({env:e="production",theme:t="dark",mobileBreakpoint:o=768,domain:r,children:n}){let c=Ae(`(max-width: ${o}px)`),[l,a]=Oe.useState(!1),s=Oe.useCallback(()=>a(!1),[]),d=Oe.useMemo(()=>({env:e,theme:t,isMobile:c,open:l,domain:r,close:s}),[e,t,c,l,r,s]);return(0,Lt.jsx)(Jt.Provider,{value:d,children:c?(0,Lt.jsx)(Ao.Drawer.Root,{direction:"right",open:l,onOpenChange:a,noBodyStyles:!0,children:n},"drawer"):(0,Lt.jsx)(Do.Root,{open:l,onOpenChange:a,children:n},"popover")})}var Vo=D(require("@radix-ui/react-popover"),1),Ho=require("vaul");var j=require("react/jsx-runtime");function Oo({size:e=18}){return(0,j.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,j.jsx)("rect",{width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function Fo(){return(0,j.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,j.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Bo(){return(0,j.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,j.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Qe=require("react/jsx-runtime");function to({asChild:e,children:t}){let{isMobile:o,theme:r}=kt(),n=t!=null,c=e??!0,l=n?t:(0,Qe.jsx)("button",{type:"button",className:"al-trigger-btn","data-theme":r,children:(0,Qe.jsx)(Oo,{size:o?12:18})});return o?(0,Qe.jsx)(Ho.Drawer.Trigger,{asChild:c,children:l}):(0,Qe.jsx)(Vo.Trigger,{asChild:c,children:l})}var Ce=D(require("react"),1),Nt=D(require("@radix-ui/react-popover"),1),ke=require("vaul");var $o=require("@tanstack/react-query");var Uo={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"};function Xe(e="production"){return(0,$o.useQuery)({queryKey:["global-menu",e],queryFn:async({signal:t})=>{let o=await fetch(Uo[e],{cache:"no-store",signal:t});if(!o.ok)throw new Error(`Failed to fetch global menu: ${o.status}`);return o.json()},staleTime:0,gcTime:0,refetchOnMount:!0})}function $(...e){return e.filter(Boolean).join(" ")}var F=require("react/jsx-runtime");function oo({align:e="end",sideOffset:t=12,className:o}){let{env:r,theme:n,isMobile:c,domain:l,close:a}=kt(),{data:s}=Xe(r),d=Ce.useMemo(()=>(s?.items??[]).sort((u,C)=>u.order-C.order),[s]),p=8,m=Ce.useRef(null),y=Ce.useCallback(u=>{m.current={x:u.clientX,y:u.clientY}},[]),L=typeof window<"u"?window.location.pathname:"",b=Ce.useCallback((u,C)=>{if(m.current){let h=u.clientX-m.current.x,A=u.clientY-m.current.y;if(m.current=null,Math.abs(h)>p||Math.abs(A)>p)return}let _=C.url[r]??C.url.production,M=qo(_,l);if(!M)try{let h=new URL(_).pathname;if(L===h||L.startsWith(h+"/")){a();return}}catch{}M?window.open(_,"_blank","noopener,noreferrer"):window.location.href=_,a()},[r,l,a,L]),f=(0,F.jsx)("div",{className:"al-grid","data-theme":n,children:d.map(u=>{let C=u.url[r]??u.url.production,_=qo(C,l),M=!1;if(!_)try{let h=new URL(C).pathname;M=L===h||L.startsWith(h+"/")}catch{M=!1}return(0,F.jsxs)("button",{type:"button",className:"al-grid-item","data-active":M||void 0,onPointerDown:y,onClick:h=>b(h,u),children:[(0,F.jsxs)("div",{className:"al-grid-item-left",children:[(0,F.jsx)("div",{className:"al-grid-item-icon",children:(0,F.jsx)("img",{src:u.iconUrl,alt:u.label,width:24,height:24,loading:"lazy"})}),(0,F.jsx)("span",{className:"al-grid-item-label",children:u.label}),u.isNew&&(0,F.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,F.jsx)("div",{className:"al-grid-item-right",children:u.badge&&(0,F.jsx)("span",{className:"al-badge",children:u.badge})})]},u.id)})});return c?(0,F.jsxs)(ke.Drawer.Portal,{children:[(0,F.jsx)(ke.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,F.jsxs)(ke.Drawer.Content,{className:$("al-drawer-content",o),"data-theme":n,children:[(0,F.jsxs)("div",{className:"al-drawer-header",children:[(0,F.jsx)(ke.Drawer.Close,{className:"al-drawer-close",children:(0,F.jsx)(Fo,{})}),(0,F.jsx)(ke.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,F.jsx)(ke.Drawer.Close,{className:"al-drawer-close",children:(0,F.jsx)(Bo,{})})]}),(0,F.jsx)("div",{className:"al-drawer-body",children:f})]})]}):(0,F.jsx)(Nt.Portal,{children:(0,F.jsx)(Nt.Content,{align:e,sideOffset:t,className:$("al-popover-content",o),"data-theme":n,children:f})})}function qo(e,t){try{let o=new URL(e).hostname;return typeof window>"u"?!0:o!==(t??window.location.hostname)}catch{return!1}}var Y=D(require("react"),1),rn=D(require("@radix-ui/react-popover"),1),nn=require("vaul");var It=require("react"),ro=(0,It.createContext)(null);function le(){let e=(0,It.useContext)(ro);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Pt=(r=>(r.CROSSx="crossx",r.MetaMask="io.metamask",r.Binance="com.binance.wallet",r))(Pt||{}),Je={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 or=D(require("@radix-ui/react-popover"),1),rr=require("vaul");var R=require("react/jsx-runtime");function zo({size:e=16,className:t}){return(0,R.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,R.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,R.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 no({size:e=16,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.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 io({size:e=16,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function ao({size:e=24,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function jo({size:e=20,className:t}){return(0,R.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,R.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,R.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 Go({size:e=20,className:t}){return(0,R.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,R.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 Zo({size:e=20,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ko({size:e=20,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Yo({size:e=20,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Qo({size:e=16,className:t}){return(0,R.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,R.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,R.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 Xo({size:e=16,className:t}){return(0,R.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,R.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,R.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Jo({size:e=42,className:t}){return(0,R.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,R.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 ce=D(require("bignumber.js"),1);function Wn(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 Rt(e,t){if(!e||e==="0")return"0.00";let o=new ce.default(e).shiftedBy(-t),r=o.isGreaterThanOrEqualTo(1)?2:4;return o.toFormat(r,ce.default.ROUND_DOWN)}function Fe(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function so(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let o=t>=1?2:4,r=Math.pow(10,o);return`$${(Math.floor(t*r)/r).toLocaleString("en-US",{minimumFractionDigits:o,maximumFractionDigits:o})}`}function er(e,t,o){let n=new ce.default(e).shiftedBy(-t).multipliedBy(new ce.default(o));return n.isZero()||n.isNaN()?"$0.00":`$${(n.integerValue(ce.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?n.decimalPlaces(2,ce.default.ROUND_DOWN):n.decimalPlaces(4,ce.default.ROUND_DOWN)).toFormat()}`}function tr(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=Wn(l.toFixed(18))}let[r="0",n=""]=o.split(".");if(Number(r)>=1){let l=n.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(r).toLocaleString("en-US")}.${l}`,isLowerBound:!1}}return n.length<4?{displayValue:`${r}.${n}`,isLowerBound:!1}:n.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${n.slice(0,4)}`,isLowerBound:!1}}var Le=require("react/jsx-runtime");function nr({asChild:e,className:t,children:o}){let{isMobile:r,theme:n,walletAddress:c}=le(),l=o!=null,a=e??!0,s=l?o:(0,Le.jsxs)("button",{type:"button",className:$("wi-trigger-btn",t),"data-theme":n,"data-mobile":r||void 0,children:[(0,Le.jsx)(zo,{size:r?14:16}),(0,Le.jsx)("span",{className:"wi-trigger-address",children:Fe(c)})]});return r?(0,Le.jsx)(rr.Drawer.Trigger,{asChild:a,children:s}):(0,Le.jsx)(or.Trigger,{asChild:a,children:s})}var B=D(require("react"),1),Ht=D(require("@radix-ui/react-popover"),1),ot=require("vaul");var Ve=D(require("bignumber.js"),1);var sr=require("@tanstack/react-query"),lr=require("react");var ee={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},X={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var lo={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"},ir={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function co(e,t){let o=X[e];if(t===o.cross)return ir.cross;if(t===o.bsc)return ir.bsc}var Dn={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function ar(e,t,o={}){if(!t||!t.startsWith("0x"))return;let{size:r=120,bg:n,format:c="png"}=o,l=Dn[e],a=n?`&bg=${n}`:"";return`${l}/portrait/evm/${t}.${c}?size=${r}${a}`}var Tt="user-balance";async function An(e,t,o,r){let n=new URLSearchParams({networkId:`eip155:${t}`,account:o}),c=await fetch(`${e}/v1/public/token/balance?${n}`,{cache:"no-store",signal:r});if(!c.ok)throw new Error(`Failed to fetch token balance: ${c.status}`);let l=await c.json();if(l.code!==200)throw new Error(`Token balance API error: ${l.code}`);return l.data}function Ne(e,t,o=!0){let r=ee[e],n=X[e],c=[n.cross,n.bsc],l=(0,sr.useQueries)({queries:c.map(p=>({queryKey:[Tt,e,t,p],queryFn:({signal:m})=>An(r,p,t,m),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1}))}),a=l.some(p=>p.isLoading),s=l.some(p=>p.isError);return{tokens:(0,lr.useMemo)(()=>{let p=[];for(let m of l)m.data&&p.push(...m.data);return p},[l]),isLoading:a,isError:s}}var Et=require("@tanstack/react-query"),cr=require("react");var On="forge-holdings",Fn="forge-token-image";async function Bn(e,t,o){let r=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:o});if(!r.ok)throw new Error(`Failed to fetch forge holdings: ${r.status}`);let n=await r.json();if(!n.success)throw new Error("Forge holdings API error");return n.data.items}async function Vn(e,t,o){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:o});if(!r.ok)return{address:t,image_url:""};let n=await r.json();return n.success?{address:t,image_url:n.data.token.image_url}:{address:t,image_url:""}}function pr(e,t,o=!0){let r=lo[e],{data:n,...c}=(0,Et.useQuery)({queryKey:[On,e,t],queryFn:({signal:l})=>Bn(r,t,l),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1});return{holdings:n??[],...c}}function dr(e,t,o=!0){let r=lo[e],n=(0,Et.useQueries)({queries:t.map(l=>({queryKey:[Fn,e,l],queryFn:({signal:a})=>Vn(r,l,a),enabled:o,staleTime:1/0}))});return{imageMap:(0,cr.useMemo)(()=>{let l=new Map;for(let a of n)a.data&&l.set(a.data.address,a.data.image_url);return l},[n])}}var mr=require("@tanstack/react-query"),fr=require("react");var Mt="token-stats";function Ie(e,t){return`${e}:${t.toLowerCase()}`}function Pe(e,t=!0){let o=ee[e],{data:r,...n}=(0,mr.useQuery)({queryKey:[Mt,e],queryFn:async({signal:l})=>{let a=await fetch(`${o}/v1/public/token/stats`,{cache:"no-store",signal:l});if(!a.ok)throw new Error(`Failed to fetch token stats: ${a.status}`);let s=await a.json();if(s.code!==200)throw new Error(`Token stats API error: ${s.code}`);return s},enabled:t,staleTime:3e4});return{statsMap:(0,fr.useMemo)(()=>{let l=new Map;if(!r?.data)return l;for(let a of r.data){let s=Ie(a.chain_id,a.address);l.set(s,a)}return l},[r]),...n}}var ur=require("@tanstack/react-query"),wr=require("react");var Hn="token-info";function po(e,t){return`${t.toLowerCase()}_${e}`}function gr(e,t=!0){let o=ee[e],{data:r,...n}=(0,ur.useQuery)({queryKey:[Hn,e],queryFn:async({signal:l})=>{let a=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:l});if(!a.ok)throw new Error(`Failed to fetch token info: ${a.status}`);let s=await a.json();if(s.code!==200)throw new Error(`Token info API error: ${s.code}`);return s},enabled:t,staleTime:1/0});return{categoryMap:(0,wr.useMemo)(()=>{let l=new Map;if(!r?.data)return l;for(let a of r.data){let s=po(a.chain_id,a.address);l.set(s,a.category)}return l},[r]),...n}}var hr=require("react"),St=D(require("bignumber.js"),1);function xr(e,t,o){let{tokens:r,isLoading:n}=Ne(e,t,o),{statsMap:c}=Pe(e,o);return(0,hr.useMemo)(()=>{let l=new St.default(0);for(let p of r){let m=c.get(Ie(p.chainId,p.address));if(!m)continue;let L=new St.default(p.quantity.numeric).shiftedBy(-p.quantity.decimals).multipliedBy(new St.default(m.price));L.isNaN()||(l=l.plus(L))}let a=l.toFixed(),{displayValue:s,isLowerBound:d}=tr(a);return{totalUsd:a,displayValue:s,isLowerBound:d,isLoading:n}},[r,c,n])}var Qr=require("qrcode.react");var Ee=D(require("react"),1),Yr=require("vaul");var _t=require("react"),et=(0,_t.createContext)(null);function G(){let e=(0,_t.useContext)(et);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var br=require("vaul");var mo=require("react/jsx-runtime");function vr({asChild:e,children:t}){let{walletAddress:o}=G(),r=t!=null,n=e??!0,c=r?t:(0,mo.jsx)("button",{type:"button",children:Fe(o)});return(0,mo.jsx)(br.Drawer.Trigger,{asChild:n,children:c})}var tt=require("vaul");var J=D(require("react"),1),Zr=require("@tanstack/react-query");var Rr=require("react"),Ft=D(require("bignumber.js"),1);var Cr=require("@tanstack/react-query"),fo=require("react");var Wt={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"},yr={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},Dt={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"},pe={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},kr={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 Un="wp:reward-pools";function At(e,t=!0){let o=Wt[e],{data:r,...n}=(0,Cr.useQuery)({queryKey:[Un,e],queryFn:async({signal:a})=>{let s=await fetch(`${o}/v1/pools`,{cache:"no-store",signal:a});if(!s.ok)throw new Error(`Failed to fetch pools: ${s.status}`);let d=await s.json();if(d.code!==200)throw new Error(`Pools API error: ${d.code}`);return d},enabled:t,staleTime:0}),c=(0,fo.useMemo)(()=>r?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[r]),l=(0,fo.useMemo)(()=>r?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[r]);return{crossPools:c,gamePools:l,allPools:r?.data.pools??[],...n}}var Lr=require("@tanstack/react-query"),Nr=require("react");var $n="wp:user-deposits";function Ot(e,t,o=!0){let r=Wt[e],n=o&&!!t,{data:c,...l}=(0,Lr.useQuery)({queryKey:[$n,e,t],queryFn:async({signal:s})=>{let d=await fetch(`${r}/v1/users/${t}/deposits`,{cache:"no-store",signal:s});if(!d.ok)throw new Error(`Deposits fetch failed: ${d.status}`);let p=await d.json();if(p.code!==200)throw new Error(`Deposits API error: ${p.code}`);return p},enabled:n,staleTime:0});return{depositMap:(0,Nr.useMemo)(()=>{let s=new Map;if(!c?.data.user_deposits)return s;for(let d of c.data.user_deposits)s.set(d.pool_address.toLowerCase(),d);return s},[c]),deposits:c?.data.user_deposits??[],...l}}var uo=require("@tanstack/react-query"),wo=require("react");function te(e,t,o,r=!0){let n=kr[e][t],c=r&&!!o,{data:l,...a}=(0,uo.useQuery)({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:b})=>{let f=await fetch(`${n}/pair-info`,{cache:"no-store",signal:b});if(!f.ok)throw new Error(`pair-info fetch failed: ${f.status}`);let u=await f.json();if(u.code!==200)throw new Error(`pair-info API error: ${u.code}`);return u},enabled:r,staleTime:0}),s=l?.data??[],d=(0,wo.useMemo)(()=>{let b=new Map;for(let f of s)b.set(f.pair_address.toLowerCase(),f);return b},[s]),{data:p,...m}=(0,uo.useQuery)({queryKey:["wp:dex-orders",e,t,o],queryFn:async({signal:b})=>{let f=Math.floor(Date.now()/1e3),u=new URLSearchParams({owner:o,size:"200",start_date:"0",end_date:String(f)}),C=await fetch(`${n}/open-order?${u}`,{cache:"no-store",signal:b});if(!C.ok)throw new Error(`open-order fetch failed: ${C.status}`);let _=await C.json();if(_.code!==200)throw new Error(`open-order API error: ${_.code}`);return _.data?.data??[]},enabled:c,staleTime:0}),y=p??[],L=(0,wo.useMemo)(()=>{let b=new Map;for(let f of y){let u=f.pair.toLowerCase();b.has(u)||b.set(u,{buys:[],sells:[]});let C=b.get(u);f.order_side===1?C.buys.push(f):C.sells.push(f)}return b},[y]);return{allPairs:s,pairMap:d,orders:y,ordersByPair:L,isEmpty:y.length===0,isLoading:a.isLoading||m.isLoading}}var qn=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],Ir="var(--wp-green)",Pr=4;function Tr(e,t,o=!0){let r=o&&!!t,{allPools:n}=At(e,r),{depositMap:c}=Ot(e,t,r),{allPairs:l,pairMap:a,ordersByPair:s}=te(e,"cross",t,r),{allPairs:d,pairMap:p,ordersByPair:m}=te(e,"crossd",t,r),{allPairs:y,pairMap:L,ordersByPair:b}=te(e,"forge",t,r);return(0,Rr.useMemo)(()=>{let f=new Map,u=new Map,C=(x,v)=>{!Number.isFinite(v)||v<=0||u.set(x,(u.get(x)??0)+v)};for(let x of n){let v=Number(x.deposit_token.price);v>0&&f.set(x.deposit_token.symbol,v);for(let O of x.reward_tokens){let I=Number(O.price);I>0&&f.set(O.symbol,I)}}for(let x of[...l,...d,...y]){let v=f.get(x.quote_symbol),O=Number(x.billboard?.price);v&&O>0&&!f.has(x.base_symbol)&&f.set(x.base_symbol,O*v)}for(let x of n){let v=c.get(x.pool_address.toLowerCase());if(!v)continue;let O=new Ft.default(v.deposited_amount).shiftedBy(-x.deposit_token.decimals).toNumber();if(C(x.deposit_token.symbol,O),x.reward_tokens.length>0){let I=x.reward_tokens[0],H=new Ft.default(v.claimable_reward).shiftedBy(-I.decimals).toNumber();C(I.symbol,H)}}let _=[{pairMap:a,ordersByPair:s},{pairMap:p,ordersByPair:m},{pairMap:L,ordersByPair:b}];for(let{pairMap:x,ordersByPair:v}of _)for(let[O,I]of v){let H=x.get(O);if(H){for(let Z of I.buys){let re=Number(Z.amount)-Number(Z.filled);C(H.quote_symbol,re*Number(Z.price))}for(let Z of I.sells){let re=Number(Z.amount)-Number(Z.filled);C(H.base_symbol,re)}}}let M=[],h=0;for(let[x,v]of u){let O=f.get(x)??0,I=v*O;I>0&&(M.push({symbol:x,usdValue:I}),h+=I)}M.sort((x,v)=>v.usdValue-x.usdValue);let A=[];if(h>0){let x=M.slice(0,Pr),v=M.slice(Pr);for(let I=0;I<x.length;I++)A.push({symbol:x[I].symbol,usdValue:x[I].usdValue,percentage:Math.round(x[I].usdValue/h*100),color:qn[I]??Ir});if(v.length>0){let I=v.reduce((H,Z)=>H+Z.usdValue,0);A.push({symbol:"Others",usdValue:I,percentage:Math.round(I/h*100),color:Ir})}let O=A.reduce((I,H)=>I+H.percentage,0);O!==100&&A.length>0&&(A[0].percentage+=100-O)}return{totalUsd:h,formattedTotal:h>0?`$${new Ft.default(h).toFormat(2)}`:"$0.00",segments:A}},[n,c,l,a,s,d,p,m,y,L,b])}var ie=require("react/jsx-runtime");function Er({size:e=22,className:t}){return(0,ie.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ie.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Mr({size:e=22,className:t}){return(0,ie.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,ie.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,ie.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 Sr({size:e=12,className:t}){return(0,ie.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ie.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 _r=require("@tanstack/react-query"),Wr=require("react");var zn="wp:token-info";function de(e,t=!0){let o=ee[e],r=X[e].cross,{data:n,...c}=(0,_r.useQuery)({queryKey:[zn,e],queryFn:async({signal:d})=>{let p=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:d});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:300*1e3}),{byChainAddr:l,byChainSym:a}=(0,Wr.useMemo)(()=>{let d=new Map,p=new Map;if(!n?.data)return{byChainAddr:d,byChainSym:p};for(let m of n.data){let y=m.address.toLowerCase();d.set(`${m.chain_id}:${y}`,m),d.set(y,m);let L=m.symbol.replace(/^t/,"").toUpperCase(),b=`${m.chain_id}:${L}`;p.has(b)||p.set(b,m),p.has(L)||p.set(L,m)}return{byChainAddr:d,byChainSym:p}},[n]);return{getTokenImage:(d,p)=>{let m=d.toLowerCase(),y=l.get(`${r}:${m}`);if(y?.image)return y.image;let L=l.get(m);if(L?.image)return L.image;if(p){let b=p.replace(/^t/,"").toUpperCase(),f=a.get(`${r}:${b}`);if(f?.image)return f.image;let u=a.get(b);if(u?.image)return u.image}return""},...c}}var me=require("react/jsx-runtime");function oe({title:e,icon:t,iconFit:o="cover",isEmpty:r,children:n}){return(0,me.jsxs)("div",{className:"wp-svc-card",children:[(0,me.jsxs)("div",{className:"wp-svc-card-head",children:[(0,me.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:o}}),(0,me.jsx)("span",{className:"wp-svc-card-title",children:e})]}),r?(0,me.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,me.jsx)("div",{className:"wp-svc-items",children:n})]})}var Bt=D(require("bignumber.js"),1),q=require("react/jsx-runtime"),jn="CROSS Rewards",Gn="https://contents.crosstoken.io/frontend/common/app-launcher/icons/award.svg";function Dr(e,t){let o=new Bt.default(e).shiftedBy(-t);return o.isZero()?"0":o.isGreaterThanOrEqualTo(1)?o.toFormat(2,Bt.default.ROUND_DOWN):o.toFormat(4,Bt.default.ROUND_DOWN)}function Ar(){let{env:e,walletAddress:t}=G(),o=!!t,{allPools:r}=At(e,o),{depositMap:n}=Ot(e,t,o),{getTokenImage:c}=de(e,o),l=a=>`${yr[e]}/rewards/${a.pool_address}?action=withdraw`;return(0,q.jsx)(oe,{title:jn,icon:Gn,isEmpty:r.length===0,children:r.map(a=>{let s=n.get(a.pool_address.toLowerCase()),d=s?.deposited_amount??"0";return(0,q.jsxs)("a",{className:"wp-item","data-side":"reward",href:l(a),target:"_blank",rel:"noopener noreferrer",children:[(0,q.jsxs)("div",{className:"wp-item-body",children:[(0,q.jsxs)("div",{className:"wp-item-field",children:[(0,q.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,q.jsxs)("div",{className:"wp-svc-token",children:[c(a.deposit_token.address,a.deposit_token.symbol)&&(0,q.jsx)("img",{className:"wp-svc-token-icon",src:c(a.deposit_token.address,a.deposit_token.symbol),alt:""}),(0,q.jsx)("span",{children:Dr(d,a.deposit_token.decimals)})]})]}),(0,q.jsxs)("div",{className:"wp-item-field",children:[(0,q.jsx)("span",{className:"wp-item-label",children:"Rewards"}),a.reward_tokens.map(p=>{let m=c(p.address,p.symbol);return(0,q.jsxs)("div",{className:"wp-svc-token",children:[m&&(0,q.jsx)("img",{className:"wp-svc-token-icon",src:m,alt:""}),(0,q.jsx)("span",{children:s?Dr(s.claimable_reward,p.decimals):"0"})]},p.address)})]})]}),(0,q.jsxs)("div",{className:"wp-item-badges",children:[(0,q.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Claim"}),(0,q.jsx)("span",{className:"wp-badge wp-badge--muted",children:"Withdraw"})]})]},a.pool_address)})})}var ho=D(require("bignumber.js"),1),N=require("react/jsx-runtime");function go(e){let t=new ho.default(e);if(t.isNaN())return e;let o=t.decimalPlaces()??0;return t.toFormat(o)}function Or(e){let t=new ho.default(e.amount).minus(e.filled);return go(t.toString())}function Be({pairMap:e,ordersByPair:t,getDexUrl:o,getTokenImage:r}){let n=[];for(let[c,l]of t){let a=e.get(c),s=a?r(a.base_address,a.base_symbol):"",d=a?r(a.quote_address,a.quote_symbol):"";for(let p of l.buys)n.push((0,N.jsxs)("a",{className:"wp-item","data-side":"buy",href:o(c),target:"_blank",rel:"noopener noreferrer",children:[(0,N.jsxs)("div",{className:"wp-item-body",children:[(0,N.jsxs)("div",{className:"wp-item-field",children:[(0,N.jsx)("span",{className:"wp-item-label wp-item-label--buy",children:"Buy"}),(0,N.jsxs)("div",{className:"wp-svc-token",children:[s&&(0,N.jsx)("img",{className:"wp-svc-token-icon",src:s,alt:""}),(0,N.jsx)("span",{children:Or(p)})]})]}),(0,N.jsxs)("div",{className:"wp-item-field",children:[(0,N.jsx)("span",{className:"wp-item-label",children:"Price"}),(0,N.jsxs)("div",{className:"wp-svc-token",children:[d&&(0,N.jsx)("img",{className:"wp-svc-token-icon",src:d,alt:""}),(0,N.jsx)("span",{children:go(p.price)})]})]})]}),(0,N.jsx)("div",{className:"wp-item-badges",children:(0,N.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Claim"})})]},`buy-${p.order_id}`));for(let p of l.sells)n.push((0,N.jsxs)("a",{className:"wp-item","data-side":"sell",href:o(c),target:"_blank",rel:"noopener noreferrer",children:[(0,N.jsxs)("div",{className:"wp-item-body",children:[(0,N.jsxs)("div",{className:"wp-item-field",children:[(0,N.jsx)("span",{className:"wp-item-label wp-item-label--sell",children:"Sell"}),(0,N.jsxs)("div",{className:"wp-svc-token",children:[s&&(0,N.jsx)("img",{className:"wp-svc-token-icon",src:s,alt:""}),(0,N.jsx)("span",{children:Or(p)})]})]}),(0,N.jsxs)("div",{className:"wp-item-field",children:[(0,N.jsx)("span",{className:"wp-item-label",children:"Price"}),(0,N.jsxs)("div",{className:"wp-svc-token",children:[d&&(0,N.jsx)("img",{className:"wp-svc-token-icon",src:d,alt:""}),(0,N.jsx)("span",{children:go(p.price)})]})]})]}),(0,N.jsx)("div",{className:"wp-item-badges",children:(0,N.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`sell-${p.order_id}`))}return(0,N.jsx)(N.Fragment,{children:n})}var xo=require("react/jsx-runtime"),Zn="Gametoken - CROSS",Kn="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function Fr(){let{env:e,walletAddress:t}=G(),o=!!t,{pairMap:r,ordersByPair:n,isEmpty:c}=te(e,"cross",t,o),{getTokenImage:l}=de(e,o);return(0,xo.jsx)(oe,{title:Zn,icon:Kn,isEmpty:c,children:(0,xo.jsx)(Be,{pairMap:r,ordersByPair:n,getDexUrl:s=>{let d=r.get(s.toLowerCase());return`${pe[e]}/gametoken/cross/${d?.base_symbol??""}`},getTokenImage:l})})}var bo=require("react/jsx-runtime"),Yn="Gametoken - CROSSD",Qn="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function Br(){let{env:e,walletAddress:t}=G(),o=!!t,{pairMap:r,ordersByPair:n,isEmpty:c}=te(e,"crossd",t,o),{getTokenImage:l}=de(e,o);return(0,bo.jsx)(oe,{title:Yn,icon:Qn,isEmpty:c,children:(0,bo.jsx)(Be,{pairMap:r,ordersByPair:n,getDexUrl:s=>{let d=r.get(s.toLowerCase());return`${pe[e]}/gametoken/crossd/${d?.base_symbol??""}`},getTokenImage:l})})}var vo=require("react/jsx-runtime"),Xn="Gametoken - Forge",Jn="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function Vr(){let{env:e,walletAddress:t}=G(),o=!!t,{pairMap:r,ordersByPair:n,isEmpty:c}=te(e,"forge",t,o),{getTokenImage:l}=de(e,o);return(0,vo.jsx)(oe,{title:Xn,icon:Jn,isEmpty:c,children:(0,vo.jsx)(Be,{pairMap:r,ordersByPair:n,getDexUrl:s=>{let d=r.get(s.toLowerCase());return`${pe[e]}/gametoken/forge/${d?.base_symbol??""}`},getTokenImage:l})})}var Vt=D(require("bignumber.js"),1),jr=require("react");var Hr=require("@tanstack/react-query");var ei="wp:forge-pools";function Ur(e,t,o=!0){let r=Dt[e],n=o&&!!t,{data:c,...l}=(0,Hr.useQuery)({queryKey:[ei,e,t],queryFn:async()=>{let s=await fetch(`${r}/v1/users/${t}/pools`,{cache:"no-store"});if(!s.ok)throw new Error(`forge pools fetch failed: ${s.status}`);return(await s.json()).data?.items??[]},enabled:n,staleTime:0}),a=c??[];return{pools:a,isEmpty:a.length===0,...l}}var $r=require("@tanstack/react-query"),qr=require("react");var ti="wp:forge-token-detail";async function oi(e,t){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return o.ok?(await o.json())?.data?.token??null:null}function zr(e,t,o=!0){let r=Dt[e],n=(0,$r.useQueries)({queries:t.map(a=>({queryKey:[ti,e,a],queryFn:()=>oi(r,a),enabled:o&&!!a,staleTime:3e4}))}),c=(0,qr.useMemo)(()=>{let a=new Map;for(let s=0;s<n.length;s++){let d=n[s]?.data,p=t[s];d&&p&&a.set(p.toLowerCase(),d)}return a},[n,t]),l=n.some(a=>a.isLoading);return{detailMap:c,isLoading:l}}var V=require("react/jsx-runtime"),ri="Forge",ni="https://x.crosstoken.io/forge/favicon-96x96.png",ii=18,ai="https://contents.crosstoken.io/wallet/token/images/FT.png";function si(e){if(!e||e==="0")return"0";let t=new Vt.default(e).shiftedBy(-ii);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Vt.default.ROUND_DOWN):t.toFormat(4,Vt.default.ROUND_DOWN)}function li(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 Gr(){let{env:e,walletAddress:t}=G(),o=!!t,{pools:r,isEmpty:n}=Ur(e,t,o),c=(0,jr.useMemo)(()=>r.map(s=>s.token.address),[r]),{detailMap:l}=zr(e,c,o&&c.length>0),a=s=>`${pe[e]}/forge/token/${s.token.address}`;return(0,V.jsx)(oe,{title:ri,icon:ni,iconFit:"contain",isEmpty:n,children:r.map(s=>{let d=l.get(s.token.address.toLowerCase()),p=d?.image_url||d?.image||s.token.image||ai,m=d?.symbol||s.token.symbol;return(0,V.jsxs)("a",{className:"wp-item","data-side":"lp",href:a(s),target:"_blank",rel:"noopener noreferrer",children:[(0,V.jsxs)("div",{className:"wp-item-body",children:[(0,V.jsxs)("div",{className:"wp-item-field",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Pair"}),(0,V.jsxs)("div",{className:"wp-svc-token",children:[(0,V.jsx)("img",{className:"wp-svc-token-icon",src:p,alt:""}),(0,V.jsx)("span",{children:m})]})]}),(0,V.jsxs)("div",{className:"wp-item-field",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,V.jsx)("div",{className:"wp-svc-token",children:(0,V.jsx)("span",{children:si(s.lp_balance)})})]}),(0,V.jsxs)("div",{className:"wp-item-field",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,V.jsx)("div",{className:"wp-svc-token",children:(0,V.jsx)("span",{children:li(s.pool_ownership)})})]})]}),(0,V.jsx)("div",{className:"wp-item-badges",children:(0,V.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Withdraw"})})]},s.pair_address)})})}E(`.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:Sora,sans-serif;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:Sora,sans-serif;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-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:Roboto,Sora,sans-serif;font-size:16px;font-weight:600;line-height:24px;letter-spacing:.15px;text-align:center;color:var(--wp-text);margin:0}.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}
6
- `);var k=require("react/jsx-runtime"),yo=5,ci="wp:";function Re({env:e="production",theme:t="dark",walletAddress:o,onBack:r,showHeader:n=!0,variant:c="embed",className:l,sendTransaction:a}){let s=!!o,d=(0,Zr.useQueryClient)(),{segments:p}=Tr(e,o,s),[m,y]=J.useState(yo),[L,b]=J.useState(!1),f=J.useCallback(()=>{d.invalidateQueries({predicate:h=>typeof h.queryKey[0]=="string"&&h.queryKey[0].startsWith(ci)})},[d]),u=J.useCallback(()=>{f(),b(!0),setTimeout(()=>b(!1),600),y(yo)},[f]);J.useEffect(()=>{if(!s)return;let h=setInterval(()=>{y(A=>A<=1?(u(),yo):A-1)},1e3);return()=>clearInterval(h)},[s,u]);let C=J.useCallback(()=>{r?.()},[r]),_=J.useMemo(()=>({env:e,theme:t,open:!0,walletAddress:o,close:C,sendTransaction:a}),[e,t,o,C,a]),M=(0,k.jsxs)(k.Fragment,{children:[n&&(0,k.jsxs)("div",{className:"wp-header",children:[r?(0,k.jsx)("button",{type:"button",className:"wp-header-btn",onClick:r,children:(0,k.jsx)(Er,{})}):(0,k.jsx)("span",{className:"wp-header-btn","aria-hidden":!0}),(0,k.jsx)("h2",{className:"wp-header-title",children:"My Portfolio"}),(0,k.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:u,children:[(0,k.jsx)(Mr,{className:L?"wp-spin-once":void 0}),s&&(0,k.jsx)("span",{className:"wp-refresh-badge",children:m})]})]}),(0,k.jsx)("div",{className:"wp-top",children:p.length>0&&(0,k.jsxs)("div",{className:"wp-asset",children:[(0,k.jsxs)("div",{className:"wp-asset-head",children:[(0,k.jsx)("span",{className:"wp-asset-head-label",children:"Consolidated Asset"}),(0,k.jsx)("span",{className:"wp-asset-head-icon",children:(0,k.jsx)(Sr,{})})]}),(0,k.jsx)("div",{className:"wp-bar",children:p.map(h=>(0,k.jsx)("div",{className:"wp-bar-seg",style:{flex:`${h.percentage} 0 0`,background:h.color},children:h.percentage>=5&&(0,k.jsxs)("span",{className:"wp-bar-seg-pct",children:[h.percentage,"%"]})},h.symbol))}),(0,k.jsx)("div",{className:"wp-legend",children:p.map(h=>(0,k.jsxs)("div",{className:"wp-legend-item",children:[(0,k.jsx)("span",{className:"wp-legend-dot",style:{background:h.color}}),(0,k.jsx)("span",{className:"wp-legend-label",children:h.symbol})]},h.symbol))})]})}),(0,k.jsx)("div",{className:"wp-body",children:(0,k.jsxs)("div",{className:"wp-body-inner",children:[(0,k.jsx)(Ar,{}),(0,k.jsx)(Fr,{}),(0,k.jsx)(Br,{}),(0,k.jsx)(Vr,{}),(0,k.jsx)(Gr,{})]})})]});return(0,k.jsx)(et.Provider,{value:_,children:c==="none"?M:(0,k.jsx)("div",{className:$(c==="fullscreen"?"wp-fullscreen":"wp-embed",l),"data-theme":t,children:M})})}var Te=require("react/jsx-runtime");function Kr({className:e}){let{env:t,theme:o,walletAddress:r,close:n,sendTransaction:c}=G();return(0,Te.jsxs)(tt.Drawer.Portal,{children:[(0,Te.jsx)(tt.Drawer.Overlay,{className:"wp-overlay"}),(0,Te.jsxs)(tt.Drawer.Content,{className:$("wp-fullscreen",e),"data-theme":o,children:[(0,Te.jsx)(tt.Drawer.Title,{className:"wp-sr-only",children:"My Portfolio"}),(0,Te.jsx)(Re,{env:t,theme:o,walletAddress:r,onBack:n,variant:"none",sendTransaction:c})]})]})}var ko=require("react/jsx-runtime");function pi({env:e="production",theme:t="dark",walletAddress:o,open:r,onOpenChange:n,sendTransaction:c,children:l}){let a=r!==void 0,[s,d]=Ee.useState(!1),p=a?r:s,m=Ee.useCallback(b=>{a||d(b),n?.(b)},[a,n]),y=Ee.useCallback(()=>m(!1),[m]),L=Ee.useMemo(()=>({env:e,theme:t,open:p,walletAddress:o,close:y,sendTransaction:c}),[e,t,p,o,y,c]);return(0,ko.jsx)(et.Provider,{value:L,children:(0,ko.jsx)(Yr.Drawer.Root,{direction:"bottom",open:p,onOpenChange:m,noBodyStyles:!0,children:l})})}var Co=Object.assign(pi,{Trigger:vr,Content:Kr});var i=require("react/jsx-runtime");function Lo(e,t,o){let r=X[e],n=o.toUpperCase();if(t===r.cross&&n.includes("CROSSD"))return 0;if(t===r.cross&&n==="CROSS")return 1;if(t===r.bsc&&n==="CROSS")return 2}function di(e){return parseInt(e.split(":")[1],10)}function mi(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function fi(e){let t=e.toLowerCase().replace(/^0x/,""),o=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),r=parseInt(o.slice(0,4),16)%360,n=(r+60+parseInt(o.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${r} 85% 65%), hsl(${n} 80% 55%))`}function Xr({align:e="end",sideOffset:t=12,className:o,children:r}){let{env:n,theme:c,isMobile:l,open:a,drawerDirection:s,modal:d,showBalance:p,showForgeToken:m,showGameToken:y,showQR:L,qrLogoSrc:b,walletAddress:f,accountName:u,profileImageUrl:C,preferredTokens:_,close:M,onSelectWallet:h,onCopyAddress:A,onDisconnect:x,disconnectLabel:v,termsUrl:O,termsLabel:I,privacyUrl:H,privacyLabel:Z,portalStyle:re,navContent:we,navPosition:$e,footerContent:mt,view:K,setView:qe,showPortfolio:ze,portfolioTitle:ft,showTotalAssets:ut,totalAssetsLabel:je,sendTransaction:Ge}=le(),{tokens:ge,isLoading:he}=Ne(n,f,a&&p),{statsMap:_e}=Pe(n,p),{categoryMap:wt}=gr(n,p),ne=p&&ut,{displayValue:xe,isLowerBound:gt,isLoading:ht}=xr(n,f,a&&ne),[We,Ze]=B.useState(!1),{holdings:be,isLoading:Ke}=pr(n,f,a&&p&&m),Gt=B.useMemo(()=>be.map(g=>g.token),[be]),{imageMap:xt}=dr(n,Gt,m&&be.length>0),De=B.useMemo(()=>{let g=[],S=[],W=[],z=new Map((_??[]).map((T,U)=>[`${di(T.chainId)}:${T.address.toLowerCase()}`,U]));for(let T of ge){let U=Lo(n,T.chainId,T.symbol)!==void 0,ve=`${T.chainId}:${T.address.toLowerCase()}`,ye=z.get(ve),Xt=new Ve.default(T.quantity.numeric).shiftedBy(-T.quantity.decimals);if(U)g.push(T);else if(ye!==void 0)S.push(T);else if(Xt.isGreaterThan(0)){if(!y&&wt.get(po(T.chainId,T.address))==="game")continue;W.push(T)}}return g.sort((T,U)=>{let ve=Lo(n,T.chainId,T.symbol)??99,ye=Lo(n,U.chainId,U.symbol)??99;return ve-ye}),S.sort((T,U)=>{let ve=z.get(`${T.chainId}:${T.address.toLowerCase()}`)??99,ye=z.get(`${U.chainId}:${U.address.toLowerCase()}`)??99;return ve-ye}),W.sort((T,U)=>{let ve=_e.get(Ie(T.chainId,T.address)),ye=_e.get(Ie(U.chainId,U.address)),Xt=new Ve.default(T.quantity.numeric).shiftedBy(-T.quantity.decimals).multipliedBy(ve?.price??0);return new Ve.default(U.quantity.numeric).shiftedBy(-U.quantity.decimals).multipliedBy(ye?.price??0).minus(Xt).toNumber()}),[...g,...S,...W]},[ge,n,_e,y,wt,_]),bt=B.useMemo(()=>{if(!m)return[];let g=new Set(ge.map(S=>S.address.toLowerCase()));return[...be].filter(S=>!g.has(S.token.toLowerCase())).sort((S,W)=>{let z=new Ve.default(S.value);return new Ve.default(W.value).minus(z).toNumber()})},[be,m,ge]),se=B.useRef(!1),Zt=B.useCallback(g=>{se.current=!0,qe(g)},[qe]);B.useEffect(()=>{a||(se.current=!1)},[a]);let Ro=B.useRef(null);B.useEffect(()=>{let g=Ro.current;if(!g||!l)return;let S=W=>{W.pointerType==="touch"&&W.stopPropagation()};return g.addEventListener("pointerdown",S),()=>g.removeEventListener("pointerdown",S)},[l]);let[Ye,To]=B.useState(!1),Kt=B.useRef(void 0);B.useEffect(()=>()=>clearTimeout(Kt.current),[]);let Eo=B.useCallback(async()=>{if(!Ye)try{await navigator.clipboard.writeText(f),To(!0),clearTimeout(Kt.current),Kt.current=setTimeout(()=>To(!1),2e3),A?.(f,!0)}catch{A?.(f,!1)}},[f,A,Ye]),Yt=B.useCallback(g=>{g.currentTarget.setAttribute("data-loaded","true")},[]),bn=B.useMemo(()=>({background:fi(f)}),[f]),Mo=B.useMemo(()=>C||ar(n,f,{size:120,bg:c==="dark"?"1A1A2E":"F3F6F8"}),[C,n,f,c]),Qt=B.useMemo(()=>mi(xe),[xe]),vn=(0,i.jsxs)("div",{className:$("wi-view-inner",se.current&&"wi-view-wallet"),children:[ne&&(()=>{let g=ze;return(0,i.jsxs)(g?"button":"div",{...g?{type:"button",onClick:()=>Zt("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":g||void 0,children:[(0,i.jsxs)("div",{className:"wi-total-head",children:[(0,i.jsx)("span",{className:"wi-total-label",children:je}),(0,i.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:W=>{W.stopPropagation(),Ze(z=>!z)},onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),W.stopPropagation(),Ze(z=>!z))},"aria-label":We?"Show balance":"Hide balance",children:We?(0,i.jsx)(Xo,{}):(0,i.jsx)(Qo,{})})]}),(0,i.jsxs)("div",{className:"wi-total-body",children:[ht?(0,i.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):(0,i.jsx)("div",{className:"wi-total-value","data-hidden":We||void 0,children:We?(0,i.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,i.jsxs)(i.Fragment,{children:[gt&&(0,i.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,i.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,i.jsx)("span",{className:"wi-total-amount",children:Qt.main}),Qt.decimal&&(0,i.jsx)("span",{className:"wi-total-decimal",children:Qt.decimal})]})}),g&&(0,i.jsx)("span",{className:"wi-total-chevron","aria-hidden":!0,children:(0,i.jsx)(Ko,{size:18})})]})]})})(),$e==="top"&&we&&(0,i.jsx)("div",{className:"wi-nav-fixed",children:we}),p&&(0,i.jsx)("div",{ref:Ro,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,i.jsxs)("div",{className:"wi-token-list",children:[he&&Array.from({length:5},(g,S)=>(0,i.jsxs)("div",{className:"wi-skeleton-item",children:[(0,i.jsxs)("div",{className:"wi-skeleton-left",children:[(0,i.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,i.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,i.jsxs)("div",{className:"wi-skeleton-right",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},S)),!he&&De.length===0&&!m&&(0,i.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),De.map(g=>{let S=_e.get(Ie(g.chainId,g.address)),W=S?parseFloat(S.percent_change_24h):null,z=W!==null&&W>=0,T=co(n,g.chainId);return(0,i.jsxs)("div",{className:"wi-token-item",children:[(0,i.jsxs)("div",{className:"wi-token-left",children:[(0,i.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,i.jsx)("img",{src:g.icon_url,alt:g.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Yt,onError:U=>{U.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),T&&(0,i.jsx)("img",{src:T,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:U=>{U.currentTarget.style.display="none"}})]}),(0,i.jsxs)("div",{className:"wi-token-info",children:[(0,i.jsx)("span",{className:"wi-token-name",children:g.symbol}),S&&(0,i.jsxs)("div",{className:"wi-token-price-row",children:[(0,i.jsx)("span",{className:"wi-token-price",children:so(S.price)}),(0,i.jsx)("span",{className:"wi-token-change","data-positive":z,"data-zero":W===0||void 0,children:W!==null&&(W===0?"0%":`${z?"+":"-"}${(z?Math.floor:Math.ceil)(Math.abs(W)*100)/100}%`)})]})]})]}),(0,i.jsxs)("div",{className:"wi-token-right",children:[(0,i.jsx)("span",{className:"wi-token-balance",children:Rt(g.quantity.numeric,g.quantity.decimals)}),S&&(0,i.jsx)("span",{className:"wi-token-value",children:er(g.quantity.numeric,g.quantity.decimals,S.price)})]})]},`${g.address}-${g.chainId}`)}),m&&Ke&&Array.from({length:3},(g,S)=>(0,i.jsxs)("div",{className:"wi-skeleton-item",children:[(0,i.jsxs)("div",{className:"wi-skeleton-left",children:[(0,i.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,i.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,i.jsxs)("div",{className:"wi-skeleton-right",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${S}`)),m&&!Ke&&!he&&De.length===0&&bt.length===0&&(0,i.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),m&&bt.map(g=>{let S=xt.get(g.token)||"",W=co(n,X[n].cross);return(0,i.jsxs)("div",{className:"wi-token-item",children:[(0,i.jsxs)("div",{className:"wi-token-left",children:[(0,i.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,i.jsx)("img",{src:S||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:g.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Yt,onError:z=>{z.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),W&&(0,i.jsx)("img",{src:W,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:z=>{z.currentTarget.style.display="none"}})]}),(0,i.jsxs)("div",{className:"wi-token-info",children:[(0,i.jsx)("span",{className:"wi-token-name",children:g.token_name}),(0,i.jsx)("div",{className:"wi-token-price-row",children:(0,i.jsxs)("span",{className:"wi-token-price",children:[Rt(g.current_price,18)," CROSS"]})})]})]}),(0,i.jsxs)("div",{className:"wi-token-right",children:[(0,i.jsx)("span",{className:"wi-token-balance",children:Rt(g.balance,18)}),(0,i.jsx)("span",{className:"wi-token-value",children:so(g.current_value_usd)})]})]},`forge-${g.token}`)})]})}),$e==="bottom"&&we&&(0,i.jsx)("div",{className:"wi-nav-fixed",children:we})]},"wallet"),yn=ze?(0,i.jsx)("div",{className:$("wi-view-inner wi-portfolio-body",se.current&&"wi-view-portfolio"),children:(0,i.jsx)(Re,{env:n,theme:c,walletAddress:f,showHeader:!1,sendTransaction:Ge})},"portfolio"):null,kn=(0,i.jsx)("div",{className:$("wi-view-inner wi-qr-body",se.current&&"wi-view-qr"),children:(0,i.jsx)("div",{className:"wi-qr-section",children:(0,i.jsxs)("div",{className:"wi-qr-card",children:[(0,i.jsxs)("div",{className:"wi-qr-code",children:[(0,i.jsx)(Qr.QRCodeSVG,{value:f,size:180,level:"H",marginSize:2,...b&&{imageSettings:{src:b,height:33,width:33,excavate:!0}}}),!b&&(0,i.jsx)("div",{className:"wi-qr-logo",children:(0,i.jsx)(Jo,{size:33})})]}),(0,i.jsx)("p",{className:"wi-qr-address",children:f}),(0,i.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:Eo,children:[(0,i.jsx)("span",{className:"wi-qr-copy-icon",children:Ye?(0,i.jsx)(io,{size:16}):(0,i.jsx)(no,{size:16})}),(0,i.jsx)("span",{className:"wi-qr-copy-text",children:Ye?"Copied!":"Copy address"})]})]})})},"qr"),Cn=K==="qr"||K==="portfolio",Ln=K==="qr"?"My Address":K==="portfolio"?ft:"",So=mt??(!!x||!!O||!!H?(0,i.jsxs)("div",{className:"wi-builtin-footer",children:[x&&(0,i.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{x(),M()},children:[(0,i.jsx)(jo,{size:20}),(0,i.jsx)("span",{className:"wi-disconnect-label",children:v})]}),(O||H)&&(0,i.jsxs)("div",{className:"wi-legal-links",children:[O&&(0,i.jsx)("a",{className:"wi-legal-link",href:O,target:"_blank",rel:"noopener noreferrer",children:I}),O&&H&&(0,i.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),H&&(0,i.jsx)("a",{className:"wi-legal-link",href:H,target:"_blank",rel:"noopener noreferrer",children:Z})]})]}):null),Nn=(0,i.jsxs)("div",{className:"wi-sticky-header",children:[(0,i.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,i.jsxs)("div",{className:"wi-account-block",children:[(0,i.jsxs)("div",{className:"wi-avatar",children:[(0,i.jsx)("div",{className:"wi-avatar-fallback",style:bn}),Mo&&(0,i.jsx)("img",{src:Mo,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:Yt,onError:g=>{g.currentTarget.style.display="none"}})]}),(0,i.jsxs)("div",{className:"wi-account-text",children:[h?(0,i.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:h,"aria-label":"Switch account",children:[(0,i.jsx)("span",{className:"wi-account-name",children:u??"Account 1"}),(0,i.jsx)("span",{className:"wi-account-switch","aria-hidden":"true",children:(0,i.jsx)(Yo,{size:12})})]}):(0,i.jsx)("div",{className:"wi-account-row",children:(0,i.jsx)("span",{className:"wi-account-name",children:u??"Account 1"})}),(0,i.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:Eo,"aria-label":"Copy address",children:[(0,i.jsx)("span",{className:"wi-account-address",children:Fe(f)}),(0,i.jsx)("span",{className:"wi-account-copy",children:Ye?(0,i.jsx)(io,{size:14}):(0,i.jsx)(no,{size:14})})]})]})]}),(0,i.jsxs)("div",{className:"wi-header-actions",children:[L&&(0,i.jsx)("button",{type:"button",className:"wi-header-action",onClick:()=>Zt("qr"),"aria-label":"Show QR code",children:(0,i.jsx)(Go,{size:20})}),(0,i.jsx)("button",{type:"button",className:"wi-header-action",onClick:M,"aria-label":"Close",children:(0,i.jsx)(ao,{size:24})})]})]}),(0,i.jsx)("hr",{className:"wi-divider"})]}),_o=(0,i.jsxs)(i.Fragment,{children:[r,Cn?(0,i.jsxs)("div",{className:"wi-sticky-header",children:[(0,i.jsxs)("div",{className:"wi-header",children:[(0,i.jsx)("button",{type:"button",className:"wi-header-back",onClick:()=>Zt("wallet"),"aria-label":"Back",children:(0,i.jsx)(Zo,{})}),(0,i.jsx)("div",{className:"wi-header-info",children:(0,i.jsx)("h2",{className:"wi-header-title",children:Ln})}),(0,i.jsx)("button",{type:"button",className:"wi-header-close",onClick:M,"aria-label":"Close",children:(0,i.jsx)(ao,{})})]}),(0,i.jsx)("hr",{className:"wi-divider"})]}):Nn,(0,i.jsxs)("div",{className:"wi-view-container",children:[K==="wallet"&&vn,K==="qr"&&kn,K==="portfolio"&&yn]}),So&&K!=="portfolio"&&(0,i.jsx)("div",{className:"wi-sticky-footer",children:(0,i.jsx)("div",{className:"wi-footer",children:So})})]});return l?(0,i.jsxs)(ot.Drawer.Portal,{children:[d&&(0,i.jsx)(ot.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,i.jsxs)(ot.Drawer.Content,{className:$("wi-drawer-content",o),"data-theme":c,style:re,"data-direction":s,"data-no-balance":!p||void 0,"data-view":K,children:[(0,i.jsx)(ot.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),_o]})]}):(0,i.jsxs)(i.Fragment,{children:[d&&a&&(0,i.jsx)("div",{className:"wi-drawer-overlay",onClick:M}),(0,i.jsx)(Ht.Portal,{children:(0,i.jsx)(Ht.Content,{align:e,sideOffset:t,className:$("wi-popover-content",o),"data-theme":c,style:re,"data-no-balance":!p||void 0,"data-view":K,children:_o})})]})}var Jr=D(require("react"),1);function en({position:e="top",children:t}){let{setNavContent:o,setNavPosition:r}=le();return Jr.useEffect(()=>(o(t),r(e),()=>o(null)),[t,e,o,r]),null}var tn=D(require("react"),1);function on({children:e}){let{setFooterContent:t}=le();return tn.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}E(`[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)}
7
- `);E(`.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}
8
- `);E(`@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}}
9
- `);E(`.wi-popover-content{z-index:100001;width:343px;border-radius:24px;border:4px 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-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:auto;left:0;right:0;width:100%;max-height:60vh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:85dvh}.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-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.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;border-radius:8px;object-fit:contain;opacity:0;transition:opacity .2s ease;background:var(--wi-surface-default)}.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-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;height:48px;padding:0 16px;border:none;border-radius:12px;background:var(--wi-surface-default);color:var(--wi-texticon-primary);font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;cursor:pointer;transition:opacity .15s ease,background .15s ease}.wi-disconnect-btn:hover{opacity:.85}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;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-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:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:16px 24px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .wi-qr-section{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-qr-section::-webkit-scrollbar{width:4px}.wi-qr-section::-webkit-scrollbar-track{background:transparent}.wi-qr-section::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-qr-section::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-qr-section::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-qr-section::-webkit-scrollbar-thumb:hover{background:#0003}.wi-qr-card{display:flex;flex-direction:column;align-items:center;gap:20px;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:16px;font-weight:600;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}
10
- `);E(`.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}
11
- `);var Ut=require("react/jsx-runtime");function ui({env:e="production",theme:t="dark",mobileBreakpoint:o=768,drawerDirection:r,modal:n,showBalance:c=!1,showForgeToken:l=!1,showGameToken:a=!0,showQR:s=!0,qrLogoSrc:d,walletAddress:p,accountName:m,profileImageUrl:y,connectorId:L,connectorName:b,connectorIconUrl:f,preferredTokens:u=[],onSelectWallet:C,onCopyAddress:_,onDisconnect:M,disconnectLabel:h="Disconnect",termsUrl:A,termsLabel:x="Terms of Service",privacyUrl:v,privacyLabel:O="Privacy Policy",open:I,onOpenChange:H,showPortfolio:Z=!1,portfolioTitle:re="My Portfolio",showTotalAssets:we=!0,totalAssetsLabel:$e="Total Assets USD",sendTransaction:mt,style:K,children:qe}){let ze=L?Je[L]:void 0,ft=b??ze?.name,ut=f??ze?.iconUrl,je=Ae(`(max-width: ${o}px)`),Ge=r??(c?"right":"bottom"),ge=n??!1,he=I!==void 0,[_e,wt]=Y.useState(!1),ne=he?I:_e,xe=Y.useCallback(se=>{he||wt(se),H?.(se)},[he,H]),gt=Y.useCallback(()=>xe(!1),[xe]),[ht,We]=Y.useState(null),[Ze,be]=Y.useState("top"),[Ke,Gt]=Y.useState(null),[xt,De]=Y.useState("wallet");Y.useEffect(()=>{ne||De("wallet")},[ne]);let bt=Y.useMemo(()=>({env:e,theme:t,isMobile:je,open:ne,drawerDirection:Ge,modal:ge,showBalance:c,showForgeToken:l,showGameToken:a,showQR:s,qrLogoSrc:d,walletAddress:p,accountName:m,profileImageUrl:y,connectorName:ft,connectorIconUrl:ut,preferredTokens:u,close:gt,onSelectWallet:C,onCopyAddress:_,onDisconnect:M,disconnectLabel:h,termsUrl:A,termsLabel:x,privacyUrl:v,privacyLabel:O,portalStyle:K,navContent:ht,navPosition:Ze,setNavContent:We,setNavPosition:be,footerContent:Ke,setFooterContent:Gt,view:xt,setView:De,showPortfolio:Z,portfolioTitle:re,showTotalAssets:we,totalAssetsLabel:$e,sendTransaction:mt}),[e,t,je,ne,Ge,ge,c,l,a,s,d,p,m,y,ft,ut,u,gt,C,_,M,h,A,x,v,O,K,ht,Ze,Ke,xt,Z,re,we,$e,mt]);return(0,Ut.jsx)(ro.Provider,{value:bt,children:je?(0,Ut.jsx)(nn.Drawer.Root,{direction:Ge,open:ne,onOpenChange:xe,noBodyStyles:!0,children:qe},"drawer"):(0,Ut.jsx)(rn.Root,{open:ne,onOpenChange:xe,children:qe},"popover")})}var Me=Object.assign(ui,{Trigger:nr,Content:Xr,Nav:en,Footer:on});var ae=D(require("react"),1),gn=D(require("@radix-ui/react-dialog"),1),hn=require("vaul");var $t=require("react"),qt=(0,$t.createContext)(null);function rt(){let e=(0,$t.useContext)(qt);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var Se=require("react");function nt(){let[e,t]=(0,Se.useState)([]),[o,r]=(0,Se.useState)(!0);(0,Se.useEffect)(()=>{if(typeof window>"u"){r(!1);return}let c=[],l=s=>{let{info:d}=s.detail;d?.rdns&&!c.some(p=>p.rdns===d.rdns)&&(c.push({rdns:d.rdns,name:d.name,icon:d.icon}),t([...c]))};window.addEventListener("eip6963:announceProvider",l),window.addEventListener("eip6963:crossAnnounceProvider",l),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let a=setTimeout(()=>r(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",l),window.removeEventListener("eip6963:crossAnnounceProvider",l),clearTimeout(a)}},[]);let n=(0,Se.useCallback)(c=>e.some(l=>l.rdns===c),[e]);return{wallets:e,isDetected:n,isLoading:o}}var an=D(require("@radix-ui/react-dialog"),1),sn=require("vaul");var No=require("react/jsx-runtime");function ln({asChild:e,children:t}){let{isMobile:o}=rt(),r=o?sn.Drawer.Trigger:an.Trigger;return(0,No.jsx)(r,{asChild:e??t!=null,children:t??(0,No.jsx)("button",{type:"button",children:"Connect Wallet"})})}var fe=D(require("@radix-ui/react-dialog"),1),it=require("vaul");var P=require("react/jsx-runtime");function zt(){return(0,P.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,P.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,P.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 cn(){return(0,P.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,P.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,P.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,P.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,P.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,P.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,P.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,P.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,P.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,P.jsx)("defs",{children:(0,P.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,P.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function pn(){return(0,P.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,P.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,P.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,P.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,P.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 dn(){return(0,P.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,P.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,P.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,P.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,P.jsx)("defs",{children:(0,P.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,P.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function mn(){return(0,P.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,P.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var jt={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:zt,featured:!0},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:zt},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:zt,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:cn,rdns:"io.metamask"},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:pn,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:dn,badge:"For SHOP"}};function He(e){return jt[e]}var w=require("react/jsx-runtime");function fn({wallet:e,detected:t,onConnect:o}){let r=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}o()},n=e.icon;return(0,w.jsxs)("button",{type:"button",className:"wcm-wallet-item",onClick:r,children:[(0,w.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,w.jsx)("div",{className:"wcm-wallet-icon",children:(0,w.jsx)(n,{})}),(0,w.jsxs)("div",{className:"wcm-wallet-info",children:[(0,w.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,w.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,w.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]}),(0,w.jsx)("span",{className:"wcm-wallet-desc",children:e.description})]})]}),e.installUrl&&(t?(0,w.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,w.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function un(){let{wallets:e,activeWalletIds:t,isDetected:o,close:r,isMobile:n}=rt(),c=t.filter(s=>{let d=He(s).visibility;return!d||d==="always"?!0:d==="desktop-only"?!n:d==="mobile-only"?n:!0}),l=c.filter(s=>He(s).featured),a=c.filter(s=>!He(s).featured);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)("div",{className:"wcm-header",children:[(0,w.jsxs)("div",{className:"wcm-header-text",children:[(0,w.jsx)("h2",{className:"wcm-title",children:"Connect Wallet"}),(0,w.jsx)("p",{className:"wcm-subtitle",children:"Connect with one of our available wallet providers to continue."})]}),(0,w.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:r,children:(0,w.jsx)(mn,{})})]}),(0,w.jsx)("div",{className:"wcm-divider"}),(0,w.jsxs)("div",{className:"wcm-body",children:[l.map(s=>{let d=He(s),p=d.rdns?o(d.rdns):!1;return(0,w.jsx)(fn,{wallet:d,detected:p,onConnect:()=>{e[s]?.(),r()}},s)}),l.length>0&&a.length>0&&(0,w.jsxs)("div",{className:"wcm-separator",children:[(0,w.jsx)("div",{className:"wcm-separator-line"}),(0,w.jsx)("span",{className:"wcm-separator-text",children:"or"}),(0,w.jsx)("div",{className:"wcm-separator-line"})]}),(0,w.jsx)("div",{className:"wcm-wallet-list",children:a.map(s=>{let d=He(s),p=d.rdns?o(d.rdns):!1;return(0,w.jsx)(fn,{wallet:d,detected:p,onConnect:()=>{e[s]?.(),r()}},s)})}),(0,w.jsxs)("div",{className:"wcm-help",children:[(0,w.jsx)("p",{className:"wcm-help-title",children:"Wallet not detected?"}),(0,w.jsxs)("ul",{className:"wcm-help-list",children:[(0,w.jsx)("li",{children:"Ensure your wallet extension is installed and unlocked"}),(0,w.jsx)("li",{children:"Try refreshing the page"}),(0,w.jsx)("li",{children:"Some wallets may require you to first open the extension"}),(0,w.jsx)("li",{children:"You can try clicking the wallet anyway"})]})]}),(0,w.jsx)("div",{className:"wcm-divider"}),(0,w.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 wn({className:e}){let{isMobile:t,theme:o,portalStyle:r}=rt();return t?(0,w.jsxs)(it.Drawer.Portal,{children:[(0,w.jsx)(it.Drawer.Overlay,{className:"wcm-overlay"}),(0,w.jsxs)(it.Drawer.Content,{className:$("wcm-drawer-content",e),"data-theme":o,style:r,children:[(0,w.jsx)(it.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,w.jsx)("div",{className:"wcm-drawer-handle"}),(0,w.jsx)("div",{className:"wcm-drawer-body",children:(0,w.jsx)(un,{})})]})]}):(0,w.jsxs)(fe.Portal,{children:[(0,w.jsx)(fe.Overlay,{className:"wcm-overlay"}),(0,w.jsxs)(fe.Content,{className:$("wcm-dialog-content",e),"data-theme":o,style:r,children:[(0,w.jsx)(fe.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,w.jsx)("div",{className:"wcm-dialog-body",children:(0,w.jsx)(un,{})})]})]})}E(`[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))}
12
- `);E(`.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}
13
- `);E(`@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)}}
14
- `);var Ue=require("react/jsx-runtime");function wi({wallets:e,theme:t="dark",mobileBreakpoint:o=768,drawerDirection:r="bottom",dialogWidth:n,drawerMaxWidth:c,drawerMinWidth:l,style:a,open:s,onOpenChange:d,children:p}){let m=Ae(`(max-width: ${o}px)`),[y,L]=ae.useState(!1),b=s!==void 0,f=b?s:y,u=ae.useCallback(v=>{b||L(v),d?.(v)},[b,d]),C=ae.useCallback(()=>u(!1),[u]),{isDetected:_}=nt(),M=ae.useMemo(()=>Object.keys(e),[e]),h=ae.useMemo(()=>{let v={};return n&&(v["--wcm-dialog-width"]=n),c&&(v["--wcm-drawer-max-width"]=c),l&&(v["--wcm-drawer-min-width"]=l),{...v,...a}},[n,c,l,a]),A=ae.useMemo(()=>({theme:t,isMobile:m,open:f,setOpen:u,close:C,wallets:e,activeWalletIds:M,isDetected:_,portalStyle:h}),[t,m,f,u,C,e,M,_,h]),x=(0,Ue.jsx)("div",{"data-theme":t,style:h,children:p});return m?(0,Ue.jsx)(qt.Provider,{value:A,children:(0,Ue.jsx)(hn.Drawer.Root,{direction:r,open:f,onOpenChange:u,noBodyStyles:!0,children:x},"drawer")}):(0,Ue.jsx)(qt.Provider,{value:A,children:(0,Ue.jsx)(gn.Root,{open:f,onOpenChange:u,children:x})})}var Io=Object.assign(wi,{Trigger:ln,Content:wn});var gi='<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>',hi='<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>',xi='<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>',bi='<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>',vi='<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 at(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var st=at(gi),lt=at(hi),ct=at(xi),pt=at(bi),dt=at(vi);var Q=require("react/jsx-runtime");function Po({isConnecting:e,address:t,provider:o,providerName:r,accountName:n,onConnect:c,onDisconnect:l,onCopy:a,onSelectWallet:s,label:d="Connect Wallet",connectingLabel:p="Connecting...",disconnectLabel:m,className:y,theme:L="dark",env:b,showBalance:f=!0,showPortfolio:u,drawerDirection:C,modal:_,connectorId:M,style:h,sendTransaction:A}){if(e)return(0,Q.jsxs)("button",{type:"button",disabled:!0,className:y,style:y?void 0:{...ue.button,...ue.buttonLoading},"aria-busy":"true",children:[(0,Q.jsx)("style",{children:Li}),(0,Q.jsx)("span",{style:ue.spinner,"aria-hidden":"true"}),p]});if(t){let x=r??Ci(o),v=o?yi[o]:void 0;return(0,Q.jsxs)(Me,{env:b,theme:L,drawerDirection:C,modal:_,showBalance:f,showPortfolio:u,walletAddress:t,accountName:n,connectorId:M,onSelectWallet:s,onCopyAddress:a?(O,I)=>{I&&a()}:void 0,onDisconnect:l,disconnectLabel:m,style:h,sendTransaction:A,children:[(0,Q.jsx)(Me.Trigger,{asChild:!0,children:(0,Q.jsxs)("button",{type:"button",className:y,style:y?void 0:ue.connectedBtn,"aria-label":`Connected with ${x}: ${xn(t)}`,children:[v?(0,Q.jsx)("img",{src:v,alt:"",width:20,height:20,style:ue.connectedIcon}):(0,Q.jsx)("span",{style:ue.connectedIconPlaceholder,"aria-hidden":"true"}),(0,Q.jsx)("span",{style:ue.connectedAddress,children:xn(t)})]})}),(0,Q.jsx)(Me.Content,{align:"end",sideOffset:8})]})}return(0,Q.jsx)("button",{type:"button",onClick:c,className:y,style:y?void 0:ue.button,children:d})}var yi={google:pt,apple:dt,cross:st,metamask:lt,binance:ct},ki={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Ci(e){return e?ki[e]:"Wallet"}function xn(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Li="@keyframes cross-cb-spin{to{transform:rotate(360deg)}}",ue={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,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});
1
+ "use strict";var Mn=Object.create;var kt=Object.defineProperty;var _n=Object.getOwnPropertyDescriptor;var Sn=Object.getOwnPropertyNames;var On=Object.getPrototypeOf,Wn=Object.prototype.hasOwnProperty;var Dn=(e,t)=>{for(var o in t)kt(e,o,{get:t[o],enumerable:!0})},Fo=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Sn(t))!Wn.call(e,n)&&n!==o&&kt(e,n,{get:()=>t[n],enumerable:!(r=_n(t,n))||r.enumerable});return e};var D=(e,t,o)=>(o=e!=null?Mn(On(e)):{},Fo(t||!e||!e.__esModule?kt(o,"default",{value:e,enumerable:!0}):o,e)),An=e=>Fo(kt({},"__esModule",{value:!0}),e);var Mi={};Dn(Mi,{APPLE_ICON:()=>mt,AppLauncher:()=>oo,AppLauncherContent:()=>no,AppLauncherTrigger:()=>ro,BINANCE_ICON:()=>pt,CONNECTOR_REGISTRY:()=>et,CROSSX_ICON:()=>lt,ConnectButton:()=>To,ConnectorId:()=>Tt,GOOGLE_ICON:()=>dt,METAMASK_ICON:()=>ct,TOKEN_STATS_QUERY_KEY:()=>St,USER_BALANCE_QUERY_KEY:()=>Mt,WALLET_REGISTRY:()=>Zt,WalletConnectModal:()=>Ro,WalletInfo:()=>Se,WalletPortfolio:()=>No,WalletPortfolioBody:()=>Ee,useGlobalMenu:()=>Je,useTokenBalance:()=>Pe,useTokenStats:()=>Te,useWalletDetect:()=>it});module.exports=An(Mi);var Be=D(require("react"),1),Bo=D(require("@radix-ui/react-popover"),1),Vo=require("vaul");var Ct=require("react"),to=(0,Ct.createContext)(null);function Lt(){let e=(0,Ct.useContext)(to);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var Nt=require("react");function Fe(e){let[t,o]=(0,Nt.useState)(!1);return(0,Nt.useEffect)(()=>{let r=window.matchMedia(e);o(r.matches);let n=p=>o(p.matches);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[e]),t}function M(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}M(`[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
+ `);M(`.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
+ `);M(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
+ `);M(`.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
+ `);M("");var It=require("react/jsx-runtime");function oo({env:e="production",theme:t="dark",mobileBreakpoint:o=768,domain:r,children:n}){let p=Fe(`(max-width: ${o}px)`),[a,l]=Be.useState(!1),s=Be.useCallback(()=>l(!1),[]),c=Be.useMemo(()=>({env:e,theme:t,isMobile:p,open:a,domain:r,close:s}),[e,t,p,a,r,s]);return(0,It.jsx)(to.Provider,{value:c,children:p?(0,It.jsx)(Vo.Drawer.Root,{direction:"right",open:a,onOpenChange:l,noBodyStyles:!0,children:n},"drawer"):(0,It.jsx)(Bo.Root,{open:a,onOpenChange:l,children:n},"popover")})}var zo=D(require("@radix-ui/react-popover"),1),qo=require("vaul");var j=require("react/jsx-runtime");function Ho({size:e=18}){return(0,j.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,j.jsx)("rect",{width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function Uo(){return(0,j.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,j.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function $o(){return(0,j.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,j.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Xe=require("react/jsx-runtime");function ro({asChild:e,children:t}){let{isMobile:o,theme:r}=Lt(),n=t!=null,p=e??!0,a=n?t:(0,Xe.jsx)("button",{type:"button",className:"al-trigger-btn","data-theme":r,children:(0,Xe.jsx)(Ho,{size:o?12:18})});return o?(0,Xe.jsx)(qo.Drawer.Trigger,{asChild:p,children:a}):(0,Xe.jsx)(zo.Trigger,{asChild:p,children:a})}var Ne=D(require("react"),1),Pt=D(require("@radix-ui/react-popover"),1),Le=require("vaul");var Go=require("@tanstack/react-query");var jo={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"};function Je(e="production"){return(0,Go.useQuery)({queryKey:["global-menu",e],queryFn:async({signal:t})=>{let o=await fetch(jo[e],{cache:"no-store",signal:t});if(!o.ok)throw new Error(`Failed to fetch global menu: ${o.status}`);return o.json()},staleTime:0,gcTime:0,refetchOnMount:!0})}function $(...e){return e.filter(Boolean).join(" ")}var F=require("react/jsx-runtime");function no({align:e="end",sideOffset:t=12,className:o}){let{env:r,theme:n,isMobile:p,domain:a,close:l}=Lt(),{data:s}=Je(r),c=Ne.useMemo(()=>(s?.items??[]).sort((u,C)=>u.order-C.order),[s]),d=8,m=Ne.useRef(null),w=Ne.useCallback(u=>{m.current={x:u.clientX,y:u.clientY}},[]),h=typeof window<"u"?window.location.pathname:"",b=Ne.useCallback((u,C)=>{if(m.current){let I=u.clientX-m.current.x,k=u.clientY-m.current.y;if(m.current=null,Math.abs(I)>d||Math.abs(k)>d)return}let _=C.url[r]??C.url.production,S=Zo(_,a);if(!S)try{let I=new URL(_).pathname;if(h===I||h.startsWith(I+"/")){l();return}}catch{}S?window.open(_,"_blank","noopener,noreferrer"):window.location.href=_,l()},[r,a,l,h]),f=(0,F.jsx)("div",{className:"al-grid","data-theme":n,children:c.map(u=>{let C=u.url[r]??u.url.production,_=Zo(C,a),S=!1;if(!_)try{let I=new URL(C).pathname;S=h===I||h.startsWith(I+"/")}catch{S=!1}return(0,F.jsxs)("button",{type:"button",className:"al-grid-item","data-active":S||void 0,onPointerDown:w,onClick:I=>b(I,u),children:[(0,F.jsxs)("div",{className:"al-grid-item-left",children:[(0,F.jsx)("div",{className:"al-grid-item-icon",children:(0,F.jsx)("img",{src:u.iconUrl,alt:u.label,width:24,height:24,loading:"lazy"})}),(0,F.jsx)("span",{className:"al-grid-item-label",children:u.label}),u.isNew&&(0,F.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,F.jsx)("div",{className:"al-grid-item-right",children:u.badge&&(0,F.jsx)("span",{className:"al-badge",children:u.badge})})]},u.id)})});return p?(0,F.jsxs)(Le.Drawer.Portal,{children:[(0,F.jsx)(Le.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,F.jsxs)(Le.Drawer.Content,{className:$("al-drawer-content",o),"data-theme":n,children:[(0,F.jsxs)("div",{className:"al-drawer-header",children:[(0,F.jsx)(Le.Drawer.Close,{className:"al-drawer-close",children:(0,F.jsx)(Uo,{})}),(0,F.jsx)(Le.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,F.jsx)(Le.Drawer.Close,{className:"al-drawer-close",children:(0,F.jsx)($o,{})})]}),(0,F.jsx)("div",{className:"al-drawer-body",children:f})]})]}):(0,F.jsx)(Pt.Portal,{children:(0,F.jsx)(Pt.Content,{align:e,sideOffset:t,className:$("al-popover-content",o),"data-theme":n,children:f})})}function Zo(e,t){try{let o=new URL(e).hostname;return typeof window>"u"?!0:o!==(t??window.location.hostname)}catch{return!1}}var Y=D(require("react"),1),ln=D(require("@radix-ui/react-popover"),1),cn=require("vaul");var Rt=require("react"),io=(0,Rt.createContext)(null);function ce(){let e=(0,Rt.useContext)(io);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Tt=(r=>(r.CROSSx="crossx",r.MetaMask="io.metamask",r.Binance="com.binance.wallet",r))(Tt||{}),et={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 ar=D(require("@radix-ui/react-popover"),1),sr=require("vaul");var T=require("react/jsx-runtime");function Ko({size:e=16,className:t}){return(0,T.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,T.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,T.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 ao({size:e=16,className:t}){return(0,T.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,T.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 so({size:e=16,className:t}){return(0,T.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,T.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function lo({size:e=24,className:t}){return(0,T.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,T.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,T.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,T.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,T.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,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,T.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,T.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,T.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,T.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,T.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,T.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,T.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function tr({size:e=16,className:t}){return(0,T.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,T.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,T.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,T.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,T.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,T.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,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,T.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 pe=D(require("bignumber.js"),1);function Fn(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 Et(e,t){if(!e||e==="0")return"0.00";let o=new pe.default(e).shiftedBy(-t),r=o.isGreaterThanOrEqualTo(1)?2:4;return o.toFormat(r,pe.default.ROUND_DOWN)}function Ve(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function co(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let o=t>=1?2:4,r=Math.pow(10,o);return`$${(Math.floor(t*r)/r).toLocaleString("en-US",{minimumFractionDigits:o,maximumFractionDigits:o})}`}function nr(e,t,o){let n=new pe.default(e).shiftedBy(-t).multipliedBy(new pe.default(o));return n.isZero()||n.isNaN()?"$0.00":`$${(n.integerValue(pe.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?n.decimalPlaces(2,pe.default.ROUND_DOWN):n.decimalPlaces(4,pe.default.ROUND_DOWN)).toFormat()}`}function ir(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 a=Number(o);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};o=Fn(a.toFixed(18))}let[r="0",n=""]=o.split(".");if(Number(r)>=1){let a=n.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(r).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return n.length<4?{displayValue:`${r}.${n}`,isLowerBound:!1}:n.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${n.slice(0,4)}`,isLowerBound:!1}}var Ie=require("react/jsx-runtime");function lr({asChild:e,className:t,children:o}){let{isMobile:r,theme:n,walletAddress:p}=ce(),a=o!=null,l=e??!0,s=a?o:(0,Ie.jsxs)("button",{type:"button",className:$("wi-trigger-btn",t),"data-theme":n,"data-mobile":r||void 0,children:[(0,Ie.jsx)(Ko,{size:r?14:16}),(0,Ie.jsx)("span",{className:"wi-trigger-address",children:Ve(p)})]});return r?(0,Ie.jsx)(sr.Drawer.Trigger,{asChild:l,children:s}):(0,Ie.jsx)(ar.Trigger,{asChild:l,children:s})}var B=D(require("react"),1),$t=D(require("@radix-ui/react-popover"),1),rt=require("vaul");var Ue=D(require("bignumber.js"),1);var dr=require("@tanstack/react-query"),mr=require("react");var ee={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},X={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var po={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"},cr={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function mo(e,t){let o=X[e];if(t===o.cross)return cr.cross;if(t===o.bsc)return cr.bsc}var Bn={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function pr(e,t,o={}){if(!t||!t.startsWith("0x"))return;let{size:r=120,bg:n,format:p="png"}=o,a=Bn[e],l=n?`&bg=${n}`:"";return`${a}/portrait/evm/${t}.${p}?size=${r}${l}`}var Mt="user-balance";async function Vn(e,t,o,r){let n=new URLSearchParams({networkId:`eip155:${t}`,account:o}),p=await fetch(`${e}/v1/public/token/balance?${n}`,{cache:"no-store",signal:r});if(!p.ok)throw new Error(`Failed to fetch token balance: ${p.status}`);let a=await p.json();if(a.code!==200)throw new Error(`Token balance API error: ${a.code}`);return a.data}function Pe(e,t,o=!0){let r=ee[e],n=X[e],p=[n.cross,n.bsc],a=(0,dr.useQueries)({queries:p.map(d=>({queryKey:[Mt,e,t,d],queryFn:({signal:m})=>Vn(r,d,t,m),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1}))}),l=a.some(d=>d.isLoading),s=a.some(d=>d.isError);return{tokens:(0,mr.useMemo)(()=>{let d=[];for(let m of a)m.data&&d.push(...m.data);return d},[a]),isLoading:l,isError:s}}var _t=require("@tanstack/react-query"),fr=require("react");var Hn="forge-holdings",Un="forge-token-image";async function $n(e,t,o){let r=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:o});if(!r.ok)throw new Error(`Failed to fetch forge holdings: ${r.status}`);let n=await r.json();if(!n.success)throw new Error("Forge holdings API error");return n.data.items}async function zn(e,t,o){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:o});if(!r.ok)return{address:t,image_url:""};let n=await r.json();return n.success?{address:t,image_url:n.data.token.image_url}:{address:t,image_url:""}}function ur(e,t,o=!0){let r=po[e],{data:n,...p}=(0,_t.useQuery)({queryKey:[Hn,e,t],queryFn:({signal:a})=>$n(r,t,a),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1});return{holdings:n??[],...p}}function gr(e,t,o=!0){let r=po[e],n=(0,_t.useQueries)({queries:t.map(a=>({queryKey:[Un,e,a],queryFn:({signal:l})=>zn(r,a,l),enabled:o,staleTime:1/0}))});return{imageMap:(0,fr.useMemo)(()=>{let a=new Map;for(let l of n)l.data&&a.set(l.data.address,l.data.image_url);return a},[n])}}var wr=require("@tanstack/react-query"),hr=require("react");var St="token-stats";function Re(e,t){return`${e}:${t.toLowerCase()}`}function Te(e,t=!0){let o=ee[e],{data:r,...n}=(0,wr.useQuery)({queryKey:[St,e],queryFn:async({signal:a})=>{let l=await fetch(`${o}/v1/public/token/stats`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch token stats: ${l.status}`);let s=await l.json();if(s.code!==200)throw new Error(`Token stats API error: ${s.code}`);return s},enabled:t,staleTime:3e4});return{statsMap:(0,hr.useMemo)(()=>{let a=new Map;if(!r?.data)return a;for(let l of r.data){let s=Re(l.chain_id,l.address);a.set(s,l)}return a},[r]),...n}}var xr=require("@tanstack/react-query"),br=require("react");var qn="token-info";function fo(e,t){return`${t.toLowerCase()}_${e}`}function yr(e,t=!0){let o=ee[e],{data:r,...n}=(0,xr.useQuery)({queryKey:[qn,e],queryFn:async({signal:a})=>{let l=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let s=await l.json();if(s.code!==200)throw new Error(`Token info API error: ${s.code}`);return s},enabled:t,staleTime:1/0});return{categoryMap:(0,br.useMemo)(()=>{let a=new Map;if(!r?.data)return a;for(let l of r.data){let s=fo(l.chain_id,l.address);a.set(s,l.category)}return a},[r]),...n}}var vr=require("react"),Ot=D(require("bignumber.js"),1);function kr(e,t,o){let{tokens:r,isLoading:n}=Pe(e,t,o),{statsMap:p}=Te(e,o);return(0,vr.useMemo)(()=>{let a=new Ot.default(0);for(let d of r){let m=p.get(Re(d.chainId,d.address));if(!m)continue;let h=new Ot.default(d.quantity.numeric).shiftedBy(-d.quantity.decimals).multipliedBy(new Ot.default(m.price));h.isNaN()||(a=a.plus(h))}let l=a.toFixed(),{displayValue:s,isLowerBound:c}=ir(l);return{totalUsd:l,displayValue:s,isLowerBound:c,isLoading:n}},[r,p,n])}var tn=require("qrcode.react");function te(e,t,o,r){if(!r||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let n=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,p=l=>{if(l===null){n?.close();return}let s=l??t;if(n)try{n.location.href=s}catch{n.close(),window.open(s,"_blank","noopener,noreferrer")}else window.open(s,"_blank","noopener,noreferrer")},a;try{a=r(t,o)}catch(l){console.error("[dapp-ui] onOutlink threw:",l),n?.close();return}a&&typeof a.then=="function"?a.then(p,l=>{console.error("[dapp-ui] onOutlink rejected:",l),n?.close()}):p(a)}var _e=D(require("react"),1),en=require("vaul");var Wt=require("react"),tt=(0,Wt.createContext)(null);function G(){let e=(0,Wt.useContext)(tt);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var Cr=require("vaul");var uo=require("react/jsx-runtime");function Lr({asChild:e,children:t}){let{walletAddress:o}=G(),r=t!=null,n=e??!0,p=r?t:(0,uo.jsx)("button",{type:"button",children:Ve(o)});return(0,uo.jsx)(Cr.Drawer.Trigger,{asChild:n,children:p})}var ot=require("vaul");var J=D(require("react"),1),Xr=require("@tanstack/react-query");var _r=require("react"),Vt=D(require("bignumber.js"),1);var Pr=require("@tanstack/react-query"),go=require("react");var Dt={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"},Nr={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},At={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"},de={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},Ir={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 jn="wp:reward-pools";function Ft(e,t=!0){let o=Dt[e],{data:r,...n}=(0,Pr.useQuery)({queryKey:[jn,e],queryFn:async({signal:l})=>{let s=await fetch(`${o}/v1/pools`,{cache:"no-store",signal:l});if(!s.ok)throw new Error(`Failed to fetch pools: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),p=(0,go.useMemo)(()=>r?.data.pools.filter(l=>l.pool_type==="CrossPool")??[],[r]),a=(0,go.useMemo)(()=>r?.data.pools.filter(l=>l.pool_type==="GamePool")??[],[r]);return{crossPools:p,gamePools:a,allPools:r?.data.pools??[],...n}}var Rr=require("@tanstack/react-query"),Tr=require("react");var Gn="wp:user-deposits";function Bt(e,t,o=!0){let r=Dt[e],n=o&&!!t,{data:p,...a}=(0,Rr.useQuery)({queryKey:[Gn,e,t],queryFn:async({signal:s})=>{let c=await fetch(`${r}/v1/users/${t}/deposits`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let d=await c.json();if(d.code!==200)throw new Error(`Deposits API error: ${d.code}`);return d},enabled:n,staleTime:0});return{depositMap:(0,Tr.useMemo)(()=>{let s=new Map;if(!p?.data.user_deposits)return s;for(let c of p.data.user_deposits)s.set(c.pool_address.toLowerCase(),c);return s},[p]),deposits:p?.data.user_deposits??[],...a}}var wo=require("@tanstack/react-query"),ho=require("react");function oe(e,t,o,r=!0){let n=Ir[e][t],p=r&&!!o,{data:a,...l}=(0,wo.useQuery)({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:b})=>{let f=await fetch(`${n}/pair-info`,{cache:"no-store",signal:b});if(!f.ok)throw new Error(`pair-info fetch failed: ${f.status}`);let u=await f.json();if(u.code!==200)throw new Error(`pair-info API error: ${u.code}`);return u},enabled:r,staleTime:0}),s=a?.data??[],c=(0,ho.useMemo)(()=>{let b=new Map;for(let f of s)b.set(f.pair_address.toLowerCase(),f);return b},[s]),{data:d,...m}=(0,wo.useQuery)({queryKey:["wp:dex-orders",e,t,o],queryFn:async({signal:b})=>{let f=Math.floor(Date.now()/1e3),u=new URLSearchParams({owner:o,size:"200",start_date:"0",end_date:String(f)}),C=await fetch(`${n}/open-order?${u}`,{cache:"no-store",signal:b});if(!C.ok)throw new Error(`open-order fetch failed: ${C.status}`);let _=await C.json();if(_.code!==200)throw new Error(`open-order API error: ${_.code}`);return _.data?.data??[]},enabled:p,staleTime:0}),w=d??[],h=(0,ho.useMemo)(()=>{let b=new Map;for(let f of w){let u=f.pair.toLowerCase();b.has(u)||b.set(u,{buys:[],sells:[]});let C=b.get(u);f.order_side===1?C.buys.push(f):C.sells.push(f)}return b},[w]);return{allPairs:s,pairMap:c,orders:w,ordersByPair:h,isEmpty:w.length===0,isLoading:l.isLoading||m.isLoading}}var Zn=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],Er="var(--wp-green)",Mr=4;function Sr(e,t,o=!0){let r=o&&!!t,{allPools:n}=Ft(e,r),{depositMap:p}=Bt(e,t,r),{allPairs:a,pairMap:l,ordersByPair:s}=oe(e,"cross",t,r),{allPairs:c,pairMap:d,ordersByPair:m}=oe(e,"crossd",t,r),{allPairs:w,pairMap:h,ordersByPair:b}=oe(e,"forge",t,r);return(0,_r.useMemo)(()=>{let f=new Map,u=new Map,C=(y,v)=>{!Number.isFinite(v)||v<=0||u.set(y,(u.get(y)??0)+v)};for(let y of n){let v=Number(y.deposit_token.price);v>0&&f.set(y.deposit_token.symbol,v);for(let A of y.reward_tokens){let P=Number(A.price);P>0&&f.set(A.symbol,P)}}for(let y of[...a,...c,...w]){let v=f.get(y.quote_symbol),A=Number(y.billboard?.price);v&&A>0&&!f.has(y.base_symbol)&&f.set(y.base_symbol,A*v)}for(let y of n){let v=p.get(y.pool_address.toLowerCase());if(!v)continue;let A=new Vt.default(v.deposited_amount).shiftedBy(-y.deposit_token.decimals).toNumber();if(C(y.deposit_token.symbol,A),y.reward_tokens.length>0){let P=y.reward_tokens[0],H=new Vt.default(v.claimable_reward).shiftedBy(-P.decimals).toNumber();C(P.symbol,H)}}let _=[{pairMap:l,ordersByPair:s},{pairMap:d,ordersByPair:m},{pairMap:h,ordersByPair:b}];for(let{pairMap:y,ordersByPair:v}of _)for(let[A,P]of v){let H=y.get(A);if(H){for(let Z of P.buys){let ne=Number(Z.amount)-Number(Z.filled);C(H.quote_symbol,ne*Number(Z.price))}for(let Z of P.sells){let ne=Number(Z.amount)-Number(Z.filled);C(H.base_symbol,ne)}}}let S=[],I=0;for(let[y,v]of u){let A=f.get(y)??0,P=v*A;P>0&&(S.push({symbol:y,usdValue:P}),I+=P)}S.sort((y,v)=>v.usdValue-y.usdValue);let k=[];if(I>0){let y=S.slice(0,Mr),v=S.slice(Mr);for(let P=0;P<y.length;P++)k.push({symbol:y[P].symbol,usdValue:y[P].usdValue,percentage:Math.round(y[P].usdValue/I*100),color:Zn[P]??Er});if(v.length>0){let P=v.reduce((H,Z)=>H+Z.usdValue,0);k.push({symbol:"Others",usdValue:P,percentage:Math.round(P/I*100),color:Er})}let A=k.reduce((P,H)=>P+H.percentage,0);A!==100&&k.length>0&&(k[0].percentage+=100-A)}return{totalUsd:I,formattedTotal:I>0?`$${new Vt.default(I).toFormat(2)}`:"$0.00",segments:k}},[n,p,a,l,s,c,d,m,w,h,b])}var ae=require("react/jsx-runtime");function Or({size:e=22,className:t}){return(0,ae.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ae.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Wr({size:e=22,className:t}){return(0,ae.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,ae.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,ae.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 Dr({size:e=12,className:t}){return(0,ae.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ae.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 Ar=require("@tanstack/react-query"),Fr=require("react");var Kn="wp:token-info";function me(e,t=!0){let o=ee[e],r=X[e].cross,{data:n,...p}=(0,Ar.useQuery)({queryKey:[Kn,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:300*1e3}),{byChainAddr:a,byChainSym:l}=(0,Fr.useMemo)(()=>{let c=new Map,d=new Map;if(!n?.data)return{byChainAddr:c,byChainSym:d};for(let m of n.data){let w=m.address.toLowerCase();c.set(`${m.chain_id}:${w}`,m),c.set(w,m);let h=m.symbol.replace(/^t/,"").toUpperCase(),b=`${m.chain_id}:${h}`;d.has(b)||d.set(b,m),d.has(h)||d.set(h,m)}return{byChainAddr:c,byChainSym:d}},[n]);return{getTokenImage:(c,d)=>{let m=c.toLowerCase(),w=a.get(`${r}:${m}`);if(w?.image)return w.image;let h=a.get(m);if(h?.image)return h.image;if(d){let b=d.replace(/^t/,"").toUpperCase(),f=l.get(`${r}:${b}`);if(f?.image)return f.image;let u=l.get(b);if(u?.image)return u.image}return""},...p}}var fe=require("react/jsx-runtime");function re({title:e,icon:t,iconFit:o="cover",isEmpty:r,children:n}){return(0,fe.jsxs)("div",{className:"wp-svc-card",children:[(0,fe.jsxs)("div",{className:"wp-svc-card-head",children:[(0,fe.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:o}}),(0,fe.jsx)("span",{className:"wp-svc-card-title",children:e})]}),r?(0,fe.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,fe.jsx)("div",{className:"wp-svc-items",children:n})]})}var Ht=D(require("bignumber.js"),1),z=require("react/jsx-runtime"),Yn="CROSS Rewards",Qn="https://contents.crosstoken.io/frontend/common/app-launcher/icons/award.svg";function Br(e,t){let o=new Ht.default(e).shiftedBy(-t);return o.isZero()?"0":o.isGreaterThanOrEqualTo(1)?o.toFormat(2,Ht.default.ROUND_DOWN):o.toFormat(4,Ht.default.ROUND_DOWN)}function Vr(){let{env:e,walletAddress:t,onOutlink:o}=G(),r=!!t,{allPools:n}=Ft(e,r),{depositMap:p}=Bt(e,t,r),{getTokenImage:a}=me(e,r),l=s=>`${Nr[e]}/rewards/${s.pool_address}?action=withdraw`;return(0,z.jsx)(re,{title:Yn,icon:Qn,isEmpty:n.length===0,children:n.map(s=>{let c=p.get(s.pool_address.toLowerCase()),d=c?.deposited_amount??"0",m=l(s);return(0,z.jsxs)("a",{className:"wp-item","data-side":"reward",href:m,target:"_blank",rel:"noopener noreferrer",onClick:w=>te(w,m,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:s,userDeposit:c}},o),children:[(0,z.jsxs)("div",{className:"wp-item-body",children:[(0,z.jsxs)("div",{className:"wp-item-field",children:[(0,z.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,z.jsxs)("div",{className:"wp-svc-token",children:[a(s.deposit_token.address,s.deposit_token.symbol)&&(0,z.jsx)("img",{className:"wp-svc-token-icon",src:a(s.deposit_token.address,s.deposit_token.symbol),alt:""}),(0,z.jsx)("span",{children:Br(d,s.deposit_token.decimals)})]})]}),(0,z.jsxs)("div",{className:"wp-item-field",children:[(0,z.jsx)("span",{className:"wp-item-label",children:"Rewards"}),s.reward_tokens.map(w=>{let h=a(w.address,w.symbol);return(0,z.jsxs)("div",{className:"wp-svc-token",children:[h&&(0,z.jsx)("img",{className:"wp-svc-token-icon",src:h,alt:""}),(0,z.jsx)("span",{children:c?Br(c.claimable_reward,w.decimals):"0"})]},w.address)})]})]}),(0,z.jsxs)("div",{className:"wp-item-badges",children:[(0,z.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Claim"}),(0,z.jsx)("span",{className:"wp-badge wp-badge--muted",children:"Withdraw"})]})]},s.pool_address)})})}var bo=D(require("bignumber.js"),1);var N=require("react/jsx-runtime");function xo(e){let t=new bo.default(e);if(t.isNaN())return e;let o=t.decimalPlaces()??0;return t.toFormat(o)}function Hr(e){let t=new bo.default(e.amount).minus(e.filled);return xo(t.toString())}function He({market:e,pairMap:t,ordersByPair:o,getDexUrl:r,getTokenImage:n}){let{onOutlink:p}=G(),a=[];for(let[l,s]of o){let c=t.get(l),d=c?n(c.base_address,c.base_symbol):"",m=c?n(c.quote_address,c.quote_symbol):"",w=r(l);for(let h of s.buys)a.push((0,N.jsxs)("a",{className:"wp-item","data-side":"buy",href:w,target:"_blank",rel:"noopener noreferrer",onClick:b=>te(b,w,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"buy",order:h,pair:c}},p),children:[(0,N.jsxs)("div",{className:"wp-item-body",children:[(0,N.jsxs)("div",{className:"wp-item-field",children:[(0,N.jsx)("span",{className:"wp-item-label wp-item-label--buy",children:"Buy"}),(0,N.jsxs)("div",{className:"wp-svc-token",children:[d&&(0,N.jsx)("img",{className:"wp-svc-token-icon",src:d,alt:""}),(0,N.jsx)("span",{children:Hr(h)})]})]}),(0,N.jsxs)("div",{className:"wp-item-field",children:[(0,N.jsx)("span",{className:"wp-item-label",children:"Price"}),(0,N.jsxs)("div",{className:"wp-svc-token",children:[m&&(0,N.jsx)("img",{className:"wp-svc-token-icon",src:m,alt:""}),(0,N.jsx)("span",{children:xo(h.price)})]})]})]}),(0,N.jsx)("div",{className:"wp-item-badges",children:(0,N.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Claim"})})]},`buy-${h.order_id}`));for(let h of s.sells)a.push((0,N.jsxs)("a",{className:"wp-item","data-side":"sell",href:w,target:"_blank",rel:"noopener noreferrer",onClick:b=>te(b,w,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"sell",order:h,pair:c}},p),children:[(0,N.jsxs)("div",{className:"wp-item-body",children:[(0,N.jsxs)("div",{className:"wp-item-field",children:[(0,N.jsx)("span",{className:"wp-item-label wp-item-label--sell",children:"Sell"}),(0,N.jsxs)("div",{className:"wp-svc-token",children:[d&&(0,N.jsx)("img",{className:"wp-svc-token-icon",src:d,alt:""}),(0,N.jsx)("span",{children:Hr(h)})]})]}),(0,N.jsxs)("div",{className:"wp-item-field",children:[(0,N.jsx)("span",{className:"wp-item-label",children:"Price"}),(0,N.jsxs)("div",{className:"wp-svc-token",children:[m&&(0,N.jsx)("img",{className:"wp-svc-token-icon",src:m,alt:""}),(0,N.jsx)("span",{children:xo(h.price)})]})]})]}),(0,N.jsx)("div",{className:"wp-item-badges",children:(0,N.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`sell-${h.order_id}`))}return(0,N.jsx)(N.Fragment,{children:a})}var yo=require("react/jsx-runtime"),Xn="Gametoken - CROSS",Jn="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function Ur(){let{env:e,walletAddress:t}=G(),o=!!t,{pairMap:r,ordersByPair:n,isEmpty:p}=oe(e,"cross",t,o),{getTokenImage:a}=me(e,o);return(0,yo.jsx)(re,{title:Xn,icon:Jn,isEmpty:p,children:(0,yo.jsx)(He,{market:"cross",pairMap:r,ordersByPair:n,getDexUrl:s=>{let c=r.get(s.toLowerCase());return`${de[e]}/gametoken/cross/${c?.base_symbol??""}`},getTokenImage:a})})}var vo=require("react/jsx-runtime"),ei="Gametoken - CROSSD",ti="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function $r(){let{env:e,walletAddress:t}=G(),o=!!t,{pairMap:r,ordersByPair:n,isEmpty:p}=oe(e,"crossd",t,o),{getTokenImage:a}=me(e,o);return(0,vo.jsx)(re,{title:ei,icon:ti,isEmpty:p,children:(0,vo.jsx)(He,{market:"crossd",pairMap:r,ordersByPair:n,getDexUrl:s=>{let c=r.get(s.toLowerCase());return`${de[e]}/gametoken/crossd/${c?.base_symbol??""}`},getTokenImage:a})})}var ko=require("react/jsx-runtime"),oi="Gametoken - Forge",ri="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function zr(){let{env:e,walletAddress:t}=G(),o=!!t,{pairMap:r,ordersByPair:n,isEmpty:p}=oe(e,"forge",t,o),{getTokenImage:a}=me(e,o);return(0,ko.jsx)(re,{title:oi,icon:ri,isEmpty:p,children:(0,ko.jsx)(He,{market:"forge",pairMap:r,ordersByPair:n,getDexUrl:s=>{let c=r.get(s.toLowerCase());return`${de[e]}/gametoken/forge/${c?.base_symbol??""}`},getTokenImage:a})})}var Ut=D(require("bignumber.js"),1),Yr=require("react");var qr=require("@tanstack/react-query");var ni="wp:forge-pools";function jr(e,t,o=!0){let r=At[e],n=o&&!!t,{data:p,...a}=(0,qr.useQuery)({queryKey:[ni,e,t],queryFn:async()=>{let s=await fetch(`${r}/v1/users/${t}/pools`,{cache:"no-store"});if(!s.ok)throw new Error(`forge pools fetch failed: ${s.status}`);return(await s.json()).data?.items??[]},enabled:n,staleTime:0}),l=p??[];return{pools:l,isEmpty:l.length===0,...a}}var Gr=require("@tanstack/react-query"),Zr=require("react");var ii="wp:forge-token-detail";async function ai(e,t){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return o.ok?(await o.json())?.data?.token??null:null}function Kr(e,t,o=!0){let r=At[e],n=(0,Gr.useQueries)({queries:t.map(l=>({queryKey:[ii,e,l],queryFn:()=>ai(r,l),enabled:o&&!!l,staleTime:3e4}))}),p=(0,Zr.useMemo)(()=>{let l=new Map;for(let s=0;s<n.length;s++){let c=n[s]?.data,d=t[s];c&&d&&l.set(d.toLowerCase(),c)}return l},[n,t]),a=n.some(l=>l.isLoading);return{detailMap:p,isLoading:a}}var V=require("react/jsx-runtime"),si="Forge",li="https://x.crosstoken.io/forge/favicon-96x96.png",ci=18,pi="https://contents.crosstoken.io/wallet/token/images/FT.png";function di(e){if(!e||e==="0")return"0";let t=new Ut.default(e).shiftedBy(-ci);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Ut.default.ROUND_DOWN):t.toFormat(4,Ut.default.ROUND_DOWN)}function mi(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 Qr(){let{env:e,walletAddress:t,onOutlink:o}=G(),r=!!t,{pools:n,isEmpty:p}=jr(e,t,r),a=(0,Yr.useMemo)(()=>n.map(c=>c.token.address),[n]),{detailMap:l}=Kr(e,a,r&&a.length>0),s=c=>`${de[e]}/forge/token/${c.token.address}`;return(0,V.jsx)(re,{title:si,icon:li,iconFit:"contain",isEmpty:p,children:n.map(c=>{let d=l.get(c.token.address.toLowerCase()),m=d?.image_url||d?.image||c.token.image||pi,w=d?.symbol||c.token.symbol,h=s(c);return(0,V.jsxs)("a",{className:"wp-item","data-side":"lp",href:h,target:"_blank",rel:"noopener noreferrer",onClick:b=>te(b,h,{category:"portfolio",origin:"portfolio-forge",payload:{pool:c,tokenDetail:d}},o),children:[(0,V.jsxs)("div",{className:"wp-item-body",children:[(0,V.jsxs)("div",{className:"wp-item-field",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Pair"}),(0,V.jsxs)("div",{className:"wp-svc-token",children:[(0,V.jsx)("img",{className:"wp-svc-token-icon",src:m,alt:""}),(0,V.jsx)("span",{children:w})]})]}),(0,V.jsxs)("div",{className:"wp-item-field",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,V.jsx)("div",{className:"wp-svc-token",children:(0,V.jsx)("span",{children:di(c.lp_balance)})})]}),(0,V.jsxs)("div",{className:"wp-item-field",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,V.jsx)("div",{className:"wp-svc-token",children:(0,V.jsx)("span",{children:mi(c.pool_ownership)})})]})]}),(0,V.jsx)("div",{className:"wp-item-badges",children:(0,V.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Withdraw"})})]},c.pair_address)})})}M(`.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:Sora,sans-serif;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:Sora,sans-serif;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-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:Roboto,Sora,sans-serif;font-size:16px;font-weight:600;line-height:24px;letter-spacing:.15px;text-align:center;color:var(--wp-text);margin:0}.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}
6
+ `);var L=require("react/jsx-runtime"),Co=5,fi="wp:";function Ee({env:e="production",theme:t="dark",walletAddress:o,onBack:r,showHeader:n=!0,variant:p="embed",className:a,sendTransaction:l,onOutlink:s}){let c=!!o,d=(0,Xr.useQueryClient)(),{segments:m}=Sr(e,o,c),[w,h]=J.useState(Co),[b,f]=J.useState(!1),u=J.useCallback(()=>{d.invalidateQueries({predicate:k=>typeof k.queryKey[0]=="string"&&k.queryKey[0].startsWith(fi)})},[d]),C=J.useCallback(()=>{u(),f(!0),setTimeout(()=>f(!1),600),h(Co)},[u]);J.useEffect(()=>{if(!c)return;let k=setInterval(()=>{h(y=>y<=1?(C(),Co):y-1)},1e3);return()=>clearInterval(k)},[c,C]);let _=J.useCallback(()=>{r?.()},[r]),S=J.useMemo(()=>({env:e,theme:t,open:!0,walletAddress:o,close:_,sendTransaction:l,onOutlink:s}),[e,t,o,_,l,s]),I=(0,L.jsxs)(L.Fragment,{children:[n&&(0,L.jsxs)("div",{className:"wp-header",children:[r?(0,L.jsx)("button",{type:"button",className:"wp-header-btn",onClick:r,children:(0,L.jsx)(Or,{})}):(0,L.jsx)("span",{className:"wp-header-btn","aria-hidden":!0}),(0,L.jsx)("h2",{className:"wp-header-title",children:"My Portfolio"}),(0,L.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:C,children:[(0,L.jsx)(Wr,{className:b?"wp-spin-once":void 0}),c&&(0,L.jsx)("span",{className:"wp-refresh-badge",children:w})]})]}),(0,L.jsx)("div",{className:"wp-top",children:m.length>0&&(0,L.jsxs)("div",{className:"wp-asset",children:[(0,L.jsxs)("div",{className:"wp-asset-head",children:[(0,L.jsx)("span",{className:"wp-asset-head-label",children:"Consolidated Asset"}),(0,L.jsx)("span",{className:"wp-asset-head-icon",children:(0,L.jsx)(Dr,{})})]}),(0,L.jsx)("div",{className:"wp-bar",children:m.map(k=>(0,L.jsx)("div",{className:"wp-bar-seg",style:{flex:`${k.percentage} 0 0`,background:k.color},children:k.percentage>=5&&(0,L.jsxs)("span",{className:"wp-bar-seg-pct",children:[k.percentage,"%"]})},k.symbol))}),(0,L.jsx)("div",{className:"wp-legend",children:m.map(k=>(0,L.jsxs)("div",{className:"wp-legend-item",children:[(0,L.jsx)("span",{className:"wp-legend-dot",style:{background:k.color}}),(0,L.jsx)("span",{className:"wp-legend-label",children:k.symbol})]},k.symbol))})]})}),(0,L.jsx)("div",{className:"wp-body",children:(0,L.jsxs)("div",{className:"wp-body-inner",children:[(0,L.jsx)(Vr,{}),(0,L.jsx)(Ur,{}),(0,L.jsx)($r,{}),(0,L.jsx)(zr,{}),(0,L.jsx)(Qr,{})]})})]});return(0,L.jsx)(tt.Provider,{value:S,children:p==="none"?I:(0,L.jsx)("div",{className:$(p==="fullscreen"?"wp-fullscreen":"wp-embed",a),"data-theme":t,children:I})})}var Me=require("react/jsx-runtime");function Jr({className:e}){let{env:t,theme:o,walletAddress:r,close:n,sendTransaction:p}=G();return(0,Me.jsxs)(ot.Drawer.Portal,{children:[(0,Me.jsx)(ot.Drawer.Overlay,{className:"wp-overlay"}),(0,Me.jsxs)(ot.Drawer.Content,{className:$("wp-fullscreen",e),"data-theme":o,children:[(0,Me.jsx)(ot.Drawer.Title,{className:"wp-sr-only",children:"My Portfolio"}),(0,Me.jsx)(Ee,{env:t,theme:o,walletAddress:r,onBack:n,variant:"none",sendTransaction:p})]})]})}var Lo=require("react/jsx-runtime");function ui({env:e="production",theme:t="dark",walletAddress:o,open:r,onOpenChange:n,sendTransaction:p,onOutlink:a,children:l}){let s=r!==void 0,[c,d]=_e.useState(!1),m=s?r:c,w=_e.useCallback(f=>{s||d(f),n?.(f)},[s,n]),h=_e.useCallback(()=>w(!1),[w]),b=_e.useMemo(()=>({env:e,theme:t,open:m,walletAddress:o,close:h,sendTransaction:p,onOutlink:a}),[e,t,m,o,h,p,a]);return(0,Lo.jsx)(tt.Provider,{value:b,children:(0,Lo.jsx)(en.Drawer.Root,{direction:"bottom",open:m,onOpenChange:w,noBodyStyles:!0,children:l})})}var No=Object.assign(ui,{Trigger:Lr,Content:Jr});var i=require("react/jsx-runtime");function Io(e,t,o){let r=X[e],n=o.toUpperCase();if(t===r.cross&&n.includes("CROSSD"))return 0;if(t===r.cross&&n==="CROSS")return 1;if(t===r.bsc&&n==="CROSS")return 2}function gi(e){return parseInt(e.split(":")[1],10)}function wi(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function hi(e){let t=e.toLowerCase().replace(/^0x/,""),o=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),r=parseInt(o.slice(0,4),16)%360,n=(r+60+parseInt(o.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${r} 85% 65%), hsl(${n} 80% 55%))`}function on({align:e="end",sideOffset:t=12,className:o,children:r}){let{env:n,theme:p,isMobile:a,open:l,drawerDirection:s,modal:c,showBalance:d,showForgeToken:m,showGameToken:w,showQR:h,qrLogoSrc:b,walletAddress:f,accountName:u,profileImageUrl:C,preferredTokens:_,close:S,onSelectWallet:I,onCopyAddress:k,onDisconnect:y,disconnectLabel:v,termsUrl:A,termsLabel:P,privacyUrl:H,privacyLabel:Z,portalStyle:ne,navContent:we,navPosition:qe,footerContent:ft,view:K,setView:je,showPortfolio:Ge,portfolioTitle:ut,showTotalAssets:gt,totalAssetsLabel:wt,sendTransaction:Ze,onOutlink:he}=ce(),{tokens:xe,isLoading:be}=Pe(n,f,l&&d),{statsMap:We}=Te(n,d),{categoryMap:ht}=yr(n,d),ie=d&&gt,{displayValue:ye,isLowerBound:xt,isLoading:bt}=kr(n,f,l&&ie),[De,Ke]=B.useState(!1),{holdings:ve,isLoading:Ye}=ur(n,f,l&&d&&m),Kt=B.useMemo(()=>ve.map(x=>x.token),[ve]),{imageMap:yt}=gr(n,Kt,m&&ve.length>0),Ae=B.useMemo(()=>{let x=[],O=[],W=[],q=new Map((_??[]).map((E,U)=>[`${gi(E.chainId)}:${E.address.toLowerCase()}`,U]));for(let E of xe){let U=Io(n,E.chainId,E.symbol)!==void 0,ke=`${E.chainId}:${E.address.toLowerCase()}`,Ce=q.get(ke),eo=new Ue.default(E.quantity.numeric).shiftedBy(-E.quantity.decimals);if(U)x.push(E);else if(Ce!==void 0)O.push(E);else if(eo.isGreaterThan(0)){if(!w&&ht.get(fo(E.chainId,E.address))==="game")continue;W.push(E)}}return x.sort((E,U)=>{let ke=Io(n,E.chainId,E.symbol)??99,Ce=Io(n,U.chainId,U.symbol)??99;return ke-Ce}),O.sort((E,U)=>{let ke=q.get(`${E.chainId}:${E.address.toLowerCase()}`)??99,Ce=q.get(`${U.chainId}:${U.address.toLowerCase()}`)??99;return ke-Ce}),W.sort((E,U)=>{let ke=We.get(Re(E.chainId,E.address)),Ce=We.get(Re(U.chainId,U.address)),eo=new Ue.default(E.quantity.numeric).shiftedBy(-E.quantity.decimals).multipliedBy(ke?.price??0);return new Ue.default(U.quantity.numeric).shiftedBy(-U.quantity.decimals).multipliedBy(Ce?.price??0).minus(eo).toNumber()}),[...x,...O,...W]},[xe,n,We,w,ht,_]),vt=B.useMemo(()=>{if(!m)return[];let x=new Set(xe.map(O=>O.address.toLowerCase()));return[...ve].filter(O=>!x.has(O.token.toLowerCase())).sort((O,W)=>{let q=new Ue.default(O.value);return new Ue.default(W.value).minus(q).toNumber()})},[ve,m,xe]),le=B.useRef(!1),Yt=B.useCallback(x=>{le.current=!0,je(x)},[je]);B.useEffect(()=>{l||(le.current=!1)},[l]);let Eo=B.useRef(null);B.useEffect(()=>{let x=Eo.current;if(!x||!a)return;let O=W=>{W.pointerType==="touch"&&W.stopPropagation()};return x.addEventListener("pointerdown",O),()=>x.removeEventListener("pointerdown",O)},[a]);let[Qe,Mo]=B.useState(!1),Qt=B.useRef(void 0);B.useEffect(()=>()=>clearTimeout(Qt.current),[]);let _o=B.useCallback(async()=>{if(!Qe)try{await navigator.clipboard.writeText(f),Mo(!0),clearTimeout(Qt.current),Qt.current=setTimeout(()=>Mo(!1),2e3),k?.(f,!0)}catch{k?.(f,!1)}},[f,k,Qe]),Xt=B.useCallback(x=>{x.currentTarget.setAttribute("data-loaded","true")},[]),Cn=B.useMemo(()=>({background:hi(f)}),[f]),So=B.useMemo(()=>C||pr(n,f,{size:120,bg:p==="dark"?"1A1A2E":"F3F6F8"}),[C,n,f,p]),Jt=B.useMemo(()=>wi(ye),[ye]),Ln=(0,i.jsxs)("div",{className:$("wi-view-inner",le.current&&"wi-view-wallet"),children:[ie&&(()=>{let x=Ge;return(0,i.jsxs)(x?"button":"div",{...x?{type:"button",onClick:()=>Yt("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":x||void 0,children:[(0,i.jsxs)("div",{className:"wi-total-head",children:[(0,i.jsx)("span",{className:"wi-total-label",children:wt}),(0,i.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:W=>{W.stopPropagation(),Ke(q=>!q)},onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),W.stopPropagation(),Ke(q=>!q))},"aria-label":De?"Show balance":"Hide balance",children:De?(0,i.jsx)(or,{}):(0,i.jsx)(tr,{})})]}),(0,i.jsxs)("div",{className:"wi-total-body",children:[bt?(0,i.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):(0,i.jsx)("div",{className:"wi-total-value","data-hidden":De||void 0,children:De?(0,i.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,i.jsxs)(i.Fragment,{children:[xt&&(0,i.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,i.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,i.jsx)("span",{className:"wi-total-amount",children:Jt.main}),Jt.decimal&&(0,i.jsx)("span",{className:"wi-total-decimal",children:Jt.decimal})]})}),x&&(0,i.jsx)("span",{className:"wi-total-chevron","aria-hidden":!0,children:(0,i.jsx)(Jo,{size:18})})]})]})})(),qe==="top"&&we&&(0,i.jsx)("div",{className:"wi-nav-fixed",children:we}),d&&(0,i.jsx)("div",{ref:Eo,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,i.jsxs)("div",{className:"wi-token-list",children:[be&&Array.from({length:5},(x,O)=>(0,i.jsxs)("div",{className:"wi-skeleton-item",children:[(0,i.jsxs)("div",{className:"wi-skeleton-left",children:[(0,i.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,i.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,i.jsxs)("div",{className:"wi-skeleton-right",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},O)),!be&&Ae.length===0&&!m&&(0,i.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),Ae.map(x=>{let O=We.get(Re(x.chainId,x.address)),W=O?parseFloat(O.percent_change_24h):null,q=W!==null&&W>=0,E=mo(n,x.chainId);return(0,i.jsxs)("div",{className:"wi-token-item",children:[(0,i.jsxs)("div",{className:"wi-token-left",children:[(0,i.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,i.jsx)("img",{src:x.icon_url,alt:x.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Xt,onError:U=>{U.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),E&&(0,i.jsx)("img",{src:E,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:U=>{U.currentTarget.style.display="none"}})]}),(0,i.jsxs)("div",{className:"wi-token-info",children:[(0,i.jsx)("span",{className:"wi-token-name",children:x.symbol}),O&&(0,i.jsxs)("div",{className:"wi-token-price-row",children:[(0,i.jsx)("span",{className:"wi-token-price",children:co(O.price)}),(0,i.jsx)("span",{className:"wi-token-change","data-positive":q,"data-zero":W===0||void 0,children:W!==null&&(W===0?"0%":`${q?"+":"-"}${(q?Math.floor:Math.ceil)(Math.abs(W)*100)/100}%`)})]})]})]}),(0,i.jsxs)("div",{className:"wi-token-right",children:[(0,i.jsx)("span",{className:"wi-token-balance",children:Et(x.quantity.numeric,x.quantity.decimals)}),O&&(0,i.jsx)("span",{className:"wi-token-value",children:nr(x.quantity.numeric,x.quantity.decimals,O.price)})]})]},`${x.address}-${x.chainId}`)}),m&&Ye&&Array.from({length:3},(x,O)=>(0,i.jsxs)("div",{className:"wi-skeleton-item",children:[(0,i.jsxs)("div",{className:"wi-skeleton-left",children:[(0,i.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,i.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,i.jsxs)("div",{className:"wi-skeleton-right",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${O}`)),m&&!Ye&&!be&&Ae.length===0&&vt.length===0&&(0,i.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),m&&vt.map(x=>{let O=yt.get(x.token)||"",W=mo(n,X[n].cross);return(0,i.jsxs)("div",{className:"wi-token-item",children:[(0,i.jsxs)("div",{className:"wi-token-left",children:[(0,i.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,i.jsx)("img",{src:O||"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:Xt,onError:q=>{q.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),W&&(0,i.jsx)("img",{src:W,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:q=>{q.currentTarget.style.display="none"}})]}),(0,i.jsxs)("div",{className:"wi-token-info",children:[(0,i.jsx)("span",{className:"wi-token-name",children:x.token_name}),(0,i.jsx)("div",{className:"wi-token-price-row",children:(0,i.jsxs)("span",{className:"wi-token-price",children:[Et(x.current_price,18)," CROSS"]})})]})]}),(0,i.jsxs)("div",{className:"wi-token-right",children:[(0,i.jsx)("span",{className:"wi-token-balance",children:Et(x.balance,18)}),(0,i.jsx)("span",{className:"wi-token-value",children:co(x.current_value_usd)})]})]},`forge-${x.token}`)})]})}),qe==="bottom"&&we&&(0,i.jsx)("div",{className:"wi-nav-fixed",children:we})]},"wallet"),Nn=Ge?(0,i.jsx)("div",{className:$("wi-view-inner wi-portfolio-body",le.current&&"wi-view-portfolio"),children:(0,i.jsx)(Ee,{env:n,theme:p,walletAddress:f,showHeader:!1,sendTransaction:Ze,onOutlink:he})},"portfolio"):null,In=(0,i.jsx)("div",{className:$("wi-view-inner wi-qr-body",le.current&&"wi-view-qr"),children:(0,i.jsx)("div",{className:"wi-qr-section",children:(0,i.jsxs)("div",{className:"wi-qr-card",children:[(0,i.jsxs)("div",{className:"wi-qr-code",children:[(0,i.jsx)(tn.QRCodeSVG,{value:f,size:180,level:"H",marginSize:2,...b&&{imageSettings:{src:b,height:33,width:33,excavate:!0}}}),!b&&(0,i.jsx)("div",{className:"wi-qr-logo",children:(0,i.jsx)(rr,{size:33})})]}),(0,i.jsx)("p",{className:"wi-qr-address",children:f}),(0,i.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:_o,children:[(0,i.jsx)("span",{className:"wi-qr-copy-icon",children:Qe?(0,i.jsx)(so,{size:16}):(0,i.jsx)(ao,{size:16})}),(0,i.jsx)("span",{className:"wi-qr-copy-text",children:Qe?"Copied!":"Copy address"})]})]})})},"qr"),Pn=K==="qr"||K==="portfolio",Rn=K==="qr"?"My Address":K==="portfolio"?ut:"",Oo=A||H?(0,i.jsxs)("div",{className:"wi-legal-links",children:[A&&(0,i.jsx)("a",{className:"wi-legal-link",href:A,target:"_blank",rel:"noopener noreferrer",onClick:x=>te(x,A,{category:"terms",origin:"terms"},he),children:P}),A&&H&&(0,i.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),H&&(0,i.jsx)("a",{className:"wi-legal-link",href:H,target:"_blank",rel:"noopener noreferrer",onClick:x=>te(x,H,{category:"privacy",origin:"privacy"},he),children:Z})]}):null,Wo=ft??(y?(0,i.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{y(),S()},children:[(0,i.jsx)(Yo,{size:20}),(0,i.jsx)("span",{className:"wi-disconnect-label",children:v})]}):null),Do=Wo!==null||Oo!==null?(0,i.jsxs)("div",{className:"wi-builtin-footer",children:[Wo,Oo]}):null,Tn=(0,i.jsxs)("div",{className:"wi-sticky-header",children:[(0,i.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,i.jsxs)("div",{className:"wi-account-block",children:[(0,i.jsxs)("div",{className:"wi-avatar",children:[(0,i.jsx)("div",{className:"wi-avatar-fallback",style:Cn}),So&&(0,i.jsx)("img",{src:So,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:Xt,onError:x=>{x.currentTarget.style.display="none"}})]}),(0,i.jsxs)("div",{className:"wi-account-text",children:[I?(0,i.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:I,"aria-label":"Switch account",children:[(0,i.jsx)("span",{className:"wi-account-name",children:u??"Account 1"}),(0,i.jsx)("span",{className:"wi-account-switch","aria-hidden":"true",children:(0,i.jsx)(er,{size:12})})]}):(0,i.jsx)("div",{className:"wi-account-row",children:(0,i.jsx)("span",{className:"wi-account-name",children:u??"Account 1"})}),(0,i.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:_o,"aria-label":"Copy address",children:[(0,i.jsx)("span",{className:"wi-account-address",children:Ve(f)}),(0,i.jsx)("span",{className:"wi-account-copy",children:Qe?(0,i.jsx)(so,{size:14}):(0,i.jsx)(ao,{size:14})})]})]})]}),(0,i.jsxs)("div",{className:"wi-header-actions",children:[h&&(0,i.jsx)("button",{type:"button",className:"wi-header-action",onClick:()=>Yt("qr"),"aria-label":"Show QR code",children:(0,i.jsx)(Qo,{size:20})}),(0,i.jsx)("button",{type:"button",className:"wi-header-action",onClick:S,"aria-label":"Close",children:(0,i.jsx)(lo,{size:24})})]})]}),(0,i.jsx)("hr",{className:"wi-divider"})]}),Ao=(0,i.jsxs)(i.Fragment,{children:[r,Pn?(0,i.jsxs)("div",{className:"wi-sticky-header",children:[(0,i.jsxs)("div",{className:"wi-header",children:[(0,i.jsx)("button",{type:"button",className:"wi-header-back",onClick:()=>Yt("wallet"),"aria-label":"Back",children:(0,i.jsx)(Xo,{})}),(0,i.jsx)("div",{className:"wi-header-info",children:(0,i.jsx)("h2",{className:"wi-header-title",children:Rn})}),(0,i.jsx)("button",{type:"button",className:"wi-header-close",onClick:S,"aria-label":"Close",children:(0,i.jsx)(lo,{})})]}),(0,i.jsx)("hr",{className:"wi-divider"})]}):Tn,(0,i.jsxs)("div",{className:"wi-view-container",children:[K==="wallet"&&Ln,K==="qr"&&In,K==="portfolio"&&Nn]}),Do&&K!=="portfolio"&&(0,i.jsx)("div",{className:"wi-sticky-footer",children:(0,i.jsx)("div",{className:"wi-footer",children:Do})})]});return a?(0,i.jsxs)(rt.Drawer.Portal,{children:[c&&(0,i.jsx)(rt.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,i.jsxs)(rt.Drawer.Content,{className:$("wi-drawer-content",o),"data-theme":p,style:ne,"data-direction":s,"data-no-balance":!d||void 0,"data-view":K,children:[(0,i.jsx)(rt.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),Ao]})]}):(0,i.jsxs)(i.Fragment,{children:[c&&l&&(0,i.jsx)("div",{className:"wi-drawer-overlay",onClick:S}),(0,i.jsx)($t.Portal,{children:(0,i.jsx)($t.Content,{align:e,sideOffset:t,className:$("wi-popover-content",o),"data-theme":p,style:ne,"data-no-balance":!d||void 0,"data-view":K,children:Ao})})]})}var rn=D(require("react"),1);function nn({position:e="top",children:t}){let{setNavContent:o,setNavPosition:r}=ce();return rn.useEffect(()=>(o(t),r(e),()=>o(null)),[t,e,o,r]),null}var an=D(require("react"),1);function sn({children:e}){let{setFooterContent:t}=ce();return an.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}M(`[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)}
7
+ `);M(`.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}
8
+ `);M(`@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}}
9
+ `);M(`.wi-popover-content{z-index:100001;width:343px;border-radius:24px;border:4px 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-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:auto;left:0;right:0;width:100%;max-height:60vh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:85dvh}.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-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.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;border-radius:8px;object-fit:contain;opacity:0;transition:opacity .2s ease;background:var(--wi-surface-default)}.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-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;height:48px;padding:0 16px;border:none;border-radius:12px;background:var(--wi-surface-default);color:var(--wi-texticon-primary);font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;cursor:pointer;transition:opacity .15s ease,background .15s ease}.wi-disconnect-btn:hover{opacity:.85}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;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-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:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:16px 24px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .wi-qr-section{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-qr-section::-webkit-scrollbar{width:4px}.wi-qr-section::-webkit-scrollbar-track{background:transparent}.wi-qr-section::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-qr-section::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-qr-section::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-qr-section::-webkit-scrollbar-thumb:hover{background:#0003}.wi-qr-card{display:flex;flex-direction:column;align-items:center;gap:20px;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:16px;font-weight:600;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}
10
+ `);M(`.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}
11
+ `);var zt=require("react/jsx-runtime"),xi="https://terms.crosstoken.io/docs/cross-terms-of-use",bi="https://terms.crosstoken.io/docs/nexus-privacy-policy";function yi({env:e="production",theme:t="dark",mobileBreakpoint:o=768,drawerDirection:r,modal:n,showBalance:p=!1,showForgeToken:a=!1,showGameToken:l=!0,showQR:s=!0,qrLogoSrc:c,walletAddress:d,accountName:m,profileImageUrl:w,connectorId:h,connectorName:b,connectorIconUrl:f,preferredTokens:u=[],onSelectWallet:C,onCopyAddress:_,onDisconnect:S,disconnectLabel:I="Disconnect",termsUrl:k=xi,termsLabel:y="Terms of Service",privacyUrl:v=bi,privacyLabel:A="Privacy Policy",open:P,onOpenChange:H,showPortfolio:Z=!1,portfolioTitle:ne="My Portfolio",showTotalAssets:we=!0,totalAssetsLabel:qe="Total Assets USD",sendTransaction:ft,onOutlink:K,style:je,children:Ge}){let ut=h?et[h]:void 0,gt=b??ut?.name,wt=f??ut?.iconUrl,Ze=Fe(`(max-width: ${o}px)`),he=r??(p?"right":"bottom"),xe=n??!1,be=P!==void 0,[We,ht]=Y.useState(!1),ie=be?P:We,ye=Y.useCallback(le=>{be||ht(le),H?.(le)},[be,H]),xt=Y.useCallback(()=>ye(!1),[ye]),[bt,De]=Y.useState(null),[Ke,ve]=Y.useState("top"),[Ye,Kt]=Y.useState(null),[yt,Ae]=Y.useState("wallet");Y.useEffect(()=>{ie||Ae("wallet")},[ie]);let vt=Y.useMemo(()=>({env:e,theme:t,isMobile:Ze,open:ie,drawerDirection:he,modal:xe,showBalance:p,showForgeToken:a,showGameToken:l,showQR:s,qrLogoSrc:c,walletAddress:d,accountName:m,profileImageUrl:w,connectorName:gt,connectorIconUrl:wt,preferredTokens:u,close:xt,onSelectWallet:C,onCopyAddress:_,onDisconnect:S,disconnectLabel:I,termsUrl:k,termsLabel:y,privacyUrl:v,privacyLabel:A,portalStyle:je,navContent:bt,navPosition:Ke,setNavContent:De,setNavPosition:ve,footerContent:Ye,setFooterContent:Kt,view:yt,setView:Ae,showPortfolio:Z,portfolioTitle:ne,showTotalAssets:we,totalAssetsLabel:qe,sendTransaction:ft,onOutlink:K}),[e,t,Ze,ie,he,xe,p,a,l,s,c,d,m,w,gt,wt,u,xt,C,_,S,I,k,y,v,A,je,bt,Ke,Ye,yt,Z,ne,we,qe,ft,K]);return(0,zt.jsx)(io.Provider,{value:vt,children:Ze?(0,zt.jsx)(cn.Drawer.Root,{direction:he,open:ie,onOpenChange:ye,noBodyStyles:!0,children:Ge},"drawer"):(0,zt.jsx)(ln.Root,{open:ie,onOpenChange:ye,children:Ge},"popover")})}var Se=Object.assign(yi,{Trigger:lr,Content:on,Nav:nn,Footer:sn});var se=D(require("react"),1),yn=D(require("@radix-ui/react-dialog"),1),vn=require("vaul");var qt=require("react"),jt=(0,qt.createContext)(null);function nt(){let e=(0,qt.useContext)(jt);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var Oe=require("react");function it(){let[e,t]=(0,Oe.useState)([]),[o,r]=(0,Oe.useState)(!0);(0,Oe.useEffect)(()=>{if(typeof window>"u"){r(!1);return}let p=[],a=s=>{let{info:c}=s.detail;c?.rdns&&!p.some(d=>d.rdns===c.rdns)&&(p.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...p]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let l=setTimeout(()=>r(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(l)}},[]);let n=(0,Oe.useCallback)(p=>e.some(a=>a.rdns===p),[e]);return{wallets:e,isDetected:n,isLoading:o}}var pn=D(require("@radix-ui/react-dialog"),1),dn=require("vaul");var Po=require("react/jsx-runtime");function mn({asChild:e,children:t}){let{isMobile:o}=nt(),r=o?dn.Drawer.Trigger:pn.Trigger;return(0,Po.jsx)(r,{asChild:e??t!=null,children:t??(0,Po.jsx)("button",{type:"button",children:"Connect Wallet"})})}var ue=D(require("@radix-ui/react-dialog"),1),at=require("vaul");var R=require("react/jsx-runtime");function Gt(){return(0,R.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,R.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,R.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 fn(){return(0,R.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,R.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,R.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,R.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,R.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,R.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,R.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,R.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,R.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,R.jsx)("defs",{children:(0,R.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,R.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function un(){return(0,R.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,R.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,R.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,R.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,R.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 gn(){return(0,R.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,R.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,R.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,R.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,R.jsx)("defs",{children:(0,R.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,R.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function wn(){return(0,R.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,R.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Zt={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:Gt,featured:!0},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:Gt},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:Gt,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:fn,rdns:"io.metamask"},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:un,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:gn,badge:"For SHOP"}};function $e(e){return Zt[e]}var g=require("react/jsx-runtime");function hn({wallet:e,detected:t,onConnect:o}){let r=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}o()},n=e.icon;return(0,g.jsxs)("button",{type:"button",className:"wcm-wallet-item",onClick:r,children:[(0,g.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,g.jsx)("div",{className:"wcm-wallet-icon",children:(0,g.jsx)(n,{})}),(0,g.jsxs)("div",{className:"wcm-wallet-info",children:[(0,g.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,g.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,g.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]}),(0,g.jsx)("span",{className:"wcm-wallet-desc",children:e.description})]})]}),e.installUrl&&(t?(0,g.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,g.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function xn(){let{wallets:e,activeWalletIds:t,isDetected:o,close:r,isMobile:n}=nt(),p=t.filter(s=>{let c=$e(s).visibility;return!c||c==="always"?!0:c==="desktop-only"?!n:c==="mobile-only"?n:!0}),a=p.filter(s=>$e(s).featured),l=p.filter(s=>!$e(s).featured);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"wcm-header",children:[(0,g.jsxs)("div",{className:"wcm-header-text",children:[(0,g.jsx)("h2",{className:"wcm-title",children:"Connect Wallet"}),(0,g.jsx)("p",{className:"wcm-subtitle",children:"Connect with one of our available wallet providers to continue."})]}),(0,g.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:r,children:(0,g.jsx)(wn,{})})]}),(0,g.jsx)("div",{className:"wcm-divider"}),(0,g.jsxs)("div",{className:"wcm-body",children:[a.map(s=>{let c=$e(s),d=c.rdns?o(c.rdns):!1;return(0,g.jsx)(hn,{wallet:c,detected:d,onConnect:()=>{e[s]?.(),r()}},s)}),a.length>0&&l.length>0&&(0,g.jsxs)("div",{className:"wcm-separator",children:[(0,g.jsx)("div",{className:"wcm-separator-line"}),(0,g.jsx)("span",{className:"wcm-separator-text",children:"or"}),(0,g.jsx)("div",{className:"wcm-separator-line"})]}),(0,g.jsx)("div",{className:"wcm-wallet-list",children:l.map(s=>{let c=$e(s),d=c.rdns?o(c.rdns):!1;return(0,g.jsx)(hn,{wallet:c,detected:d,onConnect:()=>{e[s]?.(),r()}},s)})}),(0,g.jsxs)("div",{className:"wcm-help",children:[(0,g.jsx)("p",{className:"wcm-help-title",children:"Wallet not detected?"}),(0,g.jsxs)("ul",{className:"wcm-help-list",children:[(0,g.jsx)("li",{children:"Ensure your wallet extension is installed and unlocked"}),(0,g.jsx)("li",{children:"Try refreshing the page"}),(0,g.jsx)("li",{children:"Some wallets may require you to first open the extension"}),(0,g.jsx)("li",{children:"You can try clicking the wallet anyway"})]})]}),(0,g.jsx)("div",{className:"wcm-divider"}),(0,g.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 bn({className:e}){let{isMobile:t,theme:o,portalStyle:r}=nt();return t?(0,g.jsxs)(at.Drawer.Portal,{children:[(0,g.jsx)(at.Drawer.Overlay,{className:"wcm-overlay"}),(0,g.jsxs)(at.Drawer.Content,{className:$("wcm-drawer-content",e),"data-theme":o,style:r,children:[(0,g.jsx)(at.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,g.jsx)("div",{className:"wcm-drawer-handle"}),(0,g.jsx)("div",{className:"wcm-drawer-body",children:(0,g.jsx)(xn,{})})]})]}):(0,g.jsxs)(ue.Portal,{children:[(0,g.jsx)(ue.Overlay,{className:"wcm-overlay"}),(0,g.jsxs)(ue.Content,{className:$("wcm-dialog-content",e),"data-theme":o,style:r,children:[(0,g.jsx)(ue.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,g.jsx)("div",{className:"wcm-dialog-body",children:(0,g.jsx)(xn,{})})]})]})}M(`[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))}
12
+ `);M(`.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}
13
+ `);M(`@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)}}
14
+ `);var ze=require("react/jsx-runtime");function vi({wallets:e,theme:t="dark",mobileBreakpoint:o=768,drawerDirection:r="bottom",dialogWidth:n,drawerMaxWidth:p,drawerMinWidth:a,style:l,open:s,onOpenChange:c,children:d}){let m=Fe(`(max-width: ${o}px)`),[w,h]=se.useState(!1),b=s!==void 0,f=b?s:w,u=se.useCallback(v=>{b||h(v),c?.(v)},[b,c]),C=se.useCallback(()=>u(!1),[u]),{isDetected:_}=it(),S=se.useMemo(()=>Object.keys(e),[e]),I=se.useMemo(()=>{let v={};return n&&(v["--wcm-dialog-width"]=n),p&&(v["--wcm-drawer-max-width"]=p),a&&(v["--wcm-drawer-min-width"]=a),{...v,...l}},[n,p,a,l]),k=se.useMemo(()=>({theme:t,isMobile:m,open:f,setOpen:u,close:C,wallets:e,activeWalletIds:S,isDetected:_,portalStyle:I}),[t,m,f,u,C,e,S,_,I]),y=(0,ze.jsx)("div",{"data-theme":t,style:I,children:d});return m?(0,ze.jsx)(jt.Provider,{value:k,children:(0,ze.jsx)(vn.Drawer.Root,{direction:r,open:f,onOpenChange:u,noBodyStyles:!0,children:y},"drawer")}):(0,ze.jsx)(jt.Provider,{value:k,children:(0,ze.jsx)(yn.Root,{open:f,onOpenChange:u,children:y})})}var Ro=Object.assign(vi,{Trigger:mn,Content:bn});var ki='<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>',Ci='<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>',Li='<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>',Ni='<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>',Ii='<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 st(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var lt=st(ki),ct=st(Ci),pt=st(Li),dt=st(Ni),mt=st(Ii);var Q=require("react/jsx-runtime");function To({isConnecting:e,address:t,provider:o,providerName:r,accountName:n,onConnect:p,onDisconnect:a,onCopy:l,onSelectWallet:s,label:c="Connect Wallet",connectingLabel:d="Connecting...",disconnectLabel:m,className:w,theme:h="dark",env:b,showBalance:f=!0,showPortfolio:u,drawerDirection:C,modal:_,connectorId:S,style:I,sendTransaction:k}){if(e)return(0,Q.jsxs)("button",{type:"button",disabled:!0,className:w,style:w?void 0:{...ge.button,...ge.buttonLoading},"aria-busy":"true",children:[(0,Q.jsx)("style",{children:Ei}),(0,Q.jsx)("span",{style:ge.spinner,"aria-hidden":"true"}),d]});if(t){let y=r??Ti(o),v=o?Pi[o]:void 0;return(0,Q.jsxs)(Se,{env:b,theme:h,drawerDirection:C,modal:_,showBalance:f,showPortfolio:u,walletAddress:t,accountName:n,connectorId:S,onSelectWallet:s,onCopyAddress:l?(A,P)=>{P&&l()}:void 0,onDisconnect:a,disconnectLabel:m,style:I,sendTransaction:k,children:[(0,Q.jsx)(Se.Trigger,{asChild:!0,children:(0,Q.jsxs)("button",{type:"button",className:w,style:w?void 0:ge.connectedBtn,"aria-label":`Connected with ${y}: ${kn(t)}`,children:[v?(0,Q.jsx)("img",{src:v,alt:"",width:20,height:20,style:ge.connectedIcon}):(0,Q.jsx)("span",{style:ge.connectedIconPlaceholder,"aria-hidden":"true"}),(0,Q.jsx)("span",{style:ge.connectedAddress,children:kn(t)})]})}),(0,Q.jsx)(Se.Content,{align:"end",sideOffset:8})]})}return(0,Q.jsx)("button",{type:"button",onClick:p,className:w,style:w?void 0:ge.button,children:c})}var Pi={google:dt,apple:mt,cross:lt,metamask:ct,binance:pt},Ri={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Ti(e){return e?Ri[e]:"Wallet"}function kn(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Ei="@keyframes cross-cb-spin{to{transform:rotate(360deg)}}",ge={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,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});