@nexus-cross/dapp-ui 1.3.3-beta.7 → 1.3.3-beta.8

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,21 +1,21 @@
1
- "use strict";var xl=Object.create;var Yn=Object.defineProperty;var vl=Object.getOwnPropertyDescriptor;var yl=Object.getOwnPropertyNames;var kl=Object.getPrototypeOf,Sl=Object.prototype.hasOwnProperty;var Cl=(e,t)=>{for(var n in t)Yn(e,n,{get:t[n],enumerable:!0})},$r=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of yl(t))!Sl.call(e,r)&&r!==n&&Yn(e,r,{get:()=>t[r],enumerable:!(o=vl(t,r))||o.enumerable});return e};var z=(e,t,n)=>(n=e!=null?xl(kl(e)):{},$r(t||!e||!e.__esModule?Yn(n,"default",{value:e,enumerable:!0}):n,e)),Rl=e=>$r(Yn({},"__esModule",{value:!0}),e);var $d={};Cl($d,{APPLE_ICON:()=>Un,AppLauncher:()=>Qo,AppLauncherContent:()=>Zo,AppLauncherTrigger:()=>Yo,BINANCE_ICON:()=>Hn,BridgeFlow:()=>Bn,CONNECTOR_REGISTRY:()=>Cn,CROSSX_ICON:()=>Wn,ConnectButton:()=>Er,ConnectorId:()=>io,DEFAULT_SKILLS_HREF:()=>Oo,GOOGLE_ICON:()=>Gn,METAMASK_ICON:()=>Dn,SOCIAL_REGISTRY:()=>_o,SendFlow:()=>In,SkillsButton:()=>Ar,TOKEN_STATS_QUERY_KEY:()=>xo,USER_BALANCE_QUERY_KEY:()=>bo,WALLET_REGISTRY:()=>Mo,WalletConnectModal:()=>Lr,WalletInfo:()=>ln,WalletPortfolio:()=>yr,WalletPortfolioBody:()=>on,announceAppLauncherUsage:()=>Xn,resolveEnvironment:()=>Be,useGlobalMenu:()=>Sn,useTokenBalance:()=>At,useTokenStats:()=>Pt,useWalletDetect:()=>_n});module.exports=Rl($d);var Nl={};function jr(e){try{return Nl.env?.[e]}catch{return}}function Vr(e){if(!(typeof process>"u"))return process.env?.[e]}function Be(e){if(e)return qr(e);let t=jr("VITE_CROSSX_ENVIRONMENT")??jr("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Vr("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Vr("CROSSX_ENVIRONMENT");return qr(t)}function qr(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var qo="1.3.3";var Zn="__nexusCrossAppLauncherRuntime";function Tl(){if(typeof window>"u")return null;let e=window;return e[Zn]??(e[Zn]={mode:"dapp-ui"}),e[Zn]}function Il(e){if(e.scheduled)return;e.scheduled=!0;let t=()=>{if(e.scheduled=!1,e.loggedMode!==e.mode){if(e.mode==="connect-kit-react"){let n=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${n} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${qo}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${qo} \uCD08\uAE30\uD654 \uC644\uB8CC (\uC0AC\uC6A9 \uBAA8\uB4DC: dapp-ui only)`);e.loggedMode=e.mode}};typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function Xn(e){let t=Tl();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Il(t))}var fn=z(require("react"),1),Kr=z(require("@radix-ui/react-popover"),1),Qr=require("vaul");var Jn=require("react"),Ko=(0,Jn.createContext)(null);function eo(){let e=(0,Jn.useContext)(Ko);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var to=require("react");function pn(e){let[t,n]=(0,to.useState)(!1);return(0,to.useEffect)(()=>{let o=window.matchMedia(e);n(o.matches);let r=a=>n(a.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}function W(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}W(`[data-theme=dark]{--al-bg: var(--ds-surface-default, #1e232e);--al-bg-hover: var(--ds-surface-medium, #252b39);--al-text: var(--ds-content-highest, #ffffff);--al-text-secondary: var(--ds-content-medium, #ffffffa6);--al-border: var(--ds-border-default, #ffffff12);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .7));--al-badge-bg: var(--ds-accent-primary-low, #123235);--al-badge-text: var(--ds-accent-primary-default, #00ceb2);--al-badge-new-text: var(--ds-system-purple-on, #ffffff);--al-drawer-overlay: var(--ds-overlay-dim, #000000b3)}[data-theme=light]{--al-bg: var(--ds-surface-default, #ffffff);--al-bg-hover: var(--ds-surface-medium, #f5f7fa);--al-text: var(--ds-content-highest, #000000);--al-text-secondary: var(--ds-content-medium, #000000a6);--al-border: var(--ds-border-default, #00000012);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .15));--al-badge-bg: var(--ds-accent-primary-low, #e7f9f8);--al-badge-text: var(--ds-accent-primary-default, #00b4b7);--al-badge-new-text: var(--ds-system-purple-on, #ffffff);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
2
- `);W(`.al-trigger-btn{--at-bg: transparent;--at-bg-hover: #eaedf1;--at-color: var(--ds-content-high, rgba(0, 0, 0, .85));--at-border: none;--at-border-radius: 8px;--at-size: 36px;--at-padding: 0;--at-press-scale: .95;--at-transition: background-color .15s ease;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--at-size);height:var(--at-size);padding:var(--at-padding);border:var(--at-border);background:var(--at-bg);border-radius:var(--at-border-radius);color:var(--at-color);cursor:pointer;transition:var(--at-transition)}.al-trigger-btn:hover,.al-trigger-btn[data-state=open]{background:var(--at-bg-hover)}.al-trigger-btn:active:not(:disabled){background:var(--at-bg-hover);transform:scale(var(--at-press-scale))}.al-trigger-btn[data-theme=dark]{--at-color: var(--ds-content-high, rgba(255, 255, 255, .85));--at-bg-hover: #252b39}.al-trigger-btn[data-theme=light]{--at-color: var(--ds-content-high, rgba(0, 0, 0, .85))}
3
- `);W(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
- `);W(`.al-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;border-radius:24px;background:var(--al-bg);border:1px solid var(--al-popover-border, var(--al-border));box-shadow:var(--al-popover-shadow, var(--al-shadow));animation:al-fade-in .15s ease-out;max-height:80vh;overflow-x:hidden;overflow-y:auto;padding:20px 4px;box-sizing:border-box}.al-popover-content .al-grid{grid-template-columns:repeat(4,100px);row-gap:16px;column-gap:0;padding:0;justify-content:center;align-items:start}.al-popover-content .al-grid-item{flex-direction:column;justify-content:flex-start;align-items:center;gap:6px;padding:12px 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:50px;height:50px;border-radius:10.125px;overflow:hidden}.al-popover-content .al-grid-item-icon img{object-fit:cover}.al-popover-content .al-grid-item-label{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:1.1;letter-spacing:0;text-align:center;color:var(--al-text);max-width:100%;white-space:normal;overflow-wrap:anywhere}.al-popover-content .al-grid-item-right,.al-popover-content .al-badge-new{display:none}.al-drawer-overlay{position:fixed;inset:0;z-index:100000;background:var(--al-drawer-overlay)}.al-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;background:var(--al-bg);overflow-x:hidden;overflow-y:hidden;display:flex;flex-direction:column;box-sizing:border-box}.al-drawer-body{flex:1;overflow-y:auto;overscroll-behavior-y:contain;min-height:0}.al-drawer-content .al-grid{display:flex;flex-direction:column;grid-template-columns:none;max-width:100%;overflow:hidden;flex-shrink:0;gap:0;row-gap:0;column-gap:0;padding:8px 16px}.al-drawer-content .al-grid-item{width:100%;max-width:100%;gap:8px;padding: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:32px;height:32px;border-radius:6.75px;overflow:hidden}.al-drawer-content .al-grid-item-icon img{width:100%;height:100%;object-fit:cover;border-radius:6.75px}.al-drawer-content .al-grid-item-label{font-size:16px;line-height:1.35;letter-spacing:0;font-weight:400}.al-drawer-content .al-grid-item[data-active=true] .al-grid-item-label{font-weight:500}.al-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0}.al-drawer-title{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--al-text);margin:0}.al-drawer-close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--ds-content-low, #00000066);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:var(--al-bg);border-radius:8px;cursor:pointer;transition:none;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:#252b39!important}:root[data-ds-theme=light] .al-grid-item:hover,:root[data-ds-theme=light] .al-grid-item[data-active=true]{background:#eff3f8!important}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden}.al-grid-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain}.al-grid-item-label{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:150%;letter-spacing:0;color:var(--al-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.al-badge{display:flex;padding:1px 4px 2px;justify-content:center;align-items:center;gap:2px;border-radius:3px;background:var(--al-badge-bg);color:var(--al-badge-text);font-family:Pretendard,Inter,sans-serif;font-size:10px;font-weight:600;line-height:150%;letter-spacing:0;white-space:nowrap;flex-shrink:0}.al-badge-new{display:flex;width:16px;height:16px;justify-content:center;align-items:center;aspect-ratio:1/1;border-radius:12px;background:var(--ds-system-purple-high, #7346f3);color:var(--al-badge-new-text);font-family:Pretendard,Inter,sans-serif;font-size:9px;font-weight:700;flex-shrink:0}
5
- `);W("");var no=require("react/jsx-runtime");function Qo({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let a=pn(`(max-width: ${n}px)`),[i,l]=fn.useState(!1),p=fn.useCallback(()=>l(!1),[]),c=Be(e),f=fn.useMemo(()=>({env:c,theme:t,isMobile:a,open:i,domain:o,close:p}),[c,t,a,i,o,p]);return(0,no.jsx)(Ko.Provider,{value:f,children:a?(0,no.jsx)(Qr.Drawer.Root,{direction:"right",open:i,onOpenChange:l,noBodyStyles:!0,children:r},"drawer"):(0,no.jsx)(Kr.Root,{open:i,onOpenChange:l,children:r},"popover")})}var Jr=z(require("@radix-ui/react-popover"),1),ei=require("vaul");var Fe=require("react/jsx-runtime");function Yr({size:e=18}){return(0,Fe.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,Fe.jsx)("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Zr(){return(0,Fe.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Fe.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Xr(){return(0,Fe.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Fe.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var kn=require("react/jsx-runtime");function Yo({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:a}=eo(),i=t!=null,l=e??!0,p=n?`al-trigger-btn ${n}`:"al-trigger-btn",c=i?t:(0,kn.jsx)("button",{type:"button",className:p,"data-theme":a,style:o,children:(0,kn.jsx)(Yr,{size:18})});return r?(0,kn.jsx)(ei.Drawer.Trigger,{asChild:l,children:c}):(0,kn.jsx)(Jr.Trigger,{asChild:l,children:c})}var Yt=z(require("react"),1),oo=z(require("@radix-ui/react-popover"),1),Qt=require("vaul");var oi=require("@tanstack/react-query");var ti={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json"};var Ll="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",El="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function dt(e,t){return`${e==="production"?El:Ll}/${t}.png`}function ni(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://dev-x.crosstoken.io/gametoken/CROSS",stage:"https://stg-x.crosstoken.io/gametoken/CROSS",production:"https://x.crosstoken.io/gametoken/CROSS"},iconUrl:dt(t,"dex"),order:1e3,type:"gametoken",badge:null,isNew:!1},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg-x.crosstoken.io/forge",stage:"https://stg-x.crosstoken.io/forge",production:"https://x.crosstoken.io/forge"},iconUrl:dt(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0},{id:"crossd",label:"Bridge (CROSSD)",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:dt(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:dt(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg-x.crosstoken.io/rewards",stage:"https://stg-x.crosstoken.io/rewards",production:"https://x.crosstoken.io/rewards"},iconUrl:dt(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:dt(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1},{id:"play",label:"Play",description:"Discover and play games on CROSS.",url:{dev:"https://stg-play.cross.nexus",stage:"https://stg-play.cross.nexus",production:"https://play.cross.nexus"},iconUrl:dt(t,"play"),order:8500,type:"play",badge:null,isNew:!0},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://www.dev.cross.shop/",stage:"https://www.stage.cross.shop/",production:"https://www.cross.shop/"},iconUrl:dt(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg-x.crosstoken.io/points",stage:"https://stg-x.crosstoken.io/points",production:"https://x.crosstoken.io/points"},iconUrl:dt(t,"point"),order:1e4,type:"points",badge:null,isNew:!1},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg-wave.crosstoken.io/en",stage:"https://stg-wave.crosstoken.io/en",production:"https://wave.crosstoken.io/en"},iconUrl:dt(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.crosstoken.io/612055",stage:"https://stg-explorer.crosstoken.io/612055",production:"https://explorer.crosstoken.io/612055"},iconUrl:dt(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1}]}}function Sn(e){let t=Be(e);return(0,oi.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:n})=>{try{let o=await fetch(ti[t],{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch global menu: ${o.status}`);return o.json()}catch(o){if(n.aborted)throw o;return ni(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function ne(...e){return e.filter(Boolean).join(" ")}var se=require("react/jsx-runtime");function Al(e){return e.id==="cross-staking"||e.type==="cross-staking"}function Zo({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:a,domain:i,close:l}=eo(),{data:p}=Sn(o),c=Yt.useMemo(()=>(p?.items??[]).sort((w,y)=>w.order-y.order),[p]),f=8,m=Yt.useRef(null),h=Yt.useCallback(w=>{m.current={x:w.clientX,y:w.clientY}},[]),g=typeof window<"u"?window.location.pathname:"",v=Yt.useCallback((w,y)=>{if(m.current){let T=w.clientX-m.current.x,S=w.clientY-m.current.y;if(m.current=null,Math.abs(T)>f||Math.abs(S)>f)return}let A=y.url[o]??y.url.production,u=ri(A,i);if(!u)try{let T=new URL(A).pathname;if(g===T||g.startsWith(T+"/")){l();return}}catch{}u?window.open(A,"_blank","noopener,noreferrer"):window.location.href=A,l()},[o,i,l,g]),x=(0,se.jsx)("div",{className:"al-grid","data-theme":r,children:c.map(w=>{let y=w.url[o]??w.url.production,A=ri(y,i),u=!1;if(!A)try{let T=new URL(y).pathname;u=g===T||g.startsWith(T+"/")}catch{u=!1}return(0,se.jsxs)("button",{type:"button",className:"al-grid-item","data-active":u||void 0,onPointerDown:h,onClick:T=>v(T,w),children:[(0,se.jsxs)("div",{className:"al-grid-item-left",children:[(0,se.jsx)("div",{className:"al-grid-item-icon",children:(0,se.jsx)("img",{src:w.iconUrl,alt:w.label,width:24,height:24,loading:"lazy"})}),(0,se.jsx)("span",{className:"al-grid-item-label",children:w.label}),w.isNew&&(0,se.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,se.jsx)("div",{className:"al-grid-item-right",children:w.badge&&!Al(w)&&(0,se.jsx)("span",{className:"al-badge",children:w.badge})})]},w.id)})});return a?(0,se.jsxs)(Qt.Drawer.Portal,{children:[(0,se.jsx)(Qt.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,se.jsxs)(Qt.Drawer.Content,{className:ne("al-drawer-content",n),"data-theme":r,children:[(0,se.jsxs)("div",{className:"al-drawer-header",children:[(0,se.jsx)(Qt.Drawer.Close,{className:"al-drawer-close",children:(0,se.jsx)(Zr,{})}),(0,se.jsx)(Qt.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,se.jsx)(Qt.Drawer.Close,{className:"al-drawer-close",children:(0,se.jsx)(Xr,{})})]}),(0,se.jsx)("div",{className:"al-drawer-body",children:x})]})]}):(0,se.jsx)(oo.Portal,{children:(0,se.jsx)(oo.Content,{align:e,sideOffset:t,className:ne("al-popover-content",n),"data-theme":r,children:x})})}function ri(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}var He=z(require("react"),1),Ws=z(require("@radix-ui/react-popover"),1),Ds=require("vaul");var ro=require("react"),Xo=(0,ro.createContext)(null);function Wt(){let e=(0,ro.useContext)(Xo);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var io=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(io||{}),Cn={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 Qi=z(require("react"),1);var D=require("react/jsx-runtime");function ii({size:e=16,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,D.jsx)("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Rn({size:e=16,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function Zt({size:e=16,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function kt({size:e=24,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function ai({size:e=20,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,D.jsx)("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Jo({size:e=20,className:t}){return(0,D.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,D.jsx)("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function Xt({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Jt({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function si({size:e=16,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,D.jsx)("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function li({size:e=16,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,D.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function ci({size:e=42,className:t}){return(0,D.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,D.jsx)("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}function di({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M9.19133 10.8077C9.04905 10.6657 8.87947 10.554 8.69283 10.4792L2.78881 8.11167C2.71832 8.08338 2.65816 8.03421 2.61642 7.97075C2.57468 7.90729 2.55335 7.83258 2.5553 7.75665C2.55724 7.68072 2.58237 7.6072 2.6273 7.54596C2.67224 7.48472 2.73483 7.4387 2.80668 7.41406L16.9525 2.5747C17.0185 2.55087 17.0899 2.54632 17.1583 2.56159C17.2268 2.57685 17.2895 2.6113 17.3391 2.66089C17.3887 2.71049 17.4231 2.77319 17.4384 2.84165C17.4536 2.9101 17.4491 2.9815 17.4253 3.04746L12.5859 17.1933C12.5613 17.2651 12.5152 17.3277 12.454 17.3727C12.3928 17.4176 12.3192 17.4427 12.2433 17.4447C12.1674 17.4466 12.0927 17.4253 12.0292 17.3835C11.9658 17.3418 11.9166 17.2817 11.8883 17.2112L9.52073 11.3056C9.44567 11.1191 9.33362 10.9498 9.19133 10.8077ZM9.19133 10.8077L17.3367 2.66404",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function pi({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M10.8333 14.1667V7.5M15 14.1667V4.16667M2.5 2.5V15.8333C2.5 16.2754 2.67559 16.6993 2.98816 17.0118C3.30072 17.3244 3.72464 17.5 4.16667 17.5H17.5M6.66667 14.1667V11.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function fi({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M6.6665 9.99984H13.3332M9.99984 6.6665V13.3332M18.3332 9.99984C18.3332 14.6022 14.6022 18.3332 9.99984 18.3332C5.39746 18.3332 1.6665 14.6022 1.6665 9.99984C1.6665 5.39746 5.39746 1.6665 9.99984 1.6665C14.6022 1.6665 18.3332 5.39746 18.3332 9.99984Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function ui({size:e=20,className:t}){return(0,D.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,D.jsx)("path",{d:"M6.667 2.5 3.333 5.833 6.667 9.167M3.333 5.833h13.334M13.333 17.5l3.334-3.333-3.334-3.334M16.667 14.167H3.333",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function mi({size:e=20,className:t}){return(0,D.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,D.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),(0,D.jsx)("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}var E=z(require("react"),1);var Dt=z(require("bignumber.js"),1);function Pl(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return t>0&&e.charCodeAt(t-1)===46&&t--,e.slice(0,t)}function Ht(e,t){if(!e||e==="0")return"0.00";let n=new Dt.default(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,Dt.default.ROUND_DOWN)}function Ye(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function er(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,o=Math.pow(10,n);return`$${(Math.floor(t*o)/o).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function gi(e,t,n){let r=new Dt.default(e).shiftedBy(-t).multipliedBy(new Dt.default(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(Dt.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,Dt.default.ROUND_DOWN):r.decimalPlaces(4,Dt.default.ROUND_DOWN)).toFormat()}`}function hi(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 n=t;if(n.includes("e")||n.includes("E")){let i=Number(n);if(!Number.isFinite(i)||i===0)return{displayValue:"0",isLowerBound:!1};n=Pl(i.toFixed(18))}let[o="0",r=""]=n.split(".");if(Number(o)>=1){let i=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${i}`,isLowerBound:!1}}return r.length<4?{displayValue:`${o}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}var bi=require("react"),wi=require("@tanstack/react-query");var ot={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},Me={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var Bl="send:chain-info";function Fl(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let n=t[0];if(!n)throw new Error("Chain info payload is empty.");return n}return t}return e}function tr(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function Ml(e,t,n,o){if(o)return t===Me[e].cross?xi(t,o):n?.explorer_url?tr(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):_l(e,t,o)}function xi(e,t){return tr("https://explorer.crosstoken.io",String(e),"tx",t)}function _l(e,t,n){let o=Me[e];if(t===o.cross)return xi(t,n);if(t===o.bsc)return tr(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function ao(e,t,n,o=!0){let r=ot[e],a=(0,wi.useQuery)({queryKey:[Bl,e,t],queryFn:async({signal:p})=>{let c=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:p});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let f=await c.json();if("code"in f&&f.code!==void 0&&f.code!==200)throw new Error(`Chain info API error: ${f.code}`);return Fl(f)},enabled:o,staleTime:300*1e3}),i=a.data;return{transactionUrl:(0,bi.useMemo)(()=>Ml(e,t,i,n),[t,i,e,n]),chainInfo:i,...a}}var vi="0x0000000000000000000000000000000000000001";var Ol="0xa9059cbb",zl=/^0x[a-fA-F0-9]{40}$/,Wl="nexus-cross:dapp-ui:send:recent:",yi=10;function Dl(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Nn(e){return e.toLowerCase()}function St(e){return zl.test(e)}function Gt(e){return Nn(e.address)===vi}function nr(e){return`${Wl}${e.toLowerCase()}`}function un(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(nr(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&St(o.address)&&typeof o.updatedAt=="number").slice(0,yi):[]}catch{return[]}}function or(e,t){if(typeof window>"u")return[];let n=Nn(t),o=[{address:n,updatedAt:Date.now()},...un(e).filter(r=>r.address!==n)].slice(0,yi);try{window.localStorage.setItem(nr(e),JSON.stringify(o))}catch{return un(e)}return o}function rr(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(nr(e))}catch{}}function en(e,t){let n=e.trim();if(!n)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(n))return{error:"Enter a valid amount."};let[o="0",r=""]=n.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let a=BigInt(o||"0"),i=r.padEnd(t,"0"),l=i?BigInt(i):0n,p=10n**BigInt(t),c=a*p+l;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function ir(e,t){let n=BigInt(e||"0"),o=10n**BigInt(t),r=n/o,a=n%o;if(a===0n)return r.toString();let i=Dl(a.toString().padStart(t,"0"));return`${r.toString()}.${i}`}function ar(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${Ol}${n}${o}`}function so(e,t,n=10){if(t<=0)return e.toString();let o=10n**BigInt(t),r=e/o,a=e%o;if(a===0n)return r.toString();let l=a.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return l=l.replace(/0+$/,""),l?`${r.toString()}.${l}`:r.toString()}function sr(e,t){return so(e,t,6)}function ki(e){return so(e,9,2)}function Si(e){return e.toLocaleString("en-US")}function lo(e){return e===56||e===97}function co(e){return e.gasPrice??e.maxFeePerGas}function Ci(e,t=!1){return t?co(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function po(e,t=!1){if(t){let n=co(e);return n!==void 0?e.gasLimit*n:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function fo(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Ri(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let n=e,o=[];return typeof n.name=="string"&&o.push(n.name),typeof n.shortMessage=="string"&&o.push(n.shortMessage),typeof n.message=="string"&&o.push(n.message),typeof n.details=="string"&&o.push(n.details),n.cause!==void 0&&o.push(Ri(n.cause,t+1)),o.join(`
6
- `).toLowerCase()}function Hl(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;if(e&&typeof e=="object"){let t=e;if(typeof t.shortMessage=="string")return t.shortMessage;if(typeof t.message=="string")return t.message}return""}function lr(e,t={},n="Failed to send transaction."){let o=Ri(e);if(!o)return n;let r=t.nativeSymbol?.trim()||"gas token",a=t.networkName?.trim();if(o.includes("user rejected")||o.includes("userrejected")||o.includes("user denied")||o.includes("user cancelled")||o.includes("user canceled")||o.includes("action_rejected")||o.includes("rejected by user"))return"Transaction was cancelled.";if(o.includes("insufficientfunds")||o.includes("insufficient funds")||o.includes("exceeds the balance of the account")||o.includes("insufficient balance for transfer")){let i=a?` on ${a}`:"";return`Not enough ${r} to cover the gas fee.Please top up your ${r} balance and try again.`}return o.includes("transaction underpriced")||o.includes("replacement transaction underpriced")||o.includes("fee too low")?"Gas fee was too low for the network. Please try again.":o.includes("nonce too low")||o.includes("nonce has already been used")||o.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":o.includes("execution reverted")||o.includes("contractfunctionrevertederror")||o.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":o.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":o.includes("http request failed")||o.includes("failed to fetch")||o.includes("network request failed")||o.includes("timeout")||o.includes("econnreset")||o.includes("rpc error")||o.includes("429")?"Network connection failed. Check your internet and try again.":o.includes("estimategas")||o.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":Hl(e)||n}var Gl=2000000000n,Ul=1000000000n;async function uo(e,t,n){let o=new AbortController,r=setTimeout(()=>o.abort(),8e3),a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:n}),signal:o.signal}).finally(()=>clearTimeout(r));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let i=await a.json();if(i.error)throw new Error(`RPC ${t}: ${i.error.message}`);if(i.result===void 0)throw new Error(`RPC ${t}: empty result`);return i.result}function mo(e){return BigInt(e)}function $l(e){return`0x${e.toString(16)}`}function jl(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=$l(e.value)),e.data&&(t.data=e.data),t}function Vl(e){return e===56||e===97}async function Ni(e){try{let t=await uo(e,"eth_gasPrice",[]);return{gasPrice:mo(t)}}catch{return{gasPrice:Gl}}}async function ql(e,t){let n=Ul;try{let o=await uo(e,"eth_maxPriorityFeePerGas",[]);n=mo(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Kl(e,t){if(t)return Ni(e);let n;try{n=(await uo(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?ql(e,mo(n)):Ni(e)}async function Ti(e,t){let n=Vl(t.chainId),o=jl(t),[r,a]=await Promise.all([uo(e,"eth_estimateGas",[o]),Kl(e,n)]);return{gasLimit:mo(r),gasPrice:a.gasPrice,maxFeePerGas:a.maxFeePerGas,maxPriorityFeePerGas:a.maxPriorityFeePerGas}}function Ii(e){let{estimateGas:t,sendTransaction:n,getTransactionReceipt:o}=e;return{canSend:!!n,canEstimateGas(r){return!!t||!!r},async estimateGas(r,a){if(t)return t(r);if(a)return Ti(a,r);throw new Error("Gas estimation is not available.")},async sendTransaction(r){if(!n)throw new Error("Sending is not available for this wallet.");return n(r)},getTransactionReceipt:o}}var Ql=1500,Yl=120;function Li(e){return!!(e.token||e.recipient||e.amount)}function cr({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},a=e.trim(),i=en(t,n.quantity.decimals),l;return a?St(a)||(r.recipient="Enter a valid EVM recipient address."):r.recipient="Enter a recipient address.","error"in i?r.amount=i.error:(l=i.value,l>o&&(r.amount="Amount exceeds available balance.")),!Gt(n)&&!St(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:l,recipient:a&&St(a)?a:void 0}}function dr({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return Gt(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:Nn(e.address),data:ar(n,o),value:0n,chainId:e.chainId,from:r}}function Zl(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var Xl=e=>new Promise(t=>setTimeout(t,e));async function Ei({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=Ql,pollMaxAttempts:a=Yl}){let i=await e.sendTransaction(t);o(i);let{getTransactionReceipt:l}=e;if(!l)return"success";for(let p=0;p<a;p+=1){let c=await l({hash:i,chainId:n}).catch(()=>null);if(c)return Zl(c)?"reverted":"success";await Xl(r)}return"timeout"}var Ai=["token","recipient","amount","review"];function Pi(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:a="recipient",token:i,tokens:l=[],onTokenChange:p,sendTransaction:c,getTransactionReceipt:f,estimateGas:m,getTokenPriceUsd:h,onSubmitted:g,onSuccess:v,onFailed:x,onExit:w,onOutlink:y}=e,A=E.useMemo(()=>Ii({sendTransaction:c,getTransactionReceipt:f,estimateGas:m}),[c,f,m]),[u,T]=E.useState(i);E.useEffect(()=>{T(i)},[i.address,i.chainId]);let[S,P]=E.useState(a),[B,te]=E.useState(""),[O,Y]=E.useState(""),[_,re]=E.useState({}),[G,Ce]=E.useState("idle"),[pe,me]=E.useState(""),[Ue,ge]=E.useState(""),[U,he]=E.useState(null),[de,$]=E.useState(!1),[$e,ve]=E.useState(""),Oe=E.useRef(0),[ye,it]=E.useState(null),[Le,_t]=E.useState(""),[Ge,wt]=E.useState(()=>un(n)),Tt=E.useMemo(()=>Be(t),[t]),{transactionUrl:be,chainInfo:Re}=ao(Tt,u.chainId,pe||void 0,!0),Xe=Re?.currency_symbol??"",Ee=Re?.name??`Chain ID ${u.chainId}`,Ne=E.useRef({nativeSymbol:Xe||void 0,networkName:Ee,tokenSymbol:u.symbol});Ne.current={nativeSymbol:Xe||void 0,networkName:Ee,tokenSymbol:u.symbol};let we=E.useMemo(()=>BigInt(u.quantity.numeric||"0"),[u.quantity.numeric]),xt=E.useMemo(()=>Ht(u.quantity.numeric,u.quantity.decimals),[u.quantity.numeric,u.quantity.decimals]),je=h?.(u),at=E.useMemo(()=>{if(je===void 0)return;let k=parseFloat(O.replace(/,/g,""));return Number.isFinite(k)?k*je:0},[O,je]);E.useEffect(()=>{Y(""),re({})},[u.address,u.chainId]),E.useEffect(()=>{Oe.current+=1,he(null),ve(""),$(!1)},[u.address,u.chainId,B,O]),E.useEffect(()=>{wt(un(n))},[n]);let Ae=E.useCallback(k=>{te(k),re(q=>({...q,recipient:void 0}))},[]),vt=E.useCallback(k=>{Y(k),re(q=>({...q,amount:void 0}))},[]),yt=E.useCallback(()=>{Y(xt.replace(/,/g,"")),re(k=>({...k,amount:void 0}))},[xt]),ze=E.useCallback(k=>{T(k),p?.(k),P("recipient")},[p]),st=E.useCallback(()=>P("token"),[]),Je=E.useCallback(()=>{P(k=>{if(k==="result")return"review";if(k===a)return w?.(),k;let q=Ai.indexOf(k);return q<=0?(w?.(),k):Ai[q-1]})},[a,w]),fe=E.useCallback(()=>{let{errors:k}=cr({recipient:B,amount:"1",token:u,balanceRaw:we});if(k.recipient){re(q=>({...q,recipient:k.recipient}));return}re(q=>({...q,recipient:void 0})),P("amount")},[B,u,we]),et=E.useCallback(k=>{te(k),re(q=>({...q,recipient:void 0})),P("amount")},[]),Pe=E.useCallback(()=>{let k=cr({recipient:B,amount:O,token:u,balanceRaw:we});re(k.errors),!(Li(k.errors)||k.rawAmount===void 0||!k.recipient)&&(it(k.rawAmount),_t(k.recipient),he(null),ve(""),Ce("idle"),P("review"))},[B,O,u,we]);E.useEffect(()=>{if(S!=="review"||!Le||ye===null||U!==null||de||$e||!A.canEstimateGas(Re?.rpc))return;let k=++Oe.current;$(!0),ve(""),(async()=>{try{let q=dr({token:u,walletAddress:n,recipient:Le,rawAmount:ye}),ie=await A.estimateGas(q,Re?.rpc);if(Oe.current!==k)return;he(ie)}catch(q){if(Oe.current!==k)return;ve(lr(q,Ne.current,"Failed to estimate gas."))}finally{Oe.current===k&&$(!1)}})()},[S,Le,ye,U,de,$e,A,Re?.rpc,u,n]);let tt=E.useMemo(()=>{if(!Gt(u)||!U||ye===null)return!1;let k=po(U,lo(u.chainId));return k===null?!1:ye+k>we},[u,U,ye,we]),Ve=E.useCallback(async()=>{if(!(!Le||ye===null)&&!tt){ge(""),me(""),Ce("submitting");try{let k="",q=await Ei({repository:A,args:dr({token:u,walletAddress:n,recipient:Le,rawAmount:ye}),chainId:u.chainId,onSubmitted:ie=>{k=ie,me(ie),Ce("confirming"),wt(or(n,Le)),g?.({txHash:ie,chainId:u.chainId,amount:O,tokenSymbol:u.symbol,recipient:Le})}});if(q==="success")Ce("success"),k&&v?v?.(k):P("result");else if(q==="reverted"){let ie="Transaction reverted on-chain.";Ce("error"),ge(ie),k&&x?x({txHash:k,chainId:u.chainId,message:ie}):P("result")}else{let ie="Transaction receipt was not found. Please check again later.";Ce("error"),ge(ie),k&&x?x({txHash:k,chainId:u.chainId,message:ie}):P("result")}}catch(k){Ce("error"),ge(lr(k,{nativeSymbol:Xe||void 0,networkName:Ee,tokenSymbol:u.symbol})),P("result")}}},[A,Le,ye,tt,u,O,n,g,v,x,Xe,Ee]),[It,Lt]=E.useState(!1),lt=E.useRef(void 0);E.useEffect(()=>()=>clearTimeout(lt.current),[]);let Ot=E.useCallback(async()=>{if(pe)try{await navigator.clipboard.writeText(pe),Lt(!0),clearTimeout(lt.current),lt.current=setTimeout(()=>Lt(!1),2e3)}catch{}},[pe]),ct=E.useCallback(()=>{if(!be||!pe)return;let k=qe=>{typeof window<"u"&&window.open(qe,"_blank","noopener,noreferrer")};if(!y){k(be);return}let q=y(be,{category:"send",origin:"send-transaction",payload:{chainId:u.chainId,txHash:pe}});if(q&&typeof q.then=="function"){let qe=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;q.then(Ke=>{if(Ke===null){qe?.close();return}let zt=Ke??be;if(qe)try{qe.location.href=zt}catch{qe.close(),k(zt)}else k(zt)});return}let ie=q;ie!==null&&k(ie??be)},[y,u.chainId,be,pe]),Te=E.useCallback(()=>{ge(""),me(""),Ce("idle"),he(null),ve(""),P("review")},[]);return{step:S,status:G,token:u,tokens:l.length>0?l:[u],recipient:B,amount:O,amountUsd:at,fieldErrors:_,error:Ue,txHash:pe,gasEstimate:U,gasLoading:de,gasError:$e,insufficientGas:tt,reviewRawAmount:ye,reviewRecipient:Le,recentAddresses:Ge,accounts:r,accountName:o,walletAddress:n,resolvedEnv:Tt,transactionUrl:be,networkName:Ee,nativeSymbol:Xe,nativeDecimals:Re?.currency_decimals??u.quantity.decimals,balanceRaw:we,balanceText:xt,priceUsd:je,canSelectToken:(l.length>0?l:[u]).length>1,canSend:A.canSend,getTokenPriceUsd:h,setRecipient:Ae,setAmount:vt,setMax:yt,selectToken:ze,goToTokenSelect:st,selectRecipient:et,submitRecipient:fe,submitAmount:Pe,confirmSend:Ve,retry:Te,back:Je,hashCopied:It,copyHash:Ot,openTransaction:ct}}var pt=z(require("react"),1);var Ct=require("react/jsx-runtime");function Bi({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:a,token:i,setMax:l}=e,p=pt.useRef(null),c=pt.useCallback(()=>{requestAnimationFrame(()=>{let x=p.current;if(!x)return;let w=x.value.length;x.setSelectionRange(w,w)})},[]);pt.useEffect(()=>{p.current?.focus(),c()},[c]),pt.useEffect(()=>{t===""&&(h(!1),c())},[t,c]);let f=pt.useMemo(()=>{let x=en(t,i.quantity.decimals);return"value"in x&&x.value>a},[t,i.quantity.decimals,a]),[m,h]=pt.useState(!1),g=!m&&t===""?"0.00":t,v=t.trim()===""||t.trim()==="0";return(0,Ct.jsx)("div",{className:"sf-body sf-amount",children:(0,Ct.jsxs)("div",{className:"sf-amount-center",children:[(0,Ct.jsx)("span",{className:"sf-amount-usd",children:o!==void 0?fo(o):"\xA0"}),(0,Ct.jsx)("div",{className:"sf-amount-input-wrap","data-over":f||void 0,"data-empty":v||void 0,onClick:()=>p.current?.focus(),children:(0,Ct.jsx)("input",{ref:p,className:"sf-amount-input",value:g,onChange:x=>{let w=x.target.value;if(m)n(w);else if(t===""){if(w.length<4)return;h(!0);let y=w.startsWith("0.00")?w.slice(4):w;n(y)}else h(!0),n(w)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${i.symbol}`,size:1})}),(0,Ct.jsxs)("div",{className:"sf-amount-balance",children:[(0,Ct.jsx)("span",{children:"Balance:"}),(0,Ct.jsxs)("button",{type:"button",className:"sf-amount-max",onClick:l,children:[r," ",i.symbol]})]})]})})}var ft=z(require("react"),1);var pr={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"},Fi={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Tn(e,t){let n=Me[e];if(t===n.cross)return Fi.cross;if(t===n.bsc)return Fi.bsc}var Jl={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Et(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:a="png"}=n,i=Jl[e],l=r?`&bg=${r}`:"";return`${i}/portrait/evm/${t}.${a}?size=${o}${l}`}var Se=require("react/jsx-runtime");function Mi({size:e=20,className:t}){return(0,Se.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,Se.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),(0,Se.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function _i({size:e=20,className:t}){return(0,Se.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,Se.jsx)("path",{d:"M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2M12 11v6M9 14h6",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function Oi({size:e=20,className:t}){return(0,Se.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,Se.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),(0,Se.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function zi({size:e=16,className:t}){return(0,Se.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:(0,Se.jsx)("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wi({size:e=56,className:t}){return(0,Se.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,Se.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),(0,Se.jsx)("path",{d:"M17 28.5 24.2 35.5 39 20.5",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Di({size:e=56,className:t}){return(0,Se.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,Se.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),(0,Se.jsx)("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}var Q=require("react/jsx-runtime");function Hi(e,t){return e.name||`Account ${(e.index??t)+1}`}function Gi(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Ui(e){return e.toLowerCase()}function $i({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:a,walletAddress:i,resolvedEnv:l,selectRecipient:p}=e,c=ft.useMemo(()=>a.filter(u=>u.address.toLowerCase()!==i.toLowerCase()),[a,i]),f=c.length>0,m=ft.useMemo(()=>new Map(c.map((u,T)=>[Ui(u.address),{account:u,index:T}])),[c]),[h,g]=ft.useState("recent"),v=ft.useRef(null);ft.useEffect(()=>{v.current?.focus()},[]);let x="1A1A2E",w=ft.useCallback(async()=>{try{let u=await navigator.clipboard.readText();u&&n(u.trim())}catch{}},[n]),y=t.trim().length>0,A=St(t.trim());return(0,Q.jsxs)("div",{className:"sf-recipient",children:[(0,Q.jsxs)("div",{className:"sf-recipient-top",children:[(0,Q.jsxs)("div",{className:"sf-address-field","data-filled":y||void 0,"data-invalid":o.recipient||void 0,children:[(0,Q.jsx)("textarea",{ref:v,className:"sf-address-input",value:t,onChange:u=>n(u.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:y?2:1}),y?(0,Q.jsx)("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear",children:(0,Q.jsx)(Oi,{size:20})}):(0,Q.jsx)("button",{type:"button",className:"sf-address-action",onClick:w,"aria-label":"Paste from clipboard",children:(0,Q.jsx)(_i,{size:20})})]}),o.recipient&&(0,Q.jsx)("p",{className:"sf-field-error",role:"alert",children:o.recipient}),(0,Q.jsxs)("div",{className:"sf-tabs",role:"tablist",children:[(0,Q.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":h==="recent"||void 0,"aria-selected":h==="recent",onClick:()=>g("recent"),children:"Recent"}),f&&(0,Q.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":h==="account"||void 0,"aria-selected":h==="account",onClick:()=>g("account"),children:"My Account"})]})]}),(0,Q.jsx)("div",{className:"sf-address-list",children:h==="account"&&f?c.map((u,T)=>{let S=Hi(u,T),P=Et(l,u.address,{size:56,bg:x});return(0,Q.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>p(u.address),children:[(0,Q.jsxs)("span",{className:"sf-address-avatar",children:[P&&(0,Q.jsx)("img",{src:P,alt:"",width:40,height:40,draggable:!1,onError:B=>{B.currentTarget.style.display="none"}}),(0,Q.jsx)("span",{className:"sf-address-avatar-fallback",children:Gi(S)})]}),(0,Q.jsxs)("span",{className:"sf-address-meta",children:[(0,Q.jsx)("span",{className:"sf-address-name",children:S}),(0,Q.jsx)("span",{className:"sf-address-value",children:Ye(u.address)})]})]},u.address)}):r.length>0?r.map(u=>{let T=m.get(Ui(u.address)),S=T?Hi(T.account,T.index):Ye(u.address),P=Et(l,u.address,{size:56,bg:x});return(0,Q.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>p(u.address),children:[(0,Q.jsxs)("span",{className:"sf-address-avatar",children:[P&&(0,Q.jsx)("img",{src:P,alt:"",width:40,height:40,draggable:!1,onError:B=>{B.currentTarget.style.display="none"}}),(0,Q.jsx)("span",{className:"sf-address-avatar-fallback",children:Gi(S)})]}),(0,Q.jsxs)("span",{className:"sf-address-meta",children:[(0,Q.jsx)("span",{className:"sf-address-name",children:S}),(0,Q.jsx)("span",{className:"sf-address-value",children:Ye(u.address)})]})]},u.address)}):(0,Q.jsx)("div",{className:"sf-empty",children:"No send history"})}),y&&!A&&!o.recipient&&(0,Q.jsx)("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}var le=require("react/jsx-runtime");function Vi({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:a,openTransaction:i}=e,l=t==="error",p=t==="success";return l?(0,le.jsxs)("div",{className:"sf-body sf-result sf-result--error",children:[(0,le.jsx)("span",{className:"sf-result-icon",children:(0,le.jsx)(Di,{size:56})}),(0,le.jsxs)("div",{className:"sf-result-copy",children:[(0,le.jsx)("h3",{className:"sf-result-title",children:"Transaction Failed"}),(0,le.jsx)("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&(0,le.jsx)(ji,{txHash:n,hashCopied:a,onCopy:r,onOpen:i})]}):(0,le.jsxs)("div",{className:"sf-body sf-result",children:[(0,le.jsx)("span",{className:"sf-result-icon","data-pending":!p||void 0,children:p?(0,le.jsx)(Wi,{size:56}):(0,le.jsx)("span",{className:"sf-result-spinner"})}),(0,le.jsxs)("div",{className:"sf-result-copy",children:[(0,le.jsx)("h3",{className:"sf-result-title",children:p?"Transaction Complete":"Transaction in Progress"}),(0,le.jsx)("p",{className:"sf-result-desc",children:p?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&(0,le.jsx)(ji,{txHash:n,hashCopied:a,onCopy:r,onOpen:i})]})}function ji({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return(0,le.jsxs)("div",{className:"sf-result-hash-card",children:[(0,le.jsx)("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),(0,le.jsxs)("div",{className:"sf-result-hash-row",children:[(0,le.jsx)("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer",children:Ye(e)}),(0,le.jsx)("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash",children:t?(0,le.jsx)(Zt,{size:16}):"Copy"})]})]})}var H=require("react/jsx-runtime"),go="\u2014";function qi({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:a,walletAddress:i,networkName:l,nativeSymbol:p,nativeDecimals:c,gasEstimate:f,gasLoading:m,gasError:h,insufficientGas:g,error:v,resolvedEnv:x}=e,w=Gt(t),y=n!==null?so(n,t.quantity.decimals):"",A=r?.trim()||`Account ${(a[0]?.index??0)+1}`,u=Et(x,i,{size:56,bg:"1A1A2E"}),T=p||(w?t.symbol:""),S=lo(t.chainId),P=f?Ci(f,S):null,B=f?po(f,S):null,te=G=>G!==null&&T?`${sr(G,c)} ${T}`:go,O=G=>G!==void 0?`${ki(G)} Gwei`:go,Y=(()=>{if(!w||!f||B===null||n===null)return go;let G=n+B;return`${sr(G,c)} ${T||t.symbol}`})(),_=G=>m?"\u2026":G,re=[{label:"Est. Tx Fee",value:_(te(B))},...P==="dynamic"?[{label:"Max Priority Fee",value:_(O(f?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:_(O(f?.maxFeePerGas))}]:P==="legacy"?[{label:"Gas Price",value:_(O(f?co(f):void 0))}]:[],{label:"Gas Limit",value:_(f?Si(f.gasLimit):go)}];return(0,H.jsxs)("div",{className:"sf-body sf-review",children:[(0,H.jsxs)("div",{className:"sf-review-amount",children:[(0,H.jsx)("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:G=>{G.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,H.jsxs)("span",{className:"sf-review-amount-value",children:[y,(0,H.jsx)("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),(0,H.jsxs)("div",{className:"sf-review-parties",children:[(0,H.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,H.jsx)("span",{className:"sf-review-party-label",children:"From"}),(0,H.jsxs)("div",{className:"sf-review-party-head",children:[(0,H.jsx)("span",{className:"sf-review-party-avatar",children:u&&(0,H.jsx)("img",{src:u,alt:"",width:28,height:28,draggable:!1,onError:G=>{G.currentTarget.style.display="none"}})}),(0,H.jsx)("span",{className:"sf-review-party-name",children:A})]}),(0,H.jsx)("span",{className:"sf-review-party-addr",children:i})]}),(0,H.jsx)("span",{className:"sf-review-arrow","aria-hidden":!0,children:(0,H.jsx)(zi,{size:16})}),(0,H.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,H.jsx)("span",{className:"sf-review-party-label",children:"To"}),(0,H.jsx)("span",{className:"sf-review-party-addr",children:o})]})]}),(0,H.jsxs)("section",{className:"sf-review-card",children:[(0,H.jsx)("h3",{className:"sf-review-section-title",children:"Summary"}),(0,H.jsxs)("div",{className:"sf-review-row",children:[(0,H.jsx)("span",{className:"sf-review-row-label",children:"Network"}),(0,H.jsx)("span",{className:"sf-review-row-value",children:l})]}),re.map(G=>(0,H.jsxs)("div",{className:"sf-review-row",children:[(0,H.jsx)("span",{className:"sf-review-row-label",children:G.label}),(0,H.jsx)("span",{className:"sf-review-row-value",children:G.value})]},G.label))]}),(0,H.jsxs)("section",{className:"sf-review-card",children:[(0,H.jsx)("h3",{className:"sf-review-section-title",children:"Total"}),(0,H.jsxs)("div",{className:"sf-review-row",children:[(0,H.jsx)("span",{className:"sf-review-row-label",children:"Total Amount"}),(0,H.jsxs)("span",{className:"sf-review-row-value",children:[y," ",t.symbol]})]}),w&&(0,H.jsxs)("div",{className:"sf-review-row",children:[(0,H.jsx)("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),(0,H.jsx)("span",{className:"sf-review-row-value",children:_(Y)})]})]}),g&&!h&&!v&&(0,H.jsxs)("div",{className:"sf-message sf-message--error",role:"alert",children:["Not enough ",T||t.symbol," to cover the amount plus the network fee. Reduce the amount and try again."]}),(h||v)&&(0,H.jsx)("div",{className:"sf-message sf-message--error",role:"alert",children:h||v})]})}var ho=z(require("react"),1);var Ie=require("react/jsx-runtime");function Ki({flow:e}){let[t,n]=ho.useState(""),o=t.trim().toLowerCase(),r=ho.useMemo(()=>o?e.tokens.filter(a=>a.symbol.toLowerCase().includes(o)||a.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return(0,Ie.jsxs)("div",{className:"sf-body sf-token-select",children:[(0,Ie.jsxs)("div",{className:"sf-search",children:[(0,Ie.jsx)(Mi,{size:20}),(0,Ie.jsx)("input",{className:"sf-search-input",value:t,onChange:a=>n(a.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),(0,Ie.jsxs)("div",{className:"sf-token-list",children:[r.map(a=>{let i=`${a.chainId}:${a.address.toLowerCase()}`,l=Tn(e.resolvedEnv,a.chainId),p=e.getTokenPriceUsd?.(a);return(0,Ie.jsxs)("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(a),children:[(0,Ie.jsxs)("span",{className:"sf-token-left",children:[(0,Ie.jsxs)("span",{className:"sf-token-icon-wrap",children:[(0,Ie.jsx)("img",{className:"sf-token-icon",src:a.icon_url,alt:"",width:40,height:40,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),l&&(0,Ie.jsx)("img",{className:"sf-token-chain-badge",src:l,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.style.display="none"}})]}),(0,Ie.jsx)("span",{className:"sf-token-name",children:a.symbol})]}),(0,Ie.jsxs)("span",{className:"sf-token-right",children:[(0,Ie.jsx)("span",{className:"sf-token-balance",children:Ht(a.quantity.numeric,a.quantity.decimals)}),p!==void 0&&(0,Ie.jsx)("span",{className:"sf-token-price",children:fo(p)})]})]},i)}),r.length===0&&(0,Ie.jsx)("div",{className:"sf-empty",children:"No tokens found"})]})]})}W(`.sf-root{display:flex;flex-direction:column;flex:1;min-height:0;font-family:inherit}.sf-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px;flex-shrink:0;position:relative;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.sf-header .sf-header-btn:last-child{position:absolute;top:24px;right:24px}.sf-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;filter:none;transition:color .15s ease}.sf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));filter:none}.sf-header-title{position:absolute;left:50%;transform:translate(-50%);text-align:center;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);pointer-events:none}.sf-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .sf-body{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-body::-webkit-scrollbar{width:4px;height:4px}.sf-body::-webkit-scrollbar-track,.sf-body::-webkit-scrollbar-corner{background:transparent}.sf-body::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}.sf-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .sf-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .sf-body::-webkit-scrollbar-thumb:hover{background:#0003}.sf-empty{padding:32px 0;text-align:center;font-family:inherit;font-size:14px;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-field-error{margin:8px 24px 0;font-family:inherit;font-size:12px;line-height:1.5;color:var(--ds-system-red-default, #da0b2e)}.sf-message--error{margin:16px 0 0;padding:12px 16px;background:var(--ds-system-red-low, #ffeeee);color:var(--ds-system-red-high, #d20609);font-family:inherit;font-size:13px;line-height:1.5;border-radius:12px;width:100%;box-sizing:border-box}.sf-footer{display:flex;flex-shrink:0;padding:16px 24px 24px}.sf-footer:empty{display:none}.sf-footer-row{display:flex;gap:8px;width:100%}.sf-footer-row .sf-btn,.sf-footer-row .sf-btn--secondary{flex:1 1 0;min-width:0}.sf-footer>.sf-btn{width:100%}.sf-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:1;height:48px;padding:0 24px;border:none;border-radius:12px;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:background-color .15s ease,transform .1s ease}.sf-btn--primary{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff)}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){background:var(--ds-accent-primary-high, #00a0a2)}.sf-btn--primary:active:not(:disabled):not([data-disabled]){transform:scale(.97)}.sf-btn--primary[data-disabled],.sf-btn--primary:disabled{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff);cursor:default;opacity:.5}.sf-btn--secondary{flex:0 0 120px;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-token-select{padding:0;display:flex;flex-direction:column}.sf-token-select .sf-search{margin:16px 24px}.sf-token-select .sf-token-list{width:100%;margin-top:0}.sf-search{display:flex;align-items:center;gap:8px;padding:12px 16px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-low, rgba(0, 0, 0, .4));box-sizing:border-box;transition:border-color .15s ease}.sf-search:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-search:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-search-input{flex:1;min-width:0;border:none;background:transparent;outline:none;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-search-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-token-list{display:flex;flex-direction:column;margin-top:8px}.sf-token-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-token-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-token-left{display:flex;align-items:center;gap:16px;min-width:0}.sf-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.sf-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain}.sf-token-chain-badge{position:absolute;right:-2px;bottom:-2px;width:16px;height:16px;border-radius:50%;object-fit:cover}.sf-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.sf-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.sf-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.sf-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.sf-recipient{display:flex;flex-direction:column;flex:1;min-height:0}.sf-recipient-top{display:flex;flex-direction:column;padding:16px 24px 0}.sf-address-field{display:flex;align-items:center;gap:8px;padding:12px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);transition:border-color .15s ease;box-sizing:border-box}.sf-address-field:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-address-field:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-filled]{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-invalid]{border-color:var(--ds-system-red-default, #da0b2e)}.sf-address-input{flex:1;min-width:0;border:none;background:transparent;outline:none;resize:none;overflow:hidden;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));word-break:break-word;overflow-wrap:anywhere}.sf-address-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-address-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;border-radius:6px;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.sf-address-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-address-field[data-filled] .sf-address-action{border-radius:9999px}.sf-tabs{display:flex;gap:0;margin:16px 0 0}.sf-tab{position:relative;padding:8px 12px;border:none;background:transparent;cursor:pointer;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-tab[data-active]{color:var(--ds-accent-primary-high, #00a0a2)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-accent-primary-high, #00a0a2)}.sf-address-list{display:flex;flex-direction:column;width:100%;margin-top:8px}.sf-address-row{display:flex;align-items:center;gap:16px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-address-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-address-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex-shrink:0;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:600}.sf-address-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.sf-address-avatar-fallback{position:relative;z-index:0}.sf-address-meta{display:flex;flex-direction:column;min-width:0}.sf-address-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sf-address-value{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-drawer-content .sf-header{padding:16px}.wi-drawer-content .sf-header .sf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .sf-token-select{padding:0}.wi-drawer-content .sf-token-select .sf-search{margin:16px}.wi-drawer-content .sf-token-row{padding:12px 16px}.wi-drawer-content .sf-recipient-top{padding:16px 16px 0}.wi-drawer-content .sf-address-row{padding:12px 16px}.wi-drawer-content .sf-footer{padding:12px 16px 24px}.wi-drawer-content .sf-field-error,.wi-drawer-content .sf-message--error{margin:16px 0 0;width:auto}.sf-amount{display:flex;flex-direction:column}.sf-amount-center{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:64px 24px 48px;text-align:center}.sf-amount-usd{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));min-height:21px}.sf-amount-input-wrap{display:flex;justify-content:center;max-width:100%}.sf-amount-input{width:auto;max-width:100%;border:none;background:transparent;outline:none;text-align:center;font-family:inherit;font-size:40px;font-weight:700;line-height:1.25;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);field-sizing:content}.sf-amount-input-wrap[data-empty] .sf-amount-input,.sf-amount-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-input-wrap[data-over] .sf-amount-input{color:var(--ds-system-red-default, #da0b2e)}.sf-amount-balance{display:inline-flex;align-items:center;gap:4px;font-family:inherit;font-size:14px;font-weight:400;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-max{border:none;background:transparent;padding:0;cursor:pointer;font:inherit;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.sf-amount-max:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-drawer-content .sf-amount-center{padding:64px 16px 48px}.sf-review{display:flex;flex-direction:column;gap:16px;padding:24px}.sf-review-amount{display:flex;align-items:center;gap:12px;padding:0;background:transparent}.sf-review-amount-icon{width:40px;height:40px;border-radius:0;object-fit:contain;flex-shrink:0}.sf-review-amount-value{display:inline-flex;flex-direction:column;align-items:flex-start;gap:0;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);word-break:break-all}.sf-review-amount-symbol{font-size:12px;font-weight:400;line-height:1.5;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-parties{position:relative;display:flex;flex-direction:column;gap:0}.sf-review-arrow{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin:-4px auto;border-radius:50%;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-card{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa)}.sf-review-party-label{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-party-head{display:flex;align-items:center;gap:8px}.sf-review-party-avatar{display:inline-flex;width:24px;height:24px;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);flex-shrink:0}.sf-review-party-avatar img{width:100%;height:100%;object-fit:cover}.sf-review-party-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-review-party-addr{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));word-break:break-all}.sf-review-section-title{margin:0 0 4px;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-review-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.sf-review-row-label{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-row-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));text-align:left;word-break:break-all}.wi-drawer-content .sf-review{padding:16px}.sf-result{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;padding:48px 24px;text-align:center}.sf-result-icon{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px}.sf-result-spinner{width:56px;height:56px;border-radius:50%;border:4px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-top-color:var(--ds-accent-primary-default, #00b4b7);animation:sf-spin .8s linear infinite}@keyframes sf-spin{to{transform:rotate(360deg)}}.sf-result-copy{display:flex;flex-direction:column;gap:8px}.sf-result-title{margin:0;font-family:inherit;font-size:18px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-result-desc{margin:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);text-align:left}.sf-result-hash-label{font-family:inherit;font-size:12px;font-weight:500;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sf-result-hash-link{border:none;background:transparent;padding:0;cursor:pointer;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;color:var(--ds-accent-primary-high, #00a0a2)}.sf-result-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:28px;padding:0 10px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));border-radius:8px;background:var(--ds-surface-default, #ffffff);cursor:pointer;font-family:inherit;font-size:12px;font-weight:500;color:var(--ds-content-high, rgba(0, 0, 0, .85))}
7
- `);var ce=require("react/jsx-runtime"),ec={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function In({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...a}){let i=Qi.useCallback(y=>{o?.(y),n?.(y)},[n,o]),p=Pi({...a,onSuccess:o||n?i:void 0,onExit:t}),{step:c,status:f}=p,m=St(p.recipient.trim()),h=en(p.amount,p.token.quantity.decimals),g="value"in h&&h.value<=p.balanceRaw,v=f==="submitting"||f==="confirming",x=c!=="result",w=ec[c]??"";return(0,ce.jsxs)("div",{className:ne("sf-root",r),"data-step":c,children:[(0,ce.jsxs)("header",{className:"sf-header",children:[x?(0,ce.jsx)("button",{type:"button",className:"sf-header-btn",onClick:p.back,"aria-label":"Back",children:(0,ce.jsx)(Xt,{size:24})}):(0,ce.jsx)("span",{className:"sf-header-btn","aria-hidden":!0}),(0,ce.jsx)("span",{className:"sf-header-title",children:w}),(0,ce.jsx)("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close",children:(0,ce.jsx)(kt,{size:24})})]}),c==="token"&&(0,ce.jsx)(Ki,{flow:p}),c==="recipient"&&(0,ce.jsx)($i,{flow:p}),c==="amount"&&(0,ce.jsx)(Bi,{flow:p}),c==="review"&&(0,ce.jsx)(qi,{flow:p}),c==="result"&&(0,ce.jsx)(Vi,{flow:p}),(0,ce.jsxs)("footer",{className:"sf-footer","data-step":c,children:[c==="recipient"&&(0,ce.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.submitRecipient,"data-disabled":!m||void 0,"aria-disabled":!m,children:"Next"}),c==="amount"&&(0,ce.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.submitAmount,"data-disabled":!g||void 0,"aria-disabled":!g,children:"Next"}),c==="review"&&(0,ce.jsxs)("div",{className:"sf-footer-row",children:[(0,ce.jsx)("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:p.back,disabled:v,children:"Cancel"}),(0,ce.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.confirmSend,disabled:v||!p.canSend||p.insufficientGas,children:v?"Sending...":"Send"})]}),c==="result"&&f==="success"&&(0,ce.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(p.txHash||void 0),children:"All done"}),c==="result"&&f==="error"&&(0,ce.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.retry,children:"Try Again"})]})]})}var Yi=z(require("@radix-ui/react-popover"),1),Zi=require("vaul");var tn=require("react/jsx-runtime");function Xi({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:a}=Wt(),i=n!=null,l=e??!0,p=i?n:(0,tn.jsxs)("button",{type:"button",className:ne("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[(0,tn.jsx)(ii,{size:o?14:16}),(0,tn.jsx)("span",{className:"wi-trigger-address",children:Ye(a)})]});return o?(0,tn.jsx)(Zi.Drawer.Trigger,{asChild:l,children:p}):(0,tn.jsx)(Yi.Trigger,{asChild:l,children:p})}var F=z(require("react"),1),Eo=z(require("@radix-ui/react-popover"),1),Fn=require("vaul");var wn=z(require("bignumber.js"),1);var Ji=require("@tanstack/react-query"),ea=require("react");var bo="user-balance";async function tc(e,t,n,o){let r=new URLSearchParams({networkId:`eip155:${t}`,account:n}),a=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:o});if(!a.ok)throw new Error(`Failed to fetch token balance: ${a.status}`);let i=await a.json();if(i.code!==200)throw new Error(`Token balance API error: ${i.code}`);return i.data}function At(e,t,n=!0){let o=ot[e],r=Me[e],a=[r.cross,r.bsc],i=(0,Ji.useQueries)({queries:a.map(f=>({queryKey:[bo,e,t,f],queryFn:({signal:m})=>tc(o,f,t,m),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),l=i.some(f=>f.isLoading),p=i.some(f=>f.isError);return{tokens:(0,ea.useMemo)(()=>{let f=[];for(let m of i)m.data&&f.push(...m.data);return f},[i]),isLoading:l,isError:p}}var wo=require("@tanstack/react-query"),ta=require("react");var nc="forge-holdings",oc="forge-token-image";async function rc(e,t,n){let o=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch forge holdings: ${o.status}`);let r=await o.json();if(!r.success)throw new Error("Forge holdings API error");return r.data.items}async function ic(e,t,n){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:n});if(!o.ok)return{address:t,image_url:""};let r=await o.json();return r.success?{address:t,image_url:r.data.token.image_url}:{address:t,image_url:""}}function na(e,t,n=!0){let o=pr[e],{data:r,...a}=(0,wo.useQuery)({queryKey:[nc,e,t],queryFn:({signal:i})=>rc(o,t,i),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:r??[],...a}}function oa(e,t,n=!0){let o=pr[e],r=(0,wo.useQueries)({queries:t.map(i=>({queryKey:[oc,e,i],queryFn:({signal:l})=>ic(o,i,l),enabled:n,staleTime:1/0}))});return{imageMap:(0,ta.useMemo)(()=>{let i=new Map;for(let l of r)l.data&&i.set(l.data.address,l.data.image_url);return i},[r])}}var ra=require("@tanstack/react-query"),ia=require("react");var xo="token-stats";function ut(e,t){return`${e}:${t.toLowerCase()}`}function Pt(e,t=!0){let n=ot[e],{data:o,...r}=(0,ra.useQuery)({queryKey:[xo,e],queryFn:async({signal:i})=>{let l=await fetch(`${n}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token stats: ${l.status}`);let p=await l.json();if(p.code!==200)throw new Error(`Token stats API error: ${p.code}`);return p},enabled:t,staleTime:3e4});return{statsMap:(0,ia.useMemo)(()=>{let i=new Map;if(!o?.data)return i;for(let l of o.data){let p=ut(l.chain_id,l.address);i.set(p,l)}return i},[o]),...r}}var aa=require("@tanstack/react-query"),sa=require("react");var ac="token-info";function fr(e,t){return`${t.toLowerCase()}_${e}`}function la(e,t=!0){let n=ot[e],{data:o,...r}=(0,aa.useQuery)({queryKey:[ac,e],queryFn:async({signal:i})=>{let l=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let p=await l.json();if(p.code!==200)throw new Error(`Token info API error: ${p.code}`);return p},enabled:t,staleTime:1/0});return{categoryMap:(0,sa.useMemo)(()=>{let i=new Map;if(!o?.data)return i;for(let l of o.data){let p=fr(l.chain_id,l.address);i.set(p,l.category)}return i},[o]),...r}}var ca=require("react"),vo=z(require("bignumber.js"),1);function da(e,t,n){let{tokens:o,isLoading:r}=At(e,t,n),{statsMap:a}=Pt(e,n);return(0,ca.useMemo)(()=>{let i=new vo.default(0);for(let f of o){let m=a.get(ut(f.chainId,f.address));if(!m)continue;let g=new vo.default(f.quantity.numeric).shiftedBy(-f.quantity.decimals).multipliedBy(new vo.default(m.price));g.isNaN()||(i=i.plus(g))}let l=i.toFixed(),{displayValue:p,isLowerBound:c}=hi(l);return{totalUsd:l,displayValue:p,isLowerBound:c,isLoading:r}},[o,a,r])}var Bs=require("qrcode.react");function Ze(e,t,n,o){if(!o||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let r;try{r=o(t,n)}catch(c){console.error("[dapp-ui] onOutlink threw:",c);return}let a=c=>{typeof window>"u"||window.open(c,"_blank","noopener,noreferrer")};if((c=>!!c&&(typeof c=="object"||typeof c=="function")&&typeof c.then=="function")(r)){let c=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,f=m=>{if(m===null){c?.close();return}let h=m??t;if(c)try{c.location.href=h}catch{c.close(),a(h)}else a(h)};r.then(f,m=>{console.error("[dapp-ui] onOutlink rejected:",m),c?.close()});return}let l=r;if(l===null)return;a(l??t)}var an=z(require("react"),1),as=require("vaul");var yo=require("react"),Ln=(0,yo.createContext)(null);function rt(){let e=(0,yo.useContext)(Ln);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var pa=require("vaul");var ur=require("react/jsx-runtime");function fa({asChild:e,children:t}){let{walletAddress:n}=rt(),o=t!=null,r=e??!0,a=o?t:(0,ur.jsx)("button",{type:"button",children:Ye(n)});return(0,ur.jsx)(pa.Drawer.Trigger,{asChild:r,children:a})}var An=require("vaul");var _e=z(require("react"),1),rs=require("@tanstack/react-query");var mt=require("react/jsx-runtime");function ua({size:e=22,className:t}){return(0,mt.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,mt.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function ma({size:e=22,className:t}){return(0,mt.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,mt.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,mt.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 Bt({size:e=12,className:t}){return(0,mt.jsxs)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[(0,mt.jsx)("path",{d:"M5 2H2.5A1.5 1.5 0 0 0 1 3.5V9.5A1.5 1.5 0 0 0 2.5 11H8.5A1.5 1.5 0 0 0 10 9.5V7",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,mt.jsx)("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,mt.jsx)("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}var nn=z(require("bignumber.js"),1),sc=/^(\d{4}-\d{2}-\d{2})/;function ga(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:r,cumulative:a}of e.map(i=>({key:sc.exec(i.reference_date)?.[1],cumulative:i.cumulative_earned})).filter(i=>!!i.key&&i.cumulative!=null).sort((i,l)=>i.key<l.key?-1:i.key>l.key?1:0))t.set(r,a),n=r;if(n===void 0)return;let o=new Date().toISOString().slice(0,10);return t.get(o)??t.get(n)}function ha(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function mn(e,t){let n=new nn.default(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,nn.default.ROUND_DOWN):n.toFormat(4,nn.default.ROUND_DOWN)}function mr(e){return mn(e,0)}function gn(e,t,n){let o=new nn.default(n||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let r=new nn.default(e||"0").shiftedBy(-t).times(o);return r.isFinite()?`$${r.toFormat(2,nn.default.ROUND_DOWN)}`:null}var ka=require("@tanstack/react-query"),gr=require("react");var ko={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"},ba={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},So={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"},wa={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},hn={dev:"https://stg-posa-api.crosstoken.io/api/v1",stage:"https://stg-posa-api.crosstoken.io/api/v1",production:"https://posa-api.crosstoken.io/api/v1"},En={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},xa={dev:`${En.dev}/portfolio`,stage:`${En.stage}/portfolio`,production:`${En.production}/portfolio`},va={dev:"https://stg-game-swap-api.cross.nexus/v1",stage:"https://stg-game-swap-api.cross.nexus/v1",production:"https://game-swap-api.cross.nexus/v1"},ya={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},Ut={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"};var lc="wp:reward-pools";function Co(e,t=!0){let n=ko[e],{data:o,...r}=(0,ka.useQuery)({queryKey:[lc,e],queryFn:async({signal:l})=>{let p=await fetch(`${n}/v1/pools`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Failed to fetch pools: ${p.status}`);let c=await p.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),a=(0,gr.useMemo)(()=>o?.data.pools.filter(l=>l.pool_type==="CrossPool")??[],[o]),i=(0,gr.useMemo)(()=>o?.data.pools.filter(l=>l.pool_type==="GamePool")??[],[o]);return{crossPools:a,gamePools:i,allPools:o?.data.pools??[],...r}}var Sa=require("@tanstack/react-query"),Ca=require("react");var cc="wp:user-deposits";function Ra(e,t,n=!0){let o=ko[e],r=n&&!!t,{data:a,...i}=(0,Sa.useQuery)({queryKey:[cc,e,t],queryFn:async({signal:p})=>{let c=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:p});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let f=await c.json();if(f.code!==200)throw new Error(`Deposits API error: ${f.code}`);return f},enabled:r,staleTime:0});return{depositMap:(0,Ca.useMemo)(()=>{let p=new Map;if(!a?.data.user_deposits)return p;for(let c of a.data.user_deposits)p.set(c.pool_address.toLowerCase(),c);return p},[a]),deposits:a?.data.user_deposits??[],...i}}var Na=require("@tanstack/react-query"),Ta=require("react");var dc="wp:token-info";function Ia(e,t=!0){let n=ot[e],o=Me[e].cross,{data:r,...a}=(0,Na.useQuery)({queryKey:[dc,e],queryFn:async({signal:c})=>{let f=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:c});if(!f.ok)throw new Error(`Failed to fetch token info: ${f.status}`);let m=await f.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:l}=(0,Ta.useMemo)(()=>{let c=new Map,f=new Map;if(!r?.data)return{byChainAddr:c,byChainSym:f};for(let m of r.data){let h=m.address.toLowerCase();c.set(`${m.chain_id}:${h}`,m),c.set(h,m);let g=m.symbol.replace(/^t/,"").toUpperCase(),v=`${m.chain_id}:${g}`;f.has(v)||f.set(v,m),f.has(g)||f.set(g,m)}return{byChainAddr:c,byChainSym:f}},[r]);return{getTokenImage:(c,f)=>{let m=c.toLowerCase(),h=i.get(`${o}:${m}`);if(h?.image)return h.image;let g=i.get(m);if(g?.image)return g.image;if(f){let v=f.replace(/^t/,"").toUpperCase(),x=l.get(`${o}:${v}`);if(x?.image)return x.image;let w=l.get(v);if(w?.image)return w.image}return""},...a}}var $t=require("react/jsx-runtime");function jt({title:e,icon:t,iconFit:n="cover",isEmpty:o,children:r}){return(0,$t.jsxs)("div",{className:"wp-svc-card",children:[(0,$t.jsxs)("div",{className:"wp-svc-card-head",children:[(0,$t.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:n}}),(0,$t.jsx)("span",{className:"wp-svc-card-title",children:e})]}),o?(0,$t.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,$t.jsx)("div",{className:"wp-svc-items",children:r})]})}var Ro=z(require("bignumber.js"),1),V=require("react/jsx-runtime"),pc="CROSS Rewards";function fc(e){return new Ro.default(e||"0").isGreaterThan(0)}function La(){let{env:e,walletAddress:t,onOutlink:n}=rt(),o=!!t,{allPools:r}=Co(e,o),{depositMap:a}=Ra(e,t,o),{getTokenImage:i}=Ia(e,o),l=(f,m)=>`${ba[e]}/rewards/${f.pool_address}?action=${m}`,p=`${Ut[e]}/reward.png`,c=r.filter(f=>{let m=a.get(f.pool_address.toLowerCase()),h=m?.deposited_amount??"0",g=m?.claimable_reward??"0";return!(new Ro.default(h).isZero()&&new Ro.default(g).isZero())});return(0,V.jsx)(jt,{title:pc,icon:p,isEmpty:c.length===0,children:c.map(f=>{let m=a.get(f.pool_address.toLowerCase()),h=m?.deposited_amount??"0",g=m?.claimable_reward??"0",v=l(f,"withdraw"),x=l(f,"claim"),w=i(f.deposit_token.address,f.deposit_token.symbol),y=f.reward_tokens[0],A=y?i(y.address,y.symbol):"",u=f.reward_tokens.map(Y=>Y.symbol),T=u.length>0?`${f.deposit_token.symbol}-${u.join("/")}`:f.deposit_token.symbol,S=y?mn(g,y.decimals):"0",P=y?.symbol??"Reward",B=gn(h,f.deposit_token.decimals,f.deposit_token.price),te=y?gn(g,y.decimals,y.price):null,O=!!m&&fc(g);return(0,V.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,V.jsxs)("div",{className:"wp-item-body",children:[(0,V.jsxs)("div",{className:"wp-item-line",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),(0,V.jsxs)("div",{className:"wp-svc-token",children:[(0,V.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),A&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:A,alt:""})]}),(0,V.jsx)("span",{children:T})]})]}),(0,V.jsxs)("div",{className:"wp-item-line",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,V.jsxs)("div",{className:"wp-svc-token",children:[w&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),(0,V.jsxs)("div",{className:"wp-svc-amount",children:[(0,V.jsx)("span",{className:"wp-svc-amount-main",children:mn(h,f.deposit_token.decimals)}),B&&(0,V.jsx)("span",{className:"wp-item-usd",children:B})]})]})]}),(0,V.jsxs)("div",{className:"wp-item-line",children:[(0,V.jsxs)("span",{className:"wp-item-label",children:["Claimable (",P,")"]}),(0,V.jsxs)("div",{className:"wp-svc-token",children:[A&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:A,alt:""}),(0,V.jsxs)("div",{className:"wp-svc-amount",children:[(0,V.jsx)("span",{className:"wp-svc-amount-main",children:S}),te&&(0,V.jsx)("span",{className:"wp-item-usd",children:te})]})]})]})]}),(0,V.jsxs)("div",{className:"wp-item-tags",children:[(0,V.jsxs)("a",{className:"wp-tag wp-tag--muted",href:v,target:"_blank",rel:"noopener noreferrer",onClick:Y=>Ze(Y,v,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:f,userDeposit:m}},n),children:[(0,V.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,V.jsx)(Bt,{size:12,className:"wp-tag-icon"})]}),(0,V.jsxs)("a",{className:"wp-tag wp-tag--mint","data-disabled":!O||void 0,"aria-disabled":!O||void 0,href:O?x:void 0,target:O?"_blank":void 0,rel:O?"noopener noreferrer":void 0,onClick:Y=>{if(!O){Y.preventDefault();return}Ze(Y,x,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:f,userDeposit:m}},n)},children:[(0,V.jsx)("span",{className:"wp-tag-label",children:"Claim"}),(0,V.jsx)(Bt,{size:12,className:"wp-tag-icon"})]})]})]},f.pool_address)})})}var br=z(require("react"),1);var Ea=require("@tanstack/react-query");var uc="wp:stake-info";function Aa(e,t,n=!0){let o=hn[e],r=n&&!!t,{data:a,...i}=(0,Ea.useQuery)({queryKey:[uc,e,t],queryFn:async({signal:p})=>{let c=await fetch(`${o}/stake/${t}`,{cache:"no-store",signal:p});if(!c.ok)throw new Error(`Stake info fetch failed: ${c.status}`);let f=await c.json();if(f.code!==0&&f.code!==200)throw new Error(`Stake info API error: ${f.code}`);return f},enabled:r,staleTime:0});return{stakeInfo:a?.data,...i}}var Pa=require("@tanstack/react-query");var mc="wp:stake-rewards",gc=31;function Ba(e,t,n=!0){let o=hn[e],r=n&&!!t,{data:a,...i}=(0,Pa.useQuery)({queryKey:[mc,e,t],queryFn:async({signal:l})=>{let p=await fetch(`${o}/rewards/${t}?limit=${gc}`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Stake rewards fetch failed: ${p.status}`);let c=await p.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake rewards API error: ${c.code}`);return c.data?.data??[]},enabled:r,staleTime:0});return{latestReward:a?.[0]??null,aprAccrued:ga(a),...i}}var Fa=require("@tanstack/react-query");var hc="wp:network-stats";function Ma(e,t=!0){let n=hn[e],{data:o,...r}=(0,Fa.useQuery)({queryKey:[hc,e],queryFn:async({signal:i})=>{let l=await fetch(`${n}/network/stats`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Network stats fetch failed: ${l.status}`);let p=await l.json();if(p.code!==0&&p.code!==200)throw new Error(`Network stats API error: ${p.code}`);return p},enabled:t,staleTime:0});return{networkStats:o?.data,...r}}var _a=require("@tanstack/react-query"),bc="wp:staking-onchain";function Oa(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...a}=(0,_a.useQuery)({queryKey:[bc,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:o,staleTime:0});return{onchain:r,...a}}var hr=require("react"),Da=z(require("bignumber.js"),1);function za(e){return e?.trim().toUpperCase()==="CROSS"}function Wa(e){return new Da.default(e||"0").isGreaterThan(0)}function No(e,t,n=!0){let{allPools:o}=Co(e,n),r=(0,hr.useMemo)(()=>{for(let c of o)for(let f of[c.deposit_token,...c.reward_tokens])if(za(f?.symbol)&&Wa(f.price))return f.price},[o]),a=n&&r===void 0,{tokens:i}=At(e,t,a),{statsMap:l}=Pt(e,a),p=Me[e].cross;return(0,hr.useMemo)(()=>{if(r)return r;let c=i.find(f=>f.chainId===p&&za(f.symbol));if(c){let f=l.get(ut(c.chainId,c.address));if(f&&Wa(f.price))return f.price}return"0"},[r,i,l,p])}var Ft=z(require("bignumber.js"),1),J=require("react/jsx-runtime"),wc="CROSS Staking";function Ha(e){if(!e)return"\u2014";let t=new Ft.default(e);return t.isFinite()?`${t.toFormat(2,Ft.default.ROUND_DOWN)}%`:"\u2014"}function Ga(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=rt(),r=!!t,{stakeInfo:a}=Aa(e,t,r),{latestReward:i,aprAccrued:l}=Ba(e,t,r),{networkStats:p}=Ma(e,r),{onchain:c}=Oa(t,o,r),f=No(e,t,r),m=`${Ut[e]}/cross-staking.png`,h=xa[e],g=a?.total_stake??"0",v=br.useMemo(()=>c?new Ft.default(c.earnedWei.toString()).shiftedBy(-18).toString(10):i?.cumulative_earned??a?.rewards_earned??"0",[c,i,a]),x=br.useMemo(()=>c?new Ft.default(c.stakedWei.toString()).shiftedBy(-18):new Ft.default(g),[c,g]),w=l!==void 0?new Ft.default(l):void 0,y=a?.days_since_first_stake,A=w!==void 0&&w.isFinite()&&x.isGreaterThan(0)&&y!==null&&y!==void 0?w.div(x).times(365).div(Math.max(1,y)).times(100):void 0,u=!(new Ft.default(g).isZero()&&new Ft.default(v).isZero()),T=En[e],S=gn(g,0,f),P=gn(v,0,f);return(0,J.jsx)(jt,{title:wc,icon:m,iconFit:"contain",isEmpty:!1,children:(0,J.jsxs)("article",{className:"wp-item","data-side":"stake",children:[(0,J.jsx)("div",{className:"wp-item-body",children:u?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Staked"}),(0,J.jsxs)("div",{className:"wp-svc-amount",children:[(0,J.jsxs)("span",{className:"wp-svc-amount-main",children:[mr(g)," CROSS"]}),S&&(0,J.jsx)("span",{className:"wp-item-usd",children:S})]})]}),(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Rewards Earned"}),(0,J.jsxs)("div",{className:"wp-svc-amount",children:[(0,J.jsxs)("span",{className:"wp-svc-amount-main",children:[mr(v)," CROSS"]}),P&&(0,J.jsx)("span",{className:"wp-item-usd",children:P})]})]}),(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"My APR"}),(0,J.jsx)("span",{children:Ha(A?.toString(10))})]})]}):(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Delegation APR"}),(0,J.jsx)("span",{children:Ha(p?.apr)})]})}),(0,J.jsx)("div",{className:"wp-item-tags",children:(0,J.jsxs)("a",{className:"wp-tag wp-tag--mint",href:u?h:T,target:"_blank",rel:"noopener noreferrer",onClick:B=>Ze(B,u?h:T,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a,networkStats:p}},n),children:[(0,J.jsx)("span",{className:"wp-tag-label",children:u?"Manage":"Stake Now"}),(0,J.jsx)(Bt,{size:12,className:"wp-tag-icon"})]})})]})})}var wr=z(require("react"),1);var Ua=require("@tanstack/react-query");var xc="wp:game-swap-pools";function $a(e,t,n=!0){let o=va[e],r=n&&!!t,{data:a,...i}=(0,Ua.useQuery)({queryKey:[xc,e,t],queryFn:async({signal:l})=>{let p=await fetch(`${o}/addresses/${t}/portfolio`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Game-swap portfolio fetch failed: ${p.status}`);return(await p.json()).pools??[]},enabled:r,staleTime:0});return{pools:a??[],...i}}var ja=require("@tanstack/react-query"),vc="wp:game-swap-lp-balances";function Va(e,t,n,o){let r=[...n].map(p=>p.toLowerCase()).sort(),a=!!o&&!!t&&r.length>0,{data:i,...l}=(0,ja.useQuery)({queryKey:[vc,e,t,r],queryFn:async()=>{if(!o)return{};let p=await o(r),c={};for(let[f,m]of Object.entries(p))c[f.toLowerCase()]=m;return c},enabled:a,staleTime:0});return{balances:i??{},...l}}var gt=z(require("bignumber.js"),1),oe=require("react/jsx-runtime"),yc="Game Swap LP",Ka=18,kc=new gt.default("0.0001");function qa(e){return e?.trim().toUpperCase()==="CROSS"}function Sc(e){return e&&e>0?e:Ka}function Cc(e){let t=qa(e.token_a?.symbol)&&!qa(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=Sc(t?e.token_a?.decimals:e.token_b?.decimals),r=new gt.default(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new gt.default(0):r.times(2)}function Rc(e,t){let n=e.token_a?.symbol?.trim()||"TOKEN",o=e.token_b?.symbol?.trim()||"CROSS",r=t?.decimals??Ka,a,i;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let l=new gt.default(t.balance.toString()),p=new gt.default(t.totalSupply.toString()),c=l.div(p);a=c.times(100);let f=c.times(Cc(e));if(f.isGreaterThan(0)){let m=new gt.default(e.cross_usd||"0");i=m.isGreaterThan(0)?`$${f.times(m).toFormat(2,gt.default.ROUND_DOWN)}`:`${f.toFormat(4,gt.default.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:n,tokenBSymbol:o,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:r,sharePercent:a,valueText:i}}function Qa(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=rt(),r=!!t,{pools:a}=$a(e,t,r),i=wr.useMemo(()=>a.map(h=>h.pair_address).filter(Boolean),[a]),{balances:l}=Va(e,t,i,o),p=`${Ut[e]}/dex.png`,c=!!o,f=wr.useMemo(()=>{let h=a.map(g=>Rc(g,l[g.pair_address?.toLowerCase()]));return c?h.filter(g=>g.lpAmountRaw?new gt.default(g.lpAmountRaw).shiftedBy(-g.lpDecimals).isGreaterThanOrEqualTo(kc):!1):h},[a,l,c]),m=h=>{let g=h.token_a?.address??h.pair_address;return`${ya[e]}/tokens/${g}?trade=deposit`};return(0,oe.jsx)(jt,{title:yc,icon:p,iconFit:"contain",isEmpty:f.length===0,children:f.map(h=>{let{pool:g}=h,v=m(g),x=`${h.tokenASymbol} / ${h.tokenBSymbol}`,w=g.token_a?.logo_url,y=g.token_b?.logo_url;return(0,oe.jsxs)("article",{className:"wp-item","data-side":"game-swap",children:[(0,oe.jsxs)("div",{className:"wp-item-body",children:[(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"Pool"}),(0,oe.jsxs)("div",{className:"wp-svc-token",children:[(0,oe.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&(0,oe.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),y&&(0,oe.jsx)("img",{className:"wp-svc-token-icon",src:y,alt:""})]}),(0,oe.jsx)("span",{children:x})]})]}),h.lpAmountRaw!==void 0&&(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"My LP"}),(0,oe.jsxs)("span",{children:[mn(h.lpAmountRaw,h.lpDecimals)," LP"]})]}),h.sharePercent!==void 0&&(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"Pool Share"}),(0,oe.jsxs)("span",{children:[h.sharePercent.toFormat(2,gt.default.ROUND_DOWN),"%"]})]}),h.valueText!==void 0&&(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"Value"}),(0,oe.jsx)("span",{children:h.valueText})]})]}),(0,oe.jsx)("div",{className:"wp-item-tags",children:(0,oe.jsxs)("a",{className:"wp-tag wp-tag--mint",href:v,target:"_blank",rel:"noopener noreferrer",onClick:A=>Ze(A,v,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:g}},n),children:[(0,oe.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,oe.jsx)(Bt,{size:12,className:"wp-tag-icon"})]})})]},g.pair_address)})})}var Mt=z(require("bignumber.js"),1),ts=require("react");var Ya=require("@tanstack/react-query");var Nc="wp:forge-pools";function Za(e,t,n=!0){let o=So[e],r=n&&!!t,{data:a,...i}=(0,Ya.useQuery)({queryKey:[Nc,e,t],queryFn:async()=>{let p=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!p.ok)throw new Error(`forge pools fetch failed: ${p.status}`);return(await p.json()).data?.items??[]},enabled:r,staleTime:0}),l=a??[];return{pools:l,isEmpty:l.length===0,...i}}var Xa=require("@tanstack/react-query"),Ja=require("react");var Tc="wp:forge-token-detail";async function Ic(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function es(e,t,n=!0){let o=So[e],r=(0,Xa.useQueries)({queries:t.map(l=>({queryKey:[Tc,e,l],queryFn:()=>Ic(o,l),enabled:n&&!!l,staleTime:3e4}))}),a=(0,Ja.useMemo)(()=>{let l=new Map;for(let p=0;p<r.length;p++){let c=r[p]?.data,f=t[p];c&&f&&l.set(f.toLowerCase(),c)}return l},[r,t]),i=r.some(l=>l.isLoading);return{detailMap:a,isLoading:i}}var ae=require("react/jsx-runtime"),Lc="Forge",ns=18,Ec="https://contents.crosstoken.io/wallet/token/images/FT.png";function Ac(e){if(!e||e==="0")return"0";let t=new Mt.default(e).shiftedBy(-ns);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Mt.default.ROUND_DOWN):t.toFormat(4,Mt.default.ROUND_DOWN)}function Pc(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 Bc(e,t,n){let o=new Mt.default(n||"0");if(!o.isGreaterThan(0))return null;let r=new Mt.default(e.total_supply||"0"),a=new Mt.default(e.lp_balance||"0"),i=new Mt.default(t?.reserve_b||"0").shiftedBy(-ns);if(!r.isGreaterThan(0)||!a.isGreaterThan(0)||!i.isGreaterThan(0))return null;let l=i.times(2),c=a.div(r).times(l).times(o);return c.isFinite()?`$${c.toFormat(2,Mt.default.ROUND_DOWN)}`:null}function os(){let{env:e,walletAddress:t,onOutlink:n}=rt(),o=!!t,{pools:r,isEmpty:a}=Za(e,t,o),i=(0,ts.useMemo)(()=>r.map(m=>m.token.address),[r]),{detailMap:l}=es(e,i,o&&i.length>0),p=No(e,t,o),c=m=>`${wa[e]}/forge/token/${m.token.address}`,f=`${Ut[e]}/forge.png`;return(0,ae.jsx)(jt,{title:Lc,icon:f,iconFit:"contain",isEmpty:a,children:r.map(m=>{let h=l.get(m.token.address.toLowerCase()),g=h?.image_url||h?.image||m.token.image||Ec,v=h?.symbol||m.token.symbol,x=c(m),w=Bc(m,h,p);return(0,ae.jsxs)("a",{className:"wp-item","data-side":"lp",href:x,target:"_blank",rel:"noopener noreferrer",onClick:y=>Ze(y,x,{category:"portfolio",origin:"portfolio-forge",payload:{pool:m,tokenDetail:h}},n),children:[(0,ae.jsxs)("div",{className:"wp-item-body",children:[(0,ae.jsxs)("div",{className:"wp-item-line",children:[(0,ae.jsx)("span",{className:"wp-item-label",children:"Asset"}),(0,ae.jsxs)("div",{className:"wp-svc-token",children:[(0,ae.jsx)("img",{className:"wp-svc-token-icon",src:g,alt:""}),(0,ae.jsx)("span",{children:v}),h?.name&&(0,ae.jsx)("span",{className:"wp-token-subtle",children:h.name})]})]}),(0,ae.jsxs)("div",{className:"wp-item-line",children:[(0,ae.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,ae.jsx)("div",{className:"wp-svc-token",children:(0,ae.jsxs)("div",{className:"wp-svc-amount",children:[(0,ae.jsx)("span",{className:"wp-svc-amount-main",children:Ac(m.lp_balance)}),w&&(0,ae.jsx)("span",{className:"wp-item-usd",children:w})]})})]}),(0,ae.jsxs)("div",{className:"wp-item-line",children:[(0,ae.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,ae.jsx)("span",{className:"wp-line-value",children:Pc(m.pool_ownership)})]})]}),(0,ae.jsx)("div",{className:"wp-item-tags",children:(0,ae.jsxs)("span",{className:"wp-tag wp-tag--muted",children:[(0,ae.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,ae.jsx)(Bt,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}W(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--ds-bg-default, #202530);--wp-header-bg: var(--ds-surface-default, #252b39);--wp-card: var(--ds-surface-medium, #252b39);--wp-control: #292f40;--wp-border: var(--ds-border-default, #292f40);--wp-panel-border: var(--ds-border-medium, rgba(255, 255, 255, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .28);--wp-text: var(--ds-content-highest, #ffffff);--wp-text-60: var(--ds-content-high, rgba(255, 255, 255, .85));--wp-text-40: var(--ds-content-medium, rgba(255, 255, 255, .65));--wp-text-30: var(--ds-content-low, rgba(255, 255, 255, .4));--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, rgba(0, 160, 162, .14));--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #9b8cef;--wp-claim-primary-text: #202530;--wp-claim-secondary-bg: var(--wp-control);--wp-claim-success: #00d4aa;--wp-claim-success-soft: rgba(0, 212, 170, .18);--wp-claim-error: #ff3aa3;--wp-claim-error-soft: rgba(255, 58, 163, .16)}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: var(--ds-bg-dim, #f5f7fa);--wp-header-bg: var(--ds-surface-default, #ffffff);--wp-card: var(--ds-surface-default, #ffffff);--wp-control: var(--ds-surface-medium, #f5f7fa);--wp-border: var(--ds-border-default, rgba(0, 0, 0, .07));--wp-panel-border: var(--ds-border-medium, rgba(0, 0, 0, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .15);--wp-text: var(--ds-content-highest, #000000);--wp-text-60: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-text-40: var(--ds-content-medium, rgba(0, 0, 0, .65));--wp-text-30: var(--ds-content-low, rgba(0, 0, 0, .4));--wp-chrome-text: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-card-shadow: none;--wp-tooltip-bg: #192023;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, #e7f9f8);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #7346f3;--wp-claim-primary-text: #ffffff;--wp-claim-secondary-bg: #ffffff;--wp-claim-success: #019d92;--wp-claim-success-soft: rgba(1, 157, 146, .15);--wp-claim-error: #e70077;--wp-claim-error-soft: rgba(231, 0, 119, .12)}.wp-fullscreen{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:73px;padding:24px;position:relative;border-bottom:1px solid var(--wp-border);background:var(--wp-header-bg);color:var(--wp-chrome-text);flex-shrink:0;box-sizing:border-box}.wp-fullscreen .wp-header{height:60px;min-height:60px;padding:11px 20px;border-bottom:none;background:transparent}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wp-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wp-header-edge{display:flex;align-items:center;width:24px;min-width:24px}.wp-header-edge--right{justify-content:flex-end}.wp-header-edge--right .wp-header-btn{position:absolute;top:24px;right:24px}.wp-header-spacer{display:block;width:24px;height:24px}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: hsl(221.3 24.6% 25.5%)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;text-align:center;color:var(--ds-content-highest, #000000);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-account-meta{display:flex;flex-direction:column;justify-content:center;min-width:0;gap:2px}.wp-header-wallet-name{min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:1.4;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-btn{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;padding:0;border:0;background:transparent;cursor:pointer;font:inherit}.wp-header-address{min-width:0;font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-copy{display:inline-flex;align-items:center;flex-shrink:0;color:var(--wp-text-40);transition:color .15s ease}.wp-header-address-btn:hover .wp-header-address-copy{color:var(--wp-text-60)}.wp-header-address-copy[data-copied=true]{color:var(--wp-mint)}.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:var(--wp-border) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:var(--wp-border);border-radius:4px}.wp-body-inner{padding:16px 16px 32px;display:flex;flex-direction:column;gap:32px}.wp-summary-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-summary-head{position:relative;display:flex;align-items:center;justify-content:flex-start;gap:4px}.wp-summary-label{font-size:14px;font-weight:400;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address{display:inline-flex;align-items:center;gap:8px;min-width:0}.wp-address-avatar{width:16px;height:16px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 68% 34%,#ff78d1 0 18%,transparent 19%),radial-gradient(circle at 34% 66%,#00d4aa 0 20%,transparent 21%),linear-gradient(135deg,#7346f3,#0488fc)}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40);flex-shrink:0}.wp-summary-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;background:#019d921a;color:var(--wp-mint);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;white-space:nowrap}.wp-summary-estimate{position:relative;display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.wp-estimate-info{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--wp-text-40);cursor:help}.wp-estimate-tooltip{position:absolute;top:calc(100% + 8px);left:0;right:auto;z-index:3;display:flex;flex-direction:column;gap:8px;width:min(280px,calc(100vw - 48px));padding:12px;border-radius:8px;background:var(--wp-tooltip-bg);box-shadow:0 12px 32px #0000003d;color:var(--wp-tooltip-text);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-estimate-tooltip-title{display:block;font-size:12px;font-weight:600;line-height:1.3}.wp-estimate-tooltip-group{display:flex;flex-direction:column;gap:4px}.wp-estimate-tooltip-item{display:block;color:#ffffffc7}.wp-estimate-tooltip-item:before{content:"- "}.wp-estimate-info:hover .wp-estimate-tooltip,.wp-estimate-info:focus .wp-estimate-tooltip,.wp-estimate-info:focus-visible .wp-estimate-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-total{font-family:var( --wp-total-font-family, Sora, Inter, system-ui, -apple-system, sans-serif );font-size:36px;font-weight:600;line-height:1.25;letter-spacing:0;color:var(--wp-text);margin:0}.wp-svc-card{display:flex;flex-direction:column;gap:12px;width:100%}.wp-svc-card-head{display:flex;align-items:center;gap:6px}.wp-svc-card-icon{width:24px;height:24px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-item{position:relative;display:flex;flex-direction:column;gap:20px;width:100%;padding:12px;border-radius:12px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box;color:inherit;text-decoration:none;cursor:pointer;outline:none;transition:opacity .15s ease}.wp-item+.wp-item{padding-top:12px;border-top:0}.wp-item:hover{opacity:.88}.wp-item-body{display:flex;flex-direction:column;gap:12px;min-width:0}.wp-order-head{display:flex;align-items:center;width:100%}.wp-item-line{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:21px;min-width:0}.wp-item-label{flex-shrink:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-30);white-space:nowrap}.wp-line-value,.wp-order-side{min-width:0;overflow:hidden;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-order-side--buy{color:var(--wp-mint)}.wp-order-side--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;min-height:21px}.wp-svc-token>span{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:16px;height:16px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-token-stack{display:inline-flex;align-items:center;justify-content:flex-end;width:29px;min-width:29px;overflow:visible}.wp-token-stack .wp-svc-token-icon+.wp-svc-token-icon{margin-left:-3.5px}.wp-token-subtle,.wp-item-usd{color:var(--wp-text-30)!important}.wp-svc-amount{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:1px;min-width:0}.wp-svc-amount-main{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.wp-svc-amount .wp-item-usd{font-size:12px;font-weight:500;line-height:1.35}.wp-order-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-order-token .wp-svc-token-icon{width:32px;height:32px}.wp-order-token-meta{display:flex;min-width:0;flex-direction:column;justify-content:center}.wp-order-token-symbol{overflow:hidden;color:var(--wp-text-60);font-size:14px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-order-token-pair{overflow:hidden;color:var(--wp-text-30);font-size:12px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-item-tags{display:flex;align-items:stretch;gap:8px;width:100%}.wp-tag{appearance:none;display:inline-flex;flex:1 1 0;align-items:center;justify-content:center;gap:0;min-width:0;min-height:33px;padding:6px 10px;border-radius:6px;border:0;background:var(--wp-control);font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);text-align:center;text-decoration:none;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}a.wp-tag,button.wp-tag{cursor:pointer}.wp-tag:hover{background:var(--wp-control);transform:none}.wp-tag:focus-visible{outline:2px solid var(--wp-mint);outline-offset:2px}.wp-tag[aria-disabled=true],.wp-tag[data-disabled]{cursor:default;opacity:.48;pointer-events:none}.wp-tag-label{display:inline-flex;align-items:center}.wp-tag-icon{display:none}.wp-tag:hover .wp-tag-icon{transform:none}.wp-tag--mint{color:var(--wp-mint);background:var(--wp-accent-soft)}.wp-tag--mint:hover{background:var(--wp-accent-soft)}.wp-tag--muted{color:var(--wp-text-40)}.wp-svc-empty{display:flex;align-items:center;justify-content:center;min-height:74px;padding:20px 16px;background:var(--wp-card);border-radius:12px;box-shadow:var(--wp-card-shadow, none);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-30);box-sizing:border-box}.wp-claim-overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:flex-end;justify-content:center;background:#00000094;box-sizing:border-box}.wp-claim-sheet{display:flex;flex-direction:column;width:100%;max-width:375px;max-height:calc(100% - 24px);overflow:hidden;border-radius:24px 24px 0 0;background:var(--wp-bg);color:var(--wp-text);box-shadow:0 -18px 48px #00000042;animation:wp-claim-slide-up .22s ease-out}@keyframes wp-claim-slide-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.wp-claim-grabber{display:flex;align-items:flex-start;justify-content:center;height:38px;min-height:38px;padding-top:12px;box-sizing:border-box}.wp-claim-grabber span{display:block;width:52px;height:5px;border-radius:999px;background:var(--wp-control)}.wp-claim-content{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;padding:20px;box-sizing:border-box}.wp-claim-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;flex-shrink:0}.wp-claim-icon--success{background:var(--wp-claim-success-soft);color:var(--wp-claim-success)}.wp-claim-icon--pending{background:#9b8cef29;color:var(--wp-claim-primary)}.wp-claim-icon--error{background:var(--wp-claim-error-soft);color:var(--wp-claim-error);font-size:30px;font-weight:600;line-height:1}.wp-claim-icon--token{background:#00d4aa29}.wp-claim-icon--token img{width:48px;height:48px;border-radius:50%;object-fit:cover}.wp-claim-icon--token span{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;background:var(--wp-mint);color:#101820;font-size:18px;font-weight:600}.wp-claim-spinner{width:36px;height:36px;border-radius:50%;border:3px solid rgba(155,140,239,.28);border-top-color:var(--wp-claim-primary);animation:wp-claim-spin .8s linear infinite}@keyframes wp-claim-spin{to{transform:rotate(360deg)}}.wp-claim-copy{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;text-align:center}.wp-claim-title{margin:0;font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text)}.wp-claim-desc{max-width:335px;margin:0;font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-40)}.wp-claim-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.wp-claim-error-message{margin:0;color:var(--wp-claim-error);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0}.wp-claim-reward-card{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:60px;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-reward-token{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-claim-reward-token img{width:28px;height:28px;object-fit:cover}.wp-claim-reward-token span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-claim-reward-symbol{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wp-text);font-size:18px;font-weight:600;line-height:1.3;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-reward-amount{flex-shrink:0;color:var(--wp-text);font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-account-row{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-height:40px}.wp-claim-account-row>span{flex-shrink:0;color:var(--wp-text-40);font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account{display:flex;align-items:center;gap:8px;min-width:0}.wp-claim-account strong{overflow:hidden;color:var(--wp-text);font-size:15px;font-weight:600;line-height:1.6;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-account-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 30% 28%,#d87aff 0 12%,transparent 13%),radial-gradient(circle at 68% 28%,#f0a1ff 0 12%,transparent 13%),radial-gradient(circle at 32% 70%,#b561e7 0 13%,transparent 14%),radial-gradient(circle at 70% 70%,#d4a2ff 0 13%,transparent 14%),radial-gradient(circle at 50% 50%,#8c4fc4 0 18%,transparent 19%),#4a315f;box-shadow:inset 0 0 0 3.37px var(--wp-control)}.wp-claim-divider{display:block;width:100%;height:1px;background:var(--wp-border)}.wp-claim-detail-list{display:flex;flex-direction:column;gap:8px;width:100%}.wp-claim-detail-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:20px}.wp-claim-detail-row>span{min-width:0;color:var(--wp-text-40);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-detail-row--sub>span:before{content:"";display:inline-block;width:3px;height:3px;margin:0 8px 3px;background:currentColor}.wp-claim-detail-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list{display:flex;flex-direction:column;gap:8px;width:100%;padding-bottom:8px}.wp-claim-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-list-item>span{flex-shrink:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--wp-text-40);white-space:nowrap}.wp-claim-list-item strong{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;overflow:hidden;color:var(--wp-text);font-size:14px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list-item img{width:16px;height:16px;border-radius:50%;flex-shrink:0}.wp-claim-hash{appearance:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);cursor:pointer;font:inherit}.wp-claim-hash svg{flex-shrink:0;color:var(--wp-text-60)}.wp-claim-gas-card{display:flex;flex-direction:column;gap:4px;width:100%;padding:14px 16px;border-radius:8px;border:1px solid var(--wp-border);background:var(--wp-card);box-sizing:border-box}.wp-claim-gas-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:28px}.wp-claim-gas-row>span{min-width:0;font-size:12px;font-weight:400;line-height:1.3;color:var(--wp-text-40)}.wp-claim-gas-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:12px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-gas-row--primary{min-height:32px}.wp-claim-gas-row--primary>span,.wp-claim-gas-row--primary strong{font-size:14px;color:var(--wp-text)}.wp-claim-fee-label{position:relative;display:inline-flex;align-items:center;text-decoration:underline dotted;text-underline-offset:3px;cursor:help;overflow:visible!important}.wp-claim-fee-tooltip{position:absolute;left:0;bottom:calc(100% + 8px);z-index:2;width:min(260px,calc(100vw - 64px));padding:10px 12px;border-radius:8px;background:var(--wp-tooltip-bg);color:var(--wp-tooltip-text);box-shadow:0 12px 32px #0000003d;font-size:11px;font-weight:400;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-claim-fee-label:hover .wp-claim-fee-tooltip,.wp-claim-fee-label:focus .wp-claim-fee-tooltip,.wp-claim-fee-label:focus-visible .wp-claim-fee-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-claim-actions{display:flex;align-items:center;gap:8px;width:100%}.wp-claim-primary,.wp-claim-secondary{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;height:52px;padding:0 24px;border:none;border-radius:40px;font-family:inherit;font-size:15px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap;cursor:pointer}.wp-claim-primary{background:var(--wp-claim-primary);color:var(--wp-claim-primary-text)}.wp-claim-primary:disabled{cursor:default;opacity:.72}.wp-claim-secondary{background:var(--wp-claim-secondary-bg, var(--wp-control));color:var(--wp-claim-primary)}.wp-claim-actions[data-count="2"] .wp-claim-primary{flex:1 1 0}.wp-claim-actions[data-count="2"] .wp-claim-secondary{flex:0 0 120px}.wp-claim-button-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(32,37,48,.28);border-top-color:var(--wp-claim-primary-text);animation:wp-claim-spin .8s linear infinite}.wp-claim-home-indicator{display:flex;align-items:flex-end;justify-content:center;height:34px;min-height:34px;padding-bottom:8px;box-sizing:border-box}.wp-claim-home-indicator span{display:block;width:134px;height:5px;border-radius:16px;background:var(--wp-text-40)}@media(max-width:359px){.wp-header{gap:12px;padding:0 12px}.wp-total{font-size:24px}.wp-body-inner{padding:0 12px 128px;gap:20px}.wp-svc-items,.wp-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.wi-drawer-content .wp-header,.wi-portfolio-body .wp-header{padding:16px}.wi-drawer-content .wp-header-edge--right .wp-header-btn,.wi-portfolio-body .wp-header-edge--right .wp-header-btn{top:16px;right:16px}
8
- `);var ee=require("react/jsx-runtime"),xr=5,Fc="wp:";function on({env:e,theme:t="light",walletAddress:n,walletName:o,onBack:r,showHeader:a=!0,variant:i="embed",className:l,onOutlink:p,lpBalanceReader:c,stakingRewardsReader:f}){let m=Be(e),h=!!n,g=(0,rs.useQueryClient)(),[,v]=_e.useState(xr),[x,w]=_e.useState(!1),[y,A]=_e.useState(!1),u=_e.useRef(void 0),T=_e.useCallback(()=>{g.invalidateQueries({predicate:_=>typeof _.queryKey[0]=="string"&&_.queryKey[0].startsWith(Fc)})},[g]),S=_e.useCallback(()=>{T(),w(!0),setTimeout(()=>w(!1),600),v(xr)},[T]);_e.useEffect(()=>{if(!h)return;let _=setInterval(()=>{v(re=>re<=1?(S(),xr):re-1)},1e3);return()=>clearInterval(_)},[h,S]);let P=_e.useCallback(()=>{r?.()},[r]),B=h?Et(m,n,{size:64}):void 0,te=_e.useCallback(async()=>{if(!(y||!n))try{await navigator.clipboard.writeText(n),A(!0),clearTimeout(u.current),u.current=setTimeout(()=>A(!1),2e3)}catch{}},[n,y]);_e.useEffect(()=>()=>clearTimeout(u.current),[]);let O=_e.useMemo(()=>({env:m,theme:t,open:!0,walletAddress:n,close:P,onOutlink:p,lpBalanceReader:c,stakingRewardsReader:f}),[m,t,n,P,p,c,f]),Y=(0,ee.jsxs)(ee.Fragment,{children:[a&&(0,ee.jsxs)("div",{className:"wp-header",children:[(0,ee.jsxs)("div",{className:"wp-header-account",children:[r&&(0,ee.jsx)("button",{type:"button",className:"wp-header-btn","aria-label":"Back",onClick:r,children:(0,ee.jsx)(ua,{})}),(0,ee.jsx)("span",{className:"wp-header-avatar","aria-hidden":!0,children:B&&(0,ee.jsx)("img",{src:B,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(o||n)&&(0,ee.jsxs)("div",{className:"wp-header-account-meta",children:[o&&(0,ee.jsx)("span",{className:"wp-header-wallet-name",title:o,children:o}),n&&(0,ee.jsxs)("button",{type:"button",className:"wp-header-address-btn",onClick:te,"aria-label":"Copy wallet address",children:[(0,ee.jsx)("span",{className:"wp-header-address",children:ha(n)}),(0,ee.jsx)("span",{className:"wp-header-address-copy","data-copied":y,children:y?(0,ee.jsx)(Zt,{size:14}):(0,ee.jsx)(Rn,{size:14})})]})]})]}),(0,ee.jsx)("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio",onClick:S,children:(0,ee.jsx)(ma,{className:x?"wp-spin-once":void 0})})]}),(0,ee.jsx)("div",{className:"wp-body",children:(0,ee.jsxs)("div",{className:"wp-body-inner",children:[(0,ee.jsx)(La,{}),(0,ee.jsx)(Ga,{}),(0,ee.jsx)(Qa,{}),(0,ee.jsx)(os,{})]})})]});return(0,ee.jsx)(Ln.Provider,{value:O,children:i==="none"?Y:(0,ee.jsx)("div",{className:ne(i==="fullscreen"?"wp-fullscreen":"wp-embed",l),"data-theme":t,children:Y})})}var rn=require("react/jsx-runtime");function is({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:a,lpBalanceReader:i,stakingRewardsReader:l}=rt();return(0,rn.jsxs)(An.Drawer.Portal,{children:[(0,rn.jsx)(An.Drawer.Overlay,{className:"wp-overlay"}),(0,rn.jsxs)(An.Drawer.Content,{className:ne("wp-fullscreen",e),"data-theme":n,children:[(0,rn.jsx)(An.Drawer.Title,{className:"wp-sr-only",children:"Portfolio"}),(0,rn.jsx)(on,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:a,lpBalanceReader:i,stakingRewardsReader:l})]})]})}var vr=require("react/jsx-runtime");function Mc({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:a,lpBalanceReader:i,stakingRewardsReader:l,children:p}){let c=Be(e),f=o!==void 0,[m,h]=an.useState(!1),g=f?o:m,v=an.useCallback(y=>{f||h(y),r?.(y)},[f,r]),x=an.useCallback(()=>v(!1),[v]),w=an.useMemo(()=>({env:c,theme:t,open:g,walletAddress:n,close:x,onOutlink:a,lpBalanceReader:i,stakingRewardsReader:l}),[c,t,g,n,x,a,i,l]);return(0,vr.jsx)(Ln.Provider,{value:w,children:(0,vr.jsx)(as.Drawer.Root,{direction:"bottom",open:g,onOpenChange:v,noBodyStyles:!0,children:p})})}var yr=Object.assign(Mc,{Trigger:fa,Content:is});var C=z(require("react"),1),sn=require("react-dom"),bt=z(require("bignumber.js"),1);var De=require("react/jsx-runtime");function ss({size:e=20,className:t}){return(0,De.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[(0,De.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),(0,De.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function ls({size:e=16,className:t}){return(0,De.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,De.jsx)("path",{d:"M2.667 8a5.333 5.333 0 1 0 1.562-3.771L2.667 5.79M2.667 2.667v3.124h3.124M8 5.333V8l1.667 1",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function cs({size:e=16,className:t}){return(0,De.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,De.jsx)("path",{d:"M2.667 4h4M9.333 4h4M6.667 2.667v2.666M2.667 12h4M9.333 12h4M9.333 10.667v2.666M2.667 8h1.666M7 8h6.333M4.333 6.667v2.666",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function ds({size:e=20,className:t}){return(0,De.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,De.jsx)("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function ps({size:e=16,className:t}){return(0,De.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:(0,De.jsx)("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function fs({size:e=12,className:t}){return(0,De.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,De.jsx)("path",{d:"M3.5 2 1.5 4l2 2M1.5 4h9M8.5 10l2-2-2-2M10.5 8h-9",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})})}var N=z(require("react"),1);var kr=z(require("bignumber.js"),1);function us(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ms(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,kr.default.ROUND_DOWN).toFixed()}function _c(e){return e.fromToken.symbol.toLowerCase()===e.toToken.symbol.toLowerCase()||e.fromToken.chainId===e.toToken.chainId&&e.fromToken.address.toLowerCase()===e.toToken.address.toLowerCase()}function Oc(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new kr.default(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:us(t)&&us(n)?e.lastChangedBy==="to"?{fromAmount:ms(r.multipliedBy(n).dividedBy(t))}:{toAmount:ms(r.multipliedBy(t).dividedBy(n))}:_c(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function gs({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):Oc(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}var hs=15,zc=18;function Wc(e){let t=e.replace(/[^\d.]/g,""),n=t.indexOf(".");n!==-1&&(t=t.slice(0,n+1)+t.slice(n+1).replace(/\./g,""));let o=t.indexOf(".");if(o===-1)return t.slice(0,hs);let r=t.slice(0,o).slice(0,hs),a=t.slice(o+1).slice(0,zc);return`${r}.${a}`}function Dc(e){let t=Number(e??"0");if(!Number.isFinite(t)||t<.1)return"1";let n=o=>Math.floor(o*100)/100;if(t<3){let o=n(t*3);return String(o<1?1:o)}return"10"}function bs(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("CROSS")?t.slice(1):t}function Hc(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let n=new Set([bs(e.symbol),bs(t.symbol)]);return n.has("CROSS")&&n.has("CROSSD")}function ht(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function To(e){return e[0]}function Sr(e,t,n,o){if(n&&!ht(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??To(e);let a=e.findIndex(l=>ht(l,t)),i=a>=0?e[a+1]:void 0;return i&&!ht(i,t)?i:e.find(l=>!ht(l,t))??t}function ws({fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:a}){return{fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:a}}function Cr(e){let t=e instanceof Error?e.message:typeof e=="string"?e:"",n=e&&typeof e=="object"&&"code"in e?String(e.code):"",o=t.toLowerCase();return n==="4001"||o.includes("user rejected")||o.includes("user denied")||o.includes("rejected the request")||o.includes("request rejected")}function xs(e,t){return Cr(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
9
- `)[0]?.trim()||t}function vs(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:a,approveBridge:i,history:l=[],initialSlippage:p="1",termsUrl:c,getQuote:f,submitBridge:m,onSubmitted:h,onSuccess:g,onFailed:v,onExit:x}=e,w=N.useMemo(()=>gs({getQuote:f,submitBridge:m}),[f,m]),[y,A]=N.useState("form"),[u,T]=N.useState(n??To(t)),[S,P]=N.useState(()=>Sr(t,n??To(t),o,r)),[B,te]=N.useState(""),[O,Y]=N.useState(""),[_,re]=N.useState("from"),[G,Ce]=N.useState(p),[pe,me]=N.useState(null),Ue=N.useMemo(()=>Hc(u,S),[u,S]),ge=N.useMemo(()=>Ue?"1":G==="auto"?Dc(pe?.priceImpact):G,[Ue,G,pe?.priceImpact]),[U,he]=N.useState(""),[de,$]=N.useState("idle"),[$e,ve]=N.useState(""),[Oe,ye]=N.useState(null),[it,Le]=N.useState([]),[_t,Ge]=N.useState(!1),[wt,Tt]=N.useState(!1),[be,Re]=N.useState(null),[Xe,Ee]=N.useState(!1),[Ne,we]=N.useState(null),[xt,je]=N.useState(null),[at,Ae]=N.useState(!1),[vt,yt]=N.useState(!1),ze=N.useRef(0),st=N.useRef(null),Je=N.useCallback(()=>{st.current&&(clearTimeout(st.current),st.current=null)},[]),fe=N.useCallback(I=>{Je(),je(I)},[Je]);N.useEffect(()=>Je,[Je]),N.useEffect(()=>{let I=t.find(ue=>ht(ue,u))??To(t),Z=I?r?.(I,t):void 0,j=Z?.find(ue=>ht(ue,S))??(Z?void 0:t.find(ue=>ht(ue,S)))??Sr(t,I,void 0,r);T(I),P(j)},[r,t,u,S]);let et=N.useCallback((I,Z)=>{let j=Wc(I);Z==="from"?te(j):Y(j),re(Z),he("")},[]),Pe=N.useCallback(()=>{ze.current+=1,te(""),Y(""),re("from"),me(null),he(""),ve(""),$("idle"),Re(null),Ee(!1),we(null),Ae(!1),fe(null)},[fe]),tt=N.useCallback(I=>{ht(I,u)||(T(I),P(Sr(t,I,void 0,r)),Pe())},[u,r,Pe,t]),Ve=N.useCallback(I=>{ht(I,S)||ht(I,u)||(P(I),Pe())},[u,Pe,S]),It=N.useMemo(()=>u?r?.(u,t)??t.filter(I=>!ht(I,u)):[],[u,r,t]),Lt=N.useCallback(()=>{u?.balance&&et(u.balance,"from")},[u?.balance,et]),lt=N.useCallback(()=>{!u||!S||(T(S),P(u),Pe())},[u,Pe,S]),Ot=N.useCallback(()=>{ze.current+=1,te(""),Y(""),re("from"),me(null),he(""),ve("")},[]);N.useEffect(()=>{if(!u||!S)return;if(!B&&!O){me(null),he(""),$("idle");return}let I=++ze.current,Z=ws({fromToken:u,toToken:S,fromAmount:B,toAmount:O,lastChangedBy:_,slippage:G});$(w.canQuote?"quoting":"idle"),(async()=>{try{let j=await w.getQuote(Z);if(ze.current!==I)return;j.fromAmount!==void 0&&_==="to"&&te(j.fromAmount),j.toAmount!==void 0&&_==="from"&&Y(j.toAmount),me(j.summary??null),he(j.error??"")}catch(j){if(ze.current!==I)return;he(j instanceof Error?j.message:"Failed to quote bridge.")}finally{ze.current===I&&$("idle")}})()},[B,u,_,w,G,O,S]);let ct=N.useCallback(()=>!u||!S?null:ws({fromToken:u,toToken:S,fromAmount:B,toAmount:O,lastChangedBy:_,slippage:ge}),[ge,B,u,_,O,S]),Te=N.useCallback(async(I,Z)=>{ve(""),Ae(!1),Ee(!1),$("submitting");try{if(!Z?.skipApprovalCheck&&a){let ue=await a(I);if(ue){Re(ue),we(I),$("idle");return}}Re(null),we(null),fe("processing");let j=await w.submitBridge(I);ye(j),$("success"),Le(ue=>[{id:j.txHash,timestamp:new Date().toISOString(),txHash:j.txHash,fromToken:j.fromToken,toToken:j.toToken,fromAmount:j.fromAmount,toAmount:j.toAmount,summary:pe??void 0,status:"pending"},...ue.filter(jn=>jn.txHash!==j.txHash)]),Ot(),yt(!0),fe(null),Ae(!0),h?.(j),g?.(j)}catch(j){if(fe(null),Cr(j)){$("idle");return}let ue=xs(j,"Failed to submit bridge.");ve(ue),$("error"),v?.({message:ue})}},[a,v,h,g,w,Ot,fe,pe]),k=N.useCallback(async()=>{if(U)return;let I=ct();if(I){if(!wt){we(I),Ge(!0);return}await Te(I)}},[ct,U,Te,wt]),q=N.useCallback(async()=>{let I=Ne??ct();I&&(Tt(!0),Ge(!1),await Te(I))},[ct,Ne,Te]),ie=N.useCallback(()=>{Ge(!1),we(null)},[]),qe=N.useCallback(async()=>{if(!(de==="submitting"||!be||!Ne||!i)){ve(""),$("submitting");try{await i(Ne,be),Re(null),$("idle"),Ee(!0)}catch(I){if(Cr(I)){$("idle");return}let Z=xs(I,"Failed to approve token.");ve(Z),$("error"),v?.({message:Z})}}},[be,i,v,Ne,Te,de]),Ke=N.useCallback(()=>{de!=="submitting"&&(Re(null),Ee(!1),we(null),$("idle"))},[de]),zt=N.useCallback(async()=>{de==="submitting"||!Ne||(Ee(!1),await Te(Ne,{skipApprovalCheck:!0}))},[Ne,Te,de]),zo=N.useCallback(()=>{Ae(!1)},[]),vn=N.useCallback(I=>{A(I),I==="history"&&yt(!1)},[]),nt=N.useCallback(()=>{if(y==="history"){vn("form");return}x?.()},[x,vn,y]),$n=N.useMemo(()=>[...l,...it.filter(I=>!l.some(Z=>Z.txHash===I.txHash))],[l,it]);return{step:y,setStep:vn,status:de,error:$e,quoteError:U,fromToken:u,toToken:S,tokens:t,availableToTokens:It,fromAmount:B,toAmount:O,lastChangedBy:_,slippage:G,effectiveSlippage:ge,slippageLocked:Ue,setSlippage:Ce,summary:pe,history:$n,submitted:Oe,canSubmit:w.canSubmit,termsOpen:_t,approvalInfo:be,approvalSuccessOpen:Xe,approveBridge:i,pendingSubmitInput:Ne,submitToast:xt,successDialogOpen:at,dismissSuccessDialog:zo,hasNewHistory:vt,termsUrl:c,setFromToken:T,setToToken:P,selectFromToken:tt,selectToToken:Ve,setAmount:et,setMax:Lt,swapTokens:lt,submit:k,confirmTerms:q,cancelTerms:ie,confirmApproval:qe,cancelApproval:Ke,continueAfterApproval:zt,back:nt}}W(`.bf-root{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .07));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));--bf-toast-bg: #1e232e;--bf-toast-color: rgba(255, 255, 255, .85);position:relative;display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden;background:var(--bf-bg);color:var(--ds-content-highest, #ffffff);font-family:inherit}[data-theme=dark].wi-popover-content .bf-root,[data-theme=dark].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].wi-popover-content .bf-root,[data-theme=light].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}.bf-root[data-view=history]{background:var(--ds-bg-dim, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid var(--bf-border);background:var(--ds-bg-default, var(--bf-bg));box-sizing:border-box}.bf-root[data-view=history] .bf-header{padding:24px;border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff)}.bf-header-btn{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.bf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header .bf-header-btn:last-child{position:absolute;top:24px;right:24px}.bf-header-title{position:absolute;left:50%;transform:translate(-50%);font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--bf-text-high);white-space:nowrap}.bf-root[data-view=history] .bf-header-title{color:var(--ds-content-highest, #000000)}.bf-body,.bf-history-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.bf-body{padding:24px}.bf-history-body{display:flex;flex-direction:column;gap:12px;padding:24px;background:var(--ds-bg-dim, #f5f7fa)}.bf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.bf-chip{display:inline-flex;align-items:center;gap:4px;min-height:33px;padding:6px 8px;border:0;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-chip:hover:not(:disabled){color:var(--bf-text-high);background:var(--bf-surface-hover)}.bf-chip:disabled{cursor:default}.bf-chip-history{position:relative}.bf-chip-dot{position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-swap-card{position:relative;display:flex;flex-direction:column;gap:12px;margin-bottom:12px}.bf-field-error{margin-top:-4px;color:var(--ds-system-red-default, #ff2b5f);font-size:13px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-amount-panel{display:flex;min-height:110px;flex-direction:column;gap:8px;padding:16px;border:1px solid transparent;border-radius:12px;background:var(--bf-surface);box-sizing:border-box;transition:border-color .2s ease}.bf-amount-panel:hover{border-color:var(--bf-border)}.bf-amount-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--bf-text-high);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-balance{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;color:var(--bf-text-low);font-size:12px;white-space:nowrap}.bf-amount-main{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-amount-input-wrap{display:flex;min-width:0;flex:1;flex-direction:column;gap:4px}.bf-amount-input{width:100%;min-width:0;padding:0;border:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;outline:none}.bf-amount-input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-amount-usd{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis}.bf-token-pill{display:inline-flex;flex-shrink:0;align-items:center;gap:6px;min-height:33px;padding:6px 8px 6px 6px;border:1px solid var(--bf-border);border-radius:9999px;background:var(--bf-bg);color:var(--bf-text-high);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-token-pill:hover:not(:disabled):not([data-locked=true]){background:var(--bf-surface-hover)}.bf-token-pill:disabled{cursor:default;opacity:.6}.bf-token-pill[data-locked=true]{cursor:default}.bf-token-icon{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font-size:11px;font-weight:700}.bf-token-icon[data-has-image=true]{background:transparent}.bf-token-icon img{width:100%;height:100%;border-radius:0;object-fit:cover}.bf-token-fallback{line-height:1}.bf-token-picker-overlay{--bf-bg: #1e232e;--bf-surface: rgba(255, 255, 255, .05);--bf-surface-hover: rgba(255, 255, 255, .08);--bf-border: rgba(255, 255, 255, .07);--bf-text-high: rgba(255, 255, 255, .85);--bf-text-medium: rgba(255, 255, 255, .65);--bf-text-low: rgba(255, 255, 255, .4);position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-token-picker-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-surface: rgba(18, 18, 18, .05);--bf-surface-hover: rgba(18, 18, 18, .08);--bf-border: rgba(18, 18, 18, .07);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-token-picker{display:flex;width:min(480px,calc(100vw - 48px));height:min(466px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);min-height:0;flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #0006;box-sizing:border-box}.bf-token-picker-handle{display:none}.bf-token-picker-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--bf-border);box-sizing:border-box}.bf-token-picker-head h3{margin:0;color:var(--bf-text-high);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-token-picker-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--bf-text-medium);cursor:pointer}.bf-token-picker-close:hover{color:var(--bf-text-high)}.bf-token-search{display:flex;min-height:48px;flex-shrink:0;align-items:center;gap:8px;margin:16px 24px;padding:12px 16px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, rgba(18, 18, 18, .05));color:var(--bf-text-low);box-sizing:border-box}.bf-token-search:focus-within{border-color:var(--ds-accent-primary-default, #00ceb2)}.bf-token-search input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-search input::placeholder{color:var(--bf-text-low)}.bf-token-list{display:flex;min-height:0;flex:1;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;padding:0 24px 24px;scrollbar-width:thin;box-sizing:border-box}.bf-token-row{position:relative;display:flex;width:100%;min-height:69px;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid transparent;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.bf-token-row:hover:not([data-selected=true]){background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row-left{display:inline-flex;min-width:0;align-items:center;gap:16px}.bf-token-meta{display:flex;min-width:0;flex-direction:column}.bf-token-symbol{overflow:hidden;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-name{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-row-right{display:flex;min-width:86px;max-width:42%;flex-shrink:0;flex-direction:column;align-items:flex-end}.bf-token-balance,.bf-token-price{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-token-balance{color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-token-price{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-row[data-selected=true] .bf-token-symbol{color:var(--bf-text-high)}.bf-token-row[data-selected=true] .bf-token-balance{color:var(--bf-text-high);font-size:16px}.bf-token-row[data-selected=true] .bf-token-price{color:var(--bf-text-low);font-size:14px}.bf-token-empty{padding:32px 16px;color:var(--bf-text-low);font-size:14px;font-weight:500;line-height:1.5;text-align:center}.bf-slippage-overlay{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-slippage-dialog{display:flex;width:min(480px,calc(100vw - 48px));height:auto;min-height:min(316px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);flex-direction:column;overflow:hidden;border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:24px;background:var(--ds-surface-default, #ffffff);color:var(--ds-content-highest, #000000);box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));box-sizing:border-box}.bf-slippage-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-slippage-head h3{margin:0;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-slippage-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-slippage-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-slippage-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:24px;padding:24px;box-sizing:border-box}.bf-slippage-desc{margin:0;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-controls{display:flex;flex-direction:column;gap:12px;width:100%}.bf-slippage-presets{display:flex;gap:8px;width:100%}.bf-slippage-preset{appearance:none;display:inline-flex;flex:1 1 0;min-width:0;min-height:48px;align-items:center;justify-content:center;padding:12px 8px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-preset:hover,.bf-slippage-preset[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-accent-primary-low, #e7f9f8)}.bf-slippage-custom{display:flex;min-height:48px;align-items:center;gap:8px;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));box-sizing:border-box}.bf-slippage-custom:focus-within,.bf-slippage-custom[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7)}.bf-slippage-custom input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--ds-content-high, rgba(0, 0, 0, .85));font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-custom input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-slippage-custom span:not(.bf-sr-only){flex-shrink:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-apply{appearance:none;margin-top:auto;width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on-primary, #ffffff);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-apply:hover{filter:brightness(.96)}.bf-slippage-apply:disabled{cursor:not-allowed;opacity:.5;filter:none}.bf-slippage-message{margin:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-message[data-variant=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-slippage-message[data-variant=error]{color:var(--ds-system-red-default, #da0b2e)}.bf-action-modal-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#040912b8;pointer-events:auto;box-sizing:border-box}.bf-action-modal-overlay[data-theme=light]{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .08));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .65));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .4))}.bf-action-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;align-items:center;gap:24px;padding:48px 24px 24px;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:#fff;box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-action-modal h3{width:100%;margin:0;color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;text-align:center;letter-spacing:0}.bf-action-modal-desc{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-terms-check-row{display:grid;width:100%;min-height:56px;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px 16px;border:none;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font-size:16px;font-weight:700;line-height:1.4;box-sizing:border-box;cursor:pointer;touch-action:manipulation;user-select:none}.bf-terms-check-button{appearance:none;display:grid;min-width:0;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-check-button:focus-visible .bf-terms-checkbox{outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-terms-checkbox{position:relative;display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;border:1px solid rgba(124,143,180,.72);border-radius:5px;background:transparent;box-sizing:border-box}.bf-terms-checkbox[data-checked=true]{border-color:var(--ds-accent-primary-default, #00ceb2);background:var(--ds-accent-primary-default, #00ceb2)}.bf-terms-checkbox[data-checked=true]:after{width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg) translate(1px,-1px)}.bf-terms-check-row a{position:relative;z-index:1;color:var(--ds-accent-primary-default, #00ceb2);font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}.bf-terms-privacy{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-action-primary,.bf-action-secondary{display:inline-flex;width:100%;min-height:56px;align-items:center;justify-content:center;padding:14px 16px;border:0;border-radius:12px;font:inherit;font-size:18px;font-weight:700;line-height:1.4;letter-spacing:0;cursor:pointer}.bf-action-primary{background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000)}.bf-action-primary:disabled{cursor:not-allowed;opacity:.35}.bf-action-primary[aria-busy=true]{gap:8px;opacity:1}.bf-action-button-spinner{width:18px;height:18px;border:2px solid rgba(0,0,0,.22);border-top-color:currentColor;border-right-color:currentColor;border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-action-secondary{background:var(--bf-surface);color:var(--bf-text-low)}.bf-action-secondary:disabled{cursor:not-allowed;opacity:.5}.bf-approve-address-box{display:flex;width:100%;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-approve-address-box>span{color:var(--bf-text-low);font-size:14px;font-weight:700;line-height:1.4}.bf-approve-address-box>div{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-approve-address-box strong{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:15px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.bf-copy-button{flex-shrink:0;min-width:48px;min-height:32px;padding:6px 10px;border:1px solid rgba(0,206,178,.65);border-radius:8px;background:transparent;color:var(--ds-accent-primary-default, #00ceb2);font:inherit;font-size:12px;font-weight:700;line-height:1.2;cursor:pointer}.bf-copy-button:disabled{cursor:not-allowed;opacity:.45}.bf-action-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:12px}.bf-approval-success-modal{gap:28px}.bf-success-mark{position:relative;display:inline-flex;width:96px;height:96px;flex-shrink:0;align-items:center;justify-content:center;border:12px solid rgba(0,206,178,.12);border-radius:999px;background:#00ceb2a8;box-shadow:0 0 0 10px #00ceb20f;box-sizing:border-box}.bf-success-mark:after{width:34px;height:18px;border:solid #ffffff;border-width:0 0 6px 6px;content:"";transform:rotate(-45deg) translate(2px,-3px)}.bf-status-toast{position:absolute;right:16px;bottom:14px;left:16px;z-index:5;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--bf-toast-bg, #1e232e);color:var(--bf-toast-color, rgba(255, 255, 255, .85));box-shadow:0 8px 24px #0000003d;box-sizing:border-box}.bf-status-toast-icon{display:inline-flex;width:28px;height:28px;flex-shrink:0;align-items:center;justify-content:center;border-radius:999px}.bf-status-spinner{width:20px;height:20px;border:3px solid rgba(255,255,255,.18);border-top-color:var(--ds-accent-primary-default, #00ceb2);border-right-color:var(--ds-accent-primary-default, #00ceb2);border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-status-check{position:relative;width:20px;height:20px;border-radius:999px;background:var(--ds-accent-primary-default, #00ceb2)}.bf-status-check:after{position:absolute;top:6px;left:5px;width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg)}.bf-status-toast-copy{display:flex;min-width:0;flex:1;flex-direction:column}.bf-status-toast-copy strong,.bf-status-toast-copy span{overflow:hidden;text-overflow:ellipsis}.bf-status-toast-copy strong{color:#fff;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-status-toast-copy span{color:var(--bf-toast-color, rgba(255, 255, 255, .85));font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em}.bf-status-toast[data-variant=success] .bf-status-toast-copy span{color:var(--ds-accent-primary-on-inverted, #00e8c9)}.bf-status-toast[data-variant=error]{border:1px solid rgba(255,43,95,.28);background:var(--bf-toast-bg, #1e232e)}.bf-status-toast[data-variant=error] .bf-status-toast-copy strong{color:#fff}.bf-status-error-mark{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:999px;background:var(--ds-system-red-default, #ff2b5f);color:#fff;font-size:14px;font-weight:700;line-height:1}.bf-status-toast[data-variant=error] .bf-status-toast-copy span{color:#ffffffe0}.bf-success-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#000000b8;pointer-events:auto;box-sizing:border-box}.bf-success-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-border: rgba(18, 18, 18, .08);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-success-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-success-head{display:flex;min-height:73px;align-items:center;justify-content:space-between;gap:16px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));box-sizing:border-box}.bf-success-head h3{min-width:0;margin:0;overflow:hidden;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.bf-success-close{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-success-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-success-body{display:flex;flex-direction:column;align-items:center;gap:24px;padding:40px 24px 24px;box-sizing:border-box}.bf-success-copy{display:flex;width:100%;flex-direction:column;align-items:center;gap:4px;color:var(--bf-text-medium);text-align:center}.bf-success-copy strong{color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;letter-spacing:0}.bf-success-copy span{color:var(--bf-text-medium);font-size:15px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-success-route{display:flex;align-items:center;justify-content:center;gap:12px}.bf-success-route .bf-token-icon{width:48px!important;height:48px!important;background:transparent;font-size:18px}.bf-success-route-arrow{color:var(--bf-text-low);font-size:24px;font-weight:500;line-height:1}.bf-success-ok{display:inline-flex;width:100%;min-height:48px;align-items:center;justify-content:center;padding:12px;border:0;border-radius:12px;background:#00b4b7e0;color:#fff;font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}@media(max-width:767px){.bf-success-body{padding:40px 24px 24px}.bf-success-copy strong{font-size:22px}.bf-success-copy span{font-size:14px}.bf-success-mark{width:88px;height:88px}.bf-success-route .bf-token-icon{width:44px!important;height:44px!important}}@keyframes bf-loading-spin{to{transform:rotate(360deg)}}.bf-swap-toggle{position:absolute;top:100px;left:50%;z-index:1;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);box-shadow:0 1px 5px #0000001f;cursor:pointer}.bf-swap-card[data-has-from-error=true] .bf-swap-toggle{top:132px}.bf-details{display:flex;flex-direction:column;gap:24px}.bf-exchange-rate{display:flex;width:100%;align-items:center;justify-content:center;gap:4px;padding:0 0 24px;border:0;background:transparent;color:var(--bf-text-low);font:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-exchange-rate:hover{color:var(--bf-text-medium)}.bf-detail-section,.bf-history-card{display:flex;flex-direction:column;gap:12px;padding:0;border-radius:12px;background:transparent;box-sizing:border-box}.bf-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-root[data-view=history] .bf-liquidity,.bf-root[data-view=history] .bf-detail-section,.bf-root[data-view=history] .bf-history-card{background:var(--ds-surface-default, #ffffff)}.bf-detail-section h3{margin:0;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-tx-fee-section{gap:12px}.bf-tx-fee-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-collapse-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin:0;padding:0;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.bf-detail-section[data-open=true] .bf-collapse-head{padding-bottom:12px;border-bottom:1px solid var(--bf-border)}.bf-collapse-chevron{flex-shrink:0;color:var(--bf-text-low);transition:transform .2s ease}.bf-detail-section[data-open=true] .bf-collapse-chevron{transform:rotate(180deg)}.bf-collapse-body{display:flex;flex-direction:column;gap:14px}.bf-root[data-view=history] .bf-detail-section[data-open=true] .bf-collapse-head{border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07))}.bf-root[data-view=history] .bf-collapse-chevron{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-tx-fee-total{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--bf-text-medium);font-size:14px;font-weight:600;line-height:1.4;text-align:right}.bf-tx-fee-total>span[data-delegated=true]{text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:currentColor}.bf-fee-delegated{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:2px 8px;border-radius:6px;background:#379cff2e;color:#4eb3ff;font-size:10px;font-weight:500;line-height:1.3;white-space:nowrap}.bf-tx-fee-token{width:16px;height:16px;flex-shrink:0;border-radius:999px;object-fit:cover}.bf-info-card{gap:14px}.bf-info-section{display:flex;flex-direction:column;gap:10px}.bf-info-section+.bf-info-section{padding-top:2px}.bf-info-section h4{margin:0;color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5}.bf-root[data-view=history] .bf-detail-section h3,.bf-root[data-view=history] .bf-info-section h4{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-info-rows{display:flex;flex-direction:column;gap:8px}.bf-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-liquidity-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-info-label{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--bf-text-low)}.bf-tree-marker{width:10px;flex-shrink:0;color:var(--bf-text-low)}.bf-info-value{min-width:0;color:var(--bf-text-medium);text-align:right}.bf-info-route,.bf-info-value-token{display:inline-flex;align-items:center;gap:4px}.bf-info-route .bf-token-icon,.bf-info-value-token .bf-token-icon{flex-shrink:0}.bf-info-route-arrow{color:var(--bf-text-medium)}.bf-root[data-view=history] .bf-info-route-arrow{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-root[data-view=history] .bf-info-label,.bf-root[data-view=history] .bf-liquidity-head,.bf-root[data-view=history] .bf-tree-marker{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-root[data-view=history] .bf-info-value{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-root[data-view=history] .bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-root[data-view=history] .bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-liquidity-status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.4;white-space:nowrap}.bf-liquidity-status:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}.bf-liquidity-status[data-status=normal],.bf-liquidity-status:not([data-status]){background:#00ceb21f;color:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=normal]:before,.bf-liquidity-status:not([data-status]):before{background:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=low]{background:#e56f001f;color:#e56f00}.bf-liquidity-status[data-status=low]:before{background:#e56f00}.bf-liquidity-status[data-status=rebalancing]{background:#da0b2e1a;color:#da0b2e}.bf-liquidity-status[data-status=rebalancing]:before{background:#da0b2e}.bf-liquidity-track{height:8px;overflow:hidden;border-radius:999px;background:var(--bf-surface-hover)}.bf-liquidity-track span{display:block;height:100%;border-radius:inherit;background:var(--ds-accent-primary-default, #00ceb2)}.bf-error{padding:12px;border-radius:12px;background:#da0b2e1f;color:var(--ds-system-red-default, #da0b2e);font-size:13px;line-height:1.4}.bf-footer{display:flex;flex-shrink:0;flex-direction:column;align-items:center;gap:10px;padding:12px 24px 24px;background:var(--ds-bg-default, var(--bf-bg))}.bf-next{width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-next:disabled{cursor:default;opacity:.6}.bf-powered{display:inline-flex;align-items:center;gap:3px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-decoration:none}.bf-powered:focus-visible{border-radius:4px;outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-powered-brand{text-decoration:underline;text-underline-offset:2px}.bf-history-tabs{display:flex;align-items:center;gap:4px;width:100%}.bf-history-tab{position:relative;display:inline-flex;min-height:37px;align-items:center;justify-content:center;padding:8px 12px;border:0;background:transparent;color:var(--ds-content-lowest, rgba(0, 0, 0, .25));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;cursor:pointer}.bf-history-tab[data-active=true]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-history-tab[data-active=true]:after{position:absolute;right:8px;bottom:0;left:8px;height:3px;border-radius:999px;background:var(--ds-accent-primary-high, #00a0a2);content:""}.bf-history-tab-dot{position:absolute;top:8px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-history-list{display:flex;flex-direction:column;gap:12px}.bf-history-item{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-history-item-head,.bf-history-meta,.bf-history-route,.bf-history-route-token{display:inline-flex;align-items:center}.bf-history-item-head{justify-content:space-between;gap:12px;width:100%}.bf-history-status{display:inline-flex;min-height:24px;align-items:center;justify-content:center;padding:3px 8px;border-radius:4px;background:var(--ds-system-orange-low, #fcf5e9);color:var(--ds-system-orange-high, #e56f00);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;white-space:nowrap}.bf-history-status[data-status=completed]{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.bf-history-status[data-status=failed]{background:var(--ds-system-red-low, rgba(218, 11, 46, .12));color:var(--ds-system-red-default, #da0b2e)}.bf-history-time{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-align:right;white-space:nowrap}.bf-history-item-body{display:flex;flex-direction:column;gap:4px}.bf-history-amount{color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-meta{justify-content:space-between;gap:12px;min-width:0}.bf-history-usd{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route{justify-content:flex-end;gap:4px;min-width:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-route-token{gap:4px;min-width:0}.bf-history-route-token span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route-arrow{flex-shrink:0;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-empty{padding:32px 16px;text-align:center;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:14px}.bf-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:767px){.bf-token-picker-overlay{align-items:flex-end;padding:0}.bf-token-picker{width:100%;max-height:82dvh;min-height:min(520px,82dvh);border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}.bf-token-picker-handle{display:block;width:40px;height:4px;flex-shrink:0;align-self:center;margin:10px 0 0;border-radius:999px;background:#ffffff38}.bf-token-picker-head{min-height:55px;padding:12px 56px 16px 24px;border-bottom:0}.bf-token-picker-close{top:13px}.bf-token-search{margin:0 16px 12px}.bf-token-list{padding:0 16px 16px}.bf-slippage-overlay{align-items:flex-end;padding:0}.bf-slippage-dialog{width:100%;height:auto;min-height:316px;max-height:82dvh;border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}}.wi-drawer-content .bf-header{padding:16px}.wi-drawer-content .bf-header .bf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .bf-body,.wi-drawer-content .bf-history-body{padding:16px}
10
- `);var s=require("react/jsx-runtime"),Ns=C.createContext(void 0);function bn(){return C.useContext(Ns)}function Gc(e){let[t,n]=C.useState(void 0);return C.useEffect(()=>{let o=e.current;if(!o)return;let r=()=>{let i=o.closest("[data-theme]");n(i?.getAttribute("data-theme")??void 0)};r();let a=new MutationObserver(r);return a.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>a.disconnect()},[e]),t}var ys=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],Uc={dev:"https://dev.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://crossdefi.io"},$c=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function jc(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function ks(e){let t=e.replace(/[^\d.]/g,""),[n="",...o]=t.split("."),r=o.join("");return o.length===0?n:`${n}.${r.slice(0,2)}`}function Vc(e){return`${e.chainId}:${e.address.toLowerCase()}`}function Ts(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function Ss(e,t){let n=Number(e||"0"),o=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(n)?n*o:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function qc(e,t=6){if(!e)return e;let[n,o=""]=e.split(".");if(!o)return n;let r=o.slice(0,t).replace(/0+$/,"");return r?`${n}.${r}`:n}function Kc(e,t){if(!t)return!1;let n=new bt.default(e||"0"),o=new bt.default(t.balance||"0");return!n.isFinite()||!o.isFinite()?!1:n.isGreaterThan(o)}function Qc(e){if(e.priceUsd===void 0)return null;let t=new bt.default(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function Yc(e){if(e.priceUsd===void 0)return null;let t=new bt.default(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function Is(e){if(!e.isFinite()||e.isNaN())return"0";let n=e.decimalPlaces(6,bt.default.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),a=new bt.default(o||"0").toFormat(0);return r?`${a}.${r}`:a}function Zc(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function Xc(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=o=>o.toString().padStart(2,"0");return[`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`,`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`].join(" ")}function Jc(e){let t=new bt.default(e||"0");return!t.isFinite()||t.isNaN()?e||"0":Is(t)}function ed(e,t){if(t?.priceUsd===void 0)return null;let n=new bt.default(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function Lo(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function td(e,t){return t==="all"?!0:Lo(e)===t}function nd(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function Cs(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function Ls(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Es(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":Ls(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function As(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function Io(e){return!e||e==="0"||Number(e)===0}function od(e){let t=e.trim().toLowerCase();return t?t.startsWith("minimum ")?{from:e}:t.startsWith("available ")&&t.includes("or more")?{to:e}:t.includes("insufficient balance")||t.includes("not enough balance")||t.includes("exceeds balance")||t.includes("insufficient network fee")?{from:e}:t.includes("insufficient liquidity")||t.includes("not enough liquidity")?{to:e}:{}:{}}function rd(e){let t=e.fromToken,n=e.toToken,o=Es(t,n),r=e.fromAmount||"0",a=e.toAmount||"0",i=o!==void 0&&!As(o),l=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:i?[{label:"Route",value:t&&n?`${Cs(t.chainId)} \u2192 ${Cs(n.chainId)}`:"-"},{label:"Validator Fee",value:Io(r)?"0":"Free",tone:Io(r)?"default":"accent"},{label:"Network Fee",value:Io(r)?"0":"Free",tone:Io(r)?"default":"accent"}]:void 0,swapInfo:l?[t&&n?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:n.symbol,iconUrl:n.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:r,valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Swap Fee",value:"0",valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Out Amount",value:a,valueToken:n?{symbol:n.symbol,iconUrl:n.iconUrl}:void 0}]:void 0,txFee:[{label:"Priority Fee Per Gas",value:"0 Gwei"},{label:"Max Fee Per Gas",value:"0 Gwei"},{label:"Gas Limit",value:"0"}],txFeeInfo:{estTxFee:"0",isDelegateFee:!1}}}function Pn({token:e,size:t=20}){let n=e?.iconUrl;return(0,s.jsx)("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?(0,s.jsx)("img",{src:n,alt:"",width:t,height:t,draggable:!1}):(0,s.jsx)("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function Rs({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:a,locked:i=!1}){return(0,s.jsxs)("section",{className:"bf-amount-panel",children:[(0,s.jsxs)("div",{className:"bf-amount-head",children:[(0,s.jsx)("span",{children:e}),(0,s.jsxs)("span",{className:"bf-balance",children:[Ts(t?.balance??"0")," ",t?.symbol??""]})]}),(0,s.jsxs)("div",{className:"bf-amount-main",children:[(0,s.jsxs)("label",{className:"bf-amount-input-wrap",children:[(0,s.jsxs)("span",{className:"bf-sr-only",children:[e," amount"]}),(0,s.jsx)("input",{type:"text",inputMode:"decimal",value:n,onChange:l=>r(l.target.value),placeholder:"0",className:"bf-amount-input"}),(0,s.jsx)("span",{className:"bf-amount-usd",children:o})]}),(0,s.jsxs)("button",{type:"button",className:"bf-token-pill",onClick:i?void 0:a,disabled:!i&&!a,"data-locked":i?"true":void 0,"aria-label":`Select ${e.toLowerCase()} token`,children:[(0,s.jsx)(Pn,{token:t}),(0,s.jsx)("span",{children:t?.symbol??"Select"}),!i&&(0,s.jsx)(Jt,{size:16})]})]})]})}function id({flow:e,side:t,onClose:n}){let o=C.useId(),[r,a]=C.useState(""),[i,l]=C.useState(null),p=t==="from"?e.fromToken:e.toToken;C.useEffect(()=>{l(document.body)},[]),C.useEffect(()=>{let g=v=>{v.key==="Escape"&&n()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]);let c=C.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),f=C.useMemo(()=>{let g=r.trim().toLowerCase();return g?c.filter(v=>v.symbol.toLowerCase().includes(g)||v.name.toLowerCase().includes(g)):c},[r,c]),m=C.useCallback(g=>{t==="from"?e.selectFromToken(g):e.selectToToken(g),n()},[e,n,t]);if(!i)return null;let h=bn();return(0,sn.createPortal)((0,s.jsx)("div",{className:"bf-token-picker-overlay","data-theme":h,role:"presentation",onMouseDown:g=>{g.target===g.currentTarget&&n()},children:(0,s.jsxs)("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[(0,s.jsx)("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),(0,s.jsxs)("header",{className:"bf-token-picker-head",children:[(0,s.jsx)("h3",{id:o,children:"Select a token"}),(0,s.jsx)("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:(0,s.jsx)(kt,{size:24})})]}),(0,s.jsxs)("label",{className:"bf-token-search",children:[(0,s.jsx)(ss,{size:20}),(0,s.jsx)("span",{className:"bf-sr-only",children:"Search tokens"}),(0,s.jsx)("input",{value:r,onChange:g=>a(g.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),(0,s.jsxs)("div",{className:"bf-token-list",children:[f.map(g=>{let v=Ls(g,p),x=v?Yc(g):Qc(g);return(0,s.jsxs)("button",{type:"button",className:"bf-token-row","data-selected":v?"true":"false",onClick:()=>m(g),children:[(0,s.jsxs)("span",{className:"bf-token-row-left",children:[(0,s.jsx)(Pn,{token:g,size:40}),(0,s.jsxs)("span",{className:"bf-token-meta",children:[(0,s.jsx)("span",{className:"bf-token-symbol",children:g.symbol}),!v&&(0,s.jsx)("span",{className:"bf-token-name",children:g.name})]})]}),(0,s.jsxs)("span",{className:"bf-token-row-right",children:[(0,s.jsxs)("span",{className:"bf-token-balance",children:[Ts(g.balance),v?null:` ${g.symbol}`]}),x&&(0,s.jsx)("span",{className:"bf-token-price",children:x})]})]},Vc(g))}),f.length===0&&(0,s.jsx)("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),i)}function ad({flow:e,onClose:t}){let n=C.useId(),[o,r]=C.useState(null),a=ys.find(x=>x.value===e.slippage),[i,l]=C.useState(e.slippage&&!a?e.slippage:""),p=i.trim()!==""&&i.trim()!==".",c=p?Number(i):NaN,f=Number.isFinite(c)&&c>50,m=Number.isFinite(c)&&c>5&&!f,h=x=>{e.setSlippage(x),t()},g=()=>{!p||f||(e.setSlippage(ks(i)),t())};if(C.useEffect(()=>{r(document.body)},[]),C.useEffect(()=>{let x=w=>{w.key==="Escape"&&t()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[t]),!o)return null;let v=bn();return(0,sn.createPortal)((0,s.jsx)("div",{className:"bf-slippage-overlay","data-theme":v,role:"presentation",onMouseDown:x=>{x.target===x.currentTarget&&t()},children:(0,s.jsxs)("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,s.jsxs)("header",{className:"bf-slippage-head",children:[(0,s.jsx)("h3",{id:n,children:"Slippage Settings"}),(0,s.jsx)("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:(0,s.jsx)(kt,{size:24})})]}),(0,s.jsxs)("div",{className:"bf-slippage-body",children:[(0,s.jsx)("p",{className:"bf-slippage-desc",children:"The maximum price difference you are willing to accept before the transaction is reverted. Higher slippage increases the chance of execution but may result in a worse price."}),(0,s.jsxs)("div",{className:"bf-slippage-controls",children:[(0,s.jsx)("div",{className:"bf-slippage-presets",children:ys.map(x=>(0,s.jsx)("button",{type:"button",className:"bf-slippage-preset","data-selected":!p&&e.slippage===x.value?"true":"false",onClick:()=>h(x.value),children:x.label},x.value))}),(0,s.jsxs)("label",{className:"bf-slippage-custom","data-selected":p?"true":"false",children:[(0,s.jsx)("span",{className:"bf-sr-only",children:"Custom slippage percent"}),(0,s.jsx)("input",{value:i,onChange:x=>{l(ks(x.target.value))},onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),g())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),(0,s.jsx)("span",{"aria-hidden":"true",children:"%"})]})]}),f?(0,s.jsx)("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):m?(0,s.jsx)("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,p&&(0,s.jsx)("button",{type:"button",className:"bf-slippage-apply",onClick:g,disabled:f,children:"Apply"})]})]})}),o)}function sd({flow:e}){let t=C.useId(),[n,o]=C.useState(!1),[r,a]=C.useState(null),i=bn();return C.useEffect(()=>{a(document.body)},[]),C.useEffect(()=>{let l=p=>{p.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!r||!e.termsOpen?null:(0,sn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",onPointerDown:l=>{l.target===l.currentTarget&&e.cancelTerms()},children:(0,s.jsxs)("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,s.jsx)("h3",{id:t,children:"Agree to Terms of Service"}),(0,s.jsx)("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),(0,s.jsxs)("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[(0,s.jsxs)("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,onClick:()=>o(l=>!l),children:[(0,s.jsx)("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"}),(0,s.jsx)("span",{children:"Agree to Terms of Use"})]}),e.termsUrl&&(0,s.jsx)("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]}),(0,s.jsx)("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),(0,s.jsx)("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,children:"Confirm"})]})}),r)}function ld({value:e,disabled:t=!1}){let[n,o]=C.useState(!1);return(0,s.jsx)("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{o(!0),window.setTimeout(()=>o(!1),1200)})},children:n?"OK":"Copy"})}function cd({flow:e,approval:t}){let n=C.useId(),[o,r]=C.useState(null),a=bn();if(C.useEffect(()=>{r(document.body)},[]),C.useEffect(()=>{let p=c=>{e.status!=="submitting"&&c.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e]),!o)return null;let i=e.status==="submitting"||!e.approveBridge,l=e.status==="submitting";return(0,sn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",children:(0,s.jsxs)("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,s.jsxs)("h3",{id:n,children:["Approve ",t.token.symbol]}),(0,s.jsx)(Pn,{token:t.token,size:72}),(0,s.jsxs)("div",{className:"bf-approve-address-box",children:[(0,s.jsx)("span",{children:"Token Address"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:t.tokenAddress}),(0,s.jsx)(ld,{value:t.tokenAddress,disabled:l})]})]}),(0,s.jsxs)("div",{className:"bf-action-buttons",children:[(0,s.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),(0,s.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:i,"aria-busy":l,children:[l&&(0,s.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,s.jsx)("span",{children:l?"Approving...":"Approve"})]})]})]})}),o)}function dd({flow:e}){let t=C.useId(),[n,o]=C.useState(null),r=bn();return C.useEffect(()=>{o(document.body)},[]),C.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=i=>{i.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.approvalSuccessOpen?null:(0,sn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:(0,s.jsxs)("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,s.jsx)("h3",{id:t,children:"Approval Success"}),(0,s.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,s.jsxs)("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",(0,s.jsx)("br",{}),"Please continue to the next step."]}),(0,s.jsxs)("div",{className:"bf-action-buttons",children:[(0,s.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,children:"Continue"})]})]})}),n)}function pd({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,a]=C.useState(!1),i=C.useMemo(()=>{let c=new bt.default(e||"0"),f=new bt.default(t||"0");return!c.isFinite()||!f.isFinite()||c.lte(0)||f.lte(0)?null:r?c.dividedBy(f):f.dividedBy(c)},[e,r,t]);if(!i||!n||!o||n.symbol===o.symbol)return null;let l=r?o.symbol:n.symbol,p=r?n.symbol:o.symbol;return(0,s.jsxs)("button",{type:"button",className:"bf-exchange-rate",onClick:()=>a(c=>!c),children:[(0,s.jsxs)("span",{children:["1 ",l]}),(0,s.jsx)(fs,{size:12}),(0,s.jsxs)("span",{children:[Is(i)," ",p]})]})}function fd({flow:e}){return e.submitToast?(0,s.jsxs)("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[(0,s.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,s.jsx)("span",{className:"bf-status-spinner"})}),(0,s.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,s.jsx)("strong",{children:"Transaction Processing"}),(0,s.jsx)("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function ud({message:e}){let[t,n]=C.useState(!1);return C.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:(0,s.jsxs)("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[(0,s.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,s.jsx)("span",{className:"bf-status-error-mark",children:"!"})}),(0,s.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,s.jsx)("strong",{children:"Error"}),(0,s.jsx)("span",{children:e})]})]})}function md(e){switch(e){case"swap":case"deposit-swap":case"swap-withdraw":return"Swap Transaction Sent";case"bridge":return"Bridge Transaction Sent";case"swap-bridge":return"Swap & Bridge Transaction Sent";case"bridge-swap":return"Bridge & Swap Transaction Sent";default:return"Transaction Sent"}}function gd({flow:e}){let t=C.useId(),[n,o]=C.useState(null),r=e.submitted,a=bn();return C.useEffect(()=>{o(document.body)},[]),C.useEffect(()=>{if(!e.successDialogOpen)return;let i=l=>{l.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e]),!n||!e.successDialogOpen||!r?null:(0,sn.createPortal)((0,s.jsx)("div",{className:"bf-success-overlay","data-theme":a,role:"presentation",children:(0,s.jsx)("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:(0,s.jsxs)("div",{className:"bf-success-body",children:[(0,s.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,s.jsxs)("div",{className:"bf-success-copy",children:[(0,s.jsx)("strong",{id:t,children:md(r.pathType)}),(0,s.jsx)("span",{children:"Please check the results in the history."})]}),(0,s.jsx)("div",{className:"bf-success-route","aria-hidden":"true",children:(r.routeTokens&&r.routeTokens.length>0?r.routeTokens:[{symbol:r.fromToken.symbol,iconUrl:r.fromToken.iconUrl},{symbol:r.toToken.symbol,iconUrl:r.toToken.iconUrl}]).map((i,l)=>(0,s.jsxs)(C.Fragment,{children:[l>0&&(0,s.jsx)("span",{className:"bf-success-route-arrow",children:"\u2192"}),(0,s.jsx)(Rr,{token:i,size:43})]},`${i.symbol}-${l}`))}),(0,s.jsx)("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,children:"OK"})]})})}),n)}function Rr({token:e,size:t=16}){let n=!!e.iconUrl;return(0,s.jsx)("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?(0,s.jsx)("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):(0,s.jsx)("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function hd({row:e}){return e.routeTokens&&e.routeTokens.length>0?(0,s.jsx)("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>(0,s.jsxs)(C.Fragment,{children:[n>0&&(0,s.jsx)("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),(0,s.jsx)(Rr,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?(0,s.jsxs)("span",{className:"bf-info-value-token",children:[(0,s.jsx)(Rr,{token:e.valueToken}),(0,s.jsx)("span",{children:e.value})]}):(0,s.jsx)(s.Fragment,{children:e.value})}function Ps({rows:e}){return!e||e.length===0?null:(0,s.jsx)("div",{className:"bf-info-rows",children:e.map((t,n)=>(0,s.jsxs)("div",{className:"bf-info-row",children:[(0,s.jsxs)("span",{className:"bf-info-label",children:[(0,s.jsx)("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),(0,s.jsx)("span",{children:t.label})]}),(0,s.jsx)("span",{className:"bf-info-value","data-tone":t.tone??"default",children:(0,s.jsx)(hd,{row:t})})]},`${t.label}-${t.value}`))})}function bd(e,t,n){return e.pathType==="bridge"?"Bridge Info":As(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function wd({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=t&&n,r=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return(0,s.jsx)(s.Fragment,{children:r.map(a=>{let i=a==="swap"?e.swapInfo:e.bridgeInfo;return i?.length?(0,s.jsxs)("div",{className:"bf-info-section",children:[o&&(0,s.jsx)("h4",{children:a==="swap"?"Swap Info":"Bridge Info"}),(0,s.jsx)(Ps,{rows:i})]},a):null})})}function xd({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=bd(e,t,n),[a,i]=C.useState(!0),[l,p]=C.useState(!0);return(0,s.jsxs)("div",{className:"bf-details",children:[e.liquidity&&(0,s.jsxs)("section",{className:"bf-liquidity",children:[(0,s.jsxs)("div",{className:"bf-liquidity-head",children:[(0,s.jsx)("span",{children:e.liquidity.label??"Available Liquidity"}),(0,s.jsx)("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),(0,s.jsx)("div",{className:"bf-liquidity-track",children:(0,s.jsx)("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||n)&&(0,s.jsxs)("section",{className:"bf-detail-section bf-info-card","data-open":a?"true":"false",children:[(0,s.jsxs)("button",{type:"button",className:"bf-collapse-head","aria-expanded":a,onClick:()=>i(c=>!c),children:[(0,s.jsx)("h3",{children:r}),(0,s.jsx)(Jt,{size:16,className:"bf-collapse-chevron"})]}),a&&(0,s.jsx)("div",{className:"bf-collapse-body",children:(0,s.jsx)(wd,{summary:e})})]}),o&&(0,s.jsxs)("section",{className:"bf-detail-section bf-tx-fee-section","data-open":l?"true":"false",children:[(0,s.jsxs)("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":l,onClick:()=>p(c=>!c),children:[(0,s.jsx)("h3",{children:"Est. Tx Fee"}),(0,s.jsxs)("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&(0,s.jsx)("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&(0,s.jsx)("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),(0,s.jsx)("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:qc(e.txFeeInfo?.estTxFee??"0")}),(0,s.jsx)(Jt,{size:16,className:"bf-collapse-chevron"})]})]}),l&&(0,s.jsx)("div",{className:"bf-collapse-body",children:(0,s.jsx)(Ps,{rows:e.txFee})})]})]})}function vd({item:e}){let t=Lo(e),n=ed(e.fromAmount,e.fromToken);return(0,s.jsxs)("article",{className:"bf-history-item",children:[(0,s.jsxs)("div",{className:"bf-history-item-head",children:[(0,s.jsx)("span",{className:"bf-history-status","data-status":t,children:nd(t)}),(0,s.jsx)("time",{className:"bf-history-time",dateTime:e.timestamp,children:Xc(e.timestamp)})]}),(0,s.jsxs)("div",{className:"bf-history-item-body",children:[(0,s.jsxs)("strong",{className:"bf-history-amount",children:[Jc(e.fromAmount)," ",e.fromToken.symbol]}),(0,s.jsxs)("div",{className:"bf-history-meta",children:[(0,s.jsx)("span",{className:"bf-history-usd",children:n??Zc(e.txHash)}),(0,s.jsxs)("span",{className:"bf-history-route",children:[(0,s.jsxs)("span",{className:"bf-history-route-token",children:[(0,s.jsx)(Pn,{token:e.fromToken,size:16}),(0,s.jsx)("span",{children:e.fromToken.symbol})]}),(0,s.jsx)(ps,{size:16,className:"bf-history-route-arrow"}),(0,s.jsxs)("span",{className:"bf-history-route-token",children:[(0,s.jsx)(Pn,{token:e.toToken,size:16}),(0,s.jsx)("span",{children:e.toToken.symbol})]})]})]})]})]})}function yd({flow:e}){let[t,n]=C.useState("all"),o=e.history.some(i=>Lo(i)==="pending"),r=e.history.filter(i=>td(i,t)),a=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return(0,s.jsxs)("main",{className:"bf-history-body",children:[(0,s.jsx)("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:$c.map(i=>(0,s.jsxs)("button",{type:"button",className:"bf-history-tab","data-active":t===i.value?"true":"false",onClick:()=>n(i.value),children:[(0,s.jsx)("span",{children:i.label}),i.value==="pending"&&o&&(0,s.jsx)("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},i.value))}),r.length>0?(0,s.jsx)("div",{className:"bf-history-list",children:r.map(i=>(0,s.jsx)(vd,{item:i},i.id||i.txHash))}):(0,s.jsx)("div",{className:"bf-empty",children:a})]})}function kd({flow:e,env:t}){let[n,o]=C.useState(null),[r,a]=C.useState(!1),[i,l]=C.useState(0),c=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??rd(e):null,f=Uc[t],m=od(e.quoteError),h=Kc(e.fromAmount,e.fromToken),g=h?"Insufficient balance":m.from,v=e.quoteError&&!m.from&&!m.to?e.quoteError:"",x=e.error||v,w=e.history.some(u=>Lo(u)==="pending"),A=(c?.pathType??Es(e.fromToken,e.toToken))!=="bridge";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("main",{className:"bf-body",children:[(0,s.jsxs)("div",{className:"bf-toolbar",children:[(0,s.jsxs)("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),children:[(0,s.jsx)(ls,{}),(0,s.jsx)("span",{children:"History"}),(w||e.hasNewHistory)&&(0,s.jsx)("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),A&&(0,s.jsxs)("button",{type:"button",className:"bf-chip",onClick:()=>a(!0),disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":r,children:[(0,s.jsx)(cs,{}),(0,s.jsx)("span",{children:e.slippageLocked?"Auto 1%":jc(e.slippage,e.effectiveSlippage)})]})]}),(0,s.jsxs)("div",{className:"bf-swap-card","data-has-from-error":g?"true":"false",children:[(0,s.jsx)(Rs,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:Ss(e.fromAmount,e.fromToken),onAmountChange:u=>e.setAmount(u,"from"),onTokenClick:()=>o("from")}),g&&(0,s.jsx)("div",{className:"bf-field-error",children:g}),(0,s.jsx)("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),l(u=>u+360)},style:{transform:`translateX(-50%) rotate(${i}deg)`,transition:"transform 0.2s ease"},children:(0,s.jsx)(ds,{size:22})}),(0,s.jsx)(Rs,{label:"To",token:e.toToken,amount:e.toAmount,usd:Ss(e.toAmount,e.toToken),onAmountChange:u=>e.setAmount(u,"to"),onTokenClick:()=>o("to"),locked:e.availableToTokens.length<=1}),m.to&&(0,s.jsx)("div",{className:"bf-field-error",children:m.to})]}),(0,s.jsx)(pd,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),c&&(0,s.jsx)(xd,{summary:c})]}),(0,s.jsxs)("footer",{className:"bf-footer",children:[(0,s.jsx)("button",{type:"button",className:"bf-next",onClick:e.submit,disabled:e.status==="submitting"||!!e.quoteError||h,children:e.status==="submitting"?"Processing...":"Next"}),(0,s.jsxs)("a",{className:"bf-powered",href:f,target:"_blank",rel:"noreferrer",children:["Powered by ",(0,s.jsx)("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&(0,s.jsx)(id,{flow:e,side:n,onClose:()=>o(null)}),r&&(0,s.jsx)(ad,{flow:e,onClose:()=>a(!1)}),(0,s.jsx)(sd,{flow:e}),e.approvalInfo&&(0,s.jsx)(cd,{flow:e,approval:e.approvalInfo}),(0,s.jsx)(dd,{flow:e}),(0,s.jsx)(fd,{flow:e}),(0,s.jsx)(ud,{message:e.submitToast?"":x}),(0,s.jsx)(gd,{flow:e})]})}function Bn({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let a=C.useMemo(()=>Be(n),[n]),i=vs({...r,onExit:t}),l=C.useRef(null),p=Gc(l),c=i.step==="history"?"History":"Swap & Bridge";return(0,s.jsx)(Ns.Provider,{value:p,children:(0,s.jsxs)("div",{ref:l,className:ne("bf-root",o),"data-view":i.step,"data-status":i.status,children:[(0,s.jsxs)("header",{className:"bf-header",children:[(0,s.jsx)("button",{type:"button",className:"bf-header-btn",onClick:i.back,"aria-label":"Back",children:(0,s.jsx)(Xt,{size:24})}),(0,s.jsx)("span",{className:"bf-header-title",children:c}),(0,s.jsx)("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:(0,s.jsx)(kt,{size:24})})]}),i.step==="history"?(0,s.jsx)(yd,{flow:i}):(0,s.jsx)(kd,{flow:i,env:a})]})})}var d=require("react/jsx-runtime"),Sd="On-ramp is not available in your region.";function Nr(e,t,n){let o=Me[e],r=n.toUpperCase();if(t===o.cross&&r.includes("CROSSD"))return 0;if(t===o.cross&&r==="CROSS")return 1;if(t===o.bsc&&r==="CROSS")return 2}function Cd(e){return parseInt(e.split(":")[1],10)}function Rd(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Nd(e){let t=e.toLowerCase().replace(/^0x/,""),n=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),o=parseInt(n.slice(0,4),16)%360,r=(o+60+parseInt(n.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${o} 85% 65%), hsl(${r} 80% 55%))`}function Fs({align:e="end",sideOffset:t=12,className:n,children:o}){let{env:r,theme:a,isMobile:i,open:l,drawerDirection:p,modal:c,showBalance:f,showForgeToken:m,showGameToken:h,showQR:g,showBridge:v,qrLogoSrc:x,walletAddress:w,accountName:y,sendAccounts:A,profileImageUrl:u,preferredTokens:T,close:S,onSelectWallet:P,onCopyAddress:B,onBuy:te,onDisconnect:O,disconnectLabel:Y,termsUrl:_,termsLabel:re,privacyUrl:G,privacyLabel:Ce,portalStyle:pe,navContent:me,navPosition:Ue,footerContent:ge,view:U,setView:he,selectedSendToken:de,setSelectedSendToken:$,showPortfolio:$e,portfolioTitle:ve,showTotalAssets:Oe,totalAssetsLabel:ye,sendTransaction:it,getTransactionReceipt:Le,estimateGas:_t,onOutlink:Ge,lpBalanceReader:wt,stakingRewardsReader:Tt,bridgeTokens:be,bridgeHistory:Re,getBridgeQuote:Xe,getBridgeToTokens:Ee,getBridgeApproval:Ne,approveBridge:we,submitBridge:xt,onReceive:je,onBridge:at,onSend:Ae,onBuyDisabledMessage:vt}=Wt(),[yt,ze]=F.useState(null),st=F.useRef(void 0),Je=F.useCallback(b=>{ze(b),clearTimeout(st.current),st.current=setTimeout(()=>ze(null),4e3)},[]);F.useEffect(()=>()=>clearTimeout(st.current),[]);let fe=!!vt,et=F.useCallback(()=>{if(fe){Je(vt);return}let b=te?.();b&&typeof b.then=="function"&&b.catch(()=>{Je(vt??Sd)})},[fe,vt,te,Je]),{tokens:Pe,isLoading:tt}=At(r,w,l&&f),{statsMap:Ve}=Pt(r,f),{categoryMap:It}=la(r,f),Lt=f&&Oe,{displayValue:lt,isLowerBound:Ot,isLoading:ct}=da(r,w,l&&Lt),[Te,k]=F.useState(!1),q=F.useRef(null),[ie,qe]=F.useState(0),{holdings:Ke,isLoading:zt}=na(r,w,l&&f&&m),zo=F.useMemo(()=>Ke.map(b=>b.token),[Ke]),{imageMap:vn}=oa(r,zo,m&&Ke.length>0),nt=F.useMemo(()=>{let b=[],L=[],K=[],We=new Map((T??[]).map((X,ke)=>[`${Cd(X.chainId)}:${X.address.toLowerCase()}`,ke]));for(let X of Pe){let ke=Nr(r,X.chainId,X.symbol)!==void 0,qt=`${X.chainId}:${X.address.toLowerCase()}`,Kt=We.get(qt),Vo=new wn.default(X.quantity.numeric).shiftedBy(-X.quantity.decimals);if(ke)b.push(X);else if(Kt!==void 0)L.push(X);else if(Vo.isGreaterThan(0)){if(!h&&It.get(fr(X.chainId,X.address))==="game")continue;K.push(X)}}return b.sort((X,ke)=>{let qt=Nr(r,X.chainId,X.symbol)??99,Kt=Nr(r,ke.chainId,ke.symbol)??99;return qt-Kt}),L.sort((X,ke)=>{let qt=We.get(`${X.chainId}:${X.address.toLowerCase()}`)??99,Kt=We.get(`${ke.chainId}:${ke.address.toLowerCase()}`)??99;return qt-Kt}),K.sort((X,ke)=>{let qt=Ve.get(ut(X.chainId,X.address)),Kt=Ve.get(ut(ke.chainId,ke.address)),Vo=new wn.default(X.quantity.numeric).shiftedBy(-X.quantity.decimals).multipliedBy(qt?.price??0);return new wn.default(ke.quantity.numeric).shiftedBy(-ke.quantity.decimals).multipliedBy(Kt?.price??0).minus(Vo).toNumber()}),[...b,...L,...K]},[Pe,r,Ve,h,It,T]),$n=F.useMemo(()=>{if(!m)return[];let b=new Set(Pe.map(L=>L.address.toLowerCase()));return[...Ke].filter(L=>!b.has(L.token.toLowerCase())).sort((L,K)=>{let We=new wn.default(L.value);return new wn.default(K.value).minus(We).toNumber()})},[Ke,m,Pe]),I=F.useRef(!1),[Z,j]=F.useState(null),ue=F.useRef(void 0),jn=Z?.chainId??de?.chainId??nt[0]?.chainId??0,{transactionUrl:Wo}=ao(r,jn,Z?.txHash,!!(Z?.txHash&&jn)),Qe=F.useCallback(b=>{I.current=!0,he(b)},[he]),[il,Do]=F.useState("recipient"),Vn=F.useCallback(()=>{$(null),Do("recipient"),Qe("wallet")},[$,Qe]),Ho=F.useCallback((b,L="recipient")=>{Do(L),$(b),Qe("send")},[$,Qe]),al=F.useCallback(()=>{if(at){at();return}Qe("bridge")},[at,Qe]),sl=F.useCallback(b=>{clearTimeout(ue.current),$(null),Qe("wallet"),j({status:"pending",txHash:b.txHash,chainId:b.chainId,description:`${b.amount} ${b.tokenSymbol} to ${Ye(b.recipient)}`})},[$,Qe]),ll=F.useCallback(b=>{let L=de?.chainId;$(null),Qe("wallet"),!(!b||!L)&&(j(K=>({status:"success",txHash:b,chainId:L,description:K?.txHash===b?K.description:"Tap to see your transaction"})),clearTimeout(ue.current),ue.current=setTimeout(()=>j(null),5e3))},[de?.chainId,$,Qe]),cl=F.useCallback(b=>{let L=b.txHash;L&&(j({status:"error",txHash:L,chainId:b.chainId,description:b.message}),clearTimeout(ue.current),ue.current=setTimeout(()=>j(null),5e3))},[]),Go=F.useMemo(()=>{if(je)return je;if(g)return()=>Qe("qr")},[je,g,Qe]),Pr=F.useMemo(()=>{if(Ae)return Ae;if(nt.length===0)return;let b=nt[0];return()=>Ho(b,"token")},[Ae,nt,Ho]);F.useEffect(()=>{l||(I.current=!1,Do("recipient"))},[l]);let Br=F.useRef(null);F.useEffect(()=>{let b=Br.current;if(!b||!i)return;let L=K=>{K.pointerType==="touch"&&K.stopPropagation()};return b.addEventListener("pointerdown",L),()=>b.removeEventListener("pointerdown",L)},[i]);let[dn,Fr]=F.useState(!1),Uo=F.useRef(void 0),[yn,qn]=F.useState(!1);F.useEffect(()=>{if(!yn)return;let b=()=>qn(!1),L=We=>{We.key==="Escape"&&qn(!1)},K=setTimeout(()=>{document.addEventListener("mousedown",b,!0),document.addEventListener("keydown",L,!0)},0);return()=>{clearTimeout(K),document.removeEventListener("mousedown",b,!0),document.removeEventListener("keydown",L,!0)}},[yn]),F.useEffect(()=>()=>clearTimeout(Uo.current),[]),F.useEffect(()=>()=>clearTimeout(ue.current),[]),F.useEffect(()=>{let b=q.current;if(!b||ge===null){qe(0);return}let L=()=>{qe(b.offsetHeight)};if(L(),typeof ResizeObserver>"u")return;let K=new ResizeObserver(L);return K.observe(b),()=>K.disconnect()},[ge]);let Mr=F.useCallback(async()=>{if(!dn)try{await navigator.clipboard.writeText(w),Fr(!0),clearTimeout(Uo.current),Uo.current=setTimeout(()=>Fr(!1),2e3),B?.(w,!0)}catch{B?.(w,!1)}},[w,B,dn]),Kn=F.useCallback(b=>{b.currentTarget.setAttribute("data-loaded","true")},[]),_r=F.useMemo(()=>({background:Nd(w)}),[w]),Qn=F.useMemo(()=>u||Et(r,w,{size:120,bg:a==="dark"?"1A1A2E":"F3F6F8"}),[u,r,w,a]),$o=F.useMemo(()=>Rd(lt),[lt]),Or=_||G?(0,d.jsxs)("div",{className:"wi-legal-links",children:[_&&(0,d.jsx)("a",{className:"wi-legal-link",href:_,target:"_blank",rel:"noopener noreferrer",onClick:b=>Ze(b,_,{category:"terms",origin:"terms"},Ge),children:re}),_&&G&&(0,d.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),G&&(0,d.jsx)("a",{className:"wi-legal-link",href:G,target:"_blank",rel:"noopener noreferrer",onClick:b=>Ze(b,G,{category:"privacy",origin:"privacy"},Ge),children:Ce})]}):null,zr=O?(0,d.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{O(),S()},children:[(0,d.jsx)(ai,{size:16}),(0,d.jsx)("span",{className:"wi-disconnect-label",children:Y})]}):null,dl=f&&!me?(0,d.jsxs)("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[(0,d.jsxs)("button",{type:"button",className:ne("wi-action-card",fe&&"wi-action-card--dimmed"),onClick:et,disabled:!te&&!fe,"aria-disabled":fe||void 0,"aria-label":"Buy",children:[(0,d.jsx)(fi,{size:20}),(0,d.jsx)("span",{children:"Buy"})]}),v?(0,d.jsxs)("button",{type:"button",className:"wi-action-card",onClick:al,"aria-label":"Bridge",children:[(0,d.jsx)(ui,{size:20}),(0,d.jsx)("span",{children:"Bridge"})]}):(0,d.jsxs)("button",{type:"button",className:"wi-action-card",onClick:Go,disabled:!Go,"aria-label":"Receive",children:[(0,d.jsx)(Jo,{size:20}),(0,d.jsx)("span",{children:"Receive"})]}),(0,d.jsxs)("button",{type:"button",className:"wi-action-card",onClick:Pr,disabled:!Pr,"aria-label":"Send",children:[(0,d.jsx)(di,{size:20}),(0,d.jsx)("span",{children:"Send"})]}),(0,d.jsxs)("button",{type:"button",className:"wi-action-card",onClick:()=>Qe("portfolio"),disabled:!$e,"aria-label":"View portfolio",children:[(0,d.jsx)(pi,{size:20}),(0,d.jsx)("span",{children:"Portfolio"})]})]}):null,pl=(0,d.jsxs)("div",{className:ne("wi-view-inner",I.current&&"wi-view-wallet"),children:[Lt&&(0,d.jsxs)("div",{className:"wi-total-section",children:[(0,d.jsxs)("div",{className:"wi-total-head",children:[(0,d.jsx)("span",{className:"wi-total-label",children:ye}),(0,d.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:b=>{b.stopPropagation(),k(L=>!L)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),k(L=>!L))},"aria-label":Te?"Show balance":"Hide balance",children:Te?(0,d.jsx)(li,{}):(0,d.jsx)(si,{})})]}),(0,d.jsx)("div",{className:"wi-total-body",children:ct?(0,d.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):(0,d.jsx)("div",{className:"wi-total-value","data-hidden":Te||void 0,children:Te?(0,d.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,d.jsxs)(d.Fragment,{children:[Ot&&(0,d.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,d.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,d.jsx)("span",{className:"wi-total-amount",children:$o.main}),$o.decimal&&(0,d.jsx)("span",{className:"wi-total-decimal",children:$o.decimal})]})})})]}),Ue==="top"&&(me?(0,d.jsx)("div",{className:"wi-nav-fixed",children:me}):dl),f&&(0,d.jsx)("div",{ref:Br,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,d.jsxs)("div",{className:"wi-token-list",children:[tt&&Array.from({length:5},(b,L)=>(0,d.jsxs)("div",{className:"wi-skeleton-item",children:[(0,d.jsxs)("div",{className:"wi-skeleton-left",children:[(0,d.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,d.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,d.jsxs)("div",{className:"wi-skeleton-right",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},L)),!tt&&nt.length===0&&!m&&(0,d.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),nt.map(b=>{let L=Ve.get(ut(b.chainId,b.address)),K=L?parseFloat(L.percent_change_24h):null,We=K!==null&&K>=0,X=Tn(r,b.chainId);return(0,d.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>Ho(b),"aria-label":`Send ${b.symbol}`,children:[(0,d.jsxs)("div",{className:"wi-token-left",children:[(0,d.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,d.jsx)("img",{src:b.icon_url,alt:b.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Kn,onError:ke=>{ke.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),X&&(0,d.jsx)("img",{src:X,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:ke=>{ke.currentTarget.style.display="none"}})]}),(0,d.jsxs)("div",{className:"wi-token-info",children:[(0,d.jsx)("span",{className:"wi-token-name",children:b.symbol}),L&&(0,d.jsxs)("div",{className:"wi-token-price-row",children:[(0,d.jsx)("span",{className:"wi-token-price",children:er(L.price)}),(0,d.jsx)("span",{className:"wi-token-change","data-positive":We,"data-zero":K===0||void 0,children:K!==null&&(K===0?"0%":`${We?"+":"-"}${(We?Math.floor:Math.ceil)(Math.abs(K)*100)/100}%`)})]})]})]}),(0,d.jsxs)("div",{className:"wi-token-right",children:[(0,d.jsx)("span",{className:"wi-token-balance",children:Ht(b.quantity.numeric,b.quantity.decimals)}),L&&(0,d.jsx)("span",{className:"wi-token-value",children:gi(b.quantity.numeric,b.quantity.decimals,L.price)})]})]},`${b.address}-${b.chainId}`)}),m&&zt&&Array.from({length:3},(b,L)=>(0,d.jsxs)("div",{className:"wi-skeleton-item",children:[(0,d.jsxs)("div",{className:"wi-skeleton-left",children:[(0,d.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,d.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,d.jsxs)("div",{className:"wi-skeleton-right",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${L}`)),m&&!zt&&!tt&&nt.length===0&&$n.length===0&&(0,d.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),m&&$n.map(b=>{let L=vn.get(b.token)||"",K=Tn(r,Me[r].cross);return(0,d.jsxs)("div",{className:"wi-token-item",children:[(0,d.jsxs)("div",{className:"wi-token-left",children:[(0,d.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,d.jsx)("img",{src:L||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:b.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Kn,onError:We=>{We.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),K&&(0,d.jsx)("img",{src:K,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:We=>{We.currentTarget.style.display="none"}})]}),(0,d.jsxs)("div",{className:"wi-token-info",children:[(0,d.jsx)("span",{className:"wi-token-name",children:b.token_name}),(0,d.jsx)("div",{className:"wi-token-price-row",children:(0,d.jsxs)("span",{className:"wi-token-price",children:[Ht(b.current_price,18)," CROSS"]})})]})]}),(0,d.jsxs)("div",{className:"wi-token-right",children:[(0,d.jsx)("span",{className:"wi-token-balance",children:Ht(b.balance,18)}),(0,d.jsx)("span",{className:"wi-token-value",children:er(b.current_value_usd)})]})]},`forge-${b.token}`)})]})}),Ue==="bottom"&&me&&(0,d.jsx)("div",{className:"wi-nav-fixed",children:me}),zr&&(0,d.jsx)("div",{className:"wi-wallet-disconnect-row",children:zr})]},"wallet"),fl=$e?(0,d.jsx)("div",{className:ne("wi-view-inner wi-portfolio-body",I.current&&"wi-view-portfolio"),children:(0,d.jsx)(on,{env:r,theme:a,walletAddress:w,showHeader:!1,onOutlink:Ge,lpBalanceReader:wt,stakingRewardsReader:Tt})},"portfolio"):null,ul=de?(0,d.jsx)("div",{className:ne("wi-view-inner wi-send-body",I.current&&"wi-view-send"),children:(0,d.jsx)(In,{env:r,theme:a,walletAddress:w,accountName:y,accounts:A,initialStep:il,token:de,tokens:nt,onTokenChange:$,sendTransaction:it,getTransactionReceipt:Le,estimateGas:_t,getTokenPriceUsd:b=>{let L=Ve.get(ut(b.chainId,b.address));if(!L?.price)return;let K=parseFloat(L.price);return Number.isFinite(K)?K:void 0},onClose:S,onBackToWallet:Vn,onSubmitted:sl,onSuccess:ll,onFailed:cl,onOutlink:Ge})},"send"):null,ml=F.useMemo(()=>be||nt.map(b=>{let L=Ve.get(ut(b.chainId,b.address)),K=L?.price?parseFloat(L.price):void 0;return{name:b.name,symbol:b.symbol,chainId:b.chainId,address:b.address,decimals:b.quantity.decimals,balance:ir(b.quantity.numeric,b.quantity.decimals),iconUrl:b.icon_url,priceUsd:Number.isFinite(K)?K:void 0}}),[be,Ve,nt]),gl=(0,d.jsx)("div",{className:ne("wi-view-inner wi-bridge-body",I.current&&"wi-view-send"),children:(0,d.jsx)(Bn,{env:r,walletAddress:w,tokens:ml,history:Re,termsUrl:_,getQuote:Xe,getToTokens:Ee,getApproval:Ne,approveBridge:we,submitBridge:xt,onClose:S,onBackToWallet:Vn})},"bridge"),jo=!!P&&y?.trim().toLowerCase()!=="my wallet",Wr=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"wi-receive-avatar",children:[(0,d.jsx)("span",{className:"wi-avatar-fallback",style:_r}),Qn&&(0,d.jsx)("img",{src:Qn,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:Kn,onError:b=>{b.currentTarget.style.display="none"}})]}),(0,d.jsx)("span",{className:"wi-receive-account-name",children:y??"Account 1"}),jo&&(0,d.jsx)("span",{className:"wi-receive-chevron","data-open":yn,"aria-hidden":"true",children:(0,d.jsx)(Jt,{size:16})})]}),hl=(0,d.jsxs)("div",{className:ne("wi-view-inner wi-qr-body",I.current&&"wi-view-qr"),children:[(0,d.jsxs)("div",{className:"wi-receive-section",children:[jo?(0,d.jsx)("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{qn(!0),P?.()},"aria-label":"Switch account",children:Wr}):(0,d.jsx)("div",{className:"wi-receive-account",children:Wr}),(0,d.jsxs)("div",{className:"wi-qr-block",children:[(0,d.jsxs)("div",{className:"wi-qr-box",children:[(0,d.jsx)(Bs.QRCodeSVG,{value:w,size:180,level:"H",marginSize:2,...x&&{imageSettings:{src:x,height:33,width:33,excavate:!0}}}),!x&&(0,d.jsx)("div",{className:"wi-qr-logo",children:(0,d.jsx)(ci,{size:33})})]}),(0,d.jsx)("p",{className:"wi-qr-address",children:w})]}),(0,d.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:Mr,children:[(0,d.jsx)("span",{className:"wi-qr-copy-icon",children:dn?(0,d.jsx)(Zt,{size:16}):(0,d.jsx)(Rn,{size:16})}),(0,d.jsx)("span",{className:"wi-qr-copy-text",children:dn?"Copied!":"Copy address"})]})]}),Or&&(0,d.jsx)("div",{className:"wi-receive-footer",children:Or})]},"qr"),bl=U==="qr"||U==="portfolio"||U==="send"||U==="bridge",Dr=ge!==null?(0,d.jsx)("div",{className:"wi-builtin-footer",children:ge}):null,Hr=(0,d.jsxs)("div",{className:"wi-account-text",children:[jo?(0,d.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{qn(!0),P?.()},"aria-label":"Switch account","aria-expanded":yn,children:[(0,d.jsx)("span",{className:"wi-account-name",children:y??"Account 1"}),(0,d.jsx)("span",{className:"wi-account-switch","data-open":yn,"aria-hidden":"true",children:(0,d.jsx)(Jt,{size:20})})]}):(0,d.jsx)("div",{className:"wi-account-row",children:(0,d.jsx)("span",{className:"wi-account-name",children:y??"Account 1"})}),(0,d.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:Mr,"aria-label":"Copy address",children:[(0,d.jsx)("span",{className:"wi-account-address",children:Ye(w)}),(0,d.jsx)("span",{className:"wi-account-copy","data-copied":dn,children:dn?(0,d.jsx)(Zt,{size:12}):(0,d.jsx)(Rn,{size:12})})]})]}),Gr=(0,d.jsxs)(d.Fragment,{children:[o,U==="qr"?(0,d.jsx)("div",{className:"wi-sticky-header",children:(0,d.jsxs)("div",{className:"wi-header wi-header--receive",children:[(0,d.jsx)("button",{type:"button",className:"wi-header-back",onClick:Vn,"aria-label":"Back",children:(0,d.jsx)(Xt,{size:24})}),(0,d.jsx)("span",{className:"wi-receive-title",children:"Receive"}),(0,d.jsx)("button",{type:"button",className:"wi-header-action",onClick:S,"aria-label":"Close",children:(0,d.jsx)(kt,{size:24})})]})}):U==="send"||U==="bridge"?null:bl?(0,d.jsxs)("div",{className:"wi-sticky-header",children:[(0,d.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,d.jsx)("button",{type:"button",className:"wi-header-back",onClick:Vn,"aria-label":"Back",children:(0,d.jsx)(Xt,{size:24})}),(0,d.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:Hr}),(0,d.jsx)("button",{type:"button",className:"wi-header-action",onClick:S,"aria-label":"Close",children:(0,d.jsx)(kt,{size:24})})]}),(0,d.jsx)("hr",{className:"wi-divider"})]}):(0,d.jsxs)("div",{className:"wi-sticky-header",children:[(0,d.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,d.jsxs)("div",{className:"wi-account-block",children:[(0,d.jsxs)("div",{className:"wi-avatar",children:[(0,d.jsx)("div",{className:"wi-avatar-fallback",style:_r}),Qn&&(0,d.jsx)("img",{src:Qn,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:Kn,onError:b=>{b.currentTarget.style.display="none"}})]}),Hr]}),(0,d.jsxs)("div",{className:"wi-header-actions",children:[g&&v&&(0,d.jsx)("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:Go,"aria-label":"Show QR code",children:(0,d.jsx)(Jo,{size:20})}),(0,d.jsx)("button",{type:"button",className:"wi-header-action",onClick:S,"aria-label":"Close",children:(0,d.jsx)(kt,{size:24})})]})]}),(0,d.jsx)("hr",{className:"wi-divider"})]}),(0,d.jsxs)("div",{className:"wi-view-container",children:[U==="wallet"&&pl,U==="qr"&&hl,U==="portfolio"&&fl,U==="send"&&ul,U==="bridge"&&gl]}),U==="wallet"&&yt&&(0,d.jsx)("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:yt}),U==="wallet"&&Z&&(0,d.jsxs)("a",{className:"wi-send-toast",href:Wo??"#",target:"_blank",rel:"noopener noreferrer",onClick:b=>{if(!Wo){b.preventDefault();return}Ze(b,Wo,{category:"send",origin:"send-transaction",payload:{chainId:Z.chainId,txHash:Z.txHash}},Ge)},children:[(0,d.jsx)("span",{className:"wi-send-toast-icon","data-status":Z.status,"aria-hidden":!0,children:Z.status==="pending"?(0,d.jsx)("span",{className:"wi-send-toast-spinner"}):Z.status==="error"?(0,d.jsx)("span",{className:"wi-send-toast-error-dot"}):(0,d.jsx)(mi,{size:20})}),(0,d.jsxs)("span",{className:"wi-send-toast-copy",children:[(0,d.jsx)("span",{className:"wi-send-toast-title",children:Z.status==="pending"?"Sending...":Z.status==="error"?"Send failed":"Send complete"}),(0,d.jsx)("span",{className:"wi-send-toast-desc",children:Z.status==="pending"||Z.status==="error"?Z.description:"Tap to see your transaction"})]})]}),Dr&&U!=="portfolio"&&U!=="send"&&(0,d.jsx)("div",{className:"wi-sticky-footer",children:(0,d.jsx)("div",{className:"wi-footer",ref:q,children:Dr})})]}),Ur={...pe,...ie>0?{"--wi-footer-height":`${ie}px`}:null};return i?(0,d.jsxs)(Fn.Drawer.Portal,{children:[c&&(0,d.jsx)(Fn.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,d.jsxs)(Fn.Drawer.Content,{className:ne("wi-drawer-content",n),"data-theme":a,"data-vaul-no-drag":p==="left"||p==="right"?!0:void 0,style:Ur,"data-direction":p,"data-no-balance":!f||void 0,"data-has-footer":ie>0||void 0,"data-view":U,children:[(0,d.jsx)(Fn.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),Gr]})]}):(0,d.jsxs)(d.Fragment,{children:[c&&l&&(0,d.jsx)("div",{className:"wi-drawer-overlay",onClick:S}),(0,d.jsx)(Eo.Portal,{children:(0,d.jsx)(Eo.Content,{align:e,sideOffset:t,className:ne("wi-popover-content",n),"data-theme":a,style:Ur,"data-no-balance":!f||void 0,"data-has-footer":ie>0||void 0,"data-view":U,children:Gr})})]})}var Ms=z(require("react"),1);function _s({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=Wt();return Ms.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}var Os=z(require("react"),1);function zs({children:e}){let{setFooterContent:t}=Wt();return Os.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}W(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #121212);--wi-surface-default: var(--ds-surface-medium, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(255, 255, 255, .1));--wi-border-default: var(--ds-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--ds-border-medium, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--ds-content-highest, #ffffff);--wi-texticon-secondary: var(--ds-content-medium, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(255, 255, 255, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #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(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #ffffff);--wi-surface-default: var(--ds-surface-medium, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(18, 18, 18, .1));--wi-border-default: var(--ds-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--ds-border-medium, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--ds-content-highest, #121212);--wi-texticon-secondary: var(--ds-content-medium, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(18, 18, 18, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
11
- `);W(`.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}
12
- `);W(`@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}}
13
- `);W(`.wi-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;width:393px;border-radius:24px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--wi-surface-bg);box-shadow:var(--ds-shadow-modal, var(--wi-shadow));animation:wi-fade-in .15s ease-out;height:600px;overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(600px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:0;left:0;right:0;width:100%;max-height:100dvh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:100dvh}.wi-popover-content[data-view=qr]{max-height:calc(100dvh - 32px)}.wi-sticky-header{flex-shrink:0;position:relative}.wi-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px}.wi-header--wallet{align-items:flex-start;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--wallet+.wi-divider{display:none}.wi-header--sub-account{align-items:center}.wi-header--sub-account .wi-header-back{width:32px;height:38px}.wi-header--sub-account .wi-header-action{flex-shrink:0}.wi-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wi-account-block--sub-account{align-items:center}.wi-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border-radius:50%;background:var(--wi-surface-bg);box-sizing:border-box;overflow:hidden}.wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-avatar-img{position:relative;z-index:1;width:32px;height:32px;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;margin:0;width:fit-content;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:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-switch{display:inline-flex;align-items:center;justify-content:center;padding:2px 0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));border-radius:4px;flex-shrink:0;transition:color .15s ease,transform .2s ease}.wi-account-switch[data-open=true]{transform:rotate(180deg)}.wi-account-row--btn:hover .wi-account-switch{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-address-row-btn{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;text-align:left;min-width:0;transition:color .15s ease}.wi-address-row-btn:hover .wi-account-address,.wi-address-row-btn:hover .wi-account-copy{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-account-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));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;transition:color .15s ease}.wi-account-copy[data-copied=true]{color:var(--ds-system-green-high, #00a869)}.wi-header-actions{display:flex;align-items:center;gap:16px;flex-shrink:0;margin-top:-4px}.wi-header-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;border-radius:0;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header-action--qr{width:32px;height:32px;border-radius:8px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));transition:background-color .15s ease,color .15s ease}.wi-header-action--qr:hover{background:var(--ds-surface-high, rgba(0, 0, 0, .08));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header--receive{align-items:center;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--receive .wi-header-action,.wi-header--sub-account .wi-header-action{position:absolute;top:24px;right:24px}.wi-receive-title{position:absolute;left:50%;transform:translate(-50%);font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);text-align:center;pointer-events:none}.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(--ds-content-low, #00000066);transition:opacity .15s ease}.wi-header-close:hover{opacity:.7}.wi-total-section{margin:24px 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}.wi-action-row{display:flex;align-items:flex-start;gap:8px;width:auto;margin:24px 24px 0}.wi-action-card{appearance:none;display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 8px;border:none;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-align:center;cursor:pointer;transition:background-color .15s ease,color .15s ease}.wi-action-card:hover:not(:disabled){background:#2e3544!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}:root[data-ds-theme=light] .wi-action-card:hover:not(:disabled){background:#e4e8ef!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-action-card:disabled{cursor:default}.wi-action-card>svg{flex-shrink:0}.wi-action-card:not(:disabled){transition:background-color .15s ease,transform .1s ease}.wi-action-card:active:not(:disabled){transform:scale(.93)}.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-label{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.wi-total-eye{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease;border-radius:4px}.wi-total-eye:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.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.25;color:var(--ds-content-highest, #000000);font-variant-numeric:tabular-nums;min-height:45px;white-space:nowrap}.wi-total-currency,.wi-total-amount,.wi-total-decimal{font-size:36px;color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:22px;color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:32px;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:8px 0 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:0;padding:8px 0}.wi-token-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 24px;border:none;background:transparent;text-align:left;font-family:inherit;width:100%;box-sizing:border-box}.wi-token-item--button{cursor:pointer;background:var(--ds-surface-default, #ffffff);transition:none}.wi-token-item--button:hover{background:#252b39!important}:root[data-ds-theme=light] .wi-token-item--button:hover{background:#eff3f8!important}button.wi-token-item:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px;border-radius:4px}.wi-token-left{display:flex;align-items:center;gap:16px;min-width:0}.wi-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.wi-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain;opacity:0;transition:opacity .2s ease}.wi-token-icon[data-loaded=true]{opacity:1}.wi-token-chain-badge{position:absolute;right:0;bottom:0;width:14px;height:14px;border-radius:50%;background:var(--wi-surface-bg);box-shadow:0 0 0 1.5px var(--wi-surface-bg);object-fit:contain}.wi-token-info{display:flex;flex-direction:column;min-width:0}.wi-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-token-price-row{display:flex;align-items:center;gap:8px}.wi-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wi-token-change{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap}.wi-token-change[data-positive=true]{color:var(--ds-system-green-high, #00a0a2)}.wi-token-change[data-positive=false]{color:var(--ds-system-red-high, #a80927)}.wi-token-change[data-zero]{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.wi-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.wi-token-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wi-sticky-footer{flex-shrink:0}.wi-footer{padding:16px 24px 24px}.wi-builtin-footer{display:flex;flex-direction:column;gap:8px;align-items:stretch}.wi-wallet-disconnect-row{display:flex;justify-content:flex-end;flex-shrink:0;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-send-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:2;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);box-sizing:border-box;text-decoration:none}.wi-action-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:3;padding:12px 14px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);font-size:14px;line-height:1.4;text-align:center;box-sizing:border-box;animation:wi-action-toast-in .18s ease-out}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-action-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-action-toast{bottom:72px}@keyframes wi-action-toast-in{0%{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}.wi-action-card--dimmed{opacity:.4;cursor:pointer}.wi-action-card--dimmed:hover{opacity:.5}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-send-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-send-toast{bottom:72px}.wi-send-toast:hover{opacity:.92}.wi-send-toast-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;color:var(--ds-accent-primary-default, #00b4b7)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(0,232,201,.22);border-top-color:var(--ds-accent-primary-on-inverted, #00e8c9);border-radius:50%;animation:wi-send-toast-spin .8s linear infinite}.wi-send-toast-error-dot{width:18px;height:18px;border-radius:50%;background:var(--ds-system-red-default, #ff3358)}@keyframes wi-send-toast-spin{to{transform:rotate(360deg)}}.wi-send-toast-copy{display:flex;min-width:0;flex-direction:column}.wi-send-toast-title{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-inverted, #ffffff)}.wi-send-toast-desc{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-accent-primary-on-inverted, #00e8c9)}.wi-send-toast-icon[data-status=error]+.wi-send-toast-copy .wi-send-toast-desc{color:var(--ds-system-red-default, #ff3358)}.wi-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:16px;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:color .15s ease}.wi-disconnect-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;flex-shrink:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-receive-avatar .wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-receive-avatar .wi-avatar-img{width:24px;height:24px}.wi-legal-link{color:var(--ds-content-low, rgba(0, 0, 0, .4));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.wi-legal-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.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;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-back:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-view-container{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-popover-content[data-view=qr] .wi-view-container,.wi-drawer-content[data-view=qr] .wi-view-container{flex:1;min-height:0}.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-body-inner{padding:16px 16px 32px;gap:32px}.wi-receive-section{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:24px}.wi-receive-account{display:inline-flex;align-items:center;gap:8px;padding:4px 8px 4px 4px;border:0;background:var(--ds-surface-high, #edf1f2);border-radius:9999px;font-family:inherit;color:inherit}.wi-receive-account--btn{cursor:pointer;transition:none}.wi-receive-account--btn:hover{background:#2e3544}:root[data-ds-theme=light] .wi-receive-account--btn:hover{background:#e4e8ef}.wi-receive-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;overflow:hidden;flex-shrink:0}.wi-receive-account-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-receive-account>svg{color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0}.wi-receive-chevron{display:inline-flex;align-items:center;color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0;transition:transform .2s ease}.wi-receive-chevron[data-open=true]{transform:rotate(180deg)}.wi-qr-block{display:flex;flex-direction:column;align-items:center;gap:16px}.wi-qr-box{position:relative;display:flex;align-items:center;justify-content:center;padding:10px;background:#fff;border-radius:6px;overflow:hidden}.wi-qr-logo{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none}.wi-qr-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:16px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;word-break:break-all;max-width:281px;margin:0}.wi-qr-copy-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:12px 16px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);border-radius:12px;cursor:pointer;transition:border-color .15s ease}.wi-qr-copy-btn:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.wi-qr-copy-icon{display:inline-flex;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-qr-copy-text{font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-receive-footer{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-drawer-content .wi-header{padding:16px}.wi-drawer-content .wi-header--receive .wi-header-action,.wi-drawer-content .wi-header--sub-account .wi-header-action{top:16px;right:16px}.wi-drawer-content .wi-total-section,.wi-drawer-content .wi-action-row{margin:16px 16px 0}.wi-drawer-content .wi-nav-fixed{padding:0 16px}.wi-drawer-content .wi-token-item{padding:12px 16px}.wi-drawer-content .wi-wallet-disconnect-row{padding:16px}
14
- `);W(`.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}
15
- `);var Ao=require("react/jsx-runtime"),Td="https://terms.crosstoken.io/docs/cross-terms-of-use",Id="https://terms.crosstoken.io/docs/nexus-privacy-policy";function Ld({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:o,modal:r,showBalance:a=!1,showForgeToken:i=!1,showGameToken:l=!0,showQR:p=!0,showBridge:c=!0,qrLogoSrc:f,walletAddress:m,accountName:h,sendAccounts:g,profileImageUrl:v,connectorId:x,connectorName:w,connectorIconUrl:y,preferredTokens:A=[],onSelectWallet:u,onCopyAddress:T,onBuy:S,onBuyDisabledMessage:P,onDisconnect:B,disconnectLabel:te="Disconnect",termsUrl:O=Td,termsLabel:Y="Terms of Service",privacyUrl:_=Id,privacyLabel:re="Privacy Policy",open:G,onOpenChange:Ce,showPortfolio:pe=!1,portfolioTitle:me="My Portfolio",showTotalAssets:Ue=!0,totalAssetsLabel:ge="Total Assets USD",sendTransaction:U,getTransactionReceipt:he,estimateGas:de,onOutlink:$,lpBalanceReader:$e,stakingRewardsReader:ve,bridgeTokens:Oe,bridgeHistory:ye,getBridgeQuote:it,getBridgeToTokens:Le,getBridgeApproval:_t,approveBridge:Ge,submitBridge:wt,onReceive:Tt,onBridge:be,onSend:Re,style:Xe,children:Ee}){let Ne=Be(e),we=x?Cn[x]:void 0,xt=w??we?.name,je=y??we?.iconUrl,at=pn(`(max-width: ${n}px)`),Ae=o??(a?"right":"bottom"),vt=Ae==="left"||Ae==="right",yt=r??!1,ze=G!==void 0,[st,Je]=He.useState(!1),fe=ze?G:st,et=He.useCallback(Ke=>{ze||Je(Ke),Ce?.(Ke)},[ze,Ce]),Pe=He.useCallback(()=>et(!1),[et]),[tt,Ve]=He.useState(null),[It,Lt]=He.useState("top"),[lt,Ot]=He.useState(null),[ct,Te]=He.useState("wallet"),[k,q]=He.useState(null);He.useEffect(()=>{fe||(Te("wallet"),q(null))},[fe]);let ie=He.useCallback(()=>{rr(m),B?.()},[B,m]),qe=He.useMemo(()=>({env:Ne,theme:t,isMobile:at,open:fe,drawerDirection:Ae,modal:yt,showBalance:a,showForgeToken:i,showGameToken:l,showQR:p,showBridge:c,qrLogoSrc:f,walletAddress:m,accountName:h,sendAccounts:g,profileImageUrl:v,connectorName:xt,connectorIconUrl:je,preferredTokens:A,close:Pe,onSelectWallet:u,onCopyAddress:T,onBuy:S,onBuyDisabledMessage:P,onDisconnect:B?ie:void 0,disconnectLabel:te,termsUrl:O,termsLabel:Y,privacyUrl:_,privacyLabel:re,portalStyle:Xe,navContent:tt,navPosition:It,setNavContent:Ve,setNavPosition:Lt,footerContent:lt,setFooterContent:Ot,view:ct,setView:Te,selectedSendToken:k,setSelectedSendToken:q,showPortfolio:pe,portfolioTitle:me,showTotalAssets:Ue,totalAssetsLabel:ge,sendTransaction:U,getTransactionReceipt:he,estimateGas:de,onOutlink:$,lpBalanceReader:$e,stakingRewardsReader:ve,bridgeTokens:Oe,bridgeHistory:ye,getBridgeQuote:it,getBridgeToTokens:Le,getBridgeApproval:_t,approveBridge:Ge,submitBridge:wt,onReceive:Tt,onBridge:be,onSend:Re}),[Ne,t,at,fe,Ae,yt,a,i,l,p,c,f,m,h,g,v,xt,je,A,Pe,u,T,S,P,B,ie,te,O,Y,_,re,Xe,tt,It,lt,ct,k,pe,me,Ue,ge,U,he,de,$,$e,ve,Oe,ye,it,Le,_t,Ge,wt,Tt,be,Re]);return(0,Ao.jsx)(Xo.Provider,{value:qe,children:at?(0,Ao.jsx)(Ds.Drawer.Root,{direction:Ae,open:fe,onOpenChange:et,handleOnly:vt,noBodyStyles:!0,repositionInputs:!1,children:Ee},"drawer"):(0,Ao.jsx)(Ws.Root,{open:fe,onOpenChange:et,children:Ee},"popover")})}var ln=Object.assign(Ld,{Trigger:Xi,Content:Fs,Nav:_s,Footer:zs});var Nt=z(require("react"),1),tl=z(require("@radix-ui/react-dialog"),1),nl=require("vaul");var Po=require("react"),Bo=(0,Po.createContext)(null);function Mn(){let e=(0,Po.useContext)(Bo);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var cn=require("react");function _n(){let[e,t]=(0,cn.useState)([]),[n,o]=(0,cn.useState)(!0);(0,cn.useEffect)(()=>{if(typeof window>"u"){o(!1);return}let a=[],i=p=>{let{info:c}=p.detail;c?.rdns&&!a.some(f=>f.rdns===c.rdns)&&(a.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...a]))};window.addEventListener("eip6963:announceProvider",i),window.addEventListener("eip6963:crossAnnounceProvider",i),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let l=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",i),window.removeEventListener("eip6963:crossAnnounceProvider",i),clearTimeout(l)}},[]);let r=(0,cn.useCallback)(a=>e.some(i=>i.rdns===a),[e]);return{wallets:e,isDetected:r,isLoading:n}}var Hs=z(require("@radix-ui/react-dialog"),1),Gs=require("vaul");var Tr=require("react/jsx-runtime");function Us({asChild:e,children:t}){let{isMobile:n}=Mn(),o=n?Gs.Drawer.Trigger:Hs.Trigger;return(0,Tr.jsx)(o,{asChild:e??t!=null,children:t??(0,Tr.jsx)("button",{type:"button",children:"Connect Wallet"})})}var Rt=z(require("@radix-ui/react-dialog"),1),On=require("vaul");var M=require("react/jsx-runtime");function Fo(){return(0,M.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,M.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 $s(){return(0,M.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,M.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,M.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,M.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,M.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,M.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,M.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,M.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,M.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,M.jsx)("defs",{children:(0,M.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,M.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function js(){return(0,M.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsx)("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),(0,M.jsx)("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),(0,M.jsx)("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),(0,M.jsx)("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),(0,M.jsx)("path",{d:"M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z",fill:"#F3BA2F"})]})}function Vs(){return(0,M.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,M.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,M.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,M.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,M.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 qs(){return(0,M.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,M.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,M.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,M.jsx)("defs",{children:(0,M.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,M.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function Ks(){return(0,M.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[(0,M.jsx)("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"}),(0,M.jsx)("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"}),(0,M.jsx)("path",{fill:"#4CAF50",d:"M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"}),(0,M.jsx)("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"})]})}function Qs(){return(0,M.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,M.jsx)("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})})}function Ys(){return(0,M.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,M.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Mo={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:Fo},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:Fo,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:Fo,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:$s,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:js},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Vs,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:qs,badge:"For SHOP"}};function Ir(e){return Mo[e]}var _o={google:{id:"google",name:"Google",icon:Ks},apple:{id:"apple",name:"Apple",icon:Qs}};function Zs(e){return _o[e]}var R=require("react/jsx-runtime");function Ed({wallet:e,detected:t,onConnect:n}){let o=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}n()},r=e.icon,a=e.featured===!0;return(0,R.jsxs)("button",{type:"button",className:ne("wcm-wallet-item",a&&"wcm-wallet-item--featured"),onClick:o,children:[(0,R.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,R.jsx)("div",{className:"wcm-wallet-icon",children:(0,R.jsx)(r,{})}),(0,R.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,R.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,R.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?(0,R.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,R.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function Ad({social:e,onSignIn:t}){let n=e.icon,o=`Sign in with ${e.name}`;return(0,R.jsxs)("button",{type:"button",className:"wcm-social-item","data-provider":e.id,onClick:t,"aria-label":o,children:[(0,R.jsx)("span",{className:"wcm-social-icon",children:(0,R.jsx)(n,{})}),(0,R.jsx)("span",{className:"wcm-social-name",children:o})]})}function Xs(){let{wallets:e,activeWalletIds:t,socialProviders:n,activeSocialIds:o,termsUrl:r,privacyUrl:a,isDetected:i,close:l,isMobile:p}=Mn(),c=t.filter(h=>{let g=Ir(h).visibility;return!g||g==="always"?!0:g==="desktop-only"?!p:g==="mobile-only"?p:!0}),f=o.length>0,m=c.length>0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"wcm-header",children:[(0,R.jsxs)("div",{className:"wcm-header-text",children:[(0,R.jsx)("h2",{className:"wcm-title",children:"CROSS Wallet"}),!p&&(0,R.jsx)("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),(0,R.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:l,"aria-label":"Close",children:(0,R.jsx)(Ys,{})})]}),(0,R.jsxs)("div",{className:"wcm-body",children:[f&&(0,R.jsxs)(R.Fragment,{children:[!p&&(0,R.jsxs)("div",{className:"wcm-section-header",children:[(0,R.jsx)("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),(0,R.jsx)("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),(0,R.jsx)("div",{className:"wcm-social-grid",children:o.map(h=>{let g=Zs(h);return(0,R.jsx)(Ad,{social:g,onSignIn:()=>{n[h]?.(),l()}},h)})}),m&&(0,R.jsxs)("div",{className:"wcm-separator",children:[(0,R.jsx)("div",{className:"wcm-separator-line"}),(0,R.jsx)("span",{className:"wcm-separator-text",children:"Other Wallets"}),(0,R.jsx)("div",{className:"wcm-separator-line"})]})]}),m&&(0,R.jsx)("div",{className:"wcm-wallet-list",children:c.map(h=>{let g=Ir(h),v=g.rdns?i(g.rdns):!1;return(0,R.jsx)(Ed,{wallet:g,detected:v,onConnect:()=>{e[h]?.(),l()}},h)})}),(0,R.jsxs)("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",(0,R.jsx)(Js,{href:r,children:"Terms of Service"})," and consent to its ",(0,R.jsx)(Js,{href:a,children:"Privacy Policy"}),"."]})]})]})}function Js({href:e,children:t}){return e?(0,R.jsx)("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):(0,R.jsx)("span",{className:"wcm-terms-link",children:t})}function el({className:e}){let{isMobile:t,theme:n,portalStyle:o}=Mn();return t?(0,R.jsxs)(On.Drawer.Portal,{children:[(0,R.jsx)(On.Drawer.Overlay,{className:"wcm-overlay"}),(0,R.jsxs)(On.Drawer.Content,{className:ne("wcm-drawer-content",e),"data-theme":n,style:o,children:[(0,R.jsx)(On.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,R.jsx)("div",{className:"wcm-drawer-handle"}),(0,R.jsx)("div",{className:"wcm-drawer-body",children:(0,R.jsx)(Xs,{})})]})]}):(0,R.jsxs)(Rt.Portal,{children:[(0,R.jsx)(Rt.Overlay,{className:"wcm-overlay"}),(0,R.jsxs)(Rt.Content,{className:ne("wcm-dialog-content",e),"data-theme":n,style:o,children:[(0,R.jsx)(Rt.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,R.jsx)(Rt.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),(0,R.jsx)("div",{className:"wcm-dialog-body",children:(0,R.jsx)(Xs,{})})]})]})}W(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:var(--ds-overlay-dim, rgba(0, 0, 0, .5));-webkit-backdrop-filter:var(--ds-bg-blur-7, blur(3.5px));backdrop-filter:var(--ds-bg-blur-7, blur(3.5px))}.wcm-dialog-content{-webkit-font-smoothing:antialiased;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(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-radius:24px;box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));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:var(--ds-border-medium, rgba(0, 0, 0, .18)) 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:var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:4px}.wcm-drawer-content{-webkit-font-smoothing:antialiased;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(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-top-left-radius:16px;border-top-right-radius:16px;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:16px 0 0 16px}.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 16px 16px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--ds-border-medium, rgba(0, 0, 0, .18));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{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-header-text{display:flex;flex-direction:column;gap:4px;min-width:0}.wcm-title{font-family:Inter,sans-serif;font-weight:600;font-size:20px;line-height:1.25;letter-spacing:0;color:var(--ds-content-highest, #000000);margin:0}.wcm-subtitle{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));margin:0}.wcm-close-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border:none;background:transparent;color:var(--ds-content-low, #00000066);cursor:pointer;padding:0;transition:opacity .15s ease}.wcm-close-btn:hover{opacity:.6}.wcm-close-btn>svg{width:24px;height:24px}.wcm-divider{display:none}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:24px}.wcm-section-header{display:flex;align-items:center;gap:8px;width:100%}.wcm-section-title{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1;letter-spacing:0;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-recommended-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-low, #e7f9f8);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-high, #00a0a2);white-space:nowrap}.wcm-social-grid{display:grid;gap:8px;width:100%}.wcm-dialog-body .wcm-social-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wcm-drawer-body .wcm-social-grid{grid-template-columns:1fr}.wcm-social-item{display:flex;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;transition:none;font-family:inherit;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-social-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-social-item:hover{background:#eff3f8!important}.wcm-social-item[data-provider=apple] .wcm-social-icon{color:#000}[data-theme=dark] .wcm-social-item[data-provider=apple] .wcm-social-icon{color:#fff}.wcm-dialog-body .wcm-social-item{flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px}.wcm-drawer-body .wcm-social-item{flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;padding:16px}.wcm-social-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.wcm-social-icon>svg{width:32px;height:32px}.wcm-social-name{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:12px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-separator-text{font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-wallet-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:20px 16px;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;text-align:left;transition:none;font-family:inherit}.wcm-wallet-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-wallet-item:hover{background:#eff3f8!important}.wcm-wallet-item-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg,.wcm-wallet-icon>img{width:28px;height:28px;border-radius:0;object-fit:cover}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px;min-width:0}.wcm-wallet-name{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-system-purple-low, #f5f3ff);border:.5px solid var(--ds-system-purple-default, #7e54f4);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-purple-high, #7346f3);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-default, #00b4b7);border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-on, #ffffff);white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-terms{font-family:Inter,sans-serif;font-weight:400;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;margin:0}.wcm-terms-link{color:var(--ds-accent-primary-high, #00a0a2);text-decoration:none}.wcm-terms-link:hover{text-decoration:underline}.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}
16
- `);W(`@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)}}
17
- `);var xn=require("react/jsx-runtime"),Pd={};function Bd({wallets:e,socialProviders:t=Pd,termsUrl:n,privacyUrl:o,theme:r="dark",mobileBreakpoint:a=768,drawerDirection:i="bottom",dialogWidth:l,drawerMaxWidth:p,drawerMinWidth:c,style:f,open:m,onOpenChange:h,children:g}){let v=pn(`(max-width: ${a}px)`),[x,w]=Nt.useState(!1),y=m!==void 0,A=y?m:x,u=Nt.useCallback(_=>{y||w(_),h?.(_)},[y,h]),T=Nt.useCallback(()=>u(!1),[u]),{isDetected:S}=_n(),P=Nt.useMemo(()=>Object.keys(e),[e]),B=Nt.useMemo(()=>Object.keys(t),[t]),te=Nt.useMemo(()=>{let _={};return l&&(_["--wcm-dialog-width"]=l),p&&(_["--wcm-drawer-max-width"]=p),c&&(_["--wcm-drawer-min-width"]=c),{..._,...f}},[l,p,c,f]),O=Nt.useMemo(()=>({theme:r,isMobile:v,open:A,setOpen:u,close:T,wallets:e,activeWalletIds:P,socialProviders:t,activeSocialIds:B,termsUrl:n,privacyUrl:o,isDetected:S,portalStyle:te}),[r,v,A,u,T,e,P,t,B,n,o,S,te]),Y=(0,xn.jsx)("div",{"data-theme":r,style:te,children:g});return v?(0,xn.jsx)(Bo.Provider,{value:O,children:(0,xn.jsx)(nl.Drawer.Root,{direction:i,open:A,onOpenChange:u,noBodyStyles:!0,children:Y},"drawer")}):(0,xn.jsx)(Bo.Provider,{value:O,children:(0,xn.jsx)(tl.Root,{open:A,onOpenChange:u,children:Y})})}var Lr=Object.assign(Bd,{Trigger:Us,Content:el});W(`.cb-button{--cb-bg: var(--ds-accent-primary-default, #00b4b7);--cb-bg-hover: var(--cb-bg);--cb-color: var(--ds-accent-primary-on-primary, #ffffff);--cb-border: none;--cb-radius: 8px;--cb-height: 36px;--cb-padding: 8px 16px;--cb-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-font-size: 14px;--cb-font-weight: 500;--cb-line-height: 1.5;--cb-letter-spacing: -.01em;--cb-gap: 8px;--cb-transition: opacity .15s;--cb-loading-opacity: .7;--cb-press-scale: .95;--cb-icon-size: 18px;--cb-spinner-size: 18px;--cb-spinner-thumb: currentColor;--cb-spinner-track: color-mix(in srgb, currentColor 20%, transparent)}.cb-pill{--cb-pill-bg: var(--ds-surface-default, #ffffff);--cb-pill-bg-hover: var(--cb-pill-bg);--cb-pill-color: var(--ds-content-high, rgba(0, 0, 0, .85));--cb-pill-border: 1px solid var(--ds-border-default, rgba(0, 0, 0, .07));--cb-pill-border-hover: 1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));--cb-pill-radius: 8px;--cb-pill-height: 36px;--cb-pill-padding: 1px 13px;--cb-pill-press-scale: .95;--cb-pill-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-pill-font-size: 14px;--cb-pill-font-weight: 500;--cb-pill-line-height: 1.5;--cb-pill-gap: 8px;--cb-pill-icon-size: 18px;--cb-pill-icon-placeholder-bg: var(--ds-surface-medium, #f5f7fa);--cb-pill-address-font: Inter, system-ui, -apple-system, sans-serif;--cb-pill-address-font-size: 14px;--cb-pill-address-letter-spacing: -.01em}
18
- `);W(`.cb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-height);gap:var(--cb-gap);padding:var(--cb-padding);border-radius:var(--cb-radius);border:var(--cb-border);background:var(--cb-bg);color:var(--cb-color);font-family:var(--cb-font-family);font-size:var(--cb-font-size);font-weight:var(--cb-font-weight);line-height:var(--cb-line-height);letter-spacing:var(--cb-letter-spacing);cursor:pointer;transition:var(--cb-transition)}.cb-button:hover:not(:disabled){background:var(--cb-bg-hover)}.cb-button:active:not(:disabled){transform:scale(var(--cb-press-scale))}.cb-button:disabled,.cb-button[aria-busy=true]{cursor:default;opacity:var(--cb-loading-opacity)}.cb-spinner{display:inline-block;width:var(--cb-spinner-size);height:var(--cb-spinner-size);border:2px solid var(--cb-spinner-track);border-top-color:var(--cb-spinner-thumb);border-radius:50%;animation:cb-spin .6s linear infinite;flex-shrink:0}.cb-button-icon{width:var(--cb-icon-size);height:var(--cb-icon-size);flex-shrink:0}.cb-button-label{white-space:nowrap}.cb-pill{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-pill-height);gap:var(--cb-pill-gap);padding:var(--cb-pill-padding);border-radius:var(--cb-pill-radius);border:var(--cb-pill-border);background:var(--cb-pill-bg);color:var(--cb-pill-color);font-family:var(--cb-pill-font-family);font-size:var(--cb-pill-font-size);font-weight:var(--cb-pill-font-weight);line-height:var(--cb-pill-line-height);cursor:pointer}.cb-pill:hover{background:var(--cb-pill-bg-hover)}.cb-pill:active:not(:disabled){transform:scale(var(--cb-pill-press-scale))}.cb-pill-icon{width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;object-fit:contain;flex-shrink:0;background:transparent}[data-theme=dark] .cb-pill-icon[data-provider=apple]{filter:invert(1)}.cb-pill-icon-placeholder{display:inline-block;width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;background:var(--cb-pill-icon-placeholder-bg);flex-shrink:0}.cb-pill-address{font-family:var(--cb-pill-address-font);font-size:var(--cb-pill-address-font-size);letter-spacing:var(--cb-pill-address-letter-spacing);white-space:nowrap}@media(max-width:767.98px){.cb-button,.cb-pill{width:36px;min-width:36px;padding:0}.cb-button{height:36px}.cb-button-label,.cb-pill-address{display:none}}@keyframes cb-spin{to{transform:rotate(360deg)}}
19
- `);var Fd='<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>',Md='<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>',_d='<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>',Od='<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>',zd='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000"><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 zn(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var Wn=zn(Fd),Dn=zn(Md),Hn=zn(_d),Gn=zn(Od),Un=zn(zd);var xe=require("react/jsx-runtime");function Er({isConnecting:e,address:t,provider:n,providerName:o,accountName:r,sendAccounts:a,onConnect:i,onDisconnect:l,onCopy:p,onSelectWallet:c,onBuy:f,onBuyDisabledMessage:m,label:h="Connect Wallet",connectingLabel:g="Connecting...",disconnectLabel:v,className:x,theme:w="dark",env:y,showBalance:A=!0,showPortfolio:u,drawerDirection:T,modal:S,connectorId:P,style:B,walletInfoStyle:te,sendTransaction:O,getTransactionReceipt:Y,estimateGas:_,onReceive:re,onBridge:G,onSend:Ce,bridgeTokens:pe,bridgeHistory:me,getBridgeQuote:Ue,getBridgeToTokens:ge,getBridgeApproval:U,approveBridge:he,submitBridge:de}){let $=x?`cb-button ${x}`:"cb-button",$e=x?`cb-pill ${x}`:"cb-pill";if(e)return(0,xe.jsxs)("button",{type:"button",disabled:!0,className:$,style:B,"aria-busy":"true",children:[(0,xe.jsx)("span",{className:"cb-spinner","aria-hidden":"true"}),(0,xe.jsx)("span",{className:"cb-button-label",children:g})]});if(t){let ve=o??Gd(n),Oe=n?Dd[n]:void 0;return(0,xe.jsxs)(ln,{env:y,theme:w,drawerDirection:T,modal:S,showBalance:A,showPortfolio:u,walletAddress:t,accountName:r,sendAccounts:a,connectorId:P,onSelectWallet:c,onCopyAddress:p?(ye,it)=>{it&&p()}:void 0,onDisconnect:l,disconnectLabel:v,style:te,sendTransaction:O,getTransactionReceipt:Y,estimateGas:_,onReceive:re,onBridge:G,onBuy:f,onBuyDisabledMessage:m,onSend:Ce,bridgeTokens:pe,bridgeHistory:me,getBridgeQuote:Ue,getBridgeToTokens:ge,getBridgeApproval:U,approveBridge:he,submitBridge:de,children:[(0,xe.jsx)(ln.Trigger,{asChild:!0,children:(0,xe.jsxs)("button",{type:"button",className:$e,style:B,"aria-label":`Connected with ${ve}: ${ol(t)}`,children:[Oe?(0,xe.jsx)("img",{src:Oe,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":n}):(0,xe.jsx)("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),(0,xe.jsx)("span",{className:"cb-pill-address",children:ol(t)})]})}),(0,xe.jsx)(ln.Content,{align:"end",sideOffset:8})]})}return(0,xe.jsxs)("button",{type:"button",onClick:i,className:$,style:B,"aria-label":typeof h=="string"?h:"Connect Wallet",children:[(0,xe.jsx)(Wd,{}),(0,xe.jsx)("span",{className:"cb-button-label",children:h})]})}function Wd(){return(0,xe.jsxs)("svg",{className:"cb-button-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,xe.jsx)("path",{d:"M3.75 5.25H14.25C15.0784 5.25 15.75 5.92157 15.75 6.75V13.5C15.75 14.3284 15.0784 15 14.25 15H3.75C2.92157 15 2.25 14.3284 2.25 13.5V4.5C2.25 3.67157 2.92157 3 3.75 3H13.5",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),(0,xe.jsx)("path",{d:"M12 9.75H15.75V12.75H12C11.1716 12.75 10.5 12.0784 10.5 11.25C10.5 10.4216 11.1716 9.75 12 9.75Z",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),(0,xe.jsx)("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var Dd={google:Gn,apple:Un,cross:Wn,metamask:Dn,binance:Hn},Hd={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Gd(e){return e?Hd[e]:"Wallet"}function ol(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var rl=z(require("react"),1);W(`.sb-button{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-border-hover: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-color: var(--ds-content-medium, rgba(0, 0, 0, .65));--sb-color-hover: var(--ds-content-high, rgba(0, 0, 0, .85));--sb-radius: 8px;--sb-height: 36px;--sb-padding: 1px 11px;--sb-gap: 4px;--sb-font-size: 14px;--sb-font-weight: 500;--sb-line-height: 21px;--sb-letter-spacing: 0;--sb-blur: 0px;--sb-border-width: 1px;--sb-icon-size: 18px;--sb-icon-hover-rotation: 180deg;--sb-spinner-size: 18px;--sb-spinner-thumb: currentColor;--sb-spinner-track: color-mix(in srgb, currentColor 20%, transparent);--sb-disabled-opacity: .6;--sb-press-scale: .95;--sb-hover-duration: .2s;--sb-icon-duration: .3s;--sb-easing: ease}.sb-button[data-theme=dark]{--sb-bg: var(--ds-surface-default, #1e232e);--sb-border: var(--ds-border-default, #ffffff12);--sb-border-hover: var(--ds-border-medium, #ffffff2e);--sb-color: var(--ds-content-medium, #ffffffa6);--sb-color-hover: var(--ds-content-high, #ffffffd9)}.sb-button[data-theme=light]{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, #00000012);--sb-border-hover: var(--ds-border-medium, #0000002e);--sb-color: var(--ds-content-medium, #000000a6);--sb-color-hover: var(--ds-content-high, #000000d9)}
20
- `);W(`.sb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--sb-height);gap:var(--sb-gap);padding:var(--sb-padding);border-radius:var(--sb-radius);border:var(--sb-border-width) solid var(--sb-border);background:var(--sb-bg);backdrop-filter:blur(var(--sb-blur));-webkit-backdrop-filter:blur(var(--sb-blur));color:var(--sb-color);font-family:Inter,system-ui,-apple-system,sans-serif;font-weight:var(--sb-font-weight);font-size:var(--sb-font-size);line-height:var(--sb-line-height);letter-spacing:var(--sb-letter-spacing);cursor:pointer;transition:border-color var(--sb-hover-duration) var(--sb-easing),color var(--sb-hover-duration) var(--sb-easing)}@media(hover:hover){.sb-button:hover:not(:disabled){border-color:var(--sb-border-hover);color:var(--sb-color-hover)}.sb-button:hover:not(:disabled) .sb-button-icon{transform:rotate(var(--sb-icon-hover-rotation))}}.sb-button:active:not(:disabled){transform:scale(var(--sb-press-scale))}.sb-button:disabled,.sb-button[aria-busy=true]{cursor:default;opacity:var(--sb-disabled-opacity)}.sb-button-icon{width:var(--sb-icon-size);height:var(--sb-icon-size);flex-shrink:0;color:inherit;transition:transform var(--sb-icon-duration) var(--sb-easing),color var(--sb-icon-duration) var(--sb-easing)}.sb-spinner{display:inline-block;width:var(--sb-spinner-size);height:var(--sb-spinner-size);border:2px solid var(--sb-spinner-track);border-top-color:var(--sb-spinner-thumb);border-radius:50%;animation:sb-spin .6s linear infinite;flex-shrink:0}.sb-label{white-space:nowrap}@keyframes sb-spin{to{transform:rotate(360deg)}}
21
- `);var Vt=require("react/jsx-runtime"),Oo="https://skills.cross.nexus";function Ar({label:e="Skills",href:t=Oo,onClick:n,className:o,style:r,theme:a,disabled:i=!1,isLoading:l=!1,loadingLabel:p="Loading...",openInNewTab:c=!1,type:f="button"}){let[m,h]=rl.useState(!1),g=async A=>{if(t&&!n){c?window.open(t,"_blank","noopener,noreferrer"):window.location.href=t;return}if(n)try{h(!0),await n()}finally{h(!1)}},v=i||l||m,x=l||m,w=x?p:e,y=o?`sb-button ${o}`:"sb-button";return(0,Vt.jsxs)("button",{type:f,onClick:g,disabled:v,className:y,"data-theme":a,style:r,"aria-busy":x,children:[x?(0,Vt.jsx)("span",{className:"sb-spinner","aria-hidden":"true"}):(0,Vt.jsx)(Ud,{}),(0,Vt.jsx)("span",{className:"sb-label",children:w})]})}function Ud(){return(0,Vt.jsx)("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,Vt.jsx)("path",{d:"M15.5879 3.95142C16.0211 2.78097 17.6761 2.78099 18.1094 3.95142L19.6221 8.03833C20.6569 10.8348 22.8618 13.0396 25.6582 14.0745L29.7451 15.5872C30.9157 16.0204 30.9157 17.6754 29.7451 18.1086L25.6582 19.6213C22.8618 20.6562 20.657 22.861 19.6221 25.6575L18.1094 29.7444C17.6762 30.9149 16.0211 30.9149 15.5879 29.7444L14.0752 25.6575C13.0403 22.861 10.8355 20.6562 8.03906 19.6213L3.95215 18.1086C2.78172 17.6754 2.7817 16.0204 3.95215 15.5872L8.03906 14.0745C10.8355 13.0396 13.0403 10.8348 14.0752 8.03833L15.5879 3.95142Z",stroke:"currentColor",strokeWidth:"1.93556"})})}Xn({mode:"dapp-ui"});0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,BridgeFlow,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,DEFAULT_SKILLS_HREF,GOOGLE_ICON,METAMASK_ICON,SOCIAL_REGISTRY,SendFlow,SkillsButton,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,announceAppLauncherUsage,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});
1
+ "use strict";var Cl=Object.create;var eo=Object.defineProperty;var Rl=Object.getOwnPropertyDescriptor;var Nl=Object.getOwnPropertyNames;var Tl=Object.getPrototypeOf,Il=Object.prototype.hasOwnProperty;var Ll=(e,t)=>{for(var n in t)eo(e,n,{get:t[n],enumerable:!0})},Kr=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Nl(t))!Il.call(e,r)&&r!==n&&eo(e,r,{get:()=>t[r],enumerable:!(o=Rl(t,r))||o.enumerable});return e};var D=(e,t,n)=>(n=e!=null?Cl(Tl(e)):{},Kr(t||!e||!e.__esModule?eo(n,"default",{value:e,enumerable:!0}):n,e)),El=e=>Kr(eo({},"__esModule",{value:!0}),e);var Qd={};Ll(Qd,{APPLE_ICON:()=>Qn,AppLauncher:()=>Jo,AppLauncherContent:()=>tr,AppLauncherTrigger:()=>er,BINANCE_ICON:()=>qn,BridgeFlow:()=>Wn,CONNECTOR_REGISTRY:()=>En,CROSSX_ICON:()=>jn,ConnectButton:()=>Fr,ConnectorId:()=>co,DEFAULT_SKILLS_HREF:()=>Ho,GOOGLE_ICON:()=>Kn,METAMASK_ICON:()=>Vn,SOCIAL_REGISTRY:()=>Do,SendFlow:()=>Fn,SkillsButton:()=>Mr,TOKEN_STATS_QUERY_KEY:()=>So,USER_BALANCE_QUERY_KEY:()=>yo,WALLET_REGISTRY:()=>Wo,WalletConnectModal:()=>Br,WalletInfo:()=>pn,WalletPortfolio:()=>Rr,WalletPortfolioBody:()=>sn,announceAppLauncherUsage:()=>no,resolveEnvironment:()=>Be,useGlobalMenu:()=>Ln,useTokenBalance:()=>Mt,useTokenStats:()=>_t,useWalletDetect:()=>Gn});module.exports=El(Qd);var Al={};function Qr(e){try{return Al.env?.[e]}catch{return}}function Yr(e){if(!(typeof process>"u"))return process.env?.[e]}function Be(e){if(e)return Zr(e);let t=Qr("VITE_CROSSX_ENVIRONMENT")??Qr("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Yr("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Yr("CROSSX_ENVIRONMENT");return Zr(t)}function Zr(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var Zo="1.3.3";var to="__nexusCrossAppLauncherRuntime";function Pl(){if(typeof window>"u")return null;let e=window;return e[to]??(e[to]={mode:"dapp-ui"}),e[to]}function Bl(e){if(e.scheduled)return;e.scheduled=!0;let t=()=>{if(e.scheduled=!1,e.loggedMode!==e.mode){if(e.mode==="connect-kit-react"){let n=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${n} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${Zo}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${Zo} \uCD08\uAE30\uD654 \uC644\uB8CC (\uC0AC\uC6A9 \uBAA8\uB4DC: dapp-ui only)`);e.loggedMode=e.mode}};typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function no(e){let t=Pl();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Bl(t))}var bn=D(require("react"),1),Xr=D(require("@radix-ui/react-popover"),1),Jr=require("vaul");var oo=require("react"),Xo=(0,oo.createContext)(null);function ro(){let e=(0,oo.useContext)(Xo);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var io=require("react");function hn(e){let[t,n]=(0,io.useState)(!1);return(0,io.useEffect)(()=>{let o=window.matchMedia(e);n(o.matches);let r=a=>n(a.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}function H(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}H(`[data-theme=dark]{--al-bg: var(--ds-surface-default, #1e232e);--al-bg-hover: var(--ds-surface-medium, #252b39);--al-text: var(--ds-content-highest, #ffffff);--al-text-secondary: var(--ds-content-medium, #ffffffa6);--al-border: var(--ds-border-default, #ffffff12);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .7));--al-badge-bg: var(--ds-accent-primary-low, #123235);--al-badge-text: var(--ds-accent-primary-default, #00ceb2);--al-badge-new-text: var(--ds-system-purple-on, #ffffff);--al-drawer-overlay: var(--ds-overlay-dim, #000000b3)}[data-theme=light]{--al-bg: var(--ds-surface-default, #ffffff);--al-bg-hover: var(--ds-surface-medium, #f5f7fa);--al-text: var(--ds-content-highest, #000000);--al-text-secondary: var(--ds-content-medium, #000000a6);--al-border: var(--ds-border-default, #00000012);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .15));--al-badge-bg: var(--ds-accent-primary-low, #e7f9f8);--al-badge-text: var(--ds-accent-primary-default, #00b4b7);--al-badge-new-text: var(--ds-system-purple-on, #ffffff);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
2
+ `);H(`.al-trigger-btn{--at-bg: transparent;--at-bg-hover: #eaedf1;--at-color: var(--ds-content-high, rgba(0, 0, 0, .85));--at-border: none;--at-border-radius: 8px;--at-size: 36px;--at-padding: 0;--at-press-scale: .95;--at-transition: background-color .15s ease;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--at-size);height:var(--at-size);padding:var(--at-padding);border:var(--at-border);background:var(--at-bg);border-radius:var(--at-border-radius);color:var(--at-color);cursor:pointer;transition:var(--at-transition)}.al-trigger-btn:hover,.al-trigger-btn[data-state=open]{background:var(--at-bg-hover)}.al-trigger-btn:active:not(:disabled){background:var(--at-bg-hover);transform:scale(var(--at-press-scale))}.al-trigger-btn[data-theme=dark]{--at-color: var(--ds-content-high, rgba(255, 255, 255, .85));--at-bg-hover: #252b39}.al-trigger-btn[data-theme=light]{--at-color: var(--ds-content-high, rgba(0, 0, 0, .85))}
3
+ `);H(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
+ `);H(`.al-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;border-radius:24px;background:var(--al-bg);border:1px solid var(--al-popover-border, var(--al-border));box-shadow:var(--al-popover-shadow, var(--al-shadow));animation:al-fade-in .15s ease-out;max-height:80vh;overflow-x:hidden;overflow-y:auto;padding:20px 4px;box-sizing:border-box}.al-popover-content .al-grid{grid-template-columns:repeat(4,100px);row-gap:16px;column-gap:0;padding:0;justify-content:center;align-items:start}.al-popover-content .al-grid-item{flex-direction:column;justify-content:flex-start;align-items:center;gap:6px;padding:12px 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:50px;height:50px;border-radius:10.125px;overflow:hidden}.al-popover-content .al-grid-item-icon img{object-fit:cover}.al-popover-content .al-grid-item-label{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:1.1;letter-spacing:0;text-align:center;color:var(--al-text);max-width:100%;white-space:normal;overflow-wrap:anywhere}.al-popover-content .al-grid-item-right,.al-popover-content .al-badge-new{display:none}.al-drawer-overlay{position:fixed;inset:0;z-index:100000;background:var(--al-drawer-overlay)}.al-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;background:var(--al-bg);overflow-x:hidden;overflow-y:hidden;display:flex;flex-direction:column;box-sizing:border-box}.al-drawer-body{flex:1;overflow-y:auto;overscroll-behavior-y:contain;min-height:0}.al-drawer-content .al-grid{display:flex;flex-direction:column;grid-template-columns:none;max-width:100%;overflow:hidden;flex-shrink:0;gap:0;row-gap:0;column-gap:0;padding:8px 16px}.al-drawer-content .al-grid-item{width:100%;max-width:100%;gap:8px;padding: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:32px;height:32px;border-radius:6.75px;overflow:hidden}.al-drawer-content .al-grid-item-icon img{width:100%;height:100%;object-fit:cover;border-radius:6.75px}.al-drawer-content .al-grid-item-label{font-size:16px;line-height:1.35;letter-spacing:0;font-weight:400}.al-drawer-content .al-grid-item[data-active=true] .al-grid-item-label{font-weight:500}.al-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0}.al-drawer-title{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--al-text);margin:0}.al-drawer-close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--ds-content-low, #00000066);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:var(--al-bg);border-radius:8px;cursor:pointer;transition:none;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:#252b39!important}:root[data-ds-theme=light] .al-grid-item:hover,:root[data-ds-theme=light] .al-grid-item[data-active=true]{background:#eff3f8!important}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden}.al-grid-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain}.al-grid-item-label{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:150%;letter-spacing:0;color:var(--al-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.al-badge{display:flex;padding:1px 4px 2px;justify-content:center;align-items:center;gap:2px;border-radius:3px;background:var(--al-badge-bg);color:var(--al-badge-text);font-family:Pretendard,Inter,sans-serif;font-size:10px;font-weight:600;line-height:150%;letter-spacing:0;white-space:nowrap;flex-shrink:0}.al-badge-new{display:flex;width:16px;height:16px;justify-content:center;align-items:center;aspect-ratio:1/1;border-radius:12px;background:var(--ds-system-purple-high, #7346f3);color:var(--al-badge-new-text);font-family:Pretendard,Inter,sans-serif;font-size:9px;font-weight:700;flex-shrink:0}
5
+ `);H("");var ao=require("react/jsx-runtime");function Jo({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let a=hn(`(max-width: ${n}px)`),[i,l]=bn.useState(!1),p=bn.useCallback(()=>l(!1),[]),c=Be(e),f=bn.useMemo(()=>({env:c,theme:t,isMobile:a,open:i,domain:o,close:p}),[c,t,a,i,o,p]);return(0,ao.jsx)(Xo.Provider,{value:f,children:a?(0,ao.jsx)(Jr.Drawer.Root,{direction:"right",open:i,onOpenChange:l,noBodyStyles:!0,children:r},"drawer"):(0,ao.jsx)(Xr.Root,{open:i,onOpenChange:l,children:r},"popover")})}var oi=D(require("@radix-ui/react-popover"),1),ri=require("vaul");var Fe=require("react/jsx-runtime");function ei({size:e=18}){return(0,Fe.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,Fe.jsx)("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Fe.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function ti(){return(0,Fe.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Fe.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ni(){return(0,Fe.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Fe.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var In=require("react/jsx-runtime");function er({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:a}=ro(),i=t!=null,l=e??!0,p=n?`al-trigger-btn ${n}`:"al-trigger-btn",c=i?t:(0,In.jsx)("button",{type:"button",className:p,"data-theme":a,style:o,children:(0,In.jsx)(ei,{size:18})});return r?(0,In.jsx)(ri.Drawer.Trigger,{asChild:l,children:c}):(0,In.jsx)(oi.Trigger,{asChild:l,children:c})}var Jt=D(require("react"),1),so=D(require("@radix-ui/react-popover"),1),Xt=require("vaul");var si=require("@tanstack/react-query");var ii={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json"};var Fl="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Ml="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function ut(e,t){return`${e==="production"?Ml:Fl}/${t}.png`}function ai(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://dev-x.crosstoken.io/gametoken/CROSS",stage:"https://stg-x.crosstoken.io/gametoken/CROSS",production:"https://x.crosstoken.io/gametoken/CROSS"},iconUrl:ut(t,"dex"),order:1e3,type:"gametoken",badge:null,isNew:!1},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg-x.crosstoken.io/forge",stage:"https://stg-x.crosstoken.io/forge",production:"https://x.crosstoken.io/forge"},iconUrl:ut(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0},{id:"crossd",label:"Bridge (CROSSD)",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:ut(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:ut(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg-x.crosstoken.io/rewards",stage:"https://stg-x.crosstoken.io/rewards",production:"https://x.crosstoken.io/rewards"},iconUrl:ut(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:ut(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1},{id:"play",label:"Play",description:"Discover and play games on CROSS.",url:{dev:"https://stg-play.cross.nexus",stage:"https://stg-play.cross.nexus",production:"https://play.cross.nexus"},iconUrl:ut(t,"play"),order:8500,type:"play",badge:null,isNew:!0},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://www.dev.cross.shop/",stage:"https://www.stage.cross.shop/",production:"https://www.cross.shop/"},iconUrl:ut(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg-x.crosstoken.io/points",stage:"https://stg-x.crosstoken.io/points",production:"https://x.crosstoken.io/points"},iconUrl:ut(t,"point"),order:1e4,type:"points",badge:null,isNew:!1},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg-wave.crosstoken.io/en",stage:"https://stg-wave.crosstoken.io/en",production:"https://wave.crosstoken.io/en"},iconUrl:ut(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.crosstoken.io/612055",stage:"https://stg-explorer.crosstoken.io/612055",production:"https://explorer.crosstoken.io/612055"},iconUrl:ut(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1}]}}function Ln(e){let t=Be(e);return(0,si.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:n})=>{try{let o=await fetch(ii[t],{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch global menu: ${o.status}`);return o.json()}catch(o){if(n.aborted)throw o;return ai(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function ee(...e){return e.filter(Boolean).join(" ")}var ie=require("react/jsx-runtime");function _l(e){return e.id==="cross-staking"||e.type==="cross-staking"}function tr({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:a,domain:i,close:l}=ro(),{data:p}=Ln(o),c=Jt.useMemo(()=>(p?.items??[]).sort((w,y)=>w.order-y.order),[p]),f=8,m=Jt.useRef(null),h=Jt.useCallback(w=>{m.current={x:w.clientX,y:w.clientY}},[]),g=typeof window<"u"?window.location.pathname:"",v=Jt.useCallback((w,y)=>{if(m.current){let T=w.clientX-m.current.x,C=w.clientY-m.current.y;if(m.current=null,Math.abs(T)>f||Math.abs(C)>f)return}let L=y.url[o]??y.url.production,u=li(L,i);if(!u)try{let T=new URL(L).pathname;if(g===T||g.startsWith(T+"/")){l();return}}catch{}u?window.open(L,"_blank","noopener,noreferrer"):window.location.href=L,l()},[o,i,l,g]),x=(0,ie.jsx)("div",{className:"al-grid","data-theme":r,children:c.map(w=>{let y=w.url[o]??w.url.production,L=li(y,i),u=!1;if(!L)try{let T=new URL(y).pathname;u=g===T||g.startsWith(T+"/")}catch{u=!1}return(0,ie.jsxs)("button",{type:"button",className:"al-grid-item","data-active":u||void 0,onPointerDown:h,onClick:T=>v(T,w),children:[(0,ie.jsxs)("div",{className:"al-grid-item-left",children:[(0,ie.jsx)("div",{className:"al-grid-item-icon",children:(0,ie.jsx)("img",{src:w.iconUrl,alt:w.label,width:24,height:24,loading:"lazy"})}),(0,ie.jsx)("span",{className:"al-grid-item-label",children:w.label}),w.isNew&&(0,ie.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,ie.jsx)("div",{className:"al-grid-item-right",children:w.badge&&!_l(w)&&(0,ie.jsx)("span",{className:"al-badge",children:w.badge})})]},w.id)})});return a?(0,ie.jsxs)(Xt.Drawer.Portal,{children:[(0,ie.jsx)(Xt.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,ie.jsxs)(Xt.Drawer.Content,{className:ee("al-drawer-content",n),"data-theme":r,children:[(0,ie.jsxs)("div",{className:"al-drawer-header",children:[(0,ie.jsx)(Xt.Drawer.Close,{className:"al-drawer-close",children:(0,ie.jsx)(ti,{})}),(0,ie.jsx)(Xt.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,ie.jsx)(Xt.Drawer.Close,{className:"al-drawer-close",children:(0,ie.jsx)(ni,{})})]}),(0,ie.jsx)("div",{className:"al-drawer-body",children:x})]})]}):(0,ie.jsx)(so.Portal,{children:(0,ie.jsx)(so.Content,{align:e,sideOffset:t,className:ee("al-popover-content",n),"data-theme":r,children:x})})}function li(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}var He=D(require("react"),1),Us=D(require("@radix-ui/react-popover"),1),$s=require("vaul");var lo=require("react"),nr=(0,lo.createContext)(null);function Ht(){let e=(0,lo.useContext)(nr);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var co=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(co||{}),En={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 Ji=D(require("react"),1);var G=require("react/jsx-runtime");function ci({size:e=16,className:t}){return(0,G.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,G.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,G.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 An({size:e=16,className:t}){return(0,G.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,G.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 en({size:e=16,className:t}){return(0,G.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,G.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Nt({size:e=24,className:t}){return(0,G.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,G.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function di({size:e=20,className:t}){return(0,G.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,G.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,G.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 or({size:e=20,className:t}){return(0,G.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,G.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 tn({size:e=20,className:t}){return(0,G.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,G.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function nn({size:e=20,className:t}){return(0,G.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,G.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function pi({size:e=16,className:t}){return(0,G.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,G.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,G.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 fi({size:e=16,className:t}){return(0,G.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,G.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,G.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function ui({size:e=42,className:t}){return(0,G.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,G.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})})}function mi({size:e=20,className:t}){return(0,G.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,G.jsx)("path",{d:"M9.19133 10.8077C9.04905 10.6657 8.87947 10.554 8.69283 10.4792L2.78881 8.11167C2.71832 8.08338 2.65816 8.03421 2.61642 7.97075C2.57468 7.90729 2.55335 7.83258 2.5553 7.75665C2.55724 7.68072 2.58237 7.6072 2.6273 7.54596C2.67224 7.48472 2.73483 7.4387 2.80668 7.41406L16.9525 2.5747C17.0185 2.55087 17.0899 2.54632 17.1583 2.56159C17.2268 2.57685 17.2895 2.6113 17.3391 2.66089C17.3887 2.71049 17.4231 2.77319 17.4384 2.84165C17.4536 2.9101 17.4491 2.9815 17.4253 3.04746L12.5859 17.1933C12.5613 17.2651 12.5152 17.3277 12.454 17.3727C12.3928 17.4176 12.3192 17.4427 12.2433 17.4447C12.1674 17.4466 12.0927 17.4253 12.0292 17.3835C11.9658 17.3418 11.9166 17.2817 11.8883 17.2112L9.52073 11.3056C9.44567 11.1191 9.33362 10.9498 9.19133 10.8077ZM9.19133 10.8077L17.3367 2.66404",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function gi({size:e=20,className:t}){return(0,G.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,G.jsx)("path",{d:"M10.8333 14.1667V7.5M15 14.1667V4.16667M2.5 2.5V15.8333C2.5 16.2754 2.67559 16.6993 2.98816 17.0118C3.30072 17.3244 3.72464 17.5 4.16667 17.5H17.5M6.66667 14.1667V11.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function hi({size:e=20,className:t}){return(0,G.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,G.jsx)("path",{d:"M6.6665 9.99984H13.3332M9.99984 6.6665V13.3332M18.3332 9.99984C18.3332 14.6022 14.6022 18.3332 9.99984 18.3332C5.39746 18.3332 1.6665 14.6022 1.6665 9.99984C1.6665 5.39746 5.39746 1.6665 9.99984 1.6665C14.6022 1.6665 18.3332 5.39746 18.3332 9.99984Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function bi({size:e=20,className:t}){return(0,G.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,G.jsx)("path",{d:"M6.667 2.5 3.333 5.833 6.667 9.167M3.333 5.833h13.334M13.333 17.5l3.334-3.333-3.334-3.334M16.667 14.167H3.333",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function wi({size:e=20,className:t}){return(0,G.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,G.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),(0,G.jsx)("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}var E=D(require("react"),1);var Gt=D(require("bignumber.js"),1);function Ol(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 Ut(e,t){if(!e||e==="0")return"0.00";let n=new Gt.default(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,Gt.default.ROUND_DOWN)}function et(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function rr(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,o=Math.pow(10,n);return`$${(Math.floor(t*o)/o).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function xi(e,t,n){let r=new Gt.default(e).shiftedBy(-t).multipliedBy(new Gt.default(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(Gt.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,Gt.default.ROUND_DOWN):r.decimalPlaces(4,Gt.default.ROUND_DOWN)).toFormat()}`}function vi(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 n=t;if(n.includes("e")||n.includes("E")){let i=Number(n);if(!Number.isFinite(i)||i===0)return{displayValue:"0",isLowerBound:!1};n=Ol(i.toFixed(18))}let[o="0",r=""]=n.split(".");if(Number(o)>=1){let i=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${i}`,isLowerBound:!1}}return r.length<4?{displayValue:`${o}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}var yi=require("react"),ki=require("@tanstack/react-query");var st={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},Me={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var zl="send:chain-info";function Wl(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let n=t[0];if(!n)throw new Error("Chain info payload is empty.");return n}return t}return e}function ir(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function Dl(e,t,n,o){if(o)return t===Me[e].cross?Si(t,o):n?.explorer_url?ir(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):Hl(e,t,o)}function Si(e,t){return ir("https://explorer.crosstoken.io",String(e),"tx",t)}function Hl(e,t,n){let o=Me[e];if(t===o.cross)return Si(t,n);if(t===o.bsc)return ir(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function po(e,t,n,o=!0){let r=st[e],a=(0,ki.useQuery)({queryKey:[zl,e,t],queryFn:async({signal:p})=>{let c=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:p});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let f=await c.json();if("code"in f&&f.code!==void 0&&f.code!==200)throw new Error(`Chain info API error: ${f.code}`);return Wl(f)},enabled:o,staleTime:300*1e3}),i=a.data;return{transactionUrl:(0,yi.useMemo)(()=>Dl(e,t,i,n),[t,i,e,n]),chainInfo:i,...a}}var Ci="0x0000000000000000000000000000000000000001";var Gl="0xa9059cbb",Ul=/^0x[a-fA-F0-9]{40}$/,$l="nexus-cross:dapp-ui:send:recent:",Ri=10;function jl(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Pn(e){return e.toLowerCase()}function Tt(e){return Ul.test(e)}function $t(e){return Pn(e.address)===Ci}function ar(e){return`${$l}${e.toLowerCase()}`}function wn(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(ar(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&Tt(o.address)&&typeof o.updatedAt=="number").slice(0,Ri):[]}catch{return[]}}function sr(e,t){if(typeof window>"u")return[];let n=Pn(t),o=[{address:n,updatedAt:Date.now()},...wn(e).filter(r=>r.address!==n)].slice(0,Ri);try{window.localStorage.setItem(ar(e),JSON.stringify(o))}catch{return wn(e)}return o}function lr(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(ar(e))}catch{}}function on(e,t){let n=e.trim();if(!n)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(n))return{error:"Enter a valid amount."};let[o="0",r=""]=n.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let a=BigInt(o||"0"),i=r.padEnd(t,"0"),l=i?BigInt(i):0n,p=10n**BigInt(t),c=a*p+l;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function cr(e,t){let n=BigInt(e||"0"),o=10n**BigInt(t),r=n/o,a=n%o;if(a===0n)return r.toString();let i=jl(a.toString().padStart(t,"0"));return`${r.toString()}.${i}`}function dr(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${Gl}${n}${o}`}function fo(e,t,n=10){if(t<=0)return e.toString();let o=10n**BigInt(t),r=e/o,a=e%o;if(a===0n)return r.toString();let l=a.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return l=l.replace(/0+$/,""),l?`${r.toString()}.${l}`:r.toString()}function pr(e,t){return fo(e,t,6)}function Ni(e){return fo(e,9,2)}function Ti(e){return e.toLocaleString("en-US")}function uo(e){return e===56||e===97}function mo(e){return e.gasPrice??e.maxFeePerGas}function Ii(e,t=!1){return t?mo(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function go(e,t=!1){if(t){let n=mo(e);return n!==void 0?e.gasLimit*n:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function ho(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Li(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let n=e,o=[];return typeof n.name=="string"&&o.push(n.name),typeof n.shortMessage=="string"&&o.push(n.shortMessage),typeof n.message=="string"&&o.push(n.message),typeof n.details=="string"&&o.push(n.details),n.cause!==void 0&&o.push(Li(n.cause,t+1)),o.join(`
6
+ `).toLowerCase()}function Vl(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;if(e&&typeof e=="object"){let t=e;if(typeof t.shortMessage=="string")return t.shortMessage;if(typeof t.message=="string")return t.message}return""}function fr(e,t={},n="Failed to send transaction."){let o=Li(e);if(!o)return n;let r=t.nativeSymbol?.trim()||"gas token",a=t.networkName?.trim();if(o.includes("user rejected")||o.includes("userrejected")||o.includes("user denied")||o.includes("user cancelled")||o.includes("user canceled")||o.includes("action_rejected")||o.includes("rejected by user"))return"Transaction was cancelled.";if(o.includes("insufficientfunds")||o.includes("insufficient funds")||o.includes("exceeds the balance of the account")||o.includes("insufficient balance for transfer")){let i=a?` on ${a}`:"";return`Not enough ${r} to cover the gas fee.Please top up your ${r} balance and try again.`}return o.includes("transaction underpriced")||o.includes("replacement transaction underpriced")||o.includes("fee too low")?"Gas fee was too low for the network. Please try again.":o.includes("nonce too low")||o.includes("nonce has already been used")||o.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":o.includes("execution reverted")||o.includes("contractfunctionrevertederror")||o.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":o.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":o.includes("http request failed")||o.includes("failed to fetch")||o.includes("network request failed")||o.includes("timeout")||o.includes("econnreset")||o.includes("rpc error")||o.includes("429")?"Network connection failed. Check your internet and try again.":o.includes("estimategas")||o.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":Vl(e)||n}var ql=2000000000n,Kl=1000000000n;async function bo(e,t,n){let o=new AbortController,r=setTimeout(()=>o.abort(),8e3),a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:n}),signal:o.signal}).finally(()=>clearTimeout(r));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let i=await a.json();if(i.error)throw new Error(`RPC ${t}: ${i.error.message}`);if(i.result===void 0)throw new Error(`RPC ${t}: empty result`);return i.result}function wo(e){return BigInt(e)}function Ql(e){return`0x${e.toString(16)}`}function Yl(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Ql(e.value)),e.data&&(t.data=e.data),t}function Zl(e){return e===56||e===97}async function Ei(e){try{let t=await bo(e,"eth_gasPrice",[]);return{gasPrice:wo(t)}}catch{return{gasPrice:ql}}}async function Xl(e,t){let n=Kl;try{let o=await bo(e,"eth_maxPriorityFeePerGas",[]);n=wo(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Jl(e,t){if(t)return Ei(e);let n;try{n=(await bo(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?Xl(e,wo(n)):Ei(e)}async function Ai(e,t){let n=Zl(t.chainId),o=Yl(t),[r,a]=await Promise.all([bo(e,"eth_estimateGas",[o]),Jl(e,n)]);return{gasLimit:wo(r),gasPrice:a.gasPrice,maxFeePerGas:a.maxFeePerGas,maxPriorityFeePerGas:a.maxPriorityFeePerGas}}function Pi(e){let{estimateGas:t,sendTransaction:n,getTransactionReceipt:o}=e;return{canSend:!!n,canEstimateGas(r){return!!t||!!r},async estimateGas(r,a){if(t)return t(r);if(a)return Ai(a,r);throw new Error("Gas estimation is not available.")},async sendTransaction(r){if(!n)throw new Error("Sending is not available for this wallet.");return n(r)},getTransactionReceipt:o}}var ec=1500,tc=120;function Bi(e){return!!(e.token||e.recipient||e.amount)}function ur({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},a=e.trim(),i=on(t,n.quantity.decimals),l;return a?Tt(a)||(r.recipient="Enter a valid EVM recipient address."):r.recipient="Enter a recipient address.","error"in i?r.amount=i.error:(l=i.value,l>o&&(r.amount="Amount exceeds available balance.")),!$t(n)&&!Tt(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:l,recipient:a&&Tt(a)?a:void 0}}function mr({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return $t(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:Pn(e.address),data:dr(n,o),value:0n,chainId:e.chainId,from:r}}function nc(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var oc=e=>new Promise(t=>setTimeout(t,e));async function Fi({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=ec,pollMaxAttempts:a=tc}){let i=await e.sendTransaction(t);o(i);let{getTransactionReceipt:l}=e;if(!l)return"success";for(let p=0;p<a;p+=1){let c=await l({hash:i,chainId:n}).catch(()=>null);if(c)return nc(c)?"reverted":"success";await oc(r)}return"timeout"}var Mi=["token","recipient","amount","review"];function _i(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:a="recipient",token:i,tokens:l=[],onTokenChange:p,sendTransaction:c,getTransactionReceipt:f,estimateGas:m,getTokenPriceUsd:h,onSubmitted:g,onSuccess:v,onFailed:x,onExit:w,onOutlink:y}=e,L=E.useMemo(()=>Pi({sendTransaction:c,getTransactionReceipt:f,estimateGas:m}),[c,f,m]),[u,T]=E.useState(i);E.useEffect(()=>{T(i)},[i.address,i.chainId]);let[C,A]=E.useState(a),[F,J]=E.useState(""),[_,Y]=E.useState(""),[z,ne]=E.useState({}),[O,ke]=E.useState("idle"),[ce,fe]=E.useState(""),[Ke,ue]=E.useState(""),[$,me]=E.useState(null),[le,j]=E.useState(!1),[Qe,we]=E.useState(""),Oe=E.useRef(0),[xe,ct]=E.useState(null),[Te,Dt]=E.useState(""),[Ge,yt]=E.useState(()=>wn(n)),At=E.useMemo(()=>Be(t),[t]),{transactionUrl:ge,chainInfo:Se}=po(At,u.chainId,ce||void 0,!0),nt=Se?.currency_symbol??"",Ie=Se?.name??`Chain ID ${u.chainId}`,Ce=E.useRef({nativeSymbol:nt||void 0,networkName:Ie,tokenSymbol:u.symbol});Ce.current={nativeSymbol:nt||void 0,networkName:Ie,tokenSymbol:u.symbol};let he=E.useMemo(()=>BigInt(u.quantity.numeric||"0"),[u.quantity.numeric]),kt=E.useMemo(()=>Ut(u.quantity.numeric,u.quantity.decimals),[u.quantity.numeric,u.quantity.decimals]),Ye=h?.(u),St=E.useMemo(()=>{if(Ye===void 0)return;let k=parseFloat(_.replace(/,/g,""));return Number.isFinite(k)?k*Ye:0},[_,Ye]);E.useEffect(()=>{Y(""),ne({})},[u.address,u.chainId]),E.useEffect(()=>{Oe.current+=1,me(null),we(""),j(!1)},[u.address,u.chainId,F,_]),E.useEffect(()=>{yt(wn(n))},[n]);let Ze=E.useCallback(k=>{J(k),ne(K=>({...K,recipient:void 0}))},[]),ot=E.useCallback(k=>{Y(k),ne(K=>({...K,amount:void 0}))},[]),Ue=E.useCallback(()=>{Y(kt.replace(/,/g,"")),ne(k=>({...k,amount:void 0}))},[kt]),Le=E.useCallback(k=>{T(k),p?.(k),A("recipient")},[p]),dt=E.useCallback(()=>A("token"),[]),Xe=E.useCallback(()=>{A(k=>{if(k==="result")return"review";if(k===a)return w?.(),k;let K=Mi.indexOf(k);return K<=0?(w?.(),k):Mi[K-1]})},[a,w]),$e=E.useCallback(()=>{let{errors:k}=ur({recipient:F,amount:"1",token:u,balanceRaw:he});if(k.recipient){ne(K=>({...K,recipient:k.recipient}));return}ne(K=>({...K,recipient:void 0})),A("amount")},[F,u,he]),Re=E.useCallback(k=>{J(k),ne(K=>({...K,recipient:void 0})),A("amount")},[]),de=E.useCallback(()=>{let k=ur({recipient:F,amount:_,token:u,balanceRaw:he});ne(k.errors),!(Bi(k.errors)||k.rawAmount===void 0||!k.recipient)&&(ct(k.rawAmount),Dt(k.recipient),me(null),we(""),ke("idle"),A("review"))},[F,_,u,he]);E.useEffect(()=>{if(C!=="review"||!Te||xe===null||$!==null||le||Qe||!L.canEstimateGas(Se?.rpc))return;let k=++Oe.current;j(!0),we(""),(async()=>{try{let K=mr({token:u,walletAddress:n,recipient:Te,rawAmount:xe}),pe=await L.estimateGas(K,Se?.rpc);if(Oe.current!==k)return;me(pe)}catch(K){if(Oe.current!==k)return;we(fr(K,Ce.current,"Failed to estimate gas."))}finally{Oe.current===k&&j(!1)}})()},[C,Te,xe,$,le,Qe,L,Se?.rpc,u,n]);let rt=E.useMemo(()=>{if(!$t(u)||!$||xe===null)return!1;let k=go($,uo(u.chainId));return k===null?!1:xe+k>he},[u,$,xe,he]),pt=E.useCallback(async()=>{if(!(!Te||xe===null)&&!rt){ue(""),fe(""),ke("submitting");try{let k="",K=await Fi({repository:L,args:mr({token:u,walletAddress:n,recipient:Te,rawAmount:xe}),chainId:u.chainId,onSubmitted:pe=>{k=pe,fe(pe),ke("confirming"),yt(sr(n,Te)),g?.({txHash:pe,chainId:u.chainId,amount:_,tokenSymbol:u.symbol,recipient:Te})}});if(K==="success")ke("success"),k&&v?v?.(k):A("result");else if(K==="reverted"){let pe="Transaction reverted on-chain.";ke("error"),ue(pe),k&&x?x({txHash:k,chainId:u.chainId,message:pe}):A("result")}else{let pe="Transaction receipt was not found. Please check again later.";ke("error"),ue(pe),k&&x?x({txHash:k,chainId:u.chainId,message:pe}):A("result")}}catch(k){ke("error"),ue(fr(k,{nativeSymbol:nt||void 0,networkName:Ie,tokenSymbol:u.symbol})),A("result")}}},[L,Te,xe,rt,u,_,n,g,v,x,nt,Ie]),[je,ft]=E.useState(!1),it=E.useRef(void 0);E.useEffect(()=>()=>clearTimeout(it.current),[]);let Ve=E.useCallback(async()=>{if(ce)try{await navigator.clipboard.writeText(ce),ft(!0),clearTimeout(it.current),it.current=setTimeout(()=>ft(!1),2e3)}catch{}},[ce]),at=E.useCallback(()=>{if(!ge||!ce)return;let k=Ee=>{typeof window<"u"&&window.open(Ee,"_blank","noopener,noreferrer")};if(!y){k(ge);return}let K=y(ge,{category:"send",origin:"send-transaction",payload:{chainId:u.chainId,txHash:ce}});if(K&&typeof K.then=="function"){let Ee=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;K.then(Ct=>{if(Ct===null){Ee?.close();return}let Rt=Ct??ge;if(Ee)try{Ee.location.href=Rt}catch{Ee.close(),k(Rt)}else k(Rt)});return}let pe=K;pe!==null&&k(pe??ge)},[y,u.chainId,ge,ce]),qe=E.useCallback(()=>{ue(""),fe(""),ke("idle"),me(null),we(""),A("review")},[]);return{step:C,status:O,token:u,tokens:l.length>0?l:[u],recipient:F,amount:_,amountUsd:St,fieldErrors:z,error:Ke,txHash:ce,gasEstimate:$,gasLoading:le,gasError:Qe,insufficientGas:rt,reviewRawAmount:xe,reviewRecipient:Te,recentAddresses:Ge,accounts:r,accountName:o,walletAddress:n,resolvedEnv:At,transactionUrl:ge,networkName:Ie,nativeSymbol:nt,nativeDecimals:Se?.currency_decimals??u.quantity.decimals,balanceRaw:he,balanceText:kt,priceUsd:Ye,canSelectToken:(l.length>0?l:[u]).length>1,canSend:L.canSend,getTokenPriceUsd:h,setRecipient:Ze,setAmount:ot,setMax:Ue,selectToken:Le,goToTokenSelect:dt,selectRecipient:Re,submitRecipient:$e,submitAmount:de,confirmSend:pt,retry:qe,back:Xe,hashCopied:je,copyHash:Ve,openTransaction:at}}var mt=D(require("react"),1);var It=require("react/jsx-runtime");function Oi({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:a,token:i,setMax:l}=e,p=mt.useRef(null),c=mt.useCallback(()=>{requestAnimationFrame(()=>{let x=p.current;if(!x)return;let w=x.value.length;x.setSelectionRange(w,w)})},[]);mt.useEffect(()=>{p.current?.focus(),c()},[c]),mt.useEffect(()=>{t===""&&(h(!1),c())},[t,c]);let f=mt.useMemo(()=>{let x=on(t,i.quantity.decimals);return"value"in x&&x.value>a},[t,i.quantity.decimals,a]),[m,h]=mt.useState(!1),g=!m&&t===""?"0.00":t,v=t.trim()===""||t.trim()==="0";return(0,It.jsx)("div",{className:"sf-body sf-amount",children:(0,It.jsxs)("div",{className:"sf-amount-center",children:[(0,It.jsx)("span",{className:"sf-amount-usd",children:o!==void 0?ho(o):"\xA0"}),(0,It.jsx)("div",{className:"sf-amount-input-wrap","data-over":f||void 0,"data-empty":v||void 0,onClick:()=>p.current?.focus(),children:(0,It.jsx)("input",{ref:p,className:"sf-amount-input",value:g,onChange:x=>{let w=x.target.value;if(m)n(w);else if(t===""){if(w.length<4)return;h(!0);let y=w.startsWith("0.00")?w.slice(4):w;n(y)}else h(!0),n(w)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${i.symbol}`,size:1})}),(0,It.jsxs)("div",{className:"sf-amount-balance",children:[(0,It.jsx)("span",{children:"Balance:"}),(0,It.jsxs)("button",{type:"button",className:"sf-amount-max",onClick:l,children:[r," ",i.symbol]})]})]})})}var gt=D(require("react"),1);var gr={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"},zi={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Bn(e,t){let n=Me[e];if(t===n.cross)return zi.cross;if(t===n.bsc)return zi.bsc}var rc={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Ft(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:a="png"}=n,i=rc[e],l=r?`&bg=${r}`:"";return`${i}/portrait/evm/${t}.${a}?size=${o}${l}`}var ye=require("react/jsx-runtime");function Wi({size:e=20,className:t}){return(0,ye.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,ye.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),(0,ye.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Di({size:e=20,className:t}){return(0,ye.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,ye.jsx)("path",{d:"M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2M12 11v6M9 14h6",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function Hi({size:e=20,className:t}){return(0,ye.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,ye.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),(0,ye.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Gi({size:e=16,className:t}){return(0,ye.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:(0,ye.jsx)("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ui({size:e=56,className:t}){return(0,ye.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,ye.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),(0,ye.jsx)("path",{d:"M17 28.5 24.2 35.5 39 20.5",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function $i({size:e=56,className:t}){return(0,ye.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,ye.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),(0,ye.jsx)("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}var Q=require("react/jsx-runtime");function ji(e,t){return e.name||`Account ${(e.index??t)+1}`}function Vi(e){return e.trim().slice(0,1).toUpperCase()||"A"}function qi(e){return e.toLowerCase()}function Ki({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:a,walletAddress:i,resolvedEnv:l,selectRecipient:p}=e,c=gt.useMemo(()=>a.filter(u=>u.address.toLowerCase()!==i.toLowerCase()),[a,i]),f=c.length>0,m=gt.useMemo(()=>new Map(c.map((u,T)=>[qi(u.address),{account:u,index:T}])),[c]),[h,g]=gt.useState("recent"),v=gt.useRef(null);gt.useEffect(()=>{v.current?.focus()},[]);let x="1A1A2E",w=gt.useCallback(async()=>{try{let u=await navigator.clipboard.readText();u&&n(u.trim())}catch{}},[n]),y=t.trim().length>0,L=Tt(t.trim());return(0,Q.jsxs)("div",{className:"sf-recipient",children:[(0,Q.jsxs)("div",{className:"sf-recipient-top",children:[(0,Q.jsxs)("div",{className:"sf-address-field","data-filled":y||void 0,"data-invalid":o.recipient||void 0,children:[(0,Q.jsx)("textarea",{ref:v,className:"sf-address-input",value:t,onChange:u=>n(u.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:y?2:1}),y?(0,Q.jsx)("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear",children:(0,Q.jsx)(Hi,{size:20})}):(0,Q.jsx)("button",{type:"button",className:"sf-address-action",onClick:w,"aria-label":"Paste from clipboard",children:(0,Q.jsx)(Di,{size:20})})]}),o.recipient&&(0,Q.jsx)("p",{className:"sf-field-error",role:"alert",children:o.recipient}),(0,Q.jsxs)("div",{className:"sf-tabs",role:"tablist",children:[(0,Q.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":h==="recent"||void 0,"aria-selected":h==="recent",onClick:()=>g("recent"),children:"Recent"}),f&&(0,Q.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":h==="account"||void 0,"aria-selected":h==="account",onClick:()=>g("account"),children:"My Account"})]})]}),(0,Q.jsx)("div",{className:"sf-address-list",children:h==="account"&&f?c.map((u,T)=>{let C=ji(u,T),A=Ft(l,u.address,{size:56,bg:x});return(0,Q.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>p(u.address),children:[(0,Q.jsxs)("span",{className:"sf-address-avatar",children:[A&&(0,Q.jsx)("img",{src:A,alt:"",width:40,height:40,draggable:!1,onError:F=>{F.currentTarget.style.display="none"}}),(0,Q.jsx)("span",{className:"sf-address-avatar-fallback",children:Vi(C)})]}),(0,Q.jsxs)("span",{className:"sf-address-meta",children:[(0,Q.jsx)("span",{className:"sf-address-name",children:C}),(0,Q.jsx)("span",{className:"sf-address-value",children:et(u.address)})]})]},u.address)}):r.length>0?r.map(u=>{let T=m.get(qi(u.address)),C=T?ji(T.account,T.index):et(u.address),A=Ft(l,u.address,{size:56,bg:x});return(0,Q.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>p(u.address),children:[(0,Q.jsxs)("span",{className:"sf-address-avatar",children:[A&&(0,Q.jsx)("img",{src:A,alt:"",width:40,height:40,draggable:!1,onError:F=>{F.currentTarget.style.display="none"}}),(0,Q.jsx)("span",{className:"sf-address-avatar-fallback",children:Vi(C)})]}),(0,Q.jsxs)("span",{className:"sf-address-meta",children:[(0,Q.jsx)("span",{className:"sf-address-name",children:C}),(0,Q.jsx)("span",{className:"sf-address-value",children:et(u.address)})]})]},u.address)}):(0,Q.jsx)("div",{className:"sf-empty",children:"No send history"})}),y&&!L&&!o.recipient&&(0,Q.jsx)("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}var ae=require("react/jsx-runtime");function Yi({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:a,openTransaction:i}=e,l=t==="error",p=t==="success";return l?(0,ae.jsxs)("div",{className:"sf-body sf-result sf-result--error",children:[(0,ae.jsx)("span",{className:"sf-result-icon",children:(0,ae.jsx)($i,{size:56})}),(0,ae.jsxs)("div",{className:"sf-result-copy",children:[(0,ae.jsx)("h3",{className:"sf-result-title",children:"Transaction Failed"}),(0,ae.jsx)("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&(0,ae.jsx)(Qi,{txHash:n,hashCopied:a,onCopy:r,onOpen:i})]}):(0,ae.jsxs)("div",{className:"sf-body sf-result",children:[(0,ae.jsx)("span",{className:"sf-result-icon","data-pending":!p||void 0,children:p?(0,ae.jsx)(Ui,{size:56}):(0,ae.jsx)("span",{className:"sf-result-spinner"})}),(0,ae.jsxs)("div",{className:"sf-result-copy",children:[(0,ae.jsx)("h3",{className:"sf-result-title",children:p?"Transaction Complete":"Transaction in Progress"}),(0,ae.jsx)("p",{className:"sf-result-desc",children:p?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&(0,ae.jsx)(Qi,{txHash:n,hashCopied:a,onCopy:r,onOpen:i})]})}function Qi({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return(0,ae.jsxs)("div",{className:"sf-result-hash-card",children:[(0,ae.jsx)("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),(0,ae.jsxs)("div",{className:"sf-result-hash-row",children:[(0,ae.jsx)("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer",children:et(e)}),(0,ae.jsx)("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash",children:t?(0,ae.jsx)(en,{size:16}):"Copy"})]})]})}var U=require("react/jsx-runtime"),xo="\u2014";function Zi({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:a,walletAddress:i,networkName:l,nativeSymbol:p,nativeDecimals:c,gasEstimate:f,gasLoading:m,gasError:h,insufficientGas:g,error:v,resolvedEnv:x}=e,w=$t(t),y=n!==null?fo(n,t.quantity.decimals):"",L=r?.trim()||`Account ${(a[0]?.index??0)+1}`,u=Ft(x,i,{size:56,bg:"1A1A2E"}),T=p||(w?t.symbol:""),C=uo(t.chainId),A=f?Ii(f,C):null,F=f?go(f,C):null,J=O=>O!==null&&T?`${pr(O,c)} ${T}`:xo,_=O=>O!==void 0?`${Ni(O)} Gwei`:xo,Y=(()=>{if(!w||!f||F===null||n===null)return xo;let O=n+F;return`${pr(O,c)} ${T||t.symbol}`})(),z=O=>m?"\u2026":O,ne=[{label:"Est. Tx Fee",value:z(J(F))},...A==="dynamic"?[{label:"Max Priority Fee",value:z(_(f?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:z(_(f?.maxFeePerGas))}]:A==="legacy"?[{label:"Gas Price",value:z(_(f?mo(f):void 0))}]:[],{label:"Gas Limit",value:z(f?Ti(f.gasLimit):xo)}];return(0,U.jsxs)("div",{className:"sf-body sf-review",children:[(0,U.jsxs)("div",{className:"sf-review-amount",children:[(0,U.jsx)("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:O=>{O.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,U.jsxs)("span",{className:"sf-review-amount-value",children:[y,(0,U.jsx)("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),(0,U.jsxs)("div",{className:"sf-review-parties",children:[(0,U.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,U.jsx)("span",{className:"sf-review-party-label",children:"From"}),(0,U.jsxs)("div",{className:"sf-review-party-head",children:[(0,U.jsx)("span",{className:"sf-review-party-avatar",children:u&&(0,U.jsx)("img",{src:u,alt:"",width:28,height:28,draggable:!1,onError:O=>{O.currentTarget.style.display="none"}})}),(0,U.jsx)("span",{className:"sf-review-party-name",children:L})]}),(0,U.jsx)("span",{className:"sf-review-party-addr",children:i})]}),(0,U.jsx)("span",{className:"sf-review-arrow","aria-hidden":!0,children:(0,U.jsx)(Gi,{size:16})}),(0,U.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,U.jsx)("span",{className:"sf-review-party-label",children:"To"}),(0,U.jsx)("span",{className:"sf-review-party-addr",children:o})]})]}),(0,U.jsxs)("section",{className:"sf-review-card",children:[(0,U.jsx)("h3",{className:"sf-review-section-title",children:"Summary"}),(0,U.jsxs)("div",{className:"sf-review-row",children:[(0,U.jsx)("span",{className:"sf-review-row-label",children:"Network"}),(0,U.jsx)("span",{className:"sf-review-row-value",children:l})]}),ne.map(O=>(0,U.jsxs)("div",{className:"sf-review-row",children:[(0,U.jsx)("span",{className:"sf-review-row-label",children:O.label}),(0,U.jsx)("span",{className:"sf-review-row-value",children:O.value})]},O.label))]}),(0,U.jsxs)("section",{className:"sf-review-card",children:[(0,U.jsx)("h3",{className:"sf-review-section-title",children:"Total"}),(0,U.jsxs)("div",{className:"sf-review-row",children:[(0,U.jsx)("span",{className:"sf-review-row-label",children:"Total Amount"}),(0,U.jsxs)("span",{className:"sf-review-row-value",children:[y," ",t.symbol]})]}),w&&(0,U.jsxs)("div",{className:"sf-review-row",children:[(0,U.jsx)("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),(0,U.jsx)("span",{className:"sf-review-row-value",children:z(Y)})]})]}),g&&!h&&!v&&(0,U.jsxs)("div",{className:"sf-message sf-message--error",role:"alert",children:["Not enough ",T||t.symbol," to cover the amount plus the network fee. Reduce the amount and try again."]}),(h||v)&&(0,U.jsx)("div",{className:"sf-message sf-message--error",role:"alert",children:h||v})]})}var vo=D(require("react"),1);var Ne=require("react/jsx-runtime");function Xi({flow:e}){let[t,n]=vo.useState(""),o=t.trim().toLowerCase(),r=vo.useMemo(()=>o?e.tokens.filter(a=>a.symbol.toLowerCase().includes(o)||a.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return(0,Ne.jsxs)("div",{className:"sf-body sf-token-select",children:[(0,Ne.jsxs)("div",{className:"sf-search",children:[(0,Ne.jsx)(Wi,{size:20}),(0,Ne.jsx)("input",{className:"sf-search-input",value:t,onChange:a=>n(a.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),(0,Ne.jsxs)("div",{className:"sf-token-list",children:[r.map(a=>{let i=`${a.chainId}:${a.address.toLowerCase()}`,l=Bn(e.resolvedEnv,a.chainId),p=e.getTokenPriceUsd?.(a);return(0,Ne.jsxs)("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(a),children:[(0,Ne.jsxs)("span",{className:"sf-token-left",children:[(0,Ne.jsxs)("span",{className:"sf-token-icon-wrap",children:[(0,Ne.jsx)("img",{className:"sf-token-icon",src:a.icon_url,alt:"",width:40,height:40,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),l&&(0,Ne.jsx)("img",{className:"sf-token-chain-badge",src:l,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.style.display="none"}})]}),(0,Ne.jsx)("span",{className:"sf-token-name",children:a.symbol})]}),(0,Ne.jsxs)("span",{className:"sf-token-right",children:[(0,Ne.jsx)("span",{className:"sf-token-balance",children:Ut(a.quantity.numeric,a.quantity.decimals)}),p!==void 0&&(0,Ne.jsx)("span",{className:"sf-token-price",children:ho(p)})]})]},i)}),r.length===0&&(0,Ne.jsx)("div",{className:"sf-empty",children:"No tokens found"})]})]})}H(`.sf-root{display:flex;flex-direction:column;flex:1;min-height:0;font-family:inherit}.sf-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px;flex-shrink:0;position:relative;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.sf-header .sf-header-btn:last-child{position:absolute;top:24px;right:24px}.sf-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;filter:none;transition:color .15s ease}.sf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));filter:none}.sf-header-title{position:absolute;left:50%;transform:translate(-50%);text-align:center;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);pointer-events:none}.sf-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .sf-body{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-body::-webkit-scrollbar{width:4px;height:4px}.sf-body::-webkit-scrollbar-track,.sf-body::-webkit-scrollbar-corner{background:transparent}.sf-body::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}.sf-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .sf-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .sf-body::-webkit-scrollbar-thumb:hover{background:#0003}.sf-empty{padding:32px 0;text-align:center;font-family:inherit;font-size:14px;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-field-error{margin:8px 24px 0;font-family:inherit;font-size:12px;line-height:1.5;color:var(--ds-system-red-default, #da0b2e)}.sf-message--error{margin:16px 0 0;padding:12px 16px;background:var(--ds-system-red-low, #ffeeee);color:var(--ds-system-red-high, #d20609);font-family:inherit;font-size:13px;line-height:1.5;border-radius:12px;width:100%;box-sizing:border-box}.sf-footer{display:flex;flex-shrink:0;padding:16px 24px 24px}.sf-footer:empty{display:none}.sf-footer-row{display:flex;gap:8px;width:100%}.sf-footer-row .sf-btn,.sf-footer-row .sf-btn--secondary{flex:1 1 0;min-width:0}.sf-footer>.sf-btn{width:100%}.sf-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:1;height:48px;padding:0 24px;border:none;border-radius:12px;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:background-color .15s ease,transform .1s ease}.sf-btn--primary{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff)}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){background:var(--ds-accent-primary-high, #00a0a2)}.sf-btn--primary:active:not(:disabled):not([data-disabled]){transform:scale(.97)}.sf-btn--primary[data-disabled],.sf-btn--primary:disabled{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff);cursor:default;opacity:.5}.sf-btn--secondary{flex:0 0 120px;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-token-select{padding:0;display:flex;flex-direction:column}.sf-token-select .sf-search{margin:16px 24px}.sf-token-select .sf-token-list{width:100%;margin-top:0}.sf-search{display:flex;align-items:center;gap:8px;padding:12px 16px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-low, rgba(0, 0, 0, .4));box-sizing:border-box;transition:border-color .15s ease}.sf-search:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-search:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-search-input{flex:1;min-width:0;border:none;background:transparent;outline:none;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-search-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-token-list{display:flex;flex-direction:column;margin-top:8px}.sf-token-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-token-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-token-left{display:flex;align-items:center;gap:16px;min-width:0}.sf-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.sf-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain}.sf-token-chain-badge{position:absolute;right:-2px;bottom:-2px;width:16px;height:16px;border-radius:50%;object-fit:cover}.sf-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.sf-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.sf-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.sf-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.sf-recipient{display:flex;flex-direction:column;flex:1;min-height:0}.sf-recipient-top{display:flex;flex-direction:column;padding:16px 24px 0}.sf-address-field{display:flex;align-items:center;gap:8px;padding:12px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);transition:border-color .15s ease;box-sizing:border-box}.sf-address-field:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-address-field:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-filled]{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-invalid]{border-color:var(--ds-system-red-default, #da0b2e)}.sf-address-input{flex:1;min-width:0;border:none;background:transparent;outline:none;resize:none;overflow:hidden;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));word-break:break-word;overflow-wrap:anywhere}.sf-address-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-address-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;border-radius:6px;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.sf-address-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-address-field[data-filled] .sf-address-action{border-radius:9999px}.sf-tabs{display:flex;gap:0;margin:16px 0 0}.sf-tab{position:relative;padding:8px 12px;border:none;background:transparent;cursor:pointer;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-tab[data-active]{color:var(--ds-accent-primary-high, #00a0a2)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-accent-primary-high, #00a0a2)}.sf-address-list{display:flex;flex-direction:column;width:100%;margin-top:8px}.sf-address-row{display:flex;align-items:center;gap:16px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-address-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-address-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex-shrink:0;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:600}.sf-address-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.sf-address-avatar-fallback{position:relative;z-index:0}.sf-address-meta{display:flex;flex-direction:column;min-width:0}.sf-address-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sf-address-value{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-drawer-content .sf-header{padding:16px}.wi-drawer-content .sf-header .sf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .sf-token-select{padding:0}.wi-drawer-content .sf-token-select .sf-search{margin:16px}.wi-drawer-content .sf-token-row{padding:12px 16px}.wi-drawer-content .sf-recipient-top{padding:16px 16px 0}.wi-drawer-content .sf-address-row{padding:12px 16px}.wi-drawer-content .sf-footer{padding:12px 16px 24px}.wi-drawer-content .sf-field-error,.wi-drawer-content .sf-message--error{margin:16px 0 0;width:auto}.sf-amount{display:flex;flex-direction:column}.sf-amount-center{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:64px 24px 48px;text-align:center}.sf-amount-usd{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));min-height:21px}.sf-amount-input-wrap{display:flex;justify-content:center;max-width:100%}.sf-amount-input{width:auto;max-width:100%;border:none;background:transparent;outline:none;text-align:center;font-family:inherit;font-size:40px;font-weight:700;line-height:1.25;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);field-sizing:content}.sf-amount-input-wrap[data-empty] .sf-amount-input,.sf-amount-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-input-wrap[data-over] .sf-amount-input{color:var(--ds-system-red-default, #da0b2e)}.sf-amount-balance{display:inline-flex;align-items:center;gap:4px;font-family:inherit;font-size:14px;font-weight:400;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-max{border:none;background:transparent;padding:0;cursor:pointer;font:inherit;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.sf-amount-max:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-drawer-content .sf-amount-center{padding:64px 16px 48px}.sf-review{display:flex;flex-direction:column;gap:16px;padding:24px}.sf-review-amount{display:flex;align-items:center;gap:12px;padding:0;background:transparent}.sf-review-amount-icon{width:40px;height:40px;border-radius:0;object-fit:contain;flex-shrink:0}.sf-review-amount-value{display:inline-flex;flex-direction:column;align-items:flex-start;gap:0;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);word-break:break-all}.sf-review-amount-symbol{font-size:12px;font-weight:400;line-height:1.5;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-parties{position:relative;display:flex;flex-direction:column;gap:0}.sf-review-arrow{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin:-4px auto;border-radius:50%;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-card{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa)}.sf-review-party-label{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-party-head{display:flex;align-items:center;gap:8px}.sf-review-party-avatar{display:inline-flex;width:24px;height:24px;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);flex-shrink:0}.sf-review-party-avatar img{width:100%;height:100%;object-fit:cover}.sf-review-party-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-review-party-addr{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));word-break:break-all}.sf-review-section-title{margin:0 0 4px;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-review-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.sf-review-row-label{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-row-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));text-align:left;word-break:break-all}.wi-drawer-content .sf-review{padding:16px}.sf-result{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;padding:48px 24px;text-align:center}.sf-result-icon{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px}.sf-result-spinner{width:56px;height:56px;border-radius:50%;border:4px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-top-color:var(--ds-accent-primary-default, #00b4b7);animation:sf-spin .8s linear infinite}@keyframes sf-spin{to{transform:rotate(360deg)}}.sf-result-copy{display:flex;flex-direction:column;gap:8px}.sf-result-title{margin:0;font-family:inherit;font-size:18px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-result-desc{margin:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);text-align:left}.sf-result-hash-label{font-family:inherit;font-size:12px;font-weight:500;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sf-result-hash-link{border:none;background:transparent;padding:0;cursor:pointer;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;color:var(--ds-accent-primary-high, #00a0a2)}.sf-result-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:28px;padding:0 10px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));border-radius:8px;background:var(--ds-surface-default, #ffffff);cursor:pointer;font-family:inherit;font-size:12px;font-weight:500;color:var(--ds-content-high, rgba(0, 0, 0, .85))}
7
+ `);var se=require("react/jsx-runtime"),ic={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function Fn({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...a}){let i=Ji.useCallback(y=>{o?.(y),n?.(y)},[n,o]),p=_i({...a,onSuccess:o||n?i:void 0,onExit:t}),{step:c,status:f}=p,m=Tt(p.recipient.trim()),h=on(p.amount,p.token.quantity.decimals),g="value"in h&&h.value<=p.balanceRaw,v=f==="submitting"||f==="confirming",x=c!=="result",w=ic[c]??"";return(0,se.jsxs)("div",{className:ee("sf-root",r),"data-step":c,children:[(0,se.jsxs)("header",{className:"sf-header",children:[x?(0,se.jsx)("button",{type:"button",className:"sf-header-btn",onClick:p.back,"aria-label":"Back",children:(0,se.jsx)(tn,{size:24})}):(0,se.jsx)("span",{className:"sf-header-btn","aria-hidden":!0}),(0,se.jsx)("span",{className:"sf-header-title",children:w}),(0,se.jsx)("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close",children:(0,se.jsx)(Nt,{size:24})})]}),c==="token"&&(0,se.jsx)(Xi,{flow:p}),c==="recipient"&&(0,se.jsx)(Ki,{flow:p}),c==="amount"&&(0,se.jsx)(Oi,{flow:p}),c==="review"&&(0,se.jsx)(Zi,{flow:p}),c==="result"&&(0,se.jsx)(Yi,{flow:p}),(0,se.jsxs)("footer",{className:"sf-footer","data-step":c,children:[c==="recipient"&&(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.submitRecipient,"data-disabled":!m||void 0,"aria-disabled":!m,children:"Next"}),c==="amount"&&(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.submitAmount,"data-disabled":!g||void 0,"aria-disabled":!g,children:"Next"}),c==="review"&&(0,se.jsxs)("div",{className:"sf-footer-row",children:[(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:p.back,disabled:v,children:"Cancel"}),(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.confirmSend,disabled:v||!p.canSend||p.insufficientGas,children:v?"Sending...":"Send"})]}),c==="result"&&f==="success"&&(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(p.txHash||void 0),children:"All done"}),c==="result"&&f==="error"&&(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.retry,children:"Try Again"})]})]})}var ea=D(require("@radix-ui/react-popover"),1),ta=require("vaul");var rn=require("react/jsx-runtime");function na({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:a}=Ht(),i=n!=null,l=e??!0,p=i?n:(0,rn.jsxs)("button",{type:"button",className:ee("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[(0,rn.jsx)(ci,{size:o?14:16}),(0,rn.jsx)("span",{className:"wi-trigger-address",children:et(a)})]});return o?(0,rn.jsx)(ta.Drawer.Trigger,{asChild:l,children:p}):(0,rn.jsx)(ea.Trigger,{asChild:l,children:p})}var P=D(require("react"),1),Fo=D(require("@radix-ui/react-popover"),1),Dn=require("vaul");var Sn=D(require("bignumber.js"),1);var oa=require("@tanstack/react-query"),ra=require("react");var yo="user-balance";async function ac(e,t,n,o){let r=new URLSearchParams({networkId:`eip155:${t}`,account:n}),a=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:o});if(!a.ok)throw new Error(`Failed to fetch token balance: ${a.status}`);let i=await a.json();if(i.code!==200)throw new Error(`Token balance API error: ${i.code}`);return i.data}function Mt(e,t,n=!0){let o=st[e],r=Me[e],a=[r.cross,r.bsc],i=(0,oa.useQueries)({queries:a.map(f=>({queryKey:[yo,e,t,f],queryFn:({signal:m})=>ac(o,f,t,m),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),l=i.some(f=>f.isLoading),p=i.some(f=>f.isError);return{tokens:(0,ra.useMemo)(()=>{let f=[];for(let m of i)m.data&&f.push(...m.data);return f},[i]),isLoading:l,isError:p}}var ko=require("@tanstack/react-query"),ia=require("react");var sc="forge-holdings",lc="forge-token-image";async function cc(e,t,n){let o=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch forge holdings: ${o.status}`);let r=await o.json();if(!r.success)throw new Error("Forge holdings API error");return r.data.items}async function dc(e,t,n){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:n});if(!o.ok)return{address:t,image_url:""};let r=await o.json();return r.success?{address:t,image_url:r.data.token.image_url}:{address:t,image_url:""}}function aa(e,t,n=!0){let o=gr[e],{data:r,...a}=(0,ko.useQuery)({queryKey:[sc,e,t],queryFn:({signal:i})=>cc(o,t,i),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:r??[],...a}}function sa(e,t,n=!0){let o=gr[e],r=(0,ko.useQueries)({queries:t.map(i=>({queryKey:[lc,e,i],queryFn:({signal:l})=>dc(o,i,l),enabled:n,staleTime:1/0}))});return{imageMap:(0,ia.useMemo)(()=>{let i=new Map;for(let l of r)l.data&&i.set(l.data.address,l.data.image_url);return i},[r])}}var la=require("@tanstack/react-query"),ca=require("react");var So="token-stats";function ht(e,t){return`${e}:${t.toLowerCase()}`}function _t(e,t=!0){let n=st[e],{data:o,...r}=(0,la.useQuery)({queryKey:[So,e],queryFn:async({signal:i})=>{let l=await fetch(`${n}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token stats: ${l.status}`);let p=await l.json();if(p.code!==200)throw new Error(`Token stats API error: ${p.code}`);return p},enabled:t,staleTime:3e4});return{statsMap:(0,ca.useMemo)(()=>{let i=new Map;if(!o?.data)return i;for(let l of o.data){let p=ht(l.chain_id,l.address);i.set(p,l)}return i},[o]),...r}}var da=require("@tanstack/react-query"),pa=require("react");var pc="token-info";function hr(e,t){return`${t.toLowerCase()}_${e}`}function fa(e,t=!0){let n=st[e],{data:o,...r}=(0,da.useQuery)({queryKey:[pc,e],queryFn:async({signal:i})=>{let l=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let p=await l.json();if(p.code!==200)throw new Error(`Token info API error: ${p.code}`);return p},enabled:t,staleTime:1/0});return{categoryMap:(0,pa.useMemo)(()=>{let i=new Map;if(!o?.data)return i;for(let l of o.data){let p=hr(l.chain_id,l.address);i.set(p,l.category)}return i},[o]),...r}}var ua=require("react"),Co=D(require("bignumber.js"),1);function ma(e,t,n){let{tokens:o,isLoading:r}=Mt(e,t,n),{statsMap:a}=_t(e,n);return(0,ua.useMemo)(()=>{let i=new Co.default(0);for(let f of o){let m=a.get(ht(f.chainId,f.address));if(!m)continue;let g=new Co.default(f.quantity.numeric).shiftedBy(-f.quantity.decimals).multipliedBy(new Co.default(m.price));g.isNaN()||(i=i.plus(g))}let l=i.toFixed(),{displayValue:p,isLowerBound:c}=vi(l);return{totalUsd:l,displayValue:p,isLowerBound:c,isLoading:r}},[o,a,r])}var Os=require("qrcode.react");function tt(e,t,n,o){if(!o||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let r;try{r=o(t,n)}catch(c){console.error("[dapp-ui] onOutlink threw:",c);return}let a=c=>{typeof window>"u"||window.open(c,"_blank","noopener,noreferrer")};if((c=>!!c&&(typeof c=="object"||typeof c=="function")&&typeof c.then=="function")(r)){let c=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,f=m=>{if(m===null){c?.close();return}let h=m??t;if(c)try{c.location.href=h}catch{c.close(),a(h)}else a(h)};r.then(f,m=>{console.error("[dapp-ui] onOutlink rejected:",m),c?.close()});return}let l=r;if(l===null)return;a(l??t)}var cn=D(require("react"),1),ds=require("vaul");var Ro=require("react"),Mn=(0,Ro.createContext)(null);function lt(){let e=(0,Ro.useContext)(Mn);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var ga=require("vaul");var br=require("react/jsx-runtime");function ha({asChild:e,children:t}){let{walletAddress:n}=lt(),o=t!=null,r=e??!0,a=o?t:(0,br.jsx)("button",{type:"button",children:et(n)});return(0,br.jsx)(ga.Drawer.Trigger,{asChild:r,children:a})}var On=require("vaul");var _e=D(require("react"),1),ls=require("@tanstack/react-query");var bt=require("react/jsx-runtime");function ba({size:e=22,className:t}){return(0,bt.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,bt.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function wa({size:e=22,className:t}){return(0,bt.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,bt.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,bt.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 Ot({size:e=12,className:t}){return(0,bt.jsxs)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[(0,bt.jsx)("path",{d:"M5 2H2.5A1.5 1.5 0 0 0 1 3.5V9.5A1.5 1.5 0 0 0 2.5 11H8.5A1.5 1.5 0 0 0 10 9.5V7",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,bt.jsx)("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,bt.jsx)("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}var an=D(require("bignumber.js"),1),fc=/^(\d{4}-\d{2}-\d{2})/;function xa(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:r,cumulative:a}of e.map(i=>({key:fc.exec(i.reference_date)?.[1],cumulative:i.cumulative_earned})).filter(i=>!!i.key&&i.cumulative!=null).sort((i,l)=>i.key<l.key?-1:i.key>l.key?1:0))t.set(r,a),n=r;if(n===void 0)return;let o=new Date().toISOString().slice(0,10);return t.get(o)??t.get(n)}function va(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function xn(e,t){let n=new an.default(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,an.default.ROUND_DOWN):n.toFormat(4,an.default.ROUND_DOWN)}function wr(e){return xn(e,0)}function vn(e,t,n){let o=new an.default(n||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let r=new an.default(e||"0").shiftedBy(-t).times(o);return r.isFinite()?`$${r.toFormat(2,an.default.ROUND_DOWN)}`:null}var Na=require("@tanstack/react-query"),xr=require("react");var No={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"},ya={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},To={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"},ka={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},yn={dev:"https://stg-posa-api.crosstoken.io/api/v1",stage:"https://stg-posa-api.crosstoken.io/api/v1",production:"https://posa-api.crosstoken.io/api/v1"},_n={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},Sa={dev:`${_n.dev}/portfolio`,stage:`${_n.stage}/portfolio`,production:`${_n.production}/portfolio`},Ca={dev:"https://stg-game-swap-api.cross.nexus/v1",stage:"https://stg-game-swap-api.cross.nexus/v1",production:"https://game-swap-api.cross.nexus/v1"},Ra={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},jt={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"};var uc="wp:reward-pools";function Io(e,t=!0){let n=No[e],{data:o,...r}=(0,Na.useQuery)({queryKey:[uc,e],queryFn:async({signal:l})=>{let p=await fetch(`${n}/v1/pools`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Failed to fetch pools: ${p.status}`);let c=await p.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),a=(0,xr.useMemo)(()=>o?.data.pools.filter(l=>l.pool_type==="CrossPool")??[],[o]),i=(0,xr.useMemo)(()=>o?.data.pools.filter(l=>l.pool_type==="GamePool")??[],[o]);return{crossPools:a,gamePools:i,allPools:o?.data.pools??[],...r}}var Ta=require("@tanstack/react-query"),Ia=require("react");var mc="wp:user-deposits";function La(e,t,n=!0){let o=No[e],r=n&&!!t,{data:a,...i}=(0,Ta.useQuery)({queryKey:[mc,e,t],queryFn:async({signal:p})=>{let c=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:p});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let f=await c.json();if(f.code!==200)throw new Error(`Deposits API error: ${f.code}`);return f},enabled:r,staleTime:0});return{depositMap:(0,Ia.useMemo)(()=>{let p=new Map;if(!a?.data.user_deposits)return p;for(let c of a.data.user_deposits)p.set(c.pool_address.toLowerCase(),c);return p},[a]),deposits:a?.data.user_deposits??[],...i}}var Ea=require("@tanstack/react-query"),Aa=require("react");var gc="wp:token-info";function Pa(e,t=!0){let n=st[e],o=Me[e].cross,{data:r,...a}=(0,Ea.useQuery)({queryKey:[gc,e],queryFn:async({signal:c})=>{let f=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:c});if(!f.ok)throw new Error(`Failed to fetch token info: ${f.status}`);let m=await f.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:l}=(0,Aa.useMemo)(()=>{let c=new Map,f=new Map;if(!r?.data)return{byChainAddr:c,byChainSym:f};for(let m of r.data){let h=m.address.toLowerCase();c.set(`${m.chain_id}:${h}`,m),c.set(h,m);let g=m.symbol.replace(/^t/,"").toUpperCase(),v=`${m.chain_id}:${g}`;f.has(v)||f.set(v,m),f.has(g)||f.set(g,m)}return{byChainAddr:c,byChainSym:f}},[r]);return{getTokenImage:(c,f)=>{let m=c.toLowerCase(),h=i.get(`${o}:${m}`);if(h?.image)return h.image;let g=i.get(m);if(g?.image)return g.image;if(f){let v=f.replace(/^t/,"").toUpperCase(),x=l.get(`${o}:${v}`);if(x?.image)return x.image;let w=l.get(v);if(w?.image)return w.image}return""},...a}}var Vt=require("react/jsx-runtime");function qt({title:e,icon:t,iconFit:n="cover",isEmpty:o,children:r}){return(0,Vt.jsxs)("div",{className:"wp-svc-card",children:[(0,Vt.jsxs)("div",{className:"wp-svc-card-head",children:[(0,Vt.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:n}}),(0,Vt.jsx)("span",{className:"wp-svc-card-title",children:e})]}),o?(0,Vt.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,Vt.jsx)("div",{className:"wp-svc-items",children:r})]})}var Lo=D(require("bignumber.js"),1),V=require("react/jsx-runtime"),hc="CROSS Rewards";function bc(e){return new Lo.default(e||"0").isGreaterThan(0)}function Ba(){let{env:e,walletAddress:t,onOutlink:n}=lt(),o=!!t,{allPools:r}=Io(e,o),{depositMap:a}=La(e,t,o),{getTokenImage:i}=Pa(e,o),l=(f,m)=>`${ya[e]}/rewards/${f.pool_address}?action=${m}`,p=`${jt[e]}/reward.png`,c=r.filter(f=>{let m=a.get(f.pool_address.toLowerCase()),h=m?.deposited_amount??"0",g=m?.claimable_reward??"0";return!(new Lo.default(h).isZero()&&new Lo.default(g).isZero())});return(0,V.jsx)(qt,{title:hc,icon:p,isEmpty:c.length===0,children:c.map(f=>{let m=a.get(f.pool_address.toLowerCase()),h=m?.deposited_amount??"0",g=m?.claimable_reward??"0",v=l(f,"withdraw"),x=l(f,"claim"),w=i(f.deposit_token.address,f.deposit_token.symbol),y=f.reward_tokens[0],L=y?i(y.address,y.symbol):"",u=f.reward_tokens.map(Y=>Y.symbol),T=u.length>0?`${f.deposit_token.symbol}-${u.join("/")}`:f.deposit_token.symbol,C=y?xn(g,y.decimals):"0",A=y?.symbol??"Reward",F=vn(h,f.deposit_token.decimals,f.deposit_token.price),J=y?vn(g,y.decimals,y.price):null,_=!!m&&bc(g);return(0,V.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,V.jsxs)("div",{className:"wp-item-body",children:[(0,V.jsxs)("div",{className:"wp-item-line",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),(0,V.jsxs)("div",{className:"wp-svc-token",children:[(0,V.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),L&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),(0,V.jsx)("span",{children:T})]})]}),(0,V.jsxs)("div",{className:"wp-item-line",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,V.jsxs)("div",{className:"wp-svc-token",children:[w&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),(0,V.jsxs)("div",{className:"wp-svc-amount",children:[(0,V.jsx)("span",{className:"wp-svc-amount-main",children:xn(h,f.deposit_token.decimals)}),F&&(0,V.jsx)("span",{className:"wp-item-usd",children:F})]})]})]}),(0,V.jsxs)("div",{className:"wp-item-line",children:[(0,V.jsxs)("span",{className:"wp-item-label",children:["Claimable (",A,")"]}),(0,V.jsxs)("div",{className:"wp-svc-token",children:[L&&(0,V.jsx)("img",{className:"wp-svc-token-icon",src:L,alt:""}),(0,V.jsxs)("div",{className:"wp-svc-amount",children:[(0,V.jsx)("span",{className:"wp-svc-amount-main",children:C}),J&&(0,V.jsx)("span",{className:"wp-item-usd",children:J})]})]})]})]}),(0,V.jsxs)("div",{className:"wp-item-tags",children:[(0,V.jsxs)("a",{className:"wp-tag wp-tag--muted",href:v,target:"_blank",rel:"noopener noreferrer",onClick:Y=>tt(Y,v,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:f,userDeposit:m}},n),children:[(0,V.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,V.jsx)(Ot,{size:12,className:"wp-tag-icon"})]}),(0,V.jsxs)("a",{className:"wp-tag wp-tag--mint","data-disabled":!_||void 0,"aria-disabled":!_||void 0,href:_?x:void 0,target:_?"_blank":void 0,rel:_?"noopener noreferrer":void 0,onClick:Y=>{if(!_){Y.preventDefault();return}tt(Y,x,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:f,userDeposit:m}},n)},children:[(0,V.jsx)("span",{className:"wp-tag-label",children:"Claim"}),(0,V.jsx)(Ot,{size:12,className:"wp-tag-icon"})]})]})]},f.pool_address)})})}var yr=D(require("react"),1);var Fa=require("@tanstack/react-query");var wc="wp:stake-info";function Ma(e,t,n=!0){let o=yn[e],r=n&&!!t,{data:a,...i}=(0,Fa.useQuery)({queryKey:[wc,e,t],queryFn:async({signal:p})=>{let c=await fetch(`${o}/stake/${t}`,{cache:"no-store",signal:p});if(!c.ok)throw new Error(`Stake info fetch failed: ${c.status}`);let f=await c.json();if(f.code!==0&&f.code!==200)throw new Error(`Stake info API error: ${f.code}`);return f},enabled:r,staleTime:0});return{stakeInfo:a?.data,...i}}var _a=require("@tanstack/react-query");var xc="wp:stake-rewards",vc=31;function Oa(e,t,n=!0){let o=yn[e],r=n&&!!t,{data:a,...i}=(0,_a.useQuery)({queryKey:[xc,e,t],queryFn:async({signal:l})=>{let p=await fetch(`${o}/rewards/${t}?limit=${vc}`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Stake rewards fetch failed: ${p.status}`);let c=await p.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake rewards API error: ${c.code}`);return c.data?.data??[]},enabled:r,staleTime:0});return{latestReward:a?.[0]??null,aprAccrued:xa(a),...i}}var za=require("@tanstack/react-query");var yc="wp:network-stats";function Wa(e,t=!0){let n=yn[e],{data:o,...r}=(0,za.useQuery)({queryKey:[yc,e],queryFn:async({signal:i})=>{let l=await fetch(`${n}/network/stats`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Network stats fetch failed: ${l.status}`);let p=await l.json();if(p.code!==0&&p.code!==200)throw new Error(`Network stats API error: ${p.code}`);return p},enabled:t,staleTime:0});return{networkStats:o?.data,...r}}var Da=require("@tanstack/react-query"),kc="wp:staking-onchain";function Ha(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...a}=(0,Da.useQuery)({queryKey:[kc,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:o,staleTime:0});return{onchain:r,...a}}var vr=require("react"),$a=D(require("bignumber.js"),1);function Ga(e){return e?.trim().toUpperCase()==="CROSS"}function Ua(e){return new $a.default(e||"0").isGreaterThan(0)}function Eo(e,t,n=!0){let{allPools:o}=Io(e,n),r=(0,vr.useMemo)(()=>{for(let c of o)for(let f of[c.deposit_token,...c.reward_tokens])if(Ga(f?.symbol)&&Ua(f.price))return f.price},[o]),a=n&&r===void 0,{tokens:i}=Mt(e,t,a),{statsMap:l}=_t(e,a),p=Me[e].cross;return(0,vr.useMemo)(()=>{if(r)return r;let c=i.find(f=>f.chainId===p&&Ga(f.symbol));if(c){let f=l.get(ht(c.chainId,c.address));if(f&&Ua(f.price))return f.price}return"0"},[r,i,l,p])}var zt=D(require("bignumber.js"),1),te=require("react/jsx-runtime"),Sc="CROSS Staking";function ja(e){if(!e)return"\u2014";let t=new zt.default(e);return t.isFinite()?`${t.toFormat(2,zt.default.ROUND_DOWN)}%`:"\u2014"}function Va(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=lt(),r=!!t,{stakeInfo:a}=Ma(e,t,r),{latestReward:i,aprAccrued:l}=Oa(e,t,r),{networkStats:p}=Wa(e,r),{onchain:c}=Ha(t,o,r),f=Eo(e,t,r),m=`${jt[e]}/cross-staking.png`,h=Sa[e],g=a?.total_stake??"0",v=yr.useMemo(()=>c?new zt.default(c.earnedWei.toString()).shiftedBy(-18).toString(10):i?.cumulative_earned??a?.rewards_earned??"0",[c,i,a]),x=yr.useMemo(()=>c?new zt.default(c.stakedWei.toString()).shiftedBy(-18):new zt.default(g),[c,g]),w=l!==void 0?new zt.default(l):void 0,y=a?.days_since_first_stake,L=w!==void 0&&w.isFinite()&&x.isGreaterThan(0)&&y!==null&&y!==void 0?w.div(x).times(365).div(Math.max(1,y)).times(100):void 0,u=!(new zt.default(g).isZero()&&new zt.default(v).isZero()),T=_n[e],C=vn(g,0,f),A=vn(v,0,f);return(0,te.jsx)(qt,{title:Sc,icon:m,iconFit:"contain",isEmpty:!1,children:(0,te.jsxs)("article",{className:"wp-item","data-side":"stake",children:[(0,te.jsx)("div",{className:"wp-item-body",children:u?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsxs)("div",{className:"wp-item-line",children:[(0,te.jsx)("span",{className:"wp-item-label",children:"Staked"}),(0,te.jsxs)("div",{className:"wp-svc-amount",children:[(0,te.jsxs)("span",{className:"wp-svc-amount-main",children:[wr(g)," CROSS"]}),C&&(0,te.jsx)("span",{className:"wp-item-usd",children:C})]})]}),(0,te.jsxs)("div",{className:"wp-item-line",children:[(0,te.jsx)("span",{className:"wp-item-label",children:"Rewards Earned"}),(0,te.jsxs)("div",{className:"wp-svc-amount",children:[(0,te.jsxs)("span",{className:"wp-svc-amount-main",children:[wr(v)," CROSS"]}),A&&(0,te.jsx)("span",{className:"wp-item-usd",children:A})]})]}),(0,te.jsxs)("div",{className:"wp-item-line",children:[(0,te.jsx)("span",{className:"wp-item-label",children:"My APR"}),(0,te.jsx)("span",{children:ja(L?.toString(10))})]})]}):(0,te.jsxs)("div",{className:"wp-item-line",children:[(0,te.jsx)("span",{className:"wp-item-label",children:"Delegation APR"}),(0,te.jsx)("span",{children:ja(p?.apr)})]})}),(0,te.jsx)("div",{className:"wp-item-tags",children:(0,te.jsxs)("a",{className:"wp-tag wp-tag--mint",href:u?h:T,target:"_blank",rel:"noopener noreferrer",onClick:F=>tt(F,u?h:T,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a,networkStats:p}},n),children:[(0,te.jsx)("span",{className:"wp-tag-label",children:u?"Manage":"Stake Now"}),(0,te.jsx)(Ot,{size:12,className:"wp-tag-icon"})]})})]})})}var kr=D(require("react"),1);var qa=require("@tanstack/react-query");var Cc="wp:game-swap-pools";function Ka(e,t,n=!0){let o=Ca[e],r=n&&!!t,{data:a,...i}=(0,qa.useQuery)({queryKey:[Cc,e,t],queryFn:async({signal:l})=>{let p=await fetch(`${o}/addresses/${t}/portfolio`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Game-swap portfolio fetch failed: ${p.status}`);return(await p.json()).pools??[]},enabled:r,staleTime:0});return{pools:a??[],...i}}var Qa=require("@tanstack/react-query"),Rc="wp:game-swap-lp-balances";function Ya(e,t,n,o){let r=[...n].map(p=>p.toLowerCase()).sort(),a=!!o&&!!t&&r.length>0,{data:i,...l}=(0,Qa.useQuery)({queryKey:[Rc,e,t,r],queryFn:async()=>{if(!o)return{};let p=await o(r),c={};for(let[f,m]of Object.entries(p))c[f.toLowerCase()]=m;return c},enabled:a,staleTime:0});return{balances:i??{},...l}}var wt=D(require("bignumber.js"),1),oe=require("react/jsx-runtime"),Nc="Game Swap LP",Xa=18,Tc=new wt.default("0.0001");function Za(e){return e?.trim().toUpperCase()==="CROSS"}function Ic(e){return e&&e>0?e:Xa}function Lc(e){let t=Za(e.token_a?.symbol)&&!Za(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=Ic(t?e.token_a?.decimals:e.token_b?.decimals),r=new wt.default(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new wt.default(0):r.times(2)}function Ec(e,t){let n=e.token_a?.symbol?.trim()||"TOKEN",o=e.token_b?.symbol?.trim()||"CROSS",r=t?.decimals??Xa,a,i;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let l=new wt.default(t.balance.toString()),p=new wt.default(t.totalSupply.toString()),c=l.div(p);a=c.times(100);let f=c.times(Lc(e));if(f.isGreaterThan(0)){let m=new wt.default(e.cross_usd||"0");i=m.isGreaterThan(0)?`$${f.times(m).toFormat(2,wt.default.ROUND_DOWN)}`:`${f.toFormat(4,wt.default.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:n,tokenBSymbol:o,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:r,sharePercent:a,valueText:i}}function Ja(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=lt(),r=!!t,{pools:a}=Ka(e,t,r),i=kr.useMemo(()=>a.map(h=>h.pair_address).filter(Boolean),[a]),{balances:l}=Ya(e,t,i,o),p=`${jt[e]}/dex.png`,c=!!o,f=kr.useMemo(()=>{let h=a.map(g=>Ec(g,l[g.pair_address?.toLowerCase()]));return c?h.filter(g=>g.lpAmountRaw?new wt.default(g.lpAmountRaw).shiftedBy(-g.lpDecimals).isGreaterThanOrEqualTo(Tc):!1):h},[a,l,c]),m=h=>{let g=h.token_a?.address??h.pair_address;return`${Ra[e]}/tokens/${g}?trade=deposit`};return(0,oe.jsx)(qt,{title:Nc,icon:p,iconFit:"contain",isEmpty:f.length===0,children:f.map(h=>{let{pool:g}=h,v=m(g),x=`${h.tokenASymbol} / ${h.tokenBSymbol}`,w=g.token_a?.logo_url,y=g.token_b?.logo_url;return(0,oe.jsxs)("article",{className:"wp-item","data-side":"game-swap",children:[(0,oe.jsxs)("div",{className:"wp-item-body",children:[(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"Pool"}),(0,oe.jsxs)("div",{className:"wp-svc-token",children:[(0,oe.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&(0,oe.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),y&&(0,oe.jsx)("img",{className:"wp-svc-token-icon",src:y,alt:""})]}),(0,oe.jsx)("span",{children:x})]})]}),h.lpAmountRaw!==void 0&&(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"My LP"}),(0,oe.jsxs)("span",{children:[xn(h.lpAmountRaw,h.lpDecimals)," LP"]})]}),h.sharePercent!==void 0&&(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"Pool Share"}),(0,oe.jsxs)("span",{children:[h.sharePercent.toFormat(2,wt.default.ROUND_DOWN),"%"]})]}),h.valueText!==void 0&&(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"Value"}),(0,oe.jsx)("span",{children:h.valueText})]})]}),(0,oe.jsx)("div",{className:"wp-item-tags",children:(0,oe.jsxs)("a",{className:"wp-tag wp-tag--mint",href:v,target:"_blank",rel:"noopener noreferrer",onClick:L=>tt(L,v,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:g}},n),children:[(0,oe.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,oe.jsx)(Ot,{size:12,className:"wp-tag-icon"})]})})]},g.pair_address)})})}var Wt=D(require("bignumber.js"),1),is=require("react");var es=require("@tanstack/react-query");var Ac="wp:forge-pools";function ts(e,t,n=!0){let o=To[e],r=n&&!!t,{data:a,...i}=(0,es.useQuery)({queryKey:[Ac,e,t],queryFn:async()=>{let p=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!p.ok)throw new Error(`forge pools fetch failed: ${p.status}`);return(await p.json()).data?.items??[]},enabled:r,staleTime:0}),l=a??[];return{pools:l,isEmpty:l.length===0,...i}}var ns=require("@tanstack/react-query"),os=require("react");var Pc="wp:forge-token-detail";async function Bc(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function rs(e,t,n=!0){let o=To[e],r=(0,ns.useQueries)({queries:t.map(l=>({queryKey:[Pc,e,l],queryFn:()=>Bc(o,l),enabled:n&&!!l,staleTime:3e4}))}),a=(0,os.useMemo)(()=>{let l=new Map;for(let p=0;p<r.length;p++){let c=r[p]?.data,f=t[p];c&&f&&l.set(f.toLowerCase(),c)}return l},[r,t]),i=r.some(l=>l.isLoading);return{detailMap:a,isLoading:i}}var re=require("react/jsx-runtime"),Fc="Forge",as=18,Mc="https://contents.crosstoken.io/wallet/token/images/FT.png";function _c(e){if(!e||e==="0")return"0";let t=new Wt.default(e).shiftedBy(-as);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Wt.default.ROUND_DOWN):t.toFormat(4,Wt.default.ROUND_DOWN)}function Oc(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 zc(e,t,n){let o=new Wt.default(n||"0");if(!o.isGreaterThan(0))return null;let r=new Wt.default(e.total_supply||"0"),a=new Wt.default(e.lp_balance||"0"),i=new Wt.default(t?.reserve_b||"0").shiftedBy(-as);if(!r.isGreaterThan(0)||!a.isGreaterThan(0)||!i.isGreaterThan(0))return null;let l=i.times(2),c=a.div(r).times(l).times(o);return c.isFinite()?`$${c.toFormat(2,Wt.default.ROUND_DOWN)}`:null}function ss(){let{env:e,walletAddress:t,onOutlink:n}=lt(),o=!!t,{pools:r,isEmpty:a}=ts(e,t,o),i=(0,is.useMemo)(()=>r.map(m=>m.token.address),[r]),{detailMap:l}=rs(e,i,o&&i.length>0),p=Eo(e,t,o),c=m=>`${ka[e]}/forge/token/${m.token.address}`,f=`${jt[e]}/forge.png`;return(0,re.jsx)(qt,{title:Fc,icon:f,iconFit:"contain",isEmpty:a,children:r.map(m=>{let h=l.get(m.token.address.toLowerCase()),g=h?.image_url||h?.image||m.token.image||Mc,v=h?.symbol||m.token.symbol,x=c(m),w=zc(m,h,p);return(0,re.jsxs)("a",{className:"wp-item","data-side":"lp",href:x,target:"_blank",rel:"noopener noreferrer",onClick:y=>tt(y,x,{category:"portfolio",origin:"portfolio-forge",payload:{pool:m,tokenDetail:h}},n),children:[(0,re.jsxs)("div",{className:"wp-item-body",children:[(0,re.jsxs)("div",{className:"wp-item-line",children:[(0,re.jsx)("span",{className:"wp-item-label",children:"Asset"}),(0,re.jsxs)("div",{className:"wp-svc-token",children:[(0,re.jsx)("img",{className:"wp-svc-token-icon",src:g,alt:""}),(0,re.jsx)("span",{children:v}),h?.name&&(0,re.jsx)("span",{className:"wp-token-subtle",children:h.name})]})]}),(0,re.jsxs)("div",{className:"wp-item-line",children:[(0,re.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,re.jsx)("div",{className:"wp-svc-token",children:(0,re.jsxs)("div",{className:"wp-svc-amount",children:[(0,re.jsx)("span",{className:"wp-svc-amount-main",children:_c(m.lp_balance)}),w&&(0,re.jsx)("span",{className:"wp-item-usd",children:w})]})})]}),(0,re.jsxs)("div",{className:"wp-item-line",children:[(0,re.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,re.jsx)("span",{className:"wp-line-value",children:Oc(m.pool_ownership)})]})]}),(0,re.jsx)("div",{className:"wp-item-tags",children:(0,re.jsxs)("span",{className:"wp-tag wp-tag--muted",children:[(0,re.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,re.jsx)(Ot,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}H(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--ds-bg-default, #202530);--wp-header-bg: var(--ds-surface-default, #252b39);--wp-card: var(--ds-surface-medium, #252b39);--wp-control: #292f40;--wp-border: var(--ds-border-default, #292f40);--wp-panel-border: var(--ds-border-medium, rgba(255, 255, 255, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .28);--wp-text: var(--ds-content-highest, #ffffff);--wp-text-60: var(--ds-content-high, rgba(255, 255, 255, .85));--wp-text-40: var(--ds-content-medium, rgba(255, 255, 255, .65));--wp-text-30: var(--ds-content-low, rgba(255, 255, 255, .4));--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, rgba(0, 160, 162, .14));--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #9b8cef;--wp-claim-primary-text: #202530;--wp-claim-secondary-bg: var(--wp-control);--wp-claim-success: #00d4aa;--wp-claim-success-soft: rgba(0, 212, 170, .18);--wp-claim-error: #ff3aa3;--wp-claim-error-soft: rgba(255, 58, 163, .16)}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: var(--ds-bg-dim, #f5f7fa);--wp-header-bg: var(--ds-surface-default, #ffffff);--wp-card: var(--ds-surface-default, #ffffff);--wp-control: var(--ds-surface-medium, #f5f7fa);--wp-border: var(--ds-border-default, rgba(0, 0, 0, .07));--wp-panel-border: var(--ds-border-medium, rgba(0, 0, 0, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .15);--wp-text: var(--ds-content-highest, #000000);--wp-text-60: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-text-40: var(--ds-content-medium, rgba(0, 0, 0, .65));--wp-text-30: var(--ds-content-low, rgba(0, 0, 0, .4));--wp-chrome-text: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-card-shadow: none;--wp-tooltip-bg: #192023;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, #e7f9f8);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #7346f3;--wp-claim-primary-text: #ffffff;--wp-claim-secondary-bg: #ffffff;--wp-claim-success: #019d92;--wp-claim-success-soft: rgba(1, 157, 146, .15);--wp-claim-error: #e70077;--wp-claim-error-soft: rgba(231, 0, 119, .12)}.wp-fullscreen{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:73px;padding:24px;position:relative;border-bottom:1px solid var(--wp-border);background:var(--wp-header-bg);color:var(--wp-chrome-text);flex-shrink:0;box-sizing:border-box}.wp-fullscreen .wp-header{height:60px;min-height:60px;padding:11px 20px;border-bottom:none;background:transparent}.wp-fullscreen .wp-header-btn{width:22px;height:22px;color:var(--wp-chrome-text)}.wp-fullscreen .wp-header-btn:hover{color:var(--wp-chrome-text)}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wp-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wp-header-edge{display:flex;align-items:center;width:24px;min-width:24px}.wp-header-edge--right{justify-content:flex-end}.wp-header-edge--right .wp-header-btn{position:absolute;top:24px;right:24px}.wp-header-spacer{display:block;width:24px;height:24px}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: hsl(221.3 24.6% 25.5%)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;text-align:center;color:var(--ds-content-highest, #000000);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-account-meta{display:flex;flex-direction:column;justify-content:center;min-width:0;gap:2px}.wp-header-wallet-name{min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:1.4;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-btn{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;padding:0;border:0;background:transparent;cursor:pointer;font:inherit}.wp-header-address{min-width:0;font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-copy{display:inline-flex;align-items:center;flex-shrink:0;color:var(--wp-text-40);transition:color .15s ease}.wp-header-address-btn:hover .wp-header-address-copy{color:var(--wp-text-60)}.wp-header-address-copy[data-copied=true]{color:var(--wp-mint)}.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:var(--wp-border) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:var(--wp-border);border-radius:4px}.wp-body-inner{padding:16px 16px 32px;display:flex;flex-direction:column;gap:32px}.wp-fullscreen .wp-body-inner{padding-top:8px;gap:24px}.wp-summary-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-summary-head{position:relative;display:flex;align-items:center;justify-content:flex-start;gap:4px}.wp-summary-label{font-size:14px;font-weight:400;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address{display:inline-flex;align-items:center;gap:8px;min-width:0}.wp-address-avatar{width:16px;height:16px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 68% 34%,#ff78d1 0 18%,transparent 19%),radial-gradient(circle at 34% 66%,#00d4aa 0 20%,transparent 21%),linear-gradient(135deg,#7346f3,#0488fc)}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40);flex-shrink:0}.wp-summary-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;background:#019d921a;color:var(--wp-mint);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;white-space:nowrap}.wp-summary-estimate{position:relative;display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.wp-estimate-info{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--wp-text-40);cursor:help}.wp-estimate-tooltip{position:absolute;top:calc(100% + 8px);left:0;right:auto;z-index:3;display:flex;flex-direction:column;gap:8px;width:min(280px,calc(100vw - 48px));padding:12px;border-radius:8px;background:var(--wp-tooltip-bg);box-shadow:0 12px 32px #0000003d;color:var(--wp-tooltip-text);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-estimate-tooltip-title{display:block;font-size:12px;font-weight:600;line-height:1.3}.wp-estimate-tooltip-group{display:flex;flex-direction:column;gap:4px}.wp-estimate-tooltip-item{display:block;color:#ffffffc7}.wp-estimate-tooltip-item:before{content:"- "}.wp-estimate-info:hover .wp-estimate-tooltip,.wp-estimate-info:focus .wp-estimate-tooltip,.wp-estimate-info:focus-visible .wp-estimate-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-total{font-family:var( --wp-total-font-family, Sora, Inter, system-ui, -apple-system, sans-serif );font-size:36px;font-weight:600;line-height:1.25;letter-spacing:0;color:var(--wp-text);margin:0}.wp-svc-card{display:flex;flex-direction:column;gap:12px;width:100%}.wp-svc-card-head{display:flex;align-items:center;gap:6px}.wp-svc-card-icon{width:24px;height:24px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-item{position:relative;display:flex;flex-direction:column;gap:20px;width:100%;padding:12px;border-radius:12px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box;color:inherit;text-decoration:none;cursor:pointer;outline:none;transition:opacity .15s ease}.wp-item+.wp-item{padding-top:12px;border-top:0}.wp-item:hover{opacity:.88}.wp-item-body{display:flex;flex-direction:column;gap:12px;min-width:0}.wp-order-head{display:flex;align-items:center;width:100%}.wp-item-line{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:21px;min-width:0}.wp-item-label{flex-shrink:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-30);white-space:nowrap}.wp-line-value,.wp-order-side{min-width:0;overflow:hidden;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-order-side--buy{color:var(--wp-mint)}.wp-order-side--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;min-height:21px}.wp-svc-token>span{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:16px;height:16px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-token-stack{display:inline-flex;align-items:center;justify-content:flex-end;width:29px;min-width:29px;overflow:visible}.wp-token-stack .wp-svc-token-icon+.wp-svc-token-icon{margin-left:-3.5px}.wp-token-subtle,.wp-item-usd{color:var(--wp-text-30)!important}.wp-svc-amount{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:1px;min-width:0}.wp-svc-amount-main{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.wp-svc-amount .wp-item-usd{font-size:12px;font-weight:500;line-height:1.35}.wp-order-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-order-token .wp-svc-token-icon{width:32px;height:32px}.wp-order-token-meta{display:flex;min-width:0;flex-direction:column;justify-content:center}.wp-order-token-symbol{overflow:hidden;color:var(--wp-text-60);font-size:14px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-order-token-pair{overflow:hidden;color:var(--wp-text-30);font-size:12px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-item-tags{display:flex;align-items:stretch;gap:8px;width:100%}.wp-tag{appearance:none;display:inline-flex;flex:1 1 0;align-items:center;justify-content:center;gap:0;min-width:0;min-height:33px;padding:6px 10px;border-radius:6px;border:0;background:var(--wp-control);font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);text-align:center;text-decoration:none;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}a.wp-tag,button.wp-tag{cursor:pointer}.wp-tag:hover{background:var(--wp-control);transform:none}.wp-tag:focus-visible{outline:2px solid var(--wp-mint);outline-offset:2px}.wp-tag[aria-disabled=true],.wp-tag[data-disabled]{cursor:default;opacity:.48;pointer-events:none}.wp-tag-label{display:inline-flex;align-items:center}.wp-tag-icon{display:none}.wp-tag:hover .wp-tag-icon{transform:none}.wp-tag--mint{color:var(--wp-mint);background:var(--wp-accent-soft)}.wp-tag--mint:hover{background:var(--wp-accent-soft)}.wp-tag--muted{color:var(--wp-text-40)}.wp-svc-empty{display:flex;align-items:center;justify-content:center;min-height:74px;padding:20px 16px;background:var(--wp-card);border-radius:12px;box-shadow:var(--wp-card-shadow, none);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-30);box-sizing:border-box}.wp-claim-overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:flex-end;justify-content:center;background:#00000094;box-sizing:border-box}.wp-claim-sheet{display:flex;flex-direction:column;width:100%;max-width:375px;max-height:calc(100% - 24px);overflow:hidden;border-radius:24px 24px 0 0;background:var(--wp-bg);color:var(--wp-text);box-shadow:0 -18px 48px #00000042;animation:wp-claim-slide-up .22s ease-out}@keyframes wp-claim-slide-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.wp-claim-grabber{display:flex;align-items:flex-start;justify-content:center;height:38px;min-height:38px;padding-top:12px;box-sizing:border-box}.wp-claim-grabber span{display:block;width:52px;height:5px;border-radius:999px;background:var(--wp-control)}.wp-claim-content{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;padding:20px;box-sizing:border-box}.wp-claim-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;flex-shrink:0}.wp-claim-icon--success{background:var(--wp-claim-success-soft);color:var(--wp-claim-success)}.wp-claim-icon--pending{background:#9b8cef29;color:var(--wp-claim-primary)}.wp-claim-icon--error{background:var(--wp-claim-error-soft);color:var(--wp-claim-error);font-size:30px;font-weight:600;line-height:1}.wp-claim-icon--token{background:#00d4aa29}.wp-claim-icon--token img{width:48px;height:48px;border-radius:50%;object-fit:cover}.wp-claim-icon--token span{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;background:var(--wp-mint);color:#101820;font-size:18px;font-weight:600}.wp-claim-spinner{width:36px;height:36px;border-radius:50%;border:3px solid rgba(155,140,239,.28);border-top-color:var(--wp-claim-primary);animation:wp-claim-spin .8s linear infinite}@keyframes wp-claim-spin{to{transform:rotate(360deg)}}.wp-claim-copy{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;text-align:center}.wp-claim-title{margin:0;font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text)}.wp-claim-desc{max-width:335px;margin:0;font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-40)}.wp-claim-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.wp-claim-error-message{margin:0;color:var(--wp-claim-error);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0}.wp-claim-reward-card{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:60px;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-reward-token{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-claim-reward-token img{width:28px;height:28px;object-fit:cover}.wp-claim-reward-token span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-claim-reward-symbol{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wp-text);font-size:18px;font-weight:600;line-height:1.3;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-reward-amount{flex-shrink:0;color:var(--wp-text);font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-account-row{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-height:40px}.wp-claim-account-row>span{flex-shrink:0;color:var(--wp-text-40);font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account{display:flex;align-items:center;gap:8px;min-width:0}.wp-claim-account strong{overflow:hidden;color:var(--wp-text);font-size:15px;font-weight:600;line-height:1.6;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-account-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 30% 28%,#d87aff 0 12%,transparent 13%),radial-gradient(circle at 68% 28%,#f0a1ff 0 12%,transparent 13%),radial-gradient(circle at 32% 70%,#b561e7 0 13%,transparent 14%),radial-gradient(circle at 70% 70%,#d4a2ff 0 13%,transparent 14%),radial-gradient(circle at 50% 50%,#8c4fc4 0 18%,transparent 19%),#4a315f;box-shadow:inset 0 0 0 3.37px var(--wp-control)}.wp-claim-divider{display:block;width:100%;height:1px;background:var(--wp-border)}.wp-claim-detail-list{display:flex;flex-direction:column;gap:8px;width:100%}.wp-claim-detail-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:20px}.wp-claim-detail-row>span{min-width:0;color:var(--wp-text-40);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-detail-row--sub>span:before{content:"";display:inline-block;width:3px;height:3px;margin:0 8px 3px;background:currentColor}.wp-claim-detail-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list{display:flex;flex-direction:column;gap:8px;width:100%;padding-bottom:8px}.wp-claim-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-list-item>span{flex-shrink:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--wp-text-40);white-space:nowrap}.wp-claim-list-item strong{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;overflow:hidden;color:var(--wp-text);font-size:14px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list-item img{width:16px;height:16px;border-radius:50%;flex-shrink:0}.wp-claim-hash{appearance:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);cursor:pointer;font:inherit}.wp-claim-hash svg{flex-shrink:0;color:var(--wp-text-60)}.wp-claim-gas-card{display:flex;flex-direction:column;gap:4px;width:100%;padding:14px 16px;border-radius:8px;border:1px solid var(--wp-border);background:var(--wp-card);box-sizing:border-box}.wp-claim-gas-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:28px}.wp-claim-gas-row>span{min-width:0;font-size:12px;font-weight:400;line-height:1.3;color:var(--wp-text-40)}.wp-claim-gas-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:12px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-gas-row--primary{min-height:32px}.wp-claim-gas-row--primary>span,.wp-claim-gas-row--primary strong{font-size:14px;color:var(--wp-text)}.wp-claim-fee-label{position:relative;display:inline-flex;align-items:center;text-decoration:underline dotted;text-underline-offset:3px;cursor:help;overflow:visible!important}.wp-claim-fee-tooltip{position:absolute;left:0;bottom:calc(100% + 8px);z-index:2;width:min(260px,calc(100vw - 64px));padding:10px 12px;border-radius:8px;background:var(--wp-tooltip-bg);color:var(--wp-tooltip-text);box-shadow:0 12px 32px #0000003d;font-size:11px;font-weight:400;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-claim-fee-label:hover .wp-claim-fee-tooltip,.wp-claim-fee-label:focus .wp-claim-fee-tooltip,.wp-claim-fee-label:focus-visible .wp-claim-fee-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-claim-actions{display:flex;align-items:center;gap:8px;width:100%}.wp-claim-primary,.wp-claim-secondary{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;height:52px;padding:0 24px;border:none;border-radius:40px;font-family:inherit;font-size:15px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap;cursor:pointer}.wp-claim-primary{background:var(--wp-claim-primary);color:var(--wp-claim-primary-text)}.wp-claim-primary:disabled{cursor:default;opacity:.72}.wp-claim-secondary{background:var(--wp-claim-secondary-bg, var(--wp-control));color:var(--wp-claim-primary)}.wp-claim-actions[data-count="2"] .wp-claim-primary{flex:1 1 0}.wp-claim-actions[data-count="2"] .wp-claim-secondary{flex:0 0 120px}.wp-claim-button-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(32,37,48,.28);border-top-color:var(--wp-claim-primary-text);animation:wp-claim-spin .8s linear infinite}.wp-claim-home-indicator{display:flex;align-items:flex-end;justify-content:center;height:34px;min-height:34px;padding-bottom:8px;box-sizing:border-box}.wp-claim-home-indicator span{display:block;width:134px;height:5px;border-radius:16px;background:var(--wp-text-40)}@media(max-width:359px){.wp-header{gap:12px;padding:0 12px}.wp-total{font-size:24px}.wp-body-inner{padding:0 12px 128px;gap:20px}.wp-svc-items,.wp-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.wi-drawer-content .wp-header,.wi-portfolio-body .wp-header{padding:16px}.wi-drawer-content .wp-header-edge--right .wp-header-btn,.wi-portfolio-body .wp-header-edge--right .wp-header-btn{top:16px;right:16px}
8
+ `);var X=require("react/jsx-runtime"),Sr=5,Wc="wp:";function sn({env:e,theme:t="light",walletAddress:n,walletName:o,onBack:r,showHeader:a=!0,variant:i="embed",className:l,onOutlink:p,lpBalanceReader:c,stakingRewardsReader:f}){let m=Be(e),h=!!n,g=(0,ls.useQueryClient)(),[v,x]=_e.useState(Sr),[w,y]=_e.useState(!1),[L,u]=_e.useState(!1),T=_e.useRef(void 0),C=_e.useCallback(()=>{g.invalidateQueries({predicate:ne=>typeof ne.queryKey[0]=="string"&&ne.queryKey[0].startsWith(Wc)})},[g]),A=_e.useCallback(()=>{C(),y(!0),setTimeout(()=>y(!1),600),x(Sr)},[C]);_e.useEffect(()=>{if(!h)return;let ne=setInterval(()=>{x(O=>O<=1?(A(),Sr):O-1)},1e3);return()=>clearInterval(ne)},[h,A]);let F=_e.useCallback(()=>{r?.()},[r]),J=h?Ft(m,n,{size:64}):void 0,_=_e.useCallback(async()=>{if(!(L||!n))try{await navigator.clipboard.writeText(n),u(!0),clearTimeout(T.current),T.current=setTimeout(()=>u(!1),2e3)}catch{}},[n,L]);_e.useEffect(()=>()=>clearTimeout(T.current),[]);let Y=_e.useMemo(()=>({env:m,theme:t,open:!0,walletAddress:n,close:F,onOutlink:p,lpBalanceReader:c,stakingRewardsReader:f}),[m,t,n,F,p,c,f]),z=(0,X.jsxs)(X.Fragment,{children:[a&&(0,X.jsxs)("div",{className:"wp-header",children:[(0,X.jsxs)("div",{className:"wp-header-account",children:[r&&(0,X.jsx)("button",{type:"button",className:"wp-header-btn","aria-label":"Back",onClick:r,children:(0,X.jsx)(ba,{})}),(0,X.jsx)("span",{className:"wp-header-avatar","aria-hidden":!0,children:J&&(0,X.jsx)("img",{src:J,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(o||n)&&(0,X.jsxs)("div",{className:"wp-header-account-meta",children:[o&&(0,X.jsx)("span",{className:"wp-header-wallet-name",title:o,children:o}),n&&(0,X.jsxs)("button",{type:"button",className:"wp-header-address-btn",onClick:_,"aria-label":"Copy wallet address",children:[(0,X.jsx)("span",{className:"wp-header-address",children:va(n)}),(0,X.jsx)("span",{className:"wp-header-address-copy","data-copied":L,children:L?(0,X.jsx)(en,{size:14}):(0,X.jsx)(An,{size:14})})]})]})]}),(0,X.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio",onClick:A,children:[(0,X.jsx)(wa,{className:w?"wp-spin-once":void 0}),h&&(0,X.jsx)("span",{className:"wp-refresh-badge",children:v})]})]}),(0,X.jsx)("div",{className:"wp-body",children:(0,X.jsxs)("div",{className:"wp-body-inner",children:[(0,X.jsx)(Ba,{}),(0,X.jsx)(Va,{}),(0,X.jsx)(Ja,{}),(0,X.jsx)(ss,{})]})})]});return(0,X.jsx)(Mn.Provider,{value:Y,children:i==="none"?z:(0,X.jsx)("div",{className:ee(i==="fullscreen"?"wp-fullscreen":"wp-embed",l),"data-theme":t,children:z})})}var ln=require("react/jsx-runtime");function cs({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:a,lpBalanceReader:i,stakingRewardsReader:l}=lt();return(0,ln.jsxs)(On.Drawer.Portal,{children:[(0,ln.jsx)(On.Drawer.Overlay,{className:"wp-overlay"}),(0,ln.jsxs)(On.Drawer.Content,{className:ee("wp-fullscreen",e),"data-theme":n,children:[(0,ln.jsx)(On.Drawer.Title,{className:"wp-sr-only",children:"Portfolio"}),(0,ln.jsx)(sn,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:a,lpBalanceReader:i,stakingRewardsReader:l})]})]})}var Cr=require("react/jsx-runtime");function Dc({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:a,lpBalanceReader:i,stakingRewardsReader:l,children:p}){let c=Be(e),f=o!==void 0,[m,h]=cn.useState(!1),g=f?o:m,v=cn.useCallback(y=>{f||h(y),r?.(y)},[f,r]),x=cn.useCallback(()=>v(!1),[v]),w=cn.useMemo(()=>({env:c,theme:t,open:g,walletAddress:n,close:x,onOutlink:a,lpBalanceReader:i,stakingRewardsReader:l}),[c,t,g,n,x,a,i,l]);return(0,Cr.jsx)(Mn.Provider,{value:w,children:(0,Cr.jsx)(ds.Drawer.Root,{direction:"bottom",open:g,onOpenChange:v,noBodyStyles:!0,children:p})})}var Rr=Object.assign(Dc,{Trigger:ha,Content:cs});var S=D(require("react"),1),dn=require("react-dom"),vt=D(require("bignumber.js"),1);var De=require("react/jsx-runtime");function ps({size:e=20,className:t}){return(0,De.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[(0,De.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),(0,De.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function fs({size:e=16,className:t}){return(0,De.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,De.jsx)("path",{d:"M2.667 8a5.333 5.333 0 1 0 1.562-3.771L2.667 5.79M2.667 2.667v3.124h3.124M8 5.333V8l1.667 1",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function us({size:e=16,className:t}){return(0,De.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,De.jsx)("path",{d:"M2.667 4h4M9.333 4h4M6.667 2.667v2.666M2.667 12h4M9.333 12h4M9.333 10.667v2.666M2.667 8h1.666M7 8h6.333M4.333 6.667v2.666",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function ms({size:e=20,className:t}){return(0,De.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,De.jsx)("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function gs({size:e=16,className:t}){return(0,De.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:(0,De.jsx)("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function hs({size:e=12,className:t}){return(0,De.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,De.jsx)("path",{d:"M3.5 2 1.5 4l2 2M1.5 4h9M8.5 10l2-2-2-2M10.5 8h-9",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})})}var N=D(require("react"),1);var Nr=D(require("bignumber.js"),1);function bs(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ws(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,Nr.default.ROUND_DOWN).toFixed()}function Hc(e){return e.fromToken.symbol.toLowerCase()===e.toToken.symbol.toLowerCase()||e.fromToken.chainId===e.toToken.chainId&&e.fromToken.address.toLowerCase()===e.toToken.address.toLowerCase()}function Gc(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new Nr.default(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:bs(t)&&bs(n)?e.lastChangedBy==="to"?{fromAmount:ws(r.multipliedBy(n).dividedBy(t))}:{toAmount:ws(r.multipliedBy(t).dividedBy(n))}:Hc(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function xs({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):Gc(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}var vs=15,Uc=18;function $c(e){let t=e.replace(/[^\d.]/g,""),n=t.indexOf(".");n!==-1&&(t=t.slice(0,n+1)+t.slice(n+1).replace(/\./g,""));let o=t.indexOf(".");if(o===-1)return t.slice(0,vs);let r=t.slice(0,o).slice(0,vs),a=t.slice(o+1).slice(0,Uc);return`${r}.${a}`}function jc(e){let t=Number(e??"0");if(!Number.isFinite(t)||t<.1)return"1";let n=o=>Math.floor(o*100)/100;if(t<3){let o=n(t*3);return String(o<1?1:o)}return"10"}function ys(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("CROSS")?t.slice(1):t}function Vc(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let n=new Set([ys(e.symbol),ys(t.symbol)]);return n.has("CROSS")&&n.has("CROSSD")}function xt(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Ao(e){return e[0]}function Tr(e,t,n,o){if(n&&!xt(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??Ao(e);let a=e.findIndex(l=>xt(l,t)),i=a>=0?e[a+1]:void 0;return i&&!xt(i,t)?i:e.find(l=>!xt(l,t))??t}function ks({fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:a}){return{fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:a}}function Ir(e){let t=e instanceof Error?e.message:typeof e=="string"?e:"",n=e&&typeof e=="object"&&"code"in e?String(e.code):"",o=t.toLowerCase();return n==="4001"||o.includes("user rejected")||o.includes("user denied")||o.includes("rejected the request")||o.includes("request rejected")}function Ss(e,t){return Ir(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
9
+ `)[0]?.trim()||t}function Cs(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:a,approveBridge:i,history:l=[],initialSlippage:p="1",termsUrl:c,getQuote:f,submitBridge:m,onSubmitted:h,onSuccess:g,onFailed:v,onExit:x}=e,w=N.useMemo(()=>xs({getQuote:f,submitBridge:m}),[f,m]),[y,L]=N.useState("form"),[u,T]=N.useState(n??Ao(t)),[C,A]=N.useState(()=>Tr(t,n??Ao(t),o,r)),[F,J]=N.useState(""),[_,Y]=N.useState(""),[z,ne]=N.useState("from"),[O,ke]=N.useState(p),[ce,fe]=N.useState(null),Ke=N.useMemo(()=>Vc(u,C),[u,C]),ue=N.useMemo(()=>Ke?"1":O==="auto"?jc(ce?.priceImpact):O,[Ke,O,ce?.priceImpact]),[$,me]=N.useState(""),[le,j]=N.useState("idle"),[Qe,we]=N.useState(""),[Oe,xe]=N.useState(null),[ct,Te]=N.useState([]),[Dt,Ge]=N.useState(!1),[yt,At]=N.useState(!1),[ge,Se]=N.useState(null),[nt,Ie]=N.useState(!1),[Ce,he]=N.useState(null),[kt,Ye]=N.useState(null),[St,Ze]=N.useState(!1),[ot,Ue]=N.useState(!1),Le=N.useRef(0),dt=N.useRef(null),Xe=N.useCallback(()=>{dt.current&&(clearTimeout(dt.current),dt.current=null)},[]),$e=N.useCallback(M=>{Xe(),Ye(M)},[Xe]);N.useEffect(()=>Xe,[Xe]),N.useEffect(()=>{let M=t.find(Pe=>xt(Pe,u))??Ao(t),Ae=M?r?.(M,t):void 0,W=Ae?.find(Pe=>xt(Pe,C))??(Ae?void 0:t.find(Pe=>xt(Pe,C)))??Tr(t,M,void 0,r);T(M),A(W)},[r,t,u,C]);let Re=N.useCallback((M,Ae)=>{let W=$c(M);Ae==="from"?J(W):Y(W),ne(Ae),me("")},[]),de=N.useCallback(()=>{Le.current+=1,J(""),Y(""),ne("from"),fe(null),me(""),we(""),j("idle"),Se(null),Ie(!1),he(null),Ze(!1),$e(null)},[$e]),rt=N.useCallback(M=>{xt(M,u)||(T(M),A(Tr(t,M,void 0,r)),de())},[u,r,de,t]),pt=N.useCallback(M=>{xt(M,C)||xt(M,u)||(A(M),de())},[u,de,C]),je=N.useMemo(()=>u?r?.(u,t)??t.filter(M=>!xt(M,u)):[],[u,r,t]),ft=N.useCallback(()=>{u?.balance&&Re(u.balance,"from")},[u?.balance,Re]),it=N.useCallback(()=>{!u||!C||(T(C),A(u),de())},[u,de,C]),Ve=N.useCallback(()=>{Le.current+=1,J(""),Y(""),ne("from"),fe(null),me(""),we("")},[]);N.useEffect(()=>{if(!u||!C)return;if(!F&&!_){fe(null),me(""),j("idle");return}let M=++Le.current,Ae=ks({fromToken:u,toToken:C,fromAmount:F,toAmount:_,lastChangedBy:z,slippage:O});j(w.canQuote?"quoting":"idle"),(async()=>{try{let W=await w.getQuote(Ae);if(Le.current!==M)return;W.fromAmount!==void 0&&z==="to"&&J(W.fromAmount),W.toAmount!==void 0&&z==="from"&&Y(W.toAmount),fe(W.summary??null),me(W.error??"")}catch(W){if(Le.current!==M)return;me(W instanceof Error?W.message:"Failed to quote bridge.")}finally{Le.current===M&&j("idle")}})()},[F,u,z,w,O,_,C]);let at=N.useCallback(()=>!u||!C?null:ks({fromToken:u,toToken:C,fromAmount:F,toAmount:_,lastChangedBy:z,slippage:ue}),[ue,F,u,z,_,C]),qe=N.useCallback(async(M,Ae)=>{we(""),Ze(!1),Ie(!1),j("submitting");try{if(!Ae?.skipApprovalCheck&&a){let Pe=await a(M);if(Pe){Se(Pe),he(M),j("idle");return}}Se(null),he(null),$e("processing");let W=await w.submitBridge(M);xe(W),j("success"),Te(Pe=>[{id:W.txHash,timestamp:new Date().toISOString(),txHash:W.txHash,fromToken:W.fromToken,toToken:W.toToken,fromAmount:W.fromAmount,toAmount:W.toAmount,summary:ce??void 0,status:"pending"},...Pe.filter(Bt=>Bt.txHash!==W.txHash)]),Ve(),Ue(!0),$e(null),Ze(!0),h?.(W),g?.(W)}catch(W){if($e(null),Ir(W)){j("idle");return}let Pe=Ss(W,"Failed to submit bridge.");we(Pe),j("error"),v?.({message:Pe})}},[a,v,h,g,w,Ve,$e,ce]),k=N.useCallback(async()=>{if($)return;let M=at();if(M){if(!yt){he(M),Ge(!0);return}await qe(M)}},[at,$,qe,yt]),K=N.useCallback(async()=>{let M=Ce??at();M&&(At(!0),Ge(!1),await qe(M))},[at,Ce,qe]),pe=N.useCallback(()=>{Ge(!1),he(null)},[]),Ee=N.useCallback(async()=>{if(!(le==="submitting"||!ge||!Ce||!i)){we(""),j("submitting");try{await i(Ce,ge),Se(null),j("idle"),Ie(!0)}catch(M){if(Ir(M)){j("idle");return}let Ae=Ss(M,"Failed to approve token.");we(Ae),j("error"),v?.({message:Ae})}}},[ge,i,v,Ce,qe,le]),Ct=N.useCallback(()=>{le!=="submitting"&&(Se(null),Ie(!1),he(null),j("idle"))},[le]),Rt=N.useCallback(async()=>{le==="submitting"||!Ce||(Ie(!1),await qe(Ce,{skipApprovalCheck:!0}))},[Ce,qe,le]),Pt=N.useCallback(()=>{Ze(!1)},[]),un=N.useCallback(M=>{L(M),M==="history"&&Ue(!1)},[]),Qt=N.useCallback(()=>{if(y==="history"){un("form");return}x?.()},[x,un,y]),Yn=N.useMemo(()=>[...l,...ct.filter(M=>!l.some(Ae=>Ae.txHash===M.txHash))],[l,ct]);return{step:y,setStep:un,status:le,error:Qe,quoteError:$,fromToken:u,toToken:C,tokens:t,availableToTokens:je,fromAmount:F,toAmount:_,lastChangedBy:z,slippage:O,effectiveSlippage:ue,slippageLocked:Ke,setSlippage:ke,summary:ce,history:Yn,submitted:Oe,canSubmit:w.canSubmit,termsOpen:Dt,approvalInfo:ge,approvalSuccessOpen:nt,approveBridge:i,pendingSubmitInput:Ce,submitToast:kt,successDialogOpen:St,dismissSuccessDialog:Pt,hasNewHistory:ot,termsUrl:c,setFromToken:T,setToToken:A,selectFromToken:rt,selectToToken:pt,setAmount:Re,setMax:ft,swapTokens:it,submit:k,confirmTerms:K,cancelTerms:pe,confirmApproval:Ee,cancelApproval:Ct,continueAfterApproval:Rt,back:Qt}}H(`.bf-root{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .07));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));--bf-toast-bg: #1e232e;--bf-toast-color: rgba(255, 255, 255, .85);position:relative;display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden;background:var(--bf-bg);color:var(--ds-content-highest, #ffffff);font-family:inherit}[data-theme=dark].wi-popover-content .bf-root,[data-theme=dark].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].wi-popover-content .bf-root,[data-theme=light].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}.bf-root[data-view=history]{background:var(--ds-bg-dim, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid var(--bf-border);background:var(--ds-bg-default, var(--bf-bg));box-sizing:border-box}.bf-root[data-view=history] .bf-header{padding:24px;border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff)}.bf-header-btn{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.bf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header .bf-header-btn:last-child{position:absolute;top:24px;right:24px}.bf-header-title{position:absolute;left:50%;transform:translate(-50%);font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--bf-text-high);white-space:nowrap}.bf-root[data-view=history] .bf-header-title{color:var(--ds-content-highest, #000000)}.bf-body,.bf-history-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.bf-body{padding:24px}.bf-history-body{display:flex;flex-direction:column;gap:12px;padding:24px;background:var(--ds-bg-dim, #f5f7fa)}.bf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.bf-chip{display:inline-flex;align-items:center;gap:4px;min-height:33px;padding:6px 8px;border:0;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-chip:hover:not(:disabled){color:var(--bf-text-high);background:var(--bf-surface-hover)}.bf-chip:disabled{cursor:default}.bf-chip-history{position:relative}.bf-chip-dot{position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-swap-card{position:relative;display:flex;flex-direction:column;gap:12px;margin-bottom:12px}.bf-field-error{margin-top:-4px;color:var(--ds-system-red-default, #ff2b5f);font-size:13px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-amount-panel{display:flex;min-height:110px;flex-direction:column;gap:8px;padding:16px;border:1px solid transparent;border-radius:12px;background:var(--bf-surface);box-sizing:border-box;transition:border-color .2s ease}.bf-amount-panel:hover{border-color:var(--bf-border)}.bf-amount-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--bf-text-high);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-balance{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;color:var(--bf-text-low);font-size:12px;white-space:nowrap}.bf-amount-main{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-amount-input-wrap{display:flex;min-width:0;flex:1;flex-direction:column;gap:4px}.bf-amount-input{width:100%;min-width:0;padding:0;border:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;outline:none}.bf-amount-input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-amount-usd{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis}.bf-token-pill{display:inline-flex;flex-shrink:0;align-items:center;gap:6px;min-height:33px;padding:6px 8px 6px 6px;border:1px solid var(--bf-border);border-radius:9999px;background:var(--bf-bg);color:var(--bf-text-high);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-token-pill:hover:not(:disabled):not([data-locked=true]){background:var(--bf-surface-hover)}.bf-token-pill:disabled{cursor:default;opacity:.6}.bf-token-pill[data-locked=true]{cursor:default}.bf-token-icon{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font-size:11px;font-weight:700}.bf-token-icon[data-has-image=true]{background:transparent}.bf-token-icon img{width:100%;height:100%;border-radius:0;object-fit:cover}.bf-token-fallback{line-height:1}.bf-token-picker-overlay{--bf-bg: #1e232e;--bf-surface: rgba(255, 255, 255, .05);--bf-surface-hover: rgba(255, 255, 255, .08);--bf-border: rgba(255, 255, 255, .07);--bf-text-high: rgba(255, 255, 255, .85);--bf-text-medium: rgba(255, 255, 255, .65);--bf-text-low: rgba(255, 255, 255, .4);position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-token-picker-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-surface: rgba(18, 18, 18, .05);--bf-surface-hover: rgba(18, 18, 18, .08);--bf-border: rgba(18, 18, 18, .07);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-token-picker{display:flex;width:min(480px,calc(100vw - 48px));height:min(466px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);min-height:0;flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #0006;box-sizing:border-box}.bf-token-picker-handle{display:none}.bf-token-picker-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--bf-border);box-sizing:border-box}.bf-token-picker-head h3{margin:0;color:var(--bf-text-high);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-token-picker-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--bf-text-medium);cursor:pointer}.bf-token-picker-close:hover{color:var(--bf-text-high)}.bf-token-search{display:flex;min-height:48px;flex-shrink:0;align-items:center;gap:8px;margin:16px 24px;padding:12px 16px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, rgba(18, 18, 18, .05));color:var(--bf-text-low);box-sizing:border-box}.bf-token-search:focus-within{border-color:var(--ds-accent-primary-default, #00ceb2)}.bf-token-search input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-search input::placeholder{color:var(--bf-text-low)}.bf-token-list{display:flex;min-height:0;flex:1;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;padding:0 24px 24px;scrollbar-width:thin;box-sizing:border-box}.bf-token-row{position:relative;display:flex;width:100%;min-height:69px;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid transparent;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.bf-token-row:hover:not([data-selected=true]){background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row-left{display:inline-flex;min-width:0;align-items:center;gap:16px}.bf-token-meta{display:flex;min-width:0;flex-direction:column}.bf-token-symbol{overflow:hidden;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-name{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-row-right{display:flex;min-width:86px;max-width:42%;flex-shrink:0;flex-direction:column;align-items:flex-end}.bf-token-balance,.bf-token-price{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-token-balance{color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-token-price{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-row[data-selected=true] .bf-token-symbol{color:var(--bf-text-high)}.bf-token-row[data-selected=true] .bf-token-balance{color:var(--bf-text-high);font-size:16px}.bf-token-row[data-selected=true] .bf-token-price{color:var(--bf-text-low);font-size:14px}.bf-token-empty{padding:32px 16px;color:var(--bf-text-low);font-size:14px;font-weight:500;line-height:1.5;text-align:center}.bf-slippage-overlay{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-slippage-dialog{display:flex;width:min(480px,calc(100vw - 48px));height:auto;min-height:min(316px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);flex-direction:column;overflow:hidden;border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:24px;background:var(--ds-surface-default, #ffffff);color:var(--ds-content-highest, #000000);box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));box-sizing:border-box}.bf-slippage-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-slippage-head h3{margin:0;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-slippage-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-slippage-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-slippage-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:24px;padding:24px;box-sizing:border-box}.bf-slippage-desc{margin:0;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-controls{display:flex;flex-direction:column;gap:12px;width:100%}.bf-slippage-presets{display:flex;gap:8px;width:100%}.bf-slippage-preset{appearance:none;display:inline-flex;flex:1 1 0;min-width:0;min-height:48px;align-items:center;justify-content:center;padding:12px 8px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-preset:hover,.bf-slippage-preset[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-accent-primary-low, #e7f9f8)}.bf-slippage-custom{display:flex;min-height:48px;align-items:center;gap:8px;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));box-sizing:border-box}.bf-slippage-custom:focus-within,.bf-slippage-custom[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7)}.bf-slippage-custom input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--ds-content-high, rgba(0, 0, 0, .85));font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-custom input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-slippage-custom span:not(.bf-sr-only){flex-shrink:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-apply{appearance:none;margin-top:auto;width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on-primary, #ffffff);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-apply:hover{filter:brightness(.96)}.bf-slippage-apply:disabled{cursor:not-allowed;opacity:.5;filter:none}.bf-slippage-message{margin:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-message[data-variant=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-slippage-message[data-variant=error]{color:var(--ds-system-red-default, #da0b2e)}.bf-action-modal-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#040912b8;pointer-events:auto;box-sizing:border-box}.bf-action-modal-overlay[data-theme=light]{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .08));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .65));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .4))}.bf-action-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;align-items:center;gap:24px;padding:48px 24px 24px;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:#fff;box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-action-modal h3{width:100%;margin:0;color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;text-align:center;letter-spacing:0}.bf-action-modal-desc{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-terms-check-row{display:grid;width:100%;min-height:56px;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px 16px;border:none;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font-size:16px;font-weight:700;line-height:1.4;box-sizing:border-box;cursor:pointer;touch-action:manipulation;user-select:none}.bf-terms-check-button{appearance:none;display:grid;min-width:0;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-check-button:focus-visible .bf-terms-checkbox{outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-terms-checkbox{position:relative;display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;border:1px solid rgba(124,143,180,.72);border-radius:5px;background:transparent;box-sizing:border-box}.bf-terms-checkbox[data-checked=true]{border-color:var(--ds-accent-primary-default, #00ceb2);background:var(--ds-accent-primary-default, #00ceb2)}.bf-terms-checkbox[data-checked=true]:after{width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg) translate(1px,-1px)}.bf-terms-check-row a{position:relative;z-index:1;color:var(--ds-accent-primary-default, #00ceb2);font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}.bf-terms-privacy{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-action-primary,.bf-action-secondary{display:inline-flex;width:100%;min-height:56px;align-items:center;justify-content:center;padding:14px 16px;border:0;border-radius:12px;font:inherit;font-size:18px;font-weight:700;line-height:1.4;letter-spacing:0;cursor:pointer}.bf-action-primary{background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000)}.bf-action-primary:disabled{cursor:not-allowed;opacity:.35}.bf-action-primary[aria-busy=true]{gap:8px;opacity:1}.bf-action-button-spinner{width:18px;height:18px;border:2px solid rgba(0,0,0,.22);border-top-color:currentColor;border-right-color:currentColor;border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-action-secondary{background:var(--bf-surface);color:var(--bf-text-low)}.bf-action-secondary:disabled{cursor:not-allowed;opacity:.5}.bf-approve-address-box{display:flex;width:100%;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-approve-address-box>span{color:var(--bf-text-low);font-size:14px;font-weight:700;line-height:1.4}.bf-approve-address-box>div{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-approve-address-box strong{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:15px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.bf-copy-button{flex-shrink:0;min-width:48px;min-height:32px;padding:6px 10px;border:1px solid rgba(0,206,178,.65);border-radius:8px;background:transparent;color:var(--ds-accent-primary-default, #00ceb2);font:inherit;font-size:12px;font-weight:700;line-height:1.2;cursor:pointer}.bf-copy-button:disabled{cursor:not-allowed;opacity:.45}.bf-action-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:12px}.bf-approval-success-modal{gap:28px}.bf-success-mark{position:relative;display:inline-flex;width:96px;height:96px;flex-shrink:0;align-items:center;justify-content:center;border:12px solid rgba(0,206,178,.12);border-radius:999px;background:#00ceb2a8;box-shadow:0 0 0 10px #00ceb20f;box-sizing:border-box}.bf-success-mark:after{width:34px;height:18px;border:solid #ffffff;border-width:0 0 6px 6px;content:"";transform:rotate(-45deg) translate(2px,-3px)}.bf-status-toast{position:absolute;right:16px;bottom:14px;left:16px;z-index:5;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--bf-toast-bg, #1e232e);color:var(--bf-toast-color, rgba(255, 255, 255, .85));box-shadow:0 8px 24px #0000003d;box-sizing:border-box}.bf-status-toast-icon{display:inline-flex;width:28px;height:28px;flex-shrink:0;align-items:center;justify-content:center;border-radius:999px}.bf-status-spinner{width:20px;height:20px;border:3px solid rgba(255,255,255,.18);border-top-color:var(--ds-accent-primary-default, #00ceb2);border-right-color:var(--ds-accent-primary-default, #00ceb2);border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-status-check{position:relative;width:20px;height:20px;border-radius:999px;background:var(--ds-accent-primary-default, #00ceb2)}.bf-status-check:after{position:absolute;top:6px;left:5px;width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg)}.bf-status-toast-copy{display:flex;min-width:0;flex:1;flex-direction:column}.bf-status-toast-copy strong,.bf-status-toast-copy span{overflow:hidden;text-overflow:ellipsis}.bf-status-toast-copy strong{color:#fff;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-status-toast-copy span{color:var(--bf-toast-color, rgba(255, 255, 255, .85));font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em}.bf-status-toast[data-variant=success] .bf-status-toast-copy span{color:var(--ds-accent-primary-on-inverted, #00e8c9)}.bf-status-toast[data-variant=error]{border:1px solid rgba(255,43,95,.28);background:var(--bf-toast-bg, #1e232e)}.bf-status-toast[data-variant=error] .bf-status-toast-copy strong{color:#fff}.bf-status-error-mark{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:999px;background:var(--ds-system-red-default, #ff2b5f);color:#fff;font-size:14px;font-weight:700;line-height:1}.bf-status-toast[data-variant=error] .bf-status-toast-copy span{color:#ffffffe0}.bf-success-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#000000b8;pointer-events:auto;box-sizing:border-box}.bf-success-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-border: rgba(18, 18, 18, .08);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-success-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-success-head{display:flex;min-height:73px;align-items:center;justify-content:space-between;gap:16px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));box-sizing:border-box}.bf-success-head h3{min-width:0;margin:0;overflow:hidden;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.bf-success-close{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-success-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-success-body{display:flex;flex-direction:column;align-items:center;gap:24px;padding:40px 24px 24px;box-sizing:border-box}.bf-success-copy{display:flex;width:100%;flex-direction:column;align-items:center;gap:4px;color:var(--bf-text-medium);text-align:center}.bf-success-copy strong{color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;letter-spacing:0}.bf-success-copy span{color:var(--bf-text-medium);font-size:15px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-success-route{display:flex;align-items:center;justify-content:center;gap:12px}.bf-success-route .bf-token-icon{width:48px!important;height:48px!important;background:transparent;font-size:18px}.bf-success-route-arrow{color:var(--bf-text-low);font-size:24px;font-weight:500;line-height:1}.bf-success-ok{display:inline-flex;width:100%;min-height:48px;align-items:center;justify-content:center;padding:12px;border:0;border-radius:12px;background:#00b4b7e0;color:#fff;font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}@media(max-width:767px){.bf-success-body{padding:40px 24px 24px}.bf-success-copy strong{font-size:22px}.bf-success-copy span{font-size:14px}.bf-success-mark{width:88px;height:88px}.bf-success-route .bf-token-icon{width:44px!important;height:44px!important}}@keyframes bf-loading-spin{to{transform:rotate(360deg)}}.bf-swap-toggle{position:absolute;top:100px;left:50%;z-index:1;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);box-shadow:0 1px 5px #0000001f;cursor:pointer}.bf-swap-card[data-has-from-error=true] .bf-swap-toggle{top:132px}.bf-details{display:flex;flex-direction:column;gap:24px}.bf-exchange-rate{display:flex;width:100%;align-items:center;justify-content:center;gap:4px;padding:0 0 24px;border:0;background:transparent;color:var(--bf-text-low);font:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-exchange-rate:hover{color:var(--bf-text-medium)}.bf-detail-section,.bf-history-card{display:flex;flex-direction:column;gap:12px;padding:0;border-radius:12px;background:transparent;box-sizing:border-box}.bf-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-root[data-view=history] .bf-liquidity,.bf-root[data-view=history] .bf-detail-section,.bf-root[data-view=history] .bf-history-card{background:var(--ds-surface-default, #ffffff)}.bf-detail-section h3{margin:0;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-tx-fee-section{gap:12px}.bf-tx-fee-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-collapse-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin:0;padding:0;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.bf-detail-section[data-open=true] .bf-collapse-head{padding-bottom:12px;border-bottom:1px solid var(--bf-border)}.bf-collapse-chevron{flex-shrink:0;color:var(--bf-text-low);transition:transform .2s ease}.bf-detail-section[data-open=true] .bf-collapse-chevron{transform:rotate(180deg)}.bf-collapse-body{display:flex;flex-direction:column;gap:14px}.bf-root[data-view=history] .bf-detail-section[data-open=true] .bf-collapse-head{border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07))}.bf-root[data-view=history] .bf-collapse-chevron{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-tx-fee-total{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--bf-text-medium);font-size:14px;font-weight:600;line-height:1.4;text-align:right}.bf-tx-fee-total>span[data-delegated=true]{text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:currentColor}.bf-fee-delegated{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:2px 8px;border-radius:6px;background:#379cff2e;color:#4eb3ff;font-size:10px;font-weight:500;line-height:1.3;white-space:nowrap}.bf-tx-fee-token{width:16px;height:16px;flex-shrink:0;border-radius:999px;object-fit:cover}.bf-info-card{gap:14px}.bf-info-section{display:flex;flex-direction:column;gap:10px}.bf-info-section+.bf-info-section{padding-top:2px}.bf-info-section h4{margin:0;color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5}.bf-root[data-view=history] .bf-detail-section h3,.bf-root[data-view=history] .bf-info-section h4{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-info-rows{display:flex;flex-direction:column;gap:8px}.bf-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-liquidity-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-info-label{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--bf-text-low)}.bf-tree-marker{width:10px;flex-shrink:0;color:var(--bf-text-low)}.bf-info-value{min-width:0;color:var(--bf-text-medium);text-align:right}.bf-info-route,.bf-info-value-token{display:inline-flex;align-items:center;gap:4px}.bf-info-route .bf-token-icon,.bf-info-value-token .bf-token-icon{flex-shrink:0}.bf-info-route-arrow{color:var(--bf-text-medium)}.bf-root[data-view=history] .bf-info-route-arrow{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-root[data-view=history] .bf-info-label,.bf-root[data-view=history] .bf-liquidity-head,.bf-root[data-view=history] .bf-tree-marker{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-root[data-view=history] .bf-info-value{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-root[data-view=history] .bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-root[data-view=history] .bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-liquidity-status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.4;white-space:nowrap}.bf-liquidity-status:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}.bf-liquidity-status[data-status=normal],.bf-liquidity-status:not([data-status]){background:#00ceb21f;color:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=normal]:before,.bf-liquidity-status:not([data-status]):before{background:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=low]{background:#e56f001f;color:#e56f00}.bf-liquidity-status[data-status=low]:before{background:#e56f00}.bf-liquidity-status[data-status=rebalancing]{background:#da0b2e1a;color:#da0b2e}.bf-liquidity-status[data-status=rebalancing]:before{background:#da0b2e}.bf-liquidity-track{height:8px;overflow:hidden;border-radius:999px;background:var(--bf-surface-hover)}.bf-liquidity-track span{display:block;height:100%;border-radius:inherit;background:var(--ds-accent-primary-default, #00ceb2)}.bf-error{padding:12px;border-radius:12px;background:#da0b2e1f;color:var(--ds-system-red-default, #da0b2e);font-size:13px;line-height:1.4}.bf-footer{display:flex;flex-shrink:0;flex-direction:column;align-items:center;gap:10px;padding:12px 24px 24px;background:var(--ds-bg-default, var(--bf-bg))}.bf-next{width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-next:disabled{cursor:default;opacity:.6}.bf-powered{display:inline-flex;align-items:center;gap:3px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-decoration:none}.bf-powered:focus-visible{border-radius:4px;outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-powered-brand{text-decoration:underline;text-underline-offset:2px}.bf-history-tabs{display:flex;align-items:center;gap:4px;width:100%}.bf-history-tab{position:relative;display:inline-flex;min-height:37px;align-items:center;justify-content:center;padding:8px 12px;border:0;background:transparent;color:var(--ds-content-lowest, rgba(0, 0, 0, .25));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;cursor:pointer}.bf-history-tab[data-active=true]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-history-tab[data-active=true]:after{position:absolute;right:8px;bottom:0;left:8px;height:3px;border-radius:999px;background:var(--ds-accent-primary-high, #00a0a2);content:""}.bf-history-tab-dot{position:absolute;top:8px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-history-list{display:flex;flex-direction:column;gap:12px}.bf-history-item{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-history-item-head,.bf-history-meta,.bf-history-route,.bf-history-route-token{display:inline-flex;align-items:center}.bf-history-item-head{justify-content:space-between;gap:12px;width:100%}.bf-history-status{display:inline-flex;min-height:24px;align-items:center;justify-content:center;padding:3px 8px;border-radius:4px;background:var(--ds-system-orange-low, #fcf5e9);color:var(--ds-system-orange-high, #e56f00);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;white-space:nowrap}.bf-history-status[data-status=completed]{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.bf-history-status[data-status=failed]{background:var(--ds-system-red-low, rgba(218, 11, 46, .12));color:var(--ds-system-red-default, #da0b2e)}.bf-history-time{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-align:right;white-space:nowrap}.bf-history-item-body{display:flex;flex-direction:column;gap:4px}.bf-history-amount{color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-meta{justify-content:space-between;gap:12px;min-width:0}.bf-history-usd{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route{justify-content:flex-end;gap:4px;min-width:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-route-token{gap:4px;min-width:0}.bf-history-route-token span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route-arrow{flex-shrink:0;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-empty{padding:32px 16px;text-align:center;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:14px}.bf-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:767px){.bf-token-picker-overlay{align-items:flex-end;padding:0}.bf-token-picker{width:100%;max-height:82dvh;min-height:min(520px,82dvh);border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}.bf-token-picker-handle{display:block;width:40px;height:4px;flex-shrink:0;align-self:center;margin:10px 0 0;border-radius:999px;background:#ffffff38}.bf-token-picker-head{min-height:55px;padding:12px 56px 16px 24px;border-bottom:0}.bf-token-picker-close{top:13px}.bf-token-search{margin:0 16px 12px}.bf-token-list{padding:0 16px 16px}.bf-slippage-overlay{align-items:flex-end;padding:0}.bf-slippage-dialog{width:100%;height:auto;min-height:316px;max-height:82dvh;border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}}.wi-drawer-content .bf-header{padding:16px}.wi-drawer-content .bf-header .bf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .bf-body,.wi-drawer-content .bf-history-body{padding:16px}
10
+ `);var s=require("react/jsx-runtime"),Es=S.createContext(void 0);function kn(){return S.useContext(Es)}function qc(e){let[t,n]=S.useState(void 0);return S.useEffect(()=>{let o=e.current;if(!o)return;let r=()=>{let i=o.closest("[data-theme]");n(i?.getAttribute("data-theme")??void 0)};r();let a=new MutationObserver(r);return a.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>a.disconnect()},[e]),t}var Rs=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],Kc={dev:"https://dev.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://crossdefi.io"},Qc=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function Yc(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function Ns(e){let t=e.replace(/[^\d.]/g,""),[n="",...o]=t.split("."),r=o.join("");return o.length===0?n:`${n}.${r.slice(0,2)}`}function Zc(e){return`${e.chainId}:${e.address.toLowerCase()}`}function As(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function Ts(e,t){let n=Number(e||"0"),o=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(n)?n*o:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function Xc(e,t=6){if(!e)return e;let[n,o=""]=e.split(".");if(!o)return n;let r=o.slice(0,t).replace(/0+$/,"");return r?`${n}.${r}`:n}function Jc(e,t){if(!t)return!1;let n=new vt.default(e||"0"),o=new vt.default(t.balance||"0");return!n.isFinite()||!o.isFinite()?!1:n.isGreaterThan(o)}function ed(e){if(e.priceUsd===void 0)return null;let t=new vt.default(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function td(e){if(e.priceUsd===void 0)return null;let t=new vt.default(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function Ps(e){if(!e.isFinite()||e.isNaN())return"0";let n=e.decimalPlaces(6,vt.default.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),a=new vt.default(o||"0").toFormat(0);return r?`${a}.${r}`:a}function nd(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function od(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=o=>o.toString().padStart(2,"0");return[`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`,`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`].join(" ")}function rd(e){let t=new vt.default(e||"0");return!t.isFinite()||t.isNaN()?e||"0":Ps(t)}function id(e,t){if(t?.priceUsd===void 0)return null;let n=new vt.default(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function Bo(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function ad(e,t){return t==="all"?!0:Bo(e)===t}function sd(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function Is(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function Bs(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Fs(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":Bs(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function Ms(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function Po(e){return!e||e==="0"||Number(e)===0}function ld(e){let t=e.trim().toLowerCase();return t?t.startsWith("minimum ")?{from:e}:t.startsWith("available ")&&t.includes("or more")?{to:e}:t.includes("insufficient balance")||t.includes("not enough balance")||t.includes("exceeds balance")||t.includes("insufficient network fee")?{from:e}:t.includes("insufficient liquidity")||t.includes("not enough liquidity")?{to:e}:{}:{}}function cd(e){let t=e.fromToken,n=e.toToken,o=Fs(t,n),r=e.fromAmount||"0",a=e.toAmount||"0",i=o!==void 0&&!Ms(o),l=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:i?[{label:"Route",value:t&&n?`${Is(t.chainId)} \u2192 ${Is(n.chainId)}`:"-"},{label:"Validator Fee",value:Po(r)?"0":"Free",tone:Po(r)?"default":"accent"},{label:"Network Fee",value:Po(r)?"0":"Free",tone:Po(r)?"default":"accent"}]:void 0,swapInfo:l?[t&&n?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:n.symbol,iconUrl:n.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:r,valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Swap Fee",value:"0",valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Out Amount",value:a,valueToken:n?{symbol:n.symbol,iconUrl:n.iconUrl}:void 0}]:void 0,txFee:[{label:"Priority Fee Per Gas",value:"0 Gwei"},{label:"Max Fee Per Gas",value:"0 Gwei"},{label:"Gas Limit",value:"0"}],txFeeInfo:{estTxFee:"0",isDelegateFee:!1}}}function zn({token:e,size:t=20}){let n=e?.iconUrl;return(0,s.jsx)("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?(0,s.jsx)("img",{src:n,alt:"",width:t,height:t,draggable:!1}):(0,s.jsx)("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function Ls({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:a,locked:i=!1}){return(0,s.jsxs)("section",{className:"bf-amount-panel",children:[(0,s.jsxs)("div",{className:"bf-amount-head",children:[(0,s.jsx)("span",{children:e}),(0,s.jsxs)("span",{className:"bf-balance",children:[As(t?.balance??"0")," ",t?.symbol??""]})]}),(0,s.jsxs)("div",{className:"bf-amount-main",children:[(0,s.jsxs)("label",{className:"bf-amount-input-wrap",children:[(0,s.jsxs)("span",{className:"bf-sr-only",children:[e," amount"]}),(0,s.jsx)("input",{type:"text",inputMode:"decimal",value:n,onChange:l=>r(l.target.value),placeholder:"0",className:"bf-amount-input"}),(0,s.jsx)("span",{className:"bf-amount-usd",children:o})]}),(0,s.jsxs)("button",{type:"button",className:"bf-token-pill",onClick:i?void 0:a,disabled:!i&&!a,"data-locked":i?"true":void 0,"aria-label":`Select ${e.toLowerCase()} token`,children:[(0,s.jsx)(zn,{token:t}),(0,s.jsx)("span",{children:t?.symbol??"Select"}),!i&&(0,s.jsx)(nn,{size:16})]})]})]})}function dd({flow:e,side:t,onClose:n}){let o=S.useId(),[r,a]=S.useState(""),[i,l]=S.useState(null),p=t==="from"?e.fromToken:e.toToken;S.useEffect(()=>{l(document.body)},[]),S.useEffect(()=>{let g=v=>{v.key==="Escape"&&n()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]);let c=S.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),f=S.useMemo(()=>{let g=r.trim().toLowerCase();return g?c.filter(v=>v.symbol.toLowerCase().includes(g)||v.name.toLowerCase().includes(g)):c},[r,c]),m=S.useCallback(g=>{t==="from"?e.selectFromToken(g):e.selectToToken(g),n()},[e,n,t]);if(!i)return null;let h=kn();return(0,dn.createPortal)((0,s.jsx)("div",{className:"bf-token-picker-overlay","data-theme":h,role:"presentation",onMouseDown:g=>{g.target===g.currentTarget&&n()},children:(0,s.jsxs)("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[(0,s.jsx)("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),(0,s.jsxs)("header",{className:"bf-token-picker-head",children:[(0,s.jsx)("h3",{id:o,children:"Select a token"}),(0,s.jsx)("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:(0,s.jsx)(Nt,{size:24})})]}),(0,s.jsxs)("label",{className:"bf-token-search",children:[(0,s.jsx)(ps,{size:20}),(0,s.jsx)("span",{className:"bf-sr-only",children:"Search tokens"}),(0,s.jsx)("input",{value:r,onChange:g=>a(g.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),(0,s.jsxs)("div",{className:"bf-token-list",children:[f.map(g=>{let v=Bs(g,p),x=v?td(g):ed(g);return(0,s.jsxs)("button",{type:"button",className:"bf-token-row","data-selected":v?"true":"false",onClick:()=>m(g),children:[(0,s.jsxs)("span",{className:"bf-token-row-left",children:[(0,s.jsx)(zn,{token:g,size:40}),(0,s.jsxs)("span",{className:"bf-token-meta",children:[(0,s.jsx)("span",{className:"bf-token-symbol",children:g.symbol}),!v&&(0,s.jsx)("span",{className:"bf-token-name",children:g.name})]})]}),(0,s.jsxs)("span",{className:"bf-token-row-right",children:[(0,s.jsxs)("span",{className:"bf-token-balance",children:[As(g.balance),v?null:` ${g.symbol}`]}),x&&(0,s.jsx)("span",{className:"bf-token-price",children:x})]})]},Zc(g))}),f.length===0&&(0,s.jsx)("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),i)}function pd({flow:e,onClose:t}){let n=S.useId(),[o,r]=S.useState(null),a=Rs.find(x=>x.value===e.slippage),[i,l]=S.useState(e.slippage&&!a?e.slippage:""),p=i.trim()!==""&&i.trim()!==".",c=p?Number(i):NaN,f=Number.isFinite(c)&&c>50,m=Number.isFinite(c)&&c>5&&!f,h=x=>{e.setSlippage(x),t()},g=()=>{!p||f||(e.setSlippage(Ns(i)),t())};if(S.useEffect(()=>{r(document.body)},[]),S.useEffect(()=>{let x=w=>{w.key==="Escape"&&t()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[t]),!o)return null;let v=kn();return(0,dn.createPortal)((0,s.jsx)("div",{className:"bf-slippage-overlay","data-theme":v,role:"presentation",onMouseDown:x=>{x.target===x.currentTarget&&t()},children:(0,s.jsxs)("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,s.jsxs)("header",{className:"bf-slippage-head",children:[(0,s.jsx)("h3",{id:n,children:"Slippage Settings"}),(0,s.jsx)("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:(0,s.jsx)(Nt,{size:24})})]}),(0,s.jsxs)("div",{className:"bf-slippage-body",children:[(0,s.jsx)("p",{className:"bf-slippage-desc",children:"The maximum price difference you are willing to accept before the transaction is reverted. Higher slippage increases the chance of execution but may result in a worse price."}),(0,s.jsxs)("div",{className:"bf-slippage-controls",children:[(0,s.jsx)("div",{className:"bf-slippage-presets",children:Rs.map(x=>(0,s.jsx)("button",{type:"button",className:"bf-slippage-preset","data-selected":!p&&e.slippage===x.value?"true":"false",onClick:()=>h(x.value),children:x.label},x.value))}),(0,s.jsxs)("label",{className:"bf-slippage-custom","data-selected":p?"true":"false",children:[(0,s.jsx)("span",{className:"bf-sr-only",children:"Custom slippage percent"}),(0,s.jsx)("input",{value:i,onChange:x=>{l(Ns(x.target.value))},onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),g())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),(0,s.jsx)("span",{"aria-hidden":"true",children:"%"})]})]}),f?(0,s.jsx)("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):m?(0,s.jsx)("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,p&&(0,s.jsx)("button",{type:"button",className:"bf-slippage-apply",onClick:g,disabled:f,children:"Apply"})]})]})}),o)}function fd({flow:e}){let t=S.useId(),[n,o]=S.useState(!1),[r,a]=S.useState(null),i=kn();return S.useEffect(()=>{a(document.body)},[]),S.useEffect(()=>{let l=p=>{p.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!r||!e.termsOpen?null:(0,dn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",onPointerDown:l=>{l.target===l.currentTarget&&e.cancelTerms()},children:(0,s.jsxs)("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,s.jsx)("h3",{id:t,children:"Agree to Terms of Service"}),(0,s.jsx)("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),(0,s.jsxs)("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[(0,s.jsxs)("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,onClick:()=>o(l=>!l),children:[(0,s.jsx)("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"}),(0,s.jsx)("span",{children:"Agree to Terms of Use"})]}),e.termsUrl&&(0,s.jsx)("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]}),(0,s.jsx)("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),(0,s.jsx)("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,children:"Confirm"})]})}),r)}function ud({value:e,disabled:t=!1}){let[n,o]=S.useState(!1);return(0,s.jsx)("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{o(!0),window.setTimeout(()=>o(!1),1200)})},children:n?"OK":"Copy"})}function md({flow:e,approval:t}){let n=S.useId(),[o,r]=S.useState(null),a=kn();if(S.useEffect(()=>{r(document.body)},[]),S.useEffect(()=>{let p=c=>{e.status!=="submitting"&&c.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e]),!o)return null;let i=e.status==="submitting"||!e.approveBridge,l=e.status==="submitting";return(0,dn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",children:(0,s.jsxs)("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,s.jsxs)("h3",{id:n,children:["Approve ",t.token.symbol]}),(0,s.jsx)(zn,{token:t.token,size:72}),(0,s.jsxs)("div",{className:"bf-approve-address-box",children:[(0,s.jsx)("span",{children:"Token Address"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:t.tokenAddress}),(0,s.jsx)(ud,{value:t.tokenAddress,disabled:l})]})]}),(0,s.jsxs)("div",{className:"bf-action-buttons",children:[(0,s.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),(0,s.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:i,"aria-busy":l,children:[l&&(0,s.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,s.jsx)("span",{children:l?"Approving...":"Approve"})]})]})]})}),o)}function gd({flow:e}){let t=S.useId(),[n,o]=S.useState(null),r=kn();return S.useEffect(()=>{o(document.body)},[]),S.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=i=>{i.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.approvalSuccessOpen?null:(0,dn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:(0,s.jsxs)("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,s.jsx)("h3",{id:t,children:"Approval Success"}),(0,s.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,s.jsxs)("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",(0,s.jsx)("br",{}),"Please continue to the next step."]}),(0,s.jsxs)("div",{className:"bf-action-buttons",children:[(0,s.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,children:"Continue"})]})]})}),n)}function hd({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,a]=S.useState(!1),i=S.useMemo(()=>{let c=new vt.default(e||"0"),f=new vt.default(t||"0");return!c.isFinite()||!f.isFinite()||c.lte(0)||f.lte(0)?null:r?c.dividedBy(f):f.dividedBy(c)},[e,r,t]);if(!i||!n||!o||n.symbol===o.symbol)return null;let l=r?o.symbol:n.symbol,p=r?n.symbol:o.symbol;return(0,s.jsxs)("button",{type:"button",className:"bf-exchange-rate",onClick:()=>a(c=>!c),children:[(0,s.jsxs)("span",{children:["1 ",l]}),(0,s.jsx)(hs,{size:12}),(0,s.jsxs)("span",{children:[Ps(i)," ",p]})]})}function bd({flow:e}){return e.submitToast?(0,s.jsxs)("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[(0,s.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,s.jsx)("span",{className:"bf-status-spinner"})}),(0,s.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,s.jsx)("strong",{children:"Transaction Processing"}),(0,s.jsx)("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function wd({message:e}){let[t,n]=S.useState(!1);return S.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:(0,s.jsxs)("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[(0,s.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,s.jsx)("span",{className:"bf-status-error-mark",children:"!"})}),(0,s.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,s.jsx)("strong",{children:"Error"}),(0,s.jsx)("span",{children:e})]})]})}function xd(e){switch(e){case"swap":case"deposit-swap":case"swap-withdraw":return"Swap Transaction Sent";case"bridge":return"Bridge Transaction Sent";case"swap-bridge":return"Swap & Bridge Transaction Sent";case"bridge-swap":return"Bridge & Swap Transaction Sent";default:return"Transaction Sent"}}function vd({flow:e}){let t=S.useId(),[n,o]=S.useState(null),r=e.submitted,a=kn();return S.useEffect(()=>{o(document.body)},[]),S.useEffect(()=>{if(!e.successDialogOpen)return;let i=l=>{l.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e]),!n||!e.successDialogOpen||!r?null:(0,dn.createPortal)((0,s.jsx)("div",{className:"bf-success-overlay","data-theme":a,role:"presentation",children:(0,s.jsx)("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:(0,s.jsxs)("div",{className:"bf-success-body",children:[(0,s.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,s.jsxs)("div",{className:"bf-success-copy",children:[(0,s.jsx)("strong",{id:t,children:xd(r.pathType)}),(0,s.jsx)("span",{children:"Please check the results in the history."})]}),(0,s.jsx)("div",{className:"bf-success-route","aria-hidden":"true",children:(r.routeTokens&&r.routeTokens.length>0?r.routeTokens:[{symbol:r.fromToken.symbol,iconUrl:r.fromToken.iconUrl},{symbol:r.toToken.symbol,iconUrl:r.toToken.iconUrl}]).map((i,l)=>(0,s.jsxs)(S.Fragment,{children:[l>0&&(0,s.jsx)("span",{className:"bf-success-route-arrow",children:"\u2192"}),(0,s.jsx)(Lr,{token:i,size:43})]},`${i.symbol}-${l}`))}),(0,s.jsx)("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,children:"OK"})]})})}),n)}function Lr({token:e,size:t=16}){let n=!!e.iconUrl;return(0,s.jsx)("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?(0,s.jsx)("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):(0,s.jsx)("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function yd({row:e}){return e.routeTokens&&e.routeTokens.length>0?(0,s.jsx)("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>(0,s.jsxs)(S.Fragment,{children:[n>0&&(0,s.jsx)("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),(0,s.jsx)(Lr,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?(0,s.jsxs)("span",{className:"bf-info-value-token",children:[(0,s.jsx)(Lr,{token:e.valueToken}),(0,s.jsx)("span",{children:e.value})]}):(0,s.jsx)(s.Fragment,{children:e.value})}function _s({rows:e}){return!e||e.length===0?null:(0,s.jsx)("div",{className:"bf-info-rows",children:e.map((t,n)=>(0,s.jsxs)("div",{className:"bf-info-row",children:[(0,s.jsxs)("span",{className:"bf-info-label",children:[(0,s.jsx)("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),(0,s.jsx)("span",{children:t.label})]}),(0,s.jsx)("span",{className:"bf-info-value","data-tone":t.tone??"default",children:(0,s.jsx)(yd,{row:t})})]},`${t.label}-${t.value}`))})}function kd(e,t,n){return e.pathType==="bridge"?"Bridge Info":Ms(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function Sd({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=t&&n,r=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return(0,s.jsx)(s.Fragment,{children:r.map(a=>{let i=a==="swap"?e.swapInfo:e.bridgeInfo;return i?.length?(0,s.jsxs)("div",{className:"bf-info-section",children:[o&&(0,s.jsx)("h4",{children:a==="swap"?"Swap Info":"Bridge Info"}),(0,s.jsx)(_s,{rows:i})]},a):null})})}function Cd({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=kd(e,t,n),[a,i]=S.useState(!0),[l,p]=S.useState(!0);return(0,s.jsxs)("div",{className:"bf-details",children:[e.liquidity&&(0,s.jsxs)("section",{className:"bf-liquidity",children:[(0,s.jsxs)("div",{className:"bf-liquidity-head",children:[(0,s.jsx)("span",{children:e.liquidity.label??"Available Liquidity"}),(0,s.jsx)("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),(0,s.jsx)("div",{className:"bf-liquidity-track",children:(0,s.jsx)("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||n)&&(0,s.jsxs)("section",{className:"bf-detail-section bf-info-card","data-open":a?"true":"false",children:[(0,s.jsxs)("button",{type:"button",className:"bf-collapse-head","aria-expanded":a,onClick:()=>i(c=>!c),children:[(0,s.jsx)("h3",{children:r}),(0,s.jsx)(nn,{size:16,className:"bf-collapse-chevron"})]}),a&&(0,s.jsx)("div",{className:"bf-collapse-body",children:(0,s.jsx)(Sd,{summary:e})})]}),o&&(0,s.jsxs)("section",{className:"bf-detail-section bf-tx-fee-section","data-open":l?"true":"false",children:[(0,s.jsxs)("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":l,onClick:()=>p(c=>!c),children:[(0,s.jsx)("h3",{children:"Est. Tx Fee"}),(0,s.jsxs)("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&(0,s.jsx)("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&(0,s.jsx)("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),(0,s.jsx)("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:Xc(e.txFeeInfo?.estTxFee??"0")}),(0,s.jsx)(nn,{size:16,className:"bf-collapse-chevron"})]})]}),l&&(0,s.jsx)("div",{className:"bf-collapse-body",children:(0,s.jsx)(_s,{rows:e.txFee})})]})]})}function Rd({item:e}){let t=Bo(e),n=id(e.fromAmount,e.fromToken);return(0,s.jsxs)("article",{className:"bf-history-item",children:[(0,s.jsxs)("div",{className:"bf-history-item-head",children:[(0,s.jsx)("span",{className:"bf-history-status","data-status":t,children:sd(t)}),(0,s.jsx)("time",{className:"bf-history-time",dateTime:e.timestamp,children:od(e.timestamp)})]}),(0,s.jsxs)("div",{className:"bf-history-item-body",children:[(0,s.jsxs)("strong",{className:"bf-history-amount",children:[rd(e.fromAmount)," ",e.fromToken.symbol]}),(0,s.jsxs)("div",{className:"bf-history-meta",children:[(0,s.jsx)("span",{className:"bf-history-usd",children:n??nd(e.txHash)}),(0,s.jsxs)("span",{className:"bf-history-route",children:[(0,s.jsxs)("span",{className:"bf-history-route-token",children:[(0,s.jsx)(zn,{token:e.fromToken,size:16}),(0,s.jsx)("span",{children:e.fromToken.symbol})]}),(0,s.jsx)(gs,{size:16,className:"bf-history-route-arrow"}),(0,s.jsxs)("span",{className:"bf-history-route-token",children:[(0,s.jsx)(zn,{token:e.toToken,size:16}),(0,s.jsx)("span",{children:e.toToken.symbol})]})]})]})]})]})}function Nd({flow:e}){let[t,n]=S.useState("all"),o=e.history.some(i=>Bo(i)==="pending"),r=e.history.filter(i=>ad(i,t)),a=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return(0,s.jsxs)("main",{className:"bf-history-body",children:[(0,s.jsx)("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:Qc.map(i=>(0,s.jsxs)("button",{type:"button",className:"bf-history-tab","data-active":t===i.value?"true":"false",onClick:()=>n(i.value),children:[(0,s.jsx)("span",{children:i.label}),i.value==="pending"&&o&&(0,s.jsx)("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},i.value))}),r.length>0?(0,s.jsx)("div",{className:"bf-history-list",children:r.map(i=>(0,s.jsx)(Rd,{item:i},i.id||i.txHash))}):(0,s.jsx)("div",{className:"bf-empty",children:a})]})}function Td({flow:e,env:t}){let[n,o]=S.useState(null),[r,a]=S.useState(!1),[i,l]=S.useState(0),c=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??cd(e):null,f=Kc[t],m=ld(e.quoteError),h=Jc(e.fromAmount,e.fromToken),g=h?"Insufficient balance":m.from,v=e.quoteError&&!m.from&&!m.to?e.quoteError:"",x=e.error||v,w=e.history.some(u=>Bo(u)==="pending"),L=(c?.pathType??Fs(e.fromToken,e.toToken))!=="bridge";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("main",{className:"bf-body",children:[(0,s.jsxs)("div",{className:"bf-toolbar",children:[(0,s.jsxs)("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),children:[(0,s.jsx)(fs,{}),(0,s.jsx)("span",{children:"History"}),(w||e.hasNewHistory)&&(0,s.jsx)("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),L&&(0,s.jsxs)("button",{type:"button",className:"bf-chip",onClick:()=>a(!0),disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":r,children:[(0,s.jsx)(us,{}),(0,s.jsx)("span",{children:e.slippageLocked?"Auto 1%":Yc(e.slippage,e.effectiveSlippage)})]})]}),(0,s.jsxs)("div",{className:"bf-swap-card","data-has-from-error":g?"true":"false",children:[(0,s.jsx)(Ls,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:Ts(e.fromAmount,e.fromToken),onAmountChange:u=>e.setAmount(u,"from"),onTokenClick:()=>o("from")}),g&&(0,s.jsx)("div",{className:"bf-field-error",children:g}),(0,s.jsx)("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),l(u=>u+360)},style:{transform:`translateX(-50%) rotate(${i}deg)`,transition:"transform 0.2s ease"},children:(0,s.jsx)(ms,{size:22})}),(0,s.jsx)(Ls,{label:"To",token:e.toToken,amount:e.toAmount,usd:Ts(e.toAmount,e.toToken),onAmountChange:u=>e.setAmount(u,"to"),onTokenClick:()=>o("to"),locked:e.availableToTokens.length<=1}),m.to&&(0,s.jsx)("div",{className:"bf-field-error",children:m.to})]}),(0,s.jsx)(hd,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),c&&(0,s.jsx)(Cd,{summary:c})]}),(0,s.jsxs)("footer",{className:"bf-footer",children:[(0,s.jsx)("button",{type:"button",className:"bf-next",onClick:e.submit,disabled:e.status==="submitting"||!!e.quoteError||h,children:e.status==="submitting"?"Processing...":"Next"}),(0,s.jsxs)("a",{className:"bf-powered",href:f,target:"_blank",rel:"noreferrer",children:["Powered by ",(0,s.jsx)("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&(0,s.jsx)(dd,{flow:e,side:n,onClose:()=>o(null)}),r&&(0,s.jsx)(pd,{flow:e,onClose:()=>a(!1)}),(0,s.jsx)(fd,{flow:e}),e.approvalInfo&&(0,s.jsx)(md,{flow:e,approval:e.approvalInfo}),(0,s.jsx)(gd,{flow:e}),(0,s.jsx)(bd,{flow:e}),(0,s.jsx)(wd,{message:e.submitToast?"":x}),(0,s.jsx)(vd,{flow:e})]})}function Wn({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let a=S.useMemo(()=>Be(n),[n]),i=Cs({...r,onExit:t}),l=S.useRef(null),p=qc(l),c=i.step==="history"?"History":"Swap & Bridge";return(0,s.jsx)(Es.Provider,{value:p,children:(0,s.jsxs)("div",{ref:l,className:ee("bf-root",o),"data-view":i.step,"data-status":i.status,children:[(0,s.jsxs)("header",{className:"bf-header",children:[(0,s.jsx)("button",{type:"button",className:"bf-header-btn",onClick:i.back,"aria-label":"Back",children:(0,s.jsx)(tn,{size:24})}),(0,s.jsx)("span",{className:"bf-header-title",children:c}),(0,s.jsx)("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:(0,s.jsx)(Nt,{size:24})})]}),i.step==="history"?(0,s.jsx)(Nd,{flow:i}):(0,s.jsx)(Td,{flow:i,env:a})]})})}var d=require("react/jsx-runtime"),Id="On-ramp is not available in your region.";function Er(e,t,n){let o=Me[e],r=n.toUpperCase();if(t===o.cross&&r.includes("CROSSD"))return 0;if(t===o.cross&&r==="CROSS")return 1;if(t===o.bsc&&r==="CROSS")return 2}function Ld(e){return parseInt(e.split(":")[1],10)}function Ed(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Ad(e){let t=e.toLowerCase().replace(/^0x/,""),n=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),o=parseInt(n.slice(0,4),16)%360,r=(o+60+parseInt(n.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${o} 85% 65%), hsl(${r} 80% 55%))`}function zs({align:e="end",sideOffset:t=12,className:n,children:o}){let{env:r,theme:a,isMobile:i,open:l,drawerDirection:p,modal:c,showBalance:f,showForgeToken:m,showGameToken:h,showQR:g,showBridge:v,qrLogoSrc:x,walletAddress:w,accountName:y,sendAccounts:L,profileImageUrl:u,preferredTokens:T,close:C,onSelectWallet:A,onCopyAddress:F,onBuy:J,onDisconnect:_,disconnectLabel:Y,termsUrl:z,termsLabel:ne,privacyUrl:O,privacyLabel:ke,portalStyle:ce,navContent:fe,navPosition:Ke,footerContent:ue,view:$,setView:me,selectedSendToken:le,setSelectedSendToken:j,showPortfolio:Qe,portfolioTitle:we,showTotalAssets:Oe,totalAssetsLabel:xe,sendTransaction:ct,getTransactionReceipt:Te,estimateGas:Dt,onOutlink:Ge,lpBalanceReader:yt,stakingRewardsReader:At,bridgeTokens:ge,bridgeHistory:Se,getBridgeQuote:nt,getBridgeToTokens:Ie,getBridgeApproval:Ce,approveBridge:he,submitBridge:kt,onReceive:Ye,onBridge:St,onSend:Ze,onBuyDisabledMessage:ot,onBridgeDisabledMessage:Ue,onSendDisabledMessage:Le}=Ht(),[dt,Xe]=P.useState(null),$e=P.useRef(void 0),Re=P.useCallback(b=>{Xe(b),clearTimeout($e.current),$e.current=setTimeout(()=>Xe(null),4e3)},[]);P.useEffect(()=>()=>clearTimeout($e.current),[]);let de=!!ot,rt=P.useCallback(()=>{if(de){Re(ot);return}let b=J?.();b&&typeof b.then=="function"&&b.catch(()=>{Re(ot??Id)})},[de,ot,J,Re]),pt=!!Ue,je=!!Le,{tokens:ft,isLoading:it}=Mt(r,w,l&&f),{statsMap:Ve}=_t(r,f),{categoryMap:at}=fa(r,f),qe=f&&Oe,{displayValue:k,isLowerBound:K,isLoading:pe}=ma(r,w,l&&qe),[Ee,Ct]=P.useState(!1),Rt=P.useRef(null),[Pt,un]=P.useState(0),{holdings:Qt,isLoading:Yn}=aa(r,w,l&&f&&m),M=P.useMemo(()=>Qt.map(b=>b.token),[Qt]),{imageMap:Ae}=sa(r,M,m&&Qt.length>0),W=P.useMemo(()=>{let b=[],I=[],q=[],We=new Map((T??[]).map((Z,ve)=>[`${Ld(Z.chainId)}:${Z.address.toLowerCase()}`,ve]));for(let Z of ft){let ve=Er(r,Z.chainId,Z.symbol)!==void 0,Yt=`${Z.chainId}:${Z.address.toLowerCase()}`,Zt=We.get(Yt),Yo=new Sn.default(Z.quantity.numeric).shiftedBy(-Z.quantity.decimals);if(ve)b.push(Z);else if(Zt!==void 0)I.push(Z);else if(Yo.isGreaterThan(0)){if(!h&&at.get(hr(Z.chainId,Z.address))==="game")continue;q.push(Z)}}return b.sort((Z,ve)=>{let Yt=Er(r,Z.chainId,Z.symbol)??99,Zt=Er(r,ve.chainId,ve.symbol)??99;return Yt-Zt}),I.sort((Z,ve)=>{let Yt=We.get(`${Z.chainId}:${Z.address.toLowerCase()}`)??99,Zt=We.get(`${ve.chainId}:${ve.address.toLowerCase()}`)??99;return Yt-Zt}),q.sort((Z,ve)=>{let Yt=Ve.get(ht(Z.chainId,Z.address)),Zt=Ve.get(ht(ve.chainId,ve.address)),Yo=new Sn.default(Z.quantity.numeric).shiftedBy(-Z.quantity.decimals).multipliedBy(Yt?.price??0);return new Sn.default(ve.quantity.numeric).shiftedBy(-ve.quantity.decimals).multipliedBy(Zt?.price??0).minus(Yo).toNumber()}),[...b,...I,...q]},[ft,r,Ve,h,at,T]),Pe=P.useMemo(()=>{if(!m)return[];let b=new Set(ft.map(I=>I.address.toLowerCase()));return[...Qt].filter(I=>!b.has(I.token.toLowerCase())).sort((I,q)=>{let We=new Sn.default(I.value);return new Sn.default(q.value).minus(We).toNumber()})},[Qt,m,ft]),Bt=P.useRef(!1),[ze,Rn]=P.useState(null),mn=P.useRef(void 0),_r=ze?.chainId??le?.chainId??W[0]?.chainId??0,{transactionUrl:Go}=po(r,_r,ze?.txHash,!!(ze?.txHash&&_r)),Je=P.useCallback(b=>{Bt.current=!0,me(b)},[me]),[cl,Uo]=P.useState("recipient"),Zn=P.useCallback(()=>{j(null),Uo("recipient"),Je("wallet")},[j,Je]),$o=P.useCallback((b,I="recipient")=>{if(je){Re(Le);return}Uo(I),j(b),Je("send")},[je,Le,Re,j,Je]),dl=P.useCallback(()=>{if(pt){Re(Ue);return}if(St){St();return}Je("bridge")},[pt,Ue,St,Je,Re]),pl=P.useCallback(b=>{clearTimeout(mn.current),j(null),Je("wallet"),Rn({status:"pending",txHash:b.txHash,chainId:b.chainId,description:`${b.amount} ${b.tokenSymbol} to ${et(b.recipient)}`})},[j,Je]),fl=P.useCallback(b=>{let I=le?.chainId;j(null),Je("wallet"),!(!b||!I)&&(Rn(q=>({status:"success",txHash:b,chainId:I,description:q?.txHash===b?q.description:"Tap to see your transaction"})),clearTimeout(mn.current),mn.current=setTimeout(()=>Rn(null),5e3))},[le?.chainId,j,Je]),ul=P.useCallback(b=>{let I=b.txHash;I&&(Rn({status:"error",txHash:I,chainId:b.chainId,description:b.message}),clearTimeout(mn.current),mn.current=setTimeout(()=>Rn(null),5e3))},[]),jo=P.useMemo(()=>{if(Ye)return Ye;if(g)return()=>Je("qr")},[Ye,g,Je]),Vo=P.useMemo(()=>{if(Ze)return Ze;if(W.length===0)return;let b=W[0];return()=>$o(b,"token")},[Ze,W,$o]),ml=P.useCallback(()=>{if(je){Re(Le);return}Vo?.()},[je,Le,Vo,Re]);P.useEffect(()=>{l||(Bt.current=!1,Uo("recipient"))},[l]);let Or=P.useRef(null);P.useEffect(()=>{let b=Or.current;if(!b||!i)return;let I=q=>{q.pointerType==="touch"&&q.stopPropagation()};return b.addEventListener("pointerdown",I),()=>b.removeEventListener("pointerdown",I)},[i]);let[gn,zr]=P.useState(!1),qo=P.useRef(void 0),[Nn,Tn]=P.useState(!1);P.useEffect(()=>{if(!Nn)return;let b=()=>Tn(!1),I=We=>{We.key==="Escape"&&Tn(!1)},q=setTimeout(()=>{document.addEventListener("mousedown",b,!0),document.addEventListener("keydown",I,!0)},0);return()=>{clearTimeout(q),document.removeEventListener("mousedown",b,!0),document.removeEventListener("keydown",I,!0)}},[Nn]),P.useEffect(()=>{Tn(!1)},[w]),P.useEffect(()=>()=>clearTimeout(qo.current),[]),P.useEffect(()=>()=>clearTimeout(mn.current),[]),P.useEffect(()=>{let b=Rt.current;if(!b||ue===null){un(0);return}let I=()=>{un(b.offsetHeight)};if(I(),typeof ResizeObserver>"u")return;let q=new ResizeObserver(I);return q.observe(b),()=>q.disconnect()},[ue]);let Wr=P.useCallback(async()=>{if(!gn)try{await navigator.clipboard.writeText(w),zr(!0),clearTimeout(qo.current),qo.current=setTimeout(()=>zr(!1),2e3),F?.(w,!0)}catch{F?.(w,!1)}},[w,F,gn]),Xn=P.useCallback(b=>{b.currentTarget.setAttribute("data-loaded","true")},[]),Dr=P.useMemo(()=>({background:Ad(w)}),[w]),Jn=P.useMemo(()=>u||Ft(r,w,{size:120,bg:a==="dark"?"1A1A2E":"F3F6F8"}),[u,r,w,a]),Ko=P.useMemo(()=>Ed(k),[k]),Hr=z||O?(0,d.jsxs)("div",{className:"wi-legal-links",children:[z&&(0,d.jsx)("a",{className:"wi-legal-link",href:z,target:"_blank",rel:"noopener noreferrer",onClick:b=>tt(b,z,{category:"terms",origin:"terms"},Ge),children:ne}),z&&O&&(0,d.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),O&&(0,d.jsx)("a",{className:"wi-legal-link",href:O,target:"_blank",rel:"noopener noreferrer",onClick:b=>tt(b,O,{category:"privacy",origin:"privacy"},Ge),children:ke})]}):null,Gr=_?(0,d.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{_(),C()},children:[(0,d.jsx)(di,{size:16}),(0,d.jsx)("span",{className:"wi-disconnect-label",children:Y})]}):null,gl=f&&!fe?(0,d.jsxs)("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[(0,d.jsxs)("button",{type:"button",className:ee("wi-action-card",de&&"wi-action-card--dimmed"),onClick:rt,disabled:!J&&!de,"aria-disabled":de||void 0,"aria-label":"Buy",children:[(0,d.jsx)(hi,{size:20}),(0,d.jsx)("span",{children:"Buy"})]}),v?(0,d.jsxs)("button",{type:"button",className:ee("wi-action-card",pt&&"wi-action-card--dimmed"),onClick:dl,"aria-disabled":pt||void 0,"aria-label":"Bridge",children:[(0,d.jsx)(bi,{size:20}),(0,d.jsx)("span",{children:"Bridge"})]}):(0,d.jsxs)("button",{type:"button",className:"wi-action-card",onClick:jo,disabled:!jo,"aria-label":"Receive",children:[(0,d.jsx)(or,{size:20}),(0,d.jsx)("span",{children:"Receive"})]}),(0,d.jsxs)("button",{type:"button",className:ee("wi-action-card",je&&"wi-action-card--dimmed"),onClick:ml,disabled:!je&&!Vo,"aria-disabled":je||void 0,"aria-label":"Send",children:[(0,d.jsx)(mi,{size:20}),(0,d.jsx)("span",{children:"Send"})]}),(0,d.jsxs)("button",{type:"button",className:"wi-action-card",onClick:()=>Je("portfolio"),disabled:!Qe,"aria-label":"View portfolio",children:[(0,d.jsx)(gi,{size:20}),(0,d.jsx)("span",{children:"Portfolio"})]})]}):null,hl=(0,d.jsxs)("div",{className:ee("wi-view-inner",Bt.current&&"wi-view-wallet"),children:[qe&&(0,d.jsxs)("div",{className:"wi-total-section",children:[(0,d.jsxs)("div",{className:"wi-total-head",children:[(0,d.jsx)("span",{className:"wi-total-label",children:xe}),(0,d.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:b=>{b.stopPropagation(),Ct(I=>!I)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),Ct(I=>!I))},"aria-label":Ee?"Show balance":"Hide balance",children:Ee?(0,d.jsx)(fi,{}):(0,d.jsx)(pi,{})})]}),(0,d.jsx)("div",{className:"wi-total-body",children:pe?(0,d.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):(0,d.jsx)("div",{className:"wi-total-value","data-hidden":Ee||void 0,children:Ee?(0,d.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,d.jsxs)(d.Fragment,{children:[K&&(0,d.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,d.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,d.jsx)("span",{className:"wi-total-amount",children:Ko.main}),Ko.decimal&&(0,d.jsx)("span",{className:"wi-total-decimal",children:Ko.decimal})]})})})]}),Ke==="top"&&(fe?(0,d.jsx)("div",{className:"wi-nav-fixed",children:fe}):gl),f&&(0,d.jsx)("div",{ref:Or,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,d.jsxs)("div",{className:"wi-token-list",children:[it&&Array.from({length:5},(b,I)=>(0,d.jsxs)("div",{className:"wi-skeleton-item",children:[(0,d.jsxs)("div",{className:"wi-skeleton-left",children:[(0,d.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,d.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,d.jsxs)("div",{className:"wi-skeleton-right",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},I)),!it&&W.length===0&&!m&&(0,d.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),W.map(b=>{let I=Ve.get(ht(b.chainId,b.address)),q=I?parseFloat(I.percent_change_24h):null,We=q!==null&&q>=0,Z=Bn(r,b.chainId);return(0,d.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>$o(b),"aria-label":`Send ${b.symbol}`,children:[(0,d.jsxs)("div",{className:"wi-token-left",children:[(0,d.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,d.jsx)("img",{src:b.icon_url,alt:b.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Xn,onError:ve=>{ve.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Z&&(0,d.jsx)("img",{src:Z,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:ve=>{ve.currentTarget.style.display="none"}})]}),(0,d.jsxs)("div",{className:"wi-token-info",children:[(0,d.jsx)("span",{className:"wi-token-name",children:b.symbol}),I&&(0,d.jsxs)("div",{className:"wi-token-price-row",children:[(0,d.jsx)("span",{className:"wi-token-price",children:rr(I.price)}),(0,d.jsx)("span",{className:"wi-token-change","data-positive":We,"data-zero":q===0||void 0,children:q!==null&&(q===0?"0%":`${We?"+":"-"}${(We?Math.floor:Math.ceil)(Math.abs(q)*100)/100}%`)})]})]})]}),(0,d.jsxs)("div",{className:"wi-token-right",children:[(0,d.jsx)("span",{className:"wi-token-balance",children:Ut(b.quantity.numeric,b.quantity.decimals)}),I&&(0,d.jsx)("span",{className:"wi-token-value",children:xi(b.quantity.numeric,b.quantity.decimals,I.price)})]})]},`${b.address}-${b.chainId}`)}),m&&Yn&&Array.from({length:3},(b,I)=>(0,d.jsxs)("div",{className:"wi-skeleton-item",children:[(0,d.jsxs)("div",{className:"wi-skeleton-left",children:[(0,d.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,d.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,d.jsxs)("div",{className:"wi-skeleton-right",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${I}`)),m&&!Yn&&!it&&W.length===0&&Pe.length===0&&(0,d.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),m&&Pe.map(b=>{let I=Ae.get(b.token)||"",q=Bn(r,Me[r].cross);return(0,d.jsxs)("div",{className:"wi-token-item",children:[(0,d.jsxs)("div",{className:"wi-token-left",children:[(0,d.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,d.jsx)("img",{src:I||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:b.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Xn,onError:We=>{We.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),q&&(0,d.jsx)("img",{src:q,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:We=>{We.currentTarget.style.display="none"}})]}),(0,d.jsxs)("div",{className:"wi-token-info",children:[(0,d.jsx)("span",{className:"wi-token-name",children:b.token_name}),(0,d.jsx)("div",{className:"wi-token-price-row",children:(0,d.jsxs)("span",{className:"wi-token-price",children:[Ut(b.current_price,18)," CROSS"]})})]})]}),(0,d.jsxs)("div",{className:"wi-token-right",children:[(0,d.jsx)("span",{className:"wi-token-balance",children:Ut(b.balance,18)}),(0,d.jsx)("span",{className:"wi-token-value",children:rr(b.current_value_usd)})]})]},`forge-${b.token}`)})]})}),Ke==="bottom"&&fe&&(0,d.jsx)("div",{className:"wi-nav-fixed",children:fe}),Gr&&(0,d.jsx)("div",{className:"wi-wallet-disconnect-row",children:Gr})]},"wallet"),bl=Qe?(0,d.jsx)("div",{className:ee("wi-view-inner wi-portfolio-body",Bt.current&&"wi-view-portfolio"),children:(0,d.jsx)(sn,{env:r,theme:a,walletAddress:w,showHeader:!1,onOutlink:Ge,lpBalanceReader:yt,stakingRewardsReader:At})},"portfolio"):null,wl=le?(0,d.jsx)("div",{className:ee("wi-view-inner wi-send-body",Bt.current&&"wi-view-send"),children:(0,d.jsx)(Fn,{env:r,theme:a,walletAddress:w,accountName:y,accounts:L,initialStep:cl,token:le,tokens:W,onTokenChange:j,sendTransaction:ct,getTransactionReceipt:Te,estimateGas:Dt,getTokenPriceUsd:b=>{let I=Ve.get(ht(b.chainId,b.address));if(!I?.price)return;let q=parseFloat(I.price);return Number.isFinite(q)?q:void 0},onClose:C,onBackToWallet:Zn,onSubmitted:pl,onSuccess:fl,onFailed:ul,onOutlink:Ge})},"send"):null,xl=P.useMemo(()=>ge||W.map(b=>{let I=Ve.get(ht(b.chainId,b.address)),q=I?.price?parseFloat(I.price):void 0;return{name:b.name,symbol:b.symbol,chainId:b.chainId,address:b.address,decimals:b.quantity.decimals,balance:cr(b.quantity.numeric,b.quantity.decimals),iconUrl:b.icon_url,priceUsd:Number.isFinite(q)?q:void 0}}),[ge,Ve,W]),vl=(0,d.jsx)("div",{className:ee("wi-view-inner wi-bridge-body",Bt.current&&"wi-view-send"),children:(0,d.jsx)(Wn,{env:r,walletAddress:w,tokens:xl,history:Se,termsUrl:z,getQuote:nt,getToTokens:Ie,getApproval:Ce,approveBridge:he,submitBridge:kt,onClose:C,onBackToWallet:Zn})},"bridge"),Qo=!!A&&y?.trim().toLowerCase()!=="my wallet",Ur=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"wi-receive-avatar",children:[(0,d.jsx)("span",{className:"wi-avatar-fallback",style:Dr}),Jn&&(0,d.jsx)("img",{src:Jn,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:Xn,onError:b=>{b.currentTarget.style.display="none"}})]}),(0,d.jsx)("span",{className:"wi-receive-account-name",children:y??"Account 1"}),Qo&&(0,d.jsx)("span",{className:"wi-receive-chevron","data-open":Nn,"aria-hidden":"true",children:(0,d.jsx)(nn,{size:16})})]}),yl=(0,d.jsxs)("div",{className:ee("wi-view-inner wi-qr-body",Bt.current&&"wi-view-qr"),children:[(0,d.jsxs)("div",{className:"wi-receive-section",children:[Qo?(0,d.jsx)("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{Tn(!0),A?.()},"aria-label":"Switch account",children:Ur}):(0,d.jsx)("div",{className:"wi-receive-account",children:Ur}),(0,d.jsxs)("div",{className:"wi-qr-block",children:[(0,d.jsxs)("div",{className:"wi-qr-box",children:[(0,d.jsx)(Os.QRCodeSVG,{value:w,size:180,level:"H",marginSize:2,...x&&{imageSettings:{src:x,height:33,width:33,excavate:!0}}}),!x&&(0,d.jsx)("div",{className:"wi-qr-logo",children:(0,d.jsx)(ui,{size:33})})]}),(0,d.jsx)("p",{className:"wi-qr-address",children:w})]}),(0,d.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:Wr,children:[(0,d.jsx)("span",{className:"wi-qr-copy-icon",children:gn?(0,d.jsx)(en,{size:16}):(0,d.jsx)(An,{size:16})}),(0,d.jsx)("span",{className:"wi-qr-copy-text",children:gn?"Copied!":"Copy address"})]})]}),Hr&&(0,d.jsx)("div",{className:"wi-receive-footer",children:Hr})]},"qr"),kl=$==="qr"||$==="portfolio"||$==="send"||$==="bridge",$r=ue!==null?(0,d.jsx)("div",{className:"wi-builtin-footer",children:ue}):null,jr=(0,d.jsxs)("div",{className:"wi-account-text",children:[Qo?(0,d.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{Tn(!0),A?.()},"aria-label":"Switch account","aria-expanded":Nn,children:[(0,d.jsx)("span",{className:"wi-account-name",children:y??"Account 1"}),(0,d.jsx)("span",{className:"wi-account-switch","data-open":Nn,"aria-hidden":"true",children:(0,d.jsx)(nn,{size:20})})]}):(0,d.jsx)("div",{className:"wi-account-row",children:(0,d.jsx)("span",{className:"wi-account-name",children:y??"Account 1"})}),(0,d.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:Wr,"aria-label":"Copy address",children:[(0,d.jsx)("span",{className:"wi-account-address",children:et(w)}),(0,d.jsx)("span",{className:"wi-account-copy","data-copied":gn,children:gn?(0,d.jsx)(en,{size:12}):(0,d.jsx)(An,{size:12})})]})]}),Vr=(0,d.jsxs)(d.Fragment,{children:[o,$==="qr"?(0,d.jsx)("div",{className:"wi-sticky-header",children:(0,d.jsxs)("div",{className:"wi-header wi-header--receive",children:[(0,d.jsx)("button",{type:"button",className:"wi-header-back",onClick:Zn,"aria-label":"Back",children:(0,d.jsx)(tn,{size:24})}),(0,d.jsx)("span",{className:"wi-receive-title",children:"Receive"}),(0,d.jsx)("button",{type:"button",className:"wi-header-action",onClick:C,"aria-label":"Close",children:(0,d.jsx)(Nt,{size:24})})]})}):$==="send"||$==="bridge"?null:kl?(0,d.jsxs)("div",{className:"wi-sticky-header",children:[(0,d.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,d.jsx)("button",{type:"button",className:"wi-header-back",onClick:Zn,"aria-label":"Back",children:(0,d.jsx)(tn,{size:24})}),(0,d.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:jr}),(0,d.jsx)("button",{type:"button",className:"wi-header-action",onClick:C,"aria-label":"Close",children:(0,d.jsx)(Nt,{size:24})})]}),(0,d.jsx)("hr",{className:"wi-divider"})]}):(0,d.jsxs)("div",{className:"wi-sticky-header",children:[(0,d.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,d.jsxs)("div",{className:"wi-account-block",children:[(0,d.jsxs)("div",{className:"wi-avatar",children:[(0,d.jsx)("div",{className:"wi-avatar-fallback",style:Dr}),Jn&&(0,d.jsx)("img",{src:Jn,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:Xn,onError:b=>{b.currentTarget.style.display="none"}})]}),jr]}),(0,d.jsxs)("div",{className:"wi-header-actions",children:[g&&v&&(0,d.jsx)("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:jo,"aria-label":"Show QR code",children:(0,d.jsx)(or,{size:20})}),(0,d.jsx)("button",{type:"button",className:"wi-header-action",onClick:C,"aria-label":"Close",children:(0,d.jsx)(Nt,{size:24})})]})]}),(0,d.jsx)("hr",{className:"wi-divider"})]}),(0,d.jsxs)("div",{className:"wi-view-container",children:[$==="wallet"&&hl,$==="qr"&&yl,$==="portfolio"&&bl,$==="send"&&wl,$==="bridge"&&vl]}),$==="wallet"&&dt&&(0,d.jsx)("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:dt}),$==="wallet"&&ze&&(0,d.jsxs)("a",{className:"wi-send-toast",href:Go??"#",target:"_blank",rel:"noopener noreferrer",onClick:b=>{if(!Go){b.preventDefault();return}tt(b,Go,{category:"send",origin:"send-transaction",payload:{chainId:ze.chainId,txHash:ze.txHash}},Ge)},children:[(0,d.jsx)("span",{className:"wi-send-toast-icon","data-status":ze.status,"aria-hidden":!0,children:ze.status==="pending"?(0,d.jsx)("span",{className:"wi-send-toast-spinner"}):ze.status==="error"?(0,d.jsx)("span",{className:"wi-send-toast-error-dot"}):(0,d.jsx)(wi,{size:20})}),(0,d.jsxs)("span",{className:"wi-send-toast-copy",children:[(0,d.jsx)("span",{className:"wi-send-toast-title",children:ze.status==="pending"?"Sending...":ze.status==="error"?"Send failed":"Send complete"}),(0,d.jsx)("span",{className:"wi-send-toast-desc",children:ze.status==="pending"||ze.status==="error"?ze.description:"Tap to see your transaction"})]})]}),$r&&$!=="portfolio"&&$!=="send"&&(0,d.jsx)("div",{className:"wi-sticky-footer",children:(0,d.jsx)("div",{className:"wi-footer",ref:Rt,children:$r})})]}),qr={...ce,...Pt>0?{"--wi-footer-height":`${Pt}px`}:null};return i?(0,d.jsxs)(Dn.Drawer.Portal,{children:[c&&(0,d.jsx)(Dn.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,d.jsxs)(Dn.Drawer.Content,{className:ee("wi-drawer-content",n),"data-theme":a,"data-vaul-no-drag":p==="left"||p==="right"?!0:void 0,style:qr,"data-direction":p,"data-no-balance":!f||void 0,"data-has-footer":Pt>0||void 0,"data-view":$,children:[(0,d.jsx)(Dn.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),Vr]})]}):(0,d.jsxs)(d.Fragment,{children:[c&&l&&(0,d.jsx)("div",{className:"wi-drawer-overlay",onClick:C}),(0,d.jsx)(Fo.Portal,{children:(0,d.jsx)(Fo.Content,{align:e,sideOffset:t,className:ee("wi-popover-content",n),"data-theme":a,style:qr,"data-no-balance":!f||void 0,"data-has-footer":Pt>0||void 0,"data-view":$,children:Vr})})]})}var Ws=D(require("react"),1);function Ds({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=Ht();return Ws.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}var Hs=D(require("react"),1);function Gs({children:e}){let{setFooterContent:t}=Ht();return Hs.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}H(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #121212);--wi-surface-default: var(--ds-surface-medium, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(255, 255, 255, .1));--wi-border-default: var(--ds-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--ds-border-medium, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--ds-content-highest, #ffffff);--wi-texticon-secondary: var(--ds-content-medium, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(255, 255, 255, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #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(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #ffffff);--wi-surface-default: var(--ds-surface-medium, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(18, 18, 18, .1));--wi-border-default: var(--ds-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--ds-border-medium, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--ds-content-highest, #121212);--wi-texticon-secondary: var(--ds-content-medium, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(18, 18, 18, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
11
+ `);H(`.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}
12
+ `);H(`@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}}
13
+ `);H(`.wi-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;width:393px;border-radius:24px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--wi-surface-bg);box-shadow:var(--ds-shadow-modal, var(--wi-shadow));animation:wi-fade-in .15s ease-out;height:600px;overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(600px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:0;left:0;right:0;width:100%;max-height:100dvh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:100dvh}.wi-popover-content[data-view=qr]{max-height:calc(100dvh - 32px)}.wi-sticky-header{flex-shrink:0;position:relative}.wi-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px}.wi-header--wallet{align-items:flex-start;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--wallet+.wi-divider{display:none}.wi-header--sub-account{align-items:center}.wi-header--sub-account .wi-header-back{width:32px;height:38px}.wi-header--sub-account .wi-header-action{flex-shrink:0}.wi-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wi-account-block--sub-account{align-items:center}.wi-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border-radius:50%;background:var(--wi-surface-bg);box-sizing:border-box;overflow:hidden}.wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-avatar-img{position:relative;z-index:1;width:32px;height:32px;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;margin:0;width:fit-content;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:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-switch{display:inline-flex;align-items:center;justify-content:center;padding:2px 0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));border-radius:4px;flex-shrink:0;transition:color .15s ease,transform .2s ease}.wi-account-switch[data-open=true]{transform:rotate(180deg)}.wi-account-row--btn:hover .wi-account-switch{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-address-row-btn{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;text-align:left;min-width:0;transition:color .15s ease}.wi-address-row-btn:hover .wi-account-address,.wi-address-row-btn:hover .wi-account-copy{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-account-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));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;transition:color .15s ease}.wi-account-copy[data-copied=true]{color:var(--ds-system-green-high, #00a869)}.wi-header-actions{display:flex;align-items:center;gap:16px;flex-shrink:0;margin-top:-4px}.wi-header-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;border-radius:0;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header-action--qr{width:32px;height:32px;border-radius:8px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));transition:background-color .15s ease,color .15s ease}.wi-header-action--qr:hover{background:var(--ds-surface-high, rgba(0, 0, 0, .08));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header--receive{align-items:center;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--receive .wi-header-action,.wi-header--sub-account .wi-header-action{position:absolute;top:24px;right:24px}.wi-receive-title{position:absolute;left:50%;transform:translate(-50%);font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);text-align:center;pointer-events:none}.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(--ds-content-low, #00000066);transition:opacity .15s ease}.wi-header-close:hover{opacity:.7}.wi-total-section{margin:24px 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}.wi-action-row{display:flex;align-items:flex-start;gap:8px;width:auto;margin:24px 24px 0}.wi-action-card{appearance:none;display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 8px;border:none;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-align:center;cursor:pointer;transition:background-color .15s ease,color .15s ease}.wi-action-card:hover:not(:disabled){background:#2e3544!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}:root[data-ds-theme=light] .wi-action-card:hover:not(:disabled){background:#e4e8ef!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-action-card:disabled{cursor:default}.wi-action-card>svg{flex-shrink:0}.wi-action-card:not(:disabled){transition:background-color .15s ease,transform .1s ease}.wi-action-card:active:not(:disabled){transform:scale(.93)}.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-label{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.wi-total-eye{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease;border-radius:4px}.wi-total-eye:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.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.25;color:var(--ds-content-highest, #000000);font-variant-numeric:tabular-nums;min-height:45px;white-space:nowrap}.wi-total-currency,.wi-total-amount,.wi-total-decimal{font-size:36px;color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:22px;color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:32px;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:8px 0 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:0;padding:8px 0}.wi-token-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 24px;border:none;background:transparent;text-align:left;font-family:inherit;width:100%;box-sizing:border-box}.wi-token-item--button{cursor:pointer;background:var(--ds-surface-default, #ffffff);transition:none}.wi-token-item--button:hover{background:#252b39!important}:root[data-ds-theme=light] .wi-token-item--button:hover{background:#eff3f8!important}button.wi-token-item:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px;border-radius:4px}.wi-token-left{display:flex;align-items:center;gap:16px;min-width:0}.wi-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.wi-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain;opacity:0;transition:opacity .2s ease}.wi-token-icon[data-loaded=true]{opacity:1}.wi-token-chain-badge{position:absolute;right:0;bottom:0;width:14px;height:14px;border-radius:50%;background:var(--wi-surface-bg);box-shadow:0 0 0 1.5px var(--wi-surface-bg);object-fit:contain}.wi-token-info{display:flex;flex-direction:column;min-width:0}.wi-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-token-price-row{display:flex;align-items:center;gap:8px}.wi-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wi-token-change{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap}.wi-token-change[data-positive=true]{color:var(--ds-system-green-high, #00a0a2)}.wi-token-change[data-positive=false]{color:var(--ds-system-red-high, #a80927)}.wi-token-change[data-zero]{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.wi-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.wi-token-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wi-sticky-footer{flex-shrink:0}.wi-footer{padding:16px 24px 24px}.wi-builtin-footer{display:flex;flex-direction:column;gap:8px;align-items:stretch}.wi-wallet-disconnect-row{display:flex;justify-content:flex-end;flex-shrink:0;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-send-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:2;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);box-sizing:border-box;text-decoration:none}.wi-action-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:3;padding:12px 14px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);font-size:14px;line-height:1.4;text-align:center;box-sizing:border-box;animation:wi-action-toast-in .18s ease-out}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-action-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-action-toast{bottom:72px}@keyframes wi-action-toast-in{0%{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}.wi-action-card--dimmed{opacity:.4;cursor:pointer}.wi-action-card--dimmed:hover{opacity:.5}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-send-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-send-toast{bottom:72px}.wi-send-toast:hover{opacity:.92}.wi-send-toast-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;color:var(--ds-accent-primary-default, #00b4b7)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(0,232,201,.22);border-top-color:var(--ds-accent-primary-on-inverted, #00e8c9);border-radius:50%;animation:wi-send-toast-spin .8s linear infinite}.wi-send-toast-error-dot{width:18px;height:18px;border-radius:50%;background:var(--ds-system-red-default, #ff3358)}@keyframes wi-send-toast-spin{to{transform:rotate(360deg)}}.wi-send-toast-copy{display:flex;min-width:0;flex-direction:column}.wi-send-toast-title{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-inverted, #ffffff)}.wi-send-toast-desc{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-accent-primary-on-inverted, #00e8c9)}.wi-send-toast-icon[data-status=error]+.wi-send-toast-copy .wi-send-toast-desc{color:var(--ds-system-red-default, #ff3358)}.wi-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:16px;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:color .15s ease}.wi-disconnect-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;flex-shrink:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-receive-avatar .wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-receive-avatar .wi-avatar-img{width:24px;height:24px}.wi-legal-link{color:var(--ds-content-low, rgba(0, 0, 0, .4));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.wi-legal-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.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;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-back:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-view-container{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-popover-content[data-view=qr] .wi-view-container,.wi-drawer-content[data-view=qr] .wi-view-container{flex:1;min-height:0}.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-body-inner{padding:16px 16px 32px;gap:32px}.wi-receive-section{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:24px}.wi-receive-account{display:inline-flex;align-items:center;gap:8px;padding:4px 8px 4px 4px;border:0;background:var(--ds-surface-high, #edf1f2);border-radius:9999px;font-family:inherit;color:inherit}.wi-receive-account--btn{cursor:pointer;transition:none}.wi-receive-account--btn:hover{background:#2e3544}:root[data-ds-theme=light] .wi-receive-account--btn:hover{background:#e4e8ef}.wi-receive-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;overflow:hidden;flex-shrink:0}.wi-receive-account-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-receive-account>svg{color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0}.wi-receive-chevron{display:inline-flex;align-items:center;color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0;transition:transform .2s ease}.wi-receive-chevron[data-open=true]{transform:rotate(180deg)}.wi-qr-block{display:flex;flex-direction:column;align-items:center;gap:16px}.wi-qr-box{position:relative;display:flex;align-items:center;justify-content:center;padding:10px;background:#fff;border-radius:6px;overflow:hidden}.wi-qr-logo{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none}.wi-qr-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:16px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;word-break:break-all;max-width:281px;margin:0}.wi-qr-copy-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:12px 16px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);border-radius:12px;cursor:pointer;transition:border-color .15s ease}.wi-qr-copy-btn:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.wi-qr-copy-icon{display:inline-flex;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-qr-copy-text{font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-receive-footer{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-drawer-content .wi-header{padding:16px}.wi-drawer-content .wi-header--receive .wi-header-action,.wi-drawer-content .wi-header--sub-account .wi-header-action{top:16px;right:16px}.wi-drawer-content .wi-total-section,.wi-drawer-content .wi-action-row{margin:16px 16px 0}.wi-drawer-content .wi-nav-fixed{padding:0 16px}.wi-drawer-content .wi-token-item{padding:12px 16px}.wi-drawer-content .wi-wallet-disconnect-row{padding:16px}
14
+ `);H(`.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}
15
+ `);var Mo=require("react/jsx-runtime"),Pd="https://terms.crosstoken.io/docs/cross-terms-of-use",Bd="https://terms.crosstoken.io/docs/nexus-privacy-policy";function Fd({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:o,modal:r,showBalance:a=!1,showForgeToken:i=!1,showGameToken:l=!0,showQR:p=!0,showBridge:c=!0,qrLogoSrc:f,walletAddress:m,accountName:h,sendAccounts:g,profileImageUrl:v,connectorId:x,connectorName:w,connectorIconUrl:y,preferredTokens:L=[],onSelectWallet:u,onCopyAddress:T,onBuy:C,onBuyDisabledMessage:A,onBridgeDisabledMessage:F,onSendDisabledMessage:J,onDisconnect:_,disconnectLabel:Y="Disconnect",termsUrl:z=Pd,termsLabel:ne="Terms of Service",privacyUrl:O=Bd,privacyLabel:ke="Privacy Policy",open:ce,onOpenChange:fe,showPortfolio:Ke=!1,portfolioTitle:ue="My Portfolio",showTotalAssets:$=!0,totalAssetsLabel:me="Total Assets USD",sendTransaction:le,getTransactionReceipt:j,estimateGas:Qe,onOutlink:we,lpBalanceReader:Oe,stakingRewardsReader:xe,bridgeTokens:ct,bridgeHistory:Te,getBridgeQuote:Dt,getBridgeToTokens:Ge,getBridgeApproval:yt,approveBridge:At,submitBridge:ge,onReceive:Se,onBridge:nt,onSend:Ie,style:Ce,children:he}){let kt=Be(e),Ye=x?En[x]:void 0,St=w??Ye?.name,Ze=y??Ye?.iconUrl,ot=hn(`(max-width: ${n}px)`),Ue=o??(a?"right":"bottom"),Le=Ue==="left"||Ue==="right",dt=r??!1,Xe=ce!==void 0,[$e,Re]=He.useState(!1),de=Xe?ce:$e,rt=He.useCallback(Pt=>{Xe||Re(Pt),fe?.(Pt)},[Xe,fe]),pt=He.useCallback(()=>rt(!1),[rt]),[je,ft]=He.useState(null),[it,Ve]=He.useState("top"),[at,qe]=He.useState(null),[k,K]=He.useState("wallet"),[pe,Ee]=He.useState(null);He.useEffect(()=>{de||(K("wallet"),Ee(null))},[de]);let Ct=He.useCallback(()=>{lr(m),_?.()},[_,m]),Rt=He.useMemo(()=>({env:kt,theme:t,isMobile:ot,open:de,drawerDirection:Ue,modal:dt,showBalance:a,showForgeToken:i,showGameToken:l,showQR:p,showBridge:c,qrLogoSrc:f,walletAddress:m,accountName:h,sendAccounts:g,profileImageUrl:v,connectorName:St,connectorIconUrl:Ze,preferredTokens:L,close:pt,onSelectWallet:u,onCopyAddress:T,onBuy:C,onBuyDisabledMessage:A,onBridgeDisabledMessage:F,onSendDisabledMessage:J,onDisconnect:_?Ct:void 0,disconnectLabel:Y,termsUrl:z,termsLabel:ne,privacyUrl:O,privacyLabel:ke,portalStyle:Ce,navContent:je,navPosition:it,setNavContent:ft,setNavPosition:Ve,footerContent:at,setFooterContent:qe,view:k,setView:K,selectedSendToken:pe,setSelectedSendToken:Ee,showPortfolio:Ke,portfolioTitle:ue,showTotalAssets:$,totalAssetsLabel:me,sendTransaction:le,getTransactionReceipt:j,estimateGas:Qe,onOutlink:we,lpBalanceReader:Oe,stakingRewardsReader:xe,bridgeTokens:ct,bridgeHistory:Te,getBridgeQuote:Dt,getBridgeToTokens:Ge,getBridgeApproval:yt,approveBridge:At,submitBridge:ge,onReceive:Se,onBridge:nt,onSend:Ie}),[kt,t,ot,de,Ue,dt,a,i,l,p,c,f,m,h,g,v,St,Ze,L,pt,u,T,C,A,F,J,_,Ct,Y,z,ne,O,ke,Ce,je,it,at,k,pe,Ke,ue,$,me,le,j,Qe,we,Oe,xe,ct,Te,Dt,Ge,yt,At,ge,Se,nt,Ie]);return(0,Mo.jsx)(nr.Provider,{value:Rt,children:ot?(0,Mo.jsx)($s.Drawer.Root,{direction:Ue,open:de,onOpenChange:rt,handleOnly:Le,noBodyStyles:!0,repositionInputs:!1,children:he},"drawer"):(0,Mo.jsx)(Us.Root,{open:de,onOpenChange:rt,children:he},"popover")})}var pn=Object.assign(Fd,{Trigger:na,Content:zs,Nav:Ds,Footer:Gs});var Et=D(require("react"),1),il=D(require("@radix-ui/react-dialog"),1),al=require("vaul");var _o=require("react"),Oo=(0,_o.createContext)(null);function Hn(){let e=(0,_o.useContext)(Oo);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var fn=require("react");function Gn(){let[e,t]=(0,fn.useState)([]),[n,o]=(0,fn.useState)(!0);(0,fn.useEffect)(()=>{if(typeof window>"u"){o(!1);return}let a=[],i=p=>{let{info:c}=p.detail;c?.rdns&&!a.some(f=>f.rdns===c.rdns)&&(a.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...a]))};window.addEventListener("eip6963:announceProvider",i),window.addEventListener("eip6963:crossAnnounceProvider",i),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let l=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",i),window.removeEventListener("eip6963:crossAnnounceProvider",i),clearTimeout(l)}},[]);let r=(0,fn.useCallback)(a=>e.some(i=>i.rdns===a),[e]);return{wallets:e,isDetected:r,isLoading:n}}var js=D(require("@radix-ui/react-dialog"),1),Vs=require("vaul");var Ar=require("react/jsx-runtime");function qs({asChild:e,children:t}){let{isMobile:n}=Hn(),o=n?Vs.Drawer.Trigger:js.Trigger;return(0,Ar.jsx)(o,{asChild:e??t!=null,children:t??(0,Ar.jsx)("button",{type:"button",children:"Connect Wallet"})})}var Lt=D(require("@radix-ui/react-dialog"),1),Un=require("vaul");var B=require("react/jsx-runtime");function zo(){return(0,B.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,B.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,B.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 Ks(){return(0,B.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,B.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,B.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,B.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,B.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,B.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,B.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,B.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,B.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,B.jsx)("defs",{children:(0,B.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,B.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function Qs(){return(0,B.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,B.jsx)("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),(0,B.jsx)("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),(0,B.jsx)("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),(0,B.jsx)("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),(0,B.jsx)("path",{d:"M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z",fill:"#F3BA2F"})]})}function Ys(){return(0,B.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,B.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,B.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,B.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,B.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 Zs(){return(0,B.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,B.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,B.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,B.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,B.jsx)("defs",{children:(0,B.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,B.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function Xs(){return(0,B.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[(0,B.jsx)("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"}),(0,B.jsx)("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"}),(0,B.jsx)("path",{fill:"#4CAF50",d:"M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"}),(0,B.jsx)("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"})]})}function Js(){return(0,B.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,B.jsx)("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})})}function el(){return(0,B.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,B.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Wo={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:zo},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:zo,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:zo,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:Ks,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:Qs},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Ys,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Zs,badge:"For SHOP"}};function Pr(e){return Wo[e]}var Do={google:{id:"google",name:"Google",icon:Xs},apple:{id:"apple",name:"Apple",icon:Js}};function tl(e){return Do[e]}var R=require("react/jsx-runtime");function Md({wallet:e,detected:t,onConnect:n}){let o=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}n()},r=e.icon,a=e.featured===!0;return(0,R.jsxs)("button",{type:"button",className:ee("wcm-wallet-item",a&&"wcm-wallet-item--featured"),onClick:o,children:[(0,R.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,R.jsx)("div",{className:"wcm-wallet-icon",children:(0,R.jsx)(r,{})}),(0,R.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,R.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,R.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?(0,R.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,R.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function _d({social:e,onSignIn:t}){let n=e.icon,o=`Sign in with ${e.name}`;return(0,R.jsxs)("button",{type:"button",className:"wcm-social-item","data-provider":e.id,onClick:t,"aria-label":o,children:[(0,R.jsx)("span",{className:"wcm-social-icon",children:(0,R.jsx)(n,{})}),(0,R.jsx)("span",{className:"wcm-social-name",children:o})]})}function nl(){let{wallets:e,activeWalletIds:t,socialProviders:n,activeSocialIds:o,termsUrl:r,privacyUrl:a,isDetected:i,close:l,isMobile:p}=Hn(),c=t.filter(h=>{let g=Pr(h).visibility;return!g||g==="always"?!0:g==="desktop-only"?!p:g==="mobile-only"?p:!0}),f=o.length>0,m=c.length>0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"wcm-header",children:[(0,R.jsxs)("div",{className:"wcm-header-text",children:[(0,R.jsx)("h2",{className:"wcm-title",children:"CROSS Wallet"}),!p&&(0,R.jsx)("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),(0,R.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:l,"aria-label":"Close",children:(0,R.jsx)(el,{})})]}),(0,R.jsxs)("div",{className:"wcm-body",children:[f&&(0,R.jsxs)(R.Fragment,{children:[!p&&(0,R.jsxs)("div",{className:"wcm-section-header",children:[(0,R.jsx)("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),(0,R.jsx)("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),(0,R.jsx)("div",{className:"wcm-social-grid",children:o.map(h=>{let g=tl(h);return(0,R.jsx)(_d,{social:g,onSignIn:()=>{n[h]?.(),l()}},h)})}),m&&(0,R.jsxs)("div",{className:"wcm-separator",children:[(0,R.jsx)("div",{className:"wcm-separator-line"}),(0,R.jsx)("span",{className:"wcm-separator-text",children:"Other Wallets"}),(0,R.jsx)("div",{className:"wcm-separator-line"})]})]}),m&&(0,R.jsx)("div",{className:"wcm-wallet-list",children:c.map(h=>{let g=Pr(h),v=g.rdns?i(g.rdns):!1;return(0,R.jsx)(Md,{wallet:g,detected:v,onConnect:()=>{e[h]?.(),l()}},h)})}),(0,R.jsxs)("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",(0,R.jsx)(ol,{href:r,children:"Terms of Service"})," and consent to its ",(0,R.jsx)(ol,{href:a,children:"Privacy Policy"}),"."]})]})]})}function ol({href:e,children:t}){return e?(0,R.jsx)("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):(0,R.jsx)("span",{className:"wcm-terms-link",children:t})}function rl({className:e}){let{isMobile:t,theme:n,portalStyle:o}=Hn();return t?(0,R.jsxs)(Un.Drawer.Portal,{children:[(0,R.jsx)(Un.Drawer.Overlay,{className:"wcm-overlay"}),(0,R.jsxs)(Un.Drawer.Content,{className:ee("wcm-drawer-content",e),"data-theme":n,style:o,children:[(0,R.jsx)(Un.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,R.jsx)("div",{className:"wcm-drawer-handle"}),(0,R.jsx)("div",{className:"wcm-drawer-body",children:(0,R.jsx)(nl,{})})]})]}):(0,R.jsxs)(Lt.Portal,{children:[(0,R.jsx)(Lt.Overlay,{className:"wcm-overlay"}),(0,R.jsxs)(Lt.Content,{className:ee("wcm-dialog-content",e),"data-theme":n,style:o,children:[(0,R.jsx)(Lt.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,R.jsx)(Lt.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),(0,R.jsx)("div",{className:"wcm-dialog-body",children:(0,R.jsx)(nl,{})})]})]})}H(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:var(--ds-overlay-dim, rgba(0, 0, 0, .5));-webkit-backdrop-filter:var(--ds-bg-blur-7, blur(3.5px));backdrop-filter:var(--ds-bg-blur-7, blur(3.5px))}.wcm-dialog-content{-webkit-font-smoothing:antialiased;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(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-radius:24px;box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));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:var(--ds-border-medium, rgba(0, 0, 0, .18)) 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:var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:4px}.wcm-drawer-content{-webkit-font-smoothing:antialiased;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(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-top-left-radius:16px;border-top-right-radius:16px;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:16px 0 0 16px}.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 16px 16px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--ds-border-medium, rgba(0, 0, 0, .18));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{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-header-text{display:flex;flex-direction:column;gap:4px;min-width:0}.wcm-title{font-family:Inter,sans-serif;font-weight:600;font-size:20px;line-height:1.25;letter-spacing:0;color:var(--ds-content-highest, #000000);margin:0}.wcm-subtitle{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));margin:0}.wcm-close-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border:none;background:transparent;color:var(--ds-content-low, #00000066);cursor:pointer;padding:0;transition:opacity .15s ease}.wcm-close-btn:hover{opacity:.6}.wcm-close-btn>svg{width:24px;height:24px}.wcm-divider{display:none}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:24px}.wcm-section-header{display:flex;align-items:center;gap:8px;width:100%}.wcm-section-title{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1;letter-spacing:0;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-recommended-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-low, #e7f9f8);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-high, #00a0a2);white-space:nowrap}.wcm-social-grid{display:grid;gap:8px;width:100%}.wcm-dialog-body .wcm-social-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wcm-drawer-body .wcm-social-grid{grid-template-columns:1fr}.wcm-social-item{display:flex;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;transition:none;font-family:inherit;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-social-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-social-item:hover{background:#eff3f8!important}.wcm-social-item[data-provider=apple] .wcm-social-icon{color:#000}[data-theme=dark] .wcm-social-item[data-provider=apple] .wcm-social-icon{color:#fff}.wcm-dialog-body .wcm-social-item{flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px}.wcm-drawer-body .wcm-social-item{flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;padding:16px}.wcm-social-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.wcm-social-icon>svg{width:32px;height:32px}.wcm-social-name{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:12px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-separator-text{font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-wallet-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:20px 16px;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;text-align:left;transition:none;font-family:inherit}.wcm-wallet-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-wallet-item:hover{background:#eff3f8!important}.wcm-wallet-item-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg,.wcm-wallet-icon>img{width:28px;height:28px;border-radius:0;object-fit:cover}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px;min-width:0}.wcm-wallet-name{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-system-purple-low, #f5f3ff);border:.5px solid var(--ds-system-purple-default, #7e54f4);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-purple-high, #7346f3);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-default, #00b4b7);border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-on, #ffffff);white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-terms{font-family:Inter,sans-serif;font-weight:400;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;margin:0}.wcm-terms-link{color:var(--ds-accent-primary-high, #00a0a2);text-decoration:none}.wcm-terms-link:hover{text-decoration:underline}.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}
16
+ `);H(`@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)}}
17
+ `);var Cn=require("react/jsx-runtime"),Od={};function zd({wallets:e,socialProviders:t=Od,termsUrl:n,privacyUrl:o,theme:r="dark",mobileBreakpoint:a=768,drawerDirection:i="bottom",dialogWidth:l,drawerMaxWidth:p,drawerMinWidth:c,style:f,open:m,onOpenChange:h,children:g}){let v=hn(`(max-width: ${a}px)`),[x,w]=Et.useState(!1),y=m!==void 0,L=y?m:x,u=Et.useCallback(z=>{y||w(z),h?.(z)},[y,h]),T=Et.useCallback(()=>u(!1),[u]),{isDetected:C}=Gn(),A=Et.useMemo(()=>Object.keys(e),[e]),F=Et.useMemo(()=>Object.keys(t),[t]),J=Et.useMemo(()=>{let z={};return l&&(z["--wcm-dialog-width"]=l),p&&(z["--wcm-drawer-max-width"]=p),c&&(z["--wcm-drawer-min-width"]=c),{...z,...f}},[l,p,c,f]),_=Et.useMemo(()=>({theme:r,isMobile:v,open:L,setOpen:u,close:T,wallets:e,activeWalletIds:A,socialProviders:t,activeSocialIds:F,termsUrl:n,privacyUrl:o,isDetected:C,portalStyle:J}),[r,v,L,u,T,e,A,t,F,n,o,C,J]),Y=(0,Cn.jsx)("div",{"data-theme":r,style:J,children:g});return v?(0,Cn.jsx)(Oo.Provider,{value:_,children:(0,Cn.jsx)(al.Drawer.Root,{direction:i,open:L,onOpenChange:u,noBodyStyles:!0,children:Y},"drawer")}):(0,Cn.jsx)(Oo.Provider,{value:_,children:(0,Cn.jsx)(il.Root,{open:L,onOpenChange:u,children:Y})})}var Br=Object.assign(zd,{Trigger:qs,Content:rl});H(`.cb-button{--cb-bg: var(--ds-accent-primary-default, #00b4b7);--cb-bg-hover: var(--cb-bg);--cb-color: var(--ds-accent-primary-on-primary, #ffffff);--cb-border: none;--cb-radius: 8px;--cb-height: 36px;--cb-padding: 8px 16px;--cb-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-font-size: 14px;--cb-font-weight: 500;--cb-line-height: 1.5;--cb-letter-spacing: -.01em;--cb-gap: 8px;--cb-transition: opacity .15s;--cb-loading-opacity: .7;--cb-press-scale: .95;--cb-icon-size: 18px;--cb-spinner-size: 18px;--cb-spinner-thumb: currentColor;--cb-spinner-track: color-mix(in srgb, currentColor 20%, transparent)}.cb-pill{--cb-pill-bg: var(--ds-surface-default, #ffffff);--cb-pill-bg-hover: var(--cb-pill-bg);--cb-pill-color: var(--ds-content-high, rgba(0, 0, 0, .85));--cb-pill-border: 1px solid var(--ds-border-default, rgba(0, 0, 0, .07));--cb-pill-border-hover: 1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));--cb-pill-radius: 8px;--cb-pill-height: 36px;--cb-pill-padding: 1px 13px;--cb-pill-press-scale: .95;--cb-pill-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-pill-font-size: 14px;--cb-pill-font-weight: 500;--cb-pill-line-height: 1.5;--cb-pill-gap: 8px;--cb-pill-icon-size: 18px;--cb-pill-icon-placeholder-bg: var(--ds-surface-medium, #f5f7fa);--cb-pill-address-font: Inter, system-ui, -apple-system, sans-serif;--cb-pill-address-font-size: 14px;--cb-pill-address-letter-spacing: -.01em}
18
+ `);H(`.cb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-height);gap:var(--cb-gap);padding:var(--cb-padding);border-radius:var(--cb-radius);border:var(--cb-border);background:var(--cb-bg);color:var(--cb-color);font-family:var(--cb-font-family);font-size:var(--cb-font-size);font-weight:var(--cb-font-weight);line-height:var(--cb-line-height);letter-spacing:var(--cb-letter-spacing);cursor:pointer;transition:var(--cb-transition)}.cb-button:hover:not(:disabled){background:var(--cb-bg-hover)}.cb-button:active:not(:disabled){transform:scale(var(--cb-press-scale))}.cb-button:disabled,.cb-button[aria-busy=true]{cursor:default;opacity:var(--cb-loading-opacity)}.cb-spinner{display:inline-block;width:var(--cb-spinner-size);height:var(--cb-spinner-size);border:2px solid var(--cb-spinner-track);border-top-color:var(--cb-spinner-thumb);border-radius:50%;animation:cb-spin .6s linear infinite;flex-shrink:0}.cb-button-icon{width:var(--cb-icon-size);height:var(--cb-icon-size);flex-shrink:0}.cb-button-label{white-space:nowrap}.cb-pill{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-pill-height);gap:var(--cb-pill-gap);padding:var(--cb-pill-padding);border-radius:var(--cb-pill-radius);border:var(--cb-pill-border);background:var(--cb-pill-bg);color:var(--cb-pill-color);font-family:var(--cb-pill-font-family);font-size:var(--cb-pill-font-size);font-weight:var(--cb-pill-font-weight);line-height:var(--cb-pill-line-height);cursor:pointer}.cb-pill:hover{background:var(--cb-pill-bg-hover)}.cb-pill:active:not(:disabled){transform:scale(var(--cb-pill-press-scale))}.cb-pill-icon{width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;object-fit:contain;flex-shrink:0;background:transparent}[data-theme=dark] .cb-pill-icon[data-provider=apple]{filter:invert(1)}.cb-pill-icon-placeholder{display:inline-block;width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;background:var(--cb-pill-icon-placeholder-bg);flex-shrink:0}.cb-pill-address{font-family:var(--cb-pill-address-font);font-size:var(--cb-pill-address-font-size);letter-spacing:var(--cb-pill-address-letter-spacing);white-space:nowrap}@media(max-width:767.98px){.cb-button,.cb-pill{width:36px;min-width:36px;padding:0}.cb-button{height:36px}.cb-button-label,.cb-pill-address{display:none}}@keyframes cb-spin{to{transform:rotate(360deg)}}
19
+ `);var Wd='<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>',Dd='<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>',Hd='<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>',Gd='<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>',Ud='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000"><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 $n(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var jn=$n(Wd),Vn=$n(Dd),qn=$n(Hd),Kn=$n(Gd),Qn=$n(Ud);var be=require("react/jsx-runtime");function Fr({isConnecting:e,address:t,provider:n,providerName:o,accountName:r,sendAccounts:a,onConnect:i,onDisconnect:l,onCopy:p,onSelectWallet:c,onBuy:f,onBuyDisabledMessage:m,label:h="Connect Wallet",connectingLabel:g="Connecting...",disconnectLabel:v,className:x,theme:w="dark",env:y,showBalance:L=!0,showPortfolio:u,drawerDirection:T,modal:C,connectorId:A,style:F,walletInfoStyle:J,sendTransaction:_,getTransactionReceipt:Y,estimateGas:z,onReceive:ne,onBridge:O,onSend:ke,bridgeTokens:ce,bridgeHistory:fe,getBridgeQuote:Ke,getBridgeToTokens:ue,getBridgeApproval:$,approveBridge:me,submitBridge:le}){let j=x?`cb-button ${x}`:"cb-button",Qe=x?`cb-pill ${x}`:"cb-pill";if(e)return(0,be.jsxs)("button",{type:"button",disabled:!0,className:j,style:F,"aria-busy":"true",children:[(0,be.jsx)("span",{className:"cb-spinner","aria-hidden":"true"}),(0,be.jsx)("span",{className:"cb-button-label",children:g})]});if(t){let we=o??qd(n),Oe=n?jd[n]:void 0;return(0,be.jsxs)(pn,{env:y,theme:w,drawerDirection:T,modal:C,showBalance:L,showPortfolio:u,walletAddress:t,accountName:r,sendAccounts:a,connectorId:A,onSelectWallet:c,onCopyAddress:p?(xe,ct)=>{ct&&p()}:void 0,onDisconnect:l,disconnectLabel:v,style:J,sendTransaction:_,getTransactionReceipt:Y,estimateGas:z,onReceive:ne,onBridge:O,onBuy:f,onBuyDisabledMessage:m,onSend:ke,bridgeTokens:ce,bridgeHistory:fe,getBridgeQuote:Ke,getBridgeToTokens:ue,getBridgeApproval:$,approveBridge:me,submitBridge:le,children:[(0,be.jsx)(pn.Trigger,{asChild:!0,children:(0,be.jsxs)("button",{type:"button",className:Qe,style:F,"aria-label":`Connected with ${we}: ${sl(t)}`,children:[Oe?(0,be.jsx)("img",{src:Oe,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":n}):(0,be.jsx)("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),(0,be.jsx)("span",{className:"cb-pill-address",children:sl(t)})]})}),(0,be.jsx)(pn.Content,{align:"end",sideOffset:8})]})}return(0,be.jsxs)("button",{type:"button",onClick:i,className:j,style:F,"aria-label":typeof h=="string"?h:"Connect Wallet",children:[(0,be.jsx)($d,{}),(0,be.jsx)("span",{className:"cb-button-label",children:h})]})}function $d(){return(0,be.jsxs)("svg",{className:"cb-button-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,be.jsx)("path",{d:"M3.75 5.25H14.25C15.0784 5.25 15.75 5.92157 15.75 6.75V13.5C15.75 14.3284 15.0784 15 14.25 15H3.75C2.92157 15 2.25 14.3284 2.25 13.5V4.5C2.25 3.67157 2.92157 3 3.75 3H13.5",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),(0,be.jsx)("path",{d:"M12 9.75H15.75V12.75H12C11.1716 12.75 10.5 12.0784 10.5 11.25C10.5 10.4216 11.1716 9.75 12 9.75Z",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),(0,be.jsx)("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var jd={google:Kn,apple:Qn,cross:jn,metamask:Vn,binance:qn},Vd={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function qd(e){return e?Vd[e]:"Wallet"}function sl(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var ll=D(require("react"),1);H(`.sb-button{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-border-hover: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-color: var(--ds-content-medium, rgba(0, 0, 0, .65));--sb-color-hover: var(--ds-content-high, rgba(0, 0, 0, .85));--sb-radius: 8px;--sb-height: 36px;--sb-padding: 1px 11px;--sb-gap: 4px;--sb-font-size: 14px;--sb-font-weight: 500;--sb-line-height: 21px;--sb-letter-spacing: 0;--sb-blur: 0px;--sb-border-width: 1px;--sb-icon-size: 18px;--sb-icon-hover-rotation: 180deg;--sb-spinner-size: 18px;--sb-spinner-thumb: currentColor;--sb-spinner-track: color-mix(in srgb, currentColor 20%, transparent);--sb-disabled-opacity: .6;--sb-press-scale: .95;--sb-hover-duration: .2s;--sb-icon-duration: .3s;--sb-easing: ease}.sb-button[data-theme=dark]{--sb-bg: var(--ds-surface-default, #1e232e);--sb-border: var(--ds-border-default, #ffffff12);--sb-border-hover: var(--ds-border-medium, #ffffff2e);--sb-color: var(--ds-content-medium, #ffffffa6);--sb-color-hover: var(--ds-content-high, #ffffffd9)}.sb-button[data-theme=light]{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, #00000012);--sb-border-hover: var(--ds-border-medium, #0000002e);--sb-color: var(--ds-content-medium, #000000a6);--sb-color-hover: var(--ds-content-high, #000000d9)}
20
+ `);H(`.sb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--sb-height);gap:var(--sb-gap);padding:var(--sb-padding);border-radius:var(--sb-radius);border:var(--sb-border-width) solid var(--sb-border);background:var(--sb-bg);backdrop-filter:blur(var(--sb-blur));-webkit-backdrop-filter:blur(var(--sb-blur));color:var(--sb-color);font-family:Inter,system-ui,-apple-system,sans-serif;font-weight:var(--sb-font-weight);font-size:var(--sb-font-size);line-height:var(--sb-line-height);letter-spacing:var(--sb-letter-spacing);cursor:pointer;transition:border-color var(--sb-hover-duration) var(--sb-easing),color var(--sb-hover-duration) var(--sb-easing)}@media(hover:hover){.sb-button:hover:not(:disabled){border-color:var(--sb-border-hover);color:var(--sb-color-hover)}.sb-button:hover:not(:disabled) .sb-button-icon{transform:rotate(var(--sb-icon-hover-rotation))}}.sb-button:active:not(:disabled){transform:scale(var(--sb-press-scale))}.sb-button:disabled,.sb-button[aria-busy=true]{cursor:default;opacity:var(--sb-disabled-opacity)}.sb-button-icon{width:var(--sb-icon-size);height:var(--sb-icon-size);flex-shrink:0;color:inherit;transition:transform var(--sb-icon-duration) var(--sb-easing),color var(--sb-icon-duration) var(--sb-easing)}.sb-spinner{display:inline-block;width:var(--sb-spinner-size);height:var(--sb-spinner-size);border:2px solid var(--sb-spinner-track);border-top-color:var(--sb-spinner-thumb);border-radius:50%;animation:sb-spin .6s linear infinite;flex-shrink:0}.sb-label{white-space:nowrap}@keyframes sb-spin{to{transform:rotate(360deg)}}
21
+ `);var Kt=require("react/jsx-runtime"),Ho="https://skills.cross.nexus";function Mr({label:e="Skills",href:t=Ho,onClick:n,className:o,style:r,theme:a,disabled:i=!1,isLoading:l=!1,loadingLabel:p="Loading...",openInNewTab:c=!1,type:f="button"}){let[m,h]=ll.useState(!1),g=async L=>{if(t&&!n){c?window.open(t,"_blank","noopener,noreferrer"):window.location.href=t;return}if(n)try{h(!0),await n()}finally{h(!1)}},v=i||l||m,x=l||m,w=x?p:e,y=o?`sb-button ${o}`:"sb-button";return(0,Kt.jsxs)("button",{type:f,onClick:g,disabled:v,className:y,"data-theme":a,style:r,"aria-busy":x,children:[x?(0,Kt.jsx)("span",{className:"sb-spinner","aria-hidden":"true"}):(0,Kt.jsx)(Kd,{}),(0,Kt.jsx)("span",{className:"sb-label",children:w})]})}function Kd(){return(0,Kt.jsx)("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,Kt.jsx)("path",{d:"M15.5879 3.95142C16.0211 2.78097 17.6761 2.78099 18.1094 3.95142L19.6221 8.03833C20.6569 10.8348 22.8618 13.0396 25.6582 14.0745L29.7451 15.5872C30.9157 16.0204 30.9157 17.6754 29.7451 18.1086L25.6582 19.6213C22.8618 20.6562 20.657 22.861 19.6221 25.6575L18.1094 29.7444C17.6762 30.9149 16.0211 30.9149 15.5879 29.7444L14.0752 25.6575C13.0403 22.861 10.8355 20.6562 8.03906 19.6213L3.95215 18.1086C2.78172 17.6754 2.7817 16.0204 3.95215 15.5872L8.03906 14.0745C10.8355 13.0396 13.0403 10.8348 14.0752 8.03833L15.5879 3.95142Z",stroke:"currentColor",strokeWidth:"1.93556"})})}no({mode:"dapp-ui"});0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,BridgeFlow,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,DEFAULT_SKILLS_HREF,GOOGLE_ICON,METAMASK_ICON,SOCIAL_REGISTRY,SendFlow,SkillsButton,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,announceAppLauncherUsage,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});