@nexus-cross/dapp-ui 1.3.10-beta.2 → 1.3.10-beta.4

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,24 +1,26 @@
1
- "use strict";var fp=Object.create;var nr=Object.defineProperty;var mp=Object.getOwnPropertyDescriptor;var gp=Object.getOwnPropertyNames;var hp=Object.getPrototypeOf,bp=Object.prototype.hasOwnProperty;var wp=(e,t)=>{for(var n in t)nr(e,n,{get:t[n],enumerable:!0})},ka=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of gp(t))!bp.call(e,r)&&r!==n&&nr(e,r,{get:()=>t[r],enumerable:!(o=mp(t,r))||o.enumerable});return e};var H=(e,t,n)=>(n=e!=null?fp(hp(e)):{},ka(t||!e||!e.__esModule?nr(n,"default",{value:e,enumerable:!0}):n,e)),xp=e=>ka(nr({},"__esModule",{value:!0}),e);var fg={};wp(fg,{APPLE_ICON:()=>Ko,AppLauncher:()=>hi,AppLauncherContent:()=>xi,AppLauncherTrigger:()=>bi,BINANCE_ICON:()=>Vo,BridgeFlow:()=>Oo,CHAINS_CONFIG_FILE:()=>go,CONNECTOR_REGISTRY:()=>ko,CROSSX_ICON:()=>Ho,ConnectButton:()=>aa,ConnectorId:()=>pr,DEFAULT_SKILLS_HREF:()=>sa,DappUiErrorBoundary:()=>xo,GOOGLE_ICON:()=>qo,METAMASK_ICON:()=>jo,PORTFOLIO_SECTIONS:()=>Bo,SOCIAL_REGISTRY:()=>ni,SendFlow:()=>To,SkillsButton:()=>la,TOKEN_STATS_QUERY_KEY:()=>Tr,USER_BALANCE_QUERY_KEY:()=>Cr,WALLET_REGISTRY:()=>ti,WalletConnectModal:()=>ia,WalletInfo:()=>jn,WalletPortfolio:()=>Yi,WalletPortfolioBody:()=>Un,announceAppLauncherUsage:()=>rr,captureDappUiException:()=>wo,getChainDisplay:()=>Ta,getDappUiSentryScope:()=>bo,initDappUiSentry:()=>Xn,normalizeFailureReason:()=>wt,resolveEnvironment:()=>je,setDappUiAnalyticsUser:()=>In,trackDappUiEvent:()=>yo,trackDappUiFunnel:()=>Pe,useChainDisplay:()=>Qn,useChainsConfig:()=>Na,useGlobalMenu:()=>vo,useTokenBalance:()=>un,useTokenStats:()=>fn,useWalletDetect:()=>Go});module.exports=xp(fg);var yp={};function Sa(e){try{return yp.env?.[e]}catch{return}}function Ca(e){if(!(typeof process>"u"))return process.env?.[e]}function je(e){if(e)return Ra(e);let t=Sa("VITE_CROSSX_ENVIRONMENT")??Sa("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Ca("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Ca("CROSSX_ENVIRONMENT");return Ra(t)}function Ra(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var Kt=H(require("react"),1),vp={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",production:"https://contents.crosstoken.io/frontend/common/app-launcher"},kp=3e3;function Tn(e,t){if(e!=null)return typeof e=="object"&&!Array.isArray(e)&&("dev"in e||"stage"in e||"production"in e)?e[t]:e}var pi=new Map;function Nn(e,t){let n=`${vp[t]}/${e}`,o=pi.get(n);return o||(o=(async()=>{let r=new AbortController,i=setTimeout(()=>r.abort(),kp);try{let a=await fetch(n,{cache:"no-store",signal:r.signal});return a.ok?await a.json():null}catch{return null}finally{clearTimeout(i)}})().then(r=>(r===null&&pi.delete(n),r)),pi.set(n,o)),o}function Sp(e){return typeof e=="string"&&e.startsWith("https://")}async function pe(e,t){let n=await Nn("endpoints.json",t),o=Tn(n?.apis?.[e],t);if(!Sp(o))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return o}var go="chains.json";async function Ta(e,t){return(await Nn(go,t))?.chains?.[String(e)]??{}}function Qn(e,t){let[n,o]=Kt.useState({});return Kt.useEffect(()=>{if(e==null){o({});return}let r=!0;return Nn(go,t).then(i=>{r&&o(i?.chains?.[String(e)]??{})}),()=>{r=!1}},[e,t]),n}function Na(e){let[t,n]=Kt.useState({});return Kt.useEffect(()=>{let o=!0;return Nn(go,e).then(r=>{o&&n(r?.chains??{})}),()=>{o=!1}},[e]),t}function En(e,t,n){let[o,r]=Kt.useState(void 0),i=Kt.useRef(n);return i.current=n,Kt.useEffect(()=>{let a=!0;return Nn(e,t).then(s=>{if(!a)return;let l=i.current(s);l!==void 0&&r(l)}),()=>{a=!1}},[e,t]),o}var ho="1.3.10-beta.2";var or="__nexusCrossAppLauncherRuntime";function Cp(){if(typeof window>"u")return null;let e=window;return e[or]??(e[or]={mode:"dapp-ui"}),e[or]}function Rp(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${ho}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${ho} \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 rr(e){let t=Cp();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Rp(t))}var Yt=require("@sentry/react");var Tp="https://cf86db5bafcccf13c7a80c8f73ecc211@o4511788908478464.ingest.us.sentry.io/4511789047611392",Np=`dapp-ui@${ho}`,Zn=null,Ea=1;function Ia(){return Ea}function Ep(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function Xn(e){if(Zn)return Zn;if(typeof window>"u")return null;let t=Ep(je(e?.environment));typeof e?.analyticsSampleRate=="number"&&(Ea=Math.min(1,Math.max(0,e.analyticsSampleRate)));let n=new Yt.BrowserClient({dsn:e?.dsn??Tp,transport:Yt.makeFetchTransport,stackParser:Yt.defaultStackParser,integrations:[(0,Yt.linkedErrorsIntegration)()],environment:t,release:Np,enabled:e?.enabled??t==="prod"}),o=new Yt.Scope;return o.setClient(n),o.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),n.init(),Zn=o,Zn}function bo(){return Zn}function wo(e,t){let n=Zn??Xn();if(n)return n.captureException(e,t?{captureContext:{extra:t}}:void 0)}var _a=require("react");var xo=class extends _a.Component{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n,o){wo(n,{componentStack:o.componentStack??void 0,boundary:this.props.name??"dapp-ui"})}render(){return this.state.hasError?this.props.fallback??null:this.props.children}};function ge(...e){return e.filter(Boolean).join(" ")}function Pa(){return typeof window>"u"?!1:window.navigator.userAgent.includes("CROSSx")}var La="__nexus_dapp_ui_uid",ui=null;function Ip(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function fi(){if(ui)return ui;let e=null;try{e=window.localStorage.getItem(La)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${Ip()}`;try{window.localStorage.setItem(La,e)}catch{}}return ui=e,e}async function Aa(e){if(typeof crypto>"u"||!crypto.subtle)return null;try{let t=new TextEncoder().encode(e.trim().toLowerCase()),n=await crypto.subtle.digest("SHA-256",t);return`wallet_${Array.from(new Uint8Array(n),r=>r.toString(16).padStart(2,"0")).join("").slice(0,16)}`}catch{return null}}function _p(){let e=window.navigator.userAgent;return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|iphone|ipod|android/i.test(e)?"mobile":"desktop"}function Ma(){return{host:window.location.hostname,device_type:_p(),is_cross_inapp:String(Pa())}}var Fa=!1;function mi(){if(typeof window>"u")return null;let e=bo()??Xn();return e?(Fa||(Fa=!0,e.setUser({id:fi()})),e):null}function Da(){return Math.random()>=Ia()}var Ba=0;function In(e){let t=mi();if(!t)return;let n=++Ba;if(!e){t.setUser({id:fi()});return}Aa(e).then(o=>{o&&n===Ba&&t.setUser({id:o})})}function yo(e,t,n){let o=mi();!o||Da()||o.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Ma(),feature:e,action:t,...n}}})}function Pe(e,t,n){let o=mi();if(!o||Da())return;let r=n?.status??"success";o.captureMessage(`funnel: ${e}_${t}`,"info",{captureContext:{tags:{...Ma(),flow:e,funnel_step:`${e}_${t}`,funnel_status:r,...r==="failure"?{failure_reason:n?.reason??"unknown"}:{},...n?.tags}}})}function wt(e){let t=e,n=String((t&&typeof t=="object"&&"message"in t?t.message:e)??"").toLowerCase();return t?.code===4001||/reject|denied|declin|cancel/i.test(n)?"user-rejected":/insufficient (funds|gas|balance)|exceeds balance/i.test(n)?"insufficient-gas":/timeout|timed out|deadline/i.test(n)?"timeout":/revert|execution failed/i.test(n)?"contract-reverted":/network|fetch|connection|disconnected|offline/i.test(n)?"network":"unknown"}var Oa=require("react");var Wa=require("react/jsx-runtime");function Ce({feature:e,children:t}){let n=(0,Oa.useCallback)(o=>{let r=o.nativeEvent;if(r.__dappUiTracked)return;let a=o.target?.closest?.("[data-track]");if(!a)return;let s=a.getAttribute("data-track");if(!s)return;r.__dappUiTracked=!0;let l=a.getAttribute("data-track-id");yo(e,s,l?{item_id:l}:void 0)},[e]);return(0,Wa.jsx)("div",{style:{display:"contents"},onClick:n,children:t})}var eo=H(require("react"),1),Ua=H(require("@radix-ui/react-popover"),1),Ga=require("vaul");var ir=require("react"),gi=(0,ir.createContext)(null);function ar(){let e=(0,ir.useContext)(gi);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var sr=require("react");function Jn(e){let[t,n]=(0,sr.useState)(!1);return(0,sr.useEffect)(()=>{let o=window.matchMedia(e);n(o.matches);let r=i=>n(i.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}function ie(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))}ie(`[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-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #3a261f;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #123235);--al-badge-text: var(--ds-accent-primary-default, #00ceb2);--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-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #fff1eb;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #e7f9f8);--al-badge-text: var(--ds-accent-primary-default, #00b4b7);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
2
- `);ie(`.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
- `);ie(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
- `);ie(`.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-menu{display:flex;flex-direction:column;width:424px;max-width:calc(100vw - 32px);padding:0 12px;box-sizing:border-box}.al-popover-content .al-grid{display:grid;grid-template-columns:repeat(4,100px);row-gap:12px;column-gap:0;justify-content:center;align-items:start}.al-popover-content .al-grid-item{position:relative;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:visible}.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-text{flex-direction:column;align-items:center;justify-content:center;gap:2px;max-width:100%;min-height:26px}.al-popover-content .al-grid-item-status-text{font-size:10px;line-height:1.1}.al-popover-content .al-badge-list{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-menu{display:flex;flex-direction:column;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;overflow:visible}.al-drawer-content .al-grid-item-icon{width:32px;height:32px;border-radius:6.75px;overflow:visible}.al-drawer-content .al-grid-item-icon img{width:100%;height:100%;object-fit:cover;border-radius:6.75px}.al-drawer-content .al-grid-item-label{font-size:16px;line-height:1.35;letter-spacing:0;font-weight:400}.al-drawer-content .al-grid-item[data-active=true] .al-grid-item-label{font-weight:500}.al-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0}.al-drawer-title{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--al-text);margin:0}.al-drawer-close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--al-text-secondary);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:flex-start;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:var(--al-bg-hover)!important}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:visible}.al-grid-item-text{display:flex;flex-direction:column;align-items:flex-start;gap:1px;max-width:100%;min-width:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;position:relative;width:24px;height:24px;overflow:visible;border-radius:5px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain;border-radius:inherit}.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-grid-item-status-text{font-family:Inter,sans-serif;font-size:12px;font-weight:400;line-height:1.15;letter-spacing:0;color:var(--al-text);white-space:nowrap}.al-status-ribbon{position:absolute;top:-6px;right:-6px;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;box-sizing:border-box;border-radius:999px;color:#fff;font-family:Pretendard,Inter,sans-serif;font-size:12px;font-weight:800;line-height:1;pointer-events:none;box-shadow:0 1px 3px #0000002e}.al-status-ribbon-new{background:var(--al-new-ribbon-bg)}.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}
5
- `);ie("");var lr=require("react/jsx-runtime");function hi({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let i=Jn(`(max-width: ${n}px)`),[a,s]=eo.useState(!1),l=eo.useCallback(()=>s(!1),[]),c=je(e),m=eo.useMemo(()=>({env:c,theme:t,isMobile:i,open:a,domain:o,close:l}),[c,t,i,a,o,l]);return(0,lr.jsx)(gi.Provider,{value:m,children:i?(0,lr.jsx)(Ga.Drawer.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:r},"drawer"):(0,lr.jsx)(Ua.Root,{open:a,onOpenChange:s,children:r},"popover")})}var ja=H(require("@radix-ui/react-popover"),1),Va=require("vaul");var lt=require("react/jsx-runtime");function za({size:e=18}){return(0,lt.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,lt.jsx)("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,lt.jsx)("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,lt.jsx)("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,lt.jsx)("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,lt.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,lt.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,lt.jsx)("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,lt.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,lt.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function $a(){return(0,lt.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,lt.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ha(){return(0,lt.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,lt.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var _n=require("react/jsx-runtime");function bi({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:i}=ar(),a=t!=null,s=e??!0,l=n?`al-trigger-btn ${n}`:"al-trigger-btn",c=a?t:(0,_n.jsx)("button",{type:"button",className:l,"data-theme":i,"data-track":"open",style:o,children:(0,_n.jsx)(za,{size:18})});return r?(0,_n.jsx)(Ce,{feature:"app_launcher",children:(0,_n.jsx)(Va.Drawer.Trigger,{asChild:s,children:c})}):(0,_n.jsx)(Ce,{feature:"app_launcher",children:(0,_n.jsx)(ja.Trigger,{asChild:s,children:c})})}var Ln=H(require("react"),1),cr=H(require("@radix-ui/react-popover"),1),Pn=require("vaul");var Ya=require("@tanstack/react-query");var qa={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json"};var Pp="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Lp="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Ut(e,t){return`${e==="production"?Lp:Pp}/${t}.png`}function Ka(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://stg.onechain.nexus/gametoken",stage:"https://stg.onechain.nexus/gametoken",production:"https://www.onechain.nexus/gametoken"},iconUrl:Ut(t,"game-token"),order:1e3,type:"gametoken",badge:null,isNew:!1,serviceStatus:"available"},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg.onechain.nexus/forge",stage:"https://stg.onechain.nexus/forge",production:"https://onechain.nexus/forge"},iconUrl:Ut(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0,serviceStatus:"available"},{id:"crossd",label:"Bridge",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,serviceStatus:"ending"},{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,serviceStatus:"available"},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg.onechain.nexus/rewards",stage:"https://stg.onechain.nexus/rewards",production:"https://onechain.nexus/rewards"},iconUrl:Ut(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1,serviceStatus:"ending"},{id:"cross-staking",label:"Staking",description:"Stake CROSS and earn rewards.",url:{dev:"https://stg-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},iconUrl:Ut(t,"cross-staking"),order:7500,type:"cross-staking",badge:null,isNew:!0,serviceStatus:"available"},{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,serviceStatus:"available"},{id:"play",label:"Quest",description:"Discover and play games on CROSS.",url:{dev:"https://stg.onechain.nexus/quest",stage:"https://stg.onechain.nexus/quest",production:"https://www.onechain.nexus/quest"},iconUrl:Ut(t,"play"),order:8500,type:"play",badge:null,isNew:!0,serviceStatus:"available"},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://stg.onechain.nexus/shop",stage:"https://stg.onechain.nexus/shop",production:"https://www.onechain.nexus/shop"},iconUrl:Ut(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1,serviceStatus:"available"},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.onechain.nexus",stage:"https://stg-explorer.onechain.nexus",production:"https://explorer.onechain.nexus"},iconUrl:Ut(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1,serviceStatus:"available"},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg.onechain.nexus/wave",stage:"https://stg.onechain.nexus/wave",production:"https://www.onechain.nexus/wave"},iconUrl:Ut(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function vo(e){let t=je(e);return(0,Ya.useQuery)({queryKey:["global-menu",t],queryFn:async()=>{try{let n=await fetch(qa[t],{cache:"no-store"});if(!n.ok)throw new Error(`Failed to fetch global menu: ${n.status}`);return n.json()}catch{return Ka(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function wi(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function Za(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function Xa(e){return[...e].sort((t,n)=>{let o=Qa(t)-Qa(n);return o!==0?o:t.order-n.order})}function Qa(e){let t=wi(e);return t==="comingSoon"?0:t==="ending"?2:1}var ye=require("react/jsx-runtime");function Ap(e){return e.id==="cross-staking"||e.type==="cross-staking"}function xi({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:i,domain:a,close:s}=ar(),{data:l}=vo(o),c=Ln.useMemo(()=>Xa(l?.items??[]),[l?.items]),m=8,g=Ln.useRef(null),w=Ln.useCallback(h=>{g.current={x:h.clientX,y:h.clientY}},[]),p=typeof window<"u"?window.location.pathname:"",y=Ln.useCallback((h,v)=>{if(g.current){let k=h.clientX-g.current.x,C=h.clientY-g.current.y;if(g.current=null,Math.abs(k)>m||Math.abs(C)>m)return}let f=v.url[o]??v.url.production,T=Ja(f,a);if(!T)try{let k=new URL(f).pathname;if(p===k||p.startsWith(k+"/")){s();return}}catch{}T?window.open(f,"_blank","noopener,noreferrer"):window.location.href=f,s()},[o,a,s,p]),b=h=>{let v=h.url[o]??h.url.production,f=Ja(v,a),T=wi(h),k=T==="ending",C=Za(h.iconUrl,o),_=!1;if(!f)try{let N=new URL(v).pathname;_=p===N||p.startsWith(N+"/")}catch{_=!1}return(0,ye.jsx)("button",{type:"button",className:"al-grid-item","data-track":"menu_item_click","data-track-id":h.id,"data-active":_||void 0,"data-service-status":T,onPointerDown:w,onClick:N=>y(N,h),children:(0,ye.jsxs)("div",{className:"al-grid-item-left",children:[(0,ye.jsxs)("div",{className:"al-grid-item-icon",children:[(0,ye.jsx)("img",{src:C,alt:h.label,width:24,height:24,loading:"lazy"}),h.isNew&&(0,ye.jsx)("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),(0,ye.jsxs)("span",{className:"al-grid-item-text",children:[(0,ye.jsx)("span",{className:"al-grid-item-label",children:h.label}),k&&(0,ye.jsx)("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),h.badge&&!Ap(h)&&(0,ye.jsx)("span",{className:"al-badge al-badge-list",children:h.badge})]})]})},h.id)},x=(0,ye.jsx)("div",{className:"al-menu","data-theme":r,children:(0,ye.jsx)("div",{className:"al-grid",children:c.map(b)})});return i?(0,ye.jsx)(Ce,{feature:"app_launcher",children:(0,ye.jsxs)(Pn.Drawer.Portal,{children:[(0,ye.jsx)(Pn.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,ye.jsxs)(Pn.Drawer.Content,{className:ge("al-drawer-content",n),"data-theme":r,children:[(0,ye.jsxs)("div",{className:"al-drawer-header",children:[(0,ye.jsx)(Pn.Drawer.Close,{className:"al-drawer-close","data-track":"close",children:(0,ye.jsx)($a,{})}),(0,ye.jsx)(Pn.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,ye.jsx)(Pn.Drawer.Close,{className:"al-drawer-close","data-track":"close",children:(0,ye.jsx)(Ha,{})})]}),(0,ye.jsx)("div",{className:"al-drawer-body",children:x})]})]})}):(0,ye.jsx)(Ce,{feature:"app_launcher",children:(0,ye.jsx)(cr.Portal,{children:(0,ye.jsx)(cr.Content,{align:e,sideOffset:t,className:ge("al-popover-content",n),"data-theme":r,children:x})})})}function Ja(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}var rt=H(require("react"),1),yd=H(require("@radix-ui/react-popover"),1),vd=require("vaul");var dr=require("react"),yi=(0,dr.createContext)(null);function wn(){let e=(0,dr.useContext)(yi);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var es=require("@nexus-cross/crossx-design-system"),pr=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(pr||{}),ko={crossx:{name:es.WALLET_LABELS.default,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 Vs=H(require("react"),1);var se=require("react/jsx-runtime");function ts({size:e=16,className:t}){return(0,se.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,se.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,se.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,se.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.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 cn({size:e=16,className:t}){return(0,se.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Lt({size:e=24,className:t}){return(0,se.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function ns({size:e=20,className:t}){return(0,se.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,se.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,se.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 ur({size:e=20,className:t}){return(0,se.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,se.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 dn({size:e=20,className:t}){return(0,se.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Fn({size:e=20,className:t}){return(0,se.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function os({size:e=16,className:t}){return(0,se.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,se.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,se.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 rs({size:e=16,className:t}){return(0,se.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,se.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,se.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var Fp='<svg width="100%" height="100%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',Bp=`data:image/svg+xml,${encodeURIComponent(Fp)}`;function is({size:e=42,className:t}){return(0,se.jsx)("img",{src:Bp,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function as({size:e=20,className:t}){return(0,se.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.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 ss({size:e=20,className:t}){return(0,se.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.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 ls({size:e=20,className:t}){return(0,se.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.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 cs({size:e=20,className:t}){return(0,se.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.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 ds({size:e=20,className:t}){return(0,se.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,se.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),(0,se.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 q=H(require("react"),1);var xn=H(require("bignumber.js"),1);function Mp(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 yn(e,t){if(!e||e==="0")return"0.00";let n=new xn.default(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,xn.default.ROUND_DOWN)}function ct(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Bn(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,o=Math.pow(10,n);return`$${(Math.floor(t*o)/o).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function fr(e,t,n){let r=new xn.default(e).shiftedBy(-t).multipliedBy(new xn.default(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(xn.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,xn.default.ROUND_DOWN):r.decimalPlaces(4,xn.default.ROUND_DOWN)).toFormat()}`}function ps(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 a=Number(n);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};n=Mp(a.toFixed(18))}let[o="0",r=""]=n.split(".");if(Number(o)>=1){let a=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${a}`,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 vi=require("react"),us=require("@tanstack/react-query");var Me={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},to="https://terms.crosstoken.io/docs/cross-terms-of-use",mr="https://terms.crosstoken.io/docs/nexus-privacy-policy";var Dp="send:chain-info";function Op(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 ki(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function fs(e,t,n,o){if(o)return t===Me[e].cross?ms(t,o):n?.explorer_url?ki(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):Wp(e,t,o)}function ms(e,t){return ki("https://explorer.onechain.nexus",String(e),"tx",t)}function Wp(e,t,n){let o=Me[e];if(t===o.cross)return ms(t,n);if(t===o.bsc)return ki(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function So(e,t,n,o=!0){let r=(0,us.useQuery)({queryKey:[Dp,e,t],queryFn:async({signal:s})=>{let l=await pe("walletServer",e),c=await fetch(`${l}/v1/public/chain/info/${t}`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let m=await c.json();if("code"in m&&m.code!==void 0&&m.code!==200)throw new Error(`Chain info API error: ${m.code}`);return Op(m)},enabled:o,staleTime:3e5}),i=r.data;return{transactionUrl:(0,vi.useMemo)(()=>fs(e,t,i,n),[t,i,e,n]),chainInfo:i,...r}}function gs(e,t,n=!0){let{chainInfo:o}=So(e,t,void 0,n);return{buildTxUrl:(0,vi.useMemo)(()=>i=>fs(e,t,o,i),[e,t,o]),chainInfo:o}}var hs="0x0000000000000000000000000000000000000001";var Up="0xa9059cbb",Gp=/^0x[a-fA-F0-9]{40}$/,zp="nexus-cross:dapp-ui:send:recent:",bs=10;function $p(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Co(e){return e.toLowerCase()}function Qt(e){return Gp.test(e)}function vn(e){return Co(e.address)===hs}function Si(e){return`${zp}${e.toLowerCase()}`}function no(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Si(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&Qt(o.address)&&typeof o.updatedAt=="number").slice(0,bs):[]}catch{return[]}}function Ci(e,t){if(typeof window>"u")return[];let n=Co(t),o=[{address:n,updatedAt:Date.now()},...no(e).filter(r=>r.address!==n)].slice(0,bs);try{window.localStorage.setItem(Si(e),JSON.stringify(o))}catch{return no(e)}return o}function Ri(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Si(e))}catch{}}function Mn(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 i=BigInt(o||"0"),a=r.padEnd(t,"0"),s=a?BigInt(a):0n,l=10n**BigInt(t),c=i*l+s;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function oo(e,t){let n=BigInt(e||"0"),o=10n**BigInt(t),r=n/o,i=n%o;if(i===0n)return r.toString();let a=$p(i.toString().padStart(t,"0"));return`${r.toString()}.${a}`}function Ti(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${Up}${n}${o}`}function gr(e,t,n=10){if(t<=0)return e.toString();let o=10n**BigInt(t),r=e/o,i=e%o;if(i===0n)return r.toString();let s=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return s=s.replace(/0+$/,""),s?`${r.toString()}.${s}`:r.toString()}function Ni(e,t){return gr(e,t,6)}function ws(e){return gr(e,9,2)}function xs(e){return e.toLocaleString("en-US")}function hr(e){return e===56||e===97}function br(e){return e.gasPrice??e.maxFeePerGas}function ys(e,t=!1){return t?br(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function wr(e,t=!1){if(t){let n=br(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 xr(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function vs(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(vs(n.cause,t+1)),o.join(`
6
- `).toLowerCase()}function Hp(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 Ei(e,t={},n="Failed to send transaction."){let o=vs(e);if(!o)return n;let r=t.nativeSymbol?.trim()||"gas token",i=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 a=i?` on ${i}`:"";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.":Hp(e)||n}var jp=2000000000n,Vp=1000000000n;async function yr(e,t,n){let o=new AbortController,r=setTimeout(()=>o.abort(),8e3),i=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(!i.ok)throw new Error(`RPC ${t} HTTP ${i.status}`);let a=await i.json();if(a.error)throw new Error(`RPC ${t}: ${a.error.message}`);if(a.result===void 0)throw new Error(`RPC ${t}: empty result`);return a.result}function vr(e){return BigInt(e)}function qp(e){return`0x${e.toString(16)}`}function Kp(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=qp(e.value)),e.data&&(t.data=e.data),t}function Yp(e){return e===56||e===97}async function ks(e){try{let t=await yr(e,"eth_gasPrice",[]);return{gasPrice:vr(t)}}catch{return{gasPrice:jp}}}async function Qp(e,t){let n=Vp;try{let o=await yr(e,"eth_maxPriorityFeePerGas",[]);n=vr(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Zp(e,t){if(t)return ks(e);let n;try{n=(await yr(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?Qp(e,vr(n)):ks(e)}async function Ss(e,t){let n=Yp(t.chainId),o=Kp(t),[r,i]=await Promise.all([yr(e,"eth_estimateGas",[o]),Zp(e,n)]);return{gasLimit:vr(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function Cs(e){let{estimateGas:t,sendTransaction:n,getTransactionReceipt:o}=e;return{canSend:!!n,canEstimateGas(r){return!!t||!!r},async estimateGas(r,i){if(t)return t(r);if(i)return Ss(i,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 Xp=1500,Jp=120;function Rs(e){return!!(e.token||e.recipient||e.amount)}function Ii({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},i=e.trim(),a=Mn(t,n.quantity.decimals),s;return i?Qt(i)||(r.recipient="Enter a valid EVM recipient address."):r.recipient="Enter a recipient address.","error"in a?r.amount=a.error:(s=a.value,s>o&&(r.amount="Amount exceeds available balance.")),!vn(n)&&!Qt(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:s,recipient:i&&Qt(i)?i:void 0}}function _i({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return vn(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:Co(e.address),data:Ti(n,o),value:0n,chainId:e.chainId,from:r}}function eu(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var tu=e=>new Promise(t=>setTimeout(t,e));async function Ts({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=Xp,pollMaxAttempts:i=Jp}){let a=await e.sendTransaction(t);o(a);let{getTransactionReceipt:s}=e;if(!s)return"success";for(let l=0;l<i;l+=1){let c=await s({hash:a,chainId:n}).catch(()=>null);if(c)return eu(c)?"reverted":"success";await tu(r)}return"timeout"}var Ns=["token","recipient","amount","review"];function Es(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:i="recipient",token:a,tokens:s=[],onTokenChange:l,sendTransaction:c,getTransactionReceipt:m,estimateGas:g,getTokenPriceUsd:w,onSubmitted:p,onSuccess:y,onFailed:b,onExit:x,onOutlink:h}=e,v=q.useMemo(()=>Cs({sendTransaction:c,getTransactionReceipt:m,estimateGas:g}),[c,m,g]),[f,T]=q.useState(a);q.useEffect(()=>{T(a)},[a.address,a.chainId]);let[k,C]=q.useState(i),[_,N]=q.useState(""),[I,z]=q.useState(""),[F,j]=q.useState({}),[L,Z]=q.useState("idle"),[E,P]=q.useState(""),[ae,Q]=q.useState(""),[B,ue]=q.useState(null),[ce,V]=q.useState(!1),[D,X]=q.useState(""),te=q.useRef(0),[be,Ne]=q.useState(null),[ne,xe]=q.useState(""),[ze,Ke]=q.useState(()=>no(n)),pt=q.useRef(new Set),de=q.useCallback((A,re)=>{pt.current.has(A)||(pt.current.add(A),Pe("send",A,re))},[]);q.useEffect(()=>{de("opened"),i!=="token"&&de("token_selected",{tags:{item_id:a.symbol}})},[de,i,a.symbol]);let Ze=q.useMemo(()=>je(t),[t]),{transactionUrl:it,chainInfo:$e}=So(Ze,f.chainId,E||void 0,!0),at=Qn(f.chainId,Ze),Xe=at.nativeSymbol??$e?.currency_symbol??"",It=at.name??$e?.name??`Chain ID ${f.chainId}`,on=q.useRef({nativeSymbol:Xe||void 0,networkName:It,tokenSymbol:f.symbol});on.current={nativeSymbol:Xe||void 0,networkName:It,tokenSymbol:f.symbol};let bt=q.useMemo(()=>BigInt(f.quantity.numeric||"0"),[f.quantity.numeric]),yt=q.useMemo(()=>yn(f.quantity.numeric,f.quantity.decimals),[f.quantity.numeric,f.quantity.decimals]),vt=w?.(f),_t=q.useMemo(()=>{if(vt===void 0)return;let A=parseFloat(I.replace(/,/g,""));return Number.isFinite(A)?A*vt:0},[I,vt]);q.useEffect(()=>{z(""),j({})},[f.address,f.chainId]),q.useEffect(()=>{te.current+=1,ue(null),X(""),V(!1)},[f.address,f.chainId,_,I]),q.useEffect(()=>{Ke(no(n))},[n]);let He=q.useCallback(A=>{N(A),j(re=>({...re,recipient:void 0}))},[]),Dt=q.useCallback(A=>{z(A),j(re=>({...re,amount:void 0}))},[]),kt=q.useCallback(()=>{z(yt.replace(/,/g,"")),j(A=>({...A,amount:void 0}))},[yt]),St=q.useCallback(A=>{T(A),l?.(A),de("token_selected",{tags:{item_id:A.symbol}}),C("recipient")},[l,de]),rn=q.useCallback(()=>C("token"),[]),Pt=q.useCallback(()=>{C(A=>{if(A==="result")return"review";if(A===i)return x?.(),A;let re=Ns.indexOf(A);return re<=0?(x?.(),A):Ns[re-1]})},[i,x]),_e=q.useCallback(()=>{let{errors:A}=Ii({recipient:_,amount:"1",token:f,balanceRaw:bt});if(A.recipient){j(re=>({...re,recipient:A.recipient}));return}j(re=>({...re,recipient:void 0})),de("recipient_entered"),C("amount")},[_,f,bt,de]),Je=q.useCallback(A=>{N(A),j(re=>({...re,recipient:void 0})),de("recipient_entered"),C("amount")},[de]),Ct=q.useCallback(()=>{let A=Ii({recipient:_,amount:I,token:f,balanceRaw:bt});j(A.errors),!(Rs(A.errors)||A.rawAmount===void 0||!A.recipient)&&(Ne(A.rawAmount),xe(A.recipient),ue(null),X(""),Z("idle"),de("amount_entered"),C("review"))},[_,I,f,bt,de]);q.useEffect(()=>{if(k!=="review"||!ne||be===null||B!==null||ce||D||!v.canEstimateGas($e?.rpc))return;let A=++te.current;V(!0),X(""),(async()=>{try{let re=_i({token:f,walletAddress:n,recipient:ne,rawAmount:be}),Fe=await v.estimateGas(re,$e?.rpc);if(te.current!==A)return;ue(Fe)}catch(re){if(te.current!==A)return;X(Ei(re,on.current,"Failed to estimate gas."))}finally{te.current===A&&V(!1)}})()},[k,ne,be,B,ce,D,v,$e?.rpc,f,n]);let ut=q.useMemo(()=>{if(!vn(f)||!B||be===null)return!1;let A=wr(B,hr(f.chainId));return A===null?!1:be+A>bt},[f,B,be,bt]),Ye=q.useCallback(async()=>{if(!(!ne||be===null)&&!ut){Q(""),P(""),Z("submitting"),de("submitted");try{let A="",re=await Ts({repository:v,args:_i({token:f,walletAddress:n,recipient:ne,rawAmount:be}),chainId:f.chainId,onSubmitted:Fe=>{A=Fe,P(Fe),Z("confirming"),Ke(Ci(n,ne)),p?.({txHash:Fe,chainId:f.chainId,amount:I,tokenSymbol:f.symbol,recipient:ne})}});if(re==="success")Z("success"),de("confirmed"),A&&y?y?.(A):C("result");else if(re==="reverted"){let Fe="Transaction reverted on-chain.";Z("error"),Q(Fe),de("confirmed",{status:"failure",reason:wt(new Error(Fe))}),A&&b?b({txHash:A,chainId:f.chainId,message:Fe}):C("result")}else{let Fe="Transaction receipt was not found. Please check again later.";Z("error"),Q(Fe),de("confirmed",{status:"failure",reason:"timeout"}),A&&b?b({txHash:A,chainId:f.chainId,message:Fe}):C("result")}}catch(A){Z("error"),de("confirmed",{status:"failure",reason:wt(A)}),Q(Ei(A,{nativeSymbol:Xe||void 0,networkName:It,tokenSymbol:f.symbol})),C("result")}}},[v,ne,be,ut,f,I,n,p,y,b,Xe,It,de]),[Ot,jt]=q.useState(!1),et=q.useRef(void 0);q.useEffect(()=>()=>clearTimeout(et.current),[]);let Vt=q.useCallback(async()=>{if(E)try{await navigator.clipboard.writeText(E),jt(!0),clearTimeout(et.current),et.current=setTimeout(()=>jt(!1),2e3)}catch{}},[E]),an=q.useCallback(()=>{if(!it||!E)return;let A=Rt=>{typeof window<"u"&&window.open(Rt,"_blank","noopener,noreferrer")};if(!h){A(it);return}let re=h(it,{category:"send",origin:"send-transaction",payload:{chainId:f.chainId,txHash:E}});if(re&&typeof re.then=="function"){let Rt=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;re.then(Tt=>{if(Tt===null){Rt?.close();return}let qt=Tt??it;if(Rt)try{Rt.location.href=qt}catch{Rt.close(),A(qt)}else A(qt)});return}let Fe=re;Fe!==null&&A(Fe??it)},[h,f.chainId,it,E]),sn=q.useCallback(()=>{Q(""),P(""),Z("idle"),ue(null),X(""),pt.current.delete("submitted"),pt.current.delete("confirmed"),C("review")},[]);return{step:k,status:L,token:f,tokens:s.length>0?s:[f],recipient:_,amount:I,amountUsd:_t,fieldErrors:F,error:ae,txHash:E,gasEstimate:B,gasLoading:ce,gasError:D,insufficientGas:ut,reviewRawAmount:be,reviewRecipient:ne,recentAddresses:ze,accounts:r,accountName:o,walletAddress:n,resolvedEnv:Ze,transactionUrl:it,networkName:It,nativeSymbol:Xe,nativeDecimals:$e?.currency_decimals??f.quantity.decimals,balanceRaw:bt,balanceText:yt,priceUsd:vt,canSelectToken:(s.length>0?s:[f]).length>1,canSend:v.canSend,getTokenPriceUsd:w,setRecipient:He,setAmount:Dt,setMax:kt,selectToken:St,goToTokenSelect:rn,selectRecipient:Je,submitRecipient:_e,submitAmount:Ct,confirmSend:Ye,retry:sn,back:Pt,hashCopied:Ot,copyHash:Vt,openTransaction:an}}var Gt=H(require("react"),1);var Zt=require("react/jsx-runtime");function Is({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:i,token:a,setMax:s}=e,l=Gt.useRef(null),c=Gt.useCallback(()=>{requestAnimationFrame(()=>{let b=l.current;if(!b)return;let x=b.value.length;b.setSelectionRange(x,x)})},[]);Gt.useEffect(()=>{l.current?.focus(),c()},[c]),Gt.useEffect(()=>{t===""&&(w(!1),c())},[t,c]);let m=Gt.useMemo(()=>{let b=Mn(t,a.quantity.decimals);return"value"in b&&b.value>i},[t,a.quantity.decimals,i]),[g,w]=Gt.useState(!1),p=!g&&t===""?"0.00":t,y=t.trim()===""||t.trim()==="0";return(0,Zt.jsx)("div",{className:"sf-body sf-amount",children:(0,Zt.jsxs)("div",{className:"sf-amount-center",children:[(0,Zt.jsx)("span",{className:"sf-amount-usd",children:o!==void 0?xr(o):"\xA0"}),(0,Zt.jsx)("div",{className:"sf-amount-input-wrap","data-over":m||void 0,"data-empty":y||void 0,onClick:()=>l.current?.focus(),children:(0,Zt.jsx)("input",{ref:l,className:"sf-amount-input",value:p,onChange:b=>{let x=b.target.value;if(g)n(x);else if(t===""){if(x.length<4)return;w(!0);let h=x.startsWith("0.00")?x.slice(4):x;n(h)}else w(!0),n(x)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),(0,Zt.jsxs)("div",{className:"sf-amount-balance",children:[(0,Zt.jsx)("span",{children:"Balance:"}),(0,Zt.jsxs)("button",{type:"button",className:"sf-amount-max",onClick:s,"data-track":"amount_max",children:[r," ",a.symbol]})]})]})})}var zt=H(require("react"),1);var ou=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function Ps(e){return ou.has(e.toLowerCase())}var _s={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Ro(e,t){let n=Me[e];if(t===n.cross)return _s.cross;if(t===n.bsc)return _s.bsc}var ru={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function pn(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:i="png"}=n,a=ru[e],s=r?`&bg=${r}`:"";return`${a}/portrait/evm/${t}.${i}?size=${o}${s}`}var Qe=require("react/jsx-runtime");function Ls({size:e=20,className:t}){return(0,Qe.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,Qe.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),(0,Qe.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function As({size:e=20,className:t}){return(0,Qe.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,Qe.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 Fs({size:e=20,className:t}){return(0,Qe.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,Qe.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),(0,Qe.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Bs({size:e=16,className:t}){return(0,Qe.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:(0,Qe.jsx)("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ms({size:e=56,className:t}){return(0,Qe.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,Qe.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),(0,Qe.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 Ds({size:e=56,className:t}){return(0,Qe.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,Qe.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),(0,Qe.jsx)("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}var he=require("react/jsx-runtime");function Os(e,t){return e.name||`Account ${(e.index??t)+1}`}function Ws(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Us(e){return e.toLowerCase()}function Gs({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:i,walletAddress:a,resolvedEnv:s,selectRecipient:l}=e,c=zt.useMemo(()=>i.filter(f=>f.address.toLowerCase()!==a.toLowerCase()),[i,a]),m=c.length>0,g=zt.useMemo(()=>new Map(c.map((f,T)=>[Us(f.address),{account:f,index:T}])),[c]),[w,p]=zt.useState("recent"),y=zt.useRef(null);zt.useEffect(()=>{y.current?.focus()},[]);let b="1A1A2E",x=zt.useCallback(async()=>{try{let f=await navigator.clipboard.readText();f&&n(f.trim())}catch{}},[n]),h=t.trim().length>0,v=Qt(t.trim());return(0,he.jsxs)("div",{className:"sf-recipient",children:[(0,he.jsxs)("div",{className:"sf-recipient-top",children:[(0,he.jsxs)("div",{className:"sf-address-field","data-filled":h||void 0,"data-invalid":o.recipient||void 0,children:[(0,he.jsx)("textarea",{ref:y,className:"sf-address-input",value:t,onChange:f=>n(f.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:h?2:1}),h?(0,he.jsx)("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear","data-track":"recipient_clear",children:(0,he.jsx)(Fs,{size:20})}):(0,he.jsx)("button",{type:"button",className:"sf-address-action",onClick:x,"aria-label":"Paste from clipboard","data-track":"recipient_paste",children:(0,he.jsx)(As,{size:20})})]}),o.recipient&&(0,he.jsx)("p",{className:"sf-field-error",role:"alert",children:o.recipient}),(0,he.jsxs)("div",{className:"sf-tabs",role:"tablist",children:[(0,he.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":w==="recent"||void 0,"aria-selected":w==="recent",onClick:()=>p("recent"),"data-track":"recipient_tab","data-track-id":"recent",children:"Recent"}),m&&(0,he.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":w==="account"||void 0,"aria-selected":w==="account",onClick:()=>p("account"),"data-track":"recipient_tab","data-track-id":"account",children:"My Account"})]})]}),(0,he.jsx)("div",{className:"sf-address-list",children:w==="account"&&m?c.map((f,T)=>{let k=Os(f,T),C=pn(s,f.address,{size:56,bg:b});return(0,he.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>l(f.address),"data-track":"recipient_item",children:[(0,he.jsxs)("span",{className:"sf-address-avatar",children:[C&&(0,he.jsx)("img",{src:C,alt:"",width:40,height:40,draggable:!1,onError:_=>{_.currentTarget.style.display="none"}}),(0,he.jsx)("span",{className:"sf-address-avatar-fallback",children:Ws(k)})]}),(0,he.jsxs)("span",{className:"sf-address-meta",children:[(0,he.jsx)("span",{className:"sf-address-name",children:k}),(0,he.jsx)("span",{className:"sf-address-value",children:ct(f.address)})]})]},f.address)}):r.length>0?r.map(f=>{let T=g.get(Us(f.address)),k=T?Os(T.account,T.index):ct(f.address),C=pn(s,f.address,{size:56,bg:b});return(0,he.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>l(f.address),"data-track":"recipient_item",children:[(0,he.jsxs)("span",{className:"sf-address-avatar",children:[C&&(0,he.jsx)("img",{src:C,alt:"",width:40,height:40,draggable:!1,onError:_=>{_.currentTarget.style.display="none"}}),(0,he.jsx)("span",{className:"sf-address-avatar-fallback",children:Ws(k)})]}),(0,he.jsxs)("span",{className:"sf-address-meta",children:[(0,he.jsx)("span",{className:"sf-address-name",children:k}),(0,he.jsx)("span",{className:"sf-address-value",children:ct(f.address)})]})]},f.address)}):(0,he.jsx)("div",{className:"sf-empty",children:"No send history"})}),h&&!v&&!o.recipient&&(0,he.jsx)("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}var Le=require("react/jsx-runtime");function $s({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:i,openTransaction:a}=e,s=t==="error",l=t==="success";return s?(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)(Ds,{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)(zs,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]}):(0,Le.jsxs)("div",{className:"sf-body sf-result",children:[(0,Le.jsx)("span",{className:"sf-result-icon","data-pending":!l||void 0,children:l?(0,Le.jsx)(Ms,{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:l?"Transaction Complete":"Transaction in Progress"}),(0,Le.jsx)("p",{className:"sf-result-desc",children:l?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&(0,Le.jsx)(zs,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]})}function zs({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","data-track":"tx_link_open",children:ct(e)}),(0,Le.jsx)("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash","data-track":"tx_hash_copy",children:t?(0,Le.jsx)(cn,{size:16}):"Copy"})]})]})}var le=require("react/jsx-runtime"),kr="\u2014";function Hs({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:i,walletAddress:a,networkName:s,nativeSymbol:l,nativeDecimals:c,gasEstimate:m,gasLoading:g,gasError:w,insufficientGas:p,error:y,resolvedEnv:b}=e,x=vn(t),h=n!==null?gr(n,t.quantity.decimals):"",v=r?.trim()||`Account ${(i[0]?.index??0)+1}`,f=pn(b,a,{size:56,bg:"1A1A2E"}),T=l||(x?t.symbol:""),k=hr(t.chainId),C=m?ys(m,k):null,_=m?wr(m,k):null,N=L=>L!==null&&T?`${Ni(L,c)} ${T}`:kr,I=L=>L!==void 0?`${ws(L)} Gwei`:kr,z=(()=>{if(!x||!m||_===null||n===null)return kr;let L=n+_;return`${Ni(L,c)} ${T||t.symbol}`})(),F=L=>g?"\u2026":L,j=[{label:"Est. Tx Fee",value:F(N(_))},...C==="dynamic"?[{label:"Max Priority Fee",value:F(I(m?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:F(I(m?.maxFeePerGas))}]:C==="legacy"?[{label:"Gas Price",value:F(I(m?br(m):void 0))}]:[],{label:"Gas Limit",value:F(m?xs(m.gasLimit):kr)}];return(0,le.jsxs)("div",{className:"sf-body sf-review",children:[(0,le.jsxs)("div",{className:"sf-review-amount",children:[(0,le.jsx)("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:L=>{L.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,le.jsxs)("span",{className:"sf-review-amount-value",children:[h,(0,le.jsx)("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),(0,le.jsxs)("div",{className:"sf-review-parties",children:[(0,le.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,le.jsx)("span",{className:"sf-review-party-label",children:"From"}),(0,le.jsxs)("div",{className:"sf-review-party-head",children:[(0,le.jsx)("span",{className:"sf-review-party-avatar",children:f&&(0,le.jsx)("img",{src:f,alt:"",width:28,height:28,draggable:!1,onError:L=>{L.currentTarget.style.display="none"}})}),(0,le.jsx)("span",{className:"sf-review-party-name",children:v})]}),(0,le.jsx)("span",{className:"sf-review-party-addr",children:a})]}),(0,le.jsx)("span",{className:"sf-review-arrow","aria-hidden":!0,children:(0,le.jsx)(Bs,{size:16})}),(0,le.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,le.jsx)("span",{className:"sf-review-party-label",children:"To"}),(0,le.jsx)("span",{className:"sf-review-party-addr",children:o})]})]}),(0,le.jsxs)("section",{className:"sf-review-card",children:[(0,le.jsx)("h3",{className:"sf-review-section-title",children:"Summary"}),(0,le.jsxs)("div",{className:"sf-review-row",children:[(0,le.jsx)("span",{className:"sf-review-row-label",children:"Network"}),(0,le.jsx)("span",{className:"sf-review-row-value",children:s})]}),j.map(L=>(0,le.jsxs)("div",{className:"sf-review-row",children:[(0,le.jsx)("span",{className:"sf-review-row-label",children:L.label}),(0,le.jsx)("span",{className:"sf-review-row-value",children:L.value})]},L.label))]}),(0,le.jsxs)("section",{className:"sf-review-card",children:[(0,le.jsx)("h3",{className:"sf-review-section-title",children:"Total"}),(0,le.jsxs)("div",{className:"sf-review-row",children:[(0,le.jsx)("span",{className:"sf-review-row-label",children:"Total Amount"}),(0,le.jsxs)("span",{className:"sf-review-row-value",children:[h," ",t.symbol]})]}),x&&(0,le.jsxs)("div",{className:"sf-review-row",children:[(0,le.jsx)("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),(0,le.jsx)("span",{className:"sf-review-row-value",children:F(z)})]})]}),p&&!w&&!y&&(0,le.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."]}),(w||y)&&(0,le.jsx)("div",{className:"sf-message sf-message--error",role:"alert",children:w||y})]})}var Sr=H(require("react"),1);var nt=require("react/jsx-runtime");function js({flow:e}){let[t,n]=Sr.useState(""),o=t.trim().toLowerCase(),r=Sr.useMemo(()=>o?e.tokens.filter(i=>i.symbol.toLowerCase().includes(o)||i.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return(0,nt.jsxs)("div",{className:"sf-body sf-token-select",children:[(0,nt.jsxs)("div",{className:"sf-search",children:[(0,nt.jsx)(Ls,{size:20}),(0,nt.jsx)("input",{className:"sf-search-input",value:t,onChange:i=>n(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),(0,nt.jsxs)("div",{className:"sf-token-list",children:[r.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,s=Ro(e.resolvedEnv,i.chainId),l=e.getTokenPriceUsd?.(i);return(0,nt.jsxs)("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),"data-track":"token_item","data-track-id":i.symbol,children:[(0,nt.jsxs)("span",{className:"sf-token-left",children:[(0,nt.jsxs)("span",{className:"sf-token-icon-wrap",children:[(0,nt.jsx)("img",{className:"sf-token-icon",src:i.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"}}),s&&(0,nt.jsx)("img",{className:"sf-token-chain-badge",src:s,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.style.display="none"}})]}),(0,nt.jsx)("span",{className:"sf-token-name",children:i.symbol})]}),(0,nt.jsxs)("span",{className:"sf-token-right",children:[(0,nt.jsx)("span",{className:"sf-token-balance",children:yn(i.quantity.numeric,i.quantity.decimals)}),l!==void 0&&(0,nt.jsx)("span",{className:"sf-token-price",children:xr(l)})]})]},a)}),r.length===0&&(0,nt.jsx)("div",{className:"sf-empty",children:"No tokens found"})]})]})}ie(`.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-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){filter:brightness(1.05)}.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-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff;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-system-orange-default, #f0640d)}.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;flex-shrink:0;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-system-orange-default, #f0640d)}.sf-address-field[data-filled]{border-color:var(--ds-system-orange-default, #f0640d)}.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-system-orange-high, #e56f00)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-system-orange-high, #e56f00)}.sf-address-list{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;margin-top:8px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .sf-address-list{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-address-list::-webkit-scrollbar{width:4px}.sf-address-list::-webkit-scrollbar-track{background:transparent}.sf-address-list::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}[data-theme=light] .sf-address-list::-webkit-scrollbar-thumb{background:#0000001f}.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;z-index:1;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-system-orange-default, #f0640d);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-system-orange-high, #e56f00)}.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 Ee=require("react/jsx-runtime"),iu={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function To({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...i}){let a=Vs.useCallback(h=>{o?.(h),n?.(h)},[n,o]),l=Es({...i,onSuccess:o||n?a:void 0,onExit:t}),{step:c,status:m}=l,g=Qt(l.recipient.trim()),w=Mn(l.amount,l.token.quantity.decimals),p="value"in w&&w.value<=l.balanceRaw,y=m==="submitting"||m==="confirming",b=c!=="result",x=iu[c]??"";return(0,Ee.jsx)(Ce,{feature:"send",children:(0,Ee.jsxs)("div",{className:ge("sf-root",r),"data-step":c,children:[(0,Ee.jsxs)("header",{className:"sf-header",children:[b?(0,Ee.jsx)("button",{type:"button",className:"sf-header-btn",onClick:l.back,"aria-label":"Back","data-track":"back",children:(0,Ee.jsx)(dn,{size:24})}):(0,Ee.jsx)("span",{className:"sf-header-btn","aria-hidden":!0}),(0,Ee.jsx)("span",{className:"sf-header-title",children:x}),(0,Ee.jsx)("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close","data-track":"close",children:(0,Ee.jsx)(Lt,{size:24})})]}),c==="token"&&(0,Ee.jsx)(js,{flow:l}),c==="recipient"&&(0,Ee.jsx)(Gs,{flow:l}),c==="amount"&&(0,Ee.jsx)(Is,{flow:l}),c==="review"&&(0,Ee.jsx)(Hs,{flow:l}),c==="result"&&(0,Ee.jsx)($s,{flow:l}),(0,Ee.jsxs)("footer",{className:"sf-footer","data-step":c,children:[c==="recipient"&&(0,Ee.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitRecipient,"data-disabled":!g||void 0,"aria-disabled":!g,"data-track":"recipient_next",children:"Next"}),c==="amount"&&(0,Ee.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitAmount,"data-disabled":!p||void 0,"aria-disabled":!p,"data-track":"amount_next",children:"Next"}),c==="review"&&(0,Ee.jsxs)("div",{className:"sf-footer-row",children:[(0,Ee.jsx)("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:l.back,disabled:y,"data-track":"review_cancel",children:"Cancel"}),(0,Ee.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.confirmSend,disabled:y||!l.canSend||l.insufficientGas,"data-track":"review_send",children:y?"Sending...":"Send"})]}),c==="result"&&m==="success"&&(0,Ee.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(l.txHash||void 0),"data-track":"result_ok",children:"All done"}),c==="result"&&m==="error"&&(0,Ee.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.retry,"data-track":"result_retry",children:"Try Again"})]})]})})}var qs=H(require("@radix-ui/react-popover"),1),Ks=require("vaul");var Dn=require("react/jsx-runtime");function Ys({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:i}=wn(),a=n!=null,s=e??!0,l=a?n:(0,Dn.jsxs)("button",{type:"button",className:ge("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[(0,Dn.jsx)(ts,{size:o?14:16}),(0,Dn.jsx)("span",{className:"wi-trigger-address",children:ct(i)})]});return o?(0,Dn.jsx)(Ks.Drawer.Trigger,{asChild:s,children:l}):(0,Dn.jsx)(qs.Trigger,{asChild:s,children:l})}var $=H(require("react"),1),Kr=H(require("@radix-ui/react-popover"),1),Wo=require("vaul");var lo=H(require("bignumber.js"),1);var Qs=require("@tanstack/react-query"),Zs=require("react");var Cr="user-balance";async function au(e,t,n,o){let r=new URLSearchParams({networkId:`eip155:${t}`,account:n}),i=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:o});if(!i.ok)throw new Error(`Failed to fetch token balance: ${i.status}`);let a=await i.json();if(a.code!==200)throw new Error(`Token balance API error: ${a.code}`);return a.data}function un(e,t,n=!0){let o=Me[e],r=[o.cross,o.bsc],i=(0,Qs.useQueries)({queries:r.map(c=>({queryKey:[Cr,e,t,c],queryFn:async({signal:m})=>au(await pe("walletServer",e),c,t,m),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),a=i.some(c=>c.isLoading),s=i.some(c=>c.isError);return{tokens:(0,Zs.useMemo)(()=>{let c=[];for(let m of i)m.data&&c.push(...m.data);return c},[i]),isLoading:a,isError:s}}var Rr=require("@tanstack/react-query"),Xs=require("react");var su="forge-holdings",lu="forge-token-image";async function cu(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 du(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 Js(e,t,n=!0){let{data:o,...r}=(0,Rr.useQuery)({queryKey:[su,e,t],queryFn:async({signal:i})=>cu(await pe("bondingCurve",e),t,i),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:o??[],...r}}function el(e,t,n=!0){let o=(0,Rr.useQueries)({queries:t.map(i=>({queryKey:[lu,e,i],queryFn:async({signal:a})=>du(await pe("bondingCurve",e),i,a),enabled:n,staleTime:1/0}))});return{imageMap:(0,Xs.useMemo)(()=>{let i=new Map;for(let a of o)a.data&&i.set(a.data.address,a.data.image_url);return i},[o])}}var tl=require("@tanstack/react-query"),nl=require("react");var Tr="token-stats";function At(e,t){return`${e}:${t.toLowerCase()}`}function fn(e,t=!0){let{data:n,...o}=(0,tl.useQuery)({queryKey:[Tr,e],queryFn:async({signal:i})=>{let a=await pe("walletServer",e),s=await fetch(`${a}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let l=await s.json();if(l.code!==200)throw new Error(`Token stats API error: ${l.code}`);return l},enabled:t,staleTime:3e4});return{statsMap:(0,nl.useMemo)(()=>{let i=new Map;if(!n?.data)return i;for(let a of n.data){let s=At(a.chain_id,a.address);i.set(s,a)}return i},[n]),...o}}var ol=require("@tanstack/react-query"),pu="crossd-apr",uu="https://crossd-dashboard-api.crossdefi.io/api/v1/overview";function rl(){let{data:e,...t}=(0,ol.useQuery)({queryKey:[pu],queryFn:async({signal:n})=>{let o=await fetch(uu,{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch CROSSD overview: ${o.status}`);let r=await o.json();if(r.code!==200)throw new Error(`CROSSD overview API error: ${r.code}`);let i=parseFloat(r.data.est_last_epoch_apy);if(!Number.isFinite(i))throw new Error("CROSSD overview returned a non-numeric APR");return i*100},staleTime:6e4});return{aprPercent:e??null,...t}}var il=require("@tanstack/react-query"),Pi=require("react");var fu="token-info";function No(e,t){return`${t.toLowerCase()}_${e}`}function al(e,t=!0){let{data:n,...o}=(0,il.useQuery)({queryKey:[fu,e],queryFn:async({signal:a})=>{let s=await pe("walletServer",e),l=await fetch(`${s}/v1/public/token/info`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Token info API error: ${c.code}`);return c},enabled:t,staleTime:1/0}),r=(0,Pi.useMemo)(()=>{let a=new Map;if(!n?.data)return a;for(let s of n.data){let l=No(s.chain_id,s.address);a.set(l,s.category)}return a},[n]),i=(0,Pi.useMemo)(()=>{let a=new Map;if(!n?.data)return a;for(let s of n.data)a.set(No(s.chain_id,s.address),s);return a},[n]);return{categoryMap:r,infoMap:i,...o}}var sl=require("react"),Nr=H(require("bignumber.js"),1);function ll(e,t,n){let{tokens:o,isLoading:r}=un(e,t,n),{statsMap:i}=fn(e,n);return(0,sl.useMemo)(()=>{let a=new Nr.default(0);for(let m of o){let g=i.get(At(m.chainId,m.address));if(!g)continue;let p=new Nr.default(m.quantity.numeric).shiftedBy(-m.quantity.decimals).multipliedBy(new Nr.default(g.price));p.isNaN()||(a=a.plus(p))}let s=a.toFixed(),{displayValue:l,isLowerBound:c}=ps(s);return{totalUsd:s,displayValue:l,isLowerBound:c,isLoading:r}},[o,i,r])}var md=require("qrcode.react");function Ve(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 i=c=>{typeof window>"u"||window.open(c,"_blank","noopener,noreferrer")};if((c=>!!c&&(typeof c=="object"||typeof c=="function")&&typeof c.then=="function")(r)){let c=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,m=g=>{if(g===null){c?.close();return}let w=g??t;if(c)try{c.location.href=w}catch{c.close(),i(w)}else i(w)};r.then(m,g=>{console.error("[dapp-ui] onOutlink rejected:",g),c?.close()});return}let s=r;if(s===null)return;i(s??t)}var zn=H(require("react"),1),Lc=require("vaul");var io=require("react");var Nt=H(require("bignumber.js"),1),mu=/^(\d{4}-\d{2}-\d{2})/;function cl(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:r,cumulative:i}of e.map(a=>({key:mu.exec(a.reference_date)?.[1],cumulative:a.cumulative_earned})).filter(a=>!!a.key&&a.cumulative!=null).sort((a,s)=>a.key<s.key?-1:a.key>s.key?1:0))t.set(r,i),n=r;if(n===void 0)return;let o=new Date().toISOString().slice(0,10);return t.get(o)??t.get(n)}function Er(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Ir(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Eo(e,t){let n=e.length+t.length;if(n>32)return"xs";if(n>24)return"sm"}function Li(e){return e?.toUpperCase()==="WCROSS"?"CROSS":e}var gu=["Request Arguments:","Details:","Docs:","Version:","Contract Call:"];function Io(e,t){console.error("[wallet-portfolio] withdraw failed:",e);let o=e instanceof Error?e.message:"";for(let i of gu){let a=o.indexOf(i);a>=0&&(o=o.slice(0,a))}return o.split(`
8
- `).map(i=>i.trim()).find(i=>i.length>0)||t}var hu="0xe00e8bf3";function dl(e,t){let n=typeof e=="bigint"?e:BigInt(e);if(n<0n)throw new Error("poolId must be non-negative");if(t<0n)throw new Error("amount must be non-negative");let o=n.toString(16).padStart(64,"0"),r=t.toString(16).padStart(64,"0");return`${hu}${o}${r}`}function ro(e){return!e||e<=0n?"0":new Nt.default(e.toString()).shiftedBy(-9).toFormat(2,Nt.default.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function _r(e){return!e||e<=0n?"0":new Nt.default(e.toString()).toFormat(0,Nt.default.ROUND_DOWN)}function Pr(e){if(!e||e<=0n)return"0";let t=new Nt.default(e.toString()).shiftedBy(-18),n=t.isLessThan(1e-4)?7:4;return t.toFormat(n,Nt.default.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Xt(e,t){let n=new Nt.default(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,Nt.default.ROUND_DOWN):n.toFormat(4,Nt.default.ROUND_DOWN)}function Ai(e){return Xt(e,0)}var _o={rate:1,symbol:"$"};function On(e,t=_o){let n=Number.isFinite(t.rate)&&t.rate>0?t.rate:1;return`${t.symbol||"$"}${e.times(n).toFormat(2,Nt.default.ROUND_DOWN)}`}function kn(e,t,n,o=_o){let r=new Nt.default(n||"0");if(!r.isFinite()||r.isLessThanOrEqualTo(0))return null;let i=new Nt.default(e||"0").shiftedBy(-t).times(r);return i.isFinite()?On(i,o):null}var Po=(0,io.createContext)(null);function Oe(){let e=(0,io.useContext)(Po);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}function Ft(){let{conversionRatio:e,currencySymbol:t}=Oe();return(0,io.useMemo)(()=>({rate:typeof e=="number"&&e>0?e:_o.rate,symbol:t||_o.symbol}),[e,t])}var pl=require("vaul");var Fi=require("react/jsx-runtime");function ul({asChild:e,children:t}){let{walletAddress:n}=Oe(),o=t!=null,r=e??!0,i=o?t:(0,Fi.jsx)("button",{type:"button",children:ct(n)});return(0,Fi.jsx)(pl.Drawer.Trigger,{asChild:r,children:i})}var Mo=require("vaul");var Ue=H(require("react"),1),_c=require("@tanstack/react-query");var Lr=require("react"),Bi=(0,Lr.createContext)(null);function fl(){return(0,Lr.useContext)(Bi)}var qe=require("react/jsx-runtime");function ml({size:e=22,className:t}){return(0,qe.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,qe.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function gl({size:e=22,className:t}){return(0,qe.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,qe.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,qe.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 Ar({size:e=16,className:t}){return(0,qe.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,qe.jsx)("path",{d:"M5.333 5.333V4a1.333 1.333 0 011.334-1.333h5.333A1.333 1.333 0 0113.333 4v5.333a1.333 1.333 0 01-1.333 1.334h-1.333",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,qe.jsx)("path",{d:"M4 5.333h5.333c.737 0 1.334.597 1.334 1.334V12c0 .736-.597 1.333-1.334 1.333H4A1.333 1.333 0 012.667 12V6.667C2.667 5.93 3.263 5.333 4 5.333z",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Fr({size:e=16,className:t}){return(0,qe.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,qe.jsx)("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Br({size:e=48,className:t}){return(0,qe.jsxs)("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,qe.jsx)("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),(0,qe.jsx)("path",{d:"M14 24.5l6.6 6.6L34.5 17.5",stroke:"var(--wp-claim-success-mark, #ffffff)",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Et({size:e=12,className:t}){return(0,qe.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,qe.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,qe.jsx)("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,qe.jsx)("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}var hl=require("@tanstack/react-query"),Mi=require("react");var bu="wp:reward-pools";function ao(e,t=!0){let{data:n,...o}=(0,hl.useQuery)({queryKey:[bu,e],queryFn:async({signal:a})=>{let s=await pe("gameReward",e),l=await fetch(`${s}/v1/pools`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch pools: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),r=(0,Mi.useMemo)(()=>n?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[n]),i=(0,Mi.useMemo)(()=>n?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[n]);return{crossPools:r,gamePools:i,allPools:n?.data.pools??[],...o}}var bl=require("@tanstack/react-query"),wl=require("react");var wu="wp:user-deposits";function Mr(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,bl.useQuery)({queryKey:[wu,e,t],queryFn:async({signal:s})=>{let l=await pe("gameReward",e),c=await fetch(`${l}/v1/users/${t}/deposits`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let m=await c.json();if(m.code!==200)throw new Error(`Deposits API error: ${m.code}`);return m},enabled:o,staleTime:0});return{depositMap:(0,wl.useMemo)(()=>{let s=new Map;if(!r?.data.user_deposits)return s;for(let l of r.data.user_deposits)s.set(l.pool_address.toLowerCase(),l);return s},[r]),deposits:r?.data.user_deposits??[],...i}}var Nl=require("@tanstack/react-query"),El=require("react");var xl={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},yl={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var vl={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var Di={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},kl={dev:`${Di.dev}/portfolio`,stage:`${Di.stage}/portfolio`,production:`${Di.production}/portfolio`};var Sl={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Bt={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"},Dr={dev:"https://stg-swap-api.crossdefi.io",stage:"https://stg-swap-api.crossdefi.io",production:"https://swap-api.crossdefi.io"},Cl={dev:"https://stg.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://www.crossdefi.io"},Rl={dev:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",stage:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",production:"0xEFd871aF7D695A0c1709e46b565761F4cd1Ef5ba"},Tl={dev:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",stage:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",production:"0x731a104a4461ae45bfef520468b43c262d35e682"};var xu="wp:token-info",yu="0x0000000000000000000000000000000000000001";function Jt(e,t=!0){let n=Me[e].cross,{data:o,...r}=(0,Nl.useQuery)({queryKey:[xu,e],queryFn:async({signal:m})=>{let g=await pe("walletServer",e),w=await fetch(`${g}/v1/public/token/info`,{cache:"no-store",signal:m});if(!w.ok)throw new Error(`Failed to fetch token info: ${w.status}`);let p=await w.json();if(p.code!==200)throw new Error(`Token info API error: ${p.code}`);return p},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:a}=(0,El.useMemo)(()=>{let m=new Map,g=new Map;if(!o?.data)return{byChainAddr:m,byChainSym:g};for(let w of o.data){let p=w.address.toLowerCase();m.set(`${w.chain_id}:${p}`,w),m.set(p,w);let y=w.symbol.replace(/^t/,"").toUpperCase(),b=`${w.chain_id}:${y}`;g.has(b)||g.set(b,w),g.has(y)||g.set(y,w)}return{byChainAddr:m,byChainSym:g}},[o]);return{getTokenImage:(m,g,w)=>{let p=m.toLowerCase(),y=!!w?.chainOnly,b=i.get(`${n}:${p}`);if(b?.image)return b.image;if(!y){let x=i.get(p);if(x?.image)return x.image}if(g){let x=g.replace(/^t/,"").toUpperCase(),h=a.get(`${n}:${x}`);if(h?.image)return h.image;if(!y){let v=a.get(x);if(v?.image)return v.image}}return""},getTokenSymbol:(m,g,w)=>{let p=m.toLowerCase();return(i.get(`${n}:${p}`)??(w?.chainOnly?void 0:i.get(p)))?.symbol||g},getNativeToken:()=>i.get(`${n}:${yu}`),...r}}var Oi=H(require("react"),1);var Wn=require("react/jsx-runtime");function Mt({sectionKey:e,title:t,icon:n,iconFit:o="cover",isEmpty:r,loading:i=!1,children:a}){let s=fl();return Oi.useEffect(()=>{s?.report(e,{loading:i,empty:r})},[s,e,i,r]),Oi.useEffect(()=>()=>s?.unregister(e),[s,e]),r?null:(0,Wn.jsxs)("div",{className:"wp-svc-card",children:[(0,Wn.jsxs)("div",{className:"wp-svc-card-head",children:[(0,Wn.jsx)("img",{className:"wp-svc-card-icon",src:n,alt:"",style:{objectFit:o}}),(0,Wn.jsx)("span",{className:"wp-svc-card-title",children:t})]}),(0,Wn.jsx)("div",{className:"wp-svc-items",children:a})]})}var Or=H(require("bignumber.js"),1),fe=require("react/jsx-runtime"),vu="ONErewards";function ku(e){return new Or.default(e||"0").isGreaterThan(0)}function Il(){let{env:e,walletAddress:t,onOutlink:n}=Oe(),o=Ft(),r=!!t,{allPools:i,isLoading:a}=ao(e,r),{depositMap:s,isLoading:l}=Mr(e,t,r),{getTokenImage:c}=Jt(e,r),m=(p,y)=>`${xl[e]}/gametoken/tokens/${p.deposit_token.address}?mode=rewards${y==="withdraw"?"&trade=withdraw":""}`,g=`${Bt[e]}/reward.png`,w=i.filter(p=>{let y=s.get(p.pool_address.toLowerCase()),b=y?.deposited_amount??"0",x=y?.claimable_reward??"0";return!(new Or.default(b).isZero()&&new Or.default(x).isZero())});return(0,fe.jsx)(Mt,{sectionKey:"rewards",title:vu,icon:g,isEmpty:w.length===0,loading:a||l,children:w.map(p=>{let y=s.get(p.pool_address.toLowerCase()),b=y?.deposited_amount??"0",x=y?.claimable_reward??"0",h=m(p,"withdraw"),v=m(p,"claim"),f=c(p.deposit_token.address,p.deposit_token.symbol),T=p.reward_tokens[0],k=T?c(T.address,T.symbol):"",C=p.reward_tokens.map(L=>L.symbol),_=C.length>0?`${p.deposit_token.symbol}-${C.join("/")}`:p.deposit_token.symbol,N=T?Xt(x,T.decimals):"0",I=T?.symbol??"Reward",z=kn(b,p.deposit_token.decimals,p.deposit_token.price,o),F=T?kn(x,T.decimals,T.price,o):null,j=!!y&&ku(x);return(0,fe.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,fe.jsxs)("div",{className:"wp-item-body",children:[(0,fe.jsxs)("div",{className:"wp-item-line",children:[(0,fe.jsx)("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),(0,fe.jsxs)("div",{className:"wp-svc-token",children:[(0,fe.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[f&&(0,fe.jsx)("img",{className:"wp-svc-token-icon",src:f,alt:""}),k&&(0,fe.jsx)("img",{className:"wp-svc-token-icon",src:k,alt:""})]}),(0,fe.jsx)("span",{children:_})]})]}),(0,fe.jsxs)("div",{className:"wp-item-line",children:[(0,fe.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,fe.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[f&&(0,fe.jsx)("img",{className:"wp-svc-token-icon",src:f,alt:""}),(0,fe.jsxs)("div",{className:"wp-svc-amount",children:[(0,fe.jsx)("span",{className:"wp-svc-amount-main",children:Xt(b,p.deposit_token.decimals)}),z&&(0,fe.jsx)("span",{className:"wp-item-usd",children:z})]})]})]}),(0,fe.jsxs)("div",{className:"wp-item-line",children:[(0,fe.jsxs)("span",{className:"wp-item-label",children:["Claimable (",I,")"]}),(0,fe.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[k&&(0,fe.jsx)("img",{className:"wp-svc-token-icon",src:k,alt:""}),(0,fe.jsxs)("div",{className:"wp-svc-amount",children:[(0,fe.jsx)("span",{className:"wp-svc-amount-main",children:N}),F&&(0,fe.jsx)("span",{className:"wp-item-usd",children:F})]})]})]})]}),(0,fe.jsxs)("div",{className:"wp-item-tags",children:[(0,fe.jsxs)("a",{className:"wp-tag wp-tag--muted",href:h,target:"_blank",rel:"noopener noreferrer","data-track":"rewards_withdraw_open",onClick:L=>Ve(L,h,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:p,userDeposit:y}},n),children:[(0,fe.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,fe.jsx)(Et,{size:12,className:"wp-tag-icon"})]}),(0,fe.jsxs)("a",{className:"wp-tag wp-tag--mint","data-disabled":!j||void 0,"aria-disabled":!j||void 0,href:j?v:void 0,target:j?"_blank":void 0,rel:j?"noopener noreferrer":void 0,onClick:L=>{if(!j){L.preventDefault();return}Ve(L,v,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:p,userDeposit:y}},n)},children:[(0,fe.jsx)("span",{className:"wp-tag-label",children:"Claim"}),(0,fe.jsx)(Et,{size:12,className:"wp-tag-icon"})]})]})]},p.pool_address)})})}var Wl=H(require("react"),1);var Pl=require("@tanstack/react-query"),Fo=require("react");var Su="0x70a08231",Cu="0x18160ddd",Ru="0x313ce567",Tu=8e3;async function Nu(e,t,n,o){let r=new AbortController,i=setTimeout(()=>r.abort(),Tu);o&&o.addEventListener("abort",()=>r.abort(),{once:!0});let a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:n}),signal:r.signal}).finally(()=>clearTimeout(i));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let s=await a.json();if(s.error)throw new Error(`RPC ${t}: ${s.error.message}`);if(s.result===void 0)throw new Error(`RPC ${t}: empty result`);return s.result}function Eu(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function Lo(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function mn(e,t,n,o,r){try{return await Nu(e,"eth_call",[r?{from:r,to:t,data:n}:{to:t,data:n},"latest"],o)}catch{return}}async function Iu(e,t,n,o){let[r,i,a]=await Promise.all([mn(e,n,Su+Eu(t),o),mn(e,n,Cu,o),mn(e,n,Ru,o)]),s=Lo(r);if(s===void 0)return null;let l=Lo(a);return{balance:s,totalSupply:Lo(i),decimals:l!==void 0?Number(l):void 0}}async function Ao(e,t){let n=Me[e].cross,o=await pe("walletServer",e),r=await fetch(`${o}/v1/public/chain/info/${n}`,{cache:"no-store",signal:t});if(!r.ok)return;let i=await r.json();return("data"in i&&i.data!==void 0?Array.isArray(i.data)?i.data[0]:i.data:i)?.rpc||void 0}async function _l(e,t,n,o){if(!t||n.length===0)return{};let r;try{r=await Ao(e,o)}catch{r=void 0}if(!r)return{};let i=await Promise.all(n.map(async s=>[s.toLowerCase(),await Iu(r,t,s,o)])),a={};for(let[s,l]of i)l&&(a[s]=l);return a}var _u="wp:withdraw-token-meta",Pu="0xc89039c5",Lu="0x95d89b41",Au="0x313ce567";function Fu(e){if(!(!e||e==="0x"))try{let t=e.replace(/^0x/,""),n=Number(BigInt("0x"+t.slice(64,128)));if(!Number.isFinite(n)||n<=0||n>64)return;let o=t.slice(128,128+n*2),r="";for(let i=0;i<o.length;i+=2)r+=String.fromCharCode(parseInt(o.slice(i,i+2),16));return r||void 0}catch{return}}function Bu(e){if(!e||e==="0x")return;let n="0x"+e.replace(/^0x/,"").padStart(64,"0").slice(24,64);return/^0x[a-f0-9]{40}$/.test(n)&&n!=="0x0000000000000000000000000000000000000000"?n:void 0}async function Mu(e,t,n){if(t.length===0)return{};let o;try{o=await Ao(e,n)}catch{o=void 0}if(!o)return{};let r=await Promise.all(t.map(async a=>{let s=Bu(await mn(o,a,Pu,n));if(!s)return[a.toLowerCase(),null];let[l,c]=await Promise.all([mn(o,s,Lu,n),mn(o,s,Au,n)]),m=Fu(l),g=Lo(c);return m?[a.toLowerCase(),{tokenAddress:s,symbol:m,decimals:g!==void 0?Number(g):18}]:[a.toLowerCase(),null]})),i={};for(let[a,s]of r)s&&(i[a]=s);return i}function Ll(e,t,n=!0){let r=n&&!!t,{allPools:i,isLoading:a}=ao(e,r),{deposits:s,isLoading:l}=Mr(e,t,r),c=(0,Fo.useMemo)(()=>{let x=new Map;for(let h of i)x.set(h.pool_address.toLowerCase(),h);return x},[i]),m=(0,Fo.useMemo)(()=>s.filter(x=>{try{return BigInt(x.deposited_amount||"0")>0n}catch{return!1}}),[s]),g=(0,Fo.useMemo)(()=>m.map(x=>x.pool_address.toLowerCase()).filter(x=>!c.has(x)).sort(),[m,c]),{data:w,isLoading:p}=(0,Pl.useQuery)({queryKey:[_u,e,g],queryFn:({signal:x})=>Mu(e,g,x),enabled:r&&g.length>0,staleTime:1440*60*1e3});return{positions:(0,Fo.useMemo)(()=>{let x=[];for(let h of m){let v=h.pool_address.toLowerCase(),f=c.get(v);if(f){x.push({poolId:h.pool_id,poolAddress:h.pool_address,poolType:f.pool_type,tokenSymbol:f.deposit_token.symbol,tokenAddress:f.deposit_token.address,decimals:f.deposit_token.decimals,price:f.deposit_token.price,depositedRaw:h.deposited_amount});continue}let T=w?.[v];T&&x.push({poolId:h.pool_id,poolAddress:h.pool_address,poolType:"Unknown",tokenSymbol:T.symbol,tokenAddress:T.tokenAddress,decimals:T.decimals,depositedRaw:h.deposited_amount})}return x},[m,c,w]),isLoading:a||l||p}}var ot=H(require("react"),1);var O=require("react/jsx-runtime"),Du=400;function Ou(e,t,n){if(t==="loading")return"Estimating...";if(!e||t==="error"||t==="unavailable")return"Wallet estimate";let o=e.maxFeePerGas??e.gasPrice;return!o||o<=0n||e.gasLimit<=0n?"Wallet estimate":`${Pr(e.gasLimit*o)} ${n??""}`.trim()}function Wi(e,t,n){return n==="loading"?"Estimating...":n==="error"||n==="unavailable"?"-":`${e} ${t}`.trim()}function Wu({position:e,size:t}){return e.icon?(0,O.jsx)("img",{src:e.icon,alt:"",width:t,height:t}):(0,O.jsx)("span",{children:e.tokenSymbol.slice(0,1)})}function Al({open:e,status:t,positions:n,initialPoolAddress:o,walletAddress:r,txHash:i,error:a,copied:s=!1,estimateWithdraw:l,onClose:c,onConfirm:m,onCopyHash:g,trackFunnel:w,nativeSymbol:p}){let[y,b]=ot.useState(null),[x,h]=ot.useState("idle"),v=ot.useRef(0),f=ot.useRef(void 0),T=ot.useRef(null);ot.useEffect(()=>()=>clearTimeout(f.current),[]);let k=ot.useMemo(()=>{let Z=o?.toLowerCase();return n.find(E=>E.poolAddress.toLowerCase()===Z)??n[0]??null},[n,o]),C=ot.useMemo(()=>{try{return BigInt(k?.depositedRaw??"0")}catch{return 0n}},[k?.depositedRaw]),_=k?.decimals??18;ot.useEffect(()=>{!e||!k||w?.("position_selected")},[e,k,w]);let N=ot.useCallback(()=>{b(null),h(l?"idle":"unavailable"),v.current+=1,T.current=null},[]);if(ot.useEffect(()=>{e&&N()},[e,N]),ot.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(f.current);return}if(!l||!k){clearTimeout(f.current),h("unavailable");return}if(C<=0n){clearTimeout(f.current),v.current+=1,T.current=null,b(null),h("idle");return}let Z=`${k.poolAddress.toLowerCase()}:${C.toString()}`;if(T.current===Z)return;T.current=Z,clearTimeout(f.current);let E=v.current+1;v.current=E,h("loading"),f.current=setTimeout(()=>{l(k,C).then(P=>{v.current===E&&(b(P??null),h(P?"ready":"unavailable"))}).catch(()=>{v.current===E&&(b(null),h("error"))})},Du)},[e,t,C,l,k]),!e||!k)return null;let I=t==="submitting",z=ro(y?.maxPriorityFeePerGas),F=ro(y?.maxFeePerGas??y?.gasPrice),j=_r(y?.gasLimit),L=Xt(k.depositedRaw,_);return(0,O.jsx)("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:Z=>{Z.target===Z.currentTarget&&!I&&c()},children:(0,O.jsxs)("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-withdraw-title","aria-label":"Withdraw","data-status":t,"data-vaul-no-drag":!0,children:[(0,O.jsx)("div",{className:"wp-claim-grabber","aria-hidden":!0,children:(0,O.jsx)("span",{})}),(0,O.jsxs)("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:(0,O.jsx)(Br,{})}),(0,O.jsxs)("div",{className:"wp-claim-copy",children:[(0,O.jsx)("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),(0,O.jsx)("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),(0,O.jsx)("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:(0,O.jsxs)("div",{className:"wp-claim-list-item",children:[(0,O.jsx)("span",{children:"Tx Hash"}),(0,O.jsxs)("button",{type:"button",className:"wp-claim-hash",onClick:g,"aria-label":"Copy transaction hash","data-track":"withdraw_hash_copy",children:[(0,O.jsx)("strong",{children:Ir(i)}),s?(0,O.jsx)(Fr,{}):(0,O.jsx)(Ar,{})]})]})})]}):(0,O.jsxs)(O.Fragment,{children:[t==="error"&&(0,O.jsxs)("div",{className:"wp-claim-heading",children:[(0,O.jsx)("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),(0,O.jsx)("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),(0,O.jsxs)("div",{className:"wp-claim-reward-card","data-fit":Eo(k.tokenSymbol,L),"aria-label":"Deposited balance",children:[(0,O.jsx)("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:(0,O.jsx)(Wu,{position:k,size:28})}),(0,O.jsx)("strong",{className:"wp-claim-reward-symbol",children:k.tokenSymbol}),(0,O.jsx)("strong",{className:"wp-claim-reward-amount",children:L})]}),(0,O.jsxs)("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[(0,O.jsxs)("div",{className:"wp-claim-account-row",children:[(0,O.jsxs)("div",{className:"wp-claim-account",children:[(0,O.jsx)("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),(0,O.jsxs)("strong",{children:[k.tokenSymbol," Pool"]})]}),(0,O.jsx)("span",{children:Er(r)})]}),(0,O.jsx)("span",{className:"wp-claim-divider","aria-hidden":!0}),(0,O.jsxs)("div",{className:"wp-claim-detail-list",children:[(0,O.jsxs)("div",{className:"wp-claim-detail-row",children:[(0,O.jsx)("span",{children:"Est. Tx Fee"}),(0,O.jsx)("strong",{children:Ou(y,x,p)})]}),(0,O.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,O.jsx)("span",{children:"Priority Fee Per Gas"}),(0,O.jsx)("strong",{children:Wi(z,"Gwei",x)})]}),(0,O.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,O.jsx)("span",{children:"Max Fee Per Gas"}),(0,O.jsx)("strong",{children:Wi(F,"Gwei",x)})]}),(0,O.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,O.jsx)("span",{children:"Gas Limit"}),(0,O.jsx)("strong",{children:Wi(j,"",x)})]})]})]})]}),(0,O.jsxs)("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&(0,O.jsx)("button",{type:"button",className:"wp-claim-secondary","data-track":"withdraw_cancel",onClick:c,children:t==="error"?"Close":"Cancel"}),(0,O.jsxs)("button",{type:"button",className:"wp-claim-primary","data-track":"withdraw_confirm",onClick:()=>{if(t==="success"){c();return}k&&C>0n&&m(k,C,y)},disabled:I||(t==="confirm"||t==="error")&&C<=0n,children:[t==="success"&&"Done",t==="submitting"&&(0,O.jsx)("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),(0,O.jsx)("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:(0,O.jsx)("span",{})})]})})}var We=H(require("react"),1),Dl=require("@tanstack/react-query");var Fl=require("@tanstack/react-query");var Uu="wp:reward-factory-info";function Bl(e,t=!0){let{data:n,...o}=(0,Fl.useQuery)({queryKey:[Uu,e],queryFn:async({signal:r})=>{let i=await pe("gameReward",e),a=await fetch(`${i}/v1/factory/info`,{cache:"no-store",signal:r});if(!a.ok)throw new Error(`Factory info fetch failed: ${a.status}`);let s=await a.json();if(s.code!==200)throw new Error(`Factory info API error: ${s.code}`);return s},enabled:t,staleTime:0});return{factoryInfo:n?.data??null,routerAddress:n?.data.router_address??"",...o}}var Gu="wp:";function Ml(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Ol(e){let{env:t,walletAddress:n,sendTransaction:o,estimateGas:r}=Oe(),i=!!n,a=!!o,s=(0,Dl.useQueryClient)(),{routerAddress:l}=Bl(t,i&&a),c=Ml(l),[m,g]=We.useState(!1),[w,p]=We.useState(void 0),[y,b]=We.useState("confirm"),[x,h]=We.useState(),[v,f]=We.useState(""),[T,k]=We.useState(!1),C=We.useRef(void 0);We.useEffect(()=>()=>clearTimeout(C.current),[]);let _=We.useRef(new Set),N=We.useCallback((P,ae)=>{_.current.has(P)||(_.current.add(P),Pe("withdraw",P,{...ae,tags:{section:e,...ae?.tags}}))},[e]),I=We.useCallback((P,ae)=>c?{to:c,value:0n,data:dl(P,ae),chainId:Me[t].cross}:null,[t,c]),z=We.useCallback(()=>{s.invalidateQueries({predicate:P=>typeof P.queryKey[0]=="string"&&P.queryKey[0].startsWith(Gu)})},[s]),F=We.useCallback(P=>{p(P),g(!0),b("confirm"),h(void 0),f(""),k(!1),_.current=new Set,N("opened")},[N]),j=We.useCallback(()=>{y!=="submitting"&&(g(!1),p(void 0),b("confirm"),h(void 0),f(""),k(!1),y==="success"&&z())},[y,z]),L=We.useCallback(async(P,ae)=>{if(!r)return null;let Q=I(P.poolId,ae),B=Ml(n);return!Q||!B?null:r({...Q,from:B})},[I,r,n]),Z=We.useCallback(async()=>{if(!(!x||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(x),k(!0),clearTimeout(C.current),C.current=setTimeout(()=>k(!1),1400)}catch{k(!1)}},[x]),E=We.useCallback(async(P,ae,Q)=>{if(!o){b("error"),f("Withdraw is not available for this wallet.");return}if(!c){b("error"),f("Withdraw contract address is not available.");return}try{b("submitting"),f("");let B=I(P.poolId,ae);if(!B){b("error"),f("Withdraw contract address is not available.");return}N("submitted");let ue=await o({...B,gas:Q?.gasLimit&&Q.gasLimit>0n?Q.gasLimit:void 0,maxFeePerGas:Q?.maxFeePerGas&&Q.maxFeePerGas>0n?Q.maxFeePerGas:void 0,maxPriorityFeePerGas:Q?.maxPriorityFeePerGas&&Q.maxPriorityFeePerGas>0n?Q.maxPriorityFeePerGas:void 0});h(ue),b("success"),N("confirmed"),z()}catch(B){b("error"),f(Io(B,"Failed to request withdraw.")),N("confirmed",{status:"failure",reason:wt(B)})}},[I,z,c,o,N]);return{canWithdrawInline:a,isOpen:m,initialPoolAddress:w,status:y,txHash:x,error:v,copied:T,hasEstimator:!!r,openWithdraw:F,closeWithdraw:j,estimateWithdraw:L,confirmWithdraw:E,copyHash:Z,trackFunnelOnce:N}}var ve=require("react/jsx-runtime"),zu="ONEpoints";function Ul(){let{env:e,walletAddress:t,onOutlink:n}=Oe(),o=Ft(),r=!!t,{getTokenImage:i,getNativeToken:a}=Jt(e,r),s=Ol("points"),{positions:l,isLoading:c}=Ll(e,t,r),m=Wl.useMemo(()=>l.filter(p=>p.poolType!=="CrossPool").map(p=>({...p,icon:i(p.tokenAddress,p.tokenSymbol)})),[l,i]),g=`${Bt[e]}/point.png`,w=yl[e];return(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(Mt,{sectionKey:"points",title:zu,icon:g,isEmpty:m.length===0,loading:c,children:m.map(p=>{let y=p.price?kn(p.depositedRaw,p.decimals,p.price,o):null;return(0,ve.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,ve.jsxs)("div",{className:"wp-item-body",children:[(0,ve.jsxs)("div",{className:"wp-item-line",children:[(0,ve.jsx)("span",{className:"wp-item-label",children:"Token"}),(0,ve.jsxs)("div",{className:"wp-svc-token",children:[p.icon&&(0,ve.jsx)("img",{className:"wp-svc-token-icon",src:p.icon,alt:""}),(0,ve.jsx)("span",{children:p.tokenSymbol})]})]}),(0,ve.jsxs)("div",{className:"wp-item-line",children:[(0,ve.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,ve.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[p.icon&&(0,ve.jsx)("img",{className:"wp-svc-token-icon",src:p.icon,alt:""}),(0,ve.jsxs)("div",{className:"wp-svc-amount",children:[(0,ve.jsx)("span",{className:"wp-svc-amount-main",children:Xt(p.depositedRaw,p.decimals)}),y&&(0,ve.jsx)("span",{className:"wp-item-usd",children:y})]})]})]})]}),(0,ve.jsx)("div",{className:"wp-item-tags",children:s.canWithdrawInline?(0,ve.jsx)("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"points_withdraw_open",onClick:()=>s.openWithdraw(p.poolAddress),children:(0,ve.jsx)("span",{className:"wp-tag-label",children:"Withdraw"})}):(0,ve.jsxs)("a",{className:"wp-tag wp-tag--muted",href:w,target:"_blank",rel:"noopener noreferrer","data-track":"points_withdraw_open",onClick:b=>Ve(b,w,{category:"portfolio",origin:"portfolio-points",payload:{position:p}},n),children:[(0,ve.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,ve.jsx)(Et,{size:12,className:"wp-tag-icon"})]})})]},p.poolAddress)})}),(0,ve.jsx)(Al,{open:s.isOpen,status:s.status,positions:m,initialPoolAddress:s.initialPoolAddress,walletAddress:t,txHash:s.txHash,error:s.error,copied:s.copied,estimateWithdraw:s.hasEstimator?s.estimateWithdraw:void 0,onClose:s.closeWithdraw,onConfirm:s.confirmWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce,nativeSymbol:a()?.symbol})]})}var Gi=H(require("react"),1);var Gl=require("@tanstack/react-query");var $u="wp:stake-info";function zl(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,Gl.useQuery)({queryKey:[$u,e,t],queryFn:async({signal:s})=>{let l=await pe("posa",e),c=await fetch(`${l}/stake/${t}`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Stake info fetch failed: ${c.status}`);let m=await c.json();if(m.code!==0&&m.code!==200)throw new Error(`Stake info API error: ${m.code}`);return m},enabled:o,staleTime:0});return{stakeInfo:r?.data,...i}}var $l=require("@tanstack/react-query");var Hu="wp:stake-rewards",ju=31;function Hl(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,$l.useQuery)({queryKey:[Hu,e,t],queryFn:async({signal:a})=>{let s=await pe("posa",e),l=await fetch(`${s}/rewards/${t}?limit=${ju}`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Stake rewards fetch failed: ${l.status}`);let c=await l.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake rewards API error: ${c.code}`);return c.data?.data??[]},enabled:o,staleTime:0});return{latestReward:r?.[0]??null,aprAccrued:cl(r),...i}}var jl=require("@tanstack/react-query"),Vu="wp:staking-onchain";function Vl(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...i}=(0,jl.useQuery)({queryKey:[Vu,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:o,staleTime:0});return{onchain:r,...i}}var Ui=require("react"),Yl=H(require("bignumber.js"),1);function ql(e){return e?.trim().toUpperCase()==="CROSS"}function Kl(e){return new Yl.default(e||"0").isGreaterThan(0)}function Wr(e,t,n=!0){let{allPools:o}=ao(e,n),r=(0,Ui.useMemo)(()=>{for(let c of o)for(let m of[c.deposit_token,...c.reward_tokens])if(ql(m?.symbol)&&Kl(m.price))return m.price},[o]),i=n&&r===void 0,{tokens:a}=un(e,t,i),{statsMap:s}=fn(e,i),l=Me[e].cross;return(0,Ui.useMemo)(()=>{if(r)return r;let c=a.find(m=>m.chainId===l&&ql(m.symbol));if(c){let m=s.get(At(c.chainId,c.address));if(m&&Kl(m.price))return m.price}return"0"},[r,a,s,l])}var gn=H(require("bignumber.js"),1),De=require("react/jsx-runtime");function qu(e){if(!e)return"\u2014";let t=new gn.default(e);return t.isFinite()?`${t.toFormat(2,gn.default.ROUND_DOWN)}%`:"\u2014"}function Ql(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=Oe(),r=Ft(),i=!!t,{stakeInfo:a,isLoading:s}=zl(e,t,i),{latestReward:l,aprAccrued:c,isLoading:m}=Hl(e,t,i),{onchain:g}=Vl(t,o,i),w=Wr(e,t,i),{getNativeToken:p}=Jt(e,i),y=p()?.symbol,b="ONEstaking",x=`${Bt[e]}/cross-staking.png`,h=kl[e],v=a?.total_stake??"0",f=Gi.useMemo(()=>g?new gn.default(g.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??a?.rewards_earned??"0",[g,l,a]),T=Gi.useMemo(()=>g?new gn.default(g.stakedWei.toString()).shiftedBy(-18):new gn.default(v),[g,v]),k=c!==void 0?new gn.default(c):void 0,C=a?.days_since_first_stake,_=k!==void 0&&k.isFinite()&&T.isGreaterThan(0)&&C!==null&&C!==void 0?k.div(T).times(365).div(Math.max(1,C)).times(100):void 0,N=!(new gn.default(v).isZero()&&new gn.default(f).isZero()),I=kn(v,0,w,r),z=kn(f,0,w,r);return(0,De.jsx)(Mt,{sectionKey:"staking",title:b,icon:x,iconFit:"contain",isEmpty:!N,loading:s||m,children:(0,De.jsxs)("article",{className:"wp-item","data-side":"stake",children:[(0,De.jsxs)("div",{className:"wp-item-body",children:[(0,De.jsxs)("div",{className:"wp-item-line",children:[(0,De.jsx)("span",{className:"wp-item-label",children:"Staked"}),(0,De.jsxs)("div",{className:"wp-svc-amount",children:[(0,De.jsx)("span",{className:"wp-svc-amount-main",children:`${Ai(v)} ${y??""}`.trim()}),I&&(0,De.jsx)("span",{className:"wp-item-usd",children:I})]})]}),(0,De.jsxs)("div",{className:"wp-item-line",children:[(0,De.jsx)("span",{className:"wp-item-label",children:"Rewards Earned"}),(0,De.jsxs)("div",{className:"wp-svc-amount",children:[(0,De.jsx)("span",{className:"wp-svc-amount-main",children:`${Ai(f)} ${y??""}`.trim()}),z&&(0,De.jsx)("span",{className:"wp-item-usd",children:z})]})]}),(0,De.jsxs)("div",{className:"wp-item-line",children:[(0,De.jsx)("span",{className:"wp-item-label",children:"My APR"}),(0,De.jsx)("span",{children:qu(_?.toString(10))})]})]}),(0,De.jsx)("div",{className:"wp-item-tags",children:(0,De.jsxs)("a",{className:"wp-tag wp-tag--mint",href:h,target:"_blank",rel:"noopener noreferrer","data-track":"stake_outlink",onClick:F=>Ve(F,h,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a}},n),children:[(0,De.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,De.jsx)(Et,{size:12,className:"wp-tag-icon"})]})})]})})}var zi=H(require("react"),1);var Zl=require("@tanstack/react-query");var Ku="wp:game-swap-pools";function Xl(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,Zl.useQuery)({queryKey:[Ku,e,t],queryFn:async({signal:a})=>{let s=await pe("gameSwap",e),l=await fetch(`${s}/addresses/${t}/portfolio`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Game-swap portfolio fetch failed: ${l.status}`);return(await l.json()).pools??[]},enabled:o,staleTime:0});return{pools:r??[],...i}}var Jl=require("@tanstack/react-query");var Yu="wp:game-swap-lp-balances";function ec(e,t,n,o){let r=[...n].map(l=>l.toLowerCase()).sort(),i=!!t&&r.length>0,{data:a,...s}=(0,Jl.useQuery)({queryKey:[Yu,e,t,r,!!o],queryFn:async({signal:l})=>{let c=o?await o(r):await _l(e,t,r,l),m={};for(let[g,w]of Object.entries(c))m[g.toLowerCase()]=w;return m},enabled:i,staleTime:0});return{balances:a??{},...s}}var en=H(require("bignumber.js"),1),Te=require("react/jsx-runtime"),Qu="Gametoken LP",nc=18,Zu=new en.default("0.0001");function tc(e){return e?.trim().toUpperCase()==="CROSS"}function Xu(e){return e&&e>0?e:nc}function Ju(e){let t=tc(e.token_a?.symbol)&&!tc(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=Xu(t?e.token_a?.decimals:e.token_b?.decimals),r=new en.default(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new en.default(0):r.times(2)}function ef(e,t,n,o){let r=e.token_a?.symbol?.trim()||"TOKEN",i=e.token_b?.symbol?.trim()||o||"?",a=t?.decimals??nc,s,l;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let c=new en.default(t.balance.toString()),m=new en.default(t.totalSupply.toString()),g=c.div(m);s=g.times(100);let w=g.times(Ju(e));if(w.isGreaterThan(0)){let p=new en.default(e.quote_usd??e.cross_usd??"0");l=p.isGreaterThan(0)?On(w.times(p),n):`${w.toFormat(4,en.default.ROUND_DOWN)} ${o??""}`.trim()}}return{pool:e,tokenASymbol:r,tokenBSymbol:i,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:a,sharePercent:s,valueText:l}}function oc(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=Oe(),r=Ft(),i=!!t,{pools:a,isLoading:s}=Xl(e,t,i),l=zi.useMemo(()=>a.map(h=>h.pair_address).filter(Boolean),[a]),{balances:c,isLoading:m}=ec(e,t,l,o),{getNativeToken:g}=Jt(e,i),w=g()?.symbol,p=`${Bt[e]}/game-token.png`,y=Object.keys(c).length>0,b=zi.useMemo(()=>{let h=a.map(v=>ef(v,c[v.pair_address?.toLowerCase()],r,w));return y?h.filter(v=>v.lpAmountRaw?new en.default(v.lpAmountRaw).shiftedBy(-v.lpDecimals).isGreaterThanOrEqualTo(Zu):!1):h},[a,c,y,r,w]),x=h=>{let v=h.token_a?.address??h.pair_address;return`${Sl[e]}/gametoken/tokens/${v}?trade=deposit`};return(0,Te.jsx)(Mt,{sectionKey:"gameSwap",title:Qu,icon:p,iconFit:"contain",isEmpty:b.length===0,loading:s||m,children:b.map(h=>{let{pool:v}=h,f=x(v),T=`${h.tokenASymbol} / ${h.tokenBSymbol}`,k=v.token_a?.logo_url,C=v.token_b?.logo_url;return(0,Te.jsxs)("article",{className:"wp-item","data-side":"game-swap",children:[(0,Te.jsxs)("div",{className:"wp-item-body",children:[(0,Te.jsxs)("div",{className:"wp-item-line",children:[(0,Te.jsx)("span",{className:"wp-item-label",children:"Pool"}),(0,Te.jsxs)("div",{className:"wp-svc-token",children:[(0,Te.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[k&&(0,Te.jsx)("img",{className:"wp-svc-token-icon",src:k,alt:""}),C&&(0,Te.jsx)("img",{className:"wp-svc-token-icon",src:C,alt:""})]}),(0,Te.jsx)("span",{children:T})]})]}),h.lpAmountRaw!==void 0&&(0,Te.jsxs)("div",{className:"wp-item-line",children:[(0,Te.jsx)("span",{className:"wp-item-label",children:"My LP"}),(0,Te.jsxs)("span",{children:[Xt(h.lpAmountRaw,h.lpDecimals)," LP"]})]}),h.sharePercent!==void 0&&(0,Te.jsxs)("div",{className:"wp-item-line",children:[(0,Te.jsx)("span",{className:"wp-item-label",children:"Pool Share"}),(0,Te.jsxs)("span",{children:[h.sharePercent.toFormat(2,en.default.ROUND_DOWN),"%"]})]}),h.valueText!==void 0&&(0,Te.jsxs)("div",{className:"wp-item-line",children:[(0,Te.jsx)("span",{className:"wp-item-label",children:"Value"}),(0,Te.jsx)("span",{children:h.valueText})]})]}),(0,Te.jsx)("div",{className:"wp-item-tags",children:(0,Te.jsxs)("a",{className:"wp-tag wp-tag--mint",href:f,target:"_blank",rel:"noopener noreferrer","data-track":"gameswap_outlink","data-track-id":T,onClick:_=>Ve(_,f,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:v}},n),children:[(0,Te.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,Te.jsx)(Et,{size:12,className:"wp-tag-icon"})]})})]},v.pair_address)})})}var Sn=H(require("bignumber.js"),1),cc=require("react");var rc=require("@tanstack/react-query");var tf="wp:forge-pools";function ic(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,rc.useQuery)({queryKey:[tf,e,t],queryFn:async()=>{let s=await pe("bondingCurve",e),l=await fetch(`${s}/v1/users/${t}/pools`,{cache:"no-store"});if(!l.ok)throw new Error(`forge pools fetch failed: ${l.status}`);return(await l.json()).data?.items??[]},enabled:o,staleTime:0}),a=r??[];return{pools:a,isEmpty:a.length===0,...i}}var ac=require("@tanstack/react-query"),sc=require("react");var nf="wp:forge-token-detail";async function of(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function lc(e,t,n=!0){let o=(0,ac.useQueries)({queries:t.map(a=>({queryKey:[nf,e,a],queryFn:async()=>of(await pe("bondingCurve",e),a),enabled:n&&!!a,staleTime:3e4}))}),r=(0,sc.useMemo)(()=>{let a=new Map;for(let s=0;s<o.length;s++){let l=o[s]?.data,c=t[s];l&&c&&a.set(c.toLowerCase(),l)}return a},[o,t]),i=o.some(a=>a.isLoading);return{detailMap:r,isLoading:i}}var Ie=require("react/jsx-runtime"),rf="ONEforge",dc=18,af="https://contents.crosstoken.io/wallet/token/images/FT.png";function sf(e){if(!e||e==="0")return"0";let t=new Sn.default(e).shiftedBy(-dc);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Sn.default.ROUND_DOWN):t.toFormat(4,Sn.default.ROUND_DOWN)}function lf(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 cf(e,t,n,o){let r=new Sn.default(n||"0");if(!r.isGreaterThan(0))return null;let i=new Sn.default(e.total_supply||"0"),a=new Sn.default(e.lp_balance||"0"),s=new Sn.default(t?.reserve_b||"0").shiftedBy(-dc);if(!i.isGreaterThan(0)||!a.isGreaterThan(0)||!s.isGreaterThan(0))return null;let l=s.times(2),m=a.div(i).times(l).times(r);return m.isFinite()?On(m,o):null}function pc(){let{env:e,walletAddress:t,onOutlink:n}=Oe(),o=Ft(),r=!!t,{pools:i,isEmpty:a,isLoading:s}=ic(e,t,r),l=(0,cc.useMemo)(()=>i.map(p=>p.token.address),[i]),{detailMap:c}=lc(e,l,r&&l.length>0),m=Wr(e,t,r),g=p=>`${vl[e]}/forge/token/${p.token.address}`,w=`${Bt[e]}/forge.png`;return(0,Ie.jsx)(Mt,{sectionKey:"forge",title:rf,icon:w,iconFit:"contain",isEmpty:a,loading:s,children:i.map(p=>{let y=c.get(p.token.address.toLowerCase()),b=y?.image_url||y?.image||p.token.image||af,x=y?.symbol||p.token.symbol,h=g(p),v=cf(p,y,m,o);return(0,Ie.jsxs)("a",{className:"wp-item","data-side":"lp",href:h,target:"_blank",rel:"noopener noreferrer","data-track":"forge_outlink","data-track-id":x,onClick:f=>Ve(f,h,{category:"portfolio",origin:"portfolio-forge",payload:{pool:p,tokenDetail:y}},n),children:[(0,Ie.jsxs)("div",{className:"wp-item-body",children:[(0,Ie.jsxs)("div",{className:"wp-item-line",children:[(0,Ie.jsx)("span",{className:"wp-item-label",children:"Asset"}),(0,Ie.jsxs)("div",{className:"wp-svc-token",children:[(0,Ie.jsx)("img",{className:"wp-svc-token-icon",src:b,alt:""}),(0,Ie.jsx)("span",{children:x}),y?.name&&(0,Ie.jsx)("span",{className:"wp-token-subtle",children:y.name})]})]}),(0,Ie.jsxs)("div",{className:"wp-item-line",children:[(0,Ie.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,Ie.jsx)("div",{className:"wp-svc-token wp-svc-token--amount",children:(0,Ie.jsxs)("div",{className:"wp-svc-amount",children:[(0,Ie.jsx)("span",{className:"wp-svc-amount-main",children:sf(p.lp_balance)}),v&&(0,Ie.jsx)("span",{className:"wp-item-usd",children:v})]})})]}),(0,Ie.jsxs)("div",{className:"wp-item-line",children:[(0,Ie.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,Ie.jsx)("span",{className:"wp-line-value",children:lf(p.pool_ownership)})]})]}),(0,Ie.jsx)("div",{className:"wp-item-tags",children:(0,Ie.jsxs)("span",{className:"wp-tag wp-tag--muted",children:[(0,Ie.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,Ie.jsx)(Et,{size:12,className:"wp-tag-icon"})]})})]},p.pair_address)})})}var Vi=require("react"),Ec=H(require("bignumber.js"),1);var uc=require("@tanstack/react-query");var df="wp:crossd-positions";function pf(e){let t=e??{};return(t.positions??t.data?.positions??[]).filter(o=>{if(!o?.token_id||!o.liquidity)return!1;try{return BigInt(o.liquidity)>0n}catch{return!1}})}function fc(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,uc.useQuery)({queryKey:[df,e,t],queryFn:async()=>{let s=await fetch(`${Dr[e]}/api/v1/positions?owner=${t}`,{cache:"no-store"});if(!s.ok)throw new Error(`crossd positions fetch failed: ${s.status}`);return pf(await s.json())},enabled:o,staleTime:0}),a=r??[];return{positions:a,isEmpty:a.length===0,...i}}var mc=require("@tanstack/react-query"),gc=require("react");var uf="wp:crossd-position-details";function ff(e){let t=e??{},n=t.data??t;return n?.token_id||n?.pool?n:null}function hc(e,t,n=!0){let o=(0,mc.useQueries)({queries:t.map(i=>({queryKey:[uf,e,i],queryFn:async()=>{let a=await fetch(`${Dr[e]}/api/v1/positions/${i}`,{cache:"no-store"});if(!a.ok)throw new Error(`crossd position detail failed: ${a.status}`);return ff(await a.json())},enabled:n&&!!i,staleTime:6e4}))});return{detailMap:(0,gc.useMemo)(()=>{let i=new Map;return o.forEach((a,s)=>{let l=a.data,c=t[s];l&&c&&i.set(c,l)}),i},[o,t])}}var hn=H(require("react"),1);var U=require("react/jsx-runtime"),mf=300*1e3,bc="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function gf(e,t,n){if(t)return"Estimating...";if(!e)return"Wallet estimate";let o=e.maxFeePerGas??e.gasPrice;return!o||o<=0n||e.gasLimit<=0n?"Wallet estimate":`${Pr(e.gasLimit*o)} ${n??""}`.trim()}function $i(e,t,n){return n?"Estimating...":`${e} ${t}`.trim()}function wc({open:e,status:t,target:n,token0Icon:o,token1Icon:r,token0Symbol:i,token1Symbol:a,nativeSymbol:s,txHash:l,error:c,copied:m=!1,hasEstimator:g,prepareWithdraw:w,confirmWithdraw:p,onClose:y,onCopyHash:b,trackFunnel:x}){let[h,v]=hn.useState(null),[f,T]=hn.useState(null),k=hn.useRef(0);hn.useEffect(()=>{if(!e||!n)return;let te=++k.current;v(null),T(null),x?.("dialog_opened"),w().then(be=>{k.current===te&&(v(be),T(be?Date.now():null))})},[e,n]);let C=t==="submitting",_=t==="estimating"||t==="confirm"&&!h,N=hn.useCallback(async()=>{let te=h,be=!f||Date.now()-f>mf;if(!te||be){let Ne=++k.current;if(te=await w(),k.current!==Ne)return;v(te),T(te?Date.now():null)}te&&await p(te)},[h,f,w,p]);if(!e||!n)return null;let{position:I,detail:z}=n,F=z.pool?.token0,j=z.pool?.token1,L=i||F?.symbol||I.pool?.token0_symbol||"?",Z=a||j?.symbol||I.pool?.token1_symbol||"?",E=F?.decimals??18,P=j?.decimals??18,ae=o||F?.logo_url||bc,Q=r||j?.logo_url||bc,B=`${L}/${Z}`,ue=h?oo(h.expectedAmount0.toString(),E):null,ce=h?oo(h.expectedAmount1.toString(),P):null,V=ro(h?.estimate?.maxPriorityFeePerGas),D=ro(h?.estimate?.maxFeePerGas??h?.estimate?.gasPrice),X=_r(h?.estimate?.gasLimit);return(0,U.jsx)("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:te=>{te.target===te.currentTarget&&!C&&y()},children:(0,U.jsxs)("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-crossd-withdraw-title","aria-label":"Withdraw position","data-status":t,"data-vaul-no-drag":!0,children:[(0,U.jsx)("div",{className:"wp-claim-grabber","aria-hidden":!0,children:(0,U.jsx)("span",{})}),(0,U.jsxs)("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&l?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:(0,U.jsx)(Br,{})}),(0,U.jsxs)("div",{className:"wp-claim-copy",children:[(0,U.jsx)("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),(0,U.jsxs)("p",{className:"wp-claim-desc",children:["Your ",B," position withdrawal has been submitted. Balances will update shortly after the transaction settles."]})]}),(0,U.jsx)("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:(0,U.jsxs)("div",{className:"wp-claim-list-item",children:[(0,U.jsx)("span",{children:"Tx Hash"}),(0,U.jsxs)("button",{type:"button",className:"wp-claim-hash",onClick:b,"aria-label":"Copy transaction hash","data-track":"crossd_withdraw_hash_copy",children:[(0,U.jsx)("strong",{children:Ir(l)}),m?(0,U.jsx)(Fr,{}):(0,U.jsx)(Ar,{})]})]})})]}):(0,U.jsxs)(U.Fragment,{children:[t==="error"&&(0,U.jsxs)("div",{className:"wp-claim-heading",children:[(0,U.jsx)("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),(0,U.jsx)("p",{className:"wp-claim-error-message",children:c||"The withdraw request could not be completed."})]}),(0,U.jsxs)("div",{className:"wp-claim-reward-card","data-fit":Eo(L,ue??""),"aria-label":`Expected ${L}`,children:[(0,U.jsx)("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:(0,U.jsx)("img",{src:ae,alt:"",width:28,height:28})}),(0,U.jsx)("strong",{className:"wp-claim-reward-symbol",children:L}),(0,U.jsx)("strong",{className:"wp-claim-reward-amount",children:ue??"Estimating..."})]}),(0,U.jsxs)("div",{className:"wp-claim-reward-card","data-fit":Eo(Z,ce??""),"aria-label":`Expected ${Z}`,children:[(0,U.jsx)("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:(0,U.jsx)("img",{src:Q,alt:"",width:28,height:28})}),(0,U.jsx)("strong",{className:"wp-claim-reward-symbol",children:Z}),(0,U.jsx)("strong",{className:"wp-claim-reward-amount",children:ce??"Estimating..."})]}),g&&(0,U.jsx)("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:(0,U.jsxs)("div",{className:"wp-claim-detail-list",children:[(0,U.jsxs)("div",{className:"wp-claim-detail-row",children:[(0,U.jsx)("span",{children:"Est. Tx Fee"}),(0,U.jsx)("strong",{children:gf(h?.estimate,_,s)})]}),(0,U.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,U.jsx)("span",{children:"Priority Fee Per Gas"}),(0,U.jsx)("strong",{children:$i(V,"Gwei",_)})]}),(0,U.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,U.jsx)("span",{children:"Max Fee Per Gas"}),(0,U.jsx)("strong",{children:$i(D,"Gwei",_)})]}),(0,U.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,U.jsx)("span",{children:"Gas Limit"}),(0,U.jsx)("strong",{children:$i(X,"",_)})]})]})})]}),(0,U.jsxs)("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&(0,U.jsx)("button",{type:"button",className:"wp-claim-secondary","data-track":"crossd_withdraw_cancel",onClick:y,children:t==="error"?"Close":"Cancel"}),(0,U.jsx)("button",{type:"button",className:"wp-claim-primary","data-track":"crossd_withdraw_confirm",onClick:()=>{if(t==="success"){y();return}C||_||(x?.("confirm_clicked"),N())},disabled:C||_,children:t==="success"?"Done":C?(0,U.jsx)("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}):_?(0,U.jsx)("span",{className:"wp-claim-button-spinner","aria-label":"Estimating"}):t==="error"?"Retry":"Withdraw"})]})]}),(0,U.jsx)("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:(0,U.jsx)("span",{})})]})})}var Ae=H(require("react"),1),Rc=require("@tanstack/react-query");var hf="0x0c49ccbe",bf="0xfc6f7865",wf="0x49404b7c",xf="0xdf2ab5bb",yf="0xac9650d8",xc=(1n<<128n)-1n,vc=600n,vf=99n,kf=100n;function Hi(e){return e*vf/kf}function yc(e,t){return!!e&&!!t&&e.toLowerCase()===t.toLowerCase()}function xt(e,t){if(e<0n)throw new Error(`${t} must be non-negative`);let n=e.toString(16);if(n.length>64)throw new Error(`${t} exceeds uint256`);return n.padStart(64,"0")}function Ur(e,t){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`${t} is not a valid address`);return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function ji(e){return hf+xt(e.tokenId,"tokenId")+xt(e.liquidity,"liquidity")+xt(e.amount0Min,"amount0Min")+xt(e.amount1Min,"amount1Min")+xt(e.deadline,"deadline")}function Sf(e){return bf+xt(e.tokenId,"tokenId")+Ur(e.recipient,"recipient")+xt(e.amount0Max,"amount0Max")+xt(e.amount1Max,"amount1Max")}function Cf(e,t){return wf+xt(e,"amountMinimum")+Ur(t,"recipient")}function Rf(e,t,n){return xf+Ur(e,"token")+xt(t,"amountMinimum")+Ur(n,"recipient")}function Tf(e){if(e.length===0)throw new Error("multicall requires at least one call");let t=e.map(r=>{let i=r.replace(/^0x/,"");if(i.length%2!==0||!/^[0-9a-fA-F]*$/.test(i))throw new Error("multicall element must be valid hex bytes");let a=i.length%64===0?i:i.padEnd(i.length+(64-i.length%64),"0");return xt(BigInt(i.length/2),"callLength")+a.toLowerCase()}),n=BigInt(e.length)*32n,o=[];for(let r of t)o.push(xt(n,"callOffset")),n+=BigInt(r.length/2);return yf+xt(0x20n,"arrayOffset")+xt(BigInt(e.length),"arrayLength")+o.join("")+t.join("")}function kc(e){if(!e||e==="0x")return null;let t=e.replace(/^0x/,"");return t.length<128||!/^[0-9a-fA-F]+$/.test(t)?null:{amount0:BigInt(`0x${t.slice(0,64)}`),amount1:BigInt(`0x${t.slice(64,128)}`)}}function Sc(e){let t=yc(e.token0,e.wcrossAddress),n=yc(e.token1,e.wcrossAddress),o=t||n,r=[ji({tokenId:e.tokenId,liquidity:e.liquidity,amount0Min:e.amount0Min,amount1Min:e.amount1Min,deadline:e.deadline}),Sf({tokenId:e.tokenId,recipient:o?e.positionManagerAddress:e.owner,amount0Max:xc,amount1Max:xc})];return o&&(r.push(Cf(0n,e.owner)),r.push(Rf(t?e.token1:e.token0,0n,e.owner))),Tf(r)}async function Cc(e,t,n){let o;try{o=await Ao(e,n)}catch{o=void 0}if(!o)return null;let r=ji({tokenId:t.tokenId,liquidity:t.liquidity,amount0Min:0n,amount1Min:0n,deadline:t.deadline}),i=await mn(o,t.positionManager,r,n,t.owner);return kc(i)}var Nf="wp:",Ef=[1500,3e3,4500,6e3];function If(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Tc(){let{env:e,walletAddress:t,sendTransaction:n,estimateGas:o}=Oe(),r=!!n,i=(0,Rc.useQueryClient)(),[a,s]=Ae.useState(!1),[l,c]=Ae.useState(null),[m,g]=Ae.useState("confirm"),[w,p]=Ae.useState(),[y,b]=Ae.useState(""),[x,h]=Ae.useState(!1),[v,f]=Ae.useState(new Set),T=Ae.useRef(void 0),k=Ae.useRef([]),C=Ae.useRef(0);Ae.useEffect(()=>()=>{clearTimeout(T.current),k.current.forEach(clearTimeout)},[]);let _=Ae.useRef(new Set),N=Ae.useCallback((E,P)=>{_.current.has(E)||(_.current.add(E),Pe("withdraw",E,{...P,tags:{section:"crossdPool",...P?.tags}}))},[]),I=Ae.useCallback(()=>{let E=()=>i.invalidateQueries({predicate:P=>typeof P.queryKey[0]=="string"&&P.queryKey[0].startsWith(Nf)});E(),k.current.forEach(clearTimeout),k.current=Ef.map(P=>setTimeout(E,P))},[i]),z=Ae.useCallback(E=>{C.current+=1,c(E),s(!0),g("confirm"),p(void 0),b(""),h(!1),_.current=new Set,N("opened")},[N]),F=Ae.useCallback(()=>{m!=="submitting"&&(C.current+=1,s(!1),c(null),g("confirm"),p(void 0),b(""),h(!1))},[m]),j=Ae.useCallback(async()=>{let E=C.current,P=If(t),ae=l?.position.token_id,Q=l?.position.liquidity,B=l?.detail.pool?.token0?.address,ue=l?.detail.pool?.token1?.address;if(!P||!ae||!Q||!B||!ue)return g("error"),b("Position data is incomplete. Please refresh and retry."),null;try{g("estimating"),b("");let ce=BigInt(ae),V=BigInt(Q),D=BigInt(Math.floor(Date.now()/1e3))+vc,X=Rl[e],te=await Cc(e,{owner:P,positionManager:X,tokenId:ce,liquidity:V,deadline:D});if(C.current!==E)return null;if(!te)return g("error"),b("Failed to estimate withdrawal amounts. Please retry."),null;let be=Sc({tokenId:ce,liquidity:V,amount0Min:Hi(te.amount0),amount1Min:Hi(te.amount1),deadline:D,owner:P,positionManagerAddress:X,token0:B,token1:ue,wcrossAddress:Tl[e]}),Ne={to:X,value:0n,data:be,chainId:Me[e].cross},ne=null;if(o){try{ne=await o({...Ne,from:P})}catch{ne=null}if(C.current!==E)return null}return g("confirm"),{tx:Ne,estimate:ne,expectedAmount0:te.amount0,expectedAmount1:te.amount1}}catch(ce){return C.current!==E||(g("error"),b(Io(ce,"Failed to prepare withdraw."))),null}},[e,o,l,t]),L=Ae.useCallback(async E=>{if(!n){g("error"),b("Withdraw is not available for this wallet.");return}try{g("submitting"),b(""),N("submitted");let P=await n({...E.tx,gas:E.estimate?.gasLimit&&E.estimate.gasLimit>0n?E.estimate.gasLimit:void 0,maxFeePerGas:E.estimate?.maxFeePerGas&&E.estimate.maxFeePerGas>0n?E.estimate.maxFeePerGas:void 0,maxPriorityFeePerGas:E.estimate?.maxPriorityFeePerGas&&E.estimate.maxPriorityFeePerGas>0n?E.estimate.maxPriorityFeePerGas:void 0});p(P),g("success");let ae=l?.position.token_id;ae&&f(Q=>{let B=new Set(Q);return B.add(ae),B}),N("confirmed"),I()}catch(P){g("error"),b(Io(P,"Failed to request withdraw.")),N("confirmed",{status:"failure",reason:wt(P)})}},[I,n,l,N]),Z=Ae.useCallback(async()=>{if(!(!w||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(w),h(!0),clearTimeout(T.current),T.current=setTimeout(()=>h(!1),1400)}catch{h(!1)}},[w]);return{canWithdrawInline:r,isOpen:a,target:l,withdrawnTokenIds:v,status:m,txHash:w,error:y,copied:x,hasEstimator:!!o,openWithdraw:z,closeWithdraw:F,prepareWithdraw:j,confirmWithdraw:L,copyHash:Z,trackFunnelOnce:N}}var Re=require("react/jsx-runtime"),_f="ONEusd Pool",Nc="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Ic(){let{env:e,walletAddress:t,onOutlink:n}=Oe(),o=Ft(),r=!!t,{positions:i,isLoading:a}=fc(e,t,r),s=Tc(),l=(0,Vi.useMemo)(()=>i.filter(N=>!N.token_id||!s.withdrawnTokenIds.has(N.token_id)),[i,s.withdrawnTokenIds]),c=(0,Vi.useMemo)(()=>l.map(N=>N.token_id).filter(N=>!!N),[l]),{detailMap:m}=hc(e,c,r&&c.length>0),g=`${Cl[e]}/pool`,{getTokenImage:w,getTokenSymbol:p,getNativeToken:y}=Jt(e,r),b=w("","ONEUSD",{chainOnly:!0})||`${Bt[e]}/crossd.png`,x={chainOnly:!0},h=(N,I)=>{let z=Li(p(N?.address??"",N?.symbol??I,x));return z==="CROSS"?y()?.symbol??"?":z??"?"},v=(N,I)=>{let z=N?.symbol??I,F=Li(z);return F==="CROSS"?y()?.image||Nc:w(N?.address??"",F,x)||N?.logo_url||Nc},f=s.target?.detail.pool,T=v(f?.token0,s.target?.position.pool?.token0_symbol),k=v(f?.token1,s.target?.position.pool?.token1_symbol),C=h(f?.token0,s.target?.position.pool?.token0_symbol),_=h(f?.token1,s.target?.position.pool?.token1_symbol);return(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(Mt,{sectionKey:"crossdPool",title:_f,icon:b,iconFit:"contain",isEmpty:l.length===0,loading:a,children:l.map(N=>{let I=N.token_id?m.get(N.token_id):void 0,z=`${h(I?.pool?.token0,N.pool?.token0_symbol)}/${h(I?.pool?.token1,N.pool?.token1_symbol)}`,F=N.pool?.fee_tier_percentage,j=v(I?.pool?.token0,N.pool?.token0_symbol),L=v(I?.pool?.token1,N.pool?.token1_symbol),Z=On(new Ec.default(N.position_value_usd??"0"),o),E=s.canWithdrawInline&&!!I?.pool?.token0?.address&&!!I?.pool?.token1?.address;return(0,Re.jsxs)("article",{className:"wp-item","data-side":"crossd",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:"Pool"}),(0,Re.jsxs)("div",{className:"wp-svc-token",children:[(0,Re.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[(0,Re.jsx)("img",{className:"wp-svc-token-icon",src:j,alt:""}),(0,Re.jsx)("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),(0,Re.jsx)("span",{children:z}),F&&(0,Re.jsx)("span",{className:"wp-token-subtle",children:F})]})]}),(0,Re.jsxs)("div",{className:"wp-item-line",children:[(0,Re.jsx)("span",{className:"wp-item-label",children:"Position Value"}),(0,Re.jsx)("span",{className:"wp-line-value",children:Z})]})]}),(0,Re.jsx)("div",{className:"wp-item-tags",children:E?(0,Re.jsx)("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"crossd_pool_withdraw_open","data-track-id":z,onClick:()=>{I&&s.openWithdraw({position:N,detail:I})},children:(0,Re.jsx)("span",{className:"wp-tag-label",children:"Withdraw"})}):(0,Re.jsxs)("a",{className:"wp-tag wp-tag--muted",href:g,target:"_blank",rel:"noopener noreferrer","data-track":"crossd_pool_outlink","data-track-id":z,onClick:P=>Ve(P,g,{category:"portfolio",origin:"portfolio-crossd-pool",payload:{position:N,detail:I}},n),children:[(0,Re.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,Re.jsx)(Et,{size:12,className:"wp-tag-icon"})]})})]},N.token_id)})}),(0,Re.jsx)(wc,{open:s.isOpen,status:s.status,target:s.target,token0Icon:T,token1Icon:k,token0Symbol:C,token1Symbol:_,nativeSymbol:y()?.symbol,txHash:s.txHash,error:s.error,copied:s.copied,hasEstimator:s.hasEstimator,prepareWithdraw:s.prepareWithdraw,confirmWithdraw:s.confirmWithdraw,onClose:s.closeWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce})]})}var Bo=["rewards","points","staking","gameSwap","forge","crossdPool"];ie(`.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-system-orange-default, #f0640d);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-system-orange-lowest, #2e2820);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--wp-claim-primary-text: #ffffff;--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-system-orange-default, #f0640d);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-system-orange-low, #fff5ee);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--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-item[data-side=reward] .wp-svc-token-icon{border-radius:0;object-fit:contain}.wp-svc-token--amount{align-items:flex-start}.wp-svc-token--amount>.wp-svc-token-icon{margin-top:2.5px}.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-body-inner[data-empty]{min-height:100%;box-sizing:border-box;justify-content:center}.wp-portfolio-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:280px;padding:32px 24px;text-align:center}.wp-portfolio-empty-icon{display:flex;align-items:center;justify-content:center;width:56px;height:56px;margin-bottom:6px;border-radius:50%;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);color:var(--wp-text-30)}.wp-portfolio-empty-title{margin:0;font-size:15px;font-weight:600;line-height:1.3;color:var(--wp-text-60)}.wp-portfolio-empty-desc{margin:0;font-size:13px;font-weight:400;line-height:1.4;color:var(--wp-text-30)}.wp-portfolio-loading{display:flex;align-items:center;justify-content:center;min-height:280px;padding:32px 24px}.wp-portfolio-spinner{width:22px;height:22px;border:2px solid var(--wp-border);border-top-color:var(--wp-mint);border-radius:50%;animation:wp-claim-spin .8s linear infinite}.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-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}}.wi-popover-content .wp-claim-sheet{min-height:min(600px,calc(100% - 24px))}.wi-popover-content .wp-claim-content{flex:1 1 auto}.wi-popover-content .wp-claim-actions{margin-top:auto}.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:6px;width:100%;min-height:60px;padding:16px 8px;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-reward-card[data-fit=sm] .wp-claim-reward-symbol{font-size:14px}.wp-claim-reward-card[data-fit=sm] .wp-claim-reward-amount{font-size:16px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-symbol{font-size:12px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-amount{font-size:13px}.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}.wp-withdraw-amount-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-withdraw-amount-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-input{flex:1 1 auto;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);font-family:inherit;font-size:24px;font-weight:600;line-height:1.3;letter-spacing:0;text-align:left;outline:none}.wp-withdraw-input::placeholder{color:var(--wp-text-30)}.wp-withdraw-input[aria-invalid=true]{color:var(--wp-claim-error)}.wp-withdraw-input-symbol{flex-shrink:0;color:var(--wp-text-40);font-size:15px;font-weight:600;line-height:1.3}.wp-withdraw-quick-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-quick{appearance:none;flex:1 1 0;min-width:0;height:32px;padding:0 10px;border:1px solid var(--wp-border);border-radius:999px;background:transparent;color:var(--wp-text-60);font-family:inherit;font-size:13px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer}.wp-withdraw-quick:hover:not(:disabled){border-color:var(--wp-claim-primary);color:var(--wp-claim-primary)}.wp-withdraw-quick:disabled{cursor:default;opacity:.5}.wp-withdraw-content{overflow-y:auto}.wp-withdraw-token-list{display:flex;flex-direction:column;gap:8px;width:100%;max-height:216px;overflow-y:auto}.wp-withdraw-token{appearance:none;display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:10px 12px;border:1px solid var(--wp-border);border-radius:8px;background:var(--wp-card);color:var(--wp-text);font-family:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.wp-withdraw-token[data-selected]{border-color:var(--wp-claim-primary);box-shadow:inset 0 0 0 1px var(--wp-claim-primary)}.wp-withdraw-token:disabled{cursor:default;opacity:.6}.wp-withdraw-token-icon{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-withdraw-token-icon img{width:28px;height:28px;object-fit:cover}.wp-withdraw-token-icon 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-withdraw-token-symbol{flex:1 1 auto;min-width:0;overflow:hidden;font-size:15px;font-weight:600;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.wp-withdraw-token-amount{flex-shrink:0;color:var(--wp-text-40);font-size:13px;font-weight:500;line-height:1.3;white-space:nowrap}
9
- `);var ee=require("react/jsx-runtime"),qi=15,Pf="wp:";function Un({env:e,theme:t="light",walletAddress:n,walletName:o,onBack:r,showHeader:i=!0,variant:a="embed",className:s,onOutlink:l,lpBalanceReader:c,stakingRewardsReader:m,sendTransaction:g,estimateGas:w,conversionRatio:p,currencySymbol:y,sections:b}){let x=je(e),h=Ue.useCallback(ne=>!b||b.includes(ne),[b]),v=!!n,f=(0,_c.useQueryClient)(),[T,k]=Ue.useState({}),C=Ue.useCallback((ne,xe)=>{k(ze=>{let Ke=ze[ne];return Ke&&Ke.loading===xe.loading&&Ke.empty===xe.empty?ze:{...ze,[ne]:xe}})},[]),_=Ue.useCallback(ne=>{k(xe=>{if(!(ne in xe))return xe;let ze={...xe};return delete ze[ne],ze})},[]),N=Ue.useMemo(()=>({report:C,unregister:_}),[C,_]),[I,z]=Ue.useState(qi),[F,j]=Ue.useState(!1),[L,Z]=Ue.useState(!1),E=Ue.useRef(void 0),P=Ue.useCallback(()=>{f.invalidateQueries({predicate:ne=>typeof ne.queryKey[0]=="string"&&ne.queryKey[0].startsWith(Pf)})},[f]),ae=Ue.useCallback(()=>{P(),j(!0),setTimeout(()=>j(!1),600),z(qi)},[P]);Ue.useEffect(()=>{if(!v)return;let ne=setInterval(()=>{z(xe=>xe<=1?(ae(),qi):xe-1)},1e3);return()=>clearInterval(ne)},[v,ae]);let Q=Ue.useCallback(()=>{r?.()},[r]),B=v?pn(x,n,{size:64}):void 0,ue=Ue.useCallback(async()=>{if(!(L||!n))try{await navigator.clipboard.writeText(n),Z(!0),clearTimeout(E.current),E.current=setTimeout(()=>Z(!1),2e3)}catch{}},[n,L]);Ue.useEffect(()=>()=>clearTimeout(E.current),[]);let ce=Ue.useMemo(()=>({env:x,theme:t,open:!0,walletAddress:n,close:Q,onOutlink:l,lpBalanceReader:c,stakingRewardsReader:m,sendTransaction:g,estimateGas:w,conversionRatio:p,currencySymbol:y}),[x,t,n,Q,l,c,m,g,w,p,y]),V=Bo.filter(h),D=V.length>0&&V.every(ne=>{let xe=T[ne];return!!xe&&!xe.loading}),X=D&&V.every(ne=>T[ne]?.empty),te=V.some(ne=>{let xe=T[ne];return!!xe&&!xe.empty}),be=V.length>0&&!D&&!te,Ne=(0,ee.jsxs)(ee.Fragment,{children:[i&&(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","data-track":"back",onClick:r,children:(0,ee.jsx)(ml,{})}),(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:ue,"aria-label":"Copy wallet address","data-track":"address_copy",children:[(0,ee.jsx)("span",{className:"wp-header-address",children:Er(n)}),(0,ee.jsx)("span",{className:"wp-header-address-copy","data-copied":L,children:L?(0,ee.jsx)(cn,{size:14}):(0,ee.jsx)(An,{size:14})})]})]})]}),(0,ee.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio","data-track":"refresh",onClick:ae,children:[(0,ee.jsx)(gl,{className:F?"wp-spin-once":void 0}),v&&(0,ee.jsx)("span",{className:"wp-refresh-badge",children:I})]})]}),(0,ee.jsx)("div",{className:"wp-body",children:(0,ee.jsxs)("div",{className:"wp-body-inner","data-empty":X||void 0,children:[h("rewards")&&(0,ee.jsx)(Il,{}),h("points")&&(0,ee.jsx)(Ul,{}),h("staking")&&(0,ee.jsx)(Ql,{}),h("gameSwap")&&(0,ee.jsx)(oc,{}),h("forge")&&(0,ee.jsx)(pc,{}),h("crossdPool")&&(0,ee.jsx)(Ic,{}),be&&(0,ee.jsx)("div",{className:"wp-portfolio-loading",role:"status","aria-label":"Loading portfolio",children:(0,ee.jsx)("span",{className:"wp-portfolio-spinner","aria-hidden":!0})}),X&&(0,ee.jsxs)("div",{className:"wp-portfolio-empty",role:"status",children:[(0,ee.jsx)("span",{className:"wp-portfolio-empty-icon","aria-hidden":!0,children:(0,ee.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ee.jsx)("path",{d:"M20 7H5a2 2 0 0 1-2-2 2 2 0 0 1 2-2h13v4"}),(0,ee.jsx)("path",{d:"M3 5v13a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1"}),(0,ee.jsx)("circle",{cx:"16.5",cy:"13.5",r:"1",fill:"currentColor",stroke:"none"})]})}),(0,ee.jsx)("p",{className:"wp-portfolio-empty-title",children:"No assets yet"}),(0,ee.jsx)("p",{className:"wp-portfolio-empty-desc",children:"Assets you hold across ONE services will appear here."})]})]})})]});return(0,ee.jsx)(Po.Provider,{value:ce,children:(0,ee.jsx)(Bi.Provider,{value:N,children:(0,ee.jsx)(Ce,{feature:"wallet_portfolio",children:a==="none"?Ne:(0,ee.jsx)("div",{className:ge(a==="fullscreen"?"wp-fullscreen":"wp-embed",s),"data-theme":t,children:Ne})})})})}var Gn=require("react/jsx-runtime");function Pc({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s}=Oe();return(0,Gn.jsxs)(Mo.Drawer.Portal,{children:[(0,Gn.jsx)(Mo.Drawer.Overlay,{className:"wp-overlay"}),(0,Gn.jsxs)(Mo.Drawer.Content,{className:ge("wp-fullscreen",e),"data-theme":n,children:[(0,Gn.jsx)(Mo.Drawer.Title,{className:"wp-sr-only",children:"Portfolio"}),(0,Gn.jsx)(Un,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s})]})]})}var Ki=require("react/jsx-runtime");function Lf({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:c,conversionRatio:m,currencySymbol:g,children:w}){let p=je(e),y=o!==void 0,[b,x]=zn.useState(!1),h=y?o:b,v=zn.useCallback(k=>{y||x(k),r?.(k)},[y,r]),f=zn.useCallback(()=>v(!1),[v]),T=zn.useMemo(()=>({env:p,theme:t,open:h,walletAddress:n,close:f,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:c,conversionRatio:m,currencySymbol:g}),[p,t,h,n,f,i,a,s,l,c,m,g]);return(0,Ki.jsx)(Po.Provider,{value:T,children:(0,Ki.jsx)(Lc.Drawer.Root,{direction:"bottom",open:h,onOpenChange:v,noBodyStyles:!0,children:w})})}var Yi=Object.assign(Lf,{Trigger:ul,Content:Pc});var G=H(require("react"),1),$n=require("react-dom"),Ht=H(require("bignumber.js"),1);var gt=require("react/jsx-runtime");function Ac({size:e=20,className:t}){return(0,gt.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,gt.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),(0,gt.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function Fc({size:e=16,className:t}){return(0,gt.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,gt.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 Bc({size:e=16,className:t}){return(0,gt.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,gt.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 Mc({size:e=20,className:t}){return(0,gt.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,gt.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 Dc({size:e=16,className:t}){return(0,gt.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,gt.jsx)("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function Oc({size:e=12,className:t}){return(0,gt.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,gt.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 M=H(require("react"),1);var Qi=H(require("bignumber.js"),1);function Wc(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Uc(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,Qi.default.ROUND_DOWN).toFixed()}function Af(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 Ff(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new Qi.default(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:Wc(t)&&Wc(n)?e.lastChangedBy==="to"?{fromAmount:Uc(r.multipliedBy(n).dividedBy(t))}:{toAmount:Uc(r.multipliedBy(t).dividedBy(n))}:Af(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function Gc({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):Ff(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}var zc=15,Bf=18,Vc="cross_bridge_terms_accepted",Mf=3600*24*365;function Df(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,zc);let r=t.slice(0,o).slice(0,zc),i=t.slice(o+1).slice(0,Bf);return`${r}.${i}`}function Of(){return typeof document>"u"?!1:document.cookie.split(";").map(e=>e.trim()).some(e=>e===`${Vc}=true`)}function Wf(){if(typeof document>"u")return;let e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=[`${Vc}=true`,"Path=/",`Max-Age=${Mf}`,"SameSite=Lax",e].filter(Boolean).join("; ")}function Uf(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 $c(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("CROSS")?t.slice(1):t}function Gf(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let n=new Set([$c(e.symbol),$c(t.symbol)]);return n.has("CROSS")&&n.has("CROSSD")}function $t(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Gr(e){return e[0]}function Zi(e,t,n,o){if(n&&!$t(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??Gr(e);let i=e.findIndex(s=>$t(s,t)),a=i>=0?e[i+1]:void 0;return a&&!$t(a,t)?a:e.find(s=>!$t(s,t))??t}function Hc({fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:i}){return{fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:i}}function zr(e,t=0){if(!e||t>5)return[];if(typeof e=="string")return[e];if(!(e instanceof Error)&&typeof e!="object")return[String(e)];let n=e;return[...[e instanceof Error?e.name:n.name,e instanceof Error?e.message:n.message,n.shortMessage,n.details,n.code].filter(r=>typeof r=="string"||typeof r=="number").map(String),...zr(n.cause,t+1),...zr(n.data,t+1),...zr(n.error,t+1)]}function Xi(e){let t=zr(e).join(" ").toLowerCase(),n=t.includes("signature_failed")&&(t.includes("\uD0C0\uC785 \uB370\uC774\uD130 \uC11C\uBA85\uC5D0 \uC2E4\uD328")||t.includes("typed data")||t.includes("signtypeddata"));return t.includes("4001")||t.includes("err_user_rejected")||t.includes("userrejectedrequesterror")||t.includes("user rejected")||t.includes("user denied")||t.includes("user cancelled")||t.includes("user canceled")||t.includes("rejected the request")||t.includes("request rejected")||t.includes("action_rejected")||t.includes("rejected by user")||n}function jc(e,t){return Xi(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
10
- `)[0]?.trim()||t}function qc(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:i,approveBridge:a,history:s=[],initialSlippage:l="1",termsUrl:c=to,getQuote:m,submitBridge:g,onSubmitted:w,onSuccess:p,onFailed:y,onExit:b}=e,x=M.useMemo(()=>Gc({getQuote:m,submitBridge:g}),[m,g]),[h,v]=M.useState("form"),[f,T]=M.useState(n??Gr(t)),[k,C]=M.useState(()=>Zi(t,n??Gr(t),o,r)),[_,N]=M.useState(""),[I,z]=M.useState(""),[F,j]=M.useState("from"),[L,Z]=M.useState(l),[E,P]=M.useState(null),ae=M.useMemo(()=>Gf(f,k),[f,k]),Q=M.useMemo(()=>ae?"1":L==="auto"?Uf(E?.priceImpact):L,[ae,L,E?.priceImpact]),[B,ue]=M.useState(""),[ce,V]=M.useState("idle"),[D,X]=M.useState(""),[te,be]=M.useState(null),[Ne,ne]=M.useState([]),[xe,ze]=M.useState(!1),[Ke,pt]=M.useState(Of),[de,Ze]=M.useState(null),[it,$e]=M.useState(!1),[at,Xe]=M.useState(null),[It,on]=M.useState(null),[bt,yt]=M.useState(!1),[vt,_t]=M.useState(!1),He=M.useRef(0),Dt=M.useRef(null),kt=M.useRef(!1),St=M.useRef(!1),rn=M.useRef(!1),Pt=M.useRef(!1),_e=M.useRef(!1);M.useEffect(()=>{kt.current||(kt.current=!0,Pe("bridge","opened"))},[]);let Je=M.useCallback(()=>{Dt.current&&(clearTimeout(Dt.current),Dt.current=null)},[]),Ct=M.useCallback(Y=>{Je(),on(Y)},[Je]);M.useEffect(()=>Je,[Je]),M.useEffect(()=>{let Y=t.find(Be=>$t(Be,f))??Gr(t),Se=Y?r?.(Y,t):void 0,J=Se?.find(Be=>$t(Be,k))??(Se?void 0:t.find(Be=>$t(Be,k)))??Zi(t,Y,void 0,r);T(Y),C(J)},[r,t,f,k]);let ut=M.useCallback((Y,Se)=>{let J=Df(Y);if(!J){He.current+=1,N(""),z(""),j(Se),P(null),ue(""),V("idle");return}Se==="from"?N(J):z(J),j(Se),ue(""),!rn.current&&Number(J)>0&&(rn.current=!0,Pe("bridge","amount_entered"))},[]),Ye=M.useCallback(()=>{He.current+=1,N(""),z(""),j("from"),P(null),ue(""),X(""),V("idle"),Ze(null),$e(!1),Xe(null),yt(!1),Ct(null)},[Ct]),Ot=M.useCallback(Y=>{$t(Y,f)||(St.current||(St.current=!0,Pe("bridge","token_selected",{tags:{item_id:`from:${Y.symbol}`}})),T(Y),C(Zi(t,Y,void 0,r)),Ye())},[f,r,Ye,t]),jt=M.useCallback(Y=>{$t(Y,k)||$t(Y,f)||(St.current||(St.current=!0,Pe("bridge","token_selected",{tags:{item_id:`to:${Y.symbol}`}})),C(Y),Ye())},[f,Ye,k]),et=M.useMemo(()=>f?r?.(f,t)??t.filter(Y=>!$t(Y,f)):[],[f,r,t]),Vt=M.useCallback(()=>{f?.balance&&ut(f.balance,"from")},[f?.balance,ut]),an=M.useCallback(()=>{!f||!k||(T(k),C(f),Ye())},[f,Ye,k]),sn=M.useCallback(()=>{He.current+=1,N(""),z(""),j("from"),P(null),ue(""),X("")},[]);M.useEffect(()=>{if(!f||!k)return;if(!_&&!I){P(null),ue(""),V(J=>J==="quoting"?"idle":J);return}let Y=++He.current,Se=Hc({fromToken:f,toToken:k,fromAmount:_,toAmount:I,lastChangedBy:F,slippage:L});V(J=>J==="submitting"?J:x.canQuote?"quoting":"idle"),(async()=>{try{let J=await x.getQuote(Se);if(He.current!==Y)return;J.fromAmount!==void 0&&F==="to"&&N(J.fromAmount),J.toAmount!==void 0&&F==="from"&&z(J.toAmount),P(J.summary??null),ue(J.error??"")}catch(J){if(He.current!==Y)return;ue(J instanceof Error?J.message:"Failed to quote bridge.")}finally{He.current===Y&&V(J=>J==="quoting"?"idle":J)}})()},[_,f,F,x,L,I,k]);let A=M.useCallback(()=>!f||!k?null:Hc({fromToken:f,toToken:k,fromAmount:_,toAmount:I,lastChangedBy:F,slippage:Q}),[Q,_,f,F,I,k]),re=M.useCallback(async(Y,Se)=>{X(""),yt(!1),$e(!1),V("submitting");try{if(!Se?.skipApprovalCheck&&i){let Be=await i(Y);if(Be){Ze(Be),Xe(Y),V("idle");return}}Ze(null),Xe(null),Ct("processing");let J=await x.submitBridge(Y);be(J),V("success"),ne(Be=>[{id:J.txHash,timestamp:new Date().toISOString(),txHash:J.txHash,fromToken:J.fromToken,toToken:J.toToken,fromAmount:J.fromAmount,toAmount:J.toAmount,summary:E??void 0,status:"pending"},...Be.filter(tt=>tt.txHash!==J.txHash)]),sn(),_t(!0),Ct(null),yt(!0),Pe("bridge","confirmed"),Pt.current=!1,_e.current=!1,w?.(J),p?.(J)}catch(J){if(Ct(null),Pe("bridge","confirmed",{status:"failure",reason:wt(J)}),Pt.current=!1,_e.current=!1,Xi(J)){V("idle");return}let Be=jc(J,"Failed to submit bridge.");X(Be),V("error"),y?.({message:Be})}},[i,y,w,p,x,sn,Ct,E]),Fe=M.useCallback(async()=>{if(B)return;let Y=A();if(Y){if(Pt.current||(Pt.current=!0,Pe("bridge","submitted")),!Ke){Xe(Y),ze(!0);return}await re(Y)}},[A,B,re,Ke]),Rt=M.useCallback(async()=>{let Y=at??A();Y&&(Wf(),pt(!0),ze(!1),await re(Y))},[A,at,re]),Tt=M.useCallback(()=>{ze(!1),Xe(null)},[]),qt=M.useCallback(async()=>{if(!(ce==="submitting"||!de||!at||!a)){X(""),V("submitting");try{await a(at,de),_e.current||(_e.current=!0,Pe("bridge","approved")),Ze(null),V("idle"),$e(!0)}catch(Y){if(Xi(Y)){V("idle");return}let Se=jc(Y,"Failed to approve token.");X(Se),V("error"),y?.({message:Se})}}},[de,a,y,at,re,ce]),Cn=M.useCallback(()=>{ce!=="submitting"&&(Ze(null),$e(!1),Xe(null),V("idle"))},[ce]),qn=M.useCallback(async()=>{if(ce==="submitting")return;let Y=at??A();if(!Y){$e(!1),X("Bridge input is no longer available. Please try again."),V("error");return}$e(!1),await re(Y,{skipApprovalCheck:!0})},[A,at,re,ce]),Yo=M.useCallback(()=>{yt(!1)},[]),ln=M.useCallback(Y=>{v(Y),Y==="history"&&_t(!1)},[]),Qo=M.useCallback(()=>{if(h==="history"){ln("form");return}b?.()},[b,ln,h]),oi=M.useMemo(()=>[...s,...Ne.filter(Y=>!s.some(Se=>Se.txHash===Y.txHash))],[s,Ne]);return{step:h,setStep:ln,status:ce,error:D,quoteError:B,fromToken:f,toToken:k,tokens:t,availableToTokens:et,fromAmount:_,toAmount:I,lastChangedBy:F,slippage:L,effectiveSlippage:Q,slippageLocked:ae,setSlippage:Z,summary:E,history:oi,submitted:te,canSubmit:x.canSubmit,termsOpen:xe,approvalInfo:de,approvalSuccessOpen:it,approveBridge:a,pendingSubmitInput:at,submitToast:It,successDialogOpen:bt,dismissSuccessDialog:Yo,hasNewHistory:vt,termsUrl:c,setFromToken:T,setToToken:C,selectFromToken:Ot,selectToToken:jt,setAmount:ut,setMax:Vt,swapTokens:an,submit:Fe,confirmTerms:Rt,cancelTerms:Tt,confirmApproval:qt,cancelApproval:Cn,continueAfterApproval:qn,back:Qo}}ie(`.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:20px minmax(0,1fr);align-items:center;column-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}.bf-terms-check-button{appearance:none;display:inline-flex;min-width:0;width:20px;height:20px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-copy{display:flex;width:100%;min-width:0;align-items:baseline;justify-content:space-between;column-gap:12px;row-gap:4px;flex-wrap:wrap}.bf-terms-label{min-width:0}.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}
11
- `);var d=require("react/jsx-runtime"),Jc=G.createContext(void 0);function so(){return G.useContext(Jc)}function zf(e){let[t,n]=G.useState(void 0);return G.useEffect(()=>{let o=e.current;if(!o)return;let r=()=>{let a=o.closest("[data-theme]");n(a?.getAttribute("data-theme")??void 0)};r();let i=new MutationObserver(r);return i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>i.disconnect()},[e]),t}var Kc=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],$f=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function Hf(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function Yc(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 jf(e){return`${e.chainId}:${e.address.toLowerCase()}`}function ed(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function Qc(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 Vf(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 qf(e,t){if(!t)return!1;let n=new Ht.default(e||"0"),o=new Ht.default(t.balance||"0");return!n.isFinite()||!o.isFinite()?!1:n.isGreaterThan(o)}function Kf(e){if(e.priceUsd===void 0)return null;let t=new Ht.default(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function Yf(e){if(e.priceUsd===void 0)return null;let t=new Ht.default(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function td(e){if(!e.isFinite()||e.isNaN())return"0";let n=e.decimalPlaces(6,Ht.default.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),i=new Ht.default(o||"0").toFormat(0);return r?`${i}.${r}`:i}function Qf(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function Zf(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 Xf(e){let t=new Ht.default(e||"0");return!t.isFinite()||t.isNaN()?e||"0":td(t)}function Jf(e,t){if(t?.priceUsd===void 0)return null;let n=new Ht.default(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function Hr(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function em(e,t){return t==="all"?!0:Hr(e)===t}function tm(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function Zc(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function nd(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function od(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":nd(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function rd(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function $r(e){return!e||e==="0"||Number(e)===0}function nm(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 om(e){let t=e.fromToken,n=e.toToken,o=od(t,n),r=e.fromAmount||"0",i=e.toAmount||"0",a=o!==void 0&&!rd(o),s=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:a?[{label:"Route",value:t&&n?`${Zc(t.chainId)} \u2192 ${Zc(n.chainId)}`:"-"},{label:"Validator Fee",value:$r(r)?"0":"Free",tone:$r(r)?"default":"accent"},{label:"Network Fee",value:$r(r)?"0":"Free",tone:$r(r)?"default":"accent"}]:void 0,swapInfo:s?[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:i,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 Do({token:e,size:t=20}){let n=e?.iconUrl;return(0,d.jsx)("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?(0,d.jsx)("img",{src:n,alt:"",width:t,height:t,draggable:!1}):(0,d.jsx)("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function Xc({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:i,locked:a=!1}){return(0,d.jsxs)("section",{className:"bf-amount-panel",children:[(0,d.jsxs)("div",{className:"bf-amount-head",children:[(0,d.jsx)("span",{children:e}),(0,d.jsxs)("span",{className:"bf-balance",children:[ed(t?.balance??"0")," ",t?.symbol??""]})]}),(0,d.jsxs)("div",{className:"bf-amount-main",children:[(0,d.jsxs)("label",{className:"bf-amount-input-wrap",children:[(0,d.jsxs)("span",{className:"bf-sr-only",children:[e," amount"]}),(0,d.jsx)("input",{type:"text",inputMode:"decimal",value:n,onChange:s=>r(s.target.value),placeholder:"0",className:"bf-amount-input"}),(0,d.jsx)("span",{className:"bf-amount-usd",children:o})]}),(0,d.jsxs)("button",{type:"button",className:"bf-token-pill",onClick:a?void 0:i,disabled:!a&&!i,"data-locked":a?"true":void 0,"data-track":a?void 0:"token_select_open","data-track-id":e.toLowerCase(),"aria-label":`Select ${e.toLowerCase()} token`,children:[(0,d.jsx)(Do,{token:t}),(0,d.jsx)("span",{children:t?.symbol??"Select"}),!a&&(0,d.jsx)(Fn,{size:16})]})]})]})}function rm({flow:e,side:t,onClose:n}){let o=G.useId(),[r,i]=G.useState(""),[a,s]=G.useState(null),l=so(),c=t==="from"?e.fromToken:e.toToken;G.useEffect(()=>{s(document.body)},[]),G.useEffect(()=>{let p=y=>{y.key==="Escape"&&n()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[n]);let m=G.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),g=G.useMemo(()=>{let p=r.trim().toLowerCase();return p?m.filter(y=>y.symbol.toLowerCase().includes(p)||y.name.toLowerCase().includes(p)):m},[r,m]),w=G.useCallback(p=>{t==="from"?e.selectFromToken(p):e.selectToToken(p),n()},[e,n,t]);return a?(0,$n.createPortal)((0,d.jsx)("div",{className:"bf-token-picker-overlay","data-theme":l,role:"presentation",onMouseDown:p=>{p.target===p.currentTarget&&n()},children:(0,d.jsxs)("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[(0,d.jsx)("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),(0,d.jsxs)("header",{className:"bf-token-picker-head",children:[(0,d.jsx)("h3",{id:o,children:"Select a token"}),(0,d.jsx)("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:(0,d.jsx)(Lt,{size:24})})]}),(0,d.jsxs)("label",{className:"bf-token-search",children:[(0,d.jsx)(Ac,{size:20}),(0,d.jsx)("span",{className:"bf-sr-only",children:"Search tokens"}),(0,d.jsx)("input",{value:r,onChange:p=>i(p.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),(0,d.jsxs)("div",{className:"bf-token-list",children:[g.map(p=>{let y=nd(p,c),b=y?Yf(p):Kf(p);return(0,d.jsxs)("button",{type:"button",className:"bf-token-row","data-selected":y?"true":"false",onClick:()=>w(p),children:[(0,d.jsxs)("span",{className:"bf-token-row-left",children:[(0,d.jsx)(Do,{token:p,size:40}),(0,d.jsxs)("span",{className:"bf-token-meta",children:[(0,d.jsx)("span",{className:"bf-token-symbol",children:p.symbol}),!y&&(0,d.jsx)("span",{className:"bf-token-name",children:p.name})]})]}),(0,d.jsxs)("span",{className:"bf-token-row-right",children:[(0,d.jsxs)("span",{className:"bf-token-balance",children:[ed(p.balance),y?null:` ${p.symbol}`]}),b&&(0,d.jsx)("span",{className:"bf-token-price",children:b})]})]},jf(p))}),g.length===0&&(0,d.jsx)("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),a):null}function im({flow:e,onClose:t}){let n=G.useId(),[o,r]=G.useState(null),i=Kc.find(b=>b.value===e.slippage),[a,s]=G.useState(e.slippage&&!i?e.slippage:""),l=a.trim()!==""&&a.trim()!==".",c=l?Number(a):NaN,m=Number.isFinite(c)&&c>50,g=Number.isFinite(c)&&c>5&&!m,w=b=>{e.setSlippage(b),t()},p=()=>{!l||m||(e.setSlippage(Yc(a)),t())};if(G.useEffect(()=>{r(document.body)},[]),G.useEffect(()=>{let b=x=>{x.key==="Escape"&&t()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[t]),!o)return null;let y=so();return(0,$n.createPortal)((0,d.jsx)("div",{className:"bf-slippage-overlay","data-theme":y,role:"presentation",onMouseDown:b=>{b.target===b.currentTarget&&t()},children:(0,d.jsxs)("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,d.jsxs)("header",{className:"bf-slippage-head",children:[(0,d.jsx)("h3",{id:n,children:"Slippage Settings"}),(0,d.jsx)("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:(0,d.jsx)(Lt,{size:24})})]}),(0,d.jsxs)("div",{className:"bf-slippage-body",children:[(0,d.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,d.jsxs)("div",{className:"bf-slippage-controls",children:[(0,d.jsx)("div",{className:"bf-slippage-presets",children:Kc.map(b=>(0,d.jsx)("button",{type:"button",className:"bf-slippage-preset","data-selected":!l&&e.slippage===b.value?"true":"false",onClick:()=>w(b.value),children:b.label},b.value))}),(0,d.jsxs)("label",{className:"bf-slippage-custom","data-selected":l?"true":"false",children:[(0,d.jsx)("span",{className:"bf-sr-only",children:"Custom slippage percent"}),(0,d.jsx)("input",{value:a,onChange:b=>{s(Yc(b.target.value))},onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),p())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),(0,d.jsx)("span",{"aria-hidden":"true",children:"%"})]})]}),m?(0,d.jsx)("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):g?(0,d.jsx)("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,l&&(0,d.jsx)("button",{type:"button",className:"bf-slippage-apply",onClick:p,disabled:m,children:"Apply"})]})]})}),o)}function am({flow:e}){let t=G.useId(),[n,o]=G.useState(!1),[r,i]=G.useState(null),a=so();return G.useEffect(()=>{i(document.body)},[]),G.useEffect(()=>{let s=l=>{l.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),!r||!e.termsOpen?null:(0,$n.createPortal)((0,d.jsx)("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",onPointerDown:s=>{s.target===s.currentTarget&&e.cancelTerms()},children:(0,d.jsxs)("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,d.jsx)("h3",{id:t,children:"Agree to Terms of Service"}),(0,d.jsx)("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),(0,d.jsxs)("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[(0,d.jsx)("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,"aria-label":"Agree to Terms of Use","data-track":"terms_check",onClick:()=>o(s=>!s),children:(0,d.jsx)("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"})}),(0,d.jsxs)("div",{className:"bf-terms-copy",children:[(0,d.jsx)("span",{className:"bf-terms-label",children:"Agree to Terms of Use"}),e.termsUrl&&(0,d.jsx)("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]})]}),(0,d.jsx)("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),(0,d.jsx)("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,"data-track":"terms_confirm",children:"Confirm"})]})}),r)}function sm({value:e,disabled:t=!1}){let[n,o]=G.useState(!1);return(0,d.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 lm({flow:e,approval:t}){let n=G.useId(),[o,r]=G.useState(null),i=so();if(G.useEffect(()=>{r(document.body)},[]),G.useEffect(()=>{let l=c=>{e.status!=="submitting"&&c.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!o)return null;let a=e.status==="submitting"||!e.approveBridge,s=e.status==="submitting";return(0,$n.createPortal)((0,d.jsx)("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",children:(0,d.jsxs)("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,d.jsxs)("h3",{id:n,children:["Approve ",t.token.symbol]}),(0,d.jsx)(Do,{token:t.token,size:72}),(0,d.jsxs)("div",{className:"bf-approve-address-box",children:[(0,d.jsx)("span",{children:"Token Address"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("strong",{children:t.tokenAddress}),(0,d.jsx)(sm,{value:t.tokenAddress,disabled:s})]})]}),(0,d.jsxs)("div",{className:"bf-action-buttons",children:[(0,d.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),(0,d.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:a,"aria-busy":s,"data-track":"approve_confirm",children:[s&&(0,d.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,d.jsx)("span",{children:s?"Approving...":"Approve"})]})]})]})}),o)}function cm({flow:e}){let t=G.useId(),[n,o]=G.useState(null),r=so();if(G.useEffect(()=>{o(document.body)},[]),G.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=s=>{s.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.approvalSuccessOpen)return null;let i=e.status==="submitting";return(0,$n.createPortal)((0,d.jsx)("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:(0,d.jsxs)("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,d.jsx)("h3",{id:t,children:"Approval Success"}),(0,d.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,d.jsxs)("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",(0,d.jsx)("br",{}),"Please continue to the next step."]}),(0,d.jsxs)("div",{className:"bf-action-buttons",children:[(0,d.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:i,children:"Cancel"}),(0,d.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,disabled:i,"aria-busy":i,children:[i&&(0,d.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,d.jsx)("span",{children:i?"Continuing...":"Continue"})]})]})]})}),n)}function dm({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,i]=G.useState(!1),a=G.useMemo(()=>{let c=new Ht.default(e||"0"),m=new Ht.default(t||"0");return!c.isFinite()||!m.isFinite()||c.lte(0)||m.lte(0)?null:r?c.dividedBy(m):m.dividedBy(c)},[e,r,t]);if(!a||!n||!o||n.symbol===o.symbol)return null;let s=r?o.symbol:n.symbol,l=r?n.symbol:o.symbol;return(0,d.jsxs)("button",{type:"button",className:"bf-exchange-rate",onClick:()=>i(c=>!c),"data-track":"rate_reverse",children:[(0,d.jsxs)("span",{children:["1 ",s]}),(0,d.jsx)(Oc,{size:12}),(0,d.jsxs)("span",{children:[td(a)," ",l]})]})}function pm({flow:e}){return e.submitToast?(0,d.jsxs)("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[(0,d.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,d.jsx)("span",{className:"bf-status-spinner"})}),(0,d.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,d.jsx)("strong",{children:"Transaction Processing"}),(0,d.jsx)("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function um({message:e}){let[t,n]=G.useState(!1);return G.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:(0,d.jsxs)("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[(0,d.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,d.jsx)("span",{className:"bf-status-error-mark",children:"!"})}),(0,d.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,d.jsx)("strong",{children:"Error"}),(0,d.jsx)("span",{children:e})]})]})}function fm(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 mm({flow:e}){let t=G.useId(),[n,o]=G.useState(null),r=e.submitted,i=so();return G.useEffect(()=>{o(document.body)},[]),G.useEffect(()=>{if(!e.successDialogOpen)return;let a=s=>{s.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.successDialogOpen||!r?null:(0,$n.createPortal)((0,d.jsx)("div",{className:"bf-success-overlay","data-theme":i,role:"presentation",children:(0,d.jsx)("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:(0,d.jsxs)("div",{className:"bf-success-body",children:[(0,d.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,d.jsxs)("div",{className:"bf-success-copy",children:[(0,d.jsx)("strong",{id:t,children:fm(r.pathType)}),(0,d.jsx)("span",{children:"Please check the results in the history."})]}),(0,d.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((a,s)=>(0,d.jsxs)(G.Fragment,{children:[s>0&&(0,d.jsx)("span",{className:"bf-success-route-arrow",children:"\u2192"}),(0,d.jsx)(Ji,{token:a,size:43})]},`${a.symbol}-${s}`))}),(0,d.jsx)("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,"data-track":"success_ok",children:"OK"})]})})}),n)}function Ji({token:e,size:t=16}){let n=!!e.iconUrl;return(0,d.jsx)("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?(0,d.jsx)("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):(0,d.jsx)("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function gm({row:e}){return e.routeTokens&&e.routeTokens.length>0?(0,d.jsx)("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>(0,d.jsxs)(G.Fragment,{children:[n>0&&(0,d.jsx)("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),(0,d.jsx)(Ji,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?(0,d.jsxs)("span",{className:"bf-info-value-token",children:[(0,d.jsx)(Ji,{token:e.valueToken}),(0,d.jsx)("span",{children:e.value})]}):(0,d.jsx)(d.Fragment,{children:e.value})}function id({rows:e}){return!e||e.length===0?null:(0,d.jsx)("div",{className:"bf-info-rows",children:e.map((t,n)=>(0,d.jsxs)("div",{className:"bf-info-row",children:[(0,d.jsxs)("span",{className:"bf-info-label",children:[(0,d.jsx)("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),(0,d.jsx)("span",{children:t.label})]}),(0,d.jsx)("span",{className:"bf-info-value","data-tone":t.tone??"default",children:(0,d.jsx)(gm,{row:t})})]},`${t.label}-${t.value}`))})}function hm(e,t,n){return e.pathType==="bridge"?"Bridge Info":rd(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function bm({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,d.jsx)(d.Fragment,{children:r.map(i=>{let a=i==="swap"?e.swapInfo:e.bridgeInfo;return a?.length?(0,d.jsxs)("div",{className:"bf-info-section",children:[o&&(0,d.jsx)("h4",{children:i==="swap"?"Swap Info":"Bridge Info"}),(0,d.jsx)(id,{rows:a})]},i):null})})}function wm({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=hm(e,t,n),[i,a]=G.useState(!0),[s,l]=G.useState(!0);return(0,d.jsxs)("div",{className:"bf-details",children:[e.liquidity&&(0,d.jsxs)("section",{className:"bf-liquidity",children:[(0,d.jsxs)("div",{className:"bf-liquidity-head",children:[(0,d.jsx)("span",{children:e.liquidity.label??"Available Liquidity"}),(0,d.jsx)("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),(0,d.jsx)("div",{className:"bf-liquidity-track",children:(0,d.jsx)("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||n)&&(0,d.jsxs)("section",{className:"bf-detail-section bf-info-card","data-open":i?"true":"false",children:[(0,d.jsxs)("button",{type:"button",className:"bf-collapse-head","aria-expanded":i,onClick:()=>a(c=>!c),"data-track":"details_toggle",children:[(0,d.jsx)("h3",{children:r}),(0,d.jsx)(Fn,{size:16,className:"bf-collapse-chevron"})]}),i&&(0,d.jsx)("div",{className:"bf-collapse-body",children:(0,d.jsx)(bm,{summary:e})})]}),o&&(0,d.jsxs)("section",{className:"bf-detail-section bf-tx-fee-section","data-open":s?"true":"false",children:[(0,d.jsxs)("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":s,onClick:()=>l(c=>!c),"data-track":"details_toggle",children:[(0,d.jsx)("h3",{children:"Est. Tx Fee"}),(0,d.jsxs)("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&(0,d.jsx)("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&(0,d.jsx)("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),(0,d.jsx)("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:Vf(e.txFeeInfo?.estTxFee??"0")}),(0,d.jsx)(Fn,{size:16,className:"bf-collapse-chevron"})]})]}),s&&(0,d.jsx)("div",{className:"bf-collapse-body",children:(0,d.jsx)(id,{rows:e.txFee})})]})]})}function xm({item:e}){let t=Hr(e),n=Jf(e.fromAmount,e.fromToken);return(0,d.jsxs)("article",{className:"bf-history-item",children:[(0,d.jsxs)("div",{className:"bf-history-item-head",children:[(0,d.jsx)("span",{className:"bf-history-status","data-status":t,children:tm(t)}),(0,d.jsx)("time",{className:"bf-history-time",dateTime:e.timestamp,children:Zf(e.timestamp)})]}),(0,d.jsxs)("div",{className:"bf-history-item-body",children:[(0,d.jsxs)("strong",{className:"bf-history-amount",children:[Xf(e.fromAmount)," ",e.fromToken.symbol]}),(0,d.jsxs)("div",{className:"bf-history-meta",children:[(0,d.jsx)("span",{className:"bf-history-usd",children:n??Qf(e.txHash)}),(0,d.jsxs)("span",{className:"bf-history-route",children:[(0,d.jsxs)("span",{className:"bf-history-route-token",children:[(0,d.jsx)(Do,{token:e.fromToken,size:16}),(0,d.jsx)("span",{children:e.fromToken.symbol})]}),(0,d.jsx)(Dc,{size:16,className:"bf-history-route-arrow"}),(0,d.jsxs)("span",{className:"bf-history-route-token",children:[(0,d.jsx)(Do,{token:e.toToken,size:16}),(0,d.jsx)("span",{children:e.toToken.symbol})]})]})]})]})]})}function ym({flow:e}){let[t,n]=G.useState("all"),o=e.history.some(a=>Hr(a)==="pending"),r=e.history.filter(a=>em(a,t)),i=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return(0,d.jsxs)("main",{className:"bf-history-body",children:[(0,d.jsx)("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:$f.map(a=>(0,d.jsxs)("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>n(a.value),"data-track":"history_filter","data-track-id":a.value,children:[(0,d.jsx)("span",{children:a.label}),a.value==="pending"&&o&&(0,d.jsx)("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),r.length>0?(0,d.jsx)("div",{className:"bf-history-list",children:r.map(a=>(0,d.jsx)(xm,{item:a},a.id||a.txHash))}):(0,d.jsx)("div",{className:"bf-empty",children:i})]})}function vm({flow:e,env:t}){let[n,o]=G.useState(null),[r,i]=G.useState(!1),[a,s]=G.useState(0),c=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??om(e):null,m=En("apps.json",t,f=>Tn(f?.bridgePoweredBy?.url,t)),g=nm(e.quoteError),w=qf(e.fromAmount,e.fromToken),p=w?"Insufficient balance":g.from,y=e.quoteError&&!g.from&&!g.to?e.quoteError:"",b=e.error||y,x=e.history.some(f=>Hr(f)==="pending"),v=(c?.pathType??od(e.fromToken,e.toToken))!=="bridge";return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("main",{className:"bf-body",children:[(0,d.jsxs)("div",{className:"bf-toolbar",children:[(0,d.jsxs)("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),"data-track":"history_open",children:[(0,d.jsx)(Fc,{}),(0,d.jsx)("span",{children:"History"}),(x||e.hasNewHistory)&&(0,d.jsx)("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),v&&(0,d.jsxs)("button",{type:"button",className:"bf-chip",onClick:()=>i(!0),"data-track":"slippage_open",disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":r,children:[(0,d.jsx)(Bc,{}),(0,d.jsx)("span",{children:e.slippageLocked?"Auto 1%":Hf(e.slippage,e.effectiveSlippage)})]})]}),(0,d.jsxs)("div",{className:"bf-swap-card","data-has-from-error":p?"true":"false",children:[(0,d.jsx)(Xc,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:Qc(e.fromAmount,e.fromToken),onAmountChange:f=>e.setAmount(f,"from"),onTokenClick:()=>o("from")}),p&&(0,d.jsx)("div",{className:"bf-field-error",children:p}),(0,d.jsx)("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),s(f=>f+360)},"data-track":"token_swap",style:{transform:`translateX(-50%) rotate(${a}deg)`,transition:"transform 0.2s ease"},children:(0,d.jsx)(Mc,{size:22})}),(0,d.jsx)(Xc,{label:"To",token:e.toToken,amount:e.toAmount,usd:Qc(e.toAmount,e.toToken),onAmountChange:f=>e.setAmount(f,"to"),onTokenClick:()=>o("to"),locked:e.availableToTokens.length<=1}),g.to&&(0,d.jsx)("div",{className:"bf-field-error",children:g.to})]}),(0,d.jsx)(dm,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),c&&(0,d.jsx)(wm,{summary:c})]}),(0,d.jsxs)("footer",{className:"bf-footer",children:[(0,d.jsx)("button",{type:"button",className:"bf-next",onClick:e.submit,"data-track":"next",disabled:e.status==="submitting"||!!e.quoteError||w,children:e.status==="submitting"?"Processing...":"Next"}),m&&(0,d.jsxs)("a",{className:"bf-powered",href:m,target:"_blank",rel:"noreferrer",children:["Powered by ",(0,d.jsx)("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&(0,d.jsx)(rm,{flow:e,side:n,onClose:()=>o(null)}),r&&(0,d.jsx)(im,{flow:e,onClose:()=>i(!1)}),(0,d.jsx)(am,{flow:e}),e.approvalInfo&&(0,d.jsx)(lm,{flow:e,approval:e.approvalInfo}),(0,d.jsx)(cm,{flow:e}),(0,d.jsx)(pm,{flow:e}),(0,d.jsx)(um,{message:e.submitToast?"":b}),(0,d.jsx)(mm,{flow:e})]})}function Oo({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let i=G.useMemo(()=>je(n),[n]),a=qc({...r,onExit:t}),s=G.useRef(null),l=zf(s),c=a.step==="history"?"History":"Swap & Bridge";return(0,d.jsx)(Ce,{feature:"bridge",children:(0,d.jsx)(Jc.Provider,{value:l,children:(0,d.jsxs)("div",{ref:s,className:ge("bf-root",o),"data-view":a.step,"data-status":a.status,children:[(0,d.jsxs)("header",{className:"bf-header",children:[(0,d.jsx)("button",{type:"button",className:"bf-header-btn",onClick:a.back,"aria-label":"Back",children:(0,d.jsx)(dn,{size:24})}),(0,d.jsx)("span",{className:"bf-header-title",children:c}),(0,d.jsx)("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:(0,d.jsx)(Lt,{size:24})})]}),a.step==="history"?(0,d.jsx)(ym,{flow:a}):(0,d.jsx)(vm,{flow:a,env:i})]})})})}var dt=H(require("react"),1),na=H(require("bignumber.js"),1);var ad=require("@tanstack/react-query");var km="token-history";function sd(e,t,n,o,r=!0){return(0,ad.useInfiniteQuery)({queryKey:[km,e,t,n.toLowerCase(),o.toLowerCase()],initialPageParam:void 0,queryFn:async({pageParam:i,signal:a})=>{let s=await pe("walletServer",e),l=new URLSearchParams({chain_id:String(t),token:n,wallet:o}),c=i;c&&(l.set("last_timestamp",String(c.last_timestamp)),l.set("last_log_index",String(c.last_log_index)),l.set("last_tx_index",String(c.last_tx_index)));let m=await fetch(`${s}/v1/public/token/historical?${l}`,{cache:"no-store",signal:a});if(!m.ok)throw new Error(`Failed to fetch token history: ${m.status}`);let g=await m.json();if(g.code!==200)throw new Error(`Token history API error: ${g.code}`);return g.data??[]},getNextPageParam:i=>{if(!i||i.length===0)return;let a=i[i.length-1];return{last_timestamp:a.timestamp,last_log_index:a.log_index,last_tx_index:a.tx_index}},enabled:r&&!!o&&!!n&&t>0,staleTime:1e4})}var jr=H(require("react"),1);var ea={chart:!1,balance:!0,overview:!1,social:!1,history:!0},Sm=Object.keys(ea),Cm="apps.json";function ld(e){let[t,n]=jr.useState({visibility:ea,isLoaded:!1});return jr.useEffect(()=>{let o=!0;return Nn(Cm,e).then(r=>{if(!o)return;let i=r?.tokenDetail?.sections,a={...ea};if(i)for(let s of Sm){let l=i[s];typeof l=="boolean"&&(a[s]=l)}n({visibility:a,isLoaded:!0})}),()=>{o=!1}},[e]),t}var ht=H(require("react"),1);var Vr=require("@tanstack/react-query");var Rm="token-price-history";function cd(e,t,n,o,r=!0){return(0,Vr.useQuery)({queryKey:[Rm,e,t,n.toLowerCase(),o],queryFn:async({signal:i})=>{let a=await pe("walletServer",e),s=new URLSearchParams({chain_id:String(t),token:n,interval:o}),l=await fetch(`${a}/v1/public/token/price/historical?${s}`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token price history: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Token price history API error: ${c.code}`);return c.data??[]},enabled:r&&!!n&&t>0,staleTime:3e4,placeholderData:Vr.keepPreviousData})}var ke=require("react/jsx-runtime"),Tm="var(--ds-system-green-high, #00a869)",Nm="var(--wi-error, #e70077)",Hn=150,qr=3,ta=18,Em=18,Im=[{key:"10m",label:"10m"},{key:"1h",label:"1H"},{key:"1d",label:"1D"},{key:"7d",label:"1W"},{key:"30d",label:"1M"},{key:"1y",label:"1Y"}],_m=new Set(["7d","30d","1y"]);function Pm(){let e=ht.useRef(null),[t,n]=ht.useState(0);return ht.useEffect(()=>{let o=e.current;if(!o)return;let r=new ResizeObserver(i=>{n(i[0]?.contentRect.width??0)});return r.observe(o),n(o.clientWidth),()=>r.disconnect()},[]),[e,t]}function Lm(e,t){let n=new Date(e*1e3),o=t?{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}:{hour:"numeric",minute:"2-digit"};return new Intl.DateTimeFormat("en-US",o).format(n)}function Am(e,t){if(t<=0||e.length===0)return null;let n=e.length===1?[e[0],e[0]]:e,o=n.length,r=n[0],i=n[0],a=0,s=0;for(let v=1;v<o;v++)n[v]>r&&(r=n[v],a=v),n[v]<i&&(i=n[v],s=v);let l=r-i||1,c=Math.max(1,t-qr*2),m=Hn-ta-Em,g=v=>o===1?t/2:qr+v/(o-1)*c,w=v=>ta+(1-(v-i)/l)*m,p=n.map((v,f)=>({x:g(f),y:w(v)})),y=p.map((v,f)=>`${f===0?"M":"L"}${v.x.toFixed(2)},${v.y.toFixed(2)}`).join(" "),b=p[0],x=p[p.length-1],h=`${y} L${x.x.toFixed(2)},${Hn} L${b.x.toFixed(2)},${Hn} Z`;return{values:n,points:p,linePath:y,areaPath:h,maxIdx:a,minIdx:s}}function dd({env:e,chainId:t,tokenAddress:n}){let[o,r]=ht.useState("1d"),[i,a]=ht.useState(null),s=ht.useId(),[l,c]=Pm(),{data:m,isLoading:g,isError:w}=cd(e,t,n,o,!0),p=ht.useMemo(()=>(m??[]).filter(P=>Number.isFinite(Number(P.price))).slice().sort((P,ae)=>P.updated_at-ae.updated_at),[m]),y=ht.useMemo(()=>p.map(E=>Number(E.price)),[p]),b=ht.useMemo(()=>Am(y,c),[y,c]);ht.useEffect(()=>{a(null)},[o]);let x=p.length>0,h=i!==null&&i<y.length?i:y.length-1,v=x?y[h]:0,f=x?y[0]:0,T=f!==0?(v-f)/f*100:0,k=T>=0,C=k?Tm:Nm,_=(k?"+":"-")+(Math.floor(Math.abs(T)*100)/100).toFixed(2)+"%",N=i!==null&&p[i]?Lm(p[i].updated_at,_m.has(o)):"",I=E=>{if(!b||c<=0)return;let P=E.currentTarget.getBoundingClientRect(),ae=E.clientX-P.left;if(b.values.length<=1){a(0);return}let B=Math.max(1,c-qr*2),ue=Math.min(1,Math.max(0,(ae-qr)/B)),ce=Math.round(ue*(p.length-1));a(Math.min(p.length-1,Math.max(0,ce)))},z=()=>a(null);if(!g&&(w||!x))return null;let F=i!==null&&b&&b.points[i]?b.points[i]:null,j=b?.points[b.maxIdx],L=b?.points[b.minIdx],Z=E=>Math.min(Math.max(E,24),Math.max(24,c-24));return(0,ke.jsxs)("section",{className:"wi-td-chart",children:[(0,ke.jsxs)("div",{className:"wi-td-chart-panel",children:[(0,ke.jsx)("span",{className:"wi-td-chart-price",children:x?Bn(v):"\u2014"}),x&&(0,ke.jsxs)("span",{className:"wi-td-chart-change","data-positive":k,children:[(0,ke.jsx)("span",{children:_}),N&&(0,ke.jsx)("span",{className:"wi-td-chart-when",children:N})]})]}),(0,ke.jsx)("div",{ref:l,className:"wi-td-chart-plot",children:g&&!x?(0,ke.jsx)("div",{className:"wi-skeleton-block wi-td-chart-skeleton"}):b&&c>0&&(0,ke.jsxs)("svg",{className:"wi-td-chart-svg",width:c,height:Hn,role:"img","aria-label":"Price chart",children:[(0,ke.jsx)("defs",{children:(0,ke.jsxs)("linearGradient",{id:s,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,ke.jsx)("stop",{offset:"0%",stopColor:C,stopOpacity:.28}),(0,ke.jsx)("stop",{offset:"100%",stopColor:C,stopOpacity:0})]})}),(0,ke.jsx)("path",{d:b.areaPath,fill:`url(#${s})`}),(0,ke.jsx)("path",{d:b.linePath,fill:"none",stroke:C,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),j&&(0,ke.jsx)("text",{className:"wi-td-chart-minmax",x:Z(j.x),y:Math.max(11,j.y-7),textAnchor:"middle",children:Bn(b.values[b.maxIdx])}),L&&b.minIdx!==b.maxIdx&&(0,ke.jsx)("text",{className:"wi-td-chart-minmax",x:Z(L.x),y:Math.min(Hn-5,L.y+14),textAnchor:"middle",children:Bn(b.values[b.minIdx])}),F&&(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)("line",{className:"wi-td-chart-cursor",x1:F.x,y1:ta-6,x2:F.x,y2:Hn}),(0,ke.jsx)("circle",{cx:F.x,cy:F.y,r:4,fill:C,stroke:"var(--wi-surface-bg, #121212)",strokeWidth:2})]}),(0,ke.jsx)("rect",{x:0,y:0,width:c,height:Hn,fill:"transparent",style:{touchAction:"none"},onPointerMove:I,onPointerDown:I,onPointerLeave:z,onPointerCancel:z})]})}),(0,ke.jsx)("div",{className:"wi-td-chart-tabs",role:"tablist",children:Im.map(E=>(0,ke.jsx)("button",{type:"button",role:"tab","aria-selected":o===E.key,className:"wi-td-chart-tab","data-active":o===E.key||void 0,onClick:()=>r(E.key),"data-track":"token_detail_interval","data-track-id":E.key,children:E.label},E.key))})]})}var R=require("react/jsx-runtime"),Fm="https://contents.crosstoken.io/wallet/token/images/FT.png",Bm={receive:"Receive",send:"Send","bridge-in":"Bridge In","bridge-out":"Bridge Out"};function Mm(e){if(!e)return"";let t=e<1e12?e*1e3:e,n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"just now";let o=Math.floor(n/60);if(o<60)return`${o}m`;let r=Math.floor(o/60);if(r<24)return`about ${r}h`;let i=Math.floor(r/24);if(i<30)return`${i}d`;let a=Math.floor(i/30);return a<12?`${a}mo`:`${Math.floor(a/12)}y`}function pd(e){let[t,n]=e.split("."),o="";for(let r=0;r<t.length;r++){let i=t.length-r;r>0&&i%3===0&&(o+=","),o+=t[r]}return n?`${o}.${n}`:o}function ud(e,t){let n=BigInt(e||"0");if(t<=2){let a=10n**BigInt(t),s=n/a,l=n%a*10n**BigInt(2-t);return`${s.toString()}.${l.toString().padStart(2,"0")}`}let o=n/10n**BigInt(t-2),r=o/100n,i=o%100n;return`${r.toString()}.${i.toString().padStart(2,"0")}`}function Dm(e,t,n){let o=dt.useRef(null),r=dt.useRef(null),[i,a]=dt.useState(t);return dt.useLayoutEffect(()=>{let s=o.current,l=r.current;if(!s||!l)return;let c=()=>{let g=s.clientWidth;if(!g)return;let w=window.getComputedStyle(l),p=document.createElement("span");p.textContent=l.textContent,p.style.cssText=["position:absolute","left:-9999px","top:-9999px","visibility:hidden","white-space:nowrap",`font-family:${w.fontFamily}`,`font-weight:${w.fontWeight}`,`letter-spacing:${w.letterSpacing}`,`font-size:${t}px`].join(";"),document.body.appendChild(p);let y=p.offsetWidth;if(document.body.removeChild(p),y<=g){a(t);return}let b=Math.max(n,Math.floor(t*g/y));a(b)};c();let m=new ResizeObserver(c);return m.observe(s),()=>m.disconnect()},[e,t,n]),{containerRef:o,textRef:r,fontSize:i}}function Om(e){if(!e)return"-";let t=new na.default(e);return t.isNaN()?"-":t.decimalPlaces(4,na.default.ROUND_DOWN).toFormat()}function Wm(){return(0,R.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,R.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.6"}),(0,R.jsx)("path",{d:"M3 12h18M12 3c2.5 2.5 3.8 5.8 3.8 9s-1.3 6.5-3.8 9c-2.5-2.5-3.8-5.8-3.8-9S9.5 5.5 12 3Z",stroke:"currentColor",strokeWidth:"1.6"})]})}function Um(){return(0,R.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,R.jsx)("path",{d:"M21.9 4.3 18.6 20c-.2 1-.9 1.3-1.8.8l-4.9-3.6-2.4 2.3c-.3.3-.5.5-1 .5l.3-4.9 9-8.1c.4-.3-.1-.5-.6-.2L6.2 13.2l-4.8-1.5c-1-.3-1-1 .2-1.5L20.6 3c.9-.3 1.6.2 1.3 1.3Z"})})}function Gm(){return(0,R.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,R.jsx)("path",{d:"M18.9 2H22l-7.3 8.3L23.3 22h-6.8l-5.3-6.9L5.1 22H2l7.8-8.9L1 2h6.9l4.8 6.4L18.9 2Zm-1.2 18h1.9L7.2 4H5.2l12.5 16Z"})})}function zm(){return(0,R.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,R.jsx)("path",{d:"M6.9 6.5c0-.2-.1-.5-.3-.6L4.6 3.6V3.3h6.3l4.9 10.7 4.3-10.7H26v.3l-1.8 1.7c-.2.1-.2.3-.2.5v12.4c0 .2 0 .4.2.5l1.7 1.7v.3h-8.7v-.3l1.8-1.7c.2-.2.2-.2.2-.5V8.1l-5 12.6h-.7L7.9 8.1v8.5c0 .3.1.6.3.8l2.3 2.8v.3H4v-.3l2.3-2.8c.2-.2.3-.5.3-.8V6.5Z",transform:"scale(0.85)"})})}function fd({env:e,isMobile:t,token:n,walletAddress:o,stat:r,tokenInfo:i,showBalance:a=!0,onBack:s,onClose:l,onSend:c,onOutlink:m}){let g=n.quantity.decimals,[w,p]=dt.useState(!1),{buildTxUrl:y,chainInfo:b}=gs(e,n.chainId,!0),{visibility:x}=ld(e),{data:h,isLoading:v,isError:f,fetchNextPage:T,hasNextPage:k,isFetchingNextPage:C,refetch:_}=sd(e,n.chainId,n.address,o,!0),N=dt.useMemo(()=>h?.pages?h.pages.flat():[],[h]),I=dt.useRef(null);dt.useEffect(()=>{if(!t)return;let D=I.current;if(!D||!k)return;let X=new IntersectionObserver(te=>{te[0]?.isIntersecting&&!C&&T()},{rootMargin:"120px"});return X.observe(D),()=>X.disconnect()},[t,k,C,T]);let z=dt.useCallback(()=>{navigator?.clipboard&&navigator.clipboard.writeText(n.address).then(()=>{p(!0),setTimeout(()=>p(!1),1500)}).catch(()=>{})},[n.address]),F=pd(ud(n.quantity.numeric,g)),j=r?.price?fr(n.quantity.numeric,g,r.price):null,L=a?F:"\u2022\u2022\u2022\u2022",{containerRef:Z,textRef:E,fontSize:P}=Dm(L,30,14),Q=Qn(n.chainId,e).name??b?.name??`Chain ${n.chainId}`,B=b?.explorer_url,ue=i?.deployed??!0,ce=dt.useMemo(()=>{let D=[];return i?.info_url&&D.push({key:"web",label:"Website",url:i.info_url,icon:(0,R.jsx)(Wm,{})}),i?.telegram_url&&D.push({key:"tg",label:"Telegram",url:i.telegram_url,icon:(0,R.jsx)(Um,{})}),i?.x_url&&D.push({key:"x",label:"X",url:i.x_url,icon:(0,R.jsx)(Gm,{})}),i?.medium_url&&D.push({key:"medium",label:"Medium",url:i.medium_url,icon:(0,R.jsx)(zm,{})}),D},[i]),V=(D,X,te,be)=>{Ve(D,X,{category:"token-detail",origin:te,payload:{address:n.address,txHash:be}},m)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"wi-sticky-header",children:[(0,R.jsxs)("div",{className:"wi-header wi-header--receive",children:[(0,R.jsx)("button",{type:"button",className:"wi-header-back",onClick:s,"aria-label":"Back",children:(0,R.jsx)(dn,{size:24})}),(0,R.jsxs)("span",{className:"wi-td-header-title",children:[(0,R.jsx)("img",{src:n.icon_url,alt:"","aria-hidden":!0,className:"wi-td-header-icon",width:24,height:24,draggable:!1,onError:D=>{D.currentTarget.src=Fm}}),(0,R.jsx)("span",{className:"wi-td-header-name",children:n.symbol})]}),(0,R.jsx)("button",{type:"button",className:"wi-header-action",onClick:l,"aria-label":"Close",children:(0,R.jsx)(Lt,{size:24})})]}),(0,R.jsx)("hr",{className:"wi-divider"})]}),(0,R.jsxs)("div",{className:"wi-td-scroll",children:[x.chart&&(0,R.jsx)(dd,{env:e,chainId:n.chainId,tokenAddress:n.address}),x.balance&&(0,R.jsxs)("section",{className:"wi-td-balance-card",children:[(0,R.jsxs)("div",{className:"wi-td-balance-left",ref:Z,children:[(0,R.jsx)("span",{className:"wi-td-balance-label",children:"My Balance"}),(0,R.jsx)("span",{className:"wi-td-balance-amount",ref:E,style:{fontSize:P},children:L}),a&&j&&(0,R.jsx)("span",{className:"wi-td-balance-fiat",children:j})]}),(0,R.jsx)("button",{type:"button",className:"wi-td-send-btn",onClick:()=>c(n),"aria-label":`Send ${n.symbol}`,"data-track":"token_detail_send","data-track-id":n.symbol,children:(0,R.jsx)("span",{children:"Send"})})]}),x.overview&&(0,R.jsxs)("section",{className:"wi-td-section",children:[(0,R.jsx)("h3",{className:"wi-td-section-title",children:"Crypto Overview"}),(0,R.jsxs)("div",{className:"wi-td-rows",children:[(0,R.jsxs)("div",{className:"wi-td-row",children:[(0,R.jsx)("span",{className:"wi-td-row-label",children:"Network"}),B?(0,R.jsxs)("a",{className:"wi-td-row-value wi-td-row-link",href:B,target:"_blank",rel:"noopener noreferrer",onClick:D=>V(D,B,"token-network"),children:[(0,R.jsx)("span",{children:Q}),(0,R.jsx)($m,{})]}):(0,R.jsx)("span",{className:"wi-td-row-value",children:Q})]}),(0,R.jsxs)("div",{className:"wi-td-row",children:[(0,R.jsx)("span",{className:"wi-td-row-label",children:"Contract Address"}),(0,R.jsxs)("button",{type:"button",className:"wi-td-row-value wi-td-row-copy",onClick:z,"aria-label":"Copy contract address",children:[(0,R.jsx)("span",{children:ct(n.address)}),w?(0,R.jsx)(cn,{size:14}):(0,R.jsx)(An,{size:14})]})]}),(0,R.jsxs)("div",{className:"wi-td-row",children:[(0,R.jsx)("span",{className:"wi-td-row-label",children:"Decimals"}),(0,R.jsx)("span",{className:"wi-td-row-value",children:g})]}),(0,R.jsxs)("div",{className:"wi-td-row",children:[(0,R.jsx)("span",{className:"wi-td-row-label",children:"Total Supply"}),(0,R.jsx)("span",{className:"wi-td-row-value",children:Om(r?.circulating_supply)})]})]})]}),x.social&&ce.length>0&&(0,R.jsxs)("section",{className:"wi-td-section",children:[(0,R.jsx)("h3",{className:"wi-td-section-title",children:"Social Media"}),(0,R.jsx)("div",{className:"wi-td-social-row",children:ce.map(D=>(0,R.jsx)("a",{className:"wi-td-social-btn",href:D.url,target:"_blank",rel:"noopener noreferrer","aria-label":D.label,onClick:X=>V(X,D.url,"token-social"),children:D.icon},D.key))})]}),x.history&&(0,R.jsxs)("section",{className:"wi-td-section",children:[(0,R.jsx)("h3",{className:"wi-td-section-title",children:"Token History"}),v&&(0,R.jsx)("div",{className:"wi-td-history-list",children:Array.from({length:3},(D,X)=>(0,R.jsxs)("div",{className:"wi-td-history-skeleton",children:[(0,R.jsx)("div",{className:"wi-skeleton-block",style:{width:90,height:14}}),(0,R.jsx)("div",{className:"wi-skeleton-block",style:{width:60,height:14}})]},`td-sk-${X}`))}),!v&&f&&(0,R.jsxs)("div",{className:"wi-td-history-empty",children:[(0,R.jsx)("span",{children:"Failed to load history."}),(0,R.jsx)("button",{type:"button",className:"wi-td-retry-btn",onClick:()=>_(),children:"Retry"})]}),!v&&!f&&N.length===0&&(0,R.jsx)("div",{className:"wi-td-history-empty",children:(0,R.jsx)("span",{children:"No transactions found."})}),!v&&!f&&N.length>0&&(0,R.jsxs)("div",{className:"wi-td-history-list",children:[N.map((D,X)=>{let te=D.to_alias?.toLowerCase().includes("bridge")??!1,be=D.from_alias?.toLowerCase().includes("bridge")??!1,Ne=te?"bridge-out":be?"bridge-in":D.to?.toLowerCase()===o.toLowerCase()?"receive":"send",ne=Ne==="receive"||Ne==="bridge-in",xe=ne?D.from:D.to,ze=pd(ud(D.amount,g)),Ke=y(D.tx),pt=Mm(D.timestamp),de=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"wi-td-history-top",children:[(0,R.jsx)("span",{className:"wi-td-history-type","data-direction":Ne,children:Bm[Ne]}),(0,R.jsx)("span",{className:"wi-td-history-counter",children:ct(xe??"")})]}),(0,R.jsxs)("div",{className:"wi-td-history-bottom",children:[(0,R.jsxs)("span",{className:"wi-td-history-meta",children:[(0,R.jsx)("span",{className:"wi-td-history-status","data-status":D.status,children:D.status==="success"?"Success":"Failed"}),pt&&(0,R.jsx)("span",{className:"wi-td-history-time",children:pt})]}),(0,R.jsxs)("span",{className:"wi-td-history-amount",children:[ne?"+":"-",ze," ",n.symbol]})]})]}),Ze=`${D.tx}-${D.log_index}-${X}`;return Ke?(0,R.jsx)("a",{className:"wi-td-history-item wi-td-history-item--link",href:Ke,target:"_blank",rel:"noopener noreferrer",onClick:it=>V(it,Ke,"token-tx",D.tx),children:de},Ze):(0,R.jsx)("div",{className:"wi-td-history-item",children:de},Ze)}),k&&(t?(0,R.jsx)("div",{ref:I,className:"wi-td-history-sentinel",children:C&&(0,R.jsx)("span",{className:"wi-td-history-loading",children:"Loading\u2026"})}):(0,R.jsx)("button",{type:"button",className:"wi-td-loadmore-btn",onClick:()=>T(),disabled:C,children:C?"Loading\u2026":"Load more"}))]})]})]})]})}function $m(){return(0,R.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:ge("wi-td-external-icon"),"aria-hidden":!0,children:(0,R.jsx)("path",{d:"M14 4h6v6M20 4l-9 9M18 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}var u=require("react/jsx-runtime"),Hm="On-ramp is not available in your region.";function oa(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 jm(e){return parseInt(e.split(":")[1],10)}function Vm(e){if(typeof window>"u"||!e?.length)return!1;let{origin:t,pathname:n}=window.location,o=t+n;return e.some(r=>o===r||o.startsWith(`${r}/`))}function qm(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Km(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 Ym(e,t=.5){let n=$.useRef(null),o=$.useRef(null),[r,i]=$.useState(1);return $.useLayoutEffect(()=>{let a=n.current,s=o.current;if(!a||!s)return;let l=()=>{let m=a.clientWidth;if(!m)return;let g=s.cloneNode(!0);g.style.setProperty("--wi-total-scale","1"),g.style.position="absolute",g.style.left="-9999px",g.style.top="-9999px",g.style.visibility="hidden",g.style.maxWidth="none",g.style.width="max-content",a.appendChild(g);let w=g.offsetWidth;a.removeChild(g);let p=w>m?Math.max(t,m/w):1;i(p)};l();let c=new ResizeObserver(l);return c.observe(a),()=>c.disconnect()},[e,t]),{containerRef:n,valueRef:o,scale:r}}function gd({align:e="end",sideOffset:t=12,className:n,children:o}){let{env:r,theme:i,isMobile:a,open:s,drawerDirection:l,modal:c,showBalance:m,showForgeToken:g,showGameToken:w,showQR:p,showBridge:y,qrLogoSrc:b,walletAddress:x,accountName:h,sendAccounts:v,profileImageUrl:f,preferredTokens:T,close:k,onSelectWallet:C,onCopyAddress:_,onBuy:N,onDisconnect:I,disconnectLabel:z,termsUrl:F,termsLabel:j,privacyUrl:L,privacyLabel:Z,portalStyle:E,navContent:P,navPosition:ae,footerContent:Q,view:B,setView:ue,selectedSendToken:ce,setSelectedSendToken:V,selectedDetailToken:D,setSelectedDetailToken:X,showPortfolio:te,portfolioTitle:be,portfolioSections:Ne,showTotalAssets:ne,totalAssetsLabel:xe,sendTransaction:ze,getTransactionReceipt:Ke,estimateGas:pt,onOutlink:de,lpBalanceReader:Ze,stakingRewardsReader:it,bridgeTokens:$e,bridgeHistory:at,getBridgeQuote:Xe,getBridgeToTokens:It,getBridgeApproval:on,approveBridge:bt,submitBridge:yt,onReceive:vt,onSend:_t,onBuyDisabledMessage:He,onBridgeDisabledMessage:Dt,onSendDisabledMessage:kt}=wn(),[St,rn]=$.useState(null),Pt=$.useRef(void 0),_e=$.useCallback(S=>{rn(S),clearTimeout(Pt.current),Pt.current=setTimeout(()=>rn(null),4e3)},[]);$.useEffect(()=>()=>clearTimeout(Pt.current),[]);let Je=!!He,Ct=$.useCallback(()=>{if(Je){_e(He);return}let S=N?.();S&&typeof S.then=="function"&&S.catch(()=>{_e(He??Hm)})},[Je,He,N,_e]),ut=!!Dt,Ye=!!kt,{tokens:Ot,isLoading:jt}=un(r,x,s&&m),{statsMap:et}=fn(r,m),{aprPercent:Vt}=rl(),{categoryMap:an,infoMap:sn}=al(r,m),A=m&&ne,{displayValue:re,isLowerBound:Fe,isLoading:Rt}=ll(r,x,s&&A),[Tt,qt]=$.useState(!1),Cn=$.useRef(null),[qn,Yo]=$.useState(0),{holdings:ln,isLoading:Qo}=Js(r,x,s&&m&&g),oi=$.useMemo(()=>ln.map(S=>S.token),[ln]),{imageMap:Y}=el(r,oi,g&&ln.length>0),Se=$.useMemo(()=>{let S=[],K=[],me=[],mt=new Map((T??[]).map((we,st)=>[`${jm(we.chainId)}:${we.address.toLowerCase()}`,st]));for(let we of Ot){let st=oa(r,we.chainId,we.symbol)!==void 0,Wt=`${we.chainId}:${we.address.toLowerCase()}`,Rn=mt.get(Wt),di=new lo.default(we.quantity.numeric).shiftedBy(-we.quantity.decimals);if(st)S.push(we);else if(Rn!==void 0)K.push(we);else if(di.isGreaterThan(0)){if(!w&&an.get(No(we.chainId,we.address))==="game")continue;me.push(we)}}return S.sort((we,st)=>{let Wt=oa(r,we.chainId,we.symbol)??99,Rn=oa(r,st.chainId,st.symbol)??99;return Wt-Rn}),K.sort((we,st)=>{let Wt=mt.get(`${we.chainId}:${we.address.toLowerCase()}`)??99,Rn=mt.get(`${st.chainId}:${st.address.toLowerCase()}`)??99;return Wt-Rn}),me.sort((we,st)=>{let Wt=et.get(At(we.chainId,we.address)),Rn=et.get(At(st.chainId,st.address)),di=new lo.default(we.quantity.numeric).shiftedBy(-we.quantity.decimals).multipliedBy(Wt?.price??0);return new lo.default(st.quantity.numeric).shiftedBy(-st.quantity.decimals).multipliedBy(Rn?.price??0).minus(di).toNumber()}),[...S,...K,...me]},[Ot,r,et,w,an,T]),J=$.useMemo(()=>{if(!g)return[];let S=new Set(Ot.map(K=>K.address.toLowerCase()));return[...ln].filter(K=>!S.has(K.token.toLowerCase())).sort((K,me)=>{let mt=new lo.default(K.value);return new lo.default(me.value).minus(mt).toNumber()})},[ln,g,Ot]),Be=$.useRef(!1),[tt,po]=$.useState(null),Kn=$.useRef(void 0),ca=tt?.chainId??ce?.chainId??Se[0]?.chainId??0,{transactionUrl:ri}=So(r,ca,tt?.txHash,!!(tt?.txHash&&ca)),ft=$.useCallback(S=>{Be.current=!0,ue(S)},[ue]),[jd,ii]=$.useState("recipient"),Zo=$.useCallback(()=>{V(null),ii("recipient"),ft("wallet")},[V,ft]),Xo=$.useCallback((S,K="recipient")=>{if(Ye){_e(kt);return}ii(K),V(S),ft("send")},[Ye,kt,_e,V,ft]),Vd=$.useCallback(S=>{X(S),ft("token-detail")},[X,ft]),qd=$.useCallback(()=>{X(null),ft("wallet")},[X,ft]),Kd=$.useCallback(S=>{Xo(S,"recipient")},[Xo]),Jo=En("apps.json",r,S=>Tn(S?.gametokenBridge,r)),da=En("apps.json",r,S=>S?.gametokenSites),Yd=$.useCallback(()=>{if(ut){_e(Dt);return}if(Jo){if(Vm(da)){window.location.assign(Jo);return}window.open(Jo,"_blank","noopener,noreferrer")}},[ut,Dt,Jo,da,_e]),Qd=$.useCallback(S=>{clearTimeout(Kn.current),V(null),ft("wallet"),po({status:"pending",txHash:S.txHash,chainId:S.chainId,description:`${S.amount} ${S.tokenSymbol} to ${ct(S.recipient)}`})},[V,ft]),Zd=$.useCallback(S=>{let K=ce?.chainId;V(null),ft("wallet"),!(!S||!K)&&(po(me=>({status:"success",txHash:S,chainId:K,description:me?.txHash===S?me.description:"Tap to see your transaction"})),clearTimeout(Kn.current),Kn.current=setTimeout(()=>po(null),5e3))},[ce?.chainId,V,ft]),Xd=$.useCallback(S=>{let K=S.txHash;K&&(po({status:"error",txHash:K,chainId:S.chainId,description:S.message}),clearTimeout(Kn.current),Kn.current=setTimeout(()=>po(null),5e3))},[]),uo=$.useMemo(()=>{if(vt)return vt;if(p)return()=>ft("qr")},[vt,p,ft]),ai=$.useMemo(()=>{if(_t)return _t;if(Se.length===0)return;let S=Se[0];return()=>Xo(S,"token")},[_t,Se,Xo]),Jd=$.useCallback(()=>{if(Ye){_e(kt);return}ai?.()},[Ye,kt,ai,_e]);$.useEffect(()=>{s||(Be.current=!1,ii("recipient"))},[s]);let pa=$.useRef(null);$.useEffect(()=>{let S=pa.current;if(!S||!a)return;let K=me=>{me.pointerType==="touch"&&me.stopPropagation()};return S.addEventListener("pointerdown",K),()=>S.removeEventListener("pointerdown",K)},[a]);let[Yn,ua]=$.useState(!1),si=$.useRef(void 0),[fo,mo]=$.useState(!1);$.useEffect(()=>{if(!fo)return;let S=()=>mo(!1),K=mt=>{mt.key==="Escape"&&mo(!1)},me=setTimeout(()=>{document.addEventListener("mousedown",S,!0),document.addEventListener("keydown",K,!0)},0);return()=>{clearTimeout(me),document.removeEventListener("mousedown",S,!0),document.removeEventListener("keydown",K,!0)}},[fo]),$.useEffect(()=>{mo(!1)},[x]),$.useEffect(()=>()=>clearTimeout(si.current),[]),$.useEffect(()=>()=>clearTimeout(Kn.current),[]),$.useEffect(()=>{let S=Cn.current;if(!S||Q===null){Yo(0);return}let K=()=>{Yo(S.offsetHeight)};if(K(),typeof ResizeObserver>"u")return;let me=new ResizeObserver(K);return me.observe(S),()=>me.disconnect()},[Q]);let fa=$.useCallback(async()=>{if(!Yn)try{await navigator.clipboard.writeText(x),ua(!0),clearTimeout(si.current),si.current=setTimeout(()=>ua(!1),2e3),_?.(x,!0)}catch{_?.(x,!1)}},[x,_,Yn]),er=$.useCallback(S=>{S.currentTarget.setAttribute("data-loaded","true")},[]),ma=$.useMemo(()=>({background:Km(x)}),[x]),tr=$.useMemo(()=>f||pn(r,x,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[f,r,x,i]),li=$.useMemo(()=>qm(re),[re]),{containerRef:ep,valueRef:tp,scale:np}=Ym(Tt?"\u2022\u2022\u2022\u2022\u2022\u2022":re),ga=F||L?(0,u.jsxs)("div",{className:"wi-legal-links",children:[F&&(0,u.jsx)("a",{className:"wi-legal-link",href:F,target:"_blank",rel:"noopener noreferrer","data-track":"terms_link",onClick:S=>Ve(S,F,{category:"terms",origin:"terms"},de),children:j}),F&&L&&(0,u.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),L&&(0,u.jsx)("a",{className:"wi-legal-link",href:L,target:"_blank",rel:"noopener noreferrer","data-track":"privacy_link",onClick:S=>Ve(S,L,{category:"privacy",origin:"privacy"},de),children:Z})]}):null,ha=I?(0,u.jsxs)("button",{type:"button",className:"wi-disconnect-btn","data-track":"disconnect",onClick:()=>{I(),k()},children:[(0,u.jsx)(ns,{size:16}),(0,u.jsx)("span",{className:"wi-disconnect-label",children:z})]}):null,op=m&&!P?(0,u.jsxs)("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[(0,u.jsxs)("button",{type:"button",className:ge("wi-action-card",Je&&"wi-action-card--dimmed"),onClick:Ct,disabled:!N&&!Je,"aria-disabled":Je||void 0,"aria-label":"Buy","data-track":"buy",children:[(0,u.jsx)(ls,{size:20}),(0,u.jsx)("span",{children:"Buy"})]}),y?(0,u.jsxs)("button",{type:"button",className:ge("wi-action-card",ut&&"wi-action-card--dimmed"),onClick:Yd,"aria-disabled":ut||void 0,"aria-label":"Bridge","data-track":"bridge_open",children:[(0,u.jsx)(cs,{size:20}),(0,u.jsx)("span",{children:"Bridge"})]}):(0,u.jsxs)("button",{type:"button",className:"wi-action-card",onClick:uo,disabled:!uo,"aria-label":"Receive","data-track":"receive",children:[(0,u.jsx)(ur,{size:20}),(0,u.jsx)("span",{children:"Receive"})]}),(0,u.jsxs)("button",{type:"button",className:ge("wi-action-card",Ye&&"wi-action-card--dimmed"),onClick:Jd,disabled:!Ye&&!ai,"aria-disabled":Ye||void 0,"aria-label":"Send","data-track":"send_open",children:[(0,u.jsx)(as,{size:20}),(0,u.jsx)("span",{children:"Send"})]}),te?(0,u.jsxs)("button",{type:"button",className:"wi-action-card",onClick:()=>ft("portfolio"),"aria-label":"View portfolio","data-track":"portfolio_open",children:[(0,u.jsx)(ss,{size:20}),(0,u.jsx)("span",{children:"Portfolio"})]}):y?(0,u.jsxs)("button",{type:"button",className:"wi-action-card",onClick:uo,disabled:!uo,"aria-label":"Receive","data-track":"receive",children:[(0,u.jsx)(ur,{size:20}),(0,u.jsx)("span",{children:"Receive"})]}):null]}):null,rp=(0,u.jsxs)("div",{className:ge("wi-view-inner",Be.current&&"wi-view-wallet"),children:[A&&(0,u.jsxs)("div",{className:"wi-total-section",children:[(0,u.jsxs)("div",{className:"wi-total-head",children:[(0,u.jsx)("span",{className:"wi-total-label",children:xe}),(0,u.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:S=>{S.stopPropagation(),qt(K=>!K)},onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),S.stopPropagation(),qt(K=>!K))},"aria-label":Tt?"Show balance":"Hide balance","data-track":"balance_toggle",children:Tt?(0,u.jsx)(rs,{}):(0,u.jsx)(os,{})})]}),(0,u.jsx)("div",{className:"wi-total-body",ref:ep,children:Rt?(0,u.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):(0,u.jsx)("div",{className:"wi-total-value","data-hidden":Tt||void 0,ref:tp,style:{"--wi-total-scale":np},children:Tt?(0,u.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,u.jsxs)(u.Fragment,{children:[Fe&&(0,u.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,u.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,u.jsx)("span",{className:"wi-total-amount",children:li.main}),li.decimal&&(0,u.jsx)("span",{className:"wi-total-decimal",children:li.decimal})]})})})]}),ae==="top"&&(P?(0,u.jsx)("div",{className:"wi-nav-fixed",children:P}):op),m&&(0,u.jsx)("div",{ref:pa,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,u.jsxs)("div",{className:"wi-token-list",children:[jt&&Array.from({length:5},(S,K)=>(0,u.jsxs)("div",{className:"wi-skeleton-item",children:[(0,u.jsxs)("div",{className:"wi-skeleton-left",children:[(0,u.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,u.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,u.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,u.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,u.jsxs)("div",{className:"wi-skeleton-right",children:[(0,u.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,u.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},K)),!jt&&Se.length===0&&!g&&(0,u.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),Se.map(S=>{let K=et.get(At(S.chainId,S.address)),me=K?parseFloat(K.percent_change_24h):null,mt=me!==null&&me>=0,we=Ro(r,S.chainId),st=Ps(S.address);return(0,u.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>Vd(S),"aria-label":`View ${S.symbol} detail`,"data-track":"token_detail","data-track-id":S.symbol,children:[(0,u.jsxs)("div",{className:"wi-token-left",children:[(0,u.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,u.jsx)("img",{src:S.icon_url,alt:S.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:er,onError:Wt=>{Wt.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),we&&(0,u.jsx)("img",{src:we,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Wt=>{Wt.currentTarget.style.display="none"}})]}),(0,u.jsxs)("div",{className:"wi-token-info",children:[(0,u.jsxs)("span",{className:"wi-token-name-row",children:[(0,u.jsx)("span",{className:"wi-token-name",children:S.symbol}),st&&Vt!==null&&(0,u.jsx)("span",{className:"wi-token-apr",children:`APR ${Vt>=0?"+":"-"}${(Vt>=0?Math.floor:Math.ceil)(Math.abs(Vt)*100)/100}%`})]}),K&&(0,u.jsxs)("div",{className:"wi-token-price-row",children:[(0,u.jsx)("span",{className:"wi-token-price",children:Bn(K.price)}),(0,u.jsx)("span",{className:"wi-token-change","data-positive":mt,"data-zero":me===0||void 0,children:me!==null&&(me===0?"0%":`${mt?"+":"-"}${(mt?Math.floor:Math.ceil)(Math.abs(me)*100)/100}%`)})]})]})]}),(0,u.jsxs)("div",{className:"wi-token-right",children:[(0,u.jsx)("span",{className:"wi-token-balance",children:yn(S.quantity.numeric,S.quantity.decimals)}),K&&(0,u.jsx)("span",{className:"wi-token-value",children:fr(S.quantity.numeric,S.quantity.decimals,K.price)})]})]},`${S.address}-${S.chainId}`)}),g&&Qo&&Array.from({length:3},(S,K)=>(0,u.jsxs)("div",{className:"wi-skeleton-item",children:[(0,u.jsxs)("div",{className:"wi-skeleton-left",children:[(0,u.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,u.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,u.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,u.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,u.jsxs)("div",{className:"wi-skeleton-right",children:[(0,u.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,u.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${K}`)),g&&!Qo&&!jt&&Se.length===0&&J.length===0&&(0,u.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),g&&J.map(S=>{let K=Y.get(S.token)||"",me=Ro(r,Me[r].cross);return(0,u.jsxs)("div",{className:"wi-token-item",children:[(0,u.jsxs)("div",{className:"wi-token-left",children:[(0,u.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,u.jsx)("img",{src:K||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:S.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:er,onError:mt=>{mt.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),me&&(0,u.jsx)("img",{src:me,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:mt=>{mt.currentTarget.style.display="none"}})]}),(0,u.jsxs)("div",{className:"wi-token-info",children:[(0,u.jsx)("span",{className:"wi-token-name",children:S.token_name}),(0,u.jsx)("div",{className:"wi-token-price-row",children:(0,u.jsxs)("span",{className:"wi-token-price",children:[yn(S.current_price,18)," CROSS"]})})]})]}),(0,u.jsxs)("div",{className:"wi-token-right",children:[(0,u.jsx)("span",{className:"wi-token-balance",children:yn(S.balance,18)}),(0,u.jsx)("span",{className:"wi-token-value",children:Bn(S.current_value_usd)})]})]},`forge-${S.token}`)})]})}),ae==="bottom"&&P&&(0,u.jsx)("div",{className:"wi-nav-fixed",children:P}),ha&&(0,u.jsx)("div",{className:"wi-wallet-disconnect-row",children:ha})]},"wallet"),ip=te?(0,u.jsx)("div",{className:ge("wi-view-inner wi-portfolio-body",Be.current&&"wi-view-portfolio"),children:(0,u.jsx)(Un,{env:r,theme:i,walletAddress:x,showHeader:!1,onOutlink:de,lpBalanceReader:Ze,stakingRewardsReader:it,sendTransaction:ze,estimateGas:pt,sections:Ne})},"portfolio"):null,ap=ce?(0,u.jsx)("div",{className:ge("wi-view-inner wi-send-body",Be.current&&"wi-view-send"),children:(0,u.jsx)(To,{env:r,theme:i,walletAddress:x,accountName:h,accounts:v,initialStep:jd,token:ce,tokens:Se,onTokenChange:V,sendTransaction:ze,getTransactionReceipt:Ke,estimateGas:pt,getTokenPriceUsd:S=>{let K=et.get(At(S.chainId,S.address));if(!K?.price)return;let me=parseFloat(K.price);return Number.isFinite(me)?me:void 0},onClose:k,onBackToWallet:Zo,onSubmitted:Qd,onSuccess:Zd,onFailed:Xd,onOutlink:de})},"send"):null,sp=$.useMemo(()=>$e||Se.map(S=>{let K=et.get(At(S.chainId,S.address)),me=K?.price?parseFloat(K.price):void 0;return{name:S.name,symbol:S.symbol,chainId:S.chainId,address:S.address,decimals:S.quantity.decimals,balance:oo(S.quantity.numeric,S.quantity.decimals),iconUrl:S.icon_url,priceUsd:Number.isFinite(me)?me:void 0}}),[$e,et,Se]),lp=(0,u.jsx)("div",{className:ge("wi-view-inner wi-bridge-body",Be.current&&"wi-view-send"),children:(0,u.jsx)(Oo,{env:r,walletAddress:x,tokens:sp,history:at,termsUrl:F,getQuote:Xe,getToTokens:It,getApproval:on,approveBridge:bt,submitBridge:yt,onClose:k,onBackToWallet:Zo})},"bridge"),cp=D?(0,u.jsx)("div",{className:ge("wi-view-inner wi-token-detail-body",Be.current&&"wi-view-send"),children:(0,u.jsx)(fd,{env:r,isMobile:a,token:D,walletAddress:x,stat:et.get(At(D.chainId,D.address)),tokenInfo:sn.get(No(D.chainId,D.address)),showBalance:m,onBack:qd,onClose:k,onSend:Kd,onOutlink:de})},"token-detail"):null,ci=!!C&&h?.trim().toLowerCase()!=="my wallet",ba=(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("span",{className:"wi-receive-avatar",children:[(0,u.jsx)("span",{className:"wi-avatar-fallback",style:ma}),tr&&(0,u.jsx)("img",{src:tr,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:er,onError:S=>{S.currentTarget.style.display="none"}})]}),(0,u.jsx)("span",{className:"wi-receive-account-name",children:h??"Account 1"}),ci&&(0,u.jsx)("span",{className:"wi-receive-chevron","data-open":fo,"aria-hidden":"true",children:(0,u.jsx)(Fn,{size:16})})]}),dp=(0,u.jsxs)("div",{className:ge("wi-view-inner wi-qr-body",Be.current&&"wi-view-qr"),children:[(0,u.jsxs)("div",{className:"wi-receive-section",children:[ci?(0,u.jsx)("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{mo(!0),C?.()},"aria-label":"Switch account",children:ba}):(0,u.jsx)("div",{className:"wi-receive-account",children:ba}),(0,u.jsxs)("div",{className:"wi-qr-block",children:[(0,u.jsxs)("div",{className:"wi-qr-box",children:[(0,u.jsx)(md.QRCodeSVG,{value:x,size:180,level:"H",marginSize:2,...b&&{imageSettings:{src:b,height:33,width:33,excavate:!0}}}),!b&&(0,u.jsx)("div",{className:"wi-qr-logo",children:(0,u.jsx)(is,{size:33})})]}),(0,u.jsx)("p",{className:"wi-qr-address",children:x})]}),(0,u.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:fa,"data-track":"address_copy",children:[(0,u.jsx)("span",{className:"wi-qr-copy-icon",children:Yn?(0,u.jsx)(cn,{size:16}):(0,u.jsx)(An,{size:16})}),(0,u.jsx)("span",{className:"wi-qr-copy-text",children:Yn?"Copied!":"Copy address"})]})]}),ga&&(0,u.jsx)("div",{className:"wi-receive-footer",children:ga})]},"qr"),pp=B==="qr"||B==="portfolio"||B==="send"||B==="bridge",wa=Q!==null?(0,u.jsx)("div",{className:"wi-builtin-footer",children:Q}):null,xa=(0,u.jsxs)("div",{className:"wi-account-text",children:[ci?(0,u.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{mo(!0),C?.()},"aria-label":"Switch account","aria-expanded":fo,children:[(0,u.jsx)("span",{className:"wi-account-name",children:h??"Account 1"}),(0,u.jsx)("span",{className:"wi-account-switch","data-open":fo,"aria-hidden":"true",children:(0,u.jsx)(Fn,{size:20})})]}):(0,u.jsx)("div",{className:"wi-account-row",children:(0,u.jsx)("span",{className:"wi-account-name",children:h??"Account 1"})}),(0,u.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:fa,"aria-label":"Copy address","data-track":"address_copy",children:[(0,u.jsx)("span",{className:"wi-account-address",children:ct(x)}),(0,u.jsx)("span",{className:"wi-account-copy","data-copied":Yn,children:Yn?(0,u.jsx)(cn,{size:12}):(0,u.jsx)(An,{size:12})})]})]}),ya=(0,u.jsxs)(u.Fragment,{children:[o,B==="qr"?(0,u.jsx)("div",{className:"wi-sticky-header",children:(0,u.jsxs)("div",{className:"wi-header wi-header--receive",children:[(0,u.jsx)("button",{type:"button",className:"wi-header-back",onClick:Zo,"aria-label":"Back",children:(0,u.jsx)(dn,{size:24})}),(0,u.jsx)("span",{className:"wi-receive-title",children:"Receive"}),(0,u.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,u.jsx)(Lt,{size:24})})]})}):B==="send"||B==="bridge"||B==="token-detail"?null:pp?(0,u.jsxs)("div",{className:"wi-sticky-header",children:[(0,u.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,u.jsx)("button",{type:"button",className:"wi-header-back",onClick:Zo,"aria-label":"Back",children:(0,u.jsx)(dn,{size:24})}),(0,u.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:xa}),(0,u.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,u.jsx)(Lt,{size:24})})]}),(0,u.jsx)("hr",{className:"wi-divider"})]}):(0,u.jsxs)("div",{className:"wi-sticky-header",children:[(0,u.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,u.jsxs)("div",{className:"wi-account-block",children:[(0,u.jsxs)("div",{className:"wi-avatar",children:[(0,u.jsx)("div",{className:"wi-avatar-fallback",style:ma}),tr&&(0,u.jsx)("img",{src:tr,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:er,onError:S=>{S.currentTarget.style.display="none"}})]}),xa]}),(0,u.jsxs)("div",{className:"wi-header-actions",children:[p&&y&&(0,u.jsx)("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:uo,"aria-label":"Show QR code","data-track":"receive",children:(0,u.jsx)(ur,{size:20})}),(0,u.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,u.jsx)(Lt,{size:24})})]})]}),(0,u.jsx)("hr",{className:"wi-divider"})]}),(0,u.jsxs)("div",{className:"wi-view-container",children:[B==="wallet"&&rp,B==="qr"&&dp,B==="portfolio"&&ip,B==="send"&&ap,B==="bridge"&&lp,B==="token-detail"&&cp]}),B==="wallet"&&St&&(0,u.jsx)("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:St}),B==="wallet"&&tt&&(0,u.jsxs)("a",{className:"wi-send-toast",href:ri??"#",target:"_blank",rel:"noopener noreferrer",onClick:S=>{if(!ri){S.preventDefault();return}Ve(S,ri,{category:"send",origin:"send-transaction",payload:{chainId:tt.chainId,txHash:tt.txHash}},de)},children:[(0,u.jsx)("span",{className:"wi-send-toast-icon","data-status":tt.status,"aria-hidden":!0,children:tt.status==="pending"?(0,u.jsx)("span",{className:"wi-send-toast-spinner"}):tt.status==="error"?(0,u.jsx)("span",{className:"wi-send-toast-error-dot"}):(0,u.jsx)(ds,{size:20})}),(0,u.jsxs)("span",{className:"wi-send-toast-copy",children:[(0,u.jsx)("span",{className:"wi-send-toast-title",children:tt.status==="pending"?"Sending...":tt.status==="error"?"Send failed":"Send complete"}),(0,u.jsx)("span",{className:"wi-send-toast-desc",children:tt.status==="pending"||tt.status==="error"?tt.description:"Tap to see your transaction"})]})]}),wa&&B!=="portfolio"&&B!=="send"&&B!=="token-detail"&&(0,u.jsx)("div",{className:"wi-sticky-footer",children:(0,u.jsx)("div",{className:"wi-footer",ref:Cn,children:wa})})]}),va={...E,...qn>0?{"--wi-footer-height":`${qn}px`}:null};return a?(0,u.jsx)(Ce,{feature:"wallet_info",children:(0,u.jsxs)(Wo.Drawer.Portal,{children:[c&&(0,u.jsx)(Wo.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,u.jsxs)(Wo.Drawer.Content,{className:ge("wi-drawer-content",n),"data-theme":i,"data-vaul-no-drag":l==="left"||l==="right"?!0:void 0,style:va,"data-direction":l,"data-no-balance":!m||void 0,"data-has-footer":qn>0||void 0,"data-view":B,children:[(0,u.jsx)(Wo.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),ya]})]})}):(0,u.jsxs)(Ce,{feature:"wallet_info",children:[c&&s&&(0,u.jsx)("div",{className:"wi-drawer-overlay",onClick:k}),(0,u.jsx)(Kr.Portal,{children:(0,u.jsx)(Kr.Content,{align:e,sideOffset:t,className:ge("wi-popover-content",n),"data-theme":i,style:va,"data-no-balance":!m||void 0,"data-has-footer":qn>0||void 0,"data-view":B,children:ya})})]})}var hd=H(require("react"),1);function bd({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=wn();return hd.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}var wd=H(require("react"),1);function xd({children:e}){let{setFooterContent:t}=wn();return wd.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}ie(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-system-orange-default, #f0640d);--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-system-orange-default, #f0640d);--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)}
12
- `);ie(`.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}
13
- `);ie(`@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}}
14
- `);ie(`.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:min(680px,calc(100dvh - 32px));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(680px + 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:calc(36px * var(--wi-total-scale, 1));color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:calc(22px * var(--wi-total-scale, 1));color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:calc(32px * var(--wi-total-scale, 1));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-row{display:flex;align-items:center;gap:6px;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-apr{flex-shrink:0;font-family:inherit;font-size:12px;font-weight:600;line-height:1;color:var(--ds-system-purple-high, #9b78ff);background:var(--ds-system-purple-low, #2e2854);padding:4px;border-radius:6px;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-system-orange-default, #f0640d)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(255,159,33,.22);border-top-color:var(--ds-system-orange-on-inverted, #ff9f21);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-system-orange-on-inverted, #ff9f21)}.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}
15
- `);ie(`.wi-td-header-title{position:absolute;left:50%;transform:translate(-50%);display:inline-flex;align-items:center;gap:8px;pointer-events:none}.wi-td-header-icon{width:24px;height:24px;object-fit:contain;flex-shrink:0}.wi-td-header-name{font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--wi-texticon-primary, #ffffff)}.wi-td-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;display:flex;flex-direction:column;gap:24px;padding:20px 24px 24px;background:transparent;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .wi-td-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-td-scroll::-webkit-scrollbar{width:4px}.wi-td-scroll::-webkit-scrollbar-track{background:transparent}.wi-td-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-td-scroll::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-td-scroll::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-td-scroll::-webkit-scrollbar-thumb:hover{background:#0003}.wi-td-chart{display:flex;flex-direction:column;gap:14px}.wi-td-chart-panel{display:flex;flex-direction:column;gap:4px}.wi-td-chart-price{font-size:26px;font-weight:700;line-height:1.15;color:var(--wi-texticon-primary, #ffffff)}.wi-td-chart-change{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--ds-system-green-high, #00a869)}.wi-td-chart-change[data-positive=false]{color:var(--wi-error, #e70077)}.wi-td-chart-when{font-weight:400;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-chart-plot{position:relative;width:100%;height:150px}.wi-td-chart-svg{display:block;width:100%;height:150px;overflow:visible;touch-action:none}.wi-td-chart-minmax{fill:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));font-size:11px;font-family:inherit}.wi-td-chart-cursor{stroke:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));stroke-width:1;stroke-dasharray:3 3}.wi-td-chart-skeleton{width:100%;height:150px;border-radius:12px}.wi-td-chart-tabs{display:flex;gap:6px;justify-content:space-between}.wi-td-chart-tab{flex:1;padding:7px 0;border:none;border-radius:8px;background:transparent;cursor:pointer;font-family:inherit;font-size:13px;font-weight:600;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));transition:background .15s ease,color .15s ease}.wi-td-chart-tab[data-active]{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1));color:var(--wi-texticon-primary, #ffffff)}.wi-td-chart-tab:hover:not([data-active]){color:var(--wi-texticon-primary, #ffffff)}.wi-td-balance-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px;border-radius:16px;background:var(--wi-surface-default, rgba(255, 255, 255, .05))}.wi-td-balance-left{display:flex;flex-direction:column;gap:4px;flex:1 1 0;min-width:0}.wi-td-balance-label{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff)}.wi-td-balance-amount{font-size:30px;font-weight:700;line-height:1.15;color:var(--wi-texticon-primary, #ffffff);white-space:nowrap;max-width:100%}.wi-td-balance-fiat{font-size:14px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-send-btn{display:inline-flex;align-items:center;gap:6px;flex-shrink:0;padding:12px 22px;border:none;border-radius:999px;cursor:pointer;font-family:inherit;font-size:15px;font-weight:600;color:var(--wi-on-primary, #ffffff);background:var(--wi-primary, #019d92);transition:filter .15s ease}.wi-td-send-btn:hover{filter:brightness(1.06)}.wi-td-send-btn:active{filter:brightness(.94)}.wi-td-section{display:flex;flex-direction:column;gap:14px}.wi-td-section-title{margin:0;font-size:18px;font-weight:700;letter-spacing:-.01em;color:var(--wi-texticon-primary, #ffffff)}.wi-td-rows{display:flex;flex-direction:column;gap:12px}.wi-td-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.wi-td-row-label{font-size:15px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-row-value{font-size:15px;font-weight:500;color:var(--wi-texticon-primary, #ffffff);text-align:right;word-break:break-all}.wi-td-row-link,.wi-td-row-copy{display:inline-flex;align-items:center;gap:6px;border:none;background:transparent;padding:0;cursor:pointer;font-family:inherit;text-decoration:none}.wi-td-row-link:hover,.wi-td-row-copy:hover{opacity:.8}.wi-td-external-icon{color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));flex-shrink:0}.wi-td-row-copy svg{color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));flex-shrink:0}.wi-td-social-row{display:flex;flex-wrap:wrap;gap:10px}.wi-td-social-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;color:var(--wi-texticon-primary, #ffffff);background:var(--wi-surface-default, rgba(255, 255, 255, .05));text-decoration:none;transition:background .15s ease}.wi-td-social-btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-list{display:flex;flex-direction:column;gap:10px}.wi-td-history-item{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05));text-decoration:none}.wi-td-history-item--link{cursor:pointer;transition:background .15s ease}.wi-td-history-item--link:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-top,.wi-td-history-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}.wi-td-history-type{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff)}.wi-td-history-type[data-direction=receive]{color:var(--ds-system-green-high, #00a869)}.wi-td-history-type[data-direction=bridge-in],.wi-td-history-type[data-direction=bridge-out]{color:var(--wi-primary, #f0640d)}.wi-td-history-counter{font-size:14px;color:var(--wi-primary, #f0640d);font-variant-numeric:tabular-nums}.wi-td-history-meta{display:inline-flex;align-items:center;gap:8px;min-width:0}.wi-td-history-status{font-size:14px;font-weight:500}.wi-td-history-status[data-status=success]{color:var(--ds-system-green-high, #00a869)}.wi-td-history-status[data-status=fail]{color:var(--wi-error, #e70077)}.wi-td-history-time{font-size:14px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-history-amount{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff);text-align:right;word-break:break-all}.wi-td-history-skeleton{display:flex;align-items:center;justify-content:space-between;padding:16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05))}.wi-td-history-empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:28px 16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05));color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));font-size:14px;text-align:center}.wi-td-retry-btn{padding:8px 18px;border:1px solid var(--wi-border-subtle, rgba(255, 255, 255, .1));border-radius:999px;background:transparent;color:var(--wi-texticon-primary, #ffffff);font-family:inherit;font-size:13px;font-weight:600;cursor:pointer}.wi-td-retry-btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-sentinel{display:flex;align-items:center;justify-content:center;min-height:32px}.wi-td-history-loading{font-size:13px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-loadmore-btn{align-self:center;margin-top:2px;padding:10px 24px;border:1px solid var(--wi-border-subtle, rgba(255, 255, 255, .1));border-radius:999px;background:transparent;color:var(--wi-texticon-primary, #ffffff);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:background .15s ease}.wi-td-loadmore-btn:hover:not(:disabled){background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-loadmore-btn:disabled{cursor:default;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}
16
- `);ie(`.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}
17
- `);var Yr=require("react/jsx-runtime");function Qm({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:o,modal:r,showBalance:i=!1,showForgeToken:a=!1,showGameToken:s=!0,showQR:l=!0,showBridge:c=!0,qrLogoSrc:m,walletAddress:g,accountName:w,sendAccounts:p,profileImageUrl:y,connectorId:b,connectorName:x,connectorIconUrl:h,preferredTokens:v=[],onSelectWallet:f,onCopyAddress:T,onBuy:k,onBuyDisabledMessage:C,onBridgeDisabledMessage:_,onSendDisabledMessage:N,onDisconnect:I,disconnectLabel:z="Disconnect",termsUrl:F=to,termsLabel:j="Terms of Service",privacyUrl:L=mr,privacyLabel:Z="Privacy Policy",open:E,onOpenChange:P,showPortfolio:ae=!1,portfolioTitle:Q="My Portfolio",portfolioSections:B,showTotalAssets:ue=!0,totalAssetsLabel:ce="Total Assets USD",sendTransaction:V,getTransactionReceipt:D,estimateGas:X,onOutlink:te,lpBalanceReader:be,stakingRewardsReader:Ne,bridgeTokens:ne,bridgeHistory:xe,getBridgeQuote:ze,getBridgeToTokens:Ke,getBridgeApproval:pt,approveBridge:de,submitBridge:Ze,onReceive:it,onBridge:$e,onSend:at,style:Xe,children:It}){let on=je(e),bt=b?ko[b]:void 0,yt=x??bt?.name,vt=h??bt?.iconUrl,_t=Jn(`(max-width: ${n}px)`),He=o??(i?"right":"bottom"),Dt=He==="left"||He==="right",kt=r??!1,St=E!==void 0,[rn,Pt]=rt.useState(!1),_e=St?E:rn,Je=rt.useCallback(Cn=>{St||Pt(Cn),P?.(Cn)},[St,P]),Ct=rt.useCallback(()=>Je(!1),[Je]),[ut,Ye]=rt.useState(null),[Ot,jt]=rt.useState("top"),[et,Vt]=rt.useState(null),[an,sn]=rt.useState("wallet"),[A,re]=rt.useState(null),[Fe,Rt]=rt.useState(null);rt.useEffect(()=>{_e||(sn("wallet"),re(null),Rt(null))},[_e]),rt.useEffect(()=>{In(g)},[g]);let Tt=rt.useCallback(()=>{Ri(g),I?.()},[I,g]),qt=rt.useMemo(()=>({env:on,theme:t,isMobile:_t,open:_e,drawerDirection:He,modal:kt,showBalance:i,showForgeToken:a,showGameToken:s,showQR:l,showBridge:c,qrLogoSrc:m,walletAddress:g,accountName:w,sendAccounts:p,profileImageUrl:y,connectorName:yt,connectorIconUrl:vt,preferredTokens:v,close:Ct,onSelectWallet:f,onCopyAddress:T,onBuy:k,onBuyDisabledMessage:C,onBridgeDisabledMessage:_,onSendDisabledMessage:N,onDisconnect:I?Tt:void 0,disconnectLabel:z,termsUrl:F,termsLabel:j,privacyUrl:L,privacyLabel:Z,portalStyle:Xe,navContent:ut,navPosition:Ot,setNavContent:Ye,setNavPosition:jt,footerContent:et,setFooterContent:Vt,view:an,setView:sn,selectedSendToken:A,setSelectedSendToken:re,selectedDetailToken:Fe,setSelectedDetailToken:Rt,showPortfolio:ae,portfolioTitle:Q,portfolioSections:B,showTotalAssets:ue,totalAssetsLabel:ce,sendTransaction:V,getTransactionReceipt:D,estimateGas:X,onOutlink:te,lpBalanceReader:be,stakingRewardsReader:Ne,bridgeTokens:ne,bridgeHistory:xe,getBridgeQuote:ze,getBridgeToTokens:Ke,getBridgeApproval:pt,approveBridge:de,submitBridge:Ze,onReceive:it,onBridge:$e,onSend:at}),[on,t,_t,_e,He,kt,i,a,s,l,c,m,g,w,p,y,yt,vt,v,Ct,f,T,k,C,_,N,I,Tt,z,F,j,L,Z,Xe,ut,Ot,et,an,A,Fe,ae,Q,B,ue,ce,V,D,X,te,be,Ne,ne,xe,ze,Ke,pt,de,Ze,it,$e,at]);return(0,Yr.jsx)(yi.Provider,{value:qt,children:_t?(0,Yr.jsx)(vd.Drawer.Root,{direction:He,open:_e,onOpenChange:Je,handleOnly:Dt,noBodyStyles:!0,repositionInputs:!1,children:It},"drawer"):(0,Yr.jsx)(yd.Root,{open:_e,onOpenChange:Je,children:It},"popover")})}var jn=Object.assign(Qm,{Trigger:Ys,Content:gd,Nav:bd,Footer:xd});var nn=H(require("react"),1),Wd=H(require("@radix-ui/react-dialog"),1),Ud=require("vaul");var Qr=require("react"),Zr=(0,Qr.createContext)(null);function Uo(){let e=(0,Qr.useContext)(Zr);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var Vn=require("react");function Go(){let[e,t]=(0,Vn.useState)([]),[n,o]=(0,Vn.useState)(!0);(0,Vn.useEffect)(()=>{if(typeof window>"u"){o(!1);return}let i=[],a=l=>{let{info:c}=l.detail;c?.rdns&&!i.some(m=>m.rdns===c.rdns)&&(i.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let s=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(s)}},[]);let r=(0,Vn.useCallback)(i=>e.some(a=>a.rdns===i),[e]);return{wallets:e,isDetected:r,isLoading:n}}var kd=H(require("@radix-ui/react-dialog"),1),Sd=require("vaul");var Xr=require("react/jsx-runtime");function Cd({asChild:e,children:t}){let{isMobile:n}=Uo(),o=n?Sd.Drawer.Trigger:kd.Trigger;return(0,Xr.jsx)(Ce,{feature:"wallet_connect",children:(0,Xr.jsx)(o,{asChild:e??t!=null,children:t??(0,Xr.jsx)("button",{type:"button","data-track":"open",children:"Connect Wallet"})})})}var Md=require("react"),Dd=require("@nexus-cross/crossx-design-system"),tn=H(require("@radix-ui/react-dialog"),1),zo=require("vaul");var ei=require("@nexus-cross/crossx-design-system");var oe=require("react/jsx-runtime"),Zm='<svg width="100%" height="100%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',Xm=`data:image/svg+xml,${encodeURIComponent(Zm)}`;function Jr(){return(0,oe.jsx)("img",{src:Xm,width:40,height:40,alt:"",style:{display:"block"}})}function Rd(){return(0,oe.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,oe.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,oe.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,oe.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,oe.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,oe.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,oe.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,oe.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,oe.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,oe.jsx)("defs",{children:(0,oe.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,oe.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function Td(){return(0,oe.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,oe.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,oe.jsx)("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),(0,oe.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,oe.jsx)("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),(0,oe.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 Nd(){return(0,oe.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,oe.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,oe.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,oe.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,oe.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 Ed(){return(0,oe.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,oe.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,oe.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,oe.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,oe.jsx)("defs",{children:(0,oe.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,oe.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function Id(){return(0,oe.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[(0,oe.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,oe.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,oe.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,oe.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 _d(){return(0,oe.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.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 Pd(){return(0,oe.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var ti={cross_embedded:{id:"cross_embedded",name:ei.WALLET_LABELS.social,description:"Sign in with Google or Apple",icon:Jr},cross_wallet:{id:"cross_wallet",name:ei.WALLET_LABELS.app,description:"App approval is required",icon:Jr,featured:!0},cross_extension:{id:"cross_extension",name:ei.WALLET_LABELS.extension,description:"Browser extension approval is required",icon:Jr,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:Rd,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:Td},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Nd,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Ed,badge:"For SHOP"}};function ra(e){return ti[e]}var ni={google:{id:"google",name:"Google",icon:Id},apple:{id:"apple",name:"Apple",icon:_d}};function Ld(e){return ni[e]}var W=require("react/jsx-runtime");function Ad(e,t){Pe("connect","wallet_selected",{tags:{item_id:e}});let n=t?.();n instanceof Promise&&n.then(()=>Pe("connect","connected"),o=>Pe("connect","connected",{status:"failure",reason:wt(o)}))}function Jm({wallet:e,detected:t,onConnect:n}){let o=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}n()},r=e.icon,i=e.featured===!0;return(0,W.jsxs)("button",{type:"button",className:ge("wcm-wallet-item",i&&"wcm-wallet-item--featured"),"data-track":"wallet_item_click","data-track-id":e.id,onClick:o,children:[(0,W.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,W.jsx)("div",{className:"wcm-wallet-icon",children:(0,W.jsx)(r,{})}),(0,W.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,W.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,W.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?(0,W.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,W.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function eg({social:e,onSignIn:t}){let n=e.icon,o=`Sign in with ${e.name}`;return(0,W.jsxs)("button",{type:"button",className:"wcm-social-item","data-provider":e.id,"data-track":"social_provider_click","data-track-id":e.id,onClick:t,"aria-label":o,children:[(0,W.jsx)("span",{className:"wcm-social-icon",children:(0,W.jsx)(n,{})}),(0,W.jsx)("span",{className:"wcm-social-name",children:o})]})}function Fd(){let{wallets:e,activeWalletIds:t,socialProviders:n,activeSocialIds:o,termsUrl:r,privacyUrl:i,isDetected:a,close:s,isMobile:l}=Uo(),c=t.filter(w=>{let p=ra(w).visibility;return!p||p==="always"?!0:p==="desktop-only"?!l:p==="mobile-only"?l:!0}),m=o.length>0,g=c.length>0;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{className:"wcm-header",children:[(0,W.jsxs)("div",{className:"wcm-header-text",children:[(0,W.jsx)("h2",{className:"wcm-title",children:Dd.WALLET_LABELS.default}),!l&&(0,W.jsx)("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),(0,W.jsx)("button",{type:"button",className:"wcm-close-btn","data-track":"close",onClick:s,"aria-label":"Close",children:(0,W.jsx)(Pd,{})})]}),(0,W.jsxs)("div",{className:"wcm-body",children:[m&&(0,W.jsxs)(W.Fragment,{children:[!l&&(0,W.jsxs)("div",{className:"wcm-section-header",children:[(0,W.jsx)("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),(0,W.jsx)("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),(0,W.jsx)("div",{className:"wcm-social-grid",children:o.map(w=>{let p=Ld(w);return(0,W.jsx)(eg,{social:p,onSignIn:()=>{Ad(w,n[w]),s()}},w)})}),g&&(0,W.jsxs)("div",{className:"wcm-separator",children:[(0,W.jsx)("div",{className:"wcm-separator-line"}),(0,W.jsx)("span",{className:"wcm-separator-text",children:"Other Wallets"}),(0,W.jsx)("div",{className:"wcm-separator-line"})]})]}),g&&(0,W.jsx)("div",{className:"wcm-wallet-list",children:c.map(w=>{let p=ra(w),y=p.rdns?a(p.rdns):!1;return(0,W.jsx)(Jm,{wallet:p,detected:y,onConnect:()=>{Ad(w,e[w]),s()}},w)})}),(0,W.jsxs)("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",(0,W.jsx)(Bd,{href:r,track:"terms_link",children:"Terms of Service"})," ","and consent to its"," ",(0,W.jsx)(Bd,{href:i,track:"privacy_link",children:"Privacy Policy"}),"."]})]})]})}function Bd({href:e,track:t,children:n}){return e?(0,W.jsx)("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer","data-track":t,children:n}):(0,W.jsx)("span",{className:"wcm-terms-link",children:n})}function Od({className:e}){let{isMobile:t,theme:n,portalStyle:o,open:r}=Uo();return(0,Md.useEffect)(()=>{r&&Pe("connect","opened")},[r]),t?(0,W.jsx)(Ce,{feature:"wallet_connect",children:(0,W.jsxs)(zo.Drawer.Portal,{children:[(0,W.jsx)(zo.Drawer.Overlay,{className:"wcm-overlay"}),(0,W.jsxs)(zo.Drawer.Content,{className:ge("wcm-drawer-content",e),"data-theme":n,style:o,children:[(0,W.jsx)(zo.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,W.jsx)("div",{className:"wcm-drawer-handle"}),(0,W.jsx)("div",{className:"wcm-drawer-body",children:(0,W.jsx)(Fd,{})})]})]})}):(0,W.jsx)(Ce,{feature:"wallet_connect",children:(0,W.jsxs)(tn.Portal,{children:[(0,W.jsx)(tn.Overlay,{className:"wcm-overlay"}),(0,W.jsxs)(tn.Content,{className:ge("wcm-dialog-content",e),"data-theme":n,style:o,children:[(0,W.jsx)(tn.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,W.jsx)(tn.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),(0,W.jsx)("div",{className:"wcm-dialog-body",children:(0,W.jsx)(Fd,{})})]})]})})}ie(`.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-system-orange-low, #fff5ee);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-orange-high, #e56f00);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:#ff8438;border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:#fff;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}
18
- `);ie(`@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)}}
19
- `);var co=require("react/jsx-runtime"),tg={};function ng({wallets:e,socialProviders:t=tg,termsUrl:n,privacyUrl:o,theme:r="dark",mobileBreakpoint:i=768,drawerDirection:a="bottom",dialogWidth:s,drawerMaxWidth:l,drawerMinWidth:c,style:m,open:g,onOpenChange:w,children:p}){let y=Jn(`(max-width: ${i}px)`),[b,x]=nn.useState(!1),h=g!==void 0,v=h?g:b,f=nn.useCallback(F=>{h||x(F),w?.(F)},[h,w]),T=nn.useCallback(()=>f(!1),[f]),{isDetected:k}=Go(),C=nn.useMemo(()=>Object.keys(e),[e]),_=nn.useMemo(()=>Object.keys(t),[t]),N=nn.useMemo(()=>{let F={};return s&&(F["--wcm-dialog-width"]=s),l&&(F["--wcm-drawer-max-width"]=l),c&&(F["--wcm-drawer-min-width"]=c),{...F,...m}},[s,l,c,m]),I=nn.useMemo(()=>({theme:r,isMobile:y,open:v,setOpen:f,close:T,wallets:e,activeWalletIds:C,socialProviders:t,activeSocialIds:_,termsUrl:n??to,privacyUrl:o??mr,isDetected:k,portalStyle:N}),[r,y,v,f,T,e,C,t,_,n,o,k,N]),z=(0,co.jsx)("div",{"data-theme":r,style:N,children:p});return y?(0,co.jsx)(Zr.Provider,{value:I,children:(0,co.jsx)(Ud.Drawer.Root,{direction:a,open:v,onOpenChange:f,noBodyStyles:!0,children:z},"drawer")}):(0,co.jsx)(Zr.Provider,{value:I,children:(0,co.jsx)(Wd.Root,{open:v,onOpenChange:f,children:z})})}var ia=Object.assign(ng,{Trigger:Cd,Content:Od});var zd=require("@nexus-cross/crossx-design-system"),$d=H(require("react"),1);ie(`.cb-button{--cb-bg: var(--ds-accent-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));--cb-bg-hover: var(--cb-bg);--cb-color: #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}
20
- `);ie(`.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)}}
21
- `);var og='<svg preserveAspectRatio="xMidYMid meet" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',rg='<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>',ig='<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>',ag='<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>',sg='<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 $o(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var Ho=$o(og),jo=$o(rg),Vo=$o(ig),qo=$o(ag),Ko=$o(sg);var Ge=require("react/jsx-runtime");function aa({isConnecting:e,address:t,provider:n,providerName:o,accountName:r,sendAccounts:i,onConnect:a,onDisconnect:s,onCopy:l,onSelectWallet:c,onBuy:m,onBuyDisabledMessage:g,label:w="Connect Wallet",connectingLabel:p="Connecting...",disconnectLabel:y,className:b,theme:x="dark",env:h,showBalance:v=!0,showPortfolio:f,drawerDirection:T,modal:k,connectorId:C,style:_,walletInfoStyle:N,sendTransaction:I,getTransactionReceipt:z,estimateGas:F,onReceive:j,onBridge:L,onSend:Z,bridgeTokens:E,bridgeHistory:P,getBridgeQuote:ae,getBridgeToTokens:Q,getBridgeApproval:B,approveBridge:ue,submitBridge:ce}){let V=b?`cb-button ${b}`:"cb-button",D=b?`cb-pill ${b}`:"cb-pill";if($d.useEffect(()=>{In(t)},[t]),e)return(0,Ge.jsxs)("button",{type:"button",disabled:!0,className:V,style:_,"aria-busy":"true",children:[(0,Ge.jsx)("span",{className:"cb-spinner","aria-hidden":"true"}),(0,Ge.jsx)("span",{className:"cb-button-label",children:p})]});if(t){let X=o??pg(n),te=n?cg[n]:void 0;return(0,Ge.jsx)(Ce,{feature:"connect_button",children:(0,Ge.jsxs)(jn,{env:h,theme:x,drawerDirection:T,modal:k,showBalance:v,showPortfolio:f,walletAddress:t,accountName:r,sendAccounts:i,connectorId:C,onSelectWallet:c,onCopyAddress:l?(be,Ne)=>{Ne&&l()}:void 0,onDisconnect:s,disconnectLabel:y,style:N,sendTransaction:I,getTransactionReceipt:z,estimateGas:F,onReceive:j,onBridge:L,onBuy:m,onBuyDisabledMessage:g,onSend:Z,bridgeTokens:E,bridgeHistory:P,getBridgeQuote:ae,getBridgeToTokens:Q,getBridgeApproval:B,approveBridge:ue,submitBridge:ce,children:[(0,Ge.jsx)(jn.Trigger,{asChild:!0,children:(0,Ge.jsxs)("button",{type:"button",className:D,"data-track":"wallet_pill_open",style:_,"aria-label":`Connected with ${X}: ${Gd(t)}`,children:[te?(0,Ge.jsx)("img",{src:te,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":n}):(0,Ge.jsx)("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),(0,Ge.jsx)("span",{className:"cb-pill-address",children:Gd(t)})]})}),(0,Ge.jsx)(jn.Content,{align:"end",sideOffset:8})]})})}return(0,Ge.jsx)(Ce,{feature:"connect_button",children:(0,Ge.jsxs)("button",{type:"button",onClick:a,className:V,"data-track":"connect_click",style:_,"aria-label":typeof w=="string"?w:"Connect Wallet",children:[(0,Ge.jsx)(lg,{}),(0,Ge.jsx)("span",{className:"cb-button-label",children:w})]})})}function lg(){return(0,Ge.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,Ge.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,Ge.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,Ge.jsx)("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var cg={google:qo,apple:Ko,cross:Ho,metamask:jo,binance:Vo},dg={google:"Google",apple:"Apple",cross:zd.WALLET_LABELS.default,metamask:"MetaMask",binance:"Binance Wallet"};function pg(e){return e?dg[e]:"Wallet"}function Gd(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Hd=H(require("react"),1);ie(`.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)}
22
- `);ie(`.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)}}
23
- `);var bn=require("react/jsx-runtime"),sa="https://www.onechain.nexus/skills";function la({label:e="Skills",href:t,onClick:n,className:o,style:r,theme:i,disabled:a=!1,isLoading:s=!1,loadingLabel:l="Loading...",openInNewTab:c=!1,type:m="button"}){let[g,w]=Hd.useState(!1),p=je(),y=En("apps.json",p,k=>Tn(k?.skills,p)),b=t??y,x=async k=>{if(b&&!n){c?window.open(b,"_blank","noopener,noreferrer"):window.location.href=b;return}if(n)try{w(!0),await n()}finally{w(!1)}},h=a||s||g,v=s||g,f=v?l:e,T=o?`sb-button ${o}`:"sb-button";return(0,bn.jsx)(Ce,{feature:"skills",children:(0,bn.jsxs)("button",{type:m,onClick:x,disabled:h,className:T,"data-theme":i,"data-track":"click",style:r,"aria-busy":v,children:[v?(0,bn.jsx)("span",{className:"sb-spinner","aria-hidden":"true"}):(0,bn.jsx)(ug,{}),(0,bn.jsx)("span",{className:"sb-label",children:f})]})})}function ug(){return(0,bn.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,bn.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"})})}rr({mode:"dapp-ui"});0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,BridgeFlow,CHAINS_CONFIG_FILE,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,DEFAULT_SKILLS_HREF,DappUiErrorBoundary,GOOGLE_ICON,METAMASK_ICON,PORTFOLIO_SECTIONS,SOCIAL_REGISTRY,SendFlow,SkillsButton,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,announceAppLauncherUsage,captureDappUiException,getChainDisplay,getDappUiSentryScope,initDappUiSentry,normalizeFailureReason,resolveEnvironment,setDappUiAnalyticsUser,trackDappUiEvent,trackDappUiFunnel,useChainDisplay,useChainsConfig,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});
1
+ "use strict";var Xf=Object.create;var ri=Object.defineProperty;var Jf=Object.getOwnPropertyDescriptor;var $f=Object.getOwnPropertyNames;var em=Object.getPrototypeOf,tm=Object.prototype.hasOwnProperty;var rm=(e,t)=>{for(var r in t)ri(e,r,{get:t[r],enumerable:!0})},ml=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $f(t))!tm.call(e,o)&&o!==r&&ri(e,o,{get:()=>t[o],enumerable:!(n=Jf(t,o))||n.enumerable});return e};var Q=(e,t,r)=>(r=e!=null?Xf(em(e)):{},ml(t||!e||!e.__esModule?ri(r,"default",{value:e,enumerable:!0}):r,e)),nm=e=>ml(ri({},"__esModule",{value:!0}),e);var ow={};rm(ow,{APPLE_ICON:()=>Go,AppLauncher:()=>_a,AppLauncherContent:()=>Qa,AppLauncherTrigger:()=>Ga,BINANCE_ICON:()=>Wo,BridgeFlow:()=>Do,CHAINS_CONFIG_FILE:()=>co,CONNECTOR_REGISTRY:()=>bo,CROSSX_ICON:()=>Uo,ConnectButton:()=>Ls,ConnectorId:()=>pi,DEFAULT_SKILLS_HREF:()=>Ds,DEFAULT_TRUSTED_FACTORIES:()=>un,DappUiErrorBoundary:()=>mo,GOOGLE_ICON:()=>_o,METAMASK_ICON:()=>jo,PORTFOLIO_SECTIONS:()=>Eo,RelayApiError:()=>Wr,RelayDeposit:()=>Qs,RelayHistory:()=>Ks,RelayRecovery:()=>$s,SOCIAL_REGISTRY:()=>ra,SendFlow:()=>vo,SkillsButton:()=>Ps,StatusTracker:()=>tl,TOKEN_STATS_QUERY_KEY:()=>Ni,USER_BALANCE_QUERY_KEY:()=>Si,WALLET_REGISTRY:()=>ta,WalletConnectModal:()=>As,WalletInfo:()=>Pn,WalletPortfolio:()=>vs,WalletPortfolioBody:()=>Mn,announceAppLauncherUsage:()=>oi,captureDappUiException:()=>fo,createRelayClient:()=>rr,getChainDisplay:()=>wl,getDappUiSentryScope:()=>uo,initDappUiSentry:()=>Wn,normalizeFailureReason:()=>ir,resolveEnvironment:()=>Xe,setDappUiAnalyticsUser:()=>wn,trackDappUiEvent:()=>go,trackDappUiFunnel:()=>Ae,useChainDisplay:()=>Un,useChainsConfig:()=>yl,useGlobalMenu:()=>ho,useTokenBalance:()=>Yr,useTokenStats:()=>qr,useWalletDetect:()=>zo});module.exports=nm(ow);var om={};function gl(e){try{return om.env?.[e]}catch{return}}function hl(e){if(!(typeof process>"u"))return process.env?.[e]}function Xe(e){if(e)return bl(e);let t=gl("VITE_CROSSX_ENVIRONMENT")??gl("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??hl("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??hl("CROSSX_ENVIRONMENT");return bl(t)}function bl(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var Lr=Q(require("react"),1),im={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",production:"https://contents.crosstoken.io/frontend/common/app-launcher"},am=3e3;function cr(e,t){if(e!=null)return typeof e=="object"&&!Array.isArray(e)&&("dev"in e||"stage"in e||"production"in e)?e[t]:e}var Oa=new Map;function bn(e,t){let r=`${im[t]}/${e}`,n=Oa.get(r);return n||(n=(async()=>{let o=new AbortController,i=setTimeout(()=>o.abort(),am);try{let a=await fetch(r,{cache:"no-store",signal:o.signal});return a.ok?await a.json():null}catch{return null}finally{clearTimeout(i)}})().then(o=>(o===null&&Oa.delete(r),o)),Oa.set(r,n)),n}function sm(e){return typeof e=="string"&&e.startsWith("https://")}async function Te(e,t){let r=await bn("endpoints.json",t),n=cr(r?.apis?.[e],t);if(!sm(n))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return n}var co="chains.json";async function wl(e,t){return(await bn(co,t))?.chains?.[String(e)]??{}}function Un(e,t){let[r,n]=Lr.useState({});return Lr.useEffect(()=>{if(e==null){n({});return}let o=!0;return bn(co,t).then(i=>{o&&n(i?.chains?.[String(e)]??{})}),()=>{o=!1}},[e,t]),r}function yl(e){let[t,r]=Lr.useState({});return Lr.useEffect(()=>{let n=!0;return bn(co,e).then(o=>{n&&r(o?.chains??{})}),()=>{n=!1}},[e]),t}function Sr(e,t,r){let[n,o]=Lr.useState(void 0),i=Lr.useRef(r);return i.current=r,Lr.useEffect(()=>{let a=!0;return bn(e,t).then(s=>{if(!a)return;let l=i.current(s);l!==void 0&&o(l)}),()=>{a=!1}},[e,t]),n}var po="1.3.10-beta.4";var ni="__nexusCrossAppLauncherRuntime";function lm(){if(typeof window>"u")return null;let e=window;return e[ni]??(e[ni]={mode:"dapp-ui"}),e[ni]}function cm(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 r=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${r} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${po}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${po} \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 oi(e){let t=lm();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),cm(t))}var Dr=require("@sentry/react");var dm="https://5c82aeb32da33b5a0a14b7c5393992ca@o4511668907081728.ingest.de.sentry.io/4511705324126289",pm=`dapp-ui@${po}`,jn=null,xl=1;function vl(){return xl}function um(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function Wn(e){if(jn)return jn;if(typeof window>"u")return null;let t=um(Xe(e?.environment));typeof e?.analyticsSampleRate=="number"&&(xl=Math.min(1,Math.max(0,e.analyticsSampleRate)));let r=new Dr.BrowserClient({dsn:e?.dsn??dm,transport:Dr.makeFetchTransport,stackParser:Dr.defaultStackParser,integrations:[(0,Dr.linkedErrorsIntegration)()],environment:t,release:pm,enabled:e?.enabled??t==="prod"}),n=new Dr.Scope;return n.setClient(r),n.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),r.init(),jn=n,jn}function uo(){return jn}function fo(e,t){let r=jn??Wn();if(r)return r.captureException(e,t?{captureContext:{extra:t}}:void 0)}var kl=require("react");var mo=class extends kl.Component{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,n){fo(r,{componentStack:n.componentStack??void 0,boundary:this.props.name??"dapp-ui"})}render(){return this.state.hasError?this.props.fallback??null:this.props.children}};function Ie(...e){return e.filter(Boolean).join(" ")}function Rl(){return typeof window>"u"?!1:window.navigator.userAgent.includes("CROSSx")}var Sl="__nexus_dapp_ui_uid",Fa=null;function fm(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function Ua(){if(Fa)return Fa;let e=null;try{e=window.localStorage.getItem(Sl)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${fm()}`;try{window.localStorage.setItem(Sl,e)}catch{}}return Fa=e,e}async function Cl(e){if(typeof crypto>"u"||!crypto.subtle)return null;try{let t=new TextEncoder().encode(e.trim().toLowerCase()),r=await crypto.subtle.digest("SHA-256",t);return`wallet_${Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("").slice(0,16)}`}catch{return null}}function mm(){let e=window.navigator.userAgent;return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|iphone|ipod|android/i.test(e)?"mobile":"desktop"}function Il(){return{host:window.location.hostname,device_type:mm(),is_cross_inapp:String(Rl())}}var Nl=!1;function ja(){if(typeof window>"u")return null;let e=uo()??Wn();return e?(Nl||(Nl=!0,e.setUser({id:Ua()})),e):null}function Ml(){return Math.random()>=vl()}var Tl=0;function wn(e){let t=ja();if(!t)return;let r=++Tl;if(!e){t.setUser({id:Ua()});return}Cl(e).then(n=>{n&&r===Tl&&t.setUser({id:n})})}function go(e,t,r){let n=ja();!n||Ml()||n.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Il(),feature:e,action:t,...r}}})}function Ae(e,t,r){let n=ja();if(!n||Ml())return;let o=r?.status??"success";n.captureMessage(`funnel: ${e}_${t}`,"info",{captureContext:{tags:{...Il(),flow:e,funnel_step:`${e}_${t}`,funnel_status:o,...o==="failure"?{failure_reason:r?.reason??"unknown"}:{},...r?.tags}}})}function ir(e){let t=e,r=String((t&&typeof t=="object"&&"message"in t?t.message:e)??"").toLowerCase();return t?.code===4001||/reject|denied|declin|cancel/i.test(r)?"user-rejected":/insufficient (funds|gas|balance)|exceeds balance/i.test(r)?"insufficient-gas":/timeout|timed out|deadline/i.test(r)?"timeout":/revert|execution failed/i.test(r)?"contract-reverted":/network|fetch|connection|disconnected|offline/i.test(r)?"network":"unknown"}var El=require("react");var Al=require("react/jsx-runtime");function ve({feature:e,children:t}){let r=(0,El.useCallback)(n=>{let o=n.nativeEvent;if(o.__dappUiTracked)return;let a=n.target?.closest?.("[data-track]");if(!a)return;let s=a.getAttribute("data-track");if(!s)return;o.__dappUiTracked=!0;let l=a.getAttribute("data-track-id");go(e,s,l?{item_id:l}:void 0)},[e]);return(0,Al.jsx)("div",{style:{display:"contents"},onClick:r,children:t})}var Gn=Q(require("react"),1),Ll=Q(require("@radix-ui/react-popover"),1),Dl=require("vaul");var ii=require("react"),Wa=(0,ii.createContext)(null);function ai(){let e=(0,ii.useContext)(Wa);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var si=require("react");function _n(e){let[t,r]=(0,si.useState)(!1);return(0,si.useEffect)(()=>{let n=window.matchMedia(e);r(n.matches);let o=i=>r(i.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t}function pe(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}pe(`[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-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #3a261f;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #123235);--al-badge-text: var(--ds-accent-primary-default, #00ceb2);--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-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #fff1eb;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #e7f9f8);--al-badge-text: var(--ds-accent-primary-default, #00b4b7);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
2
+ `);pe(`.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
+ `);pe(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
+ `);pe(`.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-menu{display:flex;flex-direction:column;width:424px;max-width:calc(100vw - 32px);padding:0 12px;box-sizing:border-box}.al-popover-content .al-grid{display:grid;grid-template-columns:repeat(4,100px);row-gap:12px;column-gap:0;justify-content:center;align-items:start}.al-popover-content .al-grid-item{position:relative;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:visible}.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-text{flex-direction:column;align-items:center;justify-content:center;gap:2px;max-width:100%;min-height:26px}.al-popover-content .al-grid-item-status-text{font-size:10px;line-height:1.1}.al-popover-content .al-badge-list{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-menu{display:flex;flex-direction:column;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;overflow:visible}.al-drawer-content .al-grid-item-icon{width:32px;height:32px;border-radius:6.75px;overflow:visible}.al-drawer-content .al-grid-item-icon img{width:100%;height:100%;object-fit:cover;border-radius:6.75px}.al-drawer-content .al-grid-item-label{font-size:16px;line-height:1.35;letter-spacing:0;font-weight:400}.al-drawer-content .al-grid-item[data-active=true] .al-grid-item-label{font-weight:500}.al-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0}.al-drawer-title{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--al-text);margin:0}.al-drawer-close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--al-text-secondary);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:flex-start;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:var(--al-bg-hover)!important}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:visible}.al-grid-item-text{display:flex;flex-direction:column;align-items:flex-start;gap:1px;max-width:100%;min-width:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;position:relative;width:24px;height:24px;overflow:visible;border-radius:5px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain;border-radius:inherit}.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-grid-item-status-text{font-family:Inter,sans-serif;font-size:12px;font-weight:400;line-height:1.15;letter-spacing:0;color:var(--al-text);white-space:nowrap}.al-status-ribbon{position:absolute;top:-6px;right:-6px;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;box-sizing:border-box;border-radius:999px;color:#fff;font-family:Pretendard,Inter,sans-serif;font-size:12px;font-weight:800;line-height:1;pointer-events:none;box-shadow:0 1px 3px #0000002e}.al-status-ribbon-new{background:var(--al-new-ribbon-bg)}.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}
5
+ `);pe("");var li=require("react/jsx-runtime");function _a({env:e,theme:t="dark",mobileBreakpoint:r=768,domain:n,children:o}){let i=_n(`(max-width: ${r}px)`),[a,s]=Gn.useState(!1),l=Gn.useCallback(()=>s(!1),[]),c=Xe(e),u=Gn.useMemo(()=>({env:c,theme:t,isMobile:i,open:a,domain:n,close:l}),[c,t,i,a,n,l]);return(0,li.jsx)(Wa.Provider,{value:u,children:i?(0,li.jsx)(Dl.Drawer.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:o},"drawer"):(0,li.jsx)(Ll.Root,{open:a,onOpenChange:s,children:o},"popover")})}var Ol=Q(require("@radix-ui/react-popover"),1),Fl=require("vaul");var Vt=require("react/jsx-runtime");function Pl({size:e=18}){return(0,Vt.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,Vt.jsx)("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Vt.jsx)("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Vt.jsx)("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Vt.jsx)("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Vt.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Vt.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Vt.jsx)("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Vt.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Vt.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Bl(){return(0,Vt.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function zl(){return(0,Vt.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Vt.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var yn=require("react/jsx-runtime");function Ga({asChild:e,children:t,className:r,style:n}){let{isMobile:o,theme:i}=ai(),a=t!=null,s=e??!0,l=r?`al-trigger-btn ${r}`:"al-trigger-btn",c=a?t:(0,yn.jsx)("button",{type:"button",className:l,"data-theme":i,"data-track":"open",style:n,children:(0,yn.jsx)(Pl,{size:18})});return o?(0,yn.jsx)(ve,{feature:"app_launcher",children:(0,yn.jsx)(Fl.Drawer.Trigger,{asChild:s,children:c})}):(0,yn.jsx)(ve,{feature:"app_launcher",children:(0,yn.jsx)(Ol.Trigger,{asChild:s,children:c})})}var vn=Q(require("react"),1),ci=Q(require("@radix-ui/react-popover"),1),xn=require("vaul");var Wl=require("@tanstack/react-query");var Ul={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json"};var gm="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",hm="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Cr(e,t){return`${e==="production"?hm:gm}/${t}.png`}function jl(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://stg.onechain.nexus/gametoken",stage:"https://stg.onechain.nexus/gametoken",production:"https://www.onechain.nexus/gametoken"},iconUrl:Cr(t,"game-token"),order:1e3,type:"gametoken",badge:null,isNew:!1,serviceStatus:"available"},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg.onechain.nexus/forge",stage:"https://stg.onechain.nexus/forge",production:"https://onechain.nexus/forge"},iconUrl:Cr(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0,serviceStatus:"available"},{id:"crossd",label:"Bridge",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:Cr(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1,serviceStatus:"ending"},{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:Cr(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0,serviceStatus:"available"},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg.onechain.nexus/rewards",stage:"https://stg.onechain.nexus/rewards",production:"https://onechain.nexus/rewards"},iconUrl:Cr(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1,serviceStatus:"ending"},{id:"cross-staking",label:"Staking",description:"Stake CROSS and earn rewards.",url:{dev:"https://stg-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},iconUrl:Cr(t,"cross-staking"),order:7500,type:"cross-staking",badge:null,isNew:!0,serviceStatus:"available"},{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:Cr(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1,serviceStatus:"available"},{id:"play",label:"Quest",description:"Discover and play games on CROSS.",url:{dev:"https://stg.onechain.nexus/quest",stage:"https://stg.onechain.nexus/quest",production:"https://www.onechain.nexus/quest"},iconUrl:Cr(t,"play"),order:8500,type:"play",badge:null,isNew:!0,serviceStatus:"available"},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://stg.onechain.nexus/shop",stage:"https://stg.onechain.nexus/shop",production:"https://www.onechain.nexus/shop"},iconUrl:Cr(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1,serviceStatus:"available"},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.onechain.nexus",stage:"https://stg-explorer.onechain.nexus",production:"https://explorer.onechain.nexus"},iconUrl:Cr(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1,serviceStatus:"available"},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg.onechain.nexus/wave",stage:"https://stg.onechain.nexus/wave",production:"https://www.onechain.nexus/wave"},iconUrl:Cr(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function ho(e){let t=Xe(e);return(0,Wl.useQuery)({queryKey:["global-menu",t],queryFn:async()=>{try{let r=await fetch(Ul[t],{cache:"no-store"});if(!r.ok)throw new Error(`Failed to fetch global menu: ${r.status}`);return r.json()}catch{return jl(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function Ha(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function Gl(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function Hl(e){return[...e].sort((t,r)=>{let n=_l(t)-_l(r);return n!==0?n:t.order-r.order})}function _l(e){let t=Ha(e);return t==="comingSoon"?0:t==="ending"?2:1}var Ye=require("react/jsx-runtime");function bm(e){return e.id==="cross-staking"||e.type==="cross-staking"}function Qa({align:e="end",sideOffset:t=8,className:r}){let{env:n,theme:o,isMobile:i,domain:a,close:s}=ai(),{data:l}=ho(n),c=vn.useMemo(()=>Hl(l?.items??[]),[l?.items]),u=8,b=vn.useRef(null),h=vn.useCallback(w=>{b.current={x:w.clientX,y:w.clientY}},[]),d=typeof window<"u"?window.location.pathname:"",y=vn.useCallback((w,x)=>{if(b.current){let R=w.clientX-b.current.x,S=w.clientY-b.current.y;if(b.current=null,Math.abs(R)>u||Math.abs(S)>u)return}let p=x.url[n]??x.url.production,k=Ql(p,a);if(!k)try{let R=new URL(p).pathname;if(d===R||d.startsWith(R+"/")){s();return}}catch{}k?window.open(p,"_blank","noopener,noreferrer"):window.location.href=p,s()},[n,a,s,d]),f=w=>{let x=w.url[n]??w.url.production,p=Ql(x,a),k=Ha(w),R=k==="ending",S=Gl(w.iconUrl,n),T=!1;if(!p)try{let N=new URL(x).pathname;T=d===N||d.startsWith(N+"/")}catch{T=!1}return(0,Ye.jsx)("button",{type:"button",className:"al-grid-item","data-track":"menu_item_click","data-track-id":w.id,"data-active":T||void 0,"data-service-status":k,onPointerDown:h,onClick:N=>y(N,w),children:(0,Ye.jsxs)("div",{className:"al-grid-item-left",children:[(0,Ye.jsxs)("div",{className:"al-grid-item-icon",children:[(0,Ye.jsx)("img",{src:S,alt:w.label,width:24,height:24,loading:"lazy"}),w.isNew&&(0,Ye.jsx)("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),(0,Ye.jsxs)("span",{className:"al-grid-item-text",children:[(0,Ye.jsx)("span",{className:"al-grid-item-label",children:w.label}),R&&(0,Ye.jsx)("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),w.badge&&!bm(w)&&(0,Ye.jsx)("span",{className:"al-badge al-badge-list",children:w.badge})]})]})},w.id)},m=(0,Ye.jsx)("div",{className:"al-menu","data-theme":o,children:(0,Ye.jsx)("div",{className:"al-grid",children:c.map(f)})});return i?(0,Ye.jsx)(ve,{feature:"app_launcher",children:(0,Ye.jsxs)(xn.Drawer.Portal,{children:[(0,Ye.jsx)(xn.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,Ye.jsxs)(xn.Drawer.Content,{className:Ie("al-drawer-content",r),"data-theme":o,children:[(0,Ye.jsxs)("div",{className:"al-drawer-header",children:[(0,Ye.jsx)(xn.Drawer.Close,{className:"al-drawer-close","data-track":"close",children:(0,Ye.jsx)(Bl,{})}),(0,Ye.jsx)(xn.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,Ye.jsx)(xn.Drawer.Close,{className:"al-drawer-close","data-track":"close",children:(0,Ye.jsx)(zl,{})})]}),(0,Ye.jsx)("div",{className:"al-drawer-body",children:m})]})]})}):(0,Ye.jsx)(ve,{feature:"app_launcher",children:(0,Ye.jsx)(ci.Portal,{children:(0,Ye.jsx)(ci.Content,{align:e,sideOffset:t,className:Ie("al-popover-content",r),"data-theme":o,children:m})})})}function Ql(e,t){try{let r=new URL(e).hostname;return typeof window>"u"?!0:r!==(t??window.location.hostname)}catch{return!1}}var Ut=Q(require("react"),1),uu=Q(require("@radix-ui/react-popover"),1),fu=require("vaul");var di=require("react"),Va=(0,di.createContext)(null);function on(){let e=(0,di.useContext)(Va);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Vl=require("@nexus-cross/crossx-design-system"),pi=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(pi||{}),bo={crossx:{name:Vl.WALLET_LABELS.default,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 Fc=Q(require("react"),1);var ke=require("react/jsx-runtime");function Yl({size:e=16,className:t}){return(0,ke.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,ke.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,ke.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 kn({size:e=16,className:t}){return(0,ke.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ke.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 Hr({size:e=16,className:t}){return(0,ke.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ke.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function mr({size:e=24,className:t}){return(0,ke.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ke.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function ql({size:e=20,className:t}){return(0,ke.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,ke.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,ke.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 ui({size:e=20,className:t}){return(0,ke.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,ke.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 Qr({size:e=20,className:t}){return(0,ke.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ke.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Rn({size:e=20,className:t}){return(0,ke.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ke.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Kl({size:e=16,className:t}){return(0,ke.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,ke.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,ke.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 Zl({size:e=16,className:t}){return(0,ke.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,ke.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,ke.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var wm='<svg width="100%" height="100%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',ym=`data:image/svg+xml,${encodeURIComponent(wm)}`;function Xl({size:e=42,className:t}){return(0,ke.jsx)("img",{src:ym,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function Jl({size:e=20,className:t}){return(0,ke.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ke.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 $l({size:e=20,className:t}){return(0,ke.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ke.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 ec({size:e=20,className:t}){return(0,ke.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ke.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 tc({size:e=20,className:t}){return(0,ke.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ke.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 rc({size:e=20,className:t}){return(0,ke.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,ke.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),(0,ke.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 oe=Q(require("react"),1);var an=Q(require("bignumber.js"),1);function xm(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 sn(e,t){if(!e||e==="0")return"0.00";let r=new an.default(e).shiftedBy(-t),n=r.isGreaterThanOrEqualTo(1)?2:4;return r.toFormat(n,an.default.ROUND_DOWN)}function Yt(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Sn(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let r=t>=1?2:4,n=Math.pow(10,r);return`$${(Math.floor(t*n)/n).toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function fi(e,t,r){let o=new an.default(e).shiftedBy(-t).multipliedBy(new an.default(r));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(an.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,an.default.ROUND_DOWN):o.decimalPlaces(4,an.default.ROUND_DOWN)).toFormat()}`}function nc(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 r=t;if(r.includes("e")||r.includes("E")){let a=Number(r);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};r=xm(a.toFixed(18))}let[n="0",o=""]=r.split(".");if(Number(n)>=1){let a=o.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return o.length<4?{displayValue:`${n}.${o}`,isLowerBound:!1}:o.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${o.slice(0,4)}`,isLowerBound:!1}}var Ya=require("react"),oc=require("@tanstack/react-query");var ft={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},Hn="https://terms.onechain.nexus/docs/terms-july-23-2026",mi="https://terms.onechain.nexus/docs/pp-july-23-2026";var vm="send:chain-info";function km(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let r=t[0];if(!r)throw new Error("Chain info payload is empty.");return r}return t}return e}function qa(e,...t){let r=e.replace(/\/+$/,""),n=t.map(o=>o.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[r,...n].join("/")}function ic(e,t,r,n){if(n)return t===ft[e].cross?ac(t,n):r?.explorer_url?qa(r.explorer_url,r.explorer_postfix?.transaction??"tx",n):Rm(e,t,n)}function ac(e,t){return qa("https://explorer.onechain.nexus",String(e),"tx",t)}function Rm(e,t,r){let n=ft[e];if(t===n.cross)return ac(t,r);if(t===n.bsc)return qa(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",r)}function wo(e,t,r,n=!0){let o=(0,oc.useQuery)({queryKey:[vm,e,t],queryFn:async({signal:s})=>{let l=await Te("walletServer",e),c=await fetch(`${l}/v1/public/chain/info/${t}`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let u=await c.json();if("code"in u&&u.code!==void 0&&u.code!==200)throw new Error(`Chain info API error: ${u.code}`);return km(u)},enabled:n,staleTime:3e5}),i=o.data;return{transactionUrl:(0,Ya.useMemo)(()=>ic(e,t,i,r),[t,i,e,r]),chainInfo:i,...o}}function sc(e,t,r=!0){let{chainInfo:n}=wo(e,t,void 0,r);return{buildTxUrl:(0,Ya.useMemo)(()=>i=>ic(e,t,n,i),[e,t,n]),chainInfo:n}}var lc="0x0000000000000000000000000000000000000001";var Sm="0xa9059cbb",Cm=/^0x[a-fA-F0-9]{40}$/,Nm="nexus-cross:dapp-ui:send:recent:",cc=10;function Tm(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function yo(e){return e.toLowerCase()}function Pr(e){return Cm.test(e)}function ln(e){return yo(e.address)===lc}function Ka(e){return`${Nm}${e.toLowerCase()}`}function Qn(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Ka(e));if(!t)return[];let r=JSON.parse(t);return Array.isArray(r)?r.filter(n=>n!==null&&typeof n=="object"&&Pr(n.address)&&typeof n.updatedAt=="number").slice(0,cc):[]}catch{return[]}}function Za(e,t){if(typeof window>"u")return[];let r=yo(t),n=[{address:r,updatedAt:Date.now()},...Qn(e).filter(o=>o.address!==r)].slice(0,cc);try{window.localStorage.setItem(Ka(e),JSON.stringify(n))}catch{return Qn(e)}return n}function Xa(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Ka(e))}catch{}}function Cn(e,t){let r=e.trim();if(!r)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(r))return{error:"Enter a valid amount."};let[n="0",o=""]=r.split(".");if(o.length>t)return{error:`Max ${t} decimal places.`};let i=BigInt(n||"0"),a=o.padEnd(t,"0"),s=a?BigInt(a):0n,l=10n**BigInt(t),c=i*l+s;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function Vn(e,t){let r=BigInt(e||"0"),n=10n**BigInt(t),o=r/n,i=r%n;if(i===0n)return o.toString();let a=Tm(i.toString().padStart(t,"0"));return`${o.toString()}.${a}`}function Ja(e,t){let r=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${Sm}${r}${n}`}function gi(e,t,r=10){if(t<=0)return e.toString();let n=10n**BigInt(t),o=e/n,i=e%n;if(i===0n)return o.toString();let s=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(r,t)));return s=s.replace(/0+$/,""),s?`${o.toString()}.${s}`:o.toString()}function $a(e,t){return gi(e,t,6)}function dc(e){return gi(e,9,2)}function pc(e){return e.toLocaleString("en-US")}function hi(e){return e===56||e===97}function bi(e){return e.gasPrice??e.maxFeePerGas}function uc(e,t=!1){return t?bi(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function wi(e,t=!1){if(t){let r=bi(e);return r!==void 0?e.gasLimit*r:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function yi(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function fc(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 r=e,n=[];return typeof r.name=="string"&&n.push(r.name),typeof r.shortMessage=="string"&&n.push(r.shortMessage),typeof r.message=="string"&&n.push(r.message),typeof r.details=="string"&&n.push(r.details),r.cause!==void 0&&n.push(fc(r.cause,t+1)),n.join(`
6
+ `).toLowerCase()}function Im(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 es(e,t={},r="Failed to send transaction."){let n=fc(e);if(!n)return r;let o=t.nativeSymbol?.trim()||"gas token",i=t.networkName?.trim();if(n.includes("user rejected")||n.includes("userrejected")||n.includes("user denied")||n.includes("user cancelled")||n.includes("user canceled")||n.includes("action_rejected")||n.includes("rejected by user"))return"Transaction was cancelled.";if(n.includes("insufficientfunds")||n.includes("insufficient funds")||n.includes("exceeds the balance of the account")||n.includes("insufficient balance for transfer")){let a=i?` on ${i}`:"";return`Not enough ${o} to cover the gas fee.Please top up your ${o} balance and try again.`}return n.includes("transaction underpriced")||n.includes("replacement transaction underpriced")||n.includes("fee too low")?"Gas fee was too low for the network. Please try again.":n.includes("nonce too low")||n.includes("nonce has already been used")||n.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":n.includes("execution reverted")||n.includes("contractfunctionrevertederror")||n.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":n.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":n.includes("http request failed")||n.includes("failed to fetch")||n.includes("network request failed")||n.includes("timeout")||n.includes("econnreset")||n.includes("rpc error")||n.includes("429")?"Network connection failed. Check your internet and try again.":n.includes("estimategas")||n.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":Im(e)||r}var Mm=2000000000n,Em=1000000000n;async function xi(e,t,r){let n=new AbortController,o=setTimeout(()=>n.abort(),8e3),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:r}),signal:n.signal}).finally(()=>clearTimeout(o));if(!i.ok)throw new Error(`RPC ${t} HTTP ${i.status}`);let a=await i.json();if(a.error)throw new Error(`RPC ${t}: ${a.error.message}`);if(a.result===void 0)throw new Error(`RPC ${t}: empty result`);return a.result}function vi(e){return BigInt(e)}function Am(e){return`0x${e.toString(16)}`}function Lm(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Am(e.value)),e.data&&(t.data=e.data),t}function Dm(e){return e===56||e===97}async function mc(e){try{let t=await xi(e,"eth_gasPrice",[]);return{gasPrice:vi(t)}}catch{return{gasPrice:Mm}}}async function Pm(e,t){let r=Em;try{let n=await xi(e,"eth_maxPriorityFeePerGas",[]);r=vi(n)}catch{}return{maxFeePerGas:t+r,maxPriorityFeePerGas:r}}async function Bm(e,t){if(t)return mc(e);let r;try{r=(await xi(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return r?Pm(e,vi(r)):mc(e)}async function gc(e,t){let r=Dm(t.chainId),n=Lm(t),[o,i]=await Promise.all([xi(e,"eth_estimateGas",[n]),Bm(e,r)]);return{gasLimit:vi(o),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function hc(e){let{estimateGas:t,sendTransaction:r,getTransactionReceipt:n}=e;return{canSend:!!r,canEstimateGas(o){return!!t||!!o},async estimateGas(o,i){if(t)return t(o);if(i)return gc(i,o);throw new Error("Gas estimation is not available.")},async sendTransaction(o){if(!r)throw new Error("Sending is not available for this wallet.");return r(o)},getTransactionReceipt:n}}var zm=1500,Om=120;function bc(e){return!!(e.token||e.recipient||e.amount)}function ts({recipient:e,amount:t,token:r,balanceRaw:n}){let o={},i=e.trim(),a=Cn(t,r.quantity.decimals),s;return i?Pr(i)||(o.recipient="Enter a valid EVM recipient address."):o.recipient="Enter a recipient address.","error"in a?o.amount=a.error:(s=a.value,s>n&&(o.amount="Amount exceeds available balance.")),!ln(r)&&!Pr(r.address)&&(o.token="Token contract address is invalid."),{errors:o,rawAmount:o.amount?void 0:s,recipient:i&&Pr(i)?i:void 0}}function rs({token:e,walletAddress:t,recipient:r,rawAmount:n}){let o=t;return ln(e)?{to:r,value:n,chainId:e.chainId,from:o}:{to:yo(e.address),data:Ja(r,n),value:0n,chainId:e.chainId,from:o}}function Fm(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var Um=e=>new Promise(t=>setTimeout(t,e));async function wc({repository:e,args:t,chainId:r,onSubmitted:n,pollIntervalMs:o=zm,pollMaxAttempts:i=Om}){let a=await e.sendTransaction(t);n(a);let{getTransactionReceipt:s}=e;if(!s)return"success";for(let l=0;l<i;l+=1){let c=await s({hash:a,chainId:r}).catch(()=>null);if(c)return Fm(c)?"reverted":"success";await Um(o)}return"timeout"}var yc=["token","recipient","amount","review"];function xc(e){let{env:t,walletAddress:r,accountName:n,accounts:o=[],initialStep:i="recipient",token:a,tokens:s=[],onTokenChange:l,sendTransaction:c,getTransactionReceipt:u,estimateGas:b,getTokenPriceUsd:h,onSubmitted:d,onSuccess:y,onFailed:f,onExit:m,onOutlink:w}=e,x=oe.useMemo(()=>hc({sendTransaction:c,getTransactionReceipt:u,estimateGas:b}),[c,u,b]),[p,k]=oe.useState(a);oe.useEffect(()=>{k(a)},[a.address,a.chainId]);let[R,S]=oe.useState(i),[T,N]=oe.useState(""),[C,M]=oe.useState(""),[B,W]=oe.useState({}),[L,$]=oe.useState("idle"),[P,F]=oe.useState(""),[de,V]=oe.useState(""),[_,we]=oe.useState(null),[ee,Z]=oe.useState(!1),[j,ie]=oe.useState(""),re=oe.useRef(0),[Se,ye]=oe.useState(null),[ne,Ne]=oe.useState(""),[Oe,xe]=oe.useState(()=>Qn(r)),Be=oe.useRef(new Set),ge=oe.useCallback((O,se)=>{Be.current.has(O)||(Be.current.add(O),Ae("send",O,se))},[]);oe.useEffect(()=>{ge("opened"),i!=="token"&&ge("token_selected",{tags:{item_id:a.symbol}})},[ge,i,a.symbol]);let Ze=oe.useMemo(()=>Xe(t),[t]),{transactionUrl:dt,chainInfo:Fe}=wo(Ze,p.chainId,P||void 0,!0),Ue=Un(p.chainId,Ze),De=Ue.nativeSymbol??Fe?.currency_symbol??"",ht=Ue.name??Fe?.name??`Chain ID ${p.chainId}`,et=oe.useRef({nativeSymbol:De||void 0,networkName:ht,tokenSymbol:p.symbol});et.current={nativeSymbol:De||void 0,networkName:ht,tokenSymbol:p.symbol};let Qe=oe.useMemo(()=>BigInt(p.quantity.numeric||"0"),[p.quantity.numeric]),Mt=oe.useMemo(()=>sn(p.quantity.numeric,p.quantity.decimals),[p.quantity.numeric,p.quantity.decimals]),vt=h?.(p),Dt=oe.useMemo(()=>{if(vt===void 0)return;let O=parseFloat(C.replace(/,/g,""));return Number.isFinite(O)?O*vt:0},[C,vt]);oe.useEffect(()=>{M(""),W({})},[p.address,p.chainId]),oe.useEffect(()=>{re.current+=1,we(null),ie(""),Z(!1)},[p.address,p.chainId,T,C]),oe.useEffect(()=>{xe(Qn(r))},[r]);let je=oe.useCallback(O=>{N(O),W(se=>({...se,recipient:void 0}))},[]),Pt=oe.useCallback(O=>{M(O),W(se=>({...se,amount:void 0}))},[]),kt=oe.useCallback(()=>{M(Mt.replace(/,/g,"")),W(O=>({...O,amount:void 0}))},[Mt]),Rt=oe.useCallback(O=>{k(O),l?.(O),ge("token_selected",{tags:{item_id:O.symbol}}),S("recipient")},[l,ge]),Zt=oe.useCallback(()=>S("token"),[]),Bt=oe.useCallback(()=>{S(O=>{if(O==="result")return"review";if(O===i)return m?.(),O;let se=yc.indexOf(O);return se<=0?(m?.(),O):yc[se-1]})},[i,m]),We=oe.useCallback(()=>{let{errors:O}=ts({recipient:T,amount:"1",token:p,balanceRaw:Qe});if(O.recipient){W(se=>({...se,recipient:O.recipient}));return}W(se=>({...se,recipient:void 0})),ge("recipient_entered"),S("amount")},[T,p,Qe,ge]),pt=oe.useCallback(O=>{N(O),W(se=>({...se,recipient:void 0})),ge("recipient_entered"),S("amount")},[ge]),Ge=oe.useCallback(()=>{let O=ts({recipient:T,amount:C,token:p,balanceRaw:Qe});W(O.errors),!(bc(O.errors)||O.rawAmount===void 0||!O.recipient)&&(ye(O.rawAmount),Ne(O.recipient),we(null),ie(""),$("idle"),ge("amount_entered"),S("review"))},[T,C,p,Qe,ge]);oe.useEffect(()=>{if(R!=="review"||!ne||Se===null||_!==null||ee||j||!x.canEstimateGas(Fe?.rpc))return;let O=++re.current;Z(!0),ie(""),(async()=>{try{let se=rs({token:p,walletAddress:r,recipient:ne,rawAmount:Se}),Ve=await x.estimateGas(se,Fe?.rpc);if(re.current!==O)return;we(Ve)}catch(se){if(re.current!==O)return;ie(es(se,et.current,"Failed to estimate gas."))}finally{re.current===O&&Z(!1)}})()},[R,ne,Se,_,ee,j,x,Fe?.rpc,p,r]);let tt=oe.useMemo(()=>{if(!ln(p)||!_||Se===null)return!1;let O=wi(_,hi(p.chainId));return O===null?!1:Se+O>Qe},[p,_,Se,Qe]),at=oe.useCallback(async()=>{if(!(!ne||Se===null)&&!tt){V(""),F(""),$("submitting"),ge("submitted");try{let O="",se=await wc({repository:x,args:rs({token:p,walletAddress:r,recipient:ne,rawAmount:Se}),chainId:p.chainId,onSubmitted:Ve=>{O=Ve,F(Ve),$("confirming"),xe(Za(r,ne)),d?.({txHash:Ve,chainId:p.chainId,amount:C,tokenSymbol:p.symbol,recipient:ne})}});if(se==="success")$("success"),ge("confirmed"),O&&y?y?.(O):S("result");else if(se==="reverted"){let Ve="Transaction reverted on-chain.";$("error"),V(Ve),ge("confirmed",{status:"failure",reason:ir(new Error(Ve))}),O&&f?f({txHash:O,chainId:p.chainId,message:Ve}):S("result")}else{let Ve="Transaction receipt was not found. Please check again later.";$("error"),V(Ve),ge("confirmed",{status:"failure",reason:"timeout"}),O&&f?f({txHash:O,chainId:p.chainId,message:Ve}):S("result")}}catch(O){$("error"),ge("confirmed",{status:"failure",reason:ir(O)}),V(es(O,{nativeSymbol:De||void 0,networkName:ht,tokenSymbol:p.symbol})),S("result")}}},[x,ne,Se,tt,p,C,r,d,y,f,De,ht,ge]),[jt,Wt]=oe.useState(!1),st=oe.useRef(void 0);oe.useEffect(()=>()=>clearTimeout(st.current),[]);let zt=oe.useCallback(async()=>{if(P)try{await navigator.clipboard.writeText(P),Wt(!0),clearTimeout(st.current),st.current=setTimeout(()=>Wt(!1),2e3)}catch{}},[P]),_t=oe.useCallback(()=>{if(!dt||!P)return;let O=St=>{typeof window<"u"&&window.open(St,"_blank","noopener,noreferrer")};if(!w){O(dt);return}let se=w(dt,{category:"send",origin:"send-transaction",payload:{chainId:p.chainId,txHash:P}});if(se&&typeof se.then=="function"){let St=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;se.then(ut=>{if(ut===null){St?.close();return}let Gt=ut??dt;if(St)try{St.location.href=Gt}catch{St.close(),O(Gt)}else O(Gt)});return}let Ve=se;Ve!==null&&O(Ve??dt)},[w,p.chainId,dt,P]),Xt=oe.useCallback(()=>{V(""),F(""),$("idle"),we(null),ie(""),Be.current.delete("submitted"),Be.current.delete("confirmed"),S("review")},[]);return{step:R,status:L,token:p,tokens:s.length>0?s:[p],recipient:T,amount:C,amountUsd:Dt,fieldErrors:B,error:de,txHash:P,gasEstimate:_,gasLoading:ee,gasError:j,insufficientGas:tt,reviewRawAmount:Se,reviewRecipient:ne,recentAddresses:Oe,accounts:o,accountName:n,walletAddress:r,resolvedEnv:Ze,transactionUrl:dt,networkName:ht,nativeSymbol:De,nativeDecimals:Fe?.currency_decimals??p.quantity.decimals,balanceRaw:Qe,balanceText:Mt,priceUsd:vt,canSelectToken:(s.length>0?s:[p]).length>1,canSend:x.canSend,getTokenPriceUsd:h,setRecipient:je,setAmount:Pt,setMax:kt,selectToken:Rt,goToTokenSelect:Zt,selectRecipient:pt,submitRecipient:We,submitAmount:Ge,confirmSend:at,retry:Xt,back:Bt,hashCopied:jt,copyHash:zt,openTransaction:_t}}var Nr=Q(require("react"),1);var Br=require("react/jsx-runtime");function vc({flow:e}){let{amount:t,setAmount:r,amountUsd:n,balanceText:o,balanceRaw:i,token:a,setMax:s}=e,l=Nr.useRef(null),c=Nr.useCallback(()=>{requestAnimationFrame(()=>{let f=l.current;if(!f)return;let m=f.value.length;f.setSelectionRange(m,m)})},[]);Nr.useEffect(()=>{l.current?.focus(),c()},[c]),Nr.useEffect(()=>{t===""&&(h(!1),c())},[t,c]);let u=Nr.useMemo(()=>{let f=Cn(t,a.quantity.decimals);return"value"in f&&f.value>i},[t,a.quantity.decimals,i]),[b,h]=Nr.useState(!1),d=!b&&t===""?"0.00":t,y=t.trim()===""||t.trim()==="0";return(0,Br.jsx)("div",{className:"sf-body sf-amount",children:(0,Br.jsxs)("div",{className:"sf-amount-center",children:[(0,Br.jsx)("span",{className:"sf-amount-usd",children:n!==void 0?yi(n):"\xA0"}),(0,Br.jsx)("div",{className:"sf-amount-input-wrap","data-over":u||void 0,"data-empty":y||void 0,onClick:()=>l.current?.focus(),children:(0,Br.jsx)("input",{ref:l,className:"sf-amount-input",value:d,onChange:f=>{let m=f.target.value;if(b)r(m);else if(t===""){if(m.length<4)return;h(!0);let w=m.startsWith("0.00")?m.slice(4):m;r(w)}else h(!0),r(m)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),(0,Br.jsxs)("div",{className:"sf-amount-balance",children:[(0,Br.jsx)("span",{children:"Balance:"}),(0,Br.jsxs)("button",{type:"button",className:"sf-amount-max",onClick:s,"data-track":"amount_max",children:[o," ",a.symbol]})]})]})})}var Tr=Q(require("react"),1);var Wm=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function Rc(e){return Wm.has(e.toLowerCase())}var kc={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function xo(e,t){let r=ft[e];if(t===r.cross)return kc.cross;if(t===r.bsc)return kc.bsc}var _m={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Vr(e,t,r={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:o,format:i="png"}=r,a=_m[e],s=o?`&bg=${o}`:"";return`${a}/portrait/evm/${t}.${i}?size=${n}${s}`}var Et=require("react/jsx-runtime");function Sc({size:e=20,className:t}){return(0,Et.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,Et.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),(0,Et.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Cc({size:e=20,className:t}){return(0,Et.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,Et.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 Nc({size:e=20,className:t}){return(0,Et.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,Et.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),(0,Et.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Tc({size:e=16,className:t}){return(0,Et.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:(0,Et.jsx)("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ic({size:e=56,className:t}){return(0,Et.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,Et.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),(0,Et.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 Mc({size:e=56,className:t}){return(0,Et.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,Et.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),(0,Et.jsx)("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}var Pe=require("react/jsx-runtime");function Ec(e,t){return e.name||`Account ${(e.index??t)+1}`}function Ac(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Lc(e){return e.toLowerCase()}function Dc({flow:e}){let{recipient:t,setRecipient:r,fieldErrors:n,recentAddresses:o,accounts:i,walletAddress:a,resolvedEnv:s,selectRecipient:l}=e,c=Tr.useMemo(()=>i.filter(p=>p.address.toLowerCase()!==a.toLowerCase()),[i,a]),u=c.length>0,b=Tr.useMemo(()=>new Map(c.map((p,k)=>[Lc(p.address),{account:p,index:k}])),[c]),[h,d]=Tr.useState("recent"),y=Tr.useRef(null);Tr.useEffect(()=>{y.current?.focus()},[]);let f="1A1A2E",m=Tr.useCallback(async()=>{try{let p=await navigator.clipboard.readText();p&&r(p.trim())}catch{}},[r]),w=t.trim().length>0,x=Pr(t.trim());return(0,Pe.jsxs)("div",{className:"sf-recipient",children:[(0,Pe.jsxs)("div",{className:"sf-recipient-top",children:[(0,Pe.jsxs)("div",{className:"sf-address-field","data-filled":w||void 0,"data-invalid":n.recipient||void 0,children:[(0,Pe.jsx)("textarea",{ref:y,className:"sf-address-input",value:t,onChange:p=>r(p.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:w?2:1}),w?(0,Pe.jsx)("button",{type:"button",className:"sf-address-action",onClick:()=>r(""),"aria-label":"Clear","data-track":"recipient_clear",children:(0,Pe.jsx)(Nc,{size:20})}):(0,Pe.jsx)("button",{type:"button",className:"sf-address-action",onClick:m,"aria-label":"Paste from clipboard","data-track":"recipient_paste",children:(0,Pe.jsx)(Cc,{size:20})})]}),n.recipient&&(0,Pe.jsx)("p",{className:"sf-field-error",role:"alert",children:n.recipient}),(0,Pe.jsxs)("div",{className:"sf-tabs",role:"tablist",children:[(0,Pe.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":h==="recent"||void 0,"aria-selected":h==="recent",onClick:()=>d("recent"),"data-track":"recipient_tab","data-track-id":"recent",children:"Recent"}),u&&(0,Pe.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":h==="account"||void 0,"aria-selected":h==="account",onClick:()=>d("account"),"data-track":"recipient_tab","data-track-id":"account",children:"My Account"})]})]}),(0,Pe.jsx)("div",{className:"sf-address-list",children:h==="account"&&u?c.map((p,k)=>{let R=Ec(p,k),S=Vr(s,p.address,{size:56,bg:f});return(0,Pe.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>l(p.address),"data-track":"recipient_item",children:[(0,Pe.jsxs)("span",{className:"sf-address-avatar",children:[S&&(0,Pe.jsx)("img",{src:S,alt:"",width:40,height:40,draggable:!1,onError:T=>{T.currentTarget.style.display="none"}}),(0,Pe.jsx)("span",{className:"sf-address-avatar-fallback",children:Ac(R)})]}),(0,Pe.jsxs)("span",{className:"sf-address-meta",children:[(0,Pe.jsx)("span",{className:"sf-address-name",children:R}),(0,Pe.jsx)("span",{className:"sf-address-value",children:Yt(p.address)})]})]},p.address)}):o.length>0?o.map(p=>{let k=b.get(Lc(p.address)),R=k?Ec(k.account,k.index):Yt(p.address),S=Vr(s,p.address,{size:56,bg:f});return(0,Pe.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>l(p.address),"data-track":"recipient_item",children:[(0,Pe.jsxs)("span",{className:"sf-address-avatar",children:[S&&(0,Pe.jsx)("img",{src:S,alt:"",width:40,height:40,draggable:!1,onError:T=>{T.currentTarget.style.display="none"}}),(0,Pe.jsx)("span",{className:"sf-address-avatar-fallback",children:Ac(R)})]}),(0,Pe.jsxs)("span",{className:"sf-address-meta",children:[(0,Pe.jsx)("span",{className:"sf-address-name",children:R}),(0,Pe.jsx)("span",{className:"sf-address-value",children:Yt(p.address)})]})]},p.address)}):(0,Pe.jsx)("div",{className:"sf-empty",children:"No send history"})}),w&&!x&&!n.recipient&&(0,Pe.jsx)("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}var lt=require("react/jsx-runtime");function Bc({flow:e}){let{status:t,txHash:r,error:n,copyHash:o,hashCopied:i,openTransaction:a}=e,s=t==="error",l=t==="success";return s?(0,lt.jsxs)("div",{className:"sf-body sf-result sf-result--error",children:[(0,lt.jsx)("span",{className:"sf-result-icon",children:(0,lt.jsx)(Mc,{size:56})}),(0,lt.jsxs)("div",{className:"sf-result-copy",children:[(0,lt.jsx)("h3",{className:"sf-result-title",children:"Transaction Failed"}),(0,lt.jsx)("p",{className:"sf-result-desc",children:n||"Something went wrong. Please try again."})]}),r&&(0,lt.jsx)(Pc,{txHash:r,hashCopied:i,onCopy:o,onOpen:a})]}):(0,lt.jsxs)("div",{className:"sf-body sf-result",children:[(0,lt.jsx)("span",{className:"sf-result-icon","data-pending":!l||void 0,children:l?(0,lt.jsx)(Ic,{size:56}):(0,lt.jsx)("span",{className:"sf-result-spinner"})}),(0,lt.jsxs)("div",{className:"sf-result-copy",children:[(0,lt.jsx)("h3",{className:"sf-result-title",children:l?"Transaction Complete":"Transaction in Progress"}),(0,lt.jsx)("p",{className:"sf-result-desc",children:l?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),r&&(0,lt.jsx)(Pc,{txHash:r,hashCopied:i,onCopy:o,onOpen:a})]})}function Pc({txHash:e,hashCopied:t,onCopy:r,onOpen:n}){return(0,lt.jsxs)("div",{className:"sf-result-hash-card",children:[(0,lt.jsx)("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),(0,lt.jsxs)("div",{className:"sf-result-hash-row",children:[(0,lt.jsx)("button",{type:"button",className:"sf-result-hash-link",onClick:n,"aria-label":"Open transaction in explorer","data-track":"tx_link_open",children:Yt(e)}),(0,lt.jsx)("button",{type:"button",className:"sf-result-copy-btn",onClick:r,"aria-label":"Copy transaction hash","data-track":"tx_hash_copy",children:t?(0,lt.jsx)(Hr,{size:16}):"Copy"})]})]})}var Re=require("react/jsx-runtime"),ki="\u2014";function zc({flow:e}){let{token:t,reviewRawAmount:r,reviewRecipient:n,accountName:o,accounts:i,walletAddress:a,networkName:s,nativeSymbol:l,nativeDecimals:c,gasEstimate:u,gasLoading:b,gasError:h,insufficientGas:d,error:y,resolvedEnv:f}=e,m=ln(t),w=r!==null?gi(r,t.quantity.decimals):"",x=o?.trim()||`Account ${(i[0]?.index??0)+1}`,p=Vr(f,a,{size:56,bg:"1A1A2E"}),k=l||(m?t.symbol:""),R=hi(t.chainId),S=u?uc(u,R):null,T=u?wi(u,R):null,N=L=>L!==null&&k?`${$a(L,c)} ${k}`:ki,C=L=>L!==void 0?`${dc(L)} Gwei`:ki,M=(()=>{if(!m||!u||T===null||r===null)return ki;let L=r+T;return`${$a(L,c)} ${k||t.symbol}`})(),B=L=>b?"\u2026":L,W=[{label:"Est. Tx Fee",value:B(N(T))},...S==="dynamic"?[{label:"Max Priority Fee",value:B(C(u?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:B(C(u?.maxFeePerGas))}]:S==="legacy"?[{label:"Gas Price",value:B(C(u?bi(u):void 0))}]:[],{label:"Gas Limit",value:B(u?pc(u.gasLimit):ki)}];return(0,Re.jsxs)("div",{className:"sf-body sf-review",children:[(0,Re.jsxs)("div",{className:"sf-review-amount",children:[(0,Re.jsx)("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:L=>{L.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,Re.jsxs)("span",{className:"sf-review-amount-value",children:[w,(0,Re.jsx)("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),(0,Re.jsxs)("div",{className:"sf-review-parties",children:[(0,Re.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,Re.jsx)("span",{className:"sf-review-party-label",children:"From"}),(0,Re.jsxs)("div",{className:"sf-review-party-head",children:[(0,Re.jsx)("span",{className:"sf-review-party-avatar",children:p&&(0,Re.jsx)("img",{src:p,alt:"",width:28,height:28,draggable:!1,onError:L=>{L.currentTarget.style.display="none"}})}),(0,Re.jsx)("span",{className:"sf-review-party-name",children:x})]}),(0,Re.jsx)("span",{className:"sf-review-party-addr",children:a})]}),(0,Re.jsx)("span",{className:"sf-review-arrow","aria-hidden":!0,children:(0,Re.jsx)(Tc,{size:16})}),(0,Re.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,Re.jsx)("span",{className:"sf-review-party-label",children:"To"}),(0,Re.jsx)("span",{className:"sf-review-party-addr",children:n})]})]}),(0,Re.jsxs)("section",{className:"sf-review-card",children:[(0,Re.jsx)("h3",{className:"sf-review-section-title",children:"Summary"}),(0,Re.jsxs)("div",{className:"sf-review-row",children:[(0,Re.jsx)("span",{className:"sf-review-row-label",children:"Network"}),(0,Re.jsx)("span",{className:"sf-review-row-value",children:s})]}),W.map(L=>(0,Re.jsxs)("div",{className:"sf-review-row",children:[(0,Re.jsx)("span",{className:"sf-review-row-label",children:L.label}),(0,Re.jsx)("span",{className:"sf-review-row-value",children:L.value})]},L.label))]}),(0,Re.jsxs)("section",{className:"sf-review-card",children:[(0,Re.jsx)("h3",{className:"sf-review-section-title",children:"Total"}),(0,Re.jsxs)("div",{className:"sf-review-row",children:[(0,Re.jsx)("span",{className:"sf-review-row-label",children:"Total Amount"}),(0,Re.jsxs)("span",{className:"sf-review-row-value",children:[w," ",t.symbol]})]}),m&&(0,Re.jsxs)("div",{className:"sf-review-row",children:[(0,Re.jsx)("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),(0,Re.jsx)("span",{className:"sf-review-row-value",children:B(M)})]})]}),d&&!h&&!y&&(0,Re.jsxs)("div",{className:"sf-message sf-message--error",role:"alert",children:["Not enough ",k||t.symbol," to cover the amount plus the network fee. Reduce the amount and try again."]}),(h||y)&&(0,Re.jsx)("div",{className:"sf-message sf-message--error",role:"alert",children:h||y})]})}var Ri=Q(require("react"),1);var Ot=require("react/jsx-runtime");function Oc({flow:e}){let[t,r]=Ri.useState(""),n=t.trim().toLowerCase(),o=Ri.useMemo(()=>n?e.tokens.filter(i=>i.symbol.toLowerCase().includes(n)||i.name.toLowerCase().includes(n)):e.tokens,[e.tokens,n]);return(0,Ot.jsxs)("div",{className:"sf-body sf-token-select",children:[(0,Ot.jsxs)("div",{className:"sf-search",children:[(0,Ot.jsx)(Sc,{size:20}),(0,Ot.jsx)("input",{className:"sf-search-input",value:t,onChange:i=>r(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),(0,Ot.jsxs)("div",{className:"sf-token-list",children:[o.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,s=xo(e.resolvedEnv,i.chainId),l=e.getTokenPriceUsd?.(i);return(0,Ot.jsxs)("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),"data-track":"token_item","data-track-id":i.symbol,children:[(0,Ot.jsxs)("span",{className:"sf-token-left",children:[(0,Ot.jsxs)("span",{className:"sf-token-icon-wrap",children:[(0,Ot.jsx)("img",{className:"sf-token-icon",src:i.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"}}),s&&(0,Ot.jsx)("img",{className:"sf-token-chain-badge",src:s,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.style.display="none"}})]}),(0,Ot.jsx)("span",{className:"sf-token-name",children:i.symbol})]}),(0,Ot.jsxs)("span",{className:"sf-token-right",children:[(0,Ot.jsx)("span",{className:"sf-token-balance",children:sn(i.quantity.numeric,i.quantity.decimals)}),l!==void 0&&(0,Ot.jsx)("span",{className:"sf-token-price",children:yi(l)})]})]},a)}),o.length===0&&(0,Ot.jsx)("div",{className:"sf-empty",children:"No tokens found"})]})]})}pe(`.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-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){filter:brightness(1.05)}.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-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff;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-system-orange-default, #f0640d)}.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;flex-shrink:0;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-system-orange-default, #f0640d)}.sf-address-field[data-filled]{border-color:var(--ds-system-orange-default, #f0640d)}.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-system-orange-high, #e56f00)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-system-orange-high, #e56f00)}.sf-address-list{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;margin-top:8px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .sf-address-list{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-address-list::-webkit-scrollbar{width:4px}.sf-address-list::-webkit-scrollbar-track{background:transparent}.sf-address-list::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}[data-theme=light] .sf-address-list::-webkit-scrollbar-thumb{background:#0000001f}.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;z-index:1;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-system-orange-default, #f0640d);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-system-orange-high, #e56f00)}.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 nt=require("react/jsx-runtime"),Gm={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function vo({onClose:e,onBackToWallet:t,onConfirmSuccess:r,onSuccess:n,className:o,...i}){let a=Fc.useCallback(w=>{n?.(w),r?.(w)},[r,n]),l=xc({...i,onSuccess:n||r?a:void 0,onExit:t}),{step:c,status:u}=l,b=Pr(l.recipient.trim()),h=Cn(l.amount,l.token.quantity.decimals),d="value"in h&&h.value<=l.balanceRaw,y=u==="submitting"||u==="confirming",f=c!=="result",m=Gm[c]??"";return(0,nt.jsx)(ve,{feature:"send",children:(0,nt.jsxs)("div",{className:Ie("sf-root",o),"data-step":c,children:[(0,nt.jsxs)("header",{className:"sf-header",children:[f?(0,nt.jsx)("button",{type:"button",className:"sf-header-btn",onClick:l.back,"aria-label":"Back","data-track":"back",children:(0,nt.jsx)(Qr,{size:24})}):(0,nt.jsx)("span",{className:"sf-header-btn","aria-hidden":!0}),(0,nt.jsx)("span",{className:"sf-header-title",children:m}),(0,nt.jsx)("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close","data-track":"close",children:(0,nt.jsx)(mr,{size:24})})]}),c==="token"&&(0,nt.jsx)(Oc,{flow:l}),c==="recipient"&&(0,nt.jsx)(Dc,{flow:l}),c==="amount"&&(0,nt.jsx)(vc,{flow:l}),c==="review"&&(0,nt.jsx)(zc,{flow:l}),c==="result"&&(0,nt.jsx)(Bc,{flow:l}),(0,nt.jsxs)("footer",{className:"sf-footer","data-step":c,children:[c==="recipient"&&(0,nt.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitRecipient,"data-disabled":!b||void 0,"aria-disabled":!b,"data-track":"recipient_next",children:"Next"}),c==="amount"&&(0,nt.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitAmount,"data-disabled":!d||void 0,"aria-disabled":!d,"data-track":"amount_next",children:"Next"}),c==="review"&&(0,nt.jsxs)("div",{className:"sf-footer-row",children:[(0,nt.jsx)("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:l.back,disabled:y,"data-track":"review_cancel",children:"Cancel"}),(0,nt.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.confirmSend,disabled:y||!l.canSend||l.insufficientGas,"data-track":"review_send",children:y?"Sending...":"Send"})]}),c==="result"&&u==="success"&&(0,nt.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>r?.(l.txHash||void 0),"data-track":"result_ok",children:"All done"}),c==="result"&&u==="error"&&(0,nt.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.retry,"data-track":"result_retry",children:"Try Again"})]})]})})}var Uc=Q(require("@radix-ui/react-popover"),1),jc=require("vaul");var Nn=require("react/jsx-runtime");function Wc({asChild:e,className:t,children:r}){let{isMobile:n,theme:o,walletAddress:i}=on(),a=r!=null,s=e??!0,l=a?r:(0,Nn.jsxs)("button",{type:"button",className:Ie("wi-trigger-btn",t),"data-theme":o,"data-mobile":n||void 0,children:[(0,Nn.jsx)(Yl,{size:n?14:16}),(0,Nn.jsx)("span",{className:"wi-trigger-address",children:Yt(i)})]});return n?(0,Nn.jsx)(jc.Drawer.Trigger,{asChild:s,children:l}):(0,Nn.jsx)(Uc.Trigger,{asChild:s,children:l})}var te=Q(require("react"),1),qi=Q(require("@radix-ui/react-popover"),1),Po=require("vaul");var Xn=Q(require("bignumber.js"),1);var _c=require("@tanstack/react-query"),Gc=require("react");var Si="user-balance";async function Hm(e,t,r,n){let o=new URLSearchParams({networkId:`eip155:${t}`,account:r}),i=await fetch(`${e}/v1/public/token/balance?${o}`,{cache:"no-store",signal:n});if(!i.ok)throw new Error(`Failed to fetch token balance: ${i.status}`);let a=await i.json();if(a.code!==200)throw new Error(`Token balance API error: ${a.code}`);return a.data}function Yr(e,t,r=!0){let n=ft[e],o=[n.cross,n.bsc],i=(0,_c.useQueries)({queries:o.map(c=>({queryKey:[Si,e,t,c],queryFn:async({signal:u})=>Hm(await Te("walletServer",e),c,t,u),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1}))}),a=i.some(c=>c.isLoading),s=i.some(c=>c.isError);return{tokens:(0,Gc.useMemo)(()=>{let c=[];for(let u of i)u.data&&c.push(...u.data);return c},[i]),isLoading:a,isError:s}}var Ci=require("@tanstack/react-query"),Hc=require("react");var Qm="forge-holdings",Vm="forge-token-image";async function Ym(e,t,r){let n=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:r});if(!n.ok)throw new Error(`Failed to fetch forge holdings: ${n.status}`);let o=await n.json();if(!o.success)throw new Error("Forge holdings API error");return o.data.items}async function qm(e,t,r){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:r});if(!n.ok)return{address:t,image_url:""};let o=await n.json();return o.success?{address:t,image_url:o.data.token.image_url}:{address:t,image_url:""}}function Qc(e,t,r=!0){let{data:n,...o}=(0,Ci.useQuery)({queryKey:[Qm,e,t],queryFn:async({signal:i})=>Ym(await Te("bondingCurve",e),t,i),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1});return{holdings:n??[],...o}}function Vc(e,t,r=!0){let n=(0,Ci.useQueries)({queries:t.map(i=>({queryKey:[Vm,e,i],queryFn:async({signal:a})=>qm(await Te("bondingCurve",e),i,a),enabled:r,staleTime:1/0}))});return{imageMap:(0,Hc.useMemo)(()=>{let i=new Map;for(let a of n)a.data&&i.set(a.data.address,a.data.image_url);return i},[n])}}var Yc=require("@tanstack/react-query"),qc=require("react");var Ni="token-stats";function gr(e,t){return`${e}:${t.toLowerCase()}`}function qr(e,t=!0){let{data:r,...n}=(0,Yc.useQuery)({queryKey:[Ni,e],queryFn:async({signal:i})=>{let a=await Te("walletServer",e),s=await fetch(`${a}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let l=await s.json();if(l.code!==200)throw new Error(`Token stats API error: ${l.code}`);return l},enabled:t,staleTime:3e4});return{statsMap:(0,qc.useMemo)(()=>{let i=new Map;if(!r?.data)return i;for(let a of r.data){let s=gr(a.chain_id,a.address);i.set(s,a)}return i},[r]),...n}}var Kc=require("@tanstack/react-query"),Km="crossd-apr",Zm="https://crossd-dashboard-api.crossdefi.io/api/v1/overview";function Zc(){let{data:e,...t}=(0,Kc.useQuery)({queryKey:[Km],queryFn:async({signal:r})=>{let n=await fetch(Zm,{cache:"no-store",signal:r});if(!n.ok)throw new Error(`Failed to fetch CROSSD overview: ${n.status}`);let o=await n.json();if(o.code!==200)throw new Error(`CROSSD overview API error: ${o.code}`);let i=parseFloat(o.data.est_last_epoch_apy);if(!Number.isFinite(i))throw new Error("CROSSD overview returned a non-numeric APR");return i*100},staleTime:6e4});return{aprPercent:e??null,...t}}var Xc=require("@tanstack/react-query"),ns=require("react");var Xm="token-info";function ko(e,t){return`${t.toLowerCase()}_${e}`}function Jc(e,t=!0){let{data:r,...n}=(0,Xc.useQuery)({queryKey:[Xm,e],queryFn:async({signal:a})=>{let s=await Te("walletServer",e),l=await fetch(`${s}/v1/public/token/info`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Token info API error: ${c.code}`);return c},enabled:t,staleTime:1/0}),o=(0,ns.useMemo)(()=>{let a=new Map;if(!r?.data)return a;for(let s of r.data){let l=ko(s.chain_id,s.address);a.set(l,s.category)}return a},[r]),i=(0,ns.useMemo)(()=>{let a=new Map;if(!r?.data)return a;for(let s of r.data)a.set(ko(s.chain_id,s.address),s);return a},[r]);return{categoryMap:o,infoMap:i,...n}}var $c=require("react"),Ti=Q(require("bignumber.js"),1);function ed(e,t,r){let{tokens:n,isLoading:o}=Yr(e,t,r),{statsMap:i}=qr(e,r);return(0,$c.useMemo)(()=>{let a=new Ti.default(0);for(let u of n){let b=i.get(gr(u.chainId,u.address));if(!b)continue;let d=new Ti.default(u.quantity.numeric).shiftedBy(-u.quantity.decimals).multipliedBy(new Ti.default(b.price));d.isNaN()||(a=a.plus(d))}let s=a.toFixed(),{displayValue:l,isLowerBound:c}=nc(s);return{totalUsd:s,displayValue:l,isLowerBound:c,isLoading:o}},[n,i,o])}var au=require("qrcode.react");function Tt(e,t,r,n){if(!n||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let o;try{o=n(t,r)}catch(c){console.error("[dapp-ui] onOutlink threw:",c);return}let i=c=>{typeof window>"u"||window.open(c,"_blank","noopener,noreferrer")};if((c=>!!c&&(typeof c=="object"||typeof c=="function")&&typeof c.then=="function")(o)){let c=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,u=b=>{if(b===null){c?.close();return}let h=b??t;if(c)try{c.location.href=h}catch{c.close(),i(h)}else i(h)};o.then(u,b=>{console.error("[dapp-ui] onOutlink rejected:",b),c?.close()});return}let s=o;if(s===null)return;i(s??t)}var An=Q(require("react"),1),Sp=require("vaul");var qn=require("react");var dr=Q(require("bignumber.js"),1),Jm=/^(\d{4}-\d{2}-\d{2})/;function td(e){if(!e||e.length===0)return;let t=new Map,r;for(let{key:o,cumulative:i}of e.map(a=>({key:Jm.exec(a.reference_date)?.[1],cumulative:a.cumulative_earned})).filter(a=>!!a.key&&a.cumulative!=null).sort((a,s)=>a.key<s.key?-1:a.key>s.key?1:0))t.set(o,i),r=o;if(r===void 0)return;let n=new Date().toISOString().slice(0,10);return t.get(n)??t.get(r)}function Ii(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Mi(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Ro(e,t){let r=e.length+t.length;if(r>32)return"xs";if(r>24)return"sm"}function os(e){return e?.toUpperCase()==="WONE"?"ONE":e}var $m=["Request Arguments:","Details:","Docs:","Version:","Contract Call:"];function So(e,t){console.error("[wallet-portfolio] withdraw failed:",e);let n=e instanceof Error?e.message:"";for(let i of $m){let a=n.indexOf(i);a>=0&&(n=n.slice(0,a))}return n.split(`
8
+ `).map(i=>i.trim()).find(i=>i.length>0)||t}var eg="0xe00e8bf3";function rd(e,t){let r=typeof e=="bigint"?e:BigInt(e);if(r<0n)throw new Error("poolId must be non-negative");if(t<0n)throw new Error("amount must be non-negative");let n=r.toString(16).padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${eg}${n}${o}`}function Yn(e){return!e||e<=0n?"0":new dr.default(e.toString()).shiftedBy(-9).toFormat(2,dr.default.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Ei(e){return!e||e<=0n?"0":new dr.default(e.toString()).toFormat(0,dr.default.ROUND_DOWN)}function Ai(e){if(!e||e<=0n)return"0";let t=new dr.default(e.toString()).shiftedBy(-18),r=t.isLessThan(1e-4)?7:4;return t.toFormat(r,dr.default.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function zr(e,t){let r=new dr.default(e).shiftedBy(-t);return!r.isFinite()||r.isZero()?"0":r.isGreaterThanOrEqualTo(1)?r.toFormat(2,dr.default.ROUND_DOWN):r.toFormat(4,dr.default.ROUND_DOWN)}function is(e){return zr(e,0)}var Co={rate:1,symbol:"$"};function Tn(e,t=Co){let r=Number.isFinite(t.rate)&&t.rate>0?t.rate:1;return`${t.symbol||"$"}${e.times(r).toFormat(2,dr.default.ROUND_DOWN)}`}function cn(e,t,r,n=Co){let o=new dr.default(r||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let i=new dr.default(e||"0").shiftedBy(-t).times(o);return i.isFinite()?Tn(i,n):null}var No=(0,qn.createContext)(null);function bt(){let e=(0,qn.useContext)(No);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}function hr(){let{conversionRatio:e,currencySymbol:t}=bt();return(0,qn.useMemo)(()=>({rate:typeof e=="number"&&e>0?e:Co.rate,symbol:t||Co.symbol}),[e,t])}var nd=require("vaul");var as=require("react/jsx-runtime");function od({asChild:e,children:t}){let{walletAddress:r}=bt(),n=t!=null,o=e??!0,i=n?t:(0,as.jsx)("button",{type:"button",children:Yt(r)});return(0,as.jsx)(nd.Drawer.Trigger,{asChild:o,children:i})}var Ao=require("vaul");var yt=Q(require("react"),1),kp=require("@tanstack/react-query");var Li=require("react"),ss=(0,Li.createContext)(null);function id(){return(0,Li.useContext)(ss)}var It=require("react/jsx-runtime");function ad({size:e=22,className:t}){return(0,It.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,It.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function sd({size:e=22,className:t}){return(0,It.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,It.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,It.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 Di({size:e=16,className:t}){return(0,It.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,It.jsx)("path",{d:"M5.333 5.333V4a1.333 1.333 0 011.334-1.333h5.333A1.333 1.333 0 0113.333 4v5.333a1.333 1.333 0 01-1.333 1.334h-1.333",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,It.jsx)("path",{d:"M4 5.333h5.333c.737 0 1.334.597 1.334 1.334V12c0 .736-.597 1.333-1.334 1.333H4A1.333 1.333 0 012.667 12V6.667C2.667 5.93 3.263 5.333 4 5.333z",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Pi({size:e=16,className:t}){return(0,It.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,It.jsx)("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Bi({size:e=48,className:t}){return(0,It.jsxs)("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,It.jsx)("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),(0,It.jsx)("path",{d:"M14 24.5l6.6 6.6L34.5 17.5",stroke:"var(--wp-claim-success-mark, #ffffff)",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round"})]})}function pr({size:e=12,className:t}){return(0,It.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,It.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,It.jsx)("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,It.jsx)("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}var ld=require("@tanstack/react-query"),ls=require("react");var tg="wp:reward-pools";function Kn(e,t=!0){let{data:r,...n}=(0,ld.useQuery)({queryKey:[tg,e],queryFn:async({signal:a})=>{let s=await Te("gameReward",e),l=await fetch(`${s}/v1/pools`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch pools: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),o=(0,ls.useMemo)(()=>r?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[r]),i=(0,ls.useMemo)(()=>r?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[r]);return{crossPools:o,gamePools:i,allPools:r?.data.pools??[],...n}}var cd=require("@tanstack/react-query"),dd=require("react");var rg="wp:user-deposits";function zi(e,t,r=!0){let n=r&&!!t,{data:o,...i}=(0,cd.useQuery)({queryKey:[rg,e,t],queryFn:async({signal:s})=>{let l=await Te("gameReward",e),c=await fetch(`${l}/v1/users/${t}/deposits`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let u=await c.json();if(u.code!==200)throw new Error(`Deposits API error: ${u.code}`);return u},enabled:n,staleTime:0});return{depositMap:(0,dd.useMemo)(()=>{let s=new Map;if(!o?.data.user_deposits)return s;for(let l of o.data.user_deposits)s.set(l.pool_address.toLowerCase(),l);return s},[o]),deposits:o?.data.user_deposits??[],...i}}var yd=require("@tanstack/react-query"),xd=require("react");var pd={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},ud={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var fd={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var cs={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},md={dev:`${cs.dev}/portfolio`,stage:`${cs.stage}/portfolio`,production:`${cs.production}/portfolio`};var gd={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},br={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"},Oi={dev:"https://stg-swap-api.crossdefi.io",stage:"https://stg-swap-api.crossdefi.io",production:"https://swap-api.crossdefi.io"},hd={dev:"https://stg.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://www.crossdefi.io"},bd={dev:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",stage:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",production:"0xEFd871aF7D695A0c1709e46b565761F4cd1Ef5ba"},wd={dev:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",stage:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",production:"0x731a104a4461ae45bfef520468b43c262d35e682"};var ng="wp:token-info",og="0x0000000000000000000000000000000000000001";function Or(e,t=!0){let r=ft[e].cross,{data:n,...o}=(0,yd.useQuery)({queryKey:[ng,e],queryFn:async({signal:u})=>{let b=await Te("walletServer",e),h=await fetch(`${b}/v1/public/token/info`,{cache:"no-store",signal:u});if(!h.ok)throw new Error(`Failed to fetch token info: ${h.status}`);let d=await h.json();if(d.code!==200)throw new Error(`Token info API error: ${d.code}`);return d},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:a}=(0,xd.useMemo)(()=>{let u=new Map,b=new Map;if(!n?.data)return{byChainAddr:u,byChainSym:b};for(let h of n.data){let d=h.address.toLowerCase();u.set(`${h.chain_id}:${d}`,h),u.set(d,h);let y=h.symbol.replace(/^t/,"").toUpperCase(),f=`${h.chain_id}:${y}`;b.has(f)||b.set(f,h),b.has(y)||b.set(y,h)}return{byChainAddr:u,byChainSym:b}},[n]);return{getTokenImage:(u,b,h)=>{let d=u.toLowerCase(),y=!!h?.chainOnly,f=i.get(`${r}:${d}`);if(f?.image)return f.image;if(!y){let m=i.get(d);if(m?.image)return m.image}if(b){let m=b.replace(/^t/,"").toUpperCase(),w=a.get(`${r}:${m}`);if(w?.image)return w.image;if(!y){let x=a.get(m);if(x?.image)return x.image}}return""},getTokenSymbol:(u,b,h)=>{let d=u.toLowerCase();return(i.get(`${r}:${d}`)??(h?.chainOnly?void 0:i.get(d)))?.symbol||b},getNativeToken:()=>i.get(`${r}:${og}`),...o}}var ds=Q(require("react"),1);var In=require("react/jsx-runtime");function wr({sectionKey:e,title:t,icon:r,iconFit:n="cover",isEmpty:o,loading:i=!1,children:a}){let s=id();return ds.useEffect(()=>{s?.report(e,{loading:i,empty:o})},[s,e,i,o]),ds.useEffect(()=>()=>s?.unregister(e),[s,e]),o?null:(0,In.jsxs)("div",{className:"wp-svc-card",children:[(0,In.jsxs)("div",{className:"wp-svc-card-head",children:[(0,In.jsx)("img",{className:"wp-svc-card-icon",src:r,alt:"",style:{objectFit:n}}),(0,In.jsx)("span",{className:"wp-svc-card-title",children:t})]}),(0,In.jsx)("div",{className:"wp-svc-items",children:a})]})}var Fi=Q(require("bignumber.js"),1),Me=require("react/jsx-runtime"),ig="ONErewards";function ag(e){return new Fi.default(e||"0").isGreaterThan(0)}function vd(){let{env:e,walletAddress:t,onOutlink:r}=bt(),n=hr(),o=!!t,{allPools:i,isLoading:a}=Kn(e,o),{depositMap:s,isLoading:l}=zi(e,t,o),{getTokenImage:c}=Or(e,o),u=(d,y)=>`${pd[e]}/gametoken/tokens/${d.deposit_token.address}?mode=rewards${y==="withdraw"?"&trade=withdraw":""}`,b=`${br[e]}/reward.png`,h=i.filter(d=>{let y=s.get(d.pool_address.toLowerCase()),f=y?.deposited_amount??"0",m=y?.claimable_reward??"0";return!(new Fi.default(f).isZero()&&new Fi.default(m).isZero())});return(0,Me.jsx)(wr,{sectionKey:"rewards",title:ig,icon:b,isEmpty:h.length===0,loading:a||l,children:h.map(d=>{let y=s.get(d.pool_address.toLowerCase()),f=y?.deposited_amount??"0",m=y?.claimable_reward??"0",w=u(d,"withdraw"),x=u(d,"claim"),p=c(d.deposit_token.address,d.deposit_token.symbol),k=d.reward_tokens[0],R=k?c(k.address,k.symbol):"",S=d.reward_tokens.map(L=>L.symbol),T=S.length>0?`${d.deposit_token.symbol}-${S.join("/")}`:d.deposit_token.symbol,N=k?zr(m,k.decimals):"0",C=k?.symbol??"Reward",M=cn(f,d.deposit_token.decimals,d.deposit_token.price,n),B=k?cn(m,k.decimals,k.price,n):null,W=!!y&&ag(m);return(0,Me.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,Me.jsxs)("div",{className:"wp-item-body",children:[(0,Me.jsxs)("div",{className:"wp-item-line",children:[(0,Me.jsx)("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),(0,Me.jsxs)("div",{className:"wp-svc-token",children:[(0,Me.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[p&&(0,Me.jsx)("img",{className:"wp-svc-token-icon",src:p,alt:""}),R&&(0,Me.jsx)("img",{className:"wp-svc-token-icon",src:R,alt:""})]}),(0,Me.jsx)("span",{children:T})]})]}),(0,Me.jsxs)("div",{className:"wp-item-line",children:[(0,Me.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,Me.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[p&&(0,Me.jsx)("img",{className:"wp-svc-token-icon",src:p,alt:""}),(0,Me.jsxs)("div",{className:"wp-svc-amount",children:[(0,Me.jsx)("span",{className:"wp-svc-amount-main",children:zr(f,d.deposit_token.decimals)}),M&&(0,Me.jsx)("span",{className:"wp-item-usd",children:M})]})]})]}),(0,Me.jsxs)("div",{className:"wp-item-line",children:[(0,Me.jsxs)("span",{className:"wp-item-label",children:["Claimable (",C,")"]}),(0,Me.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[R&&(0,Me.jsx)("img",{className:"wp-svc-token-icon",src:R,alt:""}),(0,Me.jsxs)("div",{className:"wp-svc-amount",children:[(0,Me.jsx)("span",{className:"wp-svc-amount-main",children:N}),B&&(0,Me.jsx)("span",{className:"wp-item-usd",children:B})]})]})]})]}),(0,Me.jsxs)("div",{className:"wp-item-tags",children:[(0,Me.jsxs)("a",{className:"wp-tag wp-tag--muted",href:w,target:"_blank",rel:"noopener noreferrer","data-track":"rewards_withdraw_open",onClick:L=>Tt(L,w,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:y}},r),children:[(0,Me.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,Me.jsx)(pr,{size:12,className:"wp-tag-icon"})]}),(0,Me.jsxs)("a",{className:"wp-tag wp-tag--mint","data-disabled":!W||void 0,"aria-disabled":!W||void 0,href:W?x:void 0,target:W?"_blank":void 0,rel:W?"noopener noreferrer":void 0,onClick:L=>{if(!W){L.preventDefault();return}Tt(L,x,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:y}},r)},children:[(0,Me.jsx)("span",{className:"wp-tag-label",children:"Claim"}),(0,Me.jsx)(pr,{size:12,className:"wp-tag-icon"})]})]})]},d.pool_address)})})}var Ad=Q(require("react"),1);var Rd=require("@tanstack/react-query"),Mo=require("react");var sg="0x70a08231",lg="0x18160ddd",cg="0x313ce567",dg=8e3;async function pg(e,t,r,n){let o=new AbortController,i=setTimeout(()=>o.abort(),dg);n&&n.addEventListener("abort",()=>o.abort(),{once:!0});let a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:r}),signal:o.signal}).finally(()=>clearTimeout(i));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let s=await a.json();if(s.error)throw new Error(`RPC ${t}: ${s.error.message}`);if(s.result===void 0)throw new Error(`RPC ${t}: empty result`);return s.result}function ug(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function To(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function Kr(e,t,r,n,o){try{return await pg(e,"eth_call",[o?{from:o,to:t,data:r}:{to:t,data:r},"latest"],n)}catch{return}}async function fg(e,t,r,n){let[o,i,a]=await Promise.all([Kr(e,r,sg+ug(t),n),Kr(e,r,lg,n),Kr(e,r,cg,n)]),s=To(o);if(s===void 0)return null;let l=To(a);return{balance:s,totalSupply:To(i),decimals:l!==void 0?Number(l):void 0}}async function Io(e,t){let r=ft[e].cross,n=await Te("walletServer",e),o=await fetch(`${n}/v1/public/chain/info/${r}`,{cache:"no-store",signal:t});if(!o.ok)return;let i=await o.json();return("data"in i&&i.data!==void 0?Array.isArray(i.data)?i.data[0]:i.data:i)?.rpc||void 0}async function kd(e,t,r,n){if(!t||r.length===0)return{};let o;try{o=await Io(e,n)}catch{o=void 0}if(!o)return{};let i=await Promise.all(r.map(async s=>[s.toLowerCase(),await fg(o,t,s,n)])),a={};for(let[s,l]of i)l&&(a[s]=l);return a}var mg="wp:withdraw-token-meta",gg="0xc89039c5",hg="0x95d89b41",bg="0x313ce567";function wg(e){if(!(!e||e==="0x"))try{let t=e.replace(/^0x/,""),r=Number(BigInt("0x"+t.slice(64,128)));if(!Number.isFinite(r)||r<=0||r>64)return;let n=t.slice(128,128+r*2),o="";for(let i=0;i<n.length;i+=2)o+=String.fromCharCode(parseInt(n.slice(i,i+2),16));return o||void 0}catch{return}}function yg(e){if(!e||e==="0x")return;let r="0x"+e.replace(/^0x/,"").padStart(64,"0").slice(24,64);return/^0x[a-f0-9]{40}$/.test(r)&&r!=="0x0000000000000000000000000000000000000000"?r:void 0}async function xg(e,t,r){if(t.length===0)return{};let n;try{n=await Io(e,r)}catch{n=void 0}if(!n)return{};let o=await Promise.all(t.map(async a=>{let s=yg(await Kr(n,a,gg,r));if(!s)return[a.toLowerCase(),null];let[l,c]=await Promise.all([Kr(n,s,hg,r),Kr(n,s,bg,r)]),u=wg(l),b=To(c);return u?[a.toLowerCase(),{tokenAddress:s,symbol:u,decimals:b!==void 0?Number(b):18}]:[a.toLowerCase(),null]})),i={};for(let[a,s]of o)s&&(i[a]=s);return i}function Sd(e,t,r=!0){let o=r&&!!t,{allPools:i,isLoading:a}=Kn(e,o),{deposits:s,isLoading:l}=zi(e,t,o),c=(0,Mo.useMemo)(()=>{let m=new Map;for(let w of i)m.set(w.pool_address.toLowerCase(),w);return m},[i]),u=(0,Mo.useMemo)(()=>s.filter(m=>{try{return BigInt(m.deposited_amount||"0")>0n}catch{return!1}}),[s]),b=(0,Mo.useMemo)(()=>u.map(m=>m.pool_address.toLowerCase()).filter(m=>!c.has(m)).sort(),[u,c]),{data:h,isLoading:d}=(0,Rd.useQuery)({queryKey:[mg,e,b],queryFn:({signal:m})=>xg(e,b,m),enabled:o&&b.length>0,staleTime:1440*60*1e3});return{positions:(0,Mo.useMemo)(()=>{let m=[];for(let w of u){let x=w.pool_address.toLowerCase(),p=c.get(x);if(p){m.push({poolId:w.pool_id,poolAddress:w.pool_address,poolType:p.pool_type,tokenSymbol:p.deposit_token.symbol,tokenAddress:p.deposit_token.address,decimals:p.deposit_token.decimals,price:p.deposit_token.price,depositedRaw:w.deposited_amount});continue}let k=h?.[x];k&&m.push({poolId:w.pool_id,poolAddress:w.pool_address,poolType:"Unknown",tokenSymbol:k.symbol,tokenAddress:k.tokenAddress,decimals:k.decimals,depositedRaw:w.deposited_amount})}return m},[u,c,h]),isLoading:a||l||d}}var Ft=Q(require("react"),1);var Y=require("react/jsx-runtime"),vg=400;function kg(e,t,r){if(t==="loading")return"Estimating...";if(!e||t==="error"||t==="unavailable")return"Wallet estimate";let n=e.maxFeePerGas??e.gasPrice;return!n||n<=0n||e.gasLimit<=0n?"Wallet estimate":`${Ai(e.gasLimit*n)} ${r??""}`.trim()}function ps(e,t,r){return r==="loading"?"Estimating...":r==="error"||r==="unavailable"?"-":`${e} ${t}`.trim()}function Rg({position:e,size:t}){return e.icon?(0,Y.jsx)("img",{src:e.icon,alt:"",width:t,height:t}):(0,Y.jsx)("span",{children:e.tokenSymbol.slice(0,1)})}function Cd({open:e,status:t,positions:r,initialPoolAddress:n,walletAddress:o,txHash:i,error:a,copied:s=!1,estimateWithdraw:l,onClose:c,onConfirm:u,onCopyHash:b,trackFunnel:h,nativeSymbol:d}){let[y,f]=Ft.useState(null),[m,w]=Ft.useState("idle"),x=Ft.useRef(0),p=Ft.useRef(void 0),k=Ft.useRef(null);Ft.useEffect(()=>()=>clearTimeout(p.current),[]);let R=Ft.useMemo(()=>{let $=n?.toLowerCase();return r.find(P=>P.poolAddress.toLowerCase()===$)??r[0]??null},[r,n]),S=Ft.useMemo(()=>{try{return BigInt(R?.depositedRaw??"0")}catch{return 0n}},[R?.depositedRaw]),T=R?.decimals??18;Ft.useEffect(()=>{!e||!R||h?.("position_selected")},[e,R,h]);let N=Ft.useCallback(()=>{f(null),w(l?"idle":"unavailable"),x.current+=1,k.current=null},[]);if(Ft.useEffect(()=>{e&&N()},[e,N]),Ft.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(p.current);return}if(!l||!R){clearTimeout(p.current),w("unavailable");return}if(S<=0n){clearTimeout(p.current),x.current+=1,k.current=null,f(null),w("idle");return}let $=`${R.poolAddress.toLowerCase()}:${S.toString()}`;if(k.current===$)return;k.current=$,clearTimeout(p.current);let P=x.current+1;x.current=P,w("loading"),p.current=setTimeout(()=>{l(R,S).then(F=>{x.current===P&&(f(F??null),w(F?"ready":"unavailable"))}).catch(()=>{x.current===P&&(f(null),w("error"))})},vg)},[e,t,S,l,R]),!e||!R)return null;let C=t==="submitting",M=Yn(y?.maxPriorityFeePerGas),B=Yn(y?.maxFeePerGas??y?.gasPrice),W=Ei(y?.gasLimit),L=zr(R.depositedRaw,T);return(0,Y.jsx)("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:$=>{$.target===$.currentTarget&&!C&&c()},children:(0,Y.jsxs)("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-withdraw-title","aria-label":"Withdraw","data-status":t,"data-vaul-no-drag":!0,children:[(0,Y.jsx)("div",{className:"wp-claim-grabber","aria-hidden":!0,children:(0,Y.jsx)("span",{})}),(0,Y.jsxs)("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:(0,Y.jsx)(Bi,{})}),(0,Y.jsxs)("div",{className:"wp-claim-copy",children:[(0,Y.jsx)("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),(0,Y.jsx)("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),(0,Y.jsx)("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:(0,Y.jsxs)("div",{className:"wp-claim-list-item",children:[(0,Y.jsx)("span",{children:"Tx Hash"}),(0,Y.jsxs)("button",{type:"button",className:"wp-claim-hash",onClick:b,"aria-label":"Copy transaction hash","data-track":"withdraw_hash_copy",children:[(0,Y.jsx)("strong",{children:Mi(i)}),s?(0,Y.jsx)(Pi,{}):(0,Y.jsx)(Di,{})]})]})})]}):(0,Y.jsxs)(Y.Fragment,{children:[t==="error"&&(0,Y.jsxs)("div",{className:"wp-claim-heading",children:[(0,Y.jsx)("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),(0,Y.jsx)("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),(0,Y.jsxs)("div",{className:"wp-claim-reward-card","data-fit":Ro(R.tokenSymbol,L),"aria-label":"Deposited balance",children:[(0,Y.jsx)("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:(0,Y.jsx)(Rg,{position:R,size:28})}),(0,Y.jsx)("strong",{className:"wp-claim-reward-symbol",children:R.tokenSymbol}),(0,Y.jsx)("strong",{className:"wp-claim-reward-amount",children:L})]}),(0,Y.jsxs)("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[(0,Y.jsxs)("div",{className:"wp-claim-account-row",children:[(0,Y.jsxs)("div",{className:"wp-claim-account",children:[(0,Y.jsx)("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),(0,Y.jsxs)("strong",{children:[R.tokenSymbol," Pool"]})]}),(0,Y.jsx)("span",{children:Ii(o)})]}),(0,Y.jsx)("span",{className:"wp-claim-divider","aria-hidden":!0}),(0,Y.jsxs)("div",{className:"wp-claim-detail-list",children:[(0,Y.jsxs)("div",{className:"wp-claim-detail-row",children:[(0,Y.jsx)("span",{children:"Est. Tx Fee"}),(0,Y.jsx)("strong",{children:kg(y,m,d)})]}),(0,Y.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,Y.jsx)("span",{children:"Priority Fee Per Gas"}),(0,Y.jsx)("strong",{children:ps(M,"Gwei",m)})]}),(0,Y.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,Y.jsx)("span",{children:"Max Fee Per Gas"}),(0,Y.jsx)("strong",{children:ps(B,"Gwei",m)})]}),(0,Y.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,Y.jsx)("span",{children:"Gas Limit"}),(0,Y.jsx)("strong",{children:ps(W,"",m)})]})]})]})]}),(0,Y.jsxs)("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&(0,Y.jsx)("button",{type:"button",className:"wp-claim-secondary","data-track":"withdraw_cancel",onClick:c,children:t==="error"?"Close":"Cancel"}),(0,Y.jsxs)("button",{type:"button",className:"wp-claim-primary","data-track":"withdraw_confirm",onClick:()=>{if(t==="success"){c();return}R&&S>0n&&u(R,S,y)},disabled:C||(t==="confirm"||t==="error")&&S<=0n,children:[t==="success"&&"Done",t==="submitting"&&(0,Y.jsx)("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),(0,Y.jsx)("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:(0,Y.jsx)("span",{})})]})})}var wt=Q(require("react"),1),Md=require("@tanstack/react-query");var Nd=require("@tanstack/react-query");var Sg="wp:reward-factory-info";function Td(e,t=!0){let{data:r,...n}=(0,Nd.useQuery)({queryKey:[Sg,e],queryFn:async({signal:o})=>{let i=await Te("gameReward",e),a=await fetch(`${i}/v1/factory/info`,{cache:"no-store",signal:o});if(!a.ok)throw new Error(`Factory info fetch failed: ${a.status}`);let s=await a.json();if(s.code!==200)throw new Error(`Factory info API error: ${s.code}`);return s},enabled:t,staleTime:0});return{factoryInfo:r?.data??null,routerAddress:r?.data.router_address??"",...n}}var Cg="wp:";function Id(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Ed(e){let{env:t,walletAddress:r,sendTransaction:n,estimateGas:o}=bt(),i=!!r,a=!!n,s=(0,Md.useQueryClient)(),{routerAddress:l}=Td(t,i&&a),c=Id(l),[u,b]=wt.useState(!1),[h,d]=wt.useState(void 0),[y,f]=wt.useState("confirm"),[m,w]=wt.useState(),[x,p]=wt.useState(""),[k,R]=wt.useState(!1),S=wt.useRef(void 0);wt.useEffect(()=>()=>clearTimeout(S.current),[]);let T=wt.useRef(new Set),N=wt.useCallback((F,de)=>{T.current.has(F)||(T.current.add(F),Ae("withdraw",F,{...de,tags:{section:e,...de?.tags}}))},[e]),C=wt.useCallback((F,de)=>c?{to:c,value:0n,data:rd(F,de),chainId:ft[t].cross}:null,[t,c]),M=wt.useCallback(()=>{s.invalidateQueries({predicate:F=>typeof F.queryKey[0]=="string"&&F.queryKey[0].startsWith(Cg)})},[s]),B=wt.useCallback(F=>{d(F),b(!0),f("confirm"),w(void 0),p(""),R(!1),T.current=new Set,N("opened")},[N]),W=wt.useCallback(()=>{y!=="submitting"&&(b(!1),d(void 0),f("confirm"),w(void 0),p(""),R(!1),y==="success"&&M())},[y,M]),L=wt.useCallback(async(F,de)=>{if(!o)return null;let V=C(F.poolId,de),_=Id(r);return!V||!_?null:o({...V,from:_})},[C,o,r]),$=wt.useCallback(async()=>{if(!(!m||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(m),R(!0),clearTimeout(S.current),S.current=setTimeout(()=>R(!1),1400)}catch{R(!1)}},[m]),P=wt.useCallback(async(F,de,V)=>{if(!n){f("error"),p("Withdraw is not available for this wallet.");return}if(!c){f("error"),p("Withdraw contract address is not available.");return}try{f("submitting"),p("");let _=C(F.poolId,de);if(!_){f("error"),p("Withdraw contract address is not available.");return}N("submitted");let we=await n({..._,gas:V?.gasLimit&&V.gasLimit>0n?V.gasLimit:void 0,maxFeePerGas:V?.maxFeePerGas&&V.maxFeePerGas>0n?V.maxFeePerGas:void 0,maxPriorityFeePerGas:V?.maxPriorityFeePerGas&&V.maxPriorityFeePerGas>0n?V.maxPriorityFeePerGas:void 0});w(we),f("success"),N("confirmed"),M()}catch(_){f("error"),p(So(_,"Failed to request withdraw.")),N("confirmed",{status:"failure",reason:ir(_)})}},[C,M,c,n,N]);return{canWithdrawInline:a,isOpen:u,initialPoolAddress:h,status:y,txHash:m,error:x,copied:k,hasEstimator:!!o,openWithdraw:B,closeWithdraw:W,estimateWithdraw:L,confirmWithdraw:P,copyHash:$,trackFunnelOnce:N}}var qe=require("react/jsx-runtime"),Ng="ONEpoints";function Ld(){let{env:e,walletAddress:t,onOutlink:r}=bt(),n=hr(),o=!!t,{getTokenImage:i,getNativeToken:a}=Or(e,o),s=Ed("points"),{positions:l,isLoading:c}=Sd(e,t,o),u=Ad.useMemo(()=>l.filter(d=>d.poolType!=="CrossPool").map(d=>({...d,icon:i(d.tokenAddress,d.tokenSymbol)})),[l,i]),b=`${br[e]}/point.png`,h=ud[e];return(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(wr,{sectionKey:"points",title:Ng,icon:b,isEmpty:u.length===0,loading:c,children:u.map(d=>{let y=d.price?cn(d.depositedRaw,d.decimals,d.price,n):null;return(0,qe.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,qe.jsxs)("div",{className:"wp-item-body",children:[(0,qe.jsxs)("div",{className:"wp-item-line",children:[(0,qe.jsx)("span",{className:"wp-item-label",children:"Token"}),(0,qe.jsxs)("div",{className:"wp-svc-token",children:[d.icon&&(0,qe.jsx)("img",{className:"wp-svc-token-icon",src:d.icon,alt:""}),(0,qe.jsx)("span",{children:d.tokenSymbol})]})]}),(0,qe.jsxs)("div",{className:"wp-item-line",children:[(0,qe.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,qe.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[d.icon&&(0,qe.jsx)("img",{className:"wp-svc-token-icon",src:d.icon,alt:""}),(0,qe.jsxs)("div",{className:"wp-svc-amount",children:[(0,qe.jsx)("span",{className:"wp-svc-amount-main",children:zr(d.depositedRaw,d.decimals)}),y&&(0,qe.jsx)("span",{className:"wp-item-usd",children:y})]})]})]})]}),(0,qe.jsx)("div",{className:"wp-item-tags",children:s.canWithdrawInline?(0,qe.jsx)("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"points_withdraw_open",onClick:()=>s.openWithdraw(d.poolAddress),children:(0,qe.jsx)("span",{className:"wp-tag-label",children:"Withdraw"})}):(0,qe.jsxs)("a",{className:"wp-tag wp-tag--muted",href:h,target:"_blank",rel:"noopener noreferrer","data-track":"points_withdraw_open",onClick:f=>Tt(f,h,{category:"portfolio",origin:"portfolio-points",payload:{position:d}},r),children:[(0,qe.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,qe.jsx)(pr,{size:12,className:"wp-tag-icon"})]})})]},d.poolAddress)})}),(0,qe.jsx)(Cd,{open:s.isOpen,status:s.status,positions:u,initialPoolAddress:s.initialPoolAddress,walletAddress:t,txHash:s.txHash,error:s.error,copied:s.copied,estimateWithdraw:s.hasEstimator?s.estimateWithdraw:void 0,onClose:s.closeWithdraw,onConfirm:s.confirmWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce,nativeSymbol:a()?.symbol})]})}var fs=Q(require("react"),1);var Dd=require("@tanstack/react-query");var Tg="wp:stake-info";function Pd(e,t,r=!0){let n=r&&!!t,{data:o,...i}=(0,Dd.useQuery)({queryKey:[Tg,e,t],queryFn:async({signal:s})=>{let l=await Te("posa",e),c=await fetch(`${l}/stake/${t}`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Stake info fetch failed: ${c.status}`);let u=await c.json();if(u.code!==0&&u.code!==200)throw new Error(`Stake info API error: ${u.code}`);return u},enabled:n,staleTime:0});return{stakeInfo:o?.data,...i}}var Bd=require("@tanstack/react-query");var Ig="wp:stake-rewards",Mg=31;function zd(e,t,r=!0){let n=r&&!!t,{data:o,...i}=(0,Bd.useQuery)({queryKey:[Ig,e,t],queryFn:async({signal:a})=>{let s=await Te("posa",e),l=await fetch(`${s}/rewards/${t}?limit=${Mg}`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Stake rewards fetch failed: ${l.status}`);let c=await l.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake rewards API error: ${c.code}`);return c.data?.data??[]},enabled:n,staleTime:0});return{latestReward:o?.[0]??null,aprAccrued:td(o),...i}}var Od=require("@tanstack/react-query"),Eg="wp:staking-onchain";function Fd(e,t,r=!0){let n=r&&!!t&&!!e,{data:o,...i}=(0,Od.useQuery)({queryKey:[Eg,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:n,staleTime:0});return{onchain:o,...i}}var us=require("react"),Wd=Q(require("bignumber.js"),1);function Ud(e){return e?.trim().toUpperCase()==="ONE"}function jd(e){return new Wd.default(e||"0").isGreaterThan(0)}function Ui(e,t,r=!0){let{allPools:n}=Kn(e,r),o=(0,us.useMemo)(()=>{for(let c of n)for(let u of[c.deposit_token,...c.reward_tokens])if(Ud(u?.symbol)&&jd(u.price))return u.price},[n]),i=r&&o===void 0,{tokens:a}=Yr(e,t,i),{statsMap:s}=qr(e,i),l=ft[e].cross;return(0,us.useMemo)(()=>{if(o)return o;let c=a.find(u=>u.chainId===l&&Ud(u.symbol));if(c){let u=s.get(gr(c.chainId,c.address));if(u&&jd(u.price))return u.price}return"0"},[o,a,s,l])}var Zr=Q(require("bignumber.js"),1),mt=require("react/jsx-runtime");function Ag(e){if(!e)return"\u2014";let t=new Zr.default(e);return t.isFinite()?`${t.toFormat(2,Zr.default.ROUND_DOWN)}%`:"\u2014"}function _d(){let{env:e,walletAddress:t,onOutlink:r,stakingRewardsReader:n}=bt(),o=hr(),i=!!t,{stakeInfo:a,isLoading:s}=Pd(e,t,i),{latestReward:l,aprAccrued:c,isLoading:u}=zd(e,t,i),{onchain:b}=Fd(t,n,i),h=Ui(e,t,i),{getNativeToken:d}=Or(e,i),y=d()?.symbol,f="ONEstaking",m=`${br[e]}/cross-staking.png`,w=md[e],x=a?.total_stake??"0",p=fs.useMemo(()=>b?new Zr.default(b.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??a?.rewards_earned??"0",[b,l,a]),k=fs.useMemo(()=>b?new Zr.default(b.stakedWei.toString()).shiftedBy(-18):new Zr.default(x),[b,x]),R=c!==void 0?new Zr.default(c):void 0,S=a?.days_since_first_stake,T=R!==void 0&&R.isFinite()&&k.isGreaterThan(0)&&S!==null&&S!==void 0?R.div(k).times(365).div(Math.max(1,S)).times(100):void 0,N=!(new Zr.default(x).isZero()&&new Zr.default(p).isZero()),C=cn(x,0,h,o),M=cn(p,0,h,o);return(0,mt.jsx)(wr,{sectionKey:"staking",title:f,icon:m,iconFit:"contain",isEmpty:!N,loading:s||u,children:(0,mt.jsxs)("article",{className:"wp-item","data-side":"stake",children:[(0,mt.jsxs)("div",{className:"wp-item-body",children:[(0,mt.jsxs)("div",{className:"wp-item-line",children:[(0,mt.jsx)("span",{className:"wp-item-label",children:"Staked"}),(0,mt.jsxs)("div",{className:"wp-svc-amount",children:[(0,mt.jsx)("span",{className:"wp-svc-amount-main",children:`${is(x)} ${y??""}`.trim()}),C&&(0,mt.jsx)("span",{className:"wp-item-usd",children:C})]})]}),(0,mt.jsxs)("div",{className:"wp-item-line",children:[(0,mt.jsx)("span",{className:"wp-item-label",children:"Rewards Earned"}),(0,mt.jsxs)("div",{className:"wp-svc-amount",children:[(0,mt.jsx)("span",{className:"wp-svc-amount-main",children:`${is(p)} ${y??""}`.trim()}),M&&(0,mt.jsx)("span",{className:"wp-item-usd",children:M})]})]}),(0,mt.jsxs)("div",{className:"wp-item-line",children:[(0,mt.jsx)("span",{className:"wp-item-label",children:"My APR"}),(0,mt.jsx)("span",{children:Ag(T?.toString(10))})]})]}),(0,mt.jsx)("div",{className:"wp-item-tags",children:(0,mt.jsxs)("a",{className:"wp-tag wp-tag--mint",href:w,target:"_blank",rel:"noopener noreferrer","data-track":"stake_outlink",onClick:B=>Tt(B,w,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a}},r),children:[(0,mt.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,mt.jsx)(pr,{size:12,className:"wp-tag-icon"})]})})]})})}var ms=Q(require("react"),1);var Gd=require("@tanstack/react-query");var Lg="wp:game-swap-pools";function Hd(e,t,r=!0){let n=r&&!!t,{data:o,...i}=(0,Gd.useQuery)({queryKey:[Lg,e,t],queryFn:async({signal:a})=>{let s=await Te("gameSwap",e),l=await fetch(`${s}/addresses/${t}/portfolio`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Game-swap portfolio fetch failed: ${l.status}`);return(await l.json()).pools??[]},enabled:n,staleTime:0});return{pools:o??[],...i}}var Qd=require("@tanstack/react-query");var Dg="wp:game-swap-lp-balances";function Vd(e,t,r,n){let o=[...r].map(l=>l.toLowerCase()).sort(),i=!!t&&o.length>0,{data:a,...s}=(0,Qd.useQuery)({queryKey:[Dg,e,t,o,!!n],queryFn:async({signal:l})=>{let c=n?await n(o):await kd(e,t,o,l),u={};for(let[b,h]of Object.entries(c))u[b.toLowerCase()]=h;return u},enabled:i,staleTime:0});return{balances:a??{},...s}}var Fr=Q(require("bignumber.js"),1),rt=require("react/jsx-runtime"),Pg="Gametoken LP",qd=18,Bg=new Fr.default("0.0001");function Yd(e){return e?.trim().toUpperCase()==="ONE"}function zg(e){return e&&e>0?e:qd}function Og(e){let t=Yd(e.token_a?.symbol)&&!Yd(e.token_b?.symbol),r=t?e.reserve_a:e.reserve_b,n=zg(t?e.token_a?.decimals:e.token_b?.decimals),o=new Fr.default(r||"0").shiftedBy(-n);return!o.isFinite()||o.isLessThanOrEqualTo(0)?new Fr.default(0):o.times(2)}function Fg(e,t,r,n){let o=e.token_a?.symbol?.trim()||"TOKEN",i=e.token_b?.symbol?.trim()||n||"?",a=t?.decimals??qd,s,l;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let c=new Fr.default(t.balance.toString()),u=new Fr.default(t.totalSupply.toString()),b=c.div(u);s=b.times(100);let h=b.times(Og(e));if(h.isGreaterThan(0)){let d=new Fr.default(e.quote_usd??e.cross_usd??"0");l=d.isGreaterThan(0)?Tn(h.times(d),r):`${h.toFormat(4,Fr.default.ROUND_DOWN)} ${n??""}`.trim()}}return{pool:e,tokenASymbol:o,tokenBSymbol:i,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:a,sharePercent:s,valueText:l}}function Kd(){let{env:e,walletAddress:t,onOutlink:r,lpBalanceReader:n}=bt(),o=hr(),i=!!t,{pools:a,isLoading:s}=Hd(e,t,i),l=ms.useMemo(()=>a.map(w=>w.pair_address).filter(Boolean),[a]),{balances:c,isLoading:u}=Vd(e,t,l,n),{getNativeToken:b}=Or(e,i),h=b()?.symbol,d=`${br[e]}/game-token.png`,y=Object.keys(c).length>0,f=ms.useMemo(()=>{let w=a.map(x=>Fg(x,c[x.pair_address?.toLowerCase()],o,h));return y?w.filter(x=>x.lpAmountRaw?new Fr.default(x.lpAmountRaw).shiftedBy(-x.lpDecimals).isGreaterThanOrEqualTo(Bg):!1):w},[a,c,y,o,h]),m=w=>{let x=w.token_a?.address??w.pair_address;return`${gd[e]}/gametoken/tokens/${x}?trade=deposit`};return(0,rt.jsx)(wr,{sectionKey:"gameSwap",title:Pg,icon:d,iconFit:"contain",isEmpty:f.length===0,loading:s||u,children:f.map(w=>{let{pool:x}=w,p=m(x),k=`${w.tokenASymbol} / ${w.tokenBSymbol}`,R=x.token_a?.logo_url,S=x.token_b?.logo_url;return(0,rt.jsxs)("article",{className:"wp-item","data-side":"game-swap",children:[(0,rt.jsxs)("div",{className:"wp-item-body",children:[(0,rt.jsxs)("div",{className:"wp-item-line",children:[(0,rt.jsx)("span",{className:"wp-item-label",children:"Pool"}),(0,rt.jsxs)("div",{className:"wp-svc-token",children:[(0,rt.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[R&&(0,rt.jsx)("img",{className:"wp-svc-token-icon",src:R,alt:""}),S&&(0,rt.jsx)("img",{className:"wp-svc-token-icon",src:S,alt:""})]}),(0,rt.jsx)("span",{children:k})]})]}),w.lpAmountRaw!==void 0&&(0,rt.jsxs)("div",{className:"wp-item-line",children:[(0,rt.jsx)("span",{className:"wp-item-label",children:"My LP"}),(0,rt.jsxs)("span",{children:[zr(w.lpAmountRaw,w.lpDecimals)," LP"]})]}),w.sharePercent!==void 0&&(0,rt.jsxs)("div",{className:"wp-item-line",children:[(0,rt.jsx)("span",{className:"wp-item-label",children:"Pool Share"}),(0,rt.jsxs)("span",{children:[w.sharePercent.toFormat(2,Fr.default.ROUND_DOWN),"%"]})]}),w.valueText!==void 0&&(0,rt.jsxs)("div",{className:"wp-item-line",children:[(0,rt.jsx)("span",{className:"wp-item-label",children:"Value"}),(0,rt.jsx)("span",{children:w.valueText})]})]}),(0,rt.jsx)("div",{className:"wp-item-tags",children:(0,rt.jsxs)("a",{className:"wp-tag wp-tag--mint",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"gameswap_outlink","data-track-id":k,onClick:T=>Tt(T,p,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:x}},r),children:[(0,rt.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,rt.jsx)(pr,{size:12,className:"wp-tag-icon"})]})})]},x.pair_address)})})}var dn=Q(require("bignumber.js"),1),tp=require("react");var Zd=require("@tanstack/react-query");var Ug="wp:forge-pools";function Xd(e,t,r=!0){let n=r&&!!t,{data:o,...i}=(0,Zd.useQuery)({queryKey:[Ug,e,t],queryFn:async()=>{let s=await Te("bondingCurve",e),l=await fetch(`${s}/v1/users/${t}/pools`,{cache:"no-store"});if(!l.ok)throw new Error(`forge pools fetch failed: ${l.status}`);return(await l.json()).data?.items??[]},enabled:n,staleTime:0}),a=o??[];return{pools:a,isEmpty:a.length===0,...i}}var Jd=require("@tanstack/react-query"),$d=require("react");var jg="wp:forge-token-detail";async function Wg(e,t){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return r.ok?(await r.json())?.data?.token??null:null}function ep(e,t,r=!0){let n=(0,Jd.useQueries)({queries:t.map(a=>({queryKey:[jg,e,a],queryFn:async()=>Wg(await Te("bondingCurve",e),a),enabled:r&&!!a,staleTime:3e4}))}),o=(0,$d.useMemo)(()=>{let a=new Map;for(let s=0;s<n.length;s++){let l=n[s]?.data,c=t[s];l&&c&&a.set(c.toLowerCase(),l)}return a},[n,t]),i=n.some(a=>a.isLoading);return{detailMap:o,isLoading:i}}var ot=require("react/jsx-runtime"),_g="ONEforge",rp=18,Gg="https://contents.crosstoken.io/wallet/token/images/FT.png";function Hg(e){if(!e||e==="0")return"0";let t=new dn.default(e).shiftedBy(-rp);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,dn.default.ROUND_DOWN):t.toFormat(4,dn.default.ROUND_DOWN)}function Qg(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 Vg(e,t,r,n){let o=new dn.default(r||"0");if(!o.isGreaterThan(0))return null;let i=new dn.default(e.total_supply||"0"),a=new dn.default(e.lp_balance||"0"),s=new dn.default(t?.reserve_b||"0").shiftedBy(-rp);if(!i.isGreaterThan(0)||!a.isGreaterThan(0)||!s.isGreaterThan(0))return null;let l=s.times(2),u=a.div(i).times(l).times(o);return u.isFinite()?Tn(u,n):null}function np(){let{env:e,walletAddress:t,onOutlink:r}=bt(),n=hr(),o=!!t,{pools:i,isEmpty:a,isLoading:s}=Xd(e,t,o),l=(0,tp.useMemo)(()=>i.map(d=>d.token.address),[i]),{detailMap:c}=ep(e,l,o&&l.length>0),u=Ui(e,t,o),b=d=>`${fd[e]}/forge/token/${d.token.address}`,h=`${br[e]}/forge.png`;return(0,ot.jsx)(wr,{sectionKey:"forge",title:_g,icon:h,iconFit:"contain",isEmpty:a,loading:s,children:i.map(d=>{let y=c.get(d.token.address.toLowerCase()),f=y?.image_url||y?.image||d.token.image||Gg,m=y?.symbol||d.token.symbol,w=b(d),x=Vg(d,y,u,n);return(0,ot.jsxs)("a",{className:"wp-item","data-side":"lp",href:w,target:"_blank",rel:"noopener noreferrer","data-track":"forge_outlink","data-track-id":m,onClick:p=>Tt(p,w,{category:"portfolio",origin:"portfolio-forge",payload:{pool:d,tokenDetail:y}},r),children:[(0,ot.jsxs)("div",{className:"wp-item-body",children:[(0,ot.jsxs)("div",{className:"wp-item-line",children:[(0,ot.jsx)("span",{className:"wp-item-label",children:"Asset"}),(0,ot.jsxs)("div",{className:"wp-svc-token",children:[(0,ot.jsx)("img",{className:"wp-svc-token-icon",src:f,alt:""}),(0,ot.jsx)("span",{children:m}),y?.name&&(0,ot.jsx)("span",{className:"wp-token-subtle",children:y.name})]})]}),(0,ot.jsxs)("div",{className:"wp-item-line",children:[(0,ot.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,ot.jsx)("div",{className:"wp-svc-token wp-svc-token--amount",children:(0,ot.jsxs)("div",{className:"wp-svc-amount",children:[(0,ot.jsx)("span",{className:"wp-svc-amount-main",children:Hg(d.lp_balance)}),x&&(0,ot.jsx)("span",{className:"wp-item-usd",children:x})]})})]}),(0,ot.jsxs)("div",{className:"wp-item-line",children:[(0,ot.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,ot.jsx)("span",{className:"wp-line-value",children:Qg(d.pool_ownership)})]})]}),(0,ot.jsx)("div",{className:"wp-item-tags",children:(0,ot.jsxs)("span",{className:"wp-tag wp-tag--muted",children:[(0,ot.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,ot.jsx)(pr,{size:12,className:"wp-tag-icon"})]})})]},d.pair_address)})})}var ws=require("react"),xp=Q(require("bignumber.js"),1);var op=require("@tanstack/react-query");var Yg="wp:crossd-positions";function qg(e){let t=e??{};return(t.positions??t.data?.positions??[]).filter(n=>{if(!n?.token_id||!n.liquidity)return!1;try{return BigInt(n.liquidity)>0n}catch{return!1}})}function ip(e,t,r=!0){let n=r&&!!t,{data:o,...i}=(0,op.useQuery)({queryKey:[Yg,e,t],queryFn:async()=>{let s=await fetch(`${Oi[e]}/api/v1/positions?owner=${t}`,{cache:"no-store"});if(!s.ok)throw new Error(`crossd positions fetch failed: ${s.status}`);return qg(await s.json())},enabled:n,staleTime:0}),a=o??[];return{positions:a,isEmpty:a.length===0,...i}}var ap=require("@tanstack/react-query"),sp=require("react");var Kg="wp:crossd-position-details";function Zg(e){let t=e??{},r=t.data??t;return r?.token_id||r?.pool?r:null}function lp(e,t,r=!0){let n=(0,ap.useQueries)({queries:t.map(i=>({queryKey:[Kg,e,i],queryFn:async()=>{let a=await fetch(`${Oi[e]}/api/v1/positions/${i}`,{cache:"no-store"});if(!a.ok)throw new Error(`crossd position detail failed: ${a.status}`);return Zg(await a.json())},enabled:r&&!!i,staleTime:6e4}))});return{detailMap:(0,sp.useMemo)(()=>{let i=new Map;return n.forEach((a,s)=>{let l=a.data,c=t[s];l&&c&&i.set(c,l)}),i},[n,t])}}var Xr=Q(require("react"),1);var X=require("react/jsx-runtime"),Xg=300*1e3,cp="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Jg(e,t,r){if(t)return"Estimating...";if(!e)return"Wallet estimate";let n=e.maxFeePerGas??e.gasPrice;return!n||n<=0n||e.gasLimit<=0n?"Wallet estimate":`${Ai(e.gasLimit*n)} ${r??""}`.trim()}function gs(e,t,r){return r?"Estimating...":`${e} ${t}`.trim()}function dp({open:e,status:t,target:r,token0Icon:n,token1Icon:o,token0Symbol:i,token1Symbol:a,nativeSymbol:s,txHash:l,error:c,copied:u=!1,hasEstimator:b,prepareWithdraw:h,confirmWithdraw:d,onClose:y,onCopyHash:f,trackFunnel:m}){let[w,x]=Xr.useState(null),[p,k]=Xr.useState(null),R=Xr.useRef(0);Xr.useEffect(()=>{if(!e||!r)return;let re=++R.current;x(null),k(null),m?.("dialog_opened"),h().then(Se=>{R.current===re&&(x(Se),k(Se?Date.now():null))})},[e,r]);let S=t==="submitting",T=t==="estimating"||t==="confirm"&&!w,N=Xr.useCallback(async()=>{let re=w,Se=!p||Date.now()-p>Xg;if(!re||Se){let ye=++R.current;if(re=await h(),R.current!==ye)return;x(re),k(re?Date.now():null)}re&&await d(re)},[w,p,h,d]);if(!e||!r)return null;let{position:C,detail:M}=r,B=M.pool?.token0,W=M.pool?.token1,L=i||B?.symbol||C.pool?.token0_symbol||"?",$=a||W?.symbol||C.pool?.token1_symbol||"?",P=B?.decimals??18,F=W?.decimals??18,de=n||B?.logo_url||cp,V=o||W?.logo_url||cp,_=`${L}/${$}`,we=w?Vn(w.expectedAmount0.toString(),P):null,ee=w?Vn(w.expectedAmount1.toString(),F):null,Z=Yn(w?.estimate?.maxPriorityFeePerGas),j=Yn(w?.estimate?.maxFeePerGas??w?.estimate?.gasPrice),ie=Ei(w?.estimate?.gasLimit);return(0,X.jsx)("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:re=>{re.target===re.currentTarget&&!S&&y()},children:(0,X.jsxs)("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-crossd-withdraw-title","aria-label":"Withdraw position","data-status":t,"data-vaul-no-drag":!0,children:[(0,X.jsx)("div",{className:"wp-claim-grabber","aria-hidden":!0,children:(0,X.jsx)("span",{})}),(0,X.jsxs)("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&l?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:(0,X.jsx)(Bi,{})}),(0,X.jsxs)("div",{className:"wp-claim-copy",children:[(0,X.jsx)("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),(0,X.jsxs)("p",{className:"wp-claim-desc",children:["Your ",_," position withdrawal has been submitted. Balances will update shortly after the transaction settles."]})]}),(0,X.jsx)("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:(0,X.jsxs)("div",{className:"wp-claim-list-item",children:[(0,X.jsx)("span",{children:"Tx Hash"}),(0,X.jsxs)("button",{type:"button",className:"wp-claim-hash",onClick:f,"aria-label":"Copy transaction hash","data-track":"crossd_withdraw_hash_copy",children:[(0,X.jsx)("strong",{children:Mi(l)}),u?(0,X.jsx)(Pi,{}):(0,X.jsx)(Di,{})]})]})})]}):(0,X.jsxs)(X.Fragment,{children:[t==="error"&&(0,X.jsxs)("div",{className:"wp-claim-heading",children:[(0,X.jsx)("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),(0,X.jsx)("p",{className:"wp-claim-error-message",children:c||"The withdraw request could not be completed."})]}),(0,X.jsxs)("div",{className:"wp-claim-reward-card","data-fit":Ro(L,we??""),"aria-label":`Expected ${L}`,children:[(0,X.jsx)("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:(0,X.jsx)("img",{src:de,alt:"",width:28,height:28})}),(0,X.jsx)("strong",{className:"wp-claim-reward-symbol",children:L}),(0,X.jsx)("strong",{className:"wp-claim-reward-amount",children:we??"Estimating..."})]}),(0,X.jsxs)("div",{className:"wp-claim-reward-card","data-fit":Ro($,ee??""),"aria-label":`Expected ${$}`,children:[(0,X.jsx)("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:(0,X.jsx)("img",{src:V,alt:"",width:28,height:28})}),(0,X.jsx)("strong",{className:"wp-claim-reward-symbol",children:$}),(0,X.jsx)("strong",{className:"wp-claim-reward-amount",children:ee??"Estimating..."})]}),b&&(0,X.jsx)("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:(0,X.jsxs)("div",{className:"wp-claim-detail-list",children:[(0,X.jsxs)("div",{className:"wp-claim-detail-row",children:[(0,X.jsx)("span",{children:"Est. Tx Fee"}),(0,X.jsx)("strong",{children:Jg(w?.estimate,T,s)})]}),(0,X.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,X.jsx)("span",{children:"Priority Fee Per Gas"}),(0,X.jsx)("strong",{children:gs(Z,"Gwei",T)})]}),(0,X.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,X.jsx)("span",{children:"Max Fee Per Gas"}),(0,X.jsx)("strong",{children:gs(j,"Gwei",T)})]}),(0,X.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,X.jsx)("span",{children:"Gas Limit"}),(0,X.jsx)("strong",{children:gs(ie,"",T)})]})]})})]}),(0,X.jsxs)("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&(0,X.jsx)("button",{type:"button",className:"wp-claim-secondary","data-track":"crossd_withdraw_cancel",onClick:y,children:t==="error"?"Close":"Cancel"}),(0,X.jsx)("button",{type:"button",className:"wp-claim-primary","data-track":"crossd_withdraw_confirm",onClick:()=>{if(t==="success"){y();return}S||T||(m?.("confirm_clicked"),N())},disabled:S||T,children:t==="success"?"Done":S?(0,X.jsx)("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}):T?(0,X.jsx)("span",{className:"wp-claim-button-spinner","aria-label":"Estimating"}):t==="error"?"Retry":"Withdraw"})]})]}),(0,X.jsx)("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:(0,X.jsx)("span",{})})]})})}var ct=Q(require("react"),1),bp=require("@tanstack/react-query");var $g="0x0c49ccbe",eh="0xfc6f7865",th="0x49404b7c",rh="0xdf2ab5bb",nh="0xac9650d8",pp=(1n<<128n)-1n,fp=600n,oh=99n,ih=100n;function hs(e){return e*oh/ih}function up(e,t){return!!e&&!!t&&e.toLowerCase()===t.toLowerCase()}function ar(e,t){if(e<0n)throw new Error(`${t} must be non-negative`);let r=e.toString(16);if(r.length>64)throw new Error(`${t} exceeds uint256`);return r.padStart(64,"0")}function ji(e,t){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`${t} is not a valid address`);return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function bs(e){return $g+ar(e.tokenId,"tokenId")+ar(e.liquidity,"liquidity")+ar(e.amount0Min,"amount0Min")+ar(e.amount1Min,"amount1Min")+ar(e.deadline,"deadline")}function ah(e){return eh+ar(e.tokenId,"tokenId")+ji(e.recipient,"recipient")+ar(e.amount0Max,"amount0Max")+ar(e.amount1Max,"amount1Max")}function sh(e,t){return th+ar(e,"amountMinimum")+ji(t,"recipient")}function lh(e,t,r){return rh+ji(e,"token")+ar(t,"amountMinimum")+ji(r,"recipient")}function ch(e){if(e.length===0)throw new Error("multicall requires at least one call");let t=e.map(o=>{let i=o.replace(/^0x/,"");if(i.length%2!==0||!/^[0-9a-fA-F]*$/.test(i))throw new Error("multicall element must be valid hex bytes");let a=i.length%64===0?i:i.padEnd(i.length+(64-i.length%64),"0");return ar(BigInt(i.length/2),"callLength")+a.toLowerCase()}),r=BigInt(e.length)*32n,n=[];for(let o of t)n.push(ar(r,"callOffset")),r+=BigInt(o.length/2);return nh+ar(0x20n,"arrayOffset")+ar(BigInt(e.length),"arrayLength")+n.join("")+t.join("")}function mp(e){if(!e||e==="0x")return null;let t=e.replace(/^0x/,"");return t.length<128||!/^[0-9a-fA-F]+$/.test(t)?null:{amount0:BigInt(`0x${t.slice(0,64)}`),amount1:BigInt(`0x${t.slice(64,128)}`)}}function gp(e){let t=up(e.token0,e.wcrossAddress),r=up(e.token1,e.wcrossAddress),n=t||r,o=[bs({tokenId:e.tokenId,liquidity:e.liquidity,amount0Min:e.amount0Min,amount1Min:e.amount1Min,deadline:e.deadline}),ah({tokenId:e.tokenId,recipient:n?e.positionManagerAddress:e.owner,amount0Max:pp,amount1Max:pp})];return n&&(o.push(sh(0n,e.owner)),o.push(lh(t?e.token1:e.token0,0n,e.owner))),ch(o)}async function hp(e,t,r){let n;try{n=await Io(e,r)}catch{n=void 0}if(!n)return null;let o=bs({tokenId:t.tokenId,liquidity:t.liquidity,amount0Min:0n,amount1Min:0n,deadline:t.deadline}),i=await Kr(n,t.positionManager,o,r,t.owner);return mp(i)}var dh="wp:",ph=[1500,3e3,4500,6e3];function uh(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function wp(){let{env:e,walletAddress:t,sendTransaction:r,estimateGas:n}=bt(),o=!!r,i=(0,bp.useQueryClient)(),[a,s]=ct.useState(!1),[l,c]=ct.useState(null),[u,b]=ct.useState("confirm"),[h,d]=ct.useState(),[y,f]=ct.useState(""),[m,w]=ct.useState(!1),[x,p]=ct.useState(new Set),k=ct.useRef(void 0),R=ct.useRef([]),S=ct.useRef(0);ct.useEffect(()=>()=>{clearTimeout(k.current),R.current.forEach(clearTimeout)},[]);let T=ct.useRef(new Set),N=ct.useCallback((P,F)=>{T.current.has(P)||(T.current.add(P),Ae("withdraw",P,{...F,tags:{section:"crossdPool",...F?.tags}}))},[]),C=ct.useCallback(()=>{let P=()=>i.invalidateQueries({predicate:F=>typeof F.queryKey[0]=="string"&&F.queryKey[0].startsWith(dh)});P(),R.current.forEach(clearTimeout),R.current=ph.map(F=>setTimeout(P,F))},[i]),M=ct.useCallback(P=>{S.current+=1,c(P),s(!0),b("confirm"),d(void 0),f(""),w(!1),T.current=new Set,N("opened")},[N]),B=ct.useCallback(()=>{u!=="submitting"&&(S.current+=1,s(!1),c(null),b("confirm"),d(void 0),f(""),w(!1))},[u]),W=ct.useCallback(async()=>{let P=S.current,F=uh(t),de=l?.position.token_id,V=l?.position.liquidity,_=l?.detail.pool?.token0?.address,we=l?.detail.pool?.token1?.address;if(!F||!de||!V||!_||!we)return b("error"),f("Position data is incomplete. Please refresh and retry."),null;try{b("estimating"),f("");let ee=BigInt(de),Z=BigInt(V),j=BigInt(Math.floor(Date.now()/1e3))+fp,ie=bd[e],re=await hp(e,{owner:F,positionManager:ie,tokenId:ee,liquidity:Z,deadline:j});if(S.current!==P)return null;if(!re)return b("error"),f("Failed to estimate withdrawal amounts. Please retry."),null;let Se=gp({tokenId:ee,liquidity:Z,amount0Min:hs(re.amount0),amount1Min:hs(re.amount1),deadline:j,owner:F,positionManagerAddress:ie,token0:_,token1:we,wcrossAddress:wd[e]}),ye={to:ie,value:0n,data:Se,chainId:ft[e].cross},ne=null;if(n){try{ne=await n({...ye,from:F})}catch{ne=null}if(S.current!==P)return null}return b("confirm"),{tx:ye,estimate:ne,expectedAmount0:re.amount0,expectedAmount1:re.amount1}}catch(ee){return S.current!==P||(b("error"),f(So(ee,"Failed to prepare withdraw."))),null}},[e,n,l,t]),L=ct.useCallback(async P=>{if(!r){b("error"),f("Withdraw is not available for this wallet.");return}try{b("submitting"),f(""),N("submitted");let F=await r({...P.tx,gas:P.estimate?.gasLimit&&P.estimate.gasLimit>0n?P.estimate.gasLimit:void 0,maxFeePerGas:P.estimate?.maxFeePerGas&&P.estimate.maxFeePerGas>0n?P.estimate.maxFeePerGas:void 0,maxPriorityFeePerGas:P.estimate?.maxPriorityFeePerGas&&P.estimate.maxPriorityFeePerGas>0n?P.estimate.maxPriorityFeePerGas:void 0});d(F),b("success");let de=l?.position.token_id;de&&p(V=>{let _=new Set(V);return _.add(de),_}),N("confirmed"),C()}catch(F){b("error"),f(So(F,"Failed to request withdraw.")),N("confirmed",{status:"failure",reason:ir(F)})}},[C,r,l,N]),$=ct.useCallback(async()=>{if(!(!h||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(h),w(!0),clearTimeout(k.current),k.current=setTimeout(()=>w(!1),1400)}catch{w(!1)}},[h]);return{canWithdrawInline:o,isOpen:a,target:l,withdrawnTokenIds:x,status:u,txHash:h,error:y,copied:m,hasEstimator:!!n,openWithdraw:M,closeWithdraw:B,prepareWithdraw:W,confirmWithdraw:L,copyHash:$,trackFunnelOnce:N}}var Je=require("react/jsx-runtime"),fh="ONEusd Pool",yp="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function vp(){let{env:e,walletAddress:t,onOutlink:r}=bt(),n=hr(),o=!!t,{positions:i,isLoading:a}=ip(e,t,o),s=wp(),l=(0,ws.useMemo)(()=>i.filter(N=>!N.token_id||!s.withdrawnTokenIds.has(N.token_id)),[i,s.withdrawnTokenIds]),c=(0,ws.useMemo)(()=>l.map(N=>N.token_id).filter(N=>!!N),[l]),{detailMap:u}=lp(e,c,o&&c.length>0),b=`${hd[e]}/pool`,{getTokenImage:h,getTokenSymbol:d,getNativeToken:y}=Or(e,o),f=h("","ONEUSD",{chainOnly:!0})||`${br[e]}/crossd.png`,m={chainOnly:!0},w=(N,C)=>{let M=os(d(N?.address??"",N?.symbol??C,m));return M==="ONE"?y()?.symbol??"?":M??"?"},x=(N,C)=>{let M=N?.symbol??C,B=os(M);return B==="ONE"?y()?.image||yp:h(N?.address??"",B,m)||N?.logo_url||yp},p=s.target?.detail.pool,k=x(p?.token0,s.target?.position.pool?.token0_symbol),R=x(p?.token1,s.target?.position.pool?.token1_symbol),S=w(p?.token0,s.target?.position.pool?.token0_symbol),T=w(p?.token1,s.target?.position.pool?.token1_symbol);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(wr,{sectionKey:"crossdPool",title:fh,icon:f,iconFit:"contain",isEmpty:l.length===0,loading:a,children:l.map(N=>{let C=N.token_id?u.get(N.token_id):void 0,M=`${w(C?.pool?.token0,N.pool?.token0_symbol)}/${w(C?.pool?.token1,N.pool?.token1_symbol)}`,B=N.pool?.fee_tier_percentage,W=x(C?.pool?.token0,N.pool?.token0_symbol),L=x(C?.pool?.token1,N.pool?.token1_symbol),$=Tn(new xp.default(N.position_value_usd??"0"),n),P=s.canWithdrawInline&&!!C?.pool?.token0?.address&&!!C?.pool?.token1?.address;return(0,Je.jsxs)("article",{className:"wp-item","data-side":"crossd",children:[(0,Je.jsxs)("div",{className:"wp-item-body",children:[(0,Je.jsxs)("div",{className:"wp-item-line",children:[(0,Je.jsx)("span",{className:"wp-item-label",children:"Pool"}),(0,Je.jsxs)("div",{className:"wp-svc-token",children:[(0,Je.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[(0,Je.jsx)("img",{className:"wp-svc-token-icon",src:W,alt:""}),(0,Je.jsx)("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),(0,Je.jsx)("span",{children:M}),B&&(0,Je.jsx)("span",{className:"wp-token-subtle",children:B})]})]}),(0,Je.jsxs)("div",{className:"wp-item-line",children:[(0,Je.jsx)("span",{className:"wp-item-label",children:"Position Value"}),(0,Je.jsx)("span",{className:"wp-line-value",children:$})]})]}),(0,Je.jsx)("div",{className:"wp-item-tags",children:P?(0,Je.jsx)("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"crossd_pool_withdraw_open","data-track-id":M,onClick:()=>{C&&s.openWithdraw({position:N,detail:C})},children:(0,Je.jsx)("span",{className:"wp-tag-label",children:"Withdraw"})}):(0,Je.jsxs)("a",{className:"wp-tag wp-tag--muted",href:b,target:"_blank",rel:"noopener noreferrer","data-track":"crossd_pool_outlink","data-track-id":M,onClick:F=>Tt(F,b,{category:"portfolio",origin:"portfolio-crossd-pool",payload:{position:N,detail:C}},r),children:[(0,Je.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,Je.jsx)(pr,{size:12,className:"wp-tag-icon"})]})})]},N.token_id)})}),(0,Je.jsx)(dp,{open:s.isOpen,status:s.status,target:s.target,token0Icon:k,token1Icon:R,token0Symbol:S,token1Symbol:T,nativeSymbol:y()?.symbol,txHash:s.txHash,error:s.error,copied:s.copied,hasEstimator:s.hasEstimator,prepareWithdraw:s.prepareWithdraw,confirmWithdraw:s.confirmWithdraw,onClose:s.closeWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce})]})}var Eo=["rewards","points","staking","gameSwap","forge","crossdPool"];pe(`.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-system-orange-default, #f0640d);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-system-orange-lowest, #2e2820);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--wp-claim-primary-text: #ffffff;--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-system-orange-default, #f0640d);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-system-orange-low, #fff5ee);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--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-item[data-side=reward] .wp-svc-token-icon{border-radius:0;object-fit:contain}.wp-svc-token--amount{align-items:flex-start}.wp-svc-token--amount>.wp-svc-token-icon{margin-top:2.5px}.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-body-inner[data-empty]{min-height:100%;box-sizing:border-box;justify-content:center}.wp-portfolio-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:280px;padding:32px 24px;text-align:center}.wp-portfolio-empty-icon{display:flex;align-items:center;justify-content:center;width:56px;height:56px;margin-bottom:6px;border-radius:50%;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);color:var(--wp-text-30)}.wp-portfolio-empty-title{margin:0;font-size:15px;font-weight:600;line-height:1.3;color:var(--wp-text-60)}.wp-portfolio-empty-desc{margin:0;font-size:13px;font-weight:400;line-height:1.4;color:var(--wp-text-30)}.wp-portfolio-loading{display:flex;align-items:center;justify-content:center;min-height:280px;padding:32px 24px}.wp-portfolio-spinner{width:22px;height:22px;border:2px solid var(--wp-border);border-top-color:var(--wp-mint);border-radius:50%;animation:wp-claim-spin .8s linear infinite}.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-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}}.wi-popover-content .wp-claim-sheet{min-height:min(600px,calc(100% - 24px))}.wi-popover-content .wp-claim-content{flex:1 1 auto}.wi-popover-content .wp-claim-actions{margin-top:auto}.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:6px;width:100%;min-height:60px;padding:16px 8px;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-reward-card[data-fit=sm] .wp-claim-reward-symbol{font-size:14px}.wp-claim-reward-card[data-fit=sm] .wp-claim-reward-amount{font-size:16px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-symbol{font-size:12px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-amount{font-size:13px}.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}.wp-withdraw-amount-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-withdraw-amount-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-input{flex:1 1 auto;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);font-family:inherit;font-size:24px;font-weight:600;line-height:1.3;letter-spacing:0;text-align:left;outline:none}.wp-withdraw-input::placeholder{color:var(--wp-text-30)}.wp-withdraw-input[aria-invalid=true]{color:var(--wp-claim-error)}.wp-withdraw-input-symbol{flex-shrink:0;color:var(--wp-text-40);font-size:15px;font-weight:600;line-height:1.3}.wp-withdraw-quick-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-quick{appearance:none;flex:1 1 0;min-width:0;height:32px;padding:0 10px;border:1px solid var(--wp-border);border-radius:999px;background:transparent;color:var(--wp-text-60);font-family:inherit;font-size:13px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer}.wp-withdraw-quick:hover:not(:disabled){border-color:var(--wp-claim-primary);color:var(--wp-claim-primary)}.wp-withdraw-quick:disabled{cursor:default;opacity:.5}.wp-withdraw-content{overflow-y:auto}.wp-withdraw-token-list{display:flex;flex-direction:column;gap:8px;width:100%;max-height:216px;overflow-y:auto}.wp-withdraw-token{appearance:none;display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:10px 12px;border:1px solid var(--wp-border);border-radius:8px;background:var(--wp-card);color:var(--wp-text);font-family:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.wp-withdraw-token[data-selected]{border-color:var(--wp-claim-primary);box-shadow:inset 0 0 0 1px var(--wp-claim-primary)}.wp-withdraw-token:disabled{cursor:default;opacity:.6}.wp-withdraw-token-icon{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-withdraw-token-icon img{width:28px;height:28px;object-fit:cover}.wp-withdraw-token-icon 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-withdraw-token-symbol{flex:1 1 auto;min-width:0;overflow:hidden;font-size:15px;font-weight:600;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.wp-withdraw-token-amount{flex-shrink:0;color:var(--wp-text-40);font-size:13px;font-weight:500;line-height:1.3;white-space:nowrap}
9
+ `);var fe=require("react/jsx-runtime"),ys=15,mh="wp:";function Mn({env:e,theme:t="light",walletAddress:r,walletName:n,onBack:o,showHeader:i=!0,variant:a="embed",className:s,onOutlink:l,lpBalanceReader:c,stakingRewardsReader:u,sendTransaction:b,estimateGas:h,conversionRatio:d,currencySymbol:y,sections:f}){let m=Xe(e),w=yt.useCallback(ne=>!f||f.includes(ne),[f]),x=!!r,p=(0,kp.useQueryClient)(),[k,R]=yt.useState({}),S=yt.useCallback((ne,Ne)=>{R(Oe=>{let xe=Oe[ne];return xe&&xe.loading===Ne.loading&&xe.empty===Ne.empty?Oe:{...Oe,[ne]:Ne}})},[]),T=yt.useCallback(ne=>{R(Ne=>{if(!(ne in Ne))return Ne;let Oe={...Ne};return delete Oe[ne],Oe})},[]),N=yt.useMemo(()=>({report:S,unregister:T}),[S,T]),[C,M]=yt.useState(ys),[B,W]=yt.useState(!1),[L,$]=yt.useState(!1),P=yt.useRef(void 0),F=yt.useCallback(()=>{p.invalidateQueries({predicate:ne=>typeof ne.queryKey[0]=="string"&&ne.queryKey[0].startsWith(mh)})},[p]),de=yt.useCallback(()=>{F(),W(!0),setTimeout(()=>W(!1),600),M(ys)},[F]);yt.useEffect(()=>{if(!x)return;let ne=setInterval(()=>{M(Ne=>Ne<=1?(de(),ys):Ne-1)},1e3);return()=>clearInterval(ne)},[x,de]);let V=yt.useCallback(()=>{o?.()},[o]),_=x?Vr(m,r,{size:64}):void 0,we=yt.useCallback(async()=>{if(!(L||!r))try{await navigator.clipboard.writeText(r),$(!0),clearTimeout(P.current),P.current=setTimeout(()=>$(!1),2e3)}catch{}},[r,L]);yt.useEffect(()=>()=>clearTimeout(P.current),[]);let ee=yt.useMemo(()=>({env:m,theme:t,open:!0,walletAddress:r,close:V,onOutlink:l,lpBalanceReader:c,stakingRewardsReader:u,sendTransaction:b,estimateGas:h,conversionRatio:d,currencySymbol:y}),[m,t,r,V,l,c,u,b,h,d,y]),Z=Eo.filter(w),j=Z.length>0&&Z.every(ne=>{let Ne=k[ne];return!!Ne&&!Ne.loading}),ie=j&&Z.every(ne=>k[ne]?.empty),re=Z.some(ne=>{let Ne=k[ne];return!!Ne&&!Ne.empty}),Se=Z.length>0&&!j&&!re,ye=(0,fe.jsxs)(fe.Fragment,{children:[i&&(0,fe.jsxs)("div",{className:"wp-header",children:[(0,fe.jsxs)("div",{className:"wp-header-account",children:[o&&(0,fe.jsx)("button",{type:"button",className:"wp-header-btn","aria-label":"Back","data-track":"back",onClick:o,children:(0,fe.jsx)(ad,{})}),(0,fe.jsx)("span",{className:"wp-header-avatar","aria-hidden":!0,children:_&&(0,fe.jsx)("img",{src:_,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(n||r)&&(0,fe.jsxs)("div",{className:"wp-header-account-meta",children:[n&&(0,fe.jsx)("span",{className:"wp-header-wallet-name",title:n,children:n}),r&&(0,fe.jsxs)("button",{type:"button",className:"wp-header-address-btn",onClick:we,"aria-label":"Copy wallet address","data-track":"address_copy",children:[(0,fe.jsx)("span",{className:"wp-header-address",children:Ii(r)}),(0,fe.jsx)("span",{className:"wp-header-address-copy","data-copied":L,children:L?(0,fe.jsx)(Hr,{size:14}):(0,fe.jsx)(kn,{size:14})})]})]})]}),(0,fe.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio","data-track":"refresh",onClick:de,children:[(0,fe.jsx)(sd,{className:B?"wp-spin-once":void 0}),x&&(0,fe.jsx)("span",{className:"wp-refresh-badge",children:C})]})]}),(0,fe.jsx)("div",{className:"wp-body",children:(0,fe.jsxs)("div",{className:"wp-body-inner","data-empty":ie||void 0,children:[w("rewards")&&(0,fe.jsx)(vd,{}),w("points")&&(0,fe.jsx)(Ld,{}),w("staking")&&(0,fe.jsx)(_d,{}),w("gameSwap")&&(0,fe.jsx)(Kd,{}),w("forge")&&(0,fe.jsx)(np,{}),w("crossdPool")&&(0,fe.jsx)(vp,{}),Se&&(0,fe.jsx)("div",{className:"wp-portfolio-loading",role:"status","aria-label":"Loading portfolio",children:(0,fe.jsx)("span",{className:"wp-portfolio-spinner","aria-hidden":!0})}),ie&&(0,fe.jsxs)("div",{className:"wp-portfolio-empty",role:"status",children:[(0,fe.jsx)("span",{className:"wp-portfolio-empty-icon","aria-hidden":!0,children:(0,fe.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,fe.jsx)("path",{d:"M20 7H5a2 2 0 0 1-2-2 2 2 0 0 1 2-2h13v4"}),(0,fe.jsx)("path",{d:"M3 5v13a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1"}),(0,fe.jsx)("circle",{cx:"16.5",cy:"13.5",r:"1",fill:"currentColor",stroke:"none"})]})}),(0,fe.jsx)("p",{className:"wp-portfolio-empty-title",children:"No assets yet"}),(0,fe.jsx)("p",{className:"wp-portfolio-empty-desc",children:"Assets you hold across ONE services will appear here."})]})]})})]});return(0,fe.jsx)(No.Provider,{value:ee,children:(0,fe.jsx)(ss.Provider,{value:N,children:(0,fe.jsx)(ve,{feature:"wallet_portfolio",children:a==="none"?ye:(0,fe.jsx)("div",{className:Ie(a==="fullscreen"?"wp-fullscreen":"wp-embed",s),"data-theme":t,children:ye})})})})}var En=require("react/jsx-runtime");function Rp({className:e}){let{env:t,theme:r,walletAddress:n,close:o,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s}=bt();return(0,En.jsxs)(Ao.Drawer.Portal,{children:[(0,En.jsx)(Ao.Drawer.Overlay,{className:"wp-overlay"}),(0,En.jsxs)(Ao.Drawer.Content,{className:Ie("wp-fullscreen",e),"data-theme":r,children:[(0,En.jsx)(Ao.Drawer.Title,{className:"wp-sr-only",children:"Portfolio"}),(0,En.jsx)(Mn,{env:t,theme:r,walletAddress:n,onBack:o,variant:"none",onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s})]})]})}var xs=require("react/jsx-runtime");function gh({env:e,theme:t="light",walletAddress:r,open:n,onOpenChange:o,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:c,conversionRatio:u,currencySymbol:b,children:h}){let d=Xe(e),y=n!==void 0,[f,m]=An.useState(!1),w=y?n:f,x=An.useCallback(R=>{y||m(R),o?.(R)},[y,o]),p=An.useCallback(()=>x(!1),[x]),k=An.useMemo(()=>({env:d,theme:t,open:w,walletAddress:r,close:p,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:c,conversionRatio:u,currencySymbol:b}),[d,t,w,r,p,i,a,s,l,c,u,b]);return(0,xs.jsx)(No.Provider,{value:k,children:(0,xs.jsx)(Sp.Drawer.Root,{direction:"bottom",open:w,onOpenChange:x,noBodyStyles:!0,children:h})})}var vs=Object.assign(gh,{Trigger:od,Content:Rp});var J=Q(require("react"),1),Ln=require("react-dom"),Mr=Q(require("bignumber.js"),1);var er=require("react/jsx-runtime");function Cp({size:e=20,className:t}){return(0,er.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,er.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),(0,er.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function Np({size:e=16,className:t}){return(0,er.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,er.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 Tp({size:e=16,className:t}){return(0,er.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,er.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 Ip({size:e=20,className:t}){return(0,er.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,er.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 Mp({size:e=16,className:t}){return(0,er.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,er.jsx)("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ep({size:e=12,className:t}){return(0,er.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,er.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 G=Q(require("react"),1);var ks=Q(require("bignumber.js"),1);function Ap(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Lp(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,ks.default.ROUND_DOWN).toFixed()}function hh(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 bh(e){let t=e.fromToken.priceUsd,r=e.toToken.priceUsd,n=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,o=new ks.default(n||"0");return!o.isFinite()||o.isNaN()||o.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:Ap(t)&&Ap(r)?e.lastChangedBy==="to"?{fromAmount:Lp(o.multipliedBy(r).dividedBy(t))}:{toAmount:Lp(o.multipliedBy(t).dividedBy(r))}:hh(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function Dp({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(r){return e?e(r):bh(r)},async submitBridge(r){if(!t)throw new Error("Bridge submit handler is not configured.");return t(r)}}}var Pp=15,wh=18,Fp="cross_bridge_terms_accepted",yh=3600*24*365;function xh(e){let t=e.replace(/[^\d.]/g,""),r=t.indexOf(".");r!==-1&&(t=t.slice(0,r+1)+t.slice(r+1).replace(/\./g,""));let n=t.indexOf(".");if(n===-1)return t.slice(0,Pp);let o=t.slice(0,n).slice(0,Pp),i=t.slice(n+1).slice(0,wh);return`${o}.${i}`}function vh(){return typeof document>"u"?!1:document.cookie.split(";").map(e=>e.trim()).some(e=>e===`${Fp}=true`)}function kh(){if(typeof document>"u")return;let e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=[`${Fp}=true`,"Path=/",`Max-Age=${yh}`,"SameSite=Lax",e].filter(Boolean).join("; ")}function Rh(e){let t=Number(e??"0");if(!Number.isFinite(t)||t<.1)return"1";let r=n=>Math.floor(n*100)/100;if(t<3){let n=r(t*3);return String(n<1?1:n)}return"10"}function Bp(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("ONE")?t.slice(1):t}function Sh(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let r=new Set([Bp(e.symbol),Bp(t.symbol)]);return r.has("ONE")&&r.has("ONEUSD")}function Ir(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Wi(e){return e[0]}function Rs(e,t,r,n){if(r&&!Ir(r,t))return r;let o=t?n?.(t,e):void 0;if(o?.length)return o[0];if(!t)return e[1]??Wi(e);let i=e.findIndex(s=>Ir(s,t)),a=i>=0?e[i+1]:void 0;return a&&!Ir(a,t)?a:e.find(s=>!Ir(s,t))??t}function zp({fromToken:e,toToken:t,fromAmount:r,toAmount:n,lastChangedBy:o,slippage:i}){return{fromToken:e,toToken:t,fromAmount:r,toAmount:n,lastChangedBy:o,slippage:i}}function _i(e,t=0){if(!e||t>5)return[];if(typeof e=="string")return[e];if(!(e instanceof Error)&&typeof e!="object")return[String(e)];let r=e;return[...[e instanceof Error?e.name:r.name,e instanceof Error?e.message:r.message,r.shortMessage,r.details,r.code].filter(o=>typeof o=="string"||typeof o=="number").map(String),..._i(r.cause,t+1),..._i(r.data,t+1),..._i(r.error,t+1)]}function Ss(e){let t=_i(e).join(" ").toLowerCase(),r=t.includes("signature_failed")&&(t.includes("\uD0C0\uC785 \uB370\uC774\uD130 \uC11C\uBA85\uC5D0 \uC2E4\uD328")||t.includes("typed data")||t.includes("signtypeddata"));return t.includes("4001")||t.includes("err_user_rejected")||t.includes("userrejectedrequesterror")||t.includes("user rejected")||t.includes("user denied")||t.includes("user cancelled")||t.includes("user canceled")||t.includes("rejected the request")||t.includes("request rejected")||t.includes("action_rejected")||t.includes("rejected by user")||r}function Op(e,t){return Ss(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
10
+ `)[0]?.trim()||t}function Up(e){let{tokens:t,initialFromToken:r,initialToToken:n,getToTokens:o,getApproval:i,approveBridge:a,history:s=[],initialSlippage:l="1",termsUrl:c=Hn,getQuote:u,submitBridge:b,onSubmitted:h,onSuccess:d,onFailed:y,onExit:f}=e,m=G.useMemo(()=>Dp({getQuote:u,submitBridge:b}),[u,b]),[w,x]=G.useState("form"),[p,k]=G.useState(r??Wi(t)),[R,S]=G.useState(()=>Rs(t,r??Wi(t),n,o)),[T,N]=G.useState(""),[C,M]=G.useState(""),[B,W]=G.useState("from"),[L,$]=G.useState(l),[P,F]=G.useState(null),de=G.useMemo(()=>Sh(p,R),[p,R]),V=G.useMemo(()=>de?"1":L==="auto"?Rh(P?.priceImpact):L,[de,L,P?.priceImpact]),[_,we]=G.useState(""),[ee,Z]=G.useState("idle"),[j,ie]=G.useState(""),[re,Se]=G.useState(null),[ye,ne]=G.useState([]),[Ne,Oe]=G.useState(!1),[xe,Be]=G.useState(vh),[ge,Ze]=G.useState(null),[dt,Fe]=G.useState(!1),[Ue,De]=G.useState(null),[ht,et]=G.useState(null),[Qe,Mt]=G.useState(!1),[vt,Dt]=G.useState(!1),je=G.useRef(0),Pt=G.useRef(null),kt=G.useRef(!1),Rt=G.useRef(!1),Zt=G.useRef(!1),Bt=G.useRef(!1),We=G.useRef(!1);G.useEffect(()=>{kt.current||(kt.current=!0,Ae("bridge","opened"))},[]);let pt=G.useCallback(()=>{Pt.current&&(clearTimeout(Pt.current),Pt.current=null)},[]),Ge=G.useCallback(A=>{pt(),et(A)},[pt]);G.useEffect(()=>pt,[pt]),G.useEffect(()=>{let A=t.find(he=>Ir(he,p))??Wi(t),E=A?o?.(A,t):void 0,z=E?.find(he=>Ir(he,R))??(E?void 0:t.find(he=>Ir(he,R)))??Rs(t,A,void 0,o);k(A),S(z)},[o,t,p,R]);let tt=G.useCallback((A,E)=>{let z=xh(A);if(!z){je.current+=1,N(""),M(""),W(E),F(null),we(""),Z("idle");return}E==="from"?N(z):M(z),W(E),we(""),!Zt.current&&Number(z)>0&&(Zt.current=!0,Ae("bridge","amount_entered"))},[]),at=G.useCallback(()=>{je.current+=1,N(""),M(""),W("from"),F(null),we(""),ie(""),Z("idle"),Ze(null),Fe(!1),De(null),Mt(!1),Ge(null)},[Ge]),jt=G.useCallback(A=>{Ir(A,p)||(Rt.current||(Rt.current=!0,Ae("bridge","token_selected",{tags:{item_id:`from:${A.symbol}`}})),k(A),S(Rs(t,A,void 0,o)),at())},[p,o,at,t]),Wt=G.useCallback(A=>{Ir(A,R)||Ir(A,p)||(Rt.current||(Rt.current=!0,Ae("bridge","token_selected",{tags:{item_id:`to:${A.symbol}`}})),S(A),at())},[p,at,R]),st=G.useMemo(()=>p?o?.(p,t)??t.filter(A=>!Ir(A,p)):[],[p,o,t]),zt=G.useCallback(()=>{p?.balance&&tt(p.balance,"from")},[p?.balance,tt]),_t=G.useCallback(()=>{!p||!R||(k(R),S(p),at())},[p,at,R]),Xt=G.useCallback(()=>{je.current+=1,N(""),M(""),W("from"),F(null),we(""),ie("")},[]);G.useEffect(()=>{if(!p||!R)return;if(!T&&!C){F(null),we(""),Z(z=>z==="quoting"?"idle":z);return}let A=++je.current,E=zp({fromToken:p,toToken:R,fromAmount:T,toAmount:C,lastChangedBy:B,slippage:L});Z(z=>z==="submitting"?z:m.canQuote?"quoting":"idle"),(async()=>{try{let z=await m.getQuote(E);if(je.current!==A)return;z.fromAmount!==void 0&&B==="to"&&N(z.fromAmount),z.toAmount!==void 0&&B==="from"&&M(z.toAmount),F(z.summary??null),we(z.error??"")}catch(z){if(je.current!==A)return;we(z instanceof Error?z.message:"Failed to quote bridge.")}finally{je.current===A&&Z(z=>z==="quoting"?"idle":z)}})()},[T,p,B,m,L,C,R]);let O=G.useCallback(()=>!p||!R?null:zp({fromToken:p,toToken:R,fromAmount:T,toAmount:C,lastChangedBy:B,slippage:V}),[V,T,p,B,C,R]),se=G.useCallback(async(A,E)=>{ie(""),Mt(!1),Fe(!1),Z("submitting");try{if(!E?.skipApprovalCheck&&i){let he=await i(A);if(he){Ze(he),De(A),Z("idle");return}}Ze(null),De(null),Ge("processing");let z=await m.submitBridge(A);Se(z),Z("success"),ne(he=>[{id:z.txHash,timestamp:new Date().toISOString(),txHash:z.txHash,fromToken:z.fromToken,toToken:z.toToken,fromAmount:z.fromAmount,toAmount:z.toAmount,summary:P??void 0,status:"pending"},...he.filter(ze=>ze.txHash!==z.txHash)]),Xt(),Dt(!0),Ge(null),Mt(!0),Ae("bridge","confirmed"),Bt.current=!1,We.current=!1,h?.(z),d?.(z)}catch(z){if(Ge(null),Ae("bridge","confirmed",{status:"failure",reason:ir(z)}),Bt.current=!1,We.current=!1,Ss(z)){Z("idle");return}let he=Op(z,"Failed to submit bridge.");ie(he),Z("error"),y?.({message:he})}},[i,y,h,d,m,Xt,Ge,P]),Ve=G.useCallback(async()=>{if(_)return;let A=O();if(A){if(Bt.current||(Bt.current=!0,Ae("bridge","submitted")),!xe){De(A),Oe(!0);return}await se(A)}},[O,_,se,xe]),St=G.useCallback(async()=>{let A=Ue??O();A&&(kh(),Be(!0),Oe(!1),await se(A))},[O,Ue,se]),ut=G.useCallback(()=>{Oe(!1),De(null)},[]),Gt=G.useCallback(async()=>{if(!(ee==="submitting"||!ge||!Ue||!a)){ie(""),Z("submitting");try{await a(Ue,ge),We.current||(We.current=!0,Ae("bridge","approved")),Ze(null),Z("idle"),Fe(!0)}catch(A){if(Ss(A)){Z("idle");return}let E=Op(A,"Failed to approve token.");ie(E),Z("error"),y?.({message:E})}}},[ge,a,y,Ue,se,ee]),Ht=G.useCallback(()=>{ee!=="submitting"&&(Ze(null),Fe(!1),De(null),Z("idle"))},[ee]),Ar=G.useCallback(async()=>{if(ee==="submitting")return;let A=Ue??O();if(!A){Fe(!1),ie("Bridge input is no longer available. Please try again."),Z("error");return}Fe(!1),await se(A,{skipApprovalCheck:!0})},[O,Ue,se,ee]),rn=G.useCallback(()=>{Mt(!1)},[]),lr=G.useCallback(A=>{x(A),A==="history"&&Dt(!1)},[]),nn=G.useCallback(()=>{if(w==="history"){lr("form");return}f?.()},[f,lr,w]),gn=G.useMemo(()=>[...s,...ye.filter(A=>!s.some(E=>E.txHash===A.txHash))],[s,ye]);return{step:w,setStep:lr,status:ee,error:j,quoteError:_,fromToken:p,toToken:R,tokens:t,availableToTokens:st,fromAmount:T,toAmount:C,lastChangedBy:B,slippage:L,effectiveSlippage:V,slippageLocked:de,setSlippage:$,summary:P,history:gn,submitted:re,canSubmit:m.canSubmit,termsOpen:Ne,approvalInfo:ge,approvalSuccessOpen:dt,approveBridge:a,pendingSubmitInput:Ue,submitToast:ht,successDialogOpen:Qe,dismissSuccessDialog:rn,hasNewHistory:vt,termsUrl:c,setFromToken:k,setToToken:S,selectFromToken:jt,selectToToken:Wt,setAmount:tt,setMax:zt,swapTokens:_t,submit:Ve,confirmTerms:St,cancelTerms:ut,confirmApproval:Gt,cancelApproval:Ht,continueAfterApproval:Ar,back:nn}}pe(`.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:20px minmax(0,1fr);align-items:center;column-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}.bf-terms-check-button{appearance:none;display:inline-flex;min-width:0;width:20px;height:20px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-copy{display:flex;width:100%;min-width:0;align-items:baseline;justify-content:space-between;column-gap:12px;row-gap:4px;flex-wrap:wrap}.bf-terms-label{min-width:0}.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}
11
+ `);var g=require("react/jsx-runtime"),Qp=J.createContext(void 0);function Zn(){return J.useContext(Qp)}function Ch(e){let[t,r]=J.useState(void 0);return J.useEffect(()=>{let n=e.current;if(!n)return;let o=()=>{let a=n.closest("[data-theme]");r(a?.getAttribute("data-theme")??void 0)};o();let i=new MutationObserver(o);return i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>i.disconnect()},[e]),t}var jp=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],Nh=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function Th(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function Wp(e){let t=e.replace(/[^\d.]/g,""),[r="",...n]=t.split("."),o=n.join("");return n.length===0?r:`${r}.${o.slice(0,2)}`}function Ih(e){return`${e.chainId}:${e.address.toLowerCase()}`}function Vp(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function _p(e,t){let r=Number(e||"0"),n=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(r)?r*n:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function Mh(e,t=6){if(!e)return e;let[r,n=""]=e.split(".");if(!n)return r;let o=n.slice(0,t).replace(/0+$/,"");return o?`${r}.${o}`:r}function Eh(e,t){if(!t)return!1;let r=new Mr.default(e||"0"),n=new Mr.default(t.balance||"0");return!r.isFinite()||!n.isFinite()?!1:r.isGreaterThan(n)}function Ah(e){if(e.priceUsd===void 0)return null;let t=new Mr.default(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function Lh(e){if(e.priceUsd===void 0)return null;let t=new Mr.default(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function Yp(e){if(!e.isFinite()||e.isNaN())return"0";let r=e.decimalPlaces(6,Mr.default.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[n="0",o]=r.split("."),i=new Mr.default(n||"0").toFormat(0);return o?`${i}.${o}`:i}function Dh(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function Ph(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let r=n=>n.toString().padStart(2,"0");return[`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}`,`${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`].join(" ")}function Bh(e){let t=new Mr.default(e||"0");return!t.isFinite()||t.isNaN()?e||"0":Yp(t)}function zh(e,t){if(t?.priceUsd===void 0)return null;let r=new Mr.default(e||"0").multipliedBy(t.priceUsd);return!r.isFinite()||r.isNaN()?null:`$${r.toFormat(2)}`}function Hi(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function Oh(e,t){return t==="all"?!0:Hi(e)===t}function Fh(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function Gp(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function qp(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Kp(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":qp(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function Zp(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function Gi(e){return!e||e==="0"||Number(e)===0}function Uh(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 jh(e){let t=e.fromToken,r=e.toToken,n=Kp(t,r),o=e.fromAmount||"0",i=e.toAmount||"0",a=n!==void 0&&!Zp(n),s=n!==void 0&&n!=="bridge";return{pathType:n,bridgeInfo:a?[{label:"Route",value:t&&r?`${Gp(t.chainId)} \u2192 ${Gp(r.chainId)}`:"-"},{label:"Validator Fee",value:Gi(o)?"0":"Free",tone:Gi(o)?"default":"accent"},{label:"Network Fee",value:Gi(o)?"0":"Free",tone:Gi(o)?"default":"accent"}]:void 0,swapInfo:s?[t&&r?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:r.symbol,iconUrl:r.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:o,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:i,valueToken:r?{symbol:r.symbol,iconUrl:r.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 Lo({token:e,size:t=20}){let r=e?.iconUrl;return(0,g.jsx)("span",{className:"bf-token-icon","data-has-image":!!r?"true":"false",style:{width:t,height:t},children:r?(0,g.jsx)("img",{src:r,alt:"",width:t,height:t,draggable:!1}):(0,g.jsx)("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function Hp({label:e,token:t,amount:r,usd:n,onAmountChange:o,onTokenClick:i,locked:a=!1}){return(0,g.jsxs)("section",{className:"bf-amount-panel",children:[(0,g.jsxs)("div",{className:"bf-amount-head",children:[(0,g.jsx)("span",{children:e}),(0,g.jsxs)("span",{className:"bf-balance",children:[Vp(t?.balance??"0")," ",t?.symbol??""]})]}),(0,g.jsxs)("div",{className:"bf-amount-main",children:[(0,g.jsxs)("label",{className:"bf-amount-input-wrap",children:[(0,g.jsxs)("span",{className:"bf-sr-only",children:[e," amount"]}),(0,g.jsx)("input",{type:"text",inputMode:"decimal",value:r,onChange:s=>o(s.target.value),placeholder:"0",className:"bf-amount-input"}),(0,g.jsx)("span",{className:"bf-amount-usd",children:n})]}),(0,g.jsxs)("button",{type:"button",className:"bf-token-pill",onClick:a?void 0:i,disabled:!a&&!i,"data-locked":a?"true":void 0,"data-track":a?void 0:"token_select_open","data-track-id":e.toLowerCase(),"aria-label":`Select ${e.toLowerCase()} token`,children:[(0,g.jsx)(Lo,{token:t}),(0,g.jsx)("span",{children:t?.symbol??"Select"}),!a&&(0,g.jsx)(Rn,{size:16})]})]})]})}function Wh({flow:e,side:t,onClose:r}){let n=J.useId(),[o,i]=J.useState(""),[a,s]=J.useState(null),l=Zn(),c=t==="from"?e.fromToken:e.toToken;J.useEffect(()=>{s(document.body)},[]),J.useEffect(()=>{let d=y=>{y.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[r]);let u=J.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),b=J.useMemo(()=>{let d=o.trim().toLowerCase();return d?u.filter(y=>y.symbol.toLowerCase().includes(d)||y.name.toLowerCase().includes(d)):u},[o,u]),h=J.useCallback(d=>{t==="from"?e.selectFromToken(d):e.selectToToken(d),r()},[e,r,t]);return a?(0,Ln.createPortal)((0,g.jsx)("div",{className:"bf-token-picker-overlay","data-theme":l,role:"presentation",onMouseDown:d=>{d.target===d.currentTarget&&r()},children:(0,g.jsxs)("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,g.jsx)("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),(0,g.jsxs)("header",{className:"bf-token-picker-head",children:[(0,g.jsx)("h3",{id:n,children:"Select a token"}),(0,g.jsx)("button",{type:"button",className:"bf-token-picker-close",onClick:r,"aria-label":"Close token selector",children:(0,g.jsx)(mr,{size:24})})]}),(0,g.jsxs)("label",{className:"bf-token-search",children:[(0,g.jsx)(Cp,{size:20}),(0,g.jsx)("span",{className:"bf-sr-only",children:"Search tokens"}),(0,g.jsx)("input",{value:o,onChange:d=>i(d.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),(0,g.jsxs)("div",{className:"bf-token-list",children:[b.map(d=>{let y=qp(d,c),f=y?Lh(d):Ah(d);return(0,g.jsxs)("button",{type:"button",className:"bf-token-row","data-selected":y?"true":"false",onClick:()=>h(d),children:[(0,g.jsxs)("span",{className:"bf-token-row-left",children:[(0,g.jsx)(Lo,{token:d,size:40}),(0,g.jsxs)("span",{className:"bf-token-meta",children:[(0,g.jsx)("span",{className:"bf-token-symbol",children:d.symbol}),!y&&(0,g.jsx)("span",{className:"bf-token-name",children:d.name})]})]}),(0,g.jsxs)("span",{className:"bf-token-row-right",children:[(0,g.jsxs)("span",{className:"bf-token-balance",children:[Vp(d.balance),y?null:` ${d.symbol}`]}),f&&(0,g.jsx)("span",{className:"bf-token-price",children:f})]})]},Ih(d))}),b.length===0&&(0,g.jsx)("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),a):null}function _h({flow:e,onClose:t}){let r=J.useId(),[n,o]=J.useState(null),i=jp.find(f=>f.value===e.slippage),[a,s]=J.useState(e.slippage&&!i?e.slippage:""),l=a.trim()!==""&&a.trim()!==".",c=l?Number(a):NaN,u=Number.isFinite(c)&&c>50,b=Number.isFinite(c)&&c>5&&!u,h=f=>{e.setSlippage(f),t()},d=()=>{!l||u||(e.setSlippage(Wp(a)),t())};if(J.useEffect(()=>{o(document.body)},[]),J.useEffect(()=>{let f=m=>{m.key==="Escape"&&t()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[t]),!n)return null;let y=Zn();return(0,Ln.createPortal)((0,g.jsx)("div",{className:"bf-slippage-overlay","data-theme":y,role:"presentation",onMouseDown:f=>{f.target===f.currentTarget&&t()},children:(0,g.jsxs)("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,children:[(0,g.jsxs)("header",{className:"bf-slippage-head",children:[(0,g.jsx)("h3",{id:r,children:"Slippage Settings"}),(0,g.jsx)("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:(0,g.jsx)(mr,{size:24})})]}),(0,g.jsxs)("div",{className:"bf-slippage-body",children:[(0,g.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,g.jsxs)("div",{className:"bf-slippage-controls",children:[(0,g.jsx)("div",{className:"bf-slippage-presets",children:jp.map(f=>(0,g.jsx)("button",{type:"button",className:"bf-slippage-preset","data-selected":!l&&e.slippage===f.value?"true":"false",onClick:()=>h(f.value),children:f.label},f.value))}),(0,g.jsxs)("label",{className:"bf-slippage-custom","data-selected":l?"true":"false",children:[(0,g.jsx)("span",{className:"bf-sr-only",children:"Custom slippage percent"}),(0,g.jsx)("input",{value:a,onChange:f=>{s(Wp(f.target.value))},onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),d())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),(0,g.jsx)("span",{"aria-hidden":"true",children:"%"})]})]}),u?(0,g.jsx)("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):b?(0,g.jsx)("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,l&&(0,g.jsx)("button",{type:"button",className:"bf-slippage-apply",onClick:d,disabled:u,children:"Apply"})]})]})}),n)}function Gh({flow:e}){let t=J.useId(),[r,n]=J.useState(!1),[o,i]=J.useState(null),a=Zn();return J.useEffect(()=>{i(document.body)},[]),J.useEffect(()=>{let s=l=>{l.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),!o||!e.termsOpen?null:(0,Ln.createPortal)((0,g.jsx)("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",onPointerDown:s=>{s.target===s.currentTarget&&e.cancelTerms()},children:(0,g.jsxs)("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,g.jsx)("h3",{id:t,children:"Agree to Terms of Service"}),(0,g.jsx)("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),(0,g.jsxs)("div",{className:"bf-terms-check-row","data-checked":r?"true":"false",children:[(0,g.jsx)("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":r,"aria-label":"Agree to Terms of Use","data-track":"terms_check",onClick:()=>n(s=>!s),children:(0,g.jsx)("span",{className:"bf-terms-checkbox","data-checked":r?"true":"false","aria-hidden":"true"})}),(0,g.jsxs)("div",{className:"bf-terms-copy",children:[(0,g.jsx)("span",{className:"bf-terms-label",children:"Agree to Terms of Use"}),e.termsUrl&&(0,g.jsx)("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]})]}),(0,g.jsx)("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),(0,g.jsx)("button",{type:"button",className:"bf-action-primary",disabled:!r||e.status==="submitting",onClick:e.confirmTerms,"data-track":"terms_confirm",children:"Confirm"})]})}),o)}function Hh({value:e,disabled:t=!1}){let[r,n]=J.useState(!1);return(0,g.jsx)("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)})},children:r?"OK":"Copy"})}function Qh({flow:e,approval:t}){let r=J.useId(),[n,o]=J.useState(null),i=Zn();if(J.useEffect(()=>{o(document.body)},[]),J.useEffect(()=>{let l=c=>{e.status!=="submitting"&&c.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!n)return null;let a=e.status==="submitting"||!e.approveBridge,s=e.status==="submitting";return(0,Ln.createPortal)((0,g.jsx)("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",children:(0,g.jsxs)("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":r,children:[(0,g.jsxs)("h3",{id:r,children:["Approve ",t.token.symbol]}),(0,g.jsx)(Lo,{token:t.token,size:72}),(0,g.jsxs)("div",{className:"bf-approve-address-box",children:[(0,g.jsx)("span",{children:"Token Address"}),(0,g.jsxs)("div",{children:[(0,g.jsx)("strong",{children:t.tokenAddress}),(0,g.jsx)(Hh,{value:t.tokenAddress,disabled:s})]})]}),(0,g.jsxs)("div",{className:"bf-action-buttons",children:[(0,g.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),(0,g.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:a,"aria-busy":s,"data-track":"approve_confirm",children:[s&&(0,g.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,g.jsx)("span",{children:s?"Approving...":"Approve"})]})]})]})}),n)}function Vh({flow:e}){let t=J.useId(),[r,n]=J.useState(null),o=Zn();if(J.useEffect(()=>{n(document.body)},[]),J.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=s=>{s.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!r||!e.approvalSuccessOpen)return null;let i=e.status==="submitting";return(0,Ln.createPortal)((0,g.jsx)("div",{className:"bf-action-modal-overlay","data-theme":o,role:"presentation",children:(0,g.jsxs)("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,g.jsx)("h3",{id:t,children:"Approval Success"}),(0,g.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,g.jsxs)("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",(0,g.jsx)("br",{}),"Please continue to the next step."]}),(0,g.jsxs)("div",{className:"bf-action-buttons",children:[(0,g.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:i,children:"Cancel"}),(0,g.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,disabled:i,"aria-busy":i,children:[i&&(0,g.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,g.jsx)("span",{children:i?"Continuing...":"Continue"})]})]})]})}),r)}function Yh({fromAmount:e,toAmount:t,fromToken:r,toToken:n}){let[o,i]=J.useState(!1),a=J.useMemo(()=>{let c=new Mr.default(e||"0"),u=new Mr.default(t||"0");return!c.isFinite()||!u.isFinite()||c.lte(0)||u.lte(0)?null:o?c.dividedBy(u):u.dividedBy(c)},[e,o,t]);if(!a||!r||!n||r.symbol===n.symbol)return null;let s=o?n.symbol:r.symbol,l=o?r.symbol:n.symbol;return(0,g.jsxs)("button",{type:"button",className:"bf-exchange-rate",onClick:()=>i(c=>!c),"data-track":"rate_reverse",children:[(0,g.jsxs)("span",{children:["1 ",s]}),(0,g.jsx)(Ep,{size:12}),(0,g.jsxs)("span",{children:[Yp(a)," ",l]})]})}function qh({flow:e}){return e.submitToast?(0,g.jsxs)("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[(0,g.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,g.jsx)("span",{className:"bf-status-spinner"})}),(0,g.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,g.jsx)("strong",{children:"Transaction Processing"}),(0,g.jsx)("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function Kh({message:e}){let[t,r]=J.useState(!1);return J.useEffect(()=>{if(!e){r(!1);return}r(!0);let n=window.setTimeout(()=>{r(!1)},3500);return()=>window.clearTimeout(n)},[e]),!e||!t?null:(0,g.jsxs)("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[(0,g.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,g.jsx)("span",{className:"bf-status-error-mark",children:"!"})}),(0,g.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,g.jsx)("strong",{children:"Error"}),(0,g.jsx)("span",{children:e})]})]})}function Zh(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 Xh({flow:e}){let t=J.useId(),[r,n]=J.useState(null),o=e.submitted,i=Zn();return J.useEffect(()=>{n(document.body)},[]),J.useEffect(()=>{if(!e.successDialogOpen)return;let a=s=>{s.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!r||!e.successDialogOpen||!o?null:(0,Ln.createPortal)((0,g.jsx)("div",{className:"bf-success-overlay","data-theme":i,role:"presentation",children:(0,g.jsx)("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:(0,g.jsxs)("div",{className:"bf-success-body",children:[(0,g.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,g.jsxs)("div",{className:"bf-success-copy",children:[(0,g.jsx)("strong",{id:t,children:Zh(o.pathType)}),(0,g.jsx)("span",{children:"Please check the results in the history."})]}),(0,g.jsx)("div",{className:"bf-success-route","aria-hidden":"true",children:(o.routeTokens&&o.routeTokens.length>0?o.routeTokens:[{symbol:o.fromToken.symbol,iconUrl:o.fromToken.iconUrl},{symbol:o.toToken.symbol,iconUrl:o.toToken.iconUrl}]).map((a,s)=>(0,g.jsxs)(J.Fragment,{children:[s>0&&(0,g.jsx)("span",{className:"bf-success-route-arrow",children:"\u2192"}),(0,g.jsx)(Cs,{token:a,size:43})]},`${a.symbol}-${s}`))}),(0,g.jsx)("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,"data-track":"success_ok",children:"OK"})]})})}),r)}function Cs({token:e,size:t=16}){let r=!!e.iconUrl;return(0,g.jsx)("span",{className:"bf-token-icon","data-has-image":r?"true":"false",style:{width:t,height:t},children:e.iconUrl?(0,g.jsx)("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):(0,g.jsx)("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function Jh({row:e}){return e.routeTokens&&e.routeTokens.length>0?(0,g.jsx)("span",{className:"bf-info-route",children:e.routeTokens.map((t,r)=>(0,g.jsxs)(J.Fragment,{children:[r>0&&(0,g.jsx)("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),(0,g.jsx)(Cs,{token:t})]},`${t.symbol}-${r}`))}):e.valueToken?(0,g.jsxs)("span",{className:"bf-info-value-token",children:[(0,g.jsx)(Cs,{token:e.valueToken}),(0,g.jsx)("span",{children:e.value})]}):(0,g.jsx)(g.Fragment,{children:e.value})}function Xp({rows:e}){return!e||e.length===0?null:(0,g.jsx)("div",{className:"bf-info-rows",children:e.map((t,r)=>(0,g.jsxs)("div",{className:"bf-info-row",children:[(0,g.jsxs)("span",{className:"bf-info-label",children:[(0,g.jsx)("span",{className:"bf-tree-marker",children:r===e.length-1?"\u2514":"\u251C"}),(0,g.jsx)("span",{children:t.label})]}),(0,g.jsx)("span",{className:"bf-info-value","data-tone":t.tone??"default",children:(0,g.jsx)(Jh,{row:t})})]},`${t.label}-${t.value}`))})}function $h(e,t,r){return e.pathType==="bridge"?"Bridge Info":Zp(e.pathType)?"Swap Info":t&&r?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function e0({summary:e}){let t=!!e.bridgeInfo?.length,r=!!e.swapInfo?.length,n=t&&r,o=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return(0,g.jsx)(g.Fragment,{children:o.map(i=>{let a=i==="swap"?e.swapInfo:e.bridgeInfo;return a?.length?(0,g.jsxs)("div",{className:"bf-info-section",children:[n&&(0,g.jsx)("h4",{children:i==="swap"?"Swap Info":"Bridge Info"}),(0,g.jsx)(Xp,{rows:a})]},i):null})})}function t0({summary:e}){let t=!!e.bridgeInfo?.length,r=!!e.swapInfo?.length,n=!!e.txFee?.length,o=$h(e,t,r),[i,a]=J.useState(!0),[s,l]=J.useState(!0);return(0,g.jsxs)("div",{className:"bf-details",children:[e.liquidity&&(0,g.jsxs)("section",{className:"bf-liquidity",children:[(0,g.jsxs)("div",{className:"bf-liquidity-head",children:[(0,g.jsx)("span",{children:e.liquidity.label??"Available Liquidity"}),(0,g.jsx)("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),(0,g.jsx)("div",{className:"bf-liquidity-track",children:(0,g.jsx)("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||r)&&(0,g.jsxs)("section",{className:"bf-detail-section bf-info-card","data-open":i?"true":"false",children:[(0,g.jsxs)("button",{type:"button",className:"bf-collapse-head","aria-expanded":i,onClick:()=>a(c=>!c),"data-track":"details_toggle",children:[(0,g.jsx)("h3",{children:o}),(0,g.jsx)(Rn,{size:16,className:"bf-collapse-chevron"})]}),i&&(0,g.jsx)("div",{className:"bf-collapse-body",children:(0,g.jsx)(e0,{summary:e})})]}),n&&(0,g.jsxs)("section",{className:"bf-detail-section bf-tx-fee-section","data-open":s?"true":"false",children:[(0,g.jsxs)("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":s,onClick:()=>l(c=>!c),"data-track":"details_toggle",children:[(0,g.jsx)("h3",{children:"Est. Tx Fee"}),(0,g.jsxs)("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&(0,g.jsx)("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&(0,g.jsx)("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),(0,g.jsx)("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:Mh(e.txFeeInfo?.estTxFee??"0")}),(0,g.jsx)(Rn,{size:16,className:"bf-collapse-chevron"})]})]}),s&&(0,g.jsx)("div",{className:"bf-collapse-body",children:(0,g.jsx)(Xp,{rows:e.txFee})})]})]})}function r0({item:e}){let t=Hi(e),r=zh(e.fromAmount,e.fromToken);return(0,g.jsxs)("article",{className:"bf-history-item",children:[(0,g.jsxs)("div",{className:"bf-history-item-head",children:[(0,g.jsx)("span",{className:"bf-history-status","data-status":t,children:Fh(t)}),(0,g.jsx)("time",{className:"bf-history-time",dateTime:e.timestamp,children:Ph(e.timestamp)})]}),(0,g.jsxs)("div",{className:"bf-history-item-body",children:[(0,g.jsxs)("strong",{className:"bf-history-amount",children:[Bh(e.fromAmount)," ",e.fromToken.symbol]}),(0,g.jsxs)("div",{className:"bf-history-meta",children:[(0,g.jsx)("span",{className:"bf-history-usd",children:r??Dh(e.txHash)}),(0,g.jsxs)("span",{className:"bf-history-route",children:[(0,g.jsxs)("span",{className:"bf-history-route-token",children:[(0,g.jsx)(Lo,{token:e.fromToken,size:16}),(0,g.jsx)("span",{children:e.fromToken.symbol})]}),(0,g.jsx)(Mp,{size:16,className:"bf-history-route-arrow"}),(0,g.jsxs)("span",{className:"bf-history-route-token",children:[(0,g.jsx)(Lo,{token:e.toToken,size:16}),(0,g.jsx)("span",{children:e.toToken.symbol})]})]})]})]})]})}function n0({flow:e}){let[t,r]=J.useState("all"),n=e.history.some(a=>Hi(a)==="pending"),o=e.history.filter(a=>Oh(a,t)),i=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return(0,g.jsxs)("main",{className:"bf-history-body",children:[(0,g.jsx)("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:Nh.map(a=>(0,g.jsxs)("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>r(a.value),"data-track":"history_filter","data-track-id":a.value,children:[(0,g.jsx)("span",{children:a.label}),a.value==="pending"&&n&&(0,g.jsx)("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),o.length>0?(0,g.jsx)("div",{className:"bf-history-list",children:o.map(a=>(0,g.jsx)(r0,{item:a},a.id||a.txHash))}):(0,g.jsx)("div",{className:"bf-empty",children:i})]})}function o0({flow:e,env:t}){let[r,n]=J.useState(null),[o,i]=J.useState(!1),[a,s]=J.useState(0),c=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??jh(e):null,u=Sr("apps.json",t,p=>cr(p?.bridgePoweredBy?.url,t)),b=Uh(e.quoteError),h=Eh(e.fromAmount,e.fromToken),d=h?"Insufficient balance":b.from,y=e.quoteError&&!b.from&&!b.to?e.quoteError:"",f=e.error||y,m=e.history.some(p=>Hi(p)==="pending"),x=(c?.pathType??Kp(e.fromToken,e.toToken))!=="bridge";return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("main",{className:"bf-body",children:[(0,g.jsxs)("div",{className:"bf-toolbar",children:[(0,g.jsxs)("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),"data-track":"history_open",children:[(0,g.jsx)(Np,{}),(0,g.jsx)("span",{children:"History"}),(m||e.hasNewHistory)&&(0,g.jsx)("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),x&&(0,g.jsxs)("button",{type:"button",className:"bf-chip",onClick:()=>i(!0),"data-track":"slippage_open",disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":o,children:[(0,g.jsx)(Tp,{}),(0,g.jsx)("span",{children:e.slippageLocked?"Auto 1%":Th(e.slippage,e.effectiveSlippage)})]})]}),(0,g.jsxs)("div",{className:"bf-swap-card","data-has-from-error":d?"true":"false",children:[(0,g.jsx)(Hp,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:_p(e.fromAmount,e.fromToken),onAmountChange:p=>e.setAmount(p,"from"),onTokenClick:()=>n("from")}),d&&(0,g.jsx)("div",{className:"bf-field-error",children:d}),(0,g.jsx)("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),s(p=>p+360)},"data-track":"token_swap",style:{transform:`translateX(-50%) rotate(${a}deg)`,transition:"transform 0.2s ease"},children:(0,g.jsx)(Ip,{size:22})}),(0,g.jsx)(Hp,{label:"To",token:e.toToken,amount:e.toAmount,usd:_p(e.toAmount,e.toToken),onAmountChange:p=>e.setAmount(p,"to"),onTokenClick:()=>n("to"),locked:e.availableToTokens.length<=1}),b.to&&(0,g.jsx)("div",{className:"bf-field-error",children:b.to})]}),(0,g.jsx)(Yh,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),c&&(0,g.jsx)(t0,{summary:c})]}),(0,g.jsxs)("footer",{className:"bf-footer",children:[(0,g.jsx)("button",{type:"button",className:"bf-next",onClick:e.submit,"data-track":"next",disabled:e.status==="submitting"||!!e.quoteError||h,children:e.status==="submitting"?"Processing...":"Next"}),u&&(0,g.jsxs)("a",{className:"bf-powered",href:u,target:"_blank",rel:"noreferrer",children:["Powered by ",(0,g.jsx)("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),r&&(0,g.jsx)(Wh,{flow:e,side:r,onClose:()=>n(null)}),o&&(0,g.jsx)(_h,{flow:e,onClose:()=>i(!1)}),(0,g.jsx)(Gh,{flow:e}),e.approvalInfo&&(0,g.jsx)(Qh,{flow:e,approval:e.approvalInfo}),(0,g.jsx)(Vh,{flow:e}),(0,g.jsx)(qh,{flow:e}),(0,g.jsx)(Kh,{message:e.submitToast?"":f}),(0,g.jsx)(Xh,{flow:e})]})}function Do({onClose:e,onBackToWallet:t,env:r,className:n,...o}){let i=J.useMemo(()=>Xe(r),[r]),a=Up({...o,onExit:t}),s=J.useRef(null),l=Ch(s),c=a.step==="history"?"History":"Swap & Bridge";return(0,g.jsx)(ve,{feature:"bridge",children:(0,g.jsx)(Qp.Provider,{value:l,children:(0,g.jsxs)("div",{ref:s,className:Ie("bf-root",n),"data-view":a.step,"data-status":a.status,children:[(0,g.jsxs)("header",{className:"bf-header",children:[(0,g.jsx)("button",{type:"button",className:"bf-header-btn",onClick:a.back,"aria-label":"Back",children:(0,g.jsx)(Qr,{size:24})}),(0,g.jsx)("span",{className:"bf-header-title",children:c}),(0,g.jsx)("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:(0,g.jsx)(mr,{size:24})})]}),a.step==="history"?(0,g.jsx)(n0,{flow:a}):(0,g.jsx)(o0,{flow:a,env:i})]})})})}var qt=Q(require("react"),1),Is=Q(require("bignumber.js"),1);var Jp=require("@tanstack/react-query");var i0="token-history";function $p(e,t,r,n,o=!0){return(0,Jp.useInfiniteQuery)({queryKey:[i0,e,t,r.toLowerCase(),n.toLowerCase()],initialPageParam:void 0,queryFn:async({pageParam:i,signal:a})=>{let s=await Te("walletServer",e),l=new URLSearchParams({chain_id:String(t),token:r,wallet:n}),c=i;c&&(l.set("last_timestamp",String(c.last_timestamp)),l.set("last_log_index",String(c.last_log_index)),l.set("last_tx_index",String(c.last_tx_index)));let u=await fetch(`${s}/v1/public/token/historical?${l}`,{cache:"no-store",signal:a});if(!u.ok)throw new Error(`Failed to fetch token history: ${u.status}`);let b=await u.json();if(b.code!==200)throw new Error(`Token history API error: ${b.code}`);return b.data??[]},getNextPageParam:i=>{if(!i||i.length===0)return;let a=i[i.length-1];return{last_timestamp:a.timestamp,last_log_index:a.log_index,last_tx_index:a.tx_index}},enabled:o&&!!n&&!!r&&t>0,staleTime:1e4})}var Qi=Q(require("react"),1);var Ns={chart:!1,balance:!0,overview:!1,social:!1,history:!0},a0=Object.keys(Ns),s0="apps.json";function eu(e){let[t,r]=Qi.useState({visibility:Ns,isLoaded:!1});return Qi.useEffect(()=>{let n=!0;return bn(s0,e).then(o=>{if(!n)return;let i=o?.tokenDetail?.sections,a={...Ns};if(i)for(let s of a0){let l=i[s];typeof l=="boolean"&&(a[s]=l)}r({visibility:a,isLoaded:!0})}),()=>{n=!1}},[e]),t}var tr=Q(require("react"),1);var Vi=require("@tanstack/react-query");var l0="token-price-history";function tu(e,t,r,n,o=!0){return(0,Vi.useQuery)({queryKey:[l0,e,t,r.toLowerCase(),n],queryFn:async({signal:i})=>{let a=await Te("walletServer",e),s=new URLSearchParams({chain_id:String(t),token:r,interval:n}),l=await fetch(`${a}/v1/public/token/price/historical?${s}`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token price history: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Token price history API error: ${c.code}`);return c.data??[]},enabled:o&&!!r&&t>0,staleTime:3e4,placeholderData:Vi.keepPreviousData})}var Ke=require("react/jsx-runtime"),c0="var(--ds-system-green-high, #00a869)",d0="var(--wi-error, #e70077)",Dn=150,Yi=3,Ts=18,p0=18,u0=[{key:"10m",label:"10m"},{key:"1h",label:"1H"},{key:"1d",label:"1D"},{key:"7d",label:"1W"},{key:"30d",label:"1M"},{key:"1y",label:"1Y"}],f0=new Set(["7d","30d","1y"]);function m0(){let e=tr.useRef(null),[t,r]=tr.useState(0);return tr.useEffect(()=>{let n=e.current;if(!n)return;let o=new ResizeObserver(i=>{r(i[0]?.contentRect.width??0)});return o.observe(n),r(n.clientWidth),()=>o.disconnect()},[]),[e,t]}function g0(e,t){let r=new Date(e*1e3),n=t?{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}:{hour:"numeric",minute:"2-digit"};return new Intl.DateTimeFormat("en-US",n).format(r)}function h0(e,t){if(t<=0||e.length===0)return null;let r=e.length===1?[e[0],e[0]]:e,n=r.length,o=r[0],i=r[0],a=0,s=0;for(let x=1;x<n;x++)r[x]>o&&(o=r[x],a=x),r[x]<i&&(i=r[x],s=x);let l=o-i||1,c=Math.max(1,t-Yi*2),u=Dn-Ts-p0,b=x=>n===1?t/2:Yi+x/(n-1)*c,h=x=>Ts+(1-(x-i)/l)*u,d=r.map((x,p)=>({x:b(p),y:h(x)})),y=d.map((x,p)=>`${p===0?"M":"L"}${x.x.toFixed(2)},${x.y.toFixed(2)}`).join(" "),f=d[0],m=d[d.length-1],w=`${y} L${m.x.toFixed(2)},${Dn} L${f.x.toFixed(2)},${Dn} Z`;return{values:r,points:d,linePath:y,areaPath:w,maxIdx:a,minIdx:s}}function ru({env:e,chainId:t,tokenAddress:r}){let[n,o]=tr.useState("1d"),[i,a]=tr.useState(null),s=tr.useId(),[l,c]=m0(),{data:u,isLoading:b,isError:h}=tu(e,t,r,n,!0),d=tr.useMemo(()=>(u??[]).filter(F=>Number.isFinite(Number(F.price))).slice().sort((F,de)=>F.updated_at-de.updated_at),[u]),y=tr.useMemo(()=>d.map(P=>Number(P.price)),[d]),f=tr.useMemo(()=>h0(y,c),[y,c]);tr.useEffect(()=>{a(null)},[n]);let m=d.length>0,w=i!==null&&i<y.length?i:y.length-1,x=m?y[w]:0,p=m?y[0]:0,k=p!==0?(x-p)/p*100:0,R=k>=0,S=R?c0:d0,T=(R?"+":"-")+(Math.floor(Math.abs(k)*100)/100).toFixed(2)+"%",N=i!==null&&d[i]?g0(d[i].updated_at,f0.has(n)):"",C=P=>{if(!f||c<=0)return;let F=P.currentTarget.getBoundingClientRect(),de=P.clientX-F.left;if(f.values.length<=1){a(0);return}let _=Math.max(1,c-Yi*2),we=Math.min(1,Math.max(0,(de-Yi)/_)),ee=Math.round(we*(d.length-1));a(Math.min(d.length-1,Math.max(0,ee)))},M=()=>a(null);if(!b&&(h||!m))return null;let B=i!==null&&f&&f.points[i]?f.points[i]:null,W=f?.points[f.maxIdx],L=f?.points[f.minIdx],$=P=>Math.min(Math.max(P,24),Math.max(24,c-24));return(0,Ke.jsxs)("section",{className:"wi-td-chart",children:[(0,Ke.jsxs)("div",{className:"wi-td-chart-panel",children:[(0,Ke.jsx)("span",{className:"wi-td-chart-price",children:m?Sn(x):"\u2014"}),m&&(0,Ke.jsxs)("span",{className:"wi-td-chart-change","data-positive":R,children:[(0,Ke.jsx)("span",{children:T}),N&&(0,Ke.jsx)("span",{className:"wi-td-chart-when",children:N})]})]}),(0,Ke.jsx)("div",{ref:l,className:"wi-td-chart-plot",children:b&&!m?(0,Ke.jsx)("div",{className:"wi-skeleton-block wi-td-chart-skeleton"}):f&&c>0&&(0,Ke.jsxs)("svg",{className:"wi-td-chart-svg",width:c,height:Dn,role:"img","aria-label":"Price chart",children:[(0,Ke.jsx)("defs",{children:(0,Ke.jsxs)("linearGradient",{id:s,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,Ke.jsx)("stop",{offset:"0%",stopColor:S,stopOpacity:.28}),(0,Ke.jsx)("stop",{offset:"100%",stopColor:S,stopOpacity:0})]})}),(0,Ke.jsx)("path",{d:f.areaPath,fill:`url(#${s})`}),(0,Ke.jsx)("path",{d:f.linePath,fill:"none",stroke:S,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),W&&(0,Ke.jsx)("text",{className:"wi-td-chart-minmax",x:$(W.x),y:Math.max(11,W.y-7),textAnchor:"middle",children:Sn(f.values[f.maxIdx])}),L&&f.minIdx!==f.maxIdx&&(0,Ke.jsx)("text",{className:"wi-td-chart-minmax",x:$(L.x),y:Math.min(Dn-5,L.y+14),textAnchor:"middle",children:Sn(f.values[f.minIdx])}),B&&(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)("line",{className:"wi-td-chart-cursor",x1:B.x,y1:Ts-6,x2:B.x,y2:Dn}),(0,Ke.jsx)("circle",{cx:B.x,cy:B.y,r:4,fill:S,stroke:"var(--wi-surface-bg, #121212)",strokeWidth:2})]}),(0,Ke.jsx)("rect",{x:0,y:0,width:c,height:Dn,fill:"transparent",style:{touchAction:"none"},onPointerMove:C,onPointerDown:C,onPointerLeave:M,onPointerCancel:M})]})}),(0,Ke.jsx)("div",{className:"wi-td-chart-tabs",role:"tablist",children:u0.map(P=>(0,Ke.jsx)("button",{type:"button",role:"tab","aria-selected":n===P.key,className:"wi-td-chart-tab","data-active":n===P.key||void 0,onClick:()=>o(P.key),"data-track":"token_detail_interval","data-track-id":P.key,children:P.label},P.key))})]})}var D=require("react/jsx-runtime"),b0="https://contents.crosstoken.io/wallet/token/images/FT.png",w0={receive:"Receive",send:"Send","bridge-in":"Bridge In","bridge-out":"Bridge Out"};function y0(e){return e.length>24?"xs":e.length>18?"sm":"md"}function x0(e){if(!e)return"";let t=e<1e12?e*1e3:e,r=Math.max(0,Math.floor((Date.now()-t)/1e3));if(r<60)return"just now";let n=Math.floor(r/60);if(n<60)return`${n}m`;let o=Math.floor(n/60);if(o<24)return`about ${o}h`;let i=Math.floor(o/24);if(i<30)return`${i}d`;let a=Math.floor(i/30);return a<12?`${a}mo`:`${Math.floor(a/12)}y`}function nu(e){let[t,r]=e.split("."),n="";for(let o=0;o<t.length;o++){let i=t.length-o;o>0&&i%3===0&&(n+=","),n+=t[o]}return r?`${n}.${r}`:n}function ou(e,t){let r=BigInt(e||"0");if(t<=2){let a=10n**BigInt(t),s=r/a,l=r%a*10n**BigInt(2-t);return`${s.toString()}.${l.toString().padStart(2,"0")}`}let n=r/10n**BigInt(t-2),o=n/100n,i=n%100n;return`${o.toString()}.${i.toString().padStart(2,"0")}`}function v0(e,t,r){let n=qt.useRef(null),o=qt.useRef(null),[i,a]=qt.useState(t);return qt.useLayoutEffect(()=>{let s=n.current,l=o.current;if(!s||!l)return;let c=()=>{let b=s.clientWidth;if(!b)return;let h=window.getComputedStyle(l),d=document.createElement("span");d.textContent=l.textContent,d.style.cssText=["position:absolute","left:-9999px","top:-9999px","visibility:hidden","white-space:nowrap",`font-family:${h.fontFamily}`,`font-weight:${h.fontWeight}`,`letter-spacing:${h.letterSpacing}`,`font-size:${t}px`].join(";"),document.body.appendChild(d);let y=d.offsetWidth;if(document.body.removeChild(d),y<=b){a(t);return}let f=Math.max(r,Math.floor(t*b/y));a(f)};c();let u=new ResizeObserver(c);return u.observe(s),()=>u.disconnect()},[e,t,r]),{containerRef:n,textRef:o,fontSize:i}}function k0(e){if(!e)return"-";let t=new Is.default(e);return t.isNaN()?"-":t.decimalPlaces(4,Is.default.ROUND_DOWN).toFormat()}function R0(){return(0,D.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,D.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.6"}),(0,D.jsx)("path",{d:"M3 12h18M12 3c2.5 2.5 3.8 5.8 3.8 9s-1.3 6.5-3.8 9c-2.5-2.5-3.8-5.8-3.8-9S9.5 5.5 12 3Z",stroke:"currentColor",strokeWidth:"1.6"})]})}function S0(){return(0,D.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,D.jsx)("path",{d:"M21.9 4.3 18.6 20c-.2 1-.9 1.3-1.8.8l-4.9-3.6-2.4 2.3c-.3.3-.5.5-1 .5l.3-4.9 9-8.1c.4-.3-.1-.5-.6-.2L6.2 13.2l-4.8-1.5c-1-.3-1-1 .2-1.5L20.6 3c.9-.3 1.6.2 1.3 1.3Z"})})}function C0(){return(0,D.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,D.jsx)("path",{d:"M18.9 2H22l-7.3 8.3L23.3 22h-6.8l-5.3-6.9L5.1 22H2l7.8-8.9L1 2h6.9l4.8 6.4L18.9 2Zm-1.2 18h1.9L7.2 4H5.2l12.5 16Z"})})}function N0(){return(0,D.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,D.jsx)("path",{d:"M6.9 6.5c0-.2-.1-.5-.3-.6L4.6 3.6V3.3h6.3l4.9 10.7 4.3-10.7H26v.3l-1.8 1.7c-.2.1-.2.3-.2.5v12.4c0 .2 0 .4.2.5l1.7 1.7v.3h-8.7v-.3l1.8-1.7c.2-.2.2-.2.2-.5V8.1l-5 12.6h-.7L7.9 8.1v8.5c0 .3.1.6.3.8l2.3 2.8v.3H4v-.3l2.3-2.8c.2-.2.3-.5.3-.8V6.5Z",transform:"scale(0.85)"})})}function iu({env:e,isMobile:t,token:r,walletAddress:n,stat:o,tokenInfo:i,showBalance:a=!0,onBack:s,onClose:l,onSend:c,onOutlink:u}){let b=r.quantity.decimals,[h,d]=qt.useState(!1),{buildTxUrl:y,chainInfo:f}=sc(e,r.chainId,!0),{visibility:m}=eu(e),{data:w,isLoading:x,isError:p,fetchNextPage:k,hasNextPage:R,isFetchingNextPage:S,refetch:T}=$p(e,r.chainId,r.address,n,!0),N=qt.useMemo(()=>w?.pages?w.pages.flat():[],[w]),C=qt.useRef(null);qt.useEffect(()=>{if(!t)return;let j=C.current;if(!j||!R)return;let ie=new IntersectionObserver(re=>{re[0]?.isIntersecting&&!S&&k()},{rootMargin:"120px"});return ie.observe(j),()=>ie.disconnect()},[t,R,S,k]);let M=qt.useCallback(()=>{navigator?.clipboard&&navigator.clipboard.writeText(r.address).then(()=>{d(!0),setTimeout(()=>d(!1),1500)}).catch(()=>{})},[r.address]),B=nu(ou(r.quantity.numeric,b)),W=o?.price?fi(r.quantity.numeric,b,o.price):null,L=a?B:"\u2022\u2022\u2022\u2022",{containerRef:$,textRef:P,fontSize:F}=v0(L,30,14),V=Un(r.chainId,e).name??f?.name??`Chain ${r.chainId}`,_=f?.explorer_url,we=i?.deployed??!0,ee=qt.useMemo(()=>{let j=[];return i?.info_url&&j.push({key:"web",label:"Website",url:i.info_url,icon:(0,D.jsx)(R0,{})}),i?.telegram_url&&j.push({key:"tg",label:"Telegram",url:i.telegram_url,icon:(0,D.jsx)(S0,{})}),i?.x_url&&j.push({key:"x",label:"X",url:i.x_url,icon:(0,D.jsx)(C0,{})}),i?.medium_url&&j.push({key:"medium",label:"Medium",url:i.medium_url,icon:(0,D.jsx)(N0,{})}),j},[i]),Z=(j,ie,re,Se)=>{Tt(j,ie,{category:"token-detail",origin:re,payload:{address:r.address,txHash:Se}},u)};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("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:s,"aria-label":"Back",children:(0,D.jsx)(Qr,{size:24})}),(0,D.jsxs)("span",{className:"wi-td-header-title",children:[(0,D.jsx)("img",{src:r.icon_url,alt:"","aria-hidden":!0,className:"wi-td-header-icon",width:24,height:24,draggable:!1,onError:j=>{j.currentTarget.src=b0}}),(0,D.jsx)("span",{className:"wi-td-header-name",children:r.symbol})]}),(0,D.jsx)("button",{type:"button",className:"wi-header-action",onClick:l,"aria-label":"Close",children:(0,D.jsx)(mr,{size:24})})]}),(0,D.jsx)("hr",{className:"wi-divider"})]}),(0,D.jsxs)("div",{className:"wi-td-scroll",children:[m.chart&&(0,D.jsx)(ru,{env:e,chainId:r.chainId,tokenAddress:r.address}),m.balance&&(0,D.jsxs)("section",{className:"wi-td-balance-card",children:[(0,D.jsxs)("div",{className:"wi-td-balance-left",ref:$,children:[(0,D.jsx)("span",{className:"wi-td-balance-label",children:"My Balance"}),(0,D.jsx)("span",{className:"wi-td-balance-amount",ref:P,style:{fontSize:F},children:L}),a&&W&&(0,D.jsx)("span",{className:"wi-td-balance-fiat",children:W})]}),(0,D.jsx)("button",{type:"button",className:"wi-td-send-btn",onClick:()=>c(r),"aria-label":`Send ${r.symbol}`,"data-track":"token_detail_send","data-track-id":r.symbol,children:(0,D.jsx)("span",{children:"Send"})})]}),m.overview&&(0,D.jsxs)("section",{className:"wi-td-section",children:[(0,D.jsx)("h3",{className:"wi-td-section-title",children:"Crypto Overview"}),(0,D.jsxs)("div",{className:"wi-td-rows",children:[(0,D.jsxs)("div",{className:"wi-td-row",children:[(0,D.jsx)("span",{className:"wi-td-row-label",children:"Network"}),_?(0,D.jsxs)("a",{className:"wi-td-row-value wi-td-row-link",href:_,target:"_blank",rel:"noopener noreferrer",onClick:j=>Z(j,_,"token-network"),children:[(0,D.jsx)("span",{children:V}),(0,D.jsx)(T0,{})]}):(0,D.jsx)("span",{className:"wi-td-row-value",children:V})]}),(0,D.jsxs)("div",{className:"wi-td-row",children:[(0,D.jsx)("span",{className:"wi-td-row-label",children:"Contract Address"}),(0,D.jsxs)("button",{type:"button",className:"wi-td-row-value wi-td-row-copy",onClick:M,"aria-label":"Copy contract address",children:[(0,D.jsx)("span",{children:Yt(r.address)}),h?(0,D.jsx)(Hr,{size:14}):(0,D.jsx)(kn,{size:14})]})]}),(0,D.jsxs)("div",{className:"wi-td-row",children:[(0,D.jsx)("span",{className:"wi-td-row-label",children:"Decimals"}),(0,D.jsx)("span",{className:"wi-td-row-value",children:b})]}),(0,D.jsxs)("div",{className:"wi-td-row",children:[(0,D.jsx)("span",{className:"wi-td-row-label",children:"Total Supply"}),(0,D.jsx)("span",{className:"wi-td-row-value",children:k0(o?.circulating_supply)})]})]})]}),m.social&&ee.length>0&&(0,D.jsxs)("section",{className:"wi-td-section",children:[(0,D.jsx)("h3",{className:"wi-td-section-title",children:"Social Media"}),(0,D.jsx)("div",{className:"wi-td-social-row",children:ee.map(j=>(0,D.jsx)("a",{className:"wi-td-social-btn",href:j.url,target:"_blank",rel:"noopener noreferrer","aria-label":j.label,onClick:ie=>Z(ie,j.url,"token-social"),children:j.icon},j.key))})]}),m.history&&(0,D.jsxs)("section",{className:"wi-td-section",children:[(0,D.jsx)("h3",{className:"wi-td-section-title",children:"Token History"}),x&&(0,D.jsx)("div",{className:"wi-td-history-list",children:Array.from({length:3},(j,ie)=>(0,D.jsxs)("div",{className:"wi-td-history-skeleton",children:[(0,D.jsx)("div",{className:"wi-skeleton-block",style:{width:90,height:14}}),(0,D.jsx)("div",{className:"wi-skeleton-block",style:{width:60,height:14}})]},`td-sk-${ie}`))}),!x&&p&&(0,D.jsxs)("div",{className:"wi-td-history-empty",children:[(0,D.jsx)("span",{children:"Failed to load history."}),(0,D.jsx)("button",{type:"button",className:"wi-td-retry-btn",onClick:()=>T(),children:"Retry"})]}),!x&&!p&&N.length===0&&(0,D.jsx)("div",{className:"wi-td-history-empty",children:(0,D.jsx)("span",{children:"No transactions found."})}),!x&&!p&&N.length>0&&(0,D.jsxs)("div",{className:"wi-td-history-list",children:[N.map((j,ie)=>{let re=j.to_alias?.toLowerCase().includes("bridge")??!1,Se=j.from_alias?.toLowerCase().includes("bridge")??!1,ye=re?"bridge-out":Se?"bridge-in":j.to?.toLowerCase()===n.toLowerCase()?"receive":"send",ne=ye==="receive"||ye==="bridge-in",Ne=ne?j.from:j.to,Oe=nu(ou(j.amount,b)),xe=y(j.tx),Be=x0(j.timestamp),ge=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("div",{className:"wi-td-history-top",children:[(0,D.jsx)("span",{className:"wi-td-history-type","data-direction":ye,children:w0[ye]}),(0,D.jsx)("span",{className:"wi-td-history-counter",children:Yt(Ne??"")})]}),(0,D.jsxs)("div",{className:"wi-td-history-bottom",children:[(0,D.jsxs)("span",{className:"wi-td-history-meta",children:[(0,D.jsx)("span",{className:"wi-td-history-status","data-status":j.status,children:j.status==="success"?"Success":"Failed"}),Be&&(0,D.jsx)("span",{className:"wi-td-history-time",children:Be})]}),(0,D.jsxs)("span",{className:"wi-td-history-amount","data-size":y0(`${ne?"+":"-"}${Oe} ${r.symbol}`),children:[ne?"+":"-",Oe," ",r.symbol]})]})]}),Ze=`${j.tx}-${j.log_index}-${ie}`;return xe?(0,D.jsx)("a",{className:"wi-td-history-item wi-td-history-item--link",href:xe,target:"_blank",rel:"noopener noreferrer",onClick:dt=>Z(dt,xe,"token-tx",j.tx),children:ge},Ze):(0,D.jsx)("div",{className:"wi-td-history-item",children:ge},Ze)}),R&&(t?(0,D.jsx)("div",{ref:C,className:"wi-td-history-sentinel",children:S&&(0,D.jsx)("span",{className:"wi-td-history-loading",children:"Loading\u2026"})}):(0,D.jsx)("button",{type:"button",className:"wi-td-loadmore-btn",onClick:()=>k(),disabled:S,children:S?"Loading\u2026":"Load more"}))]})]})]})]})}function T0(){return(0,D.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:Ie("wi-td-external-icon"),"aria-hidden":!0,children:(0,D.jsx)("path",{d:"M14 4h6v6M20 4l-9 9M18 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}var v=require("react/jsx-runtime"),I0="On-ramp is not available in your region.";function Ms(e,t,r){let n=ft[e],o=r.toUpperCase();if(t===n.cross&&o.includes("ONEUSD"))return 0;if(t===n.cross&&o==="ONE")return 1;if(t===n.bsc&&o==="ONE")return 2}function M0(e){return parseInt(e.split(":")[1],10)}function E0(e){if(typeof window>"u"||!e?.length)return!1;let{origin:t,pathname:r}=window.location,n=t+r;return e.some(o=>n===o||n.startsWith(`${o}/`))}function A0(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function L0(e){let t=e.toLowerCase().replace(/^0x/,""),r=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),n=parseInt(r.slice(0,4),16)%360,o=(n+60+parseInt(r.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${n} 85% 65%), hsl(${o} 80% 55%))`}function D0(e,t=.5){let r=te.useRef(null),n=te.useRef(null),[o,i]=te.useState(1);return te.useLayoutEffect(()=>{let a=r.current,s=n.current;if(!a||!s)return;let l=()=>{let u=a.clientWidth;if(!u)return;let b=s.cloneNode(!0);b.style.setProperty("--wi-total-scale","1"),b.style.position="absolute",b.style.left="-9999px",b.style.top="-9999px",b.style.visibility="hidden",b.style.maxWidth="none",b.style.width="max-content",a.appendChild(b);let h=b.offsetWidth;a.removeChild(b);let d=h>u?Math.max(t,u/h):1;i(d)};l();let c=new ResizeObserver(l);return c.observe(a),()=>c.disconnect()},[e,t]),{containerRef:r,valueRef:n,scale:o}}function su({align:e="end",sideOffset:t=12,className:r,children:n}){let{env:o,theme:i,isMobile:a,open:s,drawerDirection:l,modal:c,showBalance:u,showForgeToken:b,showGameToken:h,showQR:d,showBridge:y,qrLogoSrc:f,walletAddress:m,accountName:w,sendAccounts:x,profileImageUrl:p,preferredTokens:k,close:R,onSelectWallet:S,onCopyAddress:T,onBuy:N,onDisconnect:C,disconnectLabel:M,termsUrl:B,termsLabel:W,privacyUrl:L,privacyLabel:$,portalStyle:P,navContent:F,navPosition:de,footerContent:V,view:_,setView:we,selectedSendToken:ee,setSelectedSendToken:Z,selectedDetailToken:j,setSelectedDetailToken:ie,showPortfolio:re,portfolioTitle:Se,portfolioSections:ye,showTotalAssets:ne,totalAssetsLabel:Ne,sendTransaction:Oe,getTransactionReceipt:xe,estimateGas:Be,onOutlink:ge,lpBalanceReader:Ze,stakingRewardsReader:dt,bridgeTokens:Fe,bridgeHistory:Ue,getBridgeQuote:De,getBridgeToTokens:ht,getBridgeApproval:et,approveBridge:Qe,submitBridge:Mt,onReceive:vt,onSend:Dt,onBuyDisabledMessage:je,onBridgeDisabledMessage:Pt,onSendDisabledMessage:kt}=on(),[Rt,Zt]=te.useState(null),Bt=te.useRef(void 0),We=te.useCallback(I=>{Zt(I),clearTimeout(Bt.current),Bt.current=setTimeout(()=>Zt(null),4e3)},[]);te.useEffect(()=>()=>clearTimeout(Bt.current),[]);let pt=!!je,Ge=te.useCallback(()=>{if(pt){We(je);return}let I=N?.();I&&typeof I.then=="function"&&I.catch(()=>{We(je??I0)})},[pt,je,N,We]),tt=!!Pt,at=!!kt,{tokens:jt,isLoading:Wt}=Yr(o,m,s&&u),{statsMap:st}=qr(o,u),{aprPercent:zt}=Zc(),{categoryMap:_t,infoMap:Xt}=Jc(o,u),O=u&&ne,{displayValue:se,isLowerBound:Ve,isLoading:St}=ed(o,m,s&&O),[ut,Gt]=te.useState(!1),Ht=te.useRef(null),[Ar,rn]=te.useState(0),{holdings:lr,isLoading:nn}=Qc(o,m,s&&u&&b),gn=te.useMemo(()=>lr.map(I=>I.token),[lr]),{imageMap:A}=Vc(o,gn,b&&lr.length>0),E=te.useMemo(()=>{let I=[],ae=[],Ee=[],$t=new Map((k??[]).map((_e,Qt)=>[`${M0(_e.chainId)}:${_e.address.toLowerCase()}`,Qt]));for(let _e of jt){let Qt=Ms(o,_e.chainId,_e.symbol)!==void 0,Rr=`${_e.chainId}:${_e.address.toLowerCase()}`,hn=$t.get(Rr),za=new Xn.default(_e.quantity.numeric).shiftedBy(-_e.quantity.decimals);if(Qt)I.push(_e);else if(hn!==void 0)ae.push(_e);else if(za.isGreaterThan(0)){if(!h&&_t.get(ko(_e.chainId,_e.address))==="game")continue;Ee.push(_e)}}return I.sort((_e,Qt)=>{let Rr=Ms(o,_e.chainId,_e.symbol)??99,hn=Ms(o,Qt.chainId,Qt.symbol)??99;return Rr-hn}),ae.sort((_e,Qt)=>{let Rr=$t.get(`${_e.chainId}:${_e.address.toLowerCase()}`)??99,hn=$t.get(`${Qt.chainId}:${Qt.address.toLowerCase()}`)??99;return Rr-hn}),Ee.sort((_e,Qt)=>{let Rr=st.get(gr(_e.chainId,_e.address)),hn=st.get(gr(Qt.chainId,Qt.address)),za=new Xn.default(_e.quantity.numeric).shiftedBy(-_e.quantity.decimals).multipliedBy(Rr?.price??0);return new Xn.default(Qt.quantity.numeric).shiftedBy(-Qt.quantity.decimals).multipliedBy(hn?.price??0).minus(za).toNumber()}),[...I,...ae,...Ee]},[jt,o,st,h,_t,k]),z=te.useMemo(()=>{if(!b)return[];let I=new Set(jt.map(ae=>ae.address.toLowerCase()));return[...lr].filter(ae=>!I.has(ae.token.toLowerCase())).sort((ae,Ee)=>{let $t=new Xn.default(ae.value);return new Xn.default(Ee.value).minus($t).toNumber()})},[lr,b,jt]),he=te.useRef(!1),[ze,Ct]=te.useState(null),kr=te.useRef(void 0),io=ze?.chainId??ee?.chainId??E[0]?.chainId??0,{transactionUrl:Ea}=wo(o,io,ze?.txHash,!!(ze?.txHash&&io)),Jt=te.useCallback(I=>{he.current=!0,we(I)},[we]),[Mf,Aa]=te.useState("recipient"),Xo=te.useCallback(()=>{Z(null),Aa("recipient"),Jt("wallet")},[Z,Jt]),Jo=te.useCallback((I,ae="recipient")=>{if(at){We(kt);return}Aa(ae),Z(I),Jt("send")},[at,kt,We,Z,Jt]),Ef=te.useCallback(I=>{ie(I),Jt("token-detail")},[ie,Jt]),Af=te.useCallback(()=>{ie(null),Jt("wallet")},[ie,Jt]),Lf=te.useCallback(I=>{Jo(I,"recipient")},[Jo]),$o=Sr("apps.json",o,I=>cr(I?.gametokenBridge,o)),rl=Sr("apps.json",o,I=>I?.gametokenSites),Df=te.useCallback(()=>{if(tt){We(Pt);return}if($o){if(E0(rl)){window.location.assign($o);return}window.open($o,"_blank","noopener,noreferrer")}},[tt,Pt,$o,rl,We]),Pf=te.useCallback(I=>{clearTimeout(kr.current),Z(null),Jt("wallet"),Ct({status:"pending",txHash:I.txHash,chainId:I.chainId,description:`${I.amount} ${I.tokenSymbol} to ${Yt(I.recipient)}`})},[Z,Jt]),Bf=te.useCallback(I=>{let ae=ee?.chainId;Z(null),Jt("wallet"),!(!I||!ae)&&(Ct(Ee=>({status:"success",txHash:I,chainId:ae,description:Ee?.txHash===I?Ee.description:"Tap to see your transaction"})),clearTimeout(kr.current),kr.current=setTimeout(()=>Ct(null),5e3))},[ee?.chainId,Z,Jt]),zf=te.useCallback(I=>{let ae=I.txHash;ae&&(Ct({status:"error",txHash:ae,chainId:I.chainId,description:I.message}),clearTimeout(kr.current),kr.current=setTimeout(()=>Ct(null),5e3))},[]),ao=te.useMemo(()=>{if(vt)return vt;if(d)return()=>Jt("qr")},[vt,d,Jt]),La=te.useMemo(()=>{if(Dt)return Dt;if(E.length===0)return;let I=E[0];return()=>Jo(I,"token")},[Dt,E,Jo]),Of=te.useCallback(()=>{if(at){We(kt);return}La?.()},[at,kt,La,We]);te.useEffect(()=>{s||(he.current=!1,Aa("recipient"))},[s]);let nl=te.useRef(null);te.useEffect(()=>{let I=nl.current;if(!I||!a)return;let ae=Ee=>{Ee.pointerType==="touch"&&Ee.stopPropagation()};return I.addEventListener("pointerdown",ae),()=>I.removeEventListener("pointerdown",ae)},[a]);let[Fn,ol]=te.useState(!1),Da=te.useRef(void 0),[so,lo]=te.useState(!1);te.useEffect(()=>{if(!so)return;let I=()=>lo(!1),ae=$t=>{$t.key==="Escape"&&lo(!1)},Ee=setTimeout(()=>{document.addEventListener("mousedown",I,!0),document.addEventListener("keydown",ae,!0)},0);return()=>{clearTimeout(Ee),document.removeEventListener("mousedown",I,!0),document.removeEventListener("keydown",ae,!0)}},[so]),te.useEffect(()=>{lo(!1)},[m]),te.useEffect(()=>()=>clearTimeout(Da.current),[]),te.useEffect(()=>()=>clearTimeout(kr.current),[]),te.useEffect(()=>{let I=Ht.current;if(!I||V===null){rn(0);return}let ae=()=>{rn(I.offsetHeight)};if(ae(),typeof ResizeObserver>"u")return;let Ee=new ResizeObserver(ae);return Ee.observe(I),()=>Ee.disconnect()},[V]);let il=te.useCallback(async()=>{if(!Fn)try{await navigator.clipboard.writeText(m),ol(!0),clearTimeout(Da.current),Da.current=setTimeout(()=>ol(!1),2e3),T?.(m,!0)}catch{T?.(m,!1)}},[m,T,Fn]),ei=te.useCallback(I=>{I.currentTarget.setAttribute("data-loaded","true")},[]),al=te.useMemo(()=>({background:L0(m)}),[m]),ti=te.useMemo(()=>p||Vr(o,m,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[p,o,m,i]),Pa=te.useMemo(()=>A0(se),[se]),{containerRef:Ff,valueRef:Uf,scale:jf}=D0(ut?"\u2022\u2022\u2022\u2022\u2022\u2022":se),sl=B||L?(0,v.jsxs)("div",{className:"wi-legal-links",children:[B&&(0,v.jsx)("a",{className:"wi-legal-link",href:B,target:"_blank",rel:"noopener noreferrer","data-track":"terms_link",onClick:I=>Tt(I,B,{category:"terms",origin:"terms"},ge),children:W}),B&&L&&(0,v.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),L&&(0,v.jsx)("a",{className:"wi-legal-link",href:L,target:"_blank",rel:"noopener noreferrer","data-track":"privacy_link",onClick:I=>Tt(I,L,{category:"privacy",origin:"privacy"},ge),children:$})]}):null,ll=C?(0,v.jsxs)("button",{type:"button",className:"wi-disconnect-btn","data-track":"disconnect",onClick:()=>{C(),R()},children:[(0,v.jsx)(ql,{size:16}),(0,v.jsx)("span",{className:"wi-disconnect-label",children:M})]}):null,Wf=u&&!F?(0,v.jsxs)("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[(0,v.jsxs)("button",{type:"button",className:Ie("wi-action-card",pt&&"wi-action-card--dimmed"),onClick:Ge,disabled:!N&&!pt,"aria-disabled":pt||void 0,"aria-label":"Buy","data-track":"buy",children:[(0,v.jsx)(ec,{size:20}),(0,v.jsx)("span",{children:"Buy"})]}),y?(0,v.jsxs)("button",{type:"button",className:Ie("wi-action-card",tt&&"wi-action-card--dimmed"),onClick:Df,"aria-disabled":tt||void 0,"aria-label":"Bridge","data-track":"bridge_open",children:[(0,v.jsx)(tc,{size:20}),(0,v.jsx)("span",{children:"Bridge"})]}):(0,v.jsxs)("button",{type:"button",className:"wi-action-card",onClick:ao,disabled:!ao,"aria-label":"Receive","data-track":"receive",children:[(0,v.jsx)(ui,{size:20}),(0,v.jsx)("span",{children:"Receive"})]}),(0,v.jsxs)("button",{type:"button",className:Ie("wi-action-card",at&&"wi-action-card--dimmed"),onClick:Of,disabled:!at&&!La,"aria-disabled":at||void 0,"aria-label":"Send","data-track":"send_open",children:[(0,v.jsx)(Jl,{size:20}),(0,v.jsx)("span",{children:"Send"})]}),re?(0,v.jsxs)("button",{type:"button",className:"wi-action-card",onClick:()=>Jt("portfolio"),"aria-label":"View portfolio","data-track":"portfolio_open",children:[(0,v.jsx)($l,{size:20}),(0,v.jsx)("span",{children:"Portfolio"})]}):y?(0,v.jsxs)("button",{type:"button",className:"wi-action-card",onClick:ao,disabled:!ao,"aria-label":"Receive","data-track":"receive",children:[(0,v.jsx)(ui,{size:20}),(0,v.jsx)("span",{children:"Receive"})]}):null]}):null,_f=(0,v.jsxs)("div",{className:Ie("wi-view-inner",he.current&&"wi-view-wallet"),children:[O&&(0,v.jsxs)("div",{className:"wi-total-section",children:[(0,v.jsxs)("div",{className:"wi-total-head",children:[(0,v.jsx)("span",{className:"wi-total-label",children:Ne}),(0,v.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:I=>{I.stopPropagation(),Gt(ae=>!ae)},onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.stopPropagation(),Gt(ae=>!ae))},"aria-label":ut?"Show balance":"Hide balance","data-track":"balance_toggle",children:ut?(0,v.jsx)(Zl,{}):(0,v.jsx)(Kl,{})})]}),(0,v.jsx)("div",{className:"wi-total-body",ref:Ff,children:St?(0,v.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):(0,v.jsx)("div",{className:"wi-total-value","data-hidden":ut||void 0,ref:Uf,style:{"--wi-total-scale":jf},children:ut?(0,v.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,v.jsxs)(v.Fragment,{children:[Ve&&(0,v.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,v.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,v.jsx)("span",{className:"wi-total-amount",children:Pa.main}),Pa.decimal&&(0,v.jsx)("span",{className:"wi-total-decimal",children:Pa.decimal})]})})})]}),de==="top"&&(F?(0,v.jsx)("div",{className:"wi-nav-fixed",children:F}):Wf),u&&(0,v.jsx)("div",{ref:nl,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,v.jsxs)("div",{className:"wi-token-list",children:[Wt&&Array.from({length:5},(I,ae)=>(0,v.jsxs)("div",{className:"wi-skeleton-item",children:[(0,v.jsxs)("div",{className:"wi-skeleton-left",children:[(0,v.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,v.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,v.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,v.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,v.jsxs)("div",{className:"wi-skeleton-right",children:[(0,v.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,v.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},ae)),!Wt&&E.length===0&&!b&&(0,v.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),E.map(I=>{let ae=st.get(gr(I.chainId,I.address)),Ee=ae?parseFloat(ae.percent_change_24h):null,$t=Ee!==null&&Ee>=0,_e=xo(o,I.chainId),Qt=Rc(I.address);return(0,v.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>Ef(I),"aria-label":`View ${I.symbol} detail`,"data-track":"token_detail","data-track-id":I.symbol,children:[(0,v.jsxs)("div",{className:"wi-token-left",children:[(0,v.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,v.jsx)("img",{src:I.icon_url,alt:I.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:ei,onError:Rr=>{Rr.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),_e&&(0,v.jsx)("img",{src:_e,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Rr=>{Rr.currentTarget.style.display="none"}})]}),(0,v.jsxs)("div",{className:"wi-token-info",children:[(0,v.jsxs)("span",{className:"wi-token-name-row",children:[(0,v.jsx)("span",{className:"wi-token-name",children:I.symbol}),Qt&&zt!==null&&(0,v.jsx)("span",{className:"wi-token-apr",children:`APR ${zt>=0?"+":"-"}${(zt>=0?Math.floor:Math.ceil)(Math.abs(zt)*100)/100}%`})]}),ae&&(0,v.jsxs)("div",{className:"wi-token-price-row",children:[(0,v.jsx)("span",{className:"wi-token-price",children:Sn(ae.price)}),(0,v.jsx)("span",{className:"wi-token-change","data-positive":$t,"data-zero":Ee===0||void 0,children:Ee!==null&&(Ee===0?"0%":`${$t?"+":"-"}${($t?Math.floor:Math.ceil)(Math.abs(Ee)*100)/100}%`)})]})]})]}),(0,v.jsxs)("div",{className:"wi-token-right",children:[(0,v.jsx)("span",{className:"wi-token-balance",children:sn(I.quantity.numeric,I.quantity.decimals)}),ae&&(0,v.jsx)("span",{className:"wi-token-value",children:fi(I.quantity.numeric,I.quantity.decimals,ae.price)})]})]},`${I.address}-${I.chainId}`)}),b&&nn&&Array.from({length:3},(I,ae)=>(0,v.jsxs)("div",{className:"wi-skeleton-item",children:[(0,v.jsxs)("div",{className:"wi-skeleton-left",children:[(0,v.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,v.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,v.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,v.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,v.jsxs)("div",{className:"wi-skeleton-right",children:[(0,v.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,v.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${ae}`)),b&&!nn&&!Wt&&E.length===0&&z.length===0&&(0,v.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),b&&z.map(I=>{let ae=A.get(I.token)||"",Ee=xo(o,ft[o].cross);return(0,v.jsxs)("div",{className:"wi-token-item",children:[(0,v.jsxs)("div",{className:"wi-token-left",children:[(0,v.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,v.jsx)("img",{src:ae||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:I.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:ei,onError:$t=>{$t.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Ee&&(0,v.jsx)("img",{src:Ee,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:$t=>{$t.currentTarget.style.display="none"}})]}),(0,v.jsxs)("div",{className:"wi-token-info",children:[(0,v.jsx)("span",{className:"wi-token-name",children:I.token_name}),(0,v.jsx)("div",{className:"wi-token-price-row",children:(0,v.jsxs)("span",{className:"wi-token-price",children:[sn(I.current_price,18)," CROSS"]})})]})]}),(0,v.jsxs)("div",{className:"wi-token-right",children:[(0,v.jsx)("span",{className:"wi-token-balance",children:sn(I.balance,18)}),(0,v.jsx)("span",{className:"wi-token-value",children:Sn(I.current_value_usd)})]})]},`forge-${I.token}`)})]})}),de==="bottom"&&F&&(0,v.jsx)("div",{className:"wi-nav-fixed",children:F}),ll&&(0,v.jsx)("div",{className:"wi-wallet-disconnect-row",children:ll})]},"wallet"),Gf=re?(0,v.jsx)("div",{className:Ie("wi-view-inner wi-portfolio-body",he.current&&"wi-view-portfolio"),children:(0,v.jsx)(Mn,{env:o,theme:i,walletAddress:m,showHeader:!1,onOutlink:ge,lpBalanceReader:Ze,stakingRewardsReader:dt,sendTransaction:Oe,estimateGas:Be,sections:ye})},"portfolio"):null,Hf=ee?(0,v.jsx)("div",{className:Ie("wi-view-inner wi-send-body",he.current&&"wi-view-send"),children:(0,v.jsx)(vo,{env:o,theme:i,walletAddress:m,accountName:w,accounts:x,initialStep:Mf,token:ee,tokens:E,onTokenChange:Z,sendTransaction:Oe,getTransactionReceipt:xe,estimateGas:Be,getTokenPriceUsd:I=>{let ae=st.get(gr(I.chainId,I.address));if(!ae?.price)return;let Ee=parseFloat(ae.price);return Number.isFinite(Ee)?Ee:void 0},onClose:R,onBackToWallet:Xo,onSubmitted:Pf,onSuccess:Bf,onFailed:zf,onOutlink:ge})},"send"):null,Qf=te.useMemo(()=>Fe||E.map(I=>{let ae=st.get(gr(I.chainId,I.address)),Ee=ae?.price?parseFloat(ae.price):void 0;return{name:I.name,symbol:I.symbol,chainId:I.chainId,address:I.address,decimals:I.quantity.decimals,balance:Vn(I.quantity.numeric,I.quantity.decimals),iconUrl:I.icon_url,priceUsd:Number.isFinite(Ee)?Ee:void 0}}),[Fe,st,E]),Vf=(0,v.jsx)("div",{className:Ie("wi-view-inner wi-bridge-body",he.current&&"wi-view-send"),children:(0,v.jsx)(Do,{env:o,walletAddress:m,tokens:Qf,history:Ue,termsUrl:B,getQuote:De,getToTokens:ht,getApproval:et,approveBridge:Qe,submitBridge:Mt,onClose:R,onBackToWallet:Xo})},"bridge"),Yf=j?(0,v.jsx)("div",{className:Ie("wi-view-inner wi-token-detail-body",he.current&&"wi-view-send"),children:(0,v.jsx)(iu,{env:o,isMobile:a,token:j,walletAddress:m,stat:st.get(gr(j.chainId,j.address)),tokenInfo:Xt.get(ko(j.chainId,j.address)),showBalance:u,onBack:Af,onClose:R,onSend:Lf,onOutlink:ge})},"token-detail"):null,Ba=!!S&&w?.trim().toLowerCase()!=="my wallet",cl=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("span",{className:"wi-receive-avatar",children:[(0,v.jsx)("span",{className:"wi-avatar-fallback",style:al}),ti&&(0,v.jsx)("img",{src:ti,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:ei,onError:I=>{I.currentTarget.style.display="none"}})]}),(0,v.jsx)("span",{className:"wi-receive-account-name",children:w??"Account 1"}),Ba&&(0,v.jsx)("span",{className:"wi-receive-chevron","data-open":so,"aria-hidden":"true",children:(0,v.jsx)(Rn,{size:16})})]}),qf=(0,v.jsxs)("div",{className:Ie("wi-view-inner wi-qr-body",he.current&&"wi-view-qr"),children:[(0,v.jsxs)("div",{className:"wi-receive-section",children:[Ba?(0,v.jsx)("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{lo(!0),S?.()},"aria-label":"Switch account",children:cl}):(0,v.jsx)("div",{className:"wi-receive-account",children:cl}),(0,v.jsxs)("div",{className:"wi-qr-block",children:[(0,v.jsxs)("div",{className:"wi-qr-box",children:[(0,v.jsx)(au.QRCodeSVG,{value:m,size:180,level:"H",marginSize:2,...f&&{imageSettings:{src:f,height:33,width:33,excavate:!0}}}),!f&&(0,v.jsx)("div",{className:"wi-qr-logo",children:(0,v.jsx)(Xl,{size:33})})]}),(0,v.jsx)("p",{className:"wi-qr-address",children:m})]}),(0,v.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:il,"data-track":"address_copy",children:[(0,v.jsx)("span",{className:"wi-qr-copy-icon",children:Fn?(0,v.jsx)(Hr,{size:16}):(0,v.jsx)(kn,{size:16})}),(0,v.jsx)("span",{className:"wi-qr-copy-text",children:Fn?"Copied!":"Copy address"})]})]}),sl&&(0,v.jsx)("div",{className:"wi-receive-footer",children:sl})]},"qr"),Kf=_==="qr"||_==="portfolio"||_==="send"||_==="bridge",dl=V!==null?(0,v.jsx)("div",{className:"wi-builtin-footer",children:V}):null,pl=(0,v.jsxs)("div",{className:"wi-account-text",children:[Ba?(0,v.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{lo(!0),S?.()},"aria-label":"Switch account","aria-expanded":so,children:[(0,v.jsx)("span",{className:"wi-account-name",children:w??"Account 1"}),(0,v.jsx)("span",{className:"wi-account-switch","data-open":so,"aria-hidden":"true",children:(0,v.jsx)(Rn,{size:20})})]}):(0,v.jsx)("div",{className:"wi-account-row",children:(0,v.jsx)("span",{className:"wi-account-name",children:w??"Account 1"})}),(0,v.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:il,"aria-label":"Copy address","data-track":"address_copy",children:[(0,v.jsx)("span",{className:"wi-account-address",children:Yt(m)}),(0,v.jsx)("span",{className:"wi-account-copy","data-copied":Fn,children:Fn?(0,v.jsx)(Hr,{size:12}):(0,v.jsx)(kn,{size:12})})]})]}),ul=(0,v.jsxs)(v.Fragment,{children:[n,_==="qr"?(0,v.jsx)("div",{className:"wi-sticky-header",children:(0,v.jsxs)("div",{className:"wi-header wi-header--receive",children:[(0,v.jsx)("button",{type:"button",className:"wi-header-back",onClick:Xo,"aria-label":"Back",children:(0,v.jsx)(Qr,{size:24})}),(0,v.jsx)("span",{className:"wi-receive-title",children:"Receive"}),(0,v.jsx)("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:(0,v.jsx)(mr,{size:24})})]})}):_==="send"||_==="bridge"||_==="token-detail"?null:Kf?(0,v.jsxs)("div",{className:"wi-sticky-header",children:[(0,v.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,v.jsx)("button",{type:"button",className:"wi-header-back",onClick:Xo,"aria-label":"Back",children:(0,v.jsx)(Qr,{size:24})}),(0,v.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:pl}),(0,v.jsx)("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:(0,v.jsx)(mr,{size:24})})]}),(0,v.jsx)("hr",{className:"wi-divider"})]}):(0,v.jsxs)("div",{className:"wi-sticky-header",children:[(0,v.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,v.jsxs)("div",{className:"wi-account-block",children:[(0,v.jsxs)("div",{className:"wi-avatar",children:[(0,v.jsx)("div",{className:"wi-avatar-fallback",style:al}),ti&&(0,v.jsx)("img",{src:ti,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:ei,onError:I=>{I.currentTarget.style.display="none"}})]}),pl]}),(0,v.jsxs)("div",{className:"wi-header-actions",children:[d&&y&&(0,v.jsx)("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:ao,"aria-label":"Show QR code","data-track":"receive",children:(0,v.jsx)(ui,{size:20})}),(0,v.jsx)("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:(0,v.jsx)(mr,{size:24})})]})]}),(0,v.jsx)("hr",{className:"wi-divider"})]}),(0,v.jsxs)("div",{className:"wi-view-container",children:[_==="wallet"&&_f,_==="qr"&&qf,_==="portfolio"&&Gf,_==="send"&&Hf,_==="bridge"&&Vf,_==="token-detail"&&Yf]}),_==="wallet"&&Rt&&(0,v.jsx)("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:Rt}),_==="wallet"&&ze&&(0,v.jsxs)("a",{className:"wi-send-toast",href:Ea??"#",target:"_blank",rel:"noopener noreferrer",onClick:I=>{if(!Ea){I.preventDefault();return}Tt(I,Ea,{category:"send",origin:"send-transaction",payload:{chainId:ze.chainId,txHash:ze.txHash}},ge)},children:[(0,v.jsx)("span",{className:"wi-send-toast-icon","data-status":ze.status,"aria-hidden":!0,children:ze.status==="pending"?(0,v.jsx)("span",{className:"wi-send-toast-spinner"}):ze.status==="error"?(0,v.jsx)("span",{className:"wi-send-toast-error-dot"}):(0,v.jsx)(rc,{size:20})}),(0,v.jsxs)("span",{className:"wi-send-toast-copy",children:[(0,v.jsx)("span",{className:"wi-send-toast-title",children:ze.status==="pending"?"Sending...":ze.status==="error"?"Send failed":"Send complete"}),(0,v.jsx)("span",{className:"wi-send-toast-desc",children:ze.status==="pending"||ze.status==="error"?ze.description:"Tap to see your transaction"})]})]}),dl&&_!=="portfolio"&&_!=="send"&&_!=="token-detail"&&(0,v.jsx)("div",{className:"wi-sticky-footer",children:(0,v.jsx)("div",{className:"wi-footer",ref:Ht,children:dl})})]}),fl={...P,...Ar>0?{"--wi-footer-height":`${Ar}px`}:null};return a?(0,v.jsx)(ve,{feature:"wallet_info",children:(0,v.jsxs)(Po.Drawer.Portal,{children:[c&&(0,v.jsx)(Po.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,v.jsxs)(Po.Drawer.Content,{className:Ie("wi-drawer-content",r),"data-theme":i,"data-vaul-no-drag":l==="left"||l==="right"?!0:void 0,style:fl,"data-direction":l,"data-no-balance":!u||void 0,"data-has-footer":Ar>0||void 0,"data-view":_,children:[(0,v.jsx)(Po.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),ul]})]})}):(0,v.jsxs)(ve,{feature:"wallet_info",children:[c&&s&&(0,v.jsx)("div",{className:"wi-drawer-overlay",onClick:R}),(0,v.jsx)(qi.Portal,{children:(0,v.jsx)(qi.Content,{align:e,sideOffset:t,className:Ie("wi-popover-content",r),"data-theme":i,style:fl,"data-no-balance":!u||void 0,"data-has-footer":Ar>0||void 0,"data-view":_,children:ul})})]})}var lu=Q(require("react"),1);function cu({position:e="top",children:t}){let{setNavContent:r,setNavPosition:n}=on();return lu.useEffect(()=>(r(t),n(e),()=>r(null)),[t,e,r,n]),null}var du=Q(require("react"),1);function pu({children:e}){let{setFooterContent:t}=on();return du.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}pe(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-system-orange-default, #f0640d);--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-system-orange-default, #f0640d);--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)}
12
+ `);pe(`.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}
13
+ `);pe(`@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}}
14
+ `);pe(`.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:min(680px,calc(100dvh - 32px));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(680px + 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:calc(36px * var(--wi-total-scale, 1));color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:calc(22px * var(--wi-total-scale, 1));color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:calc(32px * var(--wi-total-scale, 1));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-row{display:flex;align-items:center;gap:6px;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-apr{flex-shrink:0;font-family:inherit;font-size:12px;font-weight:600;line-height:1;color:var(--ds-system-purple-high, #9b78ff);background:var(--ds-system-purple-low, #2e2854);padding:4px;border-radius:6px;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-system-orange-default, #f0640d)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(255,159,33,.22);border-top-color:var(--ds-system-orange-on-inverted, #ff9f21);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-system-orange-on-inverted, #ff9f21)}.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}
15
+ `);pe(`.wi-td-header-title{position:absolute;left:50%;transform:translate(-50%);display:inline-flex;align-items:center;gap:8px;pointer-events:none}.wi-td-header-icon{width:24px;height:24px;object-fit:contain;flex-shrink:0}.wi-td-header-name{font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--wi-texticon-primary, #ffffff)}.wi-td-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;display:flex;flex-direction:column;gap:24px;padding:20px 24px 24px;background:transparent;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .wi-td-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-td-scroll::-webkit-scrollbar{width:4px}.wi-td-scroll::-webkit-scrollbar-track{background:transparent}.wi-td-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-td-scroll::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-td-scroll::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-td-scroll::-webkit-scrollbar-thumb:hover{background:#0003}.wi-td-chart{display:flex;flex-direction:column;gap:14px}.wi-td-chart-panel{display:flex;flex-direction:column;gap:4px}.wi-td-chart-price{font-size:26px;font-weight:700;line-height:1.15;color:var(--wi-texticon-primary, #ffffff)}.wi-td-chart-change{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--ds-system-green-high, #00a869)}.wi-td-chart-change[data-positive=false]{color:var(--wi-error, #e70077)}.wi-td-chart-when{font-weight:400;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-chart-plot{position:relative;width:100%;height:150px}.wi-td-chart-svg{display:block;width:100%;height:150px;overflow:visible;touch-action:none}.wi-td-chart-minmax{fill:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));font-size:11px;font-family:inherit}.wi-td-chart-cursor{stroke:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));stroke-width:1;stroke-dasharray:3 3}.wi-td-chart-skeleton{width:100%;height:150px;border-radius:12px}.wi-td-chart-tabs{display:flex;gap:6px;justify-content:space-between}.wi-td-chart-tab{flex:1;padding:7px 0;border:none;border-radius:8px;background:transparent;cursor:pointer;font-family:inherit;font-size:13px;font-weight:600;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));transition:background .15s ease,color .15s ease}.wi-td-chart-tab[data-active]{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1));color:var(--wi-texticon-primary, #ffffff)}.wi-td-chart-tab:hover:not([data-active]){color:var(--wi-texticon-primary, #ffffff)}.wi-td-balance-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px;border-radius:16px;background:var(--wi-surface-default, rgba(255, 255, 255, .05))}.wi-td-balance-left{display:flex;flex-direction:column;gap:4px;flex:1 1 0;min-width:0}.wi-td-balance-label{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff)}.wi-td-balance-amount{font-size:30px;font-weight:700;line-height:1.15;color:var(--wi-texticon-primary, #ffffff);white-space:nowrap;max-width:100%}.wi-td-balance-fiat{font-size:14px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-send-btn{display:inline-flex;align-items:center;gap:6px;flex-shrink:0;padding:12px 22px;border:none;border-radius:999px;cursor:pointer;font-family:inherit;font-size:15px;font-weight:600;color:var(--wi-on-primary, #ffffff);background:var(--wi-primary, #019d92);transition:filter .15s ease}.wi-td-send-btn:hover{filter:brightness(1.06)}.wi-td-send-btn:active{filter:brightness(.94)}.wi-td-section{display:flex;flex-direction:column;gap:14px}.wi-td-section-title{margin:0;font-size:18px;font-weight:700;letter-spacing:-.01em;color:var(--wi-texticon-primary, #ffffff)}.wi-td-rows{display:flex;flex-direction:column;gap:12px}.wi-td-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.wi-td-row-label{font-size:15px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-row-value{font-size:15px;font-weight:500;color:var(--wi-texticon-primary, #ffffff);text-align:right;word-break:break-all}.wi-td-row-link,.wi-td-row-copy{display:inline-flex;align-items:center;gap:6px;border:none;background:transparent;padding:0;cursor:pointer;font-family:inherit;text-decoration:none}.wi-td-row-link:hover,.wi-td-row-copy:hover{opacity:.8}.wi-td-external-icon{color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));flex-shrink:0}.wi-td-row-copy svg{color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));flex-shrink:0}.wi-td-social-row{display:flex;flex-wrap:wrap;gap:10px}.wi-td-social-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;color:var(--wi-texticon-primary, #ffffff);background:var(--wi-surface-default, rgba(255, 255, 255, .05));text-decoration:none;transition:background .15s ease}.wi-td-social-btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-list{display:flex;flex-direction:column;gap:10px}.wi-td-history-item{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05));text-decoration:none}.wi-td-history-item--link{cursor:pointer;transition:background .15s ease}.wi-td-history-item--link:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-top,.wi-td-history-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}.wi-td-history-type{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff)}.wi-td-history-type[data-direction=receive],.wi-td-history-type[data-direction=bridge-in]{color:var(--ds-system-green-high, #00a869)}.wi-td-history-counter{font-size:14px;color:var(--wi-primary, #f0640d);font-variant-numeric:tabular-nums}.wi-td-history-meta{display:inline-flex;align-items:center;gap:8px;min-width:0}.wi-td-history-status{font-size:14px;font-weight:500}.wi-td-history-status[data-status=success]{color:var(--ds-system-green-high, #00a869)}.wi-td-history-status[data-status=fail]{color:var(--wi-error, #e70077)}.wi-td-history-time{font-size:14px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-history-amount{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff);text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.wi-td-history-amount[data-size=sm]{font-size:13px}.wi-td-history-amount[data-size=xs]{font-size:11px;white-space:normal;word-break:break-all}.wi-td-history-skeleton{display:flex;align-items:center;justify-content:space-between;padding:16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05))}.wi-td-history-empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:28px 16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05));color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));font-size:14px;text-align:center}.wi-td-retry-btn{padding:8px 18px;border:1px solid var(--wi-border-subtle, rgba(255, 255, 255, .1));border-radius:999px;background:transparent;color:var(--wi-texticon-primary, #ffffff);font-family:inherit;font-size:13px;font-weight:600;cursor:pointer}.wi-td-retry-btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-sentinel{display:flex;align-items:center;justify-content:center;min-height:32px}.wi-td-history-loading{font-size:13px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-loadmore-btn{align-self:center;margin-top:2px;padding:10px 24px;border:1px solid var(--wi-border-subtle, rgba(255, 255, 255, .1));border-radius:999px;background:transparent;color:var(--wi-texticon-primary, #ffffff);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:background .15s ease}.wi-td-loadmore-btn:hover:not(:disabled){background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-loadmore-btn:disabled{cursor:default;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}
16
+ `);pe(`.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}
17
+ `);var Ki=require("react/jsx-runtime");function P0({env:e,theme:t="dark",mobileBreakpoint:r=768,drawerDirection:n,modal:o,showBalance:i=!1,showForgeToken:a=!1,showGameToken:s=!0,showQR:l=!0,showBridge:c=!0,qrLogoSrc:u,walletAddress:b,accountName:h,sendAccounts:d,profileImageUrl:y,connectorId:f,connectorName:m,connectorIconUrl:w,preferredTokens:x=[],onSelectWallet:p,onCopyAddress:k,onBuy:R,onBuyDisabledMessage:S,onBridgeDisabledMessage:T,onSendDisabledMessage:N,onDisconnect:C,disconnectLabel:M="Disconnect",termsUrl:B=Hn,termsLabel:W="Terms of Service",privacyUrl:L=mi,privacyLabel:$="Privacy Policy",open:P,onOpenChange:F,showPortfolio:de=!1,portfolioTitle:V="My Portfolio",portfolioSections:_,showTotalAssets:we=!0,totalAssetsLabel:ee="Total Assets USD",sendTransaction:Z,getTransactionReceipt:j,estimateGas:ie,onOutlink:re,lpBalanceReader:Se,stakingRewardsReader:ye,bridgeTokens:ne,bridgeHistory:Ne,getBridgeQuote:Oe,getBridgeToTokens:xe,getBridgeApproval:Be,approveBridge:ge,submitBridge:Ze,onReceive:dt,onBridge:Fe,onSend:Ue,style:De,children:ht}){let et=Xe(e),Qe=f?bo[f]:void 0,Mt=m??Qe?.name,vt=w??Qe?.iconUrl,Dt=_n(`(max-width: ${r}px)`),je=n??(i?"right":"bottom"),Pt=je==="left"||je==="right",kt=o??!1,Rt=P!==void 0,[Zt,Bt]=Ut.useState(!1),We=Rt?P:Zt,pt=Ut.useCallback(Ht=>{Rt||Bt(Ht),F?.(Ht)},[Rt,F]),Ge=Ut.useCallback(()=>pt(!1),[pt]),[tt,at]=Ut.useState(null),[jt,Wt]=Ut.useState("top"),[st,zt]=Ut.useState(null),[_t,Xt]=Ut.useState("wallet"),[O,se]=Ut.useState(null),[Ve,St]=Ut.useState(null);Ut.useEffect(()=>{We||(Xt("wallet"),se(null),St(null))},[We]),Ut.useEffect(()=>{wn(b)},[b]);let ut=Ut.useCallback(()=>{Xa(b),C?.()},[C,b]),Gt=Ut.useMemo(()=>({env:et,theme:t,isMobile:Dt,open:We,drawerDirection:je,modal:kt,showBalance:i,showForgeToken:a,showGameToken:s,showQR:l,showBridge:c,qrLogoSrc:u,walletAddress:b,accountName:h,sendAccounts:d,profileImageUrl:y,connectorName:Mt,connectorIconUrl:vt,preferredTokens:x,close:Ge,onSelectWallet:p,onCopyAddress:k,onBuy:R,onBuyDisabledMessage:S,onBridgeDisabledMessage:T,onSendDisabledMessage:N,onDisconnect:C?ut:void 0,disconnectLabel:M,termsUrl:B,termsLabel:W,privacyUrl:L,privacyLabel:$,portalStyle:De,navContent:tt,navPosition:jt,setNavContent:at,setNavPosition:Wt,footerContent:st,setFooterContent:zt,view:_t,setView:Xt,selectedSendToken:O,setSelectedSendToken:se,selectedDetailToken:Ve,setSelectedDetailToken:St,showPortfolio:de,portfolioTitle:V,portfolioSections:_,showTotalAssets:we,totalAssetsLabel:ee,sendTransaction:Z,getTransactionReceipt:j,estimateGas:ie,onOutlink:re,lpBalanceReader:Se,stakingRewardsReader:ye,bridgeTokens:ne,bridgeHistory:Ne,getBridgeQuote:Oe,getBridgeToTokens:xe,getBridgeApproval:Be,approveBridge:ge,submitBridge:Ze,onReceive:dt,onBridge:Fe,onSend:Ue}),[et,t,Dt,We,je,kt,i,a,s,l,c,u,b,h,d,y,Mt,vt,x,Ge,p,k,R,S,T,N,C,ut,M,B,W,L,$,De,tt,jt,st,_t,O,Ve,de,V,_,we,ee,Z,j,ie,re,Se,ye,ne,Ne,Oe,xe,Be,ge,Ze,dt,Fe,Ue]);return(0,Ki.jsx)(Va.Provider,{value:Gt,children:Dt?(0,Ki.jsx)(fu.Drawer.Root,{direction:je,open:We,onOpenChange:pt,handleOnly:Pt,noBodyStyles:!0,repositionInputs:!1,children:ht},"drawer"):(0,Ki.jsx)(uu.Root,{open:We,onOpenChange:pt,children:ht},"popover")})}var Pn=Object.assign(P0,{Trigger:Wc,Content:su,Nav:cu,Footer:pu});var jr=Q(require("react"),1),Au=Q(require("@radix-ui/react-dialog"),1),Lu=require("vaul");var Zi=require("react"),Xi=(0,Zi.createContext)(null);function Bo(){let e=(0,Zi.useContext)(Xi);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var Bn=require("react");function zo(){let[e,t]=(0,Bn.useState)([]),[r,n]=(0,Bn.useState)(!0);(0,Bn.useEffect)(()=>{if(typeof window>"u"){n(!1);return}let i=[],a=l=>{let{info:c}=l.detail;c?.rdns&&!i.some(u=>u.rdns===c.rdns)&&(i.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let s=setTimeout(()=>n(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(s)}},[]);let o=(0,Bn.useCallback)(i=>e.some(a=>a.rdns===i),[e]);return{wallets:e,isDetected:o,isLoading:r}}var mu=Q(require("@radix-ui/react-dialog"),1),gu=require("vaul");var Ji=require("react/jsx-runtime");function hu({asChild:e,children:t}){let{isMobile:r}=Bo(),n=r?gu.Drawer.Trigger:mu.Trigger;return(0,Ji.jsx)(ve,{feature:"wallet_connect",children:(0,Ji.jsx)(n,{asChild:e??t!=null,children:t??(0,Ji.jsx)("button",{type:"button","data-track":"open",children:"Connect Wallet"})})})}var Iu=require("react"),Mu=require("@nexus-cross/crossx-design-system"),Ur=Q(require("@radix-ui/react-dialog"),1),Oo=require("vaul");var ea=require("@nexus-cross/crossx-design-system");var be=require("react/jsx-runtime"),B0='<svg width="100%" height="100%" viewBox="0 0 640 640" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_75048_28969)"><rect width="640" height="640" rx="100" fill="white"/><path d="M640.092 -0.18042H0.0917969V639.82H640.092V-0.18042Z" fill="#CE3E35"/><path d="M43.6074 104.484C43.6074 71.3473 70.4703 44.4844 103.607 44.4844H536.393C569.53 44.4844 596.393 71.3473 596.393 104.484V346.514H43.6074V104.484Z" fill="white"/><g filter="url(#filter0_d_75048_28969)"><path d="M639.908 639.822H0.0917969V158.676C0.0917969 136.585 18.0004 118.676 40.0918 118.676H218.544C237.426 118.676 252.868 132.846 264.251 147.912C277.196 165.045 297.355 176.058 319.999 176.058C342.644 176.058 362.803 165.045 375.748 147.912C387.131 132.846 402.573 118.676 421.455 118.676H599.908C622 118.676 639.908 136.585 639.908 158.676V639.822Z" fill="url(#paint0_linear_75048_28969)"/></g><path d="M223.621 639.503H639.909V181.499L223.621 448.166V639.503Z" fill="url(#paint1_linear_75048_28969)"/><path d="M223.645 639.819H0.0917969V212.869L223.645 449.197V639.819Z" fill="url(#paint2_linear_75048_28969)"/><g filter="url(#filter1_d_75048_28969)"><path d="M317.103 250.341L228.024 301.829C212.311 310.864 206.867 331.162 215.899 346.881C224.93 362.6 245.221 368.046 260.933 359.01L336.28 315.444L300.401 353.936V504.934C300.401 523.129 315.247 537.981 333.434 537.981C351.621 537.981 366.468 523.129 366.468 504.934V278.932C366.468 272.62 364.489 266.431 362.014 262.347C352.735 246.752 332.692 241.182 316.979 250.217L317.103 250.341Z" fill="white"/></g></g><defs><filter id="filter0_d_75048_28969" x="-19.9082" y="93.6763" width="679.816" height="561.146" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="-5"/><feGaussianBlur stdDeviation="10"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0.892803 0 0 0 0 0.220099 0 0 0 0 0.293135 0 0 0 0.5 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_75048_28969"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_75048_28969" result="shape"/></filter><filter id="filter1_d_75048_28969" x="190.367" y="224.71" width="211.348" height="348.518" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.03953" dy="7.03953"/><feGaussianBlur stdDeviation="14.1039"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_75048_28969"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_75048_28969" result="shape"/></filter><linearGradient id="paint0_linear_75048_28969" x1="-74.0158" y1="54.6376" x2="542.251" y2="802.323" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_75048_28969" x1="159.749" y1="206.729" x2="471.286" y2="474.513" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_75048_28969" x1="399.134" y1="82.7297" x2="104.683" y2="466.123" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_75048_28969"><rect width="640" height="640" rx="100" fill="white"/></clipPath></defs></svg>',z0=`data:image/svg+xml,${encodeURIComponent(B0)}`;function $i(){return(0,be.jsx)("img",{src:z0,width:40,height:40,alt:"",style:{display:"block"}})}function bu(){return(0,be.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,be.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,be.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,be.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,be.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,be.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,be.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,be.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,be.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,be.jsx)("defs",{children:(0,be.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,be.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function wu(){return(0,be.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,be.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,be.jsx)("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),(0,be.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,be.jsx)("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),(0,be.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 yu(){return(0,be.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,be.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,be.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,be.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,be.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 xu(){return(0,be.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,be.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,be.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,be.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,be.jsx)("defs",{children:(0,be.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,be.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function vu(){return(0,be.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[(0,be.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,be.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,be.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,be.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 ku(){return(0,be.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,be.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 Ru(){return(0,be.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,be.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var ta={cross_embedded:{id:"cross_embedded",name:ea.WALLET_LABELS.social,description:"Sign in with Google or Apple",icon:$i},cross_wallet:{id:"cross_wallet",name:ea.WALLET_LABELS.app,description:"App approval is required",icon:$i,featured:!0},cross_extension:{id:"cross_extension",name:ea.WALLET_LABELS.extension,description:"Browser extension approval is required",icon:$i,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:bu,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:wu},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:yu,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:xu,badge:"For SHOP"}};function Es(e){return ta[e]}var ra={google:{id:"google",name:"Google",icon:vu},apple:{id:"apple",name:"Apple",icon:ku}};function Su(e){return ra[e]}var q=require("react/jsx-runtime");function Cu(e,t){Ae("connect","wallet_selected",{tags:{item_id:e}});let r=t?.();r instanceof Promise&&r.then(()=>Ae("connect","connected"),n=>Ae("connect","connected",{status:"failure",reason:ir(n)}))}function O0({wallet:e,detected:t,onConnect:r}){let n=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}r()},o=e.icon,i=e.featured===!0;return(0,q.jsxs)("button",{type:"button",className:Ie("wcm-wallet-item",i&&"wcm-wallet-item--featured"),"data-track":"wallet_item_click","data-track-id":e.id,onClick:n,children:[(0,q.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,q.jsx)("div",{className:"wcm-wallet-icon",children:(0,q.jsx)(o,{})}),(0,q.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,q.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,q.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?(0,q.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,q.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function F0({social:e,onSignIn:t}){let r=e.icon,n=`Sign in with ${e.name}`;return(0,q.jsxs)("button",{type:"button",className:"wcm-social-item","data-provider":e.id,"data-track":"social_provider_click","data-track-id":e.id,onClick:t,"aria-label":n,children:[(0,q.jsx)("span",{className:"wcm-social-icon",children:(0,q.jsx)(r,{})}),(0,q.jsx)("span",{className:"wcm-social-name",children:n})]})}function Nu(){let{wallets:e,activeWalletIds:t,socialProviders:r,activeSocialIds:n,termsUrl:o,privacyUrl:i,isDetected:a,close:s,isMobile:l}=Bo(),c=t.filter(h=>{let d=Es(h).visibility;return!d||d==="always"?!0:d==="desktop-only"?!l:d==="mobile-only"?l:!0}),u=n.length>0,b=c.length>0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"wcm-header",children:[(0,q.jsxs)("div",{className:"wcm-header-text",children:[(0,q.jsx)("h2",{className:"wcm-title",children:Mu.WALLET_LABELS.default}),!l&&(0,q.jsx)("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),(0,q.jsx)("button",{type:"button",className:"wcm-close-btn","data-track":"close",onClick:s,"aria-label":"Close",children:(0,q.jsx)(Ru,{})})]}),(0,q.jsxs)("div",{className:"wcm-body",children:[u&&(0,q.jsxs)(q.Fragment,{children:[!l&&(0,q.jsxs)("div",{className:"wcm-section-header",children:[(0,q.jsx)("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),(0,q.jsx)("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),(0,q.jsx)("div",{className:"wcm-social-grid",children:n.map(h=>{let d=Su(h);return(0,q.jsx)(F0,{social:d,onSignIn:()=>{Cu(h,r[h]),s()}},h)})}),b&&(0,q.jsxs)("div",{className:"wcm-separator",children:[(0,q.jsx)("div",{className:"wcm-separator-line"}),(0,q.jsx)("span",{className:"wcm-separator-text",children:"Other Wallets"}),(0,q.jsx)("div",{className:"wcm-separator-line"})]})]}),b&&(0,q.jsx)("div",{className:"wcm-wallet-list",children:c.map(h=>{let d=Es(h),y=d.rdns?a(d.rdns):!1;return(0,q.jsx)(O0,{wallet:d,detected:y,onConnect:()=>{Cu(h,e[h]),s()}},h)})}),(0,q.jsxs)("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",(0,q.jsx)(Tu,{href:o,track:"terms_link",children:"Terms of Service"})," ","and consent to its"," ",(0,q.jsx)(Tu,{href:i,track:"privacy_link",children:"Privacy Policy"}),"."]})]})]})}function Tu({href:e,track:t,children:r}){return e?(0,q.jsx)("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer","data-track":t,children:r}):(0,q.jsx)("span",{className:"wcm-terms-link",children:r})}function Eu({className:e}){let{isMobile:t,theme:r,portalStyle:n,open:o}=Bo();return(0,Iu.useEffect)(()=>{o&&Ae("connect","opened")},[o]),t?(0,q.jsx)(ve,{feature:"wallet_connect",children:(0,q.jsxs)(Oo.Drawer.Portal,{children:[(0,q.jsx)(Oo.Drawer.Overlay,{className:"wcm-overlay"}),(0,q.jsxs)(Oo.Drawer.Content,{className:Ie("wcm-drawer-content",e),"data-theme":r,style:n,children:[(0,q.jsx)(Oo.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,q.jsx)("div",{className:"wcm-drawer-handle"}),(0,q.jsx)("div",{className:"wcm-drawer-body",children:(0,q.jsx)(Nu,{})})]})]})}):(0,q.jsx)(ve,{feature:"wallet_connect",children:(0,q.jsxs)(Ur.Portal,{children:[(0,q.jsx)(Ur.Overlay,{className:"wcm-overlay"}),(0,q.jsxs)(Ur.Content,{className:Ie("wcm-dialog-content",e),"data-theme":r,style:n,children:[(0,q.jsx)(Ur.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,q.jsx)(Ur.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),(0,q.jsx)("div",{className:"wcm-dialog-body",children:(0,q.jsx)(Nu,{})})]})]})})}pe(`.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-system-orange-low, #fff5ee);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-orange-high, #e56f00);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:#ff8438;border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:#fff;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-content-high, rgba(0, 0, 0, .85));text-decoration:underline;text-underline-position:from-font}.wcm-terms-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));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}
18
+ `);pe(`@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)}}
19
+ `);var Jn=require("react/jsx-runtime"),U0={};function j0({wallets:e,socialProviders:t=U0,termsUrl:r,privacyUrl:n,theme:o="dark",mobileBreakpoint:i=768,drawerDirection:a="bottom",dialogWidth:s,drawerMaxWidth:l,drawerMinWidth:c,style:u,open:b,onOpenChange:h,children:d}){let y=_n(`(max-width: ${i}px)`),[f,m]=jr.useState(!1),w=b!==void 0,x=w?b:f,p=jr.useCallback(B=>{w||m(B),h?.(B)},[w,h]),k=jr.useCallback(()=>p(!1),[p]),{isDetected:R}=zo(),S=jr.useMemo(()=>Object.keys(e),[e]),T=jr.useMemo(()=>Object.keys(t),[t]),N=jr.useMemo(()=>{let B={};return s&&(B["--wcm-dialog-width"]=s),l&&(B["--wcm-drawer-max-width"]=l),c&&(B["--wcm-drawer-min-width"]=c),{...B,...u}},[s,l,c,u]),C=jr.useMemo(()=>({theme:o,isMobile:y,open:x,setOpen:p,close:k,wallets:e,activeWalletIds:S,socialProviders:t,activeSocialIds:T,termsUrl:r??Hn,privacyUrl:n??mi,isDetected:R,portalStyle:N}),[o,y,x,p,k,e,S,t,T,r,n,R,N]),M=(0,Jn.jsx)("div",{"data-theme":o,style:N,children:d});return y?(0,Jn.jsx)(Xi.Provider,{value:C,children:(0,Jn.jsx)(Lu.Drawer.Root,{direction:a,open:x,onOpenChange:p,noBodyStyles:!0,children:M},"drawer")}):(0,Jn.jsx)(Xi.Provider,{value:C,children:(0,Jn.jsx)(Au.Root,{open:x,onOpenChange:p,children:M})})}var As=Object.assign(j0,{Trigger:hu,Content:Eu});var Pu=require("@nexus-cross/crossx-design-system"),Bu=Q(require("react"),1);pe(`.cb-button{--cb-bg: var(--ds-accent-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));--cb-bg-hover: var(--cb-bg);--cb-color: #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}
20
+ `);pe(`.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)}}
21
+ `);var W0='<svg preserveAspectRatio="xMidYMid meet" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',_0='<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>',G0='<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>',H0='<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>',Q0='<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 Fo(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var Uo=Fo(W0),jo=Fo(_0),Wo=Fo(G0),_o=Fo(H0),Go=Fo(Q0);var xt=require("react/jsx-runtime");function Ls({isConnecting:e,address:t,provider:r,providerName:n,accountName:o,sendAccounts:i,onConnect:a,onDisconnect:s,onCopy:l,onSelectWallet:c,onBuy:u,onBuyDisabledMessage:b,label:h="Connect Wallet",connectingLabel:d="Connecting...",disconnectLabel:y,className:f,theme:m="dark",env:w,showBalance:x=!0,showPortfolio:p,drawerDirection:k,modal:R,connectorId:S,style:T,walletInfoStyle:N,sendTransaction:C,getTransactionReceipt:M,estimateGas:B,onReceive:W,onBridge:L,onSend:$,bridgeTokens:P,bridgeHistory:F,getBridgeQuote:de,getBridgeToTokens:V,getBridgeApproval:_,approveBridge:we,submitBridge:ee}){let Z=f?`cb-button ${f}`:"cb-button",j=f?`cb-pill ${f}`:"cb-pill";if(Bu.useEffect(()=>{wn(t)},[t]),e)return(0,xt.jsxs)("button",{type:"button",disabled:!0,className:Z,style:T,"aria-busy":"true",children:[(0,xt.jsx)("span",{className:"cb-spinner","aria-hidden":"true"}),(0,xt.jsx)("span",{className:"cb-button-label",children:d})]});if(t){let ie=n??K0(r),re=r?Y0[r]:void 0;return(0,xt.jsx)(ve,{feature:"connect_button",children:(0,xt.jsxs)(Pn,{env:w,theme:m,drawerDirection:k,modal:R,showBalance:x,showPortfolio:p,walletAddress:t,accountName:o,sendAccounts:i,connectorId:S,onSelectWallet:c,onCopyAddress:l?(Se,ye)=>{ye&&l()}:void 0,onDisconnect:s,disconnectLabel:y,style:N,sendTransaction:C,getTransactionReceipt:M,estimateGas:B,onReceive:W,onBridge:L,onBuy:u,onBuyDisabledMessage:b,onSend:$,bridgeTokens:P,bridgeHistory:F,getBridgeQuote:de,getBridgeToTokens:V,getBridgeApproval:_,approveBridge:we,submitBridge:ee,children:[(0,xt.jsx)(Pn.Trigger,{asChild:!0,children:(0,xt.jsxs)("button",{type:"button",className:j,"data-track":"wallet_pill_open",style:T,"aria-label":`Connected with ${ie}: ${Du(t)}`,children:[re?(0,xt.jsx)("img",{src:re,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":r}):(0,xt.jsx)("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),(0,xt.jsx)("span",{className:"cb-pill-address",children:Du(t)})]})}),(0,xt.jsx)(Pn.Content,{align:"end",sideOffset:8})]})})}return(0,xt.jsx)(ve,{feature:"connect_button",children:(0,xt.jsxs)("button",{type:"button",onClick:a,className:Z,"data-track":"connect_click",style:T,"aria-label":typeof h=="string"?h:"Connect Wallet",children:[(0,xt.jsx)(V0,{}),(0,xt.jsx)("span",{className:"cb-button-label",children:h})]})})}function V0(){return(0,xt.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,xt.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,xt.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,xt.jsx)("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var Y0={google:_o,apple:Go,cross:Uo,metamask:jo,binance:Wo},q0={google:"Google",apple:"Apple",cross:Pu.WALLET_LABELS.default,metamask:"MetaMask",binance:"Binance Wallet"};function K0(e){return e?q0[e]:"Wallet"}function Du(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var zu=Q(require("react"),1);pe(`.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)}
22
+ `);pe(`.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)}}
23
+ `);var Jr=require("react/jsx-runtime"),Ds="https://www.onechain.nexus/skills";function Ps({label:e="Skills",href:t,onClick:r,className:n,style:o,theme:i,disabled:a=!1,isLoading:s=!1,loadingLabel:l="Loading...",openInNewTab:c=!1,type:u="button"}){let[b,h]=zu.useState(!1),d=Xe(),y=Sr("apps.json",d,R=>cr(R?.skills,d)),f=t??y,m=async R=>{if(f&&!r){c?window.open(f,"_blank","noopener,noreferrer"):window.location.href=f;return}if(r)try{h(!0),await r()}finally{h(!1)}},w=a||s||b,x=s||b,p=x?l:e,k=n?`sb-button ${n}`:"sb-button";return(0,Jr.jsx)(ve,{feature:"skills",children:(0,Jr.jsxs)("button",{type:u,onClick:m,disabled:w,className:k,"data-theme":i,"data-track":"click",style:o,"aria-busy":x,children:[x?(0,Jr.jsx)("span",{className:"sb-spinner","aria-hidden":"true"}):(0,Jr.jsx)(Z0,{}),(0,Jr.jsx)("span",{className:"sb-label",children:p})]})})}function Z0(){return(0,Jr.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,Jr.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"})})}var xa=Q(require("react"),1);var na=require("react"),Bs=(0,na.createContext)(null);function Ho(){let e=(0,na.useContext)(Bs);if(!e)throw new Error("RelayDeposit compound components must be used within <RelayDeposit>");return e}var sf=Q(require("react"),1);var oa=require("react"),ia=(0,oa.createContext)(null);function Er(){let e=(0,oa.useContext)(ia);if(!e)throw new Error("ResponsiveShell compound components must be used within <ResponsiveShell>");return e}var pn=require("react");function Ou(){let e=null,t=new Set;return{getSnapshot:()=>e,publish(r){if(r!==e){e=r;for(let n of[...t])n()}},subscribe(r){return t.add(r),()=>{t.delete(r)}}}}var zs=(0,pn.createContext)(null);function X0(){let e=(0,pn.useContext)(zs);if(!e)throw new Error("RelayDeposit compound components must be used within <RelayDeposit>");return e}function Fu(){let e=X0(),[t,r]=(0,pn.useState)(e.getSnapshot);return(0,pn.useLayoutEffect)(()=>(r(e.getSnapshot()),e.subscribe(()=>r(e.getSnapshot()))),[e]),t}var qo=require("react");var Qo="0x0000000000000000000000000000000000000000",J0=/^0x[0-9a-fA-F]{40}$/;function At(e){return J0.test(e)}function gt(e,t){let r=e<0n,o=(r?-e:e).toString().padStart(t+1,"0"),i=t===0?o:o.slice(0,-t),a=t===0?"":o.slice(-t).replace(/0+$/,""),s=a?`${i}.${a}`:i;return r?`-${s}`:s}function aa(e,t){let r=e.match(/^(-?)(\d+)(?:\.(\d+))?$/);if(!r)throw new Error(`parseUnits: invalid decimal string "${e}"`);let[,n,o,i=""]=r;if(i.length>t)throw new Error(`parseUnits: too many decimal places for ${t} decimals`);let a=BigInt(o+i.padEnd(t,"0"));return n==="-"?-a:a}var Nt=require("react");var Wr=class extends Error{constructor(t,r,n){super(r),this.name="RelayApiError",this.status=t,this.body=n}};function rr(e){let t=e.baseUrl.replace(/\/+$/,"");async function r(n,o){let i={...o?.headers};o?.body!=null&&(i["Content-Type"]="application/json");let a;try{a=await fetch(`${t}${n}`,{...o,headers:i})}catch(l){throw new Wr(0,`network error calling ${n}: ${l.message}`)}let s=await a.text();if(!a.ok){let l=`request to ${n} failed with status ${a.status}`,c;try{c=JSON.parse(s);let u=c;u?.error&&(l=u.error)}catch{c=s||void 0}throw new Wr(a.status,l,c)}try{return JSON.parse(s)}catch{throw new Wr(a.status,`expected a JSON response from ${n} but got ${s?"a non-JSON body":"an empty body"}`,s||void 0)}}return{getConfig(){return r("/v1/config").then(n=>({...n,targets:n.targets??[]}))},getQuote(n){return r("/v1/quote",{method:"POST",body:JSON.stringify(n)})},getDepositAddress(n,o){let i=new URLSearchParams({user:n.user,originChainId:String(n.originChainId),originCurrency:n.originCurrency});return o&&i.set("target",o),r(`/v1/deposit-address?${i.toString()}`)},getOrder(n){return r(`/v1/orders/${encodeURIComponent(n)}`)},listOrders(n){let o=new URLSearchParams({user:n});return r(`/v1/orders?${o.toString()}`).then(i=>i.orders??[])},ordersStreamUrl(n){return`${t}/v1/orders/stream?user=${encodeURIComponent(n)}`},getRecovery(n){let o=new URLSearchParams({user:n.user});return n.target&&o.set("target",n.target),r(`/v1/recovery?${o.toString()}`)}}}var Uu=[{type:"function",name:"deploy",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"version",type:"uint256"}],outputs:[{name:"",type:"address"}]}],Os=[{type:"function",name:"execute",stateMutability:"nonpayable",inputs:[],outputs:[]},{type:"function",name:"sweepToUser",stateMutability:"nonpayable",inputs:[{name:"tokenAddr",type:"address"}],outputs:[]}],Fs=[{type:"function",name:"computeAddress",stateMutability:"view",inputs:[{name:"recipient",type:"address"},{name:"version",type:"uint256"}],outputs:[{name:"",type:"address"}]}];var un=["0x486BEEc35A9a9915213Ea02AD3709738335F7702","0x3438735303911aBe113AdF14b18eE730cC24893b","0xA3B548Ab23043e6B24A087515fe1306379683533","0x44317d07378390543d99Ee76374E86C1Ef6cF832"];function sa(e,t){return!e||!t?!1:e.toLowerCase()===t.toLowerCase()}function $0(e,t){return t.some(r=>sa(r,e))}function la(e){if(!e||e.length===0)return un;let t=new Set(un.map(n=>n.toLowerCase())),r=[...un];for(let n of e){if(typeof n!="string"||!At(n))continue;let o=n.toLowerCase();t.has(o)||(t.add(o),r.push(n))}return r}async function ju(e,t,{factory:r,forwarder:n,recipient:o,version:i,trusted:a=un}){if(!r||!n||!o||i===void 0)return{ok:!1,reason:"address verification is missing inputs (factory/forwarder/recipient/version)"};if(!$0(r,a))return{ok:!1,reason:`factory ${r} is not a recognized deposit-address factory -- refusing to sign against it`};if(!e)return{ok:!1,reason:"no chain connection available to verify the forwarder address"};let s;try{s=await e({chainId:t,address:r,abi:Fs,functionName:"computeAddress",args:[o,BigInt(i)]})}catch(l){return{ok:!1,reason:`could not verify the forwarder address on-chain: ${l instanceof Error?l.message:String(l)}`}}return sa(s,n)?{ok:!0}:{ok:!1,reason:`forwarder address mismatch: the API returned ${n}, but factory ${r} derives ${s} for this account -- refusing to sign`}}async function Wu(e,t,{forwarder:r,recipient:n,version:o,trusted:i=un}){if(!r||!n||o===void 0)return{ok:!1,reason:"address verification is missing inputs (forwarder/recipient/version)"};if(!e)return{ok:!1,reason:"no BSC chain connection available to verify the deposit forwarder -- add BNB Smart Chain (chain 56) to your wagmi config"};let a=await Promise.all(i.map(async s=>{try{return await e({chainId:t,address:s,abi:Fs,functionName:"computeAddress",args:[n,BigInt(o)]})}catch{return}}));return a.some(s=>sa(s,r))?{ok:!0}:a.every(s=>s===void 0)?{ok:!1,reason:"could not reach any deposit-address factory on BSC to verify the forwarder"}:{ok:!1,reason:`forwarder address mismatch: ${r} is not the address any known factory derives for this account -- refusing to deposit`}}function _u(e,t){return sa(e,t)}var fn=56,Us={step:"idle"};function eb(e){return e.tokens?.find(t=>t.recoverable)?.address??e.token}function js(e={}){let t=(0,Nt.useRef)(e);t.current=e;let r=e.wallet,n=r?.walletChainId,o=e.recipient,i=o&&At(o)?o:void 0,[a,s]=(0,Nt.useState)({}),l=(0,Nt.useCallback)((h,d)=>{s(y=>({...y,[h.toLowerCase()]:d}))},[]),c=(0,Nt.useCallback)(h=>h?a[h.toLowerCase()]??Us:Us,[a]),u=(0,Nt.useMemo)(()=>Object.values(a).some(h=>h.step==="switching"||h.step==="deploying"||h.step==="recovering"),[a]);return{recover:(0,Nt.useCallback)(async(h,d,y)=>{if(!i||!h?.forwarder)return;let f=h.forwarder;l(f,{step:"switching"});try{if(n!==fn){if(!r?.switchChain)throw new Error("wallet cannot switch chains");await r.switchChain(fn)}if(!r?.writeContract||!r?.readContract||!r?.waitForReceipt)throw new Error("wallet is missing contract capabilities required for recovery");let m=await ju(r.readContract,fn,{factory:h.factory,forwarder:h.forwarder,recipient:i,version:h.version,trusted:t.current.trustedFactories});if(!m.ok)throw new Error(`address verification failed: ${m.reason}`);let w;if(!h.isDeployed){if(l(f,{step:"deploying"}),w=await r.writeContract({address:h.factory,abi:Uu,functionName:"deploy",args:[i,BigInt(h.version)],chainId:fn}),l(f,{step:"deploying",deployTxHash:w}),(await r.waitForReceipt({chainId:fn,hash:w})).status==="reverted")throw new Error(`forwarder deploy reverted on-chain (tx ${w})`);t.current.onChanged?.()}l(f,{step:"recovering",deployTxHash:w});let x=d==="execute"?await r.writeContract({address:h.forwarder,abi:Os,functionName:"execute",args:[],chainId:fn}):await r.writeContract({address:h.forwarder,abi:Os,functionName:"sweepToUser",args:[y??eb(h)],chainId:fn});if(l(f,{step:"recovering",deployTxHash:w,actionTxHash:x}),(await r.waitForReceipt({chainId:fn,hash:x})).status==="reverted")throw new Error(`recovery transaction reverted on-chain (tx ${x})`);l(f,{step:"done",deployTxHash:w,actionTxHash:x}),t.current.onChanged?.()}catch(m){let w=m instanceof Error?m:new Error(String(m));s(x=>{let p=f.toLowerCase();return{...x,[p]:{...x[p]??Us,step:"error",error:w.message}}}),t.current.onError?.(w)}},[i,n,r,l]),stateFor:c,busy:u}}function Gu(e={}){let t=(0,Nt.useRef)(e);t.current=e;let r=(0,Nt.useMemo)(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useRecovery: either `client` or `apiBaseUrl` must be provided");return rr({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.recipient,o=n&&At(n)?n:void 0,[i,a]=(0,Nt.useState)(),[s,l]=(0,Nt.useState)(!1),[c,u]=(0,Nt.useState)(),[b,h]=(0,Nt.useState)(0),d=e.target,y=e.enabled??!0;(0,Nt.useEffect)(()=>{if(!o||!y){a(void 0),u(void 0),l(!1);return}let p=!1;return l(!0),r.getRecovery({user:o,target:d}).then(k=>{p||(a(k),u(void 0))}).catch(k=>{if(p)return;let R=k instanceof Error?k:new Error(String(k));a(void 0),u(R),t.current.onError?.(R),R instanceof Wr&&R.status===401&&t.current.onUnauthorized?.()}).finally(()=>{p||l(!1)}),()=>{p=!0}},[r,o,b,d,y]);let f=(0,Nt.useCallback)(()=>h(p=>p+1),[]),m=js({recipient:e.recipient,wallet:e.wallet,trustedFactories:e.trustedFactories,onError:e.onError,onChanged:f}),w=(0,Nt.useCallback)(async(p,k)=>{i&&await m.recover(i,p,k)},[m,i]),x=m.stateFor(i?.forwarder);return{info:i,loading:s,error:c,refresh:f,recover:w,recoveryState:x}}var tb="BSC_FUNDED";function Hu(e){if(!e)return 0n;try{let t=BigInt(e);return t>0n?t:0n}catch{return 0n}}function rb(e,t){return e.target||t}function $n(e,t=[]){let r=e.find(o=>o.isDefault)?.symbol,n=new Map;for(let o of e){if(!o.info?.forwarder)continue;let i=o.info.forwarder.toLowerCase(),a=n.get(i);if(a){a.targets.push(o.symbol);continue}n.set(i,{forwarder:o.info.forwarder,targets:[o.symbol],info:o.info,deposits:[],depositsTotal:0n})}for(let o of n.values()){let i=new Set(o.targets);for(let a of t){if(a.status!==tb)continue;let s=rb(a,r);if(!(!s||!i.has(s)))for(let l of a.deposits??[])o.deposits.push({amount:l.amount,originChainId:l.originChainId,originTxHash:l.originTxHash,txHash:l.txHash,blockNumber:l.blockNumber}),o.depositsTotal+=Hu(l.amount)}o.deposits.sort((a,s)=>a.blockNumber-s.blockNumber)}return[...n.values()]}function Qu(e){return e.filter(t=>(t.info.tokens??[]).some(r=>r.recoverable)?!0:Hu(t.info.balance)>0n&&t.info.suggestedAction!=="none")}function ca(e){return e.reduce((t,r)=>t+(r.info.tokens??[]).filter(n=>n.recoverable).length,0)}var Vu={1:{base:"https://etherscan.io",name:"Etherscan",kind:"evm"},56:{base:"https://bscscan.com",name:"BscScan",kind:"evm"},137:{base:"https://polygonscan.com",name:"PolygonScan",kind:"evm"},8453:{base:"https://basescan.org",name:"BaseScan",kind:"evm"},42161:{base:"https://arbiscan.io",name:"Arbiscan",kind:"evm"},612055:{base:"https://scan.crosstoken.io",name:"ONEchain Scan",kind:"evm"},792703809:{base:"https://solscan.io",name:"Solscan",kind:"svm"}};function Yu(e,t){let r=Vu[e];if(!(!r||!t))return{url:`${r.base}/token/${t}`,name:r.name}}var nb={1:"Ethereum",56:"BNB Smart Chain",137:"Polygon",8453:"Base",42161:"Arbitrum",612055:"ONEchain",792703809:"Solana"};function Vo(e){return nb[e]??`Chain ${e}`}function da(e,t){let r=Vu[e];if(!(!r||!t))return{url:`${r.base}/tx/${t}`,name:r.name}}var $r=require("react");var ob="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTQwIDU0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzc0MDAwXzM4NTkwKSI+CjxtYXNrIGlkPSJtYXNrMF83NDAwMF8zODU5MCIgc3R5bGU9Im1hc2stdHlwZTpsdW1pbmFuY2UiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSI1NDAiIGhlaWdodD0iNTQwIj4KPHBhdGggZD0iTTI3MCAwQzU2Ljg1NjMgMCAwIDU2Ljg1NjMgMCAyNzBDMCA0ODMuMTQ0IDU2Ljg1NjMgNTQwIDI3MCA1NDBDNDgzLjE0NCA1NDAgNTQwIDQ4My4xNDQgNTQwIDI3MEM1NDAgNTYuODU2MyA0ODMuMTQ0IDAgMjcwIDBaIiBmaWxsPSJ3aGl0ZSIvPgo8L21hc2s+CjxnIG1hc2s9InVybCgjbWFzazBfNzQwMDBfMzg1OTApIj4KPHBhdGggZD0iTTUzOS43MzEgMC4yNzA1MDhIMFY1NDAuMDAxSDUzOS43MzFWMC4yNzA1MDhaIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNzQwMDBfMzg1OTApIi8+CjxwYXRoIGQ9Ik0xODguNjIzIDU0MC4wMDFINTM5Ljg2NVYxMDIuOTM2TDE4OC42MjMgMzI3LjkzNlY1NDAuMDAxWiIgZmlsbD0idXJsKCNwYWludDFfbGluZWFyXzc0MDAwXzM4NTkwKSIvPgo8cGF0aCBkPSJNMTg4LjYyMyA1NDAuMDAySDBWMTI4LjUzNUwxODguNjIzIDMyNy45MzZWNTQwLjAwMloiIGZpbGw9InVybCgjcGFpbnQyX2xpbmVhcl83NDAwMF8zODU5MCkiLz4KPC9nPgo8cGF0aCBkPSJNMTQ3Ljg4NCA0MDMuNDkzQzEzOC4wMjUgNDAzLjQ5MyAxMjkuMjk2IDQwMS40MzkgMTIxLjY5NiAzOTcuMzMxQzExNC4wOTYgMzkzLjEyIDEwOC4xNCAzODcuMzY5IDEwMy44MjYgMzgwLjA3N0M5OS42MTU1IDM3Mi43ODYgOTcuNTEwMiAzNjQuNTcgOTcuNTEwMiAzNTUuNDI5VjI5OC44NjZDOTcuNTEwMiAyOTYuNDk5IDk5LjQyOSAyOTQuNTggMTAxLjc5NiAyOTQuNThIMTEzLjQwNUMxMTUuNzcyIDI5NC41OCAxMTcuNjkxIDI5Ni40OTkgMTE3LjY5MSAyOTguODY2VjM1NC41MDVDMTE3LjY5MSAzNjAuMzU5IDExOS4wMjYgMzY1LjU5NyAxMjEuNjk2IDM3MC4yMThDMTI0LjM2NiAzNzQuNzM3IDEyOC4wMTIgMzc4LjMzMSAxMzIuNjM0IDM4MS4wMDJDMTM3LjI1NSAzODMuNTY5IDE0Mi4zMzkgMzg0Ljg1MyAxNDcuODg0IDM4NC44NTNDMTUzLjg0MSAzODQuODUzIDE1OS4xODEgMzgzLjU2OSAxNjMuOTA2IDM4MS4wMDJDMTY4LjYzIDM3OC4zMzEgMTcyLjMyNyAzNzQuNzM3IDE3NC45OTcgMzcwLjIxOEMxNzcuNjY3IDM2NS41OTcgMTc5LjAwMiAzNjAuMzU5IDE3OS4wMDIgMzU0LjUwNVYyOTguODY2QzE3OS4wMDIgMjk2LjQ5OSAxODAuOTIxIDI5NC41OCAxODMuMjg4IDI5NC41OEgxOTQuMTI3QzE5Ni40OTQgMjk0LjU4IDE5OC40MTMgMjk2LjQ5OSAxOTguNDEzIDI5OC44NjZWMzU1LjQyOUMxOTguNDEzIDM2NC41NyAxOTYuMjU2IDM3Mi43ODYgMTkxLjk0MyAzODAuMDc3QzE4Ny43MzIgMzg3LjM2OSAxODEuODI3IDM5My4xMiAxNzQuMjI3IDM5Ny4zMzFDMTY2LjczIDQwMS40MzkgMTU3Ljk0OSA0MDMuNDkzIDE0Ny44ODQgNDAzLjQ5M1oiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0yNjcuNjU3IDQwNC4xMDlDMjYwLjM2NSA0MDQuMTA5IDI1My42MzggNDAzLjMzOSAyNDcuNDc2IDQwMS43OThDMjQxLjQxNyA0MDAuMTU1IDIzNS44NzEgMzk3Ljg0NCAyMzAuODM5IDM5NC44NjZDMjI2Ljg3MiAzOTIuNDY5IDIyMy4yMDQgMzg5LjU3NCAyMTkuODM2IDM4Ni4xNzlDMjE4LjM5OCAzODQuNzMxIDIxOC4zMjEgMzgyLjQ0OSAyMTkuNTUgMzgwLjgyMUwyMjYuMTg2IDM3Mi4wM0MyMjcuODAzIDM2OS44ODggMjMwLjk2MyAzNjkuNzUxIDIzMi44ODMgMzcxLjYyNkMyMzcuOTUzIDM3Ni41NzYgMjQzLjAyMyAzODAuMjE1IDI0OC4wOTIgMzgyLjU0MkMyNTQuNDYgMzg1LjMxNSAyNjEuMjg5IDM4Ni43MDIgMjY4LjU4MSAzODYuNzAyQzI3Mi43OTIgMzg2LjcwMiAyNzYuNzQ2IDM4Ni4xODggMjgwLjQ0MyAzODUuMTYxQzI4NC4yNDMgMzg0LjAzMSAyODcuMzI0IDM4Mi40MzkgMjg5LjY4NiAzODAuMzg1QzI5Mi4xNTEgMzc4LjIyOSAyOTMuMzgzIDM3NS42MSAyOTMuMzgzIDM3Mi41MjlDMjkzLjM4MyAzNzAuNDc1IDI5Mi43NjcgMzY4LjcyOSAyOTEuNTM0IDM2Ny4yOTFDMjkwLjQwNSAzNjUuNzUxIDI4OC44MTMgMzY0LjQ2NyAyODYuNzU5IDM2My40NEMyODQuODA4IDM2Mi4zMSAyODIuNTQ4IDM2MS4zODYgMjc5Ljk4MSAzNjAuNjY3QzI3Ny40MTMgMzU5Ljk0OCAyNzQuNzQzIDM1OS4zMzIgMjcxLjk3IDM1OC44MTlDMjY5LjE5NyAzNTguMzA1IDI2Ni40MjQgMzU3Ljg0MyAyNjMuNjUxIDM1Ny40MzJDMjU3LjE4MSAzNTYuNDA1IDI1MS40MyAzNTUuMDcgMjQ2LjM5OCAzNTMuNDI3QzI0MS4zNjUgMzUxLjY4MSAyMzcuMTAzIDM0OS40NzMgMjMzLjYxMiAzNDYuODAzQzIzMC4xMiAzNDQuMTMyIDIyNy40NSAzNDEgMjI1LjYwMSAzMzcuNDA2QzIyMy44NTUgMzMzLjgxMSAyMjIuOTgyIDMyOS42NTIgMjIyLjk4MiAzMjQuOTI4QzIyMi45ODIgMzE5Ljk5OCAyMjQuMTEyIDMxNS41ODIgMjI2LjM3MSAzMTEuNjc5QzIyOC42MzEgMzA3LjY3NCAyMzEuODE0IDMwNC4yODUgMjM1LjkyMiAzMDEuNTEyQzI0MC4wMyAyOTguNzM5IDI0NC43NTUgMjk2LjYzNCAyNTAuMDk1IDI5NS4xOTZDMjU1LjUzOCAyOTMuNjU2IDI2MS40NDMgMjkyLjg4NSAyNjcuODExIDI5Mi44ODVDMjc0LjU4OSAyOTIuODg1IDI4MC43IDI5My42MDQgMjg2LjE0MyAyOTUuMDQyQzI5MS42ODggMjk2LjQ4IDI5Ni41NjcgMjk4LjU4NSAzMDAuNzc3IDMwMS4zNThDMzAzLjkzOCAzMDMuMzYzIDMwNi43MjMgMzA1LjY4NiAzMDkuMTMyIDMwOC4zMjdDMzEwLjUyMiAzMDkuODUyIDMxMC40IDMxMi4xNjkgMzA5LjAxMSAzMTMuNjk2TDMwMi4yNDEgMzIxLjEzNUMzMDAuNDkgMzIzLjA1OCAyOTcuNDUzIDMyMi45NzMgMjk1LjU0OCAzMjEuMjAzQzI5My44MzkgMzE5LjYxNCAyOTEuOTg3IDMxOC4xODYgMjg5Ljk5NCAzMTYuOTE3QzI4Ni43MDcgMzE0Ljc2IDI4My4xNjQgMzEzLjE2OCAyNzkuMzY0IDMxMi4xNDFDMjc1LjU2NSAzMTEuMDEyIDI3MS41NTkgMzEwLjQ0NyAyNjcuMzQ5IDMxMC40NDdDMjYyLjgzIDMxMC40NDcgMjU4LjgyNCAzMTAuOTYgMjU1LjMzMyAzMTEuOTg3QzI1MS44NDEgMzEzLjAxNCAyNDkuMDY4IDMxNC41MDQgMjQ3LjAxNCAzMTYuNDU1QzI0NC45NiAzMTguNDA2IDI0My45MzMgMzIwLjc2OCAyNDMuOTMzIDMyMy41NDFDMjQzLjkzMyAzMjUuODAxIDI0NC42MDEgMzI3LjgwMyAyNDUuOTM2IDMyOS41NDlDMjQ3LjI3MSAzMzEuMTkyIDI0OS4xMTkgMzMyLjYzIDI1MS40ODEgMzMzLjg2MkMyNTMuOTQ2IDMzNC45OTIgMjU2LjgyMiAzMzUuOTY4IDI2MC4xMDggMzM2Ljc4OUMyNjMuMzk1IDMzNy41MDggMjY2Ljk4OSAzMzguMTc2IDI3MC44OTIgMzM4Ljc5MkMyNzYuODQ4IDMzOS43MTYgMjgyLjQ0NSAzNDAuODk3IDI4Ny42ODMgMzQyLjMzNUMyOTIuOTIxIDM0My43NzMgMjk3LjU0MiAzNDUuNjczIDMwMS41NDggMzQ4LjAzNUMzMDUuNTUzIDM1MC4yOTQgMzA4LjYzNCAzNTMuMTcgMzEwLjc5MSAzNTYuNjYyQzMxMy4wNSAzNjAuMDUxIDMxNC4xOCAzNjQuMzEzIDMxNC4xOCAzNjkuNDQ4QzMxNC4xOCAzNzYuNTM0IDMxMi4yMjggMzgyLjY5NiAzMDguMzI2IDM4Ny45MzRDMzA0LjQyMyAzOTMuMDY5IDI5OC45OCAzOTcuMDc0IDI5MS45OTYgMzk5Ljk1QzI4NS4xMTYgNDAyLjcyMyAyNzcuMDAyIDQwNC4xMDkgMjY3LjY1NyA0MDQuMTA5WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTM0Mi43NjkgNDAyLjU2OUMzNDAuNDAyIDQwMi41NjkgMzM4LjQ4MyA0MDAuNjUgMzM4LjQ4MyAzOTguMjgzVjI5OS4wMkMzMzguNDgzIDI5Ni42NTMgMzQwLjQwMiAyOTQuNzM0IDM0Mi43NjkgMjk0LjczNEgzODUuMzM1QzM5NC4zNzIgMjk0LjczNCA0MDIuNDM0IDI5Ni4xMiA0MDkuNTIxIDI5OC44OTNDNDE2LjYwNyAzMDEuNTYzIDQyMi42MTUgMzA1LjM2MyA0MjcuNTQ0IDMxMC4yOTNDNDMyLjQ3NCAzMTUuMjIyIDQzNi4xNzEgMzIwLjk3NCA0MzguNjM2IDMyNy41NDZDNDQxLjIwMyAzMzQuMDE3IDQ0Mi40ODcgMzQxLjA1MSA0NDIuNDg3IDM0OC42NTFDNDQyLjQ4NyAzNTYuMzU0IDQ0MS4yMDMgMzYzLjQ5MSA0MzguNjM2IDM3MC4wNjRDNDM2LjE3MSAzNzYuNTM0IDQzMi40NzQgMzgyLjIzNCA0MjcuNTQ0IDM4Ny4xNjRDNDIyLjYxNSAzOTEuOTkxIDQxNi42MDcgMzk1Ljc5IDQwOS41MjEgMzk4LjU2M0M0MDIuNDM0IDQwMS4yMzQgMzk0LjM3MiA0MDIuNTY5IDM4NS4zMzUgNDAyLjU2OUgzNDIuNzY5Wk0zNTguNTEgMzg0LjY2M0MzNTguNTEgMzg1LjI2OCAzNTcuNjk4IDM4NS40NjggMzU3LjQxNiAzODQuOTMzQzM1Ny4yMTMgMzg0LjU0NyAzNTcuNDkzIDM4NC4wODMgMzU3LjkzIDM4NC4wODNIMzg0LjU2NEMzOTAuODI5IDM4NC4wODMgMzk2LjI3MiAzODMuMjEgNDAwLjg5NCAzODEuNDY0QzQwNS42MTggMzc5LjYxNSA0MDkuNTIxIDM3Ny4wOTkgNDEyLjYwMiAzNzMuOTE1QzQxNS42ODMgMzcwLjczMiA0MTcuOTQyIDM2Ny4wMzUgNDE5LjM4IDM2Mi44MjRDNDIwLjkyIDM1OC41MSA0MjEuNjkgMzUzLjc4NiA0MjEuNjkgMzQ4LjY1MUM0MjEuNjkgMzQzLjYxOSA0MjAuOTIgMzM4Ljk5NyA0MTkuMzggMzM0Ljc4N0M0MTcuOTQyIDMzMC40NzMgNDE1LjYzMSAzMjYuNzI1IDQxMi40NDcgMzIzLjU0MUM0MDkuMzY3IDMyMC4yNTUgNDA1LjUxNSAzMTcuNzM5IDQwMC44OTQgMzE1Ljk5M0MzOTYuMjcyIDMxNC4xNDQgMzkwLjgyOSAzMTMuMjIgMzg0LjU2NCAzMTMuMjJIMzU3Ljg0N0MzNTcuMjk5IDMxMy4yMiAzNTYuOTg4IDMxMi41OTEgMzU3LjMyMSAzMTIuMTU1QzM1Ny43MDYgMzExLjY1MiAzNTguNTEgMzExLjkyNCAzNTguNTEgMzEyLjU1N1YzODQuNjYzWiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTI1NS4wNiA4NS4zNzAxTDIwNS4zODkgMTE0LjA2OUMxOTYuNjI4IDExOS4xMDUgMTkzLjU5MiAxMzAuNDE5IDE5OC42MjggMTM5LjE4QzIwMy42NjQgMTQ3Ljk0MiAyMTQuOTc4IDE1MC45NzcgMjIzLjc0IDE0NS45NDFMMjY1Ljc1MyAxMjEuNjU3TDI0NS43NDcgMTQzLjExM1YyMjcuMjc3QzI0NS43NDcgMjM3LjQxOCAyNTQuMDI1IDI0NS42OTcgMjY0LjE2NiAyNDUuNjk3QzI3NC4zMDcgMjQ1LjY5NyAyODIuNTg2IDIzNy40MTggMjgyLjU4NiAyMjcuMjc3VjEwMS4zMDZDMjgyLjU4NiA5Ny43ODc4IDI4MS40ODIgOTQuMzM4NSAyODAuMTAyIDkyLjA2MTlDMjc0LjkyOCA4My4zNjk1IDI2My43NTIgODAuMjY1IDI1NC45OTEgODUuMzAxMUwyNTUuMDYgODUuMzcwMVoiIGZpbGw9IndoaXRlIi8+CjwvZz4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl83NDAwMF8zODU5MCIgeDE9Ii02Mi41MTUiIHkxPSItNjQuODA0MyIgeDI9IjU3NS40MzQiIHkyPSI1NzcuNzI2IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGMzc1MkQiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRUMxMjcyIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQxX2xpbmVhcl83NDAwMF8zODU5MCIgeDE9IjEzNC43MzEiIHkxPSIxMjQuMjIzIiB4Mj0iMzk3LjU5IiB5Mj0iMzUwLjE2NiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSJ3aGl0ZSIgc3RvcC1vcGFjaXR5PSIwLjUiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSJ3aGl0ZSIgc3RvcC1vcGFjaXR5PSIwIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQyX2xpbmVhcl83NDAwMF8zODU5MCIgeDE9IjMzNi42OTIiIHkxPSIxOC43Mjk1IiB4Mj0iODguMjQ4NSIgeTI9IjM0Mi4yMTgiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0id2hpdGUiIHN0b3Atb3BhY2l0eT0iMC41Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0id2hpdGUiIHN0b3Atb3BhY2l0eT0iMCIvPgo8L2xpbmVhckdyYWRpZW50Pgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzc0MDAwXzM4NTkwIj4KPHJlY3Qgd2lkdGg9IjU0MCIgaGVpZ2h0PSI1NDAiIHJ4PSIyNzAiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==",ib="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAwIiBoZWlnaHQ9IjMwMCIgdmlld0JveD0iMCAwIDMwMCAzMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xNTAgMzAwQzIzMi44NDMgMzAwIDMwMCAyMzIuODQzIDMwMCAxNTBDMzAwIDY3LjE1NzMgMjMyLjg0MyAwIDE1MCAwQzY3LjE1NzMgMCAwIDY3LjE1NzMgMCAxNTBDMCAyMzIuODQzIDY3LjE1NzMgMzAwIDE1MCAzMDBaIiBmaWxsPSJibGFjayIvPgo8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNTAsMTUwKSBzY2FsZSgwLjg1KSB0cmFuc2xhdGUoLTE1MCwtMTUwKSI+CjxwYXRoIGQ9Ik0xNjYuOTkzIDM2LjMyMFY1OS41ODVIMjAwLjM3OEwyMjIuNjgwIDgxLjg4N1YxMDcuNzc1SDE5MC4xMzJWOTIuMTMySDEwOS44NjlWMTMzLjcyNkgxOTMuMzE3TDIyMi42ODAgMTYzLjA4N0wyMjIuNjgxIDIwNi42MzZWMjE3LjkzOEwyMDEuNDM2IDIzOS4xODNIMTY4Ljg1OFYyNjMuNjgwSDE0MC4yNDFWMjM5LjE4M0g5OC41NjRMNzcuMzIwIDIxNy45MzlWMTkxLjM3M0gxMDkuODY5VjIwNi42MzZIMTkwLjEzMlYxNjYuMjc0SDEwMS44NTRMNzcuMzIwIDE0MS43NDBWODEuODg3TDk5LjYyMiA1OS41ODVIMTQwLjI0MVYzNi4zMjBIMTY2Ljk5M1oiIGZpbGw9IiNGQjg1MjQiLz4KPC9nPgo8L3N2Zz4K",ab="data:image/png;base64,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",sb="data:image/png;base64,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";function qu(e){switch(e.toUpperCase()){case"ONEUSD":return ob;case"PONEUSD":return ib;case"USDT":return ab;case"USDC":return sb;default:return}}var U=require("react/jsx-runtime");function Ku(e){let t=e.trim();return t?t.slice(0,2).toUpperCase():"?"}function lb({size:e,bg:t,fg:r="#ffffff",children:n}){return(0,U.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",style:{display:"block",flex:"none",borderRadius:"50%"},children:[(0,U.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:t}),(0,U.jsx)("g",{fill:r,stroke:r,children:n})]})}function Ws({size:e,bg:t,fg:r="#ffffff",text:n}){return(0,U.jsx)(lb,{size:e,bg:t,fg:r,children:(0,U.jsx)("text",{x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",fontSize:"10",fontWeight:700,fontFamily:"inherit",stroke:"none",fill:r,children:n})})}function eo({size:e,viewBox:t="0 0 24 24",children:r}){return(0,U.jsx)("svg",{width:e,height:e,viewBox:t,"aria-hidden":"true",focusable:"false",style:{display:"block",flex:"none",borderRadius:"50%"},children:r})}function cb({size:e}){let t=(0,$r.useId)();return(0,U.jsxs)(eo,{size:e,children:[(0,U.jsxs)("g",{clipPath:`url(#${t})`,children:[(0,U.jsx)("path",{fill:"#000",d:"M24 0H0v24h24z"}),(0,U.jsx)("path",{fill:"#8FFCF3",d:"M12 4v5.912l5 2.237z"}),(0,U.jsx)("path",{fill:"#CABCF8",d:"m12 4-5 8.148 5-2.235z"}),(0,U.jsx)("path",{fill:"#CBA7F5",d:"M12 15.98V20l5-6.92z"}),(0,U.jsx)("path",{fill:"#74A0F3",d:"M12 20v-4.02l-5-2.9z"}),(0,U.jsx)("path",{fill:"#CBA7F5",d:"m12 15.049 5-2.9-5-2.236z"}),(0,U.jsx)("path",{fill:"#74A0F3",d:"m7 12.149 5 2.9V9.913z"}),(0,U.jsx)("path",{fill:"#202699",fillRule:"evenodd",clipRule:"evenodd",d:"m12 15.048-5-2.9L12 4l5 8.148zm-4.67-3.136 4.588-7.475v5.435zm-.068.204 4.656-2.068v4.768zm4.816-2.068v4.768l4.653-2.7zm0-.176 4.588 2.04-4.588-7.475z"}),(0,U.jsx)("path",{fill:"#202699",fillRule:"evenodd",clipRule:"evenodd",d:"m12 15.917-5-2.84L12 20l5-6.924zm-4.44-2.341 4.36 2.48v3.56zm4.519 2.48v3.56l4.36-6.04z"})]}),(0,U.jsx)("defs",{children:(0,U.jsx)("clipPath",{id:t,children:(0,U.jsx)("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]})}function db({size:e}){let t=(0,$r.useId)();return(0,U.jsxs)(eo,{size:e,children:[(0,U.jsxs)("g",{clipPath:`url(#${t})`,children:[(0,U.jsx)("path",{fill:"#F0B90B",d:"M24 0H0v24h24z"}),(0,U.jsx)("path",{fill:"#fff",d:"M7.635 6.449 12 4l4.364 2.449-1.6.907L12 5.809 9.24 7.356zm8.73 3.093-1.6-.906L12 10.182 9.24 8.636l-1.605.906v1.81l2.756 1.546v3.089l1.609.906 1.604-.906v-3.09l2.76-1.546zm0 4.903V12.63l-1.6.907v1.809zm1.141.64-2.76 1.542v1.813l4.365-2.453v-4.898l-1.605.902zm-1.604-7.09 1.6.907v1.81l1.609-.903V7.996l-1.605-.907L15.902 8zm-5.511 9.29v1.808L12 20l1.604-.907V17.29l-1.604.9-1.605-.907zM7.635 14.44l1.6.907v-1.81l-1.6-.906v1.813zm2.756-6.444L12 8.902l1.604-.906L12 7.089 10.395 8zm-3.898.906 1.605-.906-1.6-.907L4.888 8v1.813l1.605.903zm0 3.09-1.604-.903v4.898l4.364 2.453v-1.818L6.498 15.08v-3.093z"})]}),(0,U.jsx)("defs",{children:(0,U.jsx)("clipPath",{id:t,children:(0,U.jsx)("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]})}function pb({size:e}){let t=(0,$r.useId)();return(0,U.jsxs)(eo,{size:e,viewBox:"0 0 111 111",children:[(0,U.jsxs)("g",{clipPath:`url(#${t})`,children:[(0,U.jsx)("path",{fill:"#fff",d:"M0 0h111v111H0z"}),(0,U.jsx)("path",{fill:"#0052FF",d:"M54.921 110.034C85.359 110.034 110.034 85.402 110.034 55.017C110.034 24.6319 85.359 0 54.921 0C26.0432 0 2.35281 22.1714 0 50.3923H72.8467V59.6416H0C2.35281 87.8625 26.0432 110.034 54.921 110.034Z"})]}),(0,U.jsx)("defs",{children:(0,U.jsx)("clipPath",{id:t,children:(0,U.jsx)("path",{fill:"#fff",d:"M0 0h111v111H0z"})})})]})}function ub({size:e}){let t=(0,$r.useId)();return(0,U.jsxs)(eo,{size:e,children:[(0,U.jsxs)("g",{clipPath:`url(#${t})`,children:[(0,U.jsx)("path",{fill:"#213147",d:"M24 0H0v24h24z"}),(0,U.jsx)("path",{fill:"#fff",d:"m13.203 13.216-.787 2.124a.27.27 0 0 0 0 .183l1.354 3.655 1.565-.89-1.879-5.072c-.042-.117-.21-.117-.253 0m1.577-3.573a.135.135 0 0 0-.253 0l-.787 2.124a.27.27 0 0 0 0 .183l2.217 5.985 1.565-.89z"}),(0,U.jsx)("path",{fill:"#fff",d:"M11.999 4.991a.24.24 0 0 1 .111.03l5.969 3.393a.22.22 0 0 1 .112.19v6.787a.22.22 0 0 1-.112.19l-5.969 3.395a.2.2 0 0 1-.111.029.24.24 0 0 1-.113-.03l-5.968-3.39a.22.22 0 0 1-.112-.19v-6.79a.22.22 0 0 1 .112-.19l5.969-3.393a.23.23 0 0 1 .111-.03m0-.991c-.213 0-.426.054-.616.163L5.416 7.556a1.21 1.21 0 0 0-.616 1.05v6.787c0 .433.234.834.616 1.05l5.968 3.394a1.25 1.25 0 0 0 1.232 0l5.968-3.394a1.21 1.21 0 0 0 .616-1.05V8.606a1.21 1.21 0 0 0-.616-1.05l-5.97-3.393A1.24 1.24 0 0 0 11.998 4"}),(0,U.jsx)("path",{fill:"#fff",d:"m8.052 17.943.55-1.482 1.105.905-1.034.93zm3.445-9.823H9.984a.27.27 0 0 0-.254.175l-3.243 8.757 1.565.89L11.623 8.3a.132.132 0 0 0-.127-.179"}),(0,U.jsx)("path",{fill:"#fff",d:"M14.144 8.12h-1.513a.27.27 0 0 0-.253.175l-3.704 10 1.565.89 4.032-10.886a.133.133 0 0 0-.127-.179"})]}),(0,U.jsx)("defs",{children:(0,U.jsx)("clipPath",{id:t,children:(0,U.jsx)("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]})}function fb({size:e}){let t=(0,$r.useId)(),r=(0,$r.useId)();return(0,U.jsxs)(eo,{size:e,children:[(0,U.jsxs)("g",{clipPath:`url(#${t})`,children:[(0,U.jsx)("path",{fill:`url(#${r})`,d:"M24 0H0v24h24z"}),(0,U.jsx)("path",{fill:"#fff",d:"m15.88 14.86 3.794-2.165a.64.64 0 0 0 .326-.558v-4.33a.64.64 0 0 0-.326-.556L15.88 5.086a.66.66 0 0 0-.65 0L11.432 7.25a.64.64 0 0 0-.325.557v7.737l-2.662 1.517-2.661-1.517v-3.036l2.661-1.517 1.755 1.001V9.958l-1.43-.816a.66.66 0 0 0-.65 0l-3.796 2.165a.64.64 0 0 0-.325.557v4.33c0 .229.124.442.325.557l3.796 2.165c.2.114.45.114.65 0l3.796-2.165a.64.64 0 0 0 .325-.557V8.455l.048-.026 2.613-1.49 2.661 1.516v3.036l-2.661 1.517-1.753-.999v2.037l1.427.814a.66.66 0 0 0 .651 0z"})]}),(0,U.jsxs)("defs",{children:[(0,U.jsxs)("linearGradient",{id:r,x1:"3.948",x2:"19.217",y1:"16.617",y2:"7.645",gradientUnits:"userSpaceOnUse",children:[(0,U.jsx)("stop",{stopColor:"#A726C1"}),(0,U.jsx)("stop",{offset:".88",stopColor:"#803BDF"}),(0,U.jsx)("stop",{offset:"1",stopColor:"#7B3FE4"})]}),(0,U.jsx)("clipPath",{id:t,children:(0,U.jsx)("path",{fill:"#fff",d:"M0 0h24v24H0z"})})]})]})}function mb({size:e}){let t=(0,$r.useId)(),r=(0,$r.useId)();return(0,U.jsxs)(eo,{size:e,children:[(0,U.jsxs)("g",{clipPath:`url(#${t})`,children:[(0,U.jsx)("path",{fill:`url(#${r})`,d:"M24 0H0v24h24z"}),(0,U.jsx)("path",{fill:"#fff",d:"M17.7 8.358a.55.55 0 0 1-.365.145H4.515c-.455 0-.684-.52-.37-.825l2.106-2.03a.54.54 0 0 1 .364-.15h12.87c.46 0 .685.524.365.83zm0 10.005c-.1.09-.23.14-.365.14H4.515c-.455 0-.684-.516-.37-.82l2.106-2.036a.53.53 0 0 1 .364-.145h12.87c.46 0 .685.52.365.825zm0-7.72a.55.55 0 0 0-.365-.14H4.515c-.455 0-.684.515-.37.82l2.106 2.035c.1.091.23.143.364.144h12.87c.46 0 .685-.52.365-.824z"})]}),(0,U.jsxs)("defs",{children:[(0,U.jsxs)("linearGradient",{id:r,x1:"4.001",x2:"20.408",y1:"50.258",y2:"50.108",gradientUnits:"userSpaceOnUse",children:[(0,U.jsx)("stop",{stopColor:"#599DB0"}),(0,U.jsx)("stop",{offset:"1",stopColor:"#47F8C3"})]}),(0,U.jsx)("clipPath",{id:t,children:(0,U.jsx)("path",{fill:"#fff",d:"M0 0h24v24H0z"})})]})]})}function to({chainId:e,chainName:t,size:r=20}){switch(e){case 1:return(0,U.jsx)(cb,{size:r});case 56:return(0,U.jsx)(db,{size:r});case 8453:return(0,U.jsx)(pb,{size:r});case 42161:return(0,U.jsx)(ub,{size:r});case 137:return(0,U.jsx)(fb,{size:r});case 792703809:return(0,U.jsx)(mb,{size:r});case 612055:return(0,U.jsx)(Ws,{size:r,bg:"#0b1f3a",text:"CR"});default:return(0,U.jsx)(Ws,{size:r,bg:"#676b7a",text:Ku(t??String(e))})}}function _r({symbol:e,logoUrl:t,size:r=20}){let n=t&&t.trim().length>0?t.trim():qu(e);return n?(0,U.jsx)("img",{src:n,alt:"","aria-hidden":"true",width:r,height:r,style:{display:"block",flex:"none",borderRadius:"50%",objectFit:"cover"}}):(0,U.jsx)(Ws,{size:r,bg:"#676b7a",text:Ku(e)})}pe(`.rd-root{--rd-bg: var(--ds-bg-dim, #f7f8fb);--rd-surface: var(--ds-surface-default, #ffffff);--rd-surface-alt: var(--ds-surface-medium, #f0f1f6);--rd-border: var(--ds-border-default, #e2e4ec);--rd-text: var(--ds-content-highest, #14161f);--rd-text-muted: var(--ds-content-medium, #676b7a);--rd-accent: var(--ds-system-orange-default, #5b5bf6);--rd-accent-contrast: var(--ds-system-orange-on, #ffffff);--rd-success: var(--ds-system-green-default, #1e9e6a);--rd-success-bg: var(--ds-system-green-low, #e6f7f0);--rd-warning: #b8860b;--rd-warning-bg: #fdf3d9;--rd-danger: var(--ds-system-red-default, #d1394a);--rd-danger-bg: var(--ds-system-red-low, #fbe8ea);--rd-radius: 14px;--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(20, 22, 31, .04), 0 8px 24px rgba(20, 22, 31, .06));--rd-on-accent: #ffffff;width:100%;max-width:640px;box-sizing:border-box;margin:0 auto;display:flex;flex-direction:column;gap:1.25rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--rd-bg);color:var(--rd-text);-webkit-font-smoothing:antialiased;color-scheme:light dark}.rd-root[data-theme=dark]{color-scheme:dark;--rd-bg: var(--ds-bg-default, #0f1117);--rd-surface: var(--ds-surface-default, #171923);--rd-surface-alt: var(--ds-surface-medium, #1e212c);--rd-border: var(--ds-border-default, #2a2d3a);--rd-text: var(--ds-content-highest, #eef0f6);--rd-text-muted: var(--ds-content-medium, #9498a8);--rd-accent: var(--ds-system-orange-default, #8181ff);--rd-accent-contrast: var(--ds-system-orange-on, #0f1117);--rd-success: var(--ds-system-green-default, #3fd68f);--rd-success-bg: var(--ds-system-green-low, #123626);--rd-warning: #e0b23c;--rd-warning-bg: #3a2f10;--rd-danger: var(--ds-system-red-default, #ff6b7a);--rd-danger-bg: var(--ds-system-red-low, #3a1418);--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35))}.rd-root[data-theme=light]{color-scheme:light;--rd-bg: var(--ds-bg-dim, #f7f8fb);--rd-surface: var(--ds-surface-default, #ffffff);--rd-surface-alt: var(--ds-surface-medium, #f0f1f6);--rd-border: var(--ds-border-default, #e2e4ec);--rd-text: var(--ds-content-highest, #14161f);--rd-text-muted: var(--ds-content-medium, #676b7a);--rd-accent: var(--ds-system-orange-default, #5b5bf6);--rd-accent-contrast: var(--ds-system-orange-on, #ffffff);--rd-success: var(--ds-system-green-default, #1e9e6a);--rd-success-bg: var(--ds-system-green-low, #e6f7f0);--rd-warning: #b8860b;--rd-warning-bg: #fdf3d9;--rd-danger: var(--ds-system-red-default, #d1394a);--rd-danger-bg: var(--ds-system-red-low, #fbe8ea);--rd-radius: 14px;--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(20, 22, 31, .04), 0 8px 24px rgba(20, 22, 31, .06))}.rd-root *{box-sizing:border-box}.rd-card{background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:var(--rd-radius);box-shadow:var(--rd-shadow);padding:1.25rem;display:flex;flex-direction:column;gap:.9rem}.rd-card-header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.rd-card-title{font-size:1rem;font-weight:650;margin:0}.rd-card-hint{font-size:.8rem;color:var(--rd-text-muted)}.rd-token-address{display:flex;flex-direction:column;gap:.1rem}.rd-token-address-addr{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.78rem;color:var(--rd-text);overflow-wrap:anywhere;user-select:all}.rd-token-address-meta{font-size:.72rem;color:var(--rd-text-muted)}.rd-field{display:flex;flex-direction:column;gap:.35rem}.rd-field-label{font-size:.69rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-root .rd-field-label-row{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.rd-root .rd-token-explorer-link{font-size:.75rem;font-weight:500;color:var(--rd-accent);text-decoration:none;white-space:nowrap}.rd-root .rd-token-explorer-link:hover{text-decoration:underline}.rd-field-row{display:grid;grid-template-columns:1fr 1fr;gap:.625rem}.rd-root select,.rd-root input[type=text],.rd-root input[type=number]{width:100%;padding:.6rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:16px;font-family:inherit}.rd-root select:focus,.rd-root input:focus{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-dropdown{position:relative;min-width:0}.rd-root .rd-dropdown-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.55rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:.9rem;font-family:inherit;font-weight:600;text-align:left;cursor:pointer}.rd-root .rd-static-target{display:flex;align-items:center;gap:.55rem;padding:.55rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:.9rem;font-weight:600;min-width:0;overflow-wrap:anywhere}.rd-root .rd-dropdown-trigger:disabled{cursor:not-allowed}.rd-dropdown-trigger:focus,.rd-dropdown-trigger:focus-visible{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-dropdown-trigger-content{display:flex;align-items:center;gap:.55rem;min-width:0}.rd-dropdown-trigger-label{display:flex;flex-direction:column;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.rd-dropdown-trigger-sub{font-size:.66rem;font-weight:500;line-height:1.3;color:var(--rd-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-dropdown-chevron{flex:none;color:var(--rd-text-muted);font-size:.7rem;line-height:1}.rd-dropdown-listbox{position:absolute;z-index:20;top:calc(100% + .3rem);left:0;right:0;margin:0;padding:.3rem;list-style:none;max-height:15rem;overflow-y:auto;background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:10px;box-shadow:var(--rd-shadow)}.rd-dropdown-option{display:flex;align-items:center;gap:.55rem;padding:.5rem .6rem;border-radius:8px;font-size:.9rem;color:var(--rd-text);cursor:pointer}.rd-dropdown-option-active{background:var(--rd-surface-alt)}.rd-dropdown-option-selected{font-weight:650}.rd-dropdown-option-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-dropdown-option-check{flex:none;color:var(--rd-accent);font-size:.8rem}.rd-amount-input{display:flex;align-items:baseline;gap:.5rem;padding:.6rem .75rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt)}.rd-amount-input:focus-within{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-amount-input[data-rd-invalid]{border-color:var(--rd-danger)}.rd-root .rd-amount-input input[type=text]{flex:1 1 auto;width:auto;min-width:0;padding:0;border:0;border-radius:0;background:none;font-size:22px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.2}.rd-root .rd-amount-input input[type=text]:focus{outline:none}.rd-amount-input-suffix{flex:none;font-size:.8rem;font-weight:700;color:var(--rd-text-muted);pointer-events:none}.rd-root .rd-amount-input-max{flex:none;padding:0;font-size:.69rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-accent);background:transparent;border:0;border-radius:0;cursor:pointer;line-height:1}.rd-amount-input-max:hover:not(:disabled){text-decoration:underline}.rd-amount-input-max:disabled{opacity:.5;cursor:not-allowed}.rd-amount-meta{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;font-size:.75rem;color:var(--rd-text-muted);padding:0 .15rem;font-variant-numeric:tabular-nums}.rd-root button{font-family:inherit;font-size:.95rem;font-weight:650;border-radius:10px;border:1px solid transparent;padding:.7rem 1.1rem;cursor:pointer;transition:opacity .12s ease,transform .12s ease}.rd-root button:active:not(:disabled){transform:translateY(1px)}.rd-root button:disabled{cursor:not-allowed;opacity:.55}.rd-button-primary{background:var(--rd-accent);color:var(--rd-accent-contrast)}.rd-button-secondary{background:var(--rd-surface-alt);color:var(--rd-text);border-color:var(--rd-border)}.rd-button-block{width:100%}.rd-callout{border-radius:10px;padding:.65rem .85rem;font-size:.85rem;line-height:1.4}.rd-callout-warning{background:var(--rd-warning-bg);color:var(--rd-warning)}.rd-callout-danger{background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-callout-success{background:var(--rd-success-bg);color:var(--rd-success)}.rd-callout-muted{background:var(--rd-surface-alt);color:var(--rd-text-muted)}.rd-quote-summary{display:flex;align-items:center;justify-content:center;gap:.5rem;flex-wrap:wrap;width:fit-content;max-width:100%;margin:0 auto;padding:.4rem .85rem;border-radius:999px;background:var(--rd-surface);border:1px solid var(--rd-border);font-size:.8rem;color:var(--rd-text-muted);font-variant-numeric:tabular-nums;text-align:center}.rd-quote-summary-arrow{color:var(--rd-accent);font-weight:800}.rd-quote-summary strong{color:var(--rd-text);font-weight:700;font-variant-numeric:tabular-nums}.rd-quote-strip{display:flex;align-items:center;justify-content:space-between;gap:.625rem;padding:.7rem .85rem;border-radius:14px;background:color-mix(in srgb,var(--rd-accent) 10%,var(--rd-surface));border:1px solid color-mix(in srgb,var(--rd-accent) 35%,transparent)}.rd-quote-strip-side{display:flex;flex-direction:column;min-width:0;gap:.1rem;font-size:.9rem;font-weight:700;color:var(--rd-text);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.rd-quote-strip-end{text-align:right;align-items:flex-end}.rd-quote-strip-side small{font-size:.69rem;font-weight:600;color:var(--rd-text-muted);letter-spacing:.02em}.rd-quote-strip-arrow{flex:none;color:var(--rd-accent);font-weight:800}.rd-quote-strip-hint{font-size:.72rem;line-height:1.45;color:var(--rd-text-muted);padding:0 .15rem}.rd-deposit-address{display:flex;align-items:center;gap:.5rem;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:.55rem .7rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;color:var(--rd-text-muted);word-break:break-all}.rd-address-full{flex:1;min-width:0;color:var(--rd-text);font-weight:600}.rd-root .rd-address-copy{flex:none;margin-left:auto;padding:.35rem .6rem;border-radius:8px;border:0;background:var(--rd-accent);color:var(--rd-accent-contrast);font-family:inherit;font-size:.69rem;font-weight:800;letter-spacing:.03em;line-height:1}.rd-deposit-qr{position:relative;display:grid;place-items:center;width:172px;height:172px;background:#fff;border-radius:16px;margin:0 auto}.rd-deposit-qr-badge{position:absolute;inset:0;margin:auto;width:36px;height:36px;display:grid;place-items:center;background:#fff;border-radius:50%;pointer-events:none}.rd-address-warning{display:flex;align-items:flex-start;gap:.5rem;border:1px solid color-mix(in srgb,var(--rd-warning) 35%,transparent);font-size:.78rem}.rd-address-details{font-size:.75rem;color:var(--rd-text-muted);line-height:1.5}.rd-address-details>summary{cursor:pointer;font-size:.72rem;font-weight:700;letter-spacing:.02em;color:var(--rd-text-muted);padding:.15rem;list-style:none}.rd-address-details>summary::marker,.rd-address-details>summary::-webkit-details-marker{display:none}.rd-address-details>summary:after{content:" \\25be"}.rd-address-details[open]>summary:after{content:" \\25b4"}.rd-address-details>p{margin:.35rem 0 0;padding:.6rem .75rem;border-radius:10px;background:var(--rd-surface-alt)}.rd-deposit-divider{display:flex;align-items:center;gap:.6rem;color:var(--rd-text-muted);font-size:.75rem;text-transform:uppercase;letter-spacing:.04em}.rd-deposit-divider:before,.rd-deposit-divider:after{content:"";flex:1;height:1px;background:var(--rd-border)}.rd-stepper{display:flex;flex-direction:column;gap:0}.rd-stepper-item{display:flex;gap:.75rem;position:relative;padding-bottom:1.25rem}.rd-stepper-item:last-child{padding-bottom:0}.rd-stepper-rail{display:flex;flex-direction:column;align-items:center}.rd-stepper-dot{width:22px;height:22px;border-radius:50%;border:2px solid var(--rd-border);background:var(--rd-surface);display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:700;flex:none;color:var(--rd-text-muted)}.rd-stepper-item-done .rd-stepper-dot{background:var(--rd-success);border-color:var(--rd-success);color:var(--rd-on-accent)}.rd-stepper-item-active .rd-stepper-dot{border-color:var(--rd-accent);color:var(--rd-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--rd-accent) 20%,transparent)}.rd-stepper-line{flex:1;width:2px;background:var(--rd-border);margin:2px 0}.rd-stepper-item-done .rd-stepper-line{background:var(--rd-success)}.rd-stepper-body{padding-top:1px}.rd-stepper-label{font-weight:600;font-size:.9rem}.rd-stepper-item-pending .rd-stepper-label{color:var(--rd-text-muted)}.rd-stepper-meta{margin-top:.25rem;font-size:.78rem;color:var(--rd-text-muted);display:flex;flex-direction:column;gap:.15rem}.rd-stepper-meta a{color:var(--rd-accent);text-decoration:none}.rd-stepper-meta a:hover{text-decoration:underline}.rd-status-pill{display:inline-flex;align-items:center;gap:.35rem;font-size:.75rem;font-weight:650;padding:.2rem .55rem;border-radius:999px;background:var(--rd-surface-alt);color:var(--rd-text-muted);width:fit-content}.rd-status-pill-success{background:var(--rd-success-bg);color:var(--rd-success)}.rd-status-pill-failure{background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-spinner{display:inline-block;width:1em;height:1em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:rd-spin .7s linear infinite;vertical-align:-.15em}@keyframes rd-spin{to{transform:rotate(360deg)}}.rd-muted{color:var(--rd-text-muted)}.rd-settings-row{display:flex;justify-content:flex-end}.rd-root .rd-icon-button{position:relative;display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border-radius:50%;border:1px solid var(--rd-border);background:var(--rd-surface);color:var(--rd-text-muted)}.rd-root .rd-icon-button:hover:not(:disabled){color:var(--rd-text);background:var(--rd-surface-alt)}.rd-recovery-badge{position:absolute;top:-.3rem;right:-.3rem;display:flex;align-items:center;justify-content:center;min-width:1.05rem;height:1.05rem;padding:0 .25rem;border-radius:999px;background:var(--rd-danger, #d1394a);color:#fff;font-size:.65rem;font-weight:700;line-height:1;border:2px solid var(--rd-surface, #ffffff)}.rd-recover-group{display:flex;flex-direction:column;gap:.75rem}.rd-recover-group+.rd-recover-group{border-top:1px solid var(--rd-border);padding-top:1rem;margin-top:.5rem}.rd-recover-group-label{margin:0;font-size:.8rem;color:var(--rd-text-muted)}.rd-recover-made-of{display:flex;flex-direction:column;gap:.4rem;padding:.65rem .8rem;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:10px}.rd-recover-made-of-label{font-size:.72rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-token-list{display:flex;flex-direction:column;gap:.5rem}.rd-token-row{display:flex;align-items:center;gap:10px;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:12px 14px}.rd-token-row-info{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.rd-token-row-symbol{font-weight:700}.rd-token-row-amount{font-variant-numeric:tabular-nums;font-size:14px;font-weight:700;color:var(--rd-text);white-space:nowrap}.rd-token-row-status{font-size:11.5px;line-height:1.45;color:var(--rd-text-muted)}.rd-token-row-warn{font-size:11.5px;line-height:1.45;color:var(--rd-warning)}.rd-token-row-warn b{font-weight:750;font-variant-numeric:tabular-nums}.rd-token-row-step{font-size:11.5px;line-height:1.45;font-weight:650;color:var(--rd-accent)}.rd-root .rd-token-row-action{flex:none;width:auto;padding:9px 16px;font-size:13px;font-weight:700}.rd-token-row-spinner{flex:none;font-size:18px;color:var(--rd-accent)}.rd-recover-sum{display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:16px 14px}.rd-recover-sum-label{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-recover-sum-value{font-size:28px;font-weight:800;line-height:1.15;font-variant-numeric:tabular-nums;color:var(--rd-text)}.rd-recover-sum-unit{margin-left:1px;font-size:15px;font-weight:700;color:var(--rd-text-muted)}.rd-recover-sum-empty{font-size:17px;font-weight:700;color:var(--rd-text-muted)}.rd-recover-foot{text-align:center;font-size:11.5px;line-height:1.45;color:var(--rd-text-muted)}.rd-footer-note{text-align:center;font-size:.75rem;color:var(--rd-text-muted);padding:1rem 0 2rem}.rd-history-table{display:flex;flex-direction:column;gap:.6rem;font-size:.875rem}.rd-history-group{background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;overflow:hidden}.rd-history-row-button{width:100%;display:flex;flex-direction:column;gap:.55rem;padding:.8rem .9rem;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.rd-history-row-button:hover{background:color-mix(in srgb,var(--rd-border) 30%,transparent)}.rd-history-row-button:focus-visible{outline:2px solid var(--rd-accent);outline-offset:-2px}.rd-history-card-top{display:flex;align-items:center;gap:.5rem;min-width:0}.rd-history-card-top>.rd-status-pill{margin-left:auto;flex:none}.rd-history-asset{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-history-card-amounts{display:flex;align-items:baseline;gap:.5rem;flex-wrap:wrap}.rd-history-num{font-variant-numeric:tabular-nums;font-size:.875rem;font-weight:700;white-space:nowrap}.rd-history-card-arrow{color:var(--rd-text-muted);font-size:.85rem;flex:none}.rd-history-received{color:var(--rd-success)}.rd-history-received-estimate{color:var(--rd-text-muted);font-weight:600}.rd-history-card-foot{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.rd-history-date{color:var(--rd-text-muted);font-size:.78rem;font-variant-numeric:tabular-nums}.rd-history-chevron{color:var(--rd-text-muted);text-align:center}.rd-history-detail{display:flex;flex-direction:column;gap:.375rem;padding:.65rem .9rem .8rem;border-top:1px solid var(--rd-border)}.rd-history-step{display:grid;grid-template-columns:.5rem auto 1fr auto auto;gap:.5rem;align-items:center}.rd-history-step-dot{width:.5rem;height:.5rem;border-radius:50%;background:var(--rd-border)}.rd-history-step-dot-done{background:var(--rd-success)}.rd-history-step-label{font-weight:600}.rd-history-step-chain{color:var(--rd-text-muted)}.rd-history-step-amount{font-variant-numeric:tabular-nums;color:var(--rd-text-muted)}.rd-history-step-tx{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.rd-history-step-shared{margin-left:.4rem;color:var(--rd-text-muted);font-size:.72rem}.rd-complete{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.65rem;padding:1.75rem 1.25rem 1.5rem}.rd-complete-icon{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:var(--rd-success-bg);color:var(--rd-success)}.rd-complete-icon-fail{background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-complete-icon-wait{background:var(--rd-surface-alt);color:var(--rd-text-muted)}.rd-complete-spinner{width:22px;height:22px}.rd-complete-title{margin:0;font-size:1.15rem;font-weight:700}.rd-complete-amount{font-variant-numeric:tabular-nums;font-size:1.35rem;font-weight:700;color:var(--rd-success)}.rd-complete-sub{margin:0;max-width:26rem;color:var(--rd-text-muted);font-size:.85rem;line-height:1.5}.rd-complete-actions{display:flex;flex-direction:column;align-items:center;gap:.5rem;margin-top:.5rem;width:100%}.rd-complete-actions .rd-button-primary{min-width:12rem}.rd-skeleton{border-radius:10px;background:linear-gradient(90deg,var(--rd-surface-alt) 25%,color-mix(in srgb,var(--rd-surface-alt) 55%,var(--rd-surface)) 42%,var(--rd-surface-alt) 60%);background-size:220% 100%;animation:rd-skeleton-wave 1.4s ease-in-out infinite}@keyframes rd-skeleton-wave{0%{background-position:130% 0}to{background-position:-90% 0}}@media(prefers-reduced-motion:reduce){.rd-skeleton{animation:none}}.rd-skeleton-form,.rd-skeleton-address{display:flex;flex-direction:column;gap:.85rem}.rd-skeleton-address{align-items:center}.rd-skeleton-line{height:.9rem;width:40%}.rd-skeleton-field{height:48px}.rd-skeleton-notice{height:96px}.rd-skeleton-cta{height:48px}.rd-skeleton-qr{width:172px;height:172px;border-radius:16px}.rd-skeleton-chip{height:44px;width:100%}.rd-wizard{flex:1 1 auto;min-height:0;overflow-y:auto;padding:1rem 1.25rem 1.25rem;max-width:none;gap:.85rem}.rd-stack{display:flex;flex-direction:column;gap:.75rem}.rd-flow{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:.7rem .85rem;font-size:.85rem}.rd-flow-pair{display:inline-flex;align-items:center;gap:.4rem;min-width:0}.rd-flow-badge{position:relative;display:inline-grid;flex:none}.rd-flow-badge-sub{position:absolute;right:-5px;bottom:-4px;display:inline-grid;border-radius:50%;border:2px solid var(--rd-surface-alt)}.rd-flow-name b{font-weight:700}.rd-flow-name small{color:var(--rd-text-muted)}.rd-flow-arrow{color:var(--rd-text-muted);flex:none}.rd-flow-to{width:100%;display:flex;align-items:center;gap:.35rem;color:var(--rd-text-muted);font-size:.78rem}.rd-flow-to code{background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:6px;padding:0 .35rem;font-size:.75rem}.rd-live{border:1px dashed var(--rd-border);border-radius:12px;padding:.85rem .95rem;display:flex;flex-direction:column;gap:.45rem}.rd-live-head{display:flex;align-items:center;gap:.55rem;font-weight:650;font-size:.9rem}.rd-live-pulse{width:10px;height:10px;border-radius:50%;background:var(--rd-accent);position:relative;flex:none}.rd-live-pulse:after{content:"";position:absolute;inset:-5px;border-radius:50%;border:2px solid var(--rd-accent);opacity:.5;animation:rd-live-pulse 1.6s ease-out infinite}@keyframes rd-live-pulse{0%{transform:scale(.5);opacity:.7}to{transform:scale(1.4);opacity:0}}@media(prefers-reduced-motion:reduce){.rd-live-pulse:after{animation:none}}.rd-live-sub{margin:0;color:var(--rd-text-muted);font-size:.8rem;line-height:1.5}.rd-live-sub b{color:var(--rd-text);font-weight:650}.rd-step-nav{display:flex;gap:.75rem}.rd-step-nav>button{flex:1 1 auto;border-radius:14px;padding:.85rem 1.1rem;font-size:.95rem;font-weight:800}.rd-wizard-header{display:flex;align-items:center;gap:.5rem;margin-bottom:0}.rd-back-arrow{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:none;border-radius:8px;background:transparent;color:var(--rd-text);cursor:pointer}.rd-back-arrow svg{width:20px;height:20px;flex-shrink:0}.rd-back-arrow:hover:not(:disabled){background:var(--rd-surface-alt)}.rd-back-arrow:disabled{opacity:.4;cursor:not-allowed}.rd-wizard-heading{font-size:1rem;font-weight:700;color:var(--rd-text);margin:0}.rd-wizard-actions{margin-left:auto;display:flex;align-items:center;gap:.25rem}.rd-min-notice{background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:4px}.rd-min-notice-main{font-size:14px;color:var(--rd-text)}.rd-min-notice-main b{color:var(--rd-accent);font-weight:750}.rd-min-notice-sub{font-size:12px;color:var(--rd-text-muted)}.rd-min-notice-pending{display:block;font-size:13px;line-height:1.5;color:var(--rd-text);background:color-mix(in srgb,var(--rd-warning) 12%,transparent);border:1px solid color-mix(in srgb,var(--rd-warning) 40%,transparent);border-radius:10px;padding:10px 12px;margin-top:2px}.rd-min-notice-pending:before{content:"\\25cf";color:var(--rd-warning);font-size:9px;margin-right:7px;vertical-align:1px}.rd-min-notice-pending b{font-weight:750;color:var(--rd-warning);font-variant-numeric:tabular-nums}.rd-min-notice-warning{display:flex;align-items:flex-start;gap:.5rem;font-size:13px;line-height:1.5;color:var(--rd-text);background:color-mix(in srgb,var(--rd-warning) 12%,transparent);border:1px solid color-mix(in srgb,var(--rd-warning) 40%,transparent);border-radius:10px;padding:10px 12px;margin-top:2px}.rd-min-notice-warning b{font-weight:750}
24
+ `);var K=require("react/jsx-runtime"),gb=56;function hb(e){return{client:e.client,apiBaseUrl:e.apiBaseUrl,recipient:e.recipient,target:e.target,enabled:e.targets===void 0,wallet:e.wallet,trustedFactories:e.trustedFactories,onUnauthorized:e.onUnauthorized,onError:e.onError}}var bb="These funds may be processing normally -- only recover if they're stuck.",pa="USDT",Zu="primary";function wb(e){return`${e} more recoverable under other delivery tokens -- switch the delivery token above to recover ${e===1?"it":"them"}.`}function Yo(e){if(!e)return 0n;try{return BigInt(e)}catch{return 0n}}function en(e,t){try{return gt(e,t)}catch{return e.toString()}}function Xu(e){return e.length>14?`${e.slice(0,8)}...${e.slice(-4)}`:e}function yb(e){let t=Yo(e.bridgeMinWei),r=[];for(let i of e.tokens??[]){let a=Yo(i.balance);if(!(a<=0n)){if(i.suggestedAction==="execute"){r.push({key:i.address,symbol:i.symbol,decimals:i.decimals,balance:a,action:{kind:"execute"}});continue}if(i.recoverable){r.push({key:i.address,symbol:i.symbol,decimals:i.decimals,balance:a,action:{kind:"sweep",tokenAddress:i.address}});continue}r.push({key:i.address,symbol:i.symbol,decimals:i.decimals,balance:a,...t>a?{shortfall:t-a,minimum:t}:{}})}}let n=Yo(e.balance),o=r.some(i=>i.action?.kind==="execute");return n>0n&&e.suggestedAction==="execute"&&!o?r.unshift({key:Zu,symbol:pa,decimals:e.decimals,balance:n,action:{kind:"execute"}}):r.length===0&&n>0n&&e.suggestedAction!=="none"&&r.push({key:Zu,symbol:pa,decimals:e.decimals,balance:n,action:{kind:"sweep"}}),r}function xb({deposit:e,decimals:t}){let r=e.originChainId??gb,n=e.originTxHash||e.txHash,o=n?da(r,n):void 0;return(0,K.jsxs)("div",{className:"rd-history-step","data-testid":"recovery-deposit-row",children:[(0,K.jsx)("span",{className:"rd-history-step-dot rd-history-step-dot-done"}),(0,K.jsx)("span",{className:"rd-history-step-chain",children:Vo(r)}),(0,K.jsx)("span",{className:"rd-history-step-amount",children:en(Yo(e.amount),t)}),(0,K.jsx)("span",{className:"rd-history-step-tx",children:o?(0,K.jsx)("a",{href:o.url,target:"_blank",rel:"noreferrer",title:n,children:Xu(n)}):n?(0,K.jsx)("span",{title:n,children:Xu(n)}):null})]})}function vb({group:e,showTargetLabel:t,busy:r,state:n,onRecover:o,actingRowKey:i,rowKeyOf:a}){let{info:s}=e,l=yb(s),c=Yo(s.balance),u=l.length===1?`${en(l[0].balance,l[0].decimals)}`:`${l.length} assets`,b=e.deposits.length>0&&e.depositsTotal>=c,h=c>e.depositsTotal?c-e.depositsTotal:0n,d=n.step==="switching"||n.step==="deploying"||n.step==="recovering";function y(){return n.step==="switching"?"Switching network\u2026":n.step==="deploying"?"Confirm in wallet\u2026 (1/2 \u2014 preparing your address)":n.deployTxHash?"Confirm in wallet\u2026 (2/2 \u2014 recovering)":"Confirm in wallet\u2026 (recovering)"}return(0,K.jsxs)("div",{className:"rd-recover-group","data-testid":"forwarder-section",children:[t&&(0,K.jsxs)("p",{className:"rd-recover-group-label",children:["Held for ",(0,K.jsx)("b",{children:e.targets.join(", ")})]}),(0,K.jsxs)("div",{className:"rd-recover-sum",children:[(0,K.jsx)("span",{className:"rd-recover-sum-label",children:"Waiting at your deposit address"}),(0,K.jsxs)("span",{className:"rd-recover-sum-value",children:[u,l.length===1&&(0,K.jsxs)(K.Fragment,{children:[" ",(0,K.jsx)("span",{className:"rd-recover-sum-unit",children:l[0].symbol})]})]})]}),e.deposits.length>0&&(0,K.jsxs)("div",{className:"rd-recover-made-of",children:[(0,K.jsx)("div",{className:"rd-recover-made-of-label",children:"Made up of"}),e.deposits.map(f=>(0,K.jsx)(xb,{deposit:f,decimals:s.decimals},`${f.txHash}-${f.blockNumber}`)),!b&&(0,K.jsxs)("p",{className:"rd-token-row-status","data-testid":"deposits-incomplete-note",children:["Listed deposits account for ",en(e.depositsTotal,s.decimals)," of the"," ",en(c,s.decimals)," ",pa," above; the remaining"," ",en(h,s.decimals)," ",pa," arrived outside these transfers (or is left over from an earlier one). Recovering moves the full balance either way."]})]}),(0,K.jsx)("div",{className:"rd-token-list",children:l.map(f=>{let m=a(f),w=d&&i===m;return(0,K.jsxs)("div",{className:"rd-token-row",children:[(0,K.jsx)(_r,{symbol:f.symbol,size:26}),(0,K.jsxs)("div",{className:"rd-token-row-info",children:[(0,K.jsxs)("span",{className:"rd-token-row-amount",children:[en(f.balance,f.decimals)," ",(0,K.jsx)("span",{className:"rd-token-row-symbol",children:f.symbol})]}),w?(0,K.jsx)("span",{className:"rd-token-row-step",children:y()}):f.shortfall!==void 0&&f.minimum!==void 0?(0,K.jsxs)("span",{className:"rd-token-row-warn",children:["Below the ",en(f.minimum,f.decimals)," ",f.symbol," minimum \u2014 deposit"," ",(0,K.jsxs)("b",{children:[en(f.shortfall,f.decimals)," ",f.symbol]})," ","more via ",(0,K.jsx)("b",{children:"Deposit to CROSS"})," and it sweeps in together."]}):f.action?(0,K.jsx)("span",{className:"rd-token-row-status",children:"Ready to recover to your wallet"}):(0,K.jsx)("span",{className:"rd-token-row-status",children:"Waiting to be delivered."})]}),w?(0,K.jsx)("span",{className:"rd-spinner rd-token-row-spinner"}):f.action&&(0,K.jsx)("button",{type:"button",className:"rd-button-primary rd-token-row-action",onClick:()=>o(f),disabled:r,children:"Recover"})]},f.key)})}),!s.isDeployed&&n.step==="idle"&&(0,K.jsxs)("div",{className:"rd-callout rd-callout-warning","data-testid":"two-tx-notice",children:["Recovering from this address the first time takes ",(0,K.jsx)("b",{children:"two transactions"}),": one to prepare the address, then one to move the funds \u2014 your wallet will prompt twice. After that, it's a single transaction."]}),s.inFlight&&(0,K.jsx)("p",{className:"rd-muted rd-token-row-status",children:s.inFlightReason||bb}),n.step==="done"&&(0,K.jsx)("div",{className:"rd-callout rd-callout-success",children:"Recovered \u2014 funds are on the way to your wallet."}),n.step==="error"&&n.error&&(0,K.jsx)("div",{className:"rd-callout rd-callout-danger",children:n.error})]})}function ua(e){let{info:t,loading:r,error:n,refresh:o}=Gu(hb(e)),i=js({recipient:e.recipient,wallet:e.wallet,trustedFactories:e.trustedFactories,onError:e.onError,onChanged:e.targets!==void 0?e.onRecovered:o}),[a,s]=(0,qo.useState)(),l=e.targets!==void 0?[...e.targets]:t?[{symbol:e.target??"",isDefault:!0,info:t}]:[],c=Qu($n(l,e.orders??[])),u=c.length>0,b=e.wallet?.walletAddress,h=e.wallet?.getBalance,[d,y]=(0,qo.useState)();return(0,qo.useEffect)(()=>{if(!u||!h||!b){y(void 0);return}let f=!1;return h({chainId:56,address:b}).then(m=>{f||y({value:m.value,decimals:m.decimals})}).catch(()=>{f||y(void 0)}),()=>{f=!0}},[u,h,b]),(0,K.jsxs)("section",{className:"rd-card",children:[(e.showTitle??!0)&&(0,K.jsx)("div",{className:"rd-card-header",children:(0,K.jsx)("h2",{className:"rd-card-title",children:"Recover stuck funds"})}),typeof e.otherTargetsRecoverable=="number"&&e.otherTargetsRecoverable>0&&(0,K.jsx)("div",{className:"rd-callout rd-callout-muted","data-testid":"other-targets-recoverable-note",children:wb(e.otherTargetsRecoverable)}),r&&(0,K.jsxs)("p",{className:"rd-muted",children:[(0,K.jsx)("span",{className:"rd-spinner"})," Checking for stuck funds\u2026"]}),n&&(0,K.jsxs)("div",{className:"rd-callout rd-callout-danger",children:["Couldn't check recovery status: ",n.message]}),!r&&!n&&l.length>0&&!u&&(0,K.jsxs)("div",{className:"rd-recover-sum",children:[(0,K.jsx)("span",{className:"rd-recover-sum-label",children:"Waiting at your deposit address"}),(0,K.jsx)("span",{className:"rd-recover-sum-value rd-recover-sum-empty",children:"Nothing to recover"})]}),!r&&!n&&c.map(f=>(0,K.jsx)(vb,{group:f,showTargetLabel:c.length>1||f.targets.length>1,busy:i.busy,state:i.stateFor(f.forwarder),actingRowKey:a,rowKeyOf:m=>`${f.forwarder.toLowerCase()}:${m.key}`,onRecover:m=>{m.action&&(s(`${f.forwarder.toLowerCase()}:${m.key}`),i.recover(f.info,m.action.kind,m.action.tokenAddress))}},f.forwarder.toLowerCase())),!r&&!n&&u&&(0,K.jsxs)("div",{className:"rd-callout rd-callout-muted","data-testid":"rd-recover-gas-note",children:["Recovering runs on BSC and needs ",(0,K.jsx)("b",{children:"BNB for gas"})," in your connected wallet",d&&(0,K.jsxs)(K.Fragment,{children:[" ","\u2014 it currently holds ",(0,K.jsxs)("b",{children:[en(d.value,d.decimals)," BNB"]})]}),". A first-time recovery is two transactions, so keep a little extra."]}),(0,K.jsx)("p",{className:"rd-recover-foot",children:"Funds always return to your own wallet \u2014 recovery can't send anywhere else."})]})}var Gr=Q(require("react"),1),sr=Q(require("@radix-ui/react-dialog"),1),zn=require("vaul");pe(`.rd-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))}.rd-dialog-content{-webkit-font-smoothing:antialiased;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--rd-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;font-family:inherit}.rd-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--rd-drawer-max-width, none);min-width:var(--rd-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}.rd-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--rd-drawer-max-width, 400px);max-width:100vw;border-radius:16px 0 0 16px}.rd-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--rd-drawer-max-width, 400px);max-width:100vw;border-radius:0 16px 16px 0}.rd-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.rd-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}.rd-drawer-content[data-vaul-drawer-direction=left] .rd-drawer-handle,.rd-drawer-content[data-vaul-drawer-direction=right] .rd-drawer-handle{display:none}.rd-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}
25
+ `);var Lt=require("react/jsx-runtime");function kb(e){let t=`(max-width: ${e}px)`,[r,n]=Gr.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(t).matches);return Gr.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia(t);n(o.matches);let i=a=>n(a.matches);return o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[t]),r}function ro({theme:e="dark",mobileBreakpoint:t=768,drawerDirection:r="bottom",dialogWidth:n,drawerMaxWidth:o,drawerMinWidth:i,style:a,open:s,onOpenChange:l,children:c}){let u=kb(t),[b,h]=Gr.useState(!1),d=s!==void 0,y=d?s:b,f=Gr.useCallback(p=>{d||h(p),l?.(p)},[d,l]),m=Gr.useMemo(()=>{let p={};return n&&(p["--rd-dialog-width"]=n),o&&(p["--rd-drawer-max-width"]=o),i&&(p["--rd-drawer-min-width"]=i),{...p,...a}},[n,o,i,a]),w=Gr.useMemo(()=>({open:y,setOpen:f,isMobile:u,theme:e,portalStyle:m}),[y,f,u,e,m]),x=(0,Lt.jsx)("div",{"data-theme":e,style:m,children:c});return u?(0,Lt.jsx)(ia.Provider,{value:w,children:(0,Lt.jsx)(zn.Drawer.Root,{direction:r,open:y,onOpenChange:f,noBodyStyles:!0,children:x},"drawer")}):(0,Lt.jsx)(ia.Provider,{value:w,children:(0,Lt.jsx)(sr.Root,{open:y,onOpenChange:f,children:x})})}function no({asChild:e,children:t,dataAttributes:r}){let{isMobile:n}=Er(),o=n?zn.Drawer.Trigger:sr.Trigger;return(0,Lt.jsx)(o,{asChild:e,...r,children:t})}function oo({className:e,ariaTitle:t,children:r}){let{isMobile:n,theme:o,portalStyle:i}=Er();return n?(0,Lt.jsxs)(zn.Drawer.Portal,{children:[(0,Lt.jsx)(zn.Drawer.Overlay,{className:"rd-overlay"}),(0,Lt.jsxs)(zn.Drawer.Content,{className:Ie("rd-drawer-content",e),"data-theme":o,"data-rd-shell":"drawer",style:i,children:[(0,Lt.jsx)(zn.Drawer.Title,{className:"rd-sr-only",children:t}),(0,Lt.jsx)("div",{className:"rd-drawer-handle"}),r]})]}):(0,Lt.jsxs)(sr.Portal,{children:[(0,Lt.jsx)(sr.Overlay,{className:"rd-overlay"}),(0,Lt.jsxs)(sr.Content,{className:Ie("rd-dialog-content",e),"data-theme":o,"data-rd-shell":"dialog",style:i,children:[(0,Lt.jsx)(sr.Title,{className:"rd-sr-only",children:t}),(0,Lt.jsx)(sr.Description,{className:"rd-sr-only",children:t}),r]})]})}var Ju=require("react");var $u=require("qrcode.react"),me=require("react/jsx-runtime");function Rb(e){let{depositAddress:t,originChainId:r,originCurrency:n,amountWei:o,isNative:i}=e;if(i)return o!==void 0?`ethereum:${t}@${r}?value=${o.toString()}`:`ethereum:${t}@${r}`;let a=new URLSearchParams({address:t});return o!==void 0&&a.set("uint256",o.toString()),`ethereum:${n}@${r}/transfer?${a.toString()}`}function Sb(e){let{depositAddress:t,splMint:r,humanAmount:n}=e,o=new URLSearchParams;return n&&o.set("amount",n),o.set("spl-token",r),`solana:${t}?${o.toString()}`}function ef({depositAddress:e,originChainId:t,originChainName:r,originCurrency:n,amount:o,tokenSymbol:i,tokenDecimals:a,kind:s="evm",minAmount:l,hideTokenWarning:c=!1,depositState:u,onDeposit:b,canDeposit:h,oneClickEnabled:d=!0}){let[y,f]=(0,Ju.useState)(!1),m=n.toLowerCase()===Qo,w=s==="svm";async function x(){try{await navigator.clipboard.writeText(e),f(!0),setTimeout(()=>f(!1),1500)}catch{}}let p;if(o)try{let P=BigInt(o);P>0n&&(p=P)}catch{}let k=p!==void 0,R;if(k)try{R=gt(p,a)}catch{R=o}let S=w?Sb({depositAddress:e,splMint:n,humanAmount:R??""}):Rb({depositAddress:e,originChainId:t,originCurrency:n,amountWei:p,isNative:m}),T;if(l)try{T=`${gt(BigInt(l),a)} ${i}`}catch{}let{isSubmitting:N,isConfirming:C,isConfirmed:M,needsSwitch:B,txHash:W,reverted:L,error:$}=u;return(0,me.jsxs)("section",{className:"rd-stack",children:[!w&&h&&(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)("button",{type:"button",className:"rd-button-primary rd-button-block",onClick:b,disabled:N||C||M&&!L,children:M&&!L?"Deposit sent":C?"Confirming...":N?B?"Switching network...":"Confirm in wallet...":`One-click deposit ${i}${B?` (switch to ${r})`:""}`}),$&&(0,me.jsx)("div",{className:"rd-callout rd-callout-danger",children:$}),W&&(0,me.jsxs)("p",{className:"rd-card-hint",children:["Tx: ",(0,me.jsx)("span",{style:{fontFamily:"monospace"},children:W})]}),M&&L&&(0,me.jsx)("div",{className:"rd-callout rd-callout-danger",children:"The deposit transaction reverted on-chain. Please check your wallet and try again."}),M&&!L&&(0,me.jsx)("div",{className:"rd-callout rd-callout-success",children:"Deposit confirmed on-chain. Waiting for it to be swept..."}),(0,me.jsx)("div",{className:"rd-deposit-divider",children:"or deposit manually"})]}),w&&(0,me.jsxs)("div",{className:"rd-callout rd-callout-muted",children:["Pay from a Solana wallet (e.g. Phantom). Scan the QR or copy the address below and send"," ",k?(0,me.jsxs)(me.Fragment,{children:["exactly"," ",(0,me.jsxs)("strong",{children:[R," ",i]})]}):(0,me.jsxs)(me.Fragment,{children:["any amount of ",(0,me.jsx)("strong",{children:i})]}),"."]}),(0,me.jsxs)("div",{className:"rd-deposit-qr",children:[(0,me.jsx)($u.QRCodeSVG,{value:S,size:144,level:"H"}),(0,me.jsx)("span",{className:"rd-deposit-qr-badge","aria-hidden":"true",children:(0,me.jsx)(to,{chainId:t,chainName:r,size:28})})]}),(0,me.jsxs)("div",{className:"rd-deposit-address",children:[(0,me.jsx)("span",{className:"rd-address-full",title:e,children:e}),(0,me.jsx)("button",{type:"button",className:"rd-address-copy",onClick:x,"aria-label":`Copy deposit address ${e}`,children:y?"Copied":"Copy"})]}),(0,me.jsxs)("p",{className:"rd-card-hint",children:[k?(0,me.jsxs)(me.Fragment,{children:["Send exactly"," ",(0,me.jsxs)("strong",{children:[R," ",i]})," ","on ",r," to this address."]}):(0,me.jsxs)(me.Fragment,{children:["Reusable address -- send any amount of ",(0,me.jsx)("strong",{children:i})," on ",r,", as many times as you like."]}),!w&&!h&&d&&!k&&" Enter an amount to deposit in one click."]}),!c&&(0,me.jsxs)("div",{className:"rd-callout rd-callout-warning rd-address-warning",children:[(0,me.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,me.jsxs)("span",{children:["Only send ",(0,me.jsx)("strong",{children:i})," on ",(0,me.jsx)("strong",{children:r})," to this address."]})]}),(0,me.jsxs)("details",{className:"rd-address-details",children:[(0,me.jsx)("summary",{children:"More about this address"}),(0,me.jsx)("p",{children:"This is a reusable, open deposit address -- a wrong token or wrong chain will not be processed automatically, and recovering it has weaker guarantees than a one-time order address (it may require a manual request)."})]}),T&&(0,me.jsxs)("p",{className:"rd-card-hint",children:["Deposits below ",T," may not be swept."]})]})}var ur=require("react/jsx-runtime");function fa({minNotice:e,onlySend:t}){return(0,ur.jsxs)("div",{className:"rd-min-notice","data-rd-min-notice":"",children:[(0,ur.jsxs)("div",{className:"rd-min-notice-main",children:["Send at least"," ",(0,ur.jsxs)("b",{children:[e.remaining??e.min," ",e.symbol]})]}),e.remaining!==void 0?(0,ur.jsxs)("div",{className:"rd-min-notice-pending","data-rd-min-notice-pending":"",children:[(0,ur.jsxs)("b",{children:[e.pending,e.pendingSymbol?` ${e.pendingSymbol}`:""]})," ","from an earlier deposit is already waiting at your address \u2014 it counts toward the ",e.min," ",e.symbol," minimum."]}):(0,ur.jsx)("div",{className:"rd-min-notice-sub",children:"Smaller deposits may not be processed."}),t&&(0,ur.jsxs)("div",{className:"rd-min-notice-warning","data-rd-min-notice-warning":"",children:[(0,ur.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,ur.jsxs)("span",{children:["Only send ",(0,ur.jsx)("b",{children:t.symbol})," on ",(0,ur.jsx)("b",{children:t.chainName})," to this address."]})]})]})}var H=require("react/jsx-runtime");function _s(e){return e.length>12?`${e.slice(0,6)}\u2026${e.slice(-4)}`:e}function Cb({origin:e,delivered:t,recipient:r}){return(0,H.jsxs)("div",{className:"rd-flow","data-testid":"rd-flow-summary",children:[(0,H.jsxs)("span",{className:"rd-flow-pair",children:[(0,H.jsxs)("span",{className:"rd-flow-badge",children:[(0,H.jsx)(_r,{symbol:e.token.symbol,size:22}),(0,H.jsx)("span",{className:"rd-flow-badge-sub",children:(0,H.jsx)(to,{chainId:e.chainId,chainName:e.chainName,size:12})})]}),(0,H.jsxs)("span",{className:"rd-flow-name",children:[(0,H.jsx)("b",{children:e.token.symbol})," ",(0,H.jsxs)("small",{children:["on ",e.chainName]})]})]}),(0,H.jsx)("span",{className:"rd-flow-arrow","aria-hidden":"true",children:"\u2192"}),(0,H.jsxs)("span",{className:"rd-flow-pair",children:[t&&(0,H.jsx)(_r,{symbol:t.symbol,size:22}),(0,H.jsxs)("span",{className:"rd-flow-name",children:[(0,H.jsx)("b",{children:t?.symbol??"\u2026"})," ",(0,H.jsx)("small",{children:"on CROSS"})]})]}),r&&(0,H.jsxs)("span",{className:"rd-flow-to",children:["Delivered to ",(0,H.jsx)("code",{children:_s(r)})," \u2014 your CROSS wallet"]})]})}function Nb(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function Tb(e,t=6){let r=e.indexOf(".");if(r<0)return e;let n=e.slice(0,r+1+t).replace(/0+$/,"").replace(/\.$/,"");return n===""?"0":n}function Ib({order:e,delivered:t,onClose:r,recipient:n}){let o=Nb(e.status),i=e.status==="COMPLETED",a=(()=>{if(!t||o)return;let s=e.amountOut||e.expectedOut;if(s)try{let l=Tb(gt(BigInt(s),t.decimals));return`${e.amountOut?"+":"~"}${l} ${t.symbol}`}catch{return}})();return(0,H.jsxs)("div",{className:"rd-card rd-complete","data-testid":"rd-deposit-detected","data-variant":o?"danger":i?"success":"progress",children:[(0,H.jsx)("div",{className:`rd-complete-icon${o?" rd-complete-icon-fail":i?"":" rd-complete-icon-wait"}`,children:o?(0,H.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,H.jsx)("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})}):i?(0,H.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,H.jsx)("path",{d:"M4 12.5l5.2 5L20 7",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}):(0,H.jsx)("span",{className:"rd-spinner rd-complete-spinner"})}),(0,H.jsx)("h3",{className:"rd-complete-title",children:o?"Deposit didn't complete":i?"Deposit complete":"Deposit received!"}),a&&(0,H.jsx)("div",{className:"rd-complete-amount",children:a}),(0,H.jsx)("p",{className:"rd-complete-sub",children:o?`The transfer ended with status ${e.status}. Check the transfer history for details \u2014 deposited funds can be recovered.`:i?`Funds have been delivered to your wallet${n?` (${_s(n)})`:""}.`:`Your funds are being delivered to your wallet${n?` (${_s(n)})`:""}. You can close this window \u2014 delivery continues on its own.`}),r&&(i||o)&&(0,H.jsx)("div",{className:"rd-complete-actions",children:(0,H.jsx)("button",{type:"button",className:"rd-button-primary",onClick:r,"data-track":"close",children:"Done"})})]})}function tf({depositAddress:e,origin:t,amountSmallestUnits:r,depositState:n,onDeposit:o,canDeposit:i,oneClickEnabled:a=!0,quote:s,humanAmount:l,destination:c,detectedDeposit:u,minNotice:b,onClose:h,delivered:d,recipient:y}){let{phase:f,isSubmitting:m,isConfirming:w,isConfirmed:x,needsSwitch:p,reverted:k,error:R}=n,S=!!(s&&l?.trim()&&c),T=(0,H.jsx)(Cb,{origin:t,delivered:d??c,recipient:y});return u?(0,H.jsxs)(H.Fragment,{children:[T,(0,H.jsx)(Ib,{order:u,delivered:d??c,onClose:h,recipient:y})]}):(0,H.jsxs)(H.Fragment,{children:[T,S&&s&&c&&(0,H.jsxs)("div",{className:"rd-quote-summary","data-rd-quote-recap":"",children:[(0,H.jsxs)("span",{children:["You send ",(0,H.jsx)("strong",{children:l})," ",t.token.symbol]}),(0,H.jsx)("span",{className:"rd-quote-summary-arrow",children:"\u2192"}),(0,H.jsxs)("span",{children:["receive ~",(0,H.jsx)("strong",{children:(()=>{try{return gt(BigInt(s.expectedCrossd),c.decimals)}catch{return"--"}})()})," ",c.symbol]})]}),b&&(0,H.jsx)(fa,{minNotice:b,onlySend:{symbol:t.token.symbol,chainName:t.chainName}}),(0,H.jsx)(ef,{depositAddress:e,originChainId:t.chainId,originChainName:t.chainName,originCurrency:t.token.address,amount:r,tokenSymbol:t.token.symbol,tokenDecimals:t.token.decimals,minAmount:b?void 0:t.minAmount,hideTokenWarning:!!b,depositState:n,onDeposit:o,canDeposit:i,oneClickEnabled:a}),f!=="idle"&&!i&&(0,H.jsxs)("div",{className:"rd-card",children:[m&&(0,H.jsxs)("p",{className:"rd-muted",children:[(0,H.jsx)("span",{className:"rd-spinner"})," ",p?"Switching network...":"Confirm in wallet..."]}),w&&(0,H.jsxs)("p",{className:"rd-muted",children:[(0,H.jsx)("span",{className:"rd-spinner"})," Confirming..."]}),n.txHash&&(0,H.jsxs)("p",{className:"rd-card-hint",children:["Tx: ",(0,H.jsx)("span",{style:{fontFamily:"monospace"},children:n.txHash})]}),x&&k&&(0,H.jsx)("div",{className:"rd-callout rd-callout-danger",children:"The deposit transaction reverted on-chain. Please check your wallet and try again."}),x&&!k&&(0,H.jsx)("div",{className:"rd-callout rd-callout-success",children:"Deposit confirmed on-chain. Waiting for it to be swept..."}),R&&(0,H.jsx)("div",{className:"rd-callout rd-callout-danger",children:R})]}),(0,H.jsxs)("div",{className:"rd-live","data-testid":"rd-deposit-watch",children:[(0,H.jsxs)("div",{className:"rd-live-head",children:[(0,H.jsx)("span",{className:"rd-live-pulse","aria-hidden":"true"}),"Waiting for your deposit"]}),(0,H.jsxs)("p",{className:"rd-live-sub",children:["We're watching this address. Send ",(0,H.jsx)("b",{children:t.token.symbol})," on ",(0,H.jsx)("b",{children:t.chainName})," and the progress shows up here automatically \u2014 delivery continues even if you close this window."]})]})]})}var xr=require("react");var yr=require("react/jsx-runtime");function Ko({value:e,options:t,onChange:r,disabled:n,ariaLabel:o,id:i}){let a=(0,xr.useId)(),s=i??a,l=`${s}-listbox`,[c,u]=(0,xr.useState)(!1),b=t.findIndex(C=>C.value===e),[h,d]=(0,xr.useState)(b>=0?b:0),y=(0,xr.useRef)(null),f=(0,xr.useRef)(null),m=(0,xr.useRef)([]),w=!!n||t.length===0,x=b>=0?t[b]:void 0;(0,xr.useEffect)(()=>{if(!c)return;function C(M){y.current&&!y.current.contains(M.target)&&u(!1)}return document.addEventListener("pointerdown",C),()=>document.removeEventListener("pointerdown",C)},[c]),(0,xr.useEffect)(()=>{c&&m.current[h]?.scrollIntoView?.({block:"nearest"})},[c,h]);function p(){w||(d(b>=0?b:0),u(!0))}function k(C){u(!1),C&&f.current?.focus()}function R(C){let M=t[C];M&&(r(M.value),k(!0))}function S(){w||(c?k(!1):p())}function T(C){if(!w)switch(C.key){case"ArrowDown":C.preventDefault(),c?d(M=>Math.min(M+1,t.length-1)):p();break;case"ArrowUp":C.preventDefault(),c?d(M=>Math.max(M-1,0)):p();break;case"Enter":case" ":C.preventDefault(),c?R(h):p();break;case"Escape":c&&(C.preventDefault(),k(!0));break;case"Tab":c&&u(!1);break;default:break}}let N=c&&t[h]?`${s}-option-${h}`:void 0;return(0,yr.jsxs)("div",{className:"rd-dropdown",ref:y,children:[(0,yr.jsxs)("button",{type:"button",id:s,ref:f,className:"rd-dropdown-trigger","aria-haspopup":"listbox","aria-expanded":c,"aria-controls":l,"aria-activedescendant":N,"aria-label":o,disabled:w,onClick:S,onKeyDown:T,children:[(0,yr.jsxs)("span",{className:"rd-dropdown-trigger-content",children:[x?.icon,(0,yr.jsxs)("span",{className:"rd-dropdown-trigger-label",children:[x?.label??"",x?.subLabel&&(0,yr.jsx)("small",{className:"rd-dropdown-trigger-sub",children:x.subLabel})]})]}),(0,yr.jsx)("span",{className:"rd-dropdown-chevron","aria-hidden":"true",children:"\u25BE"})]}),c&&(0,yr.jsx)("ul",{className:"rd-dropdown-listbox",role:"listbox",id:l,"aria-label":o,tabIndex:-1,"data-vaul-no-drag":!0,children:t.map((C,M)=>{let B=C.value===e,W=M===h;return(0,yr.jsxs)("li",{id:`${s}-option-${M}`,role:"option","aria-selected":B,ref:L=>{m.current[M]=L},className:["rd-dropdown-option",W?"rd-dropdown-option-active":"",B?"rd-dropdown-option-selected":""].filter(Boolean).join(" "),onPointerEnter:()=>d(M),onClick:L=>{L.preventDefault(),R(M)},children:[C.icon,(0,yr.jsx)("span",{className:"rd-dropdown-option-label",children:C.label}),B&&(0,yr.jsx)("span",{className:"rd-dropdown-option-check","aria-hidden":"true",children:"\u2713"})]},C.value)})})]})}var $e=require("react/jsx-runtime");function Mb(e,t){if(!e)return"--";try{return gt(BigInt(e),t)}catch{return"--"}}function rf({quote:e,isLoading:t,error:r,humanAmount:n,originSymbol:o,destination:i}){return(0,$e.jsxs)("div",{className:"rd-stack","data-rd-quote-preview":"",children:[t&&(0,$e.jsxs)("div",{className:"rd-quote-strip","data-testid":"rd-quote-skeleton",children:[(0,$e.jsx)("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"30%"},"aria-hidden":"true"}),(0,$e.jsx)("span",{className:"rd-quote-strip-arrow","aria-hidden":"true",children:"\u2192"}),(0,$e.jsx)("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"30%"},"aria-hidden":"true"})]}),!t&&r&&(0,$e.jsxs)("div",{className:"rd-callout rd-callout-danger",children:["Couldn't fetch a quote: ",r.message]}),!t&&!r&&e&&o&&(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsxs)("div",{className:"rd-quote-strip",children:[(0,$e.jsxs)("span",{className:"rd-quote-strip-side",children:[(0,$e.jsxs)("b",{children:[n," ",o]}),(0,$e.jsx)("small",{children:"You send"})]}),(0,$e.jsx)("span",{className:"rd-quote-strip-arrow","aria-hidden":"true",children:"\u2192"}),(0,$e.jsxs)("span",{className:"rd-quote-strip-side rd-quote-strip-end",children:[(0,$e.jsxs)("b",{children:["~",Mb(e.expectedCrossd,i.decimals)," ",i.symbol]}),(0,$e.jsx)("small",{children:"You receive"})]})]}),e.belowMin&&(0,$e.jsx)("div",{className:"rd-callout rd-callout-warning",children:"This amount is below the minimum the bridge will accept. Increase the amount to continue."}),(e.assumesParity||e.feeUsd)&&(0,$e.jsxs)("p",{className:"rd-quote-strip-hint",children:[e.feeUsd&&(0,$e.jsxs)($e.Fragment,{children:["Bridge fee: $",e.feeUsd,", already deducted from the amount above. You also pay your own network fee to send the deposit."," "]}),e.assumesParity&&(0,$e.jsxs)($e.Fragment,{children:["Assumes 1:1 parity between bridged USDT and ",i.symbol,"; the final amount may differ slightly."]})]})]}),!t&&!r&&!e&&(0,$e.jsx)("p",{className:"rd-muted",children:"Enter an amount to see a quote."})]})}var Gs=require("react");var Le=require("react/jsx-runtime");function Eb(e){let t=new Map;for(let r of e.origins)t.has(r.chainId)||t.set(r.chainId,r.chainName);return Array.from(t,([r,n])=>({chainId:r,chainName:n}))}function nf(e,t){return t===void 0?[]:e.origins.filter(r=>r.chainId===t)}function Ab(e,t){let r=gt(e,t),n=r.indexOf(".");return n===-1?r:`${r.slice(0,n)}.${r.slice(n+1,n+1+4)}`.replace(/\.?0+$/,"")||r.slice(0,n)}function of({catalog:e,origin:t,onChangeOrigin:r,amount:n,onChangeAmount:o,showAmountInput:i=!0,recipient:a,onChangeRecipient:s,showRecipientInput:l=!0,recipientValid:c=!0,balance:u,balanceLoading:b,insufficientBalance:h,onMax:d,disabled:y}){let f=(0,Gs.useMemo)(()=>Eb(e),[e]),m=(0,Gs.useMemo)(()=>nf(e,t?.chainId),[e,t?.chainId]);function w(T){let N=Number(T),C=nf(e,N)[0];C&&r(C)}function x(T){let N=m.find(C=>C.token.address.toLowerCase()===T.toLowerCase());N&&r(N)}let p=t?`${gt(BigInt(t.minAmount),t.token.decimals)} ${t.token.symbol} min`:void 0,k=u?`${Ab(u.value,u.decimals)} ${u.symbol}`:void 0,R=h?`Amount exceeds your balance${k?` (${k})`:""}`:void 0,S=c?void 0:"Not a valid address";return(0,Le.jsxs)("section",{className:"rd-stack","data-rd-source-form":"",children:[(0,Le.jsxs)("div",{className:"rd-field",children:[(0,Le.jsxs)("div",{className:"rd-field-label-row",children:[(0,Le.jsx)("span",{className:"rd-field-label",children:"From"}),t&&(()=>{let T=Yu(t.chainId,t.token.address);return T?(0,Le.jsxs)("a",{className:"rd-token-explorer-link",href:T.url,target:"_blank",rel:"noopener noreferrer",title:`View ${t.token.symbol} on ${T.name}`,children:[T.name," \u2197"]}):null})()]}),(0,Le.jsxs)("div",{className:"rd-field-row",children:[(0,Le.jsx)(Ko,{ariaLabel:"Origin chain",value:t?String(t.chainId):"",onChange:w,disabled:y,options:f.map(T=>({value:String(T.chainId),label:T.chainName,subLabel:"Network",icon:(0,Le.jsx)(to,{chainId:T.chainId,chainName:T.chainName,size:22})}))}),(0,Le.jsx)(Ko,{ariaLabel:"Token",value:t?.token.address??"",onChange:x,disabled:y||m.length===0,options:m.map(T=>({value:T.token.address,label:T.token.symbol,subLabel:`${T.token.decimals} decimals`,icon:(0,Le.jsx)(_r,{symbol:T.token.symbol,logoUrl:T.token.logoUrl,size:22})}))})]})]}),i&&(0,Le.jsxs)("label",{className:"rd-field",children:[(0,Le.jsx)("span",{className:"rd-field-label",children:"Amount (optional)"}),(0,Le.jsxs)("div",{className:"rd-amount-input","data-rd-invalid":R?"":void 0,children:[(0,Le.jsx)("input",{type:"text",inputMode:"decimal",placeholder:"0.0",value:n,onChange:T=>{let N=T.target.value;if(N===""){o(N);return}N.startsWith(".")&&(N=`0${N}`),/^\d*\.?\d{0,4}$/.test(N)&&(N=N.replace(/^0+(?=\d)/,""),!((N.split(".")[0]??"").length>12)&&o(N))},disabled:y||!t,"data-vaul-no-drag":!0}),t&&(0,Le.jsx)("span",{className:"rd-amount-input-suffix",children:t.token.symbol}),d&&!y&&(0,Le.jsx)("button",{type:"button",className:"rd-amount-input-max",onClick:d,disabled:y||!t,children:"Max"})]}),(k||b||p)&&(0,Le.jsxs)("span",{className:"rd-amount-meta",children:[(0,Le.jsx)("span",{children:p??""}),(0,Le.jsx)("span",{children:b?"Balance: \u2026":k?`Balance: ${k}`:""})]}),R&&(0,Le.jsx)("span",{className:"rd-callout rd-callout-danger",children:R})]}),l&&(0,Le.jsxs)("label",{className:"rd-field",children:[(0,Le.jsx)("span",{className:"rd-field-label",children:"ONEchain recipient address"}),(0,Le.jsx)("input",{type:"text",placeholder:"0x...",value:a,onChange:T=>s(T.target.value),disabled:y,"data-vaul-no-drag":!0}),(0,Le.jsx)("span",{className:"rd-card-hint",children:"Defaults to your connected wallet. This is where your delivery token is received on ONEchain -- it can differ from the address you deposit from, and is also used as the refund address if anything goes wrong."}),S&&(0,Le.jsx)("span",{className:"rd-callout rd-callout-danger",children:S})]}),!l&&a.trim().length>0&&(0,Le.jsxs)("div",{className:"rd-field",children:[(0,Le.jsx)("span",{className:"rd-field-label",children:"ONEchain recipient address"}),(0,Le.jsx)("div",{className:"rd-static-target",children:(0,Le.jsx)("span",{className:"rd-token-address-addr",children:a})}),(0,Le.jsx)("span",{className:"rd-card-hint",children:"Set by the host -- this is where your delivery token is received on ONEchain."})]})]})}var it=require("react/jsx-runtime");function af({catalog:e,origin:t,onChangeOrigin:r,amount:n,onChangeAmount:o,showAmountInput:i,minNotice:a,onMax:s,recipient:l,onChangeRecipient:c,showRecipientInput:u,recipientValid:b,balance:h,balanceLoading:d,insufficientBalance:y,targetOptions:f,selectedTarget:m,onChangeTarget:w,showTargetSelector:x,quote:p,quoteLoading:k,quoteError:R,depositAddressLoading:S,depositAddressError:T,canContinue:N,continueBlockedHint:C,onContinue:M}){let B=f.length>1&&x;return(0,it.jsxs)(it.Fragment,{children:[(0,it.jsx)(of,{catalog:e,origin:t,onChangeOrigin:r,amount:n,onChangeAmount:o,showAmountInput:i,recipient:l,onChangeRecipient:c,showRecipientInput:u,recipientValid:b,balance:h,balanceLoading:d,insufficientBalance:y,onMax:s}),B&&(0,it.jsxs)("div",{className:"rd-field",children:[(0,it.jsx)("span",{className:"rd-field-label",children:"Deliver as"}),(0,it.jsx)(Ko,{ariaLabel:"Delivery token",value:m?.symbol??"",onChange:w,options:f.map(W=>({value:W.symbol,label:W.symbol,subLabel:"on ONEchain",icon:(0,it.jsx)(_r,{symbol:W.symbol,size:22})}))})]}),!B&&m&&(0,it.jsxs)("div",{className:"rd-field",children:[(0,it.jsx)("span",{className:"rd-field-label",children:"Deliver as"}),(0,it.jsxs)("div",{className:"rd-static-target",children:[(0,it.jsx)(_r,{symbol:m.symbol,size:22}),(0,it.jsx)("span",{children:m.symbol})]})]}),m?.external&&(0,it.jsxs)("div",{className:"rd-callout rd-callout-muted",children:["Delivered as ",m.symbol," via an external adapter."]}),S&&(0,it.jsxs)("p",{className:"rd-muted",children:[(0,it.jsx)("span",{className:"rd-spinner"})," Fetching your deposit address..."]}),T&&(0,it.jsxs)("div",{className:"rd-callout rd-callout-danger",children:["Couldn't fetch a deposit address: ",T.message]}),a&&(0,it.jsx)(fa,{minNotice:a}),C&&(0,it.jsx)("div",{className:"rd-callout rd-callout-warning",children:C}),n.trim()&&(0,it.jsx)(rf,{quote:p,isLoading:k,error:R,humanAmount:n,originSymbol:t.token.symbol,destination:e.destination}),(0,it.jsx)("div",{className:"rd-step-nav",children:(0,it.jsx)("button",{type:"button",className:"rd-button-primary rd-button-block","data-track":"continue",disabled:!N,onClick:M,children:"Continue"})})]})}var ue=require("react/jsx-runtime");function Lb(){return(0,ue.jsx)("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:(0,ue.jsx)("path",{d:"M19.14 12.94c.04-.31.06-.62.06-.94 0-.32-.02-.63-.06-.94l2.03-1.58a.5.5 0 0 0 .12-.64l-1.92-3.32a.5.5 0 0 0-.6-.22l-2.39.96a7.03 7.03 0 0 0-1.62-.94l-.36-2.54a.5.5 0 0 0-.5-.42h-3.84a.5.5 0 0 0-.5.42l-.36 2.54c-.59.24-1.13.56-1.62.94l-2.39-.96a.5.5 0 0 0-.6.22L2.71 8.84a.5.5 0 0 0 .12.64l2.03 1.58c-.04.31-.06.63-.06.94 0 .32.02.63.06.94l-2.03 1.58a.5.5 0 0 0-.12.64l1.92 3.32c.14.24.42.32.6.22l2.39-.96c.49.38 1.03.7 1.62.94l.36 2.54c.05.24.26.42.5.42h3.84c.24 0 .45-.18.5-.42l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.24.1.5 0 .6-.22l1.92-3.32a.5.5 0 0 0-.12-.64zM12 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7",fill:"currentColor"})})}function lf({className:e}){let t=Ho();return(0,ue.jsx)(ve,{feature:"relay",children:(0,ue.jsx)(oo,{ariaTitle:"Deposit",className:e??t.className,children:(0,ue.jsx)(Db,{})})})}function Db(){let e=Ho(),{theme:t,isMobile:r,setOpen:n}=Er(),o=Fu(),i=sf.useCallback(et=>{if(!r)return;let Qe=et.target;Qe instanceof HTMLElement&&(Qe.tagName!=="INPUT"&&Qe.tagName!=="TEXTAREA"||window.setTimeout(()=>{Qe.scrollIntoView({block:"center",behavior:"smooth"})},250))},[r]);if(!o)return null;let{step:a,goToSource:s,goToExecute:l,recoveryOpen:c,setRecoveryOpen:u,resolvedApiBaseUrl:b,wallet:h,catalog:d,catalogLoading:y,catalogError:f,origin:m,setOrigin:w,amount:x,setAmount:p,recipient:k,setRecipient:R,recipientValid:S,balance:T,balanceLoading:N,insufficientBalance:C,depositAddress:M,depositAddressLoading:B,depositAddressError:W,quote:L,quoteLoading:$,quoteError:P,canDeposit:F,deposit:de,depositState:V,detectedDeposit:_,targetOptions:we,selectedTarget:ee,setSelectedTarget:Z,showAmountInput:j,minNotice:ie,showRecipientInput:re,showTargetSelector:Se,showOneClick:ye,showConnectPrompt:ne,showRecipientHint:Ne,canRecover:Oe,recoverableCount:xe,recoveryTargets:Be,recoveryOrders:ge,refreshRecovery:Ze,trustedFactories:dt,canContinue:Fe,continueBlockedHint:Ue,amountSmallestUnits:De,onMax:ht}=o;return(0,ue.jsxs)("div",{className:"rd-root rd-wizard","data-theme":t,"data-rd-step":a,onFocusCapture:i,children:[(0,ue.jsxs)("div",{className:"rd-wizard-header",children:[a==="execute"&&(0,ue.jsx)("button",{type:"button",className:"rd-back-arrow","aria-label":"Back","data-track":"back",disabled:V.isSubmitting||V.isConfirming,onClick:s,children:(0,ue.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,ue.jsx)("path",{d:"M15 18l-6-6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,ue.jsxs)("div",{className:"rd-wizard-actions",children:[Oe&&(0,ue.jsxs)("button",{type:"button",className:"rd-icon-button","aria-label":"Recovery settings","aria-expanded":c,"data-track":"recovery_toggle",onClick:()=>u(et=>!et),children:[(0,ue.jsx)(Lb,{}),xe>0&&(0,ue.jsx)("span",{className:"rd-recovery-badge","data-testid":"recovery-badge",children:xe})]}),!r&&(0,ue.jsx)("button",{type:"button",className:"rd-icon-button","aria-label":"Close","data-track":"close",onClick:()=>n(!1),children:(0,ue.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,ue.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),Oe&&c&&(0,ue.jsx)(ua,{client:e.client,apiBaseUrl:b,recipient:k,target:ee?.symbol,wallet:h,trustedFactories:dt,targets:Be.length>0?Be:void 0,orders:ge,onRecovered:Ze,onError:e.onError}),y&&(0,ue.jsxs)("div",{className:"rd-skeleton-form","data-testid":"rd-source-skeleton","aria-hidden":"true",children:[(0,ue.jsx)("span",{className:"rd-skeleton rd-skeleton-line"}),(0,ue.jsx)("span",{className:"rd-skeleton rd-skeleton-field"}),(0,ue.jsx)("span",{className:"rd-skeleton rd-skeleton-line"}),(0,ue.jsx)("span",{className:"rd-skeleton rd-skeleton-field"}),(0,ue.jsx)("span",{className:"rd-skeleton rd-skeleton-notice"}),(0,ue.jsx)("span",{className:"rd-skeleton rd-skeleton-cta"})]}),f&&(0,ue.jsxs)("div",{className:"rd-callout rd-callout-danger",children:["Failed to load configuration: ",f.message]}),ne&&(0,ue.jsxs)("section",{className:"rd-card","data-rd-connect-prompt":"",children:[(0,ue.jsx)("p",{className:"rd-card-hint",children:re?"Connect a wallet or provide a recipient address to get a deposit address.":"Connect a wallet to get your deposit address."}),e.onRequestConnect&&(0,ue.jsx)("button",{type:"button",className:"rd-button-primary rd-button-block","data-track":"connect",onClick:e.onRequestConnect,children:"Connect Wallet"})]}),Ne&&(0,ue.jsx)("div",{className:"rd-callout rd-callout-muted",children:re?"Connect a wallet or provide a recipient address to fetch your deposit address.":"Connect a wallet to fetch your deposit address."}),d&&m&&a==="source"&&(0,ue.jsx)(af,{catalog:d,origin:m,onChangeOrigin:w,amount:x,onChangeAmount:p,showAmountInput:j,minNotice:j?void 0:ie,onMax:ht,recipient:k,onChangeRecipient:R,showRecipientInput:re,recipientValid:S,balance:T,balanceLoading:N,insufficientBalance:C,targetOptions:we,selectedTarget:ee,onChangeTarget:Z,showTargetSelector:Se,quote:L,quoteLoading:$,quoteError:P,depositAddressLoading:B,depositAddressError:W,canContinue:Fe,continueBlockedHint:Ue,onContinue:l}),d&&m&&a==="execute"&&M&&(0,ue.jsx)(tf,{depositAddress:M,origin:m,minNotice:j?void 0:ie,amountSmallestUnits:De,depositState:V,onDeposit:()=>{de()},canDeposit:F&&ye,oneClickEnabled:ye,quote:L,humanAmount:x,destination:d?.destination,detectedDeposit:_,onClose:()=>n(!1),recipient:S?k:void 0,delivered:ee?{symbol:ee.symbol,decimals:ee.decimals}:d?{symbol:d.destination.symbol,decimals:d.destination.decimals}:void 0}),a==="execute"&&!M&&(0,ue.jsxs)(ue.Fragment,{children:[B&&(0,ue.jsxs)("div",{className:"rd-skeleton-address","data-testid":"rd-address-skeleton","aria-hidden":"true",children:[(0,ue.jsx)("span",{className:"rd-skeleton rd-skeleton-qr"}),(0,ue.jsx)("span",{className:"rd-skeleton rd-skeleton-chip"}),(0,ue.jsx)("span",{className:"rd-skeleton rd-skeleton-line"})]}),W&&(0,ue.jsxs)("div",{className:"rd-callout rd-callout-danger",children:["Couldn't fetch a deposit address: ",W.message]}),(0,ue.jsx)("div",{className:"rd-step-nav",children:(0,ue.jsx)("button",{type:"button",className:"rd-button-secondary rd-button-block","data-track":"back",onClick:s,children:"Back"})})]}),(0,ue.jsxs)("p",{className:"rd-footer-note",children:["Final asset is always ",ee?.symbol??d?.destination.symbol??"ONEUSD"," on ONEchain. This is a reusable deposit address -- it accepts any number of deposits over time",j?", with or without an amount entered here":"","."]})]})}var ma=require("react/jsx-runtime");function cf({asChild:e,children:t}){return(0,ma.jsx)(ve,{feature:"relay",children:(0,ma.jsx)(no,{asChild:e??t!=null,children:t??(0,ma.jsx)("button",{type:"button","data-track":"open",children:"Deposit"})})})}var Ce=Q(require("react"),1);var le=require("react");var ga=require("react");function df(e,t){let[r,n]=(0,ga.useState)(e);return(0,ga.useEffect)(()=>{let o=setTimeout(()=>n(e),t);return()=>clearTimeout(o)},[e,t]),r}var Pb=500,uf=56,pf={chainId:uf,token:"0x55d398326f99059fF775485246999027B3197955"},ff=3e4,Bb=5e3;function zb(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?ff:Math.max(Bb,e*1e3)}var Ob=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];function Hs(e,t){let r=e.trim();if(!r)return null;try{let n=aa(r,t);return n>0n?n:null}catch{return null}}function mf(e={}){let t=(0,le.useRef)(e);t.current=e;let r=(0,le.useMemo)(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useDepositAddress: either `client` or `apiBaseUrl` must be provided");return rr({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.wallet,o=n?.walletAddress,i=!!o,a=n?.walletChainId,[s,l]=(0,le.useState)(),[c,u]=(0,le.useState)(!0),[b,h]=(0,le.useState)();(0,le.useEffect)(()=>{let A=!1;return u(!0),r.getConfig().then(E=>{A||(l(E),h(void 0))}).catch(E=>{A||h(E instanceof Error?E:new Error(String(E)))}).finally(()=>{A||u(!1)}),()=>{A=!0}},[r]);let d=e.chains,y=(0,le.useMemo)(()=>{if(!s)return[];if(!d||d.length===0)return s.origins;let A=new Set(d);return s.origins.filter(E=>A.has(E.chainId))},[s,d]),f=(0,le.useMemo)(()=>s?{...s,origins:y}:void 0,[s,y]),[m,w]=(0,le.useState)();(0,le.useEffect)(()=>{if(m||y.length===0)return;let A=t.current.defaultToken,E=A?y.find(z=>z.chainId===A.chainId&&z.token.address.toLowerCase()===A.address.toLowerCase()):void 0;w(E??y[0])},[y,m]);let[x,p]=(0,le.useState)(),k=(0,le.useCallback)(()=>{tt(void 0),st(!1),_t(!1),O(!1),jt(void 0)},[]),R=(0,le.useCallback)(A=>{w(A),p(void 0),k()},[k]),S=m?.kind==="svm",[T,N]=(0,le.useState)(""),C=e.amount!==void 0?e.amount:T,M=(0,le.useCallback)(A=>{N(A),p(void 0),k()},[k]),B=df(C,Pb),W=m?Hs(B,m.token.decimals):null,L=m?Hs(C,m.token.decimals):null,[$,P]=(0,le.useState)(""),[F,de]=(0,le.useState)(!1),V=e.recipient!==void 0?e.recipient:$,_=(0,le.useCallback)(A=>{P(A),de(!0),p(void 0),k()},[k]);(0,le.useEffect)(()=>{e.recipient===void 0&&o&&!F&&P(o)},[o,F,e.recipient]);let we=V.length===0||At(V),ee=V.length>0&&At(V)?V:void 0,[Z,j]=(0,le.useState)(),[ie,re]=(0,le.useState)(!1),[Se,ye]=(0,le.useState)(0),ne=n?.getBalance;(0,le.useEffect)(()=>{if(!ne||!o||!m||S){j(void 0),re(!1);return}let A=!1;re(!0);let E=m.token.address.toLowerCase()===Qo?void 0:m.token.address;return ne({chainId:m.chainId,address:o,token:E}).then(z=>{A||j({...z,formatted:gt(z.value,z.decimals)})}).catch(()=>{A||j(void 0)}).finally(()=>{A||re(!1)}),()=>{A=!0}},[ne,o,m,S,Se]);let Ne=Z?.value??null,Oe=!S&&L!==null&&Ne!==null&&L>Ne,[xe,Be]=(0,le.useState)(),[ge,Ze]=(0,le.useState)(!1),[dt,Fe]=(0,le.useState)(),Ue=m?.chainId,De=m?.token.address,ht=e.target;(0,le.useEffect)(()=>{if(!ee||!Ue||!De){Be(void 0),Fe(void 0),Ze(!1);return}let A=!1;return Be(void 0),Fe(void 0),Ze(!0),(ht?r.getDepositAddress({user:ee,originChainId:Ue,originCurrency:De},ht):r.getDepositAddress({user:ee,originChainId:Ue,originCurrency:De})).then(z=>{A||(Be(z),Fe(void 0),t.current.onDepositAddress?.(z))}).catch(z=>{if(A)return;Be(void 0);let he=z instanceof Error?z:new Error(String(z));Fe(he),t.current.onError?.(he)}).finally(()=>{A||Ze(!1)}),()=>{A=!0}},[r,ee,Ue,De,ht]);let et=[Ue??"",(De??"").toLowerCase(),(ee??"").toLowerCase(),ht??"",C.trim()].join("|"),Qe=(0,le.useRef)(et);(0,le.useEffect)(()=>{Qe.current!==et&&(Qe.current=et,p(void 0),k())},[et,k]);let[Mt,vt]=(0,le.useState)(),[Dt,je]=(0,le.useState)(!1),[Pt,kt]=(0,le.useState)(),Rt=W?.toString();(0,le.useEffect)(()=>{if(!Ue||!De||!Rt){vt(void 0),kt(void 0),je(!1);return}let A=!1,E,z=!0;async function he(){z&&je(!0);let ze=ff;try{let Ct=await r.getQuote({originChainId:Ue,originCurrency:De,amount:Rt});if(A)return;vt(Ct),kt(void 0),ze=zb(Ct.ttl)}catch(Ct){if(A)return;vt(void 0),kt(Ct instanceof Error?Ct:new Error(String(Ct)))}finally{A||je(!1),z=!1}A||(E=setTimeout(he,ze))}return he(),()=>{A=!0,E&&clearTimeout(E)}},[r,Ue,De,Rt]);let[Zt,Bt]=(0,le.useState)(!1),[We,pt]=(0,le.useState)(!1),[Ge,tt]=(0,le.useState)(),[at,jt]=(0,le.useState)(),[Wt,st]=(0,le.useState)(!1),[zt,_t]=(0,le.useState)(!1),[Xt,O]=(0,le.useState)(!1),se=n?.waitForReceipt,Ve=(0,le.useRef)(void 0);(0,le.useEffect)(()=>{if(!Ge||!m||!se)return;let A=!1;return st(!0),_t(!1),O(!1),se({chainId:m.chainId,hash:Ge}).then(E=>{A||(_t(!0),O(E.status==="reverted"),ye(z=>z+1),E.status!=="reverted"&&Ge!==Ve.current&&(Ve.current=Ge,t.current.onDeposited?.(Ge)))}).catch(E=>{A||jt(E instanceof Error?E.message:String(E))}).finally(()=>{A||st(!1)}),()=>{A=!0}},[Ge,se]);let St=a!==void 0&&m!==void 0&&a!==m.chainId,ut=Zt||We,Gt=x??at,Ht="idle";Gt?Ht="error":zt?Ht="confirmed":Wt?Ht="confirming":ut&&(Ht=Zt?"switching":"pending");let Ar={phase:Ht,isSubmitting:ut,isConfirming:Wt,isConfirmed:zt,needsSwitch:St,txHash:Ge,reverted:zt&&Xt,error:Gt},rn=!!(m&&xe&&xe.originChainId===m.chainId&&xe.originCurrency.toLowerCase()===m.token.address.toLowerCase()),lr=!!(n?.sendTransaction&&n?.writeContract&&n?.readContract&&n?.waitForReceipt),nn=!!(i&&lr&&m&&!S&&xe&&rn&&L&&L>0n&&!Oe&&!ut&&!Wt),gn=(0,le.useCallback)(async()=>{if(S||!m||!xe||!n?.sendTransaction||!n?.writeContract)return;p(void 0);let A=Hs(C,m.token.decimals);if(!A||A<=0n){p("enter an amount to use the one-click deposit");return}let E=m.token.address.toLowerCase()===Qo,z=xe.depositAddress,he=await Wu(n?.readContract,uf,{forwarder:xe.forwarder,recipient:ee,version:xe.version,trusted:t.current.trustedFactories});if(!he.ok){p(`address verification failed: ${he.reason}`);return}if(m.chainId===pf.chainId&&m.token.address.toLowerCase()===pf.token.toLowerCase()&&!_u(z,xe.forwarder)){p("address verification failed: deposit address does not match the verified forwarder (expected them to be identical on this route; check the backend's direct_same_token setting)");return}try{if(St){if(!n?.switchChain)throw new Error("wallet cannot switch chains");Bt(!0);try{await n.switchChain(m.chainId)}finally{Bt(!1)}}k(),pt(!0);try{let Ct=E?await n.sendTransaction({chainId:m.chainId,to:z,value:A}):await n.writeContract({chainId:m.chainId,address:m.token.address,abi:Ob,functionName:"transfer",args:[z,A]});tt(Ct)}finally{pt(!1)}}catch(Ct){p(Ct.message)}},[S,m,xe,C,St,n,ee,k]);return{address:o,isConnected:i,catalog:f,catalogLoading:c,catalogError:b,origin:m,setOrigin:R,recipient:V,setRecipient:_,recipientValid:we,amount:C,setAmount:M,balance:Z,balanceLoading:ie,insufficientBalance:Oe,isSvmOrigin:S,depositAddress:xe?.depositAddress,depositAddressResult:xe,depositAddressLoading:ge,depositAddressError:dt,quote:Mt,quoteLoading:Dt,quoteError:Pt,canDeposit:nn,deposit:gn,depositState:Ar}}var tn=require("react");var Fb=3e4,Ub=300;function On(e){let t=(0,tn.useRef)(e);t.current=e;let{client:r,enabled:n=!0}=e,o=e.recipient&&At(e.recipient)?e.recipient:void 0,[i,a]=(0,tn.useState)([]),[s,l]=(0,tn.useState)(!1),[c,u]=(0,tn.useState)(),[b,h]=(0,tn.useState)(!1);return(0,tn.useEffect)(()=>{if(!o){a([]),u(void 0),l(!1),h(!1);return}if(!n){a([]),u(void 0),l(!1),h(!1);return}let d=!1,y=!0,f,m=0;async function w(){let R=++m;y&&l(!0);try{let S=await r.listOrders(o);if(d)return;R===m&&(a(S),u(void 0))}catch(S){if(d)return;let T=S instanceof Error?S:new Error(String(S));R===m&&(u(T),t.current.onError?.(T))}finally{d||(l(!1),h(!0)),y=!1}}function x(){f&&clearTimeout(f),f=setTimeout(()=>{f=void 0,d||w()},Ub)}w();let p;typeof EventSource<"u"&&(p=new EventSource(r.ordersStreamUrl(o)),p.addEventListener("orders-changed",x),p.onopen=()=>{x()});let k=setInterval(()=>{w()},Fb);return()=>{d=!0,f&&clearTimeout(f),clearInterval(k),p?.close()}},[r,o,n]),{orders:i,ordersLoading:s,ordersError:c,ordersInitialized:b}}var ha=require("react");function gf(e,t){if(t){let r=e.find(n=>n.symbol===t);if(r)return r}return e.find(r=>r.isDefault)??e[0]}function hf({catalogTargets:e,filter:t,defaultTarget:r}){let n=(0,ha.useMemo)(()=>{if(!t||t.length===0)return e;let l=new Set(t);return e.filter(c=>l.has(c.symbol))},[e,t]),[o,i]=(0,ha.useState)(()=>gf(n,r)?.symbol),a=(o!==void 0?n.find(l=>l.symbol===o):void 0)??gf(n,r);function s(l){n.some(c=>c.symbol===l)&&i(l)}return{options:n,selected:a,setSelected:s}}var jb={dev:"https://dev-relay-protocol-api.onechain.nexus",stage:"https://dev-relay-protocol-api.onechain.nexus",production:"https://relay-protocol-api.onechain.nexus"};function mn(e){return e.apiBaseUrl?e.apiBaseUrl:jb[Xe(e.environment)]}var wa=require("react/jsx-runtime");function Wb(e,t,r,n,o){return{client:e.client,apiBaseUrl:n,wallet:r,chains:e.chains,recipient:e.recipient,amount:e.amount,defaultToken:e.defaultToken,target:t,trustedFactories:o,onDepositAddress:e.onDepositAddress,onDeposited:e.onDeposited,onError:e.onError}}function ba(e,t){let r=e.trim();if(!r)return 0n;try{let n=aa(r,t);return n>0n?n:0n}catch{return 0n}}function bf({open:e,children:t}){let[r]=Ce.useState(Ou);return(0,wa.jsxs)(zs.Provider,{value:r,children:[e&&(0,wa.jsx)(_b,{store:r}),t]})}function _b({store:e}){let t=Ho(),{showTargetSelector:r=!0}=t,[n,o]=Ce.useState("source"),[i,a]=Ce.useState(!1);Ce.useEffect(()=>{Ae("relay","opened")},[]);let[s,l]=Ce.useState(void 0),c=Ce.useMemo(()=>mn({apiBaseUrl:t.apiBaseUrl,environment:t.environment}),[t.apiBaseUrl,t.environment]),u=Ce.useMemo(()=>({walletAddress:t.walletAddress,walletChainId:t.walletChainId,sendTransaction:t.sendTransaction,writeContract:t.writeContract,readContract:t.readContract,switchChain:t.switchChain,waitForReceipt:t.waitForReceipt,getBalance:t.getBalance}),[t.walletAddress,t.walletChainId,t.sendTransaction,t.writeContract,t.readContract,t.switchChain,t.waitForReceipt,t.getBalance]),b=Xe(t.environment),h=Sr("apps.json",b,E=>({min:cr(E?.relay?.minDepositAmount,b),max:cr(E?.relay?.maxDepositAmount,b),trustedFactories:cr(E?.relay?.trustedFactories,b)})),d=Ce.useMemo(()=>t.trustedFactories??la(h?.trustedFactories),[t.trustedFactories,h?.trustedFactories]),{isConnected:y,catalog:f,catalogLoading:m,catalogError:w,origin:x,setOrigin:p,amount:k,setAmount:R,recipient:S,setRecipient:T,recipientValid:N,balance:C,balanceLoading:M,insufficientBalance:B,depositAddress:W,depositAddressResult:L,depositAddressLoading:$,depositAddressError:P,quote:F,quoteLoading:de,quoteError:V,canDeposit:_,deposit:we,depositState:ee}=mf(Wb(t,s,u,c,d)),{options:Z,selected:j,setSelected:ie}=hf({catalogTargets:f?.targets??[],filter:t.targetTokens,defaultTarget:t.defaultTarget});Ce.useEffect(()=>{l(j?.symbol)},[j?.symbol]);let re=t.amount===void 0&&!t.hideAmount,Se=(t.showRecipientInput??!0)&&t.recipient===void 0,ye=N&&S.trim().length>0&&At(S),ne=t.recipient!==void 0&&t.recipient.trim().length>0,Ne=!y&&!ne&&!ye,Oe=!!f&&!ye&&!Ne,xe=(t.showRecovery??!1)&&y&&!!(u.writeContract&&u.readContract&&u.waitForReceipt),Be=Ce.useMemo(()=>t.client?t.client:rr({baseUrl:c}),[t.client,c]),[ge,Ze]=Ce.useState({}),[dt,Fe]=Ce.useState(0),Ue=Ce.useCallback(()=>Fe(E=>E+1),[]),De=ee.isConfirmed,{orders:ht}=On({client:Be,recipient:i&&ye?S:void 0,enabled:i&&ye}),et=n==="execute"&&ye,{orders:Qe,ordersLoading:Mt,ordersError:vt,ordersInitialized:Dt}=On({client:Be,recipient:et?S:void 0,enabled:et}),je=Ce.useRef(null),Pt=Ce.useRef(new Set),[kt,Rt]=Ce.useState();Ce.useEffect(()=>{et||(je.current=null,Pt.current=new Set,Rt(void 0))},[et]);let Zt=Ce.useRef(t.onDepositDetected);Zt.current=t.onDepositDetected,Ce.useEffect(()=>{if(!(!et||!Dt||Mt||vt)){if(je.current===null){je.current=new Set(Qe.map(E=>E.orderId));return}for(let E of Qe)if(!(je.current.has(E.orderId)||Pt.current.has(E.orderId))){Pt.current.add(E.orderId),Rt(E.orderId),Zt.current?.(E);break}}},[et,Qe,Mt,vt,Dt]);let Bt=kt?Qe.find(E=>E.orderId===kt):void 0;Ce.useEffect(()=>{let E=f?.targets??[];if(!xe||!ye||E.length===0){Ze({});return}let z=!1;return Promise.all(E.map(he=>Be.getRecovery({user:S,target:he.symbol}).catch(()=>{}))).then(he=>{if(z)return;let ze={};E.forEach((Ct,kr)=>{let io=he[kr];io&&(ze[Ct.symbol]=io)}),Ze(ze)}),()=>{z=!0}},[Be,xe,ye,S,f,De,dt]);let We=Ce.useMemo(()=>(f?.targets??[]).map(E=>({symbol:E.symbol,isDefault:E.isDefault,info:ge[E.symbol]})).filter(E=>E.info!==void 0),[f,ge]),pt=Ce.useMemo(()=>ca($n(We)),[We]),[Ge,tt]=Ce.useState(void 0),at=!!f&&(f?.targets.length??0)>0&&!s;Ce.useEffect(()=>{if(!ye||!x||at){tt(void 0);return}let E=!1;return Be.getRecovery({user:S,target:s||void 0}).then(z=>{if(E)return;if(!z||z.suggestedAction!=="sweep"){tt(void 0);return}let he;try{he=BigInt(z.balance)}catch{tt(void 0);return}let ze=Number(z.decimals);if(he<=0n||!Number.isInteger(ze)||ze<0){tt(void 0);return}let Ct=z.tokens?.find(kr=>kr.address?.toLowerCase()===z.token?.toLowerCase()&&kr.symbol)?.symbol;tt({balance:he,decimals:ze,symbol:Ct})}).catch(()=>{E||tt(void 0)}),()=>{E=!0}},[Be,ye,S,s,at,x,De]);let jt=Ce.useCallback(()=>{!x||!C||R(gt(C.value,x.token.decimals))},[x,C,R]),Wt=Ce.useCallback(()=>{o("execute"),Ae("relay","deposit_address_shown")},[]),st=Ce.useCallback(()=>{o("source"),Ae("relay","source_reopened")},[]),zt=ee.txHash;Ce.useEffect(()=>{zt&&Ae("relay","deposit_submitted")},[zt]);let _t=(()=>{let E=Number(h?.min);return Number.isFinite(E)&&E>=0?String(h?.min):"6"})(),Xt=(()=>{let E=Number(h?.max);return Number.isFinite(E)&&E>0?String(h?.max):void 0})(),O=(()=>{if(!x)return 0n;let E=ba(_t,x.token.decimals),z=BigInt(x.minAmount);return E>z?E:z})(),se=x?gt(O,x.token.decimals):_t,Ve=(()=>{if(!x||!Ge||O<=0n)return;let E=x.token.decimals,z=Ge.decimals,he=E>=z?Ge.balance*10n**BigInt(E-z):Ge.balance/10n**BigInt(z-E);if(he>=O)return;let ze=O-he;return{pending:gt(Ge.balance,z),pendingSymbol:Ge.symbol,remaining:gt(ze,E)}})(),St=x&&Xt?ba(Xt,x.token.decimals):void 0,ut=x&&k.trim()?ba(k,x.token.decimals):0n,Gt=!!(x&&ut>0n&&ut<O),Ht=!!(x&&St!==void 0&&ut>0n&&ut>St),Ar=(()=>{if(x){if(Gt)return`Amount is below the ${se} ${x.token.symbol} minimum.`;if(Ht)return`Amount is above the ${Xt} ${x.token.symbol} maximum.`}})(),rn=t.showOneClickDeposit??!1,lr=!!k.trim()&&(de||!!V||!F),nn=!!L&&!$&&N&&!Gt&&!Ht&&!lr,gn=x&&k.trim()?ba(k,x.token.decimals).toString():void 0,A={step:n,goToSource:st,goToExecute:Wt,recoveryOpen:i,setRecoveryOpen:a,resolvedApiBaseUrl:c,wallet:u,catalog:f,catalogLoading:m,catalogError:w,origin:x,setOrigin:p,amount:k,setAmount:R,recipient:S,setRecipient:T,recipientValid:N,balance:C,balanceLoading:M,insufficientBalance:B,depositAddress:W,depositAddressLoading:$,depositAddressError:P,quote:F,quoteLoading:de,quoteError:V,canDeposit:_,deposit:we,depositState:ee,detectedDeposit:Bt,targetOptions:Z,selectedTarget:j,setSelectedTarget:ie,showAmountInput:re,minNotice:x?{min:se,symbol:x.token.symbol,...Ve}:void 0,showRecipientInput:Se,showTargetSelector:r,showOneClick:rn,showConnectPrompt:Ne,showRecipientHint:Oe,canRecover:xe,recoverableCount:pt,recoveryTargets:We,recoveryOrders:ht,refreshRecovery:Ue,trustedFactories:d,canContinue:nn,continueBlockedHint:Ar,amountSmallestUnits:gn,onMax:re&&C&&C.value>0n?jt:void 0};return Ce.useLayoutEffect(()=>{e.publish(A)}),Ce.useLayoutEffect(()=>()=>e.publish(null),[e]),null}var ya=require("react/jsx-runtime");function Gb(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:c,children:u}=e,[b,h]=xa.useState(!1),d=l!==void 0,y=d?l:b,f=xa.useCallback(m=>{d||h(m),c?.(m)},[d,c]);return(0,ya.jsx)(Bs.Provider,{value:e,children:(0,ya.jsx)(bf,{open:y,children:(0,ya.jsx)(ro,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:y,onOpenChange:f,children:u})})})}var Qs=Object.assign(Gb,{Trigger:cf,Content:lf});var va=require("react"),Vs=(0,va.createContext)(null);function Ys(){let e=(0,va.useContext)(Vs);if(!e)throw new Error("RelayHistory compound components must be used within <RelayHistory>");return e}var fr=Q(require("react"),1);var yf=require("react");var ce=require("react/jsx-runtime"),Zo=56;function Hb(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function Qb(e){return e==="COMPLETED"?"rd-status-pill rd-status-pill-success":Hb(e)?"rd-status-pill rd-status-pill-failure":"rd-status-pill"}function ka(e,t){if(e){if(t===void 0)return e;try{return gt(BigInt(e),t)}catch{return e}}}function Ra(e,t=6){let r=e.indexOf(".");if(r<0)return e;let n=e.slice(0,r+1+t).replace(/0+$/,"").replace(/\.$/,"");return n===""?"0":n}function Vb(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function wf(e){return e.length>14?`${e.slice(0,8)}...${e.slice(-4)}`:e}function Yb(e){let t=(e.deposits??[]).filter(n=>n.originChainId),r=new Set(t.map(n=>`${n.originChainId}:${(n.originCurrency??"").toLowerCase()}`));if(t.length>0){let n=t[0];return{chainId:n.originChainId,currency:n.originCurrency??"",routes:r.size}}return{chainId:e.originChainId,currency:e.originCurrency,routes:1}}function qb(e,t){if(!e)return;let r,n;try{r=BigInt(e),n=t.map(s=>BigInt(s.amount))}catch{return}let o=n.reduce((s,l)=>s+l,0n);if(o<=0n)return;let i=n.map(s=>r*s/o),a=i.reduce((s,l)=>s+l,0n);return i[i.length-1]+=r-a,i}function Sa({label:e,chainId:t,txHash:r,amount:n,shared:o}){let i=r?da(t,r):void 0;return(0,ce.jsxs)("div",{className:"rd-history-step",children:[(0,ce.jsx)("span",{className:`rd-history-step-dot${r?" rd-history-step-dot-done":""}`}),(0,ce.jsx)("span",{className:"rd-history-step-label",children:e}),(0,ce.jsx)("span",{className:"rd-history-step-chain",children:Vo(t)}),n&&(0,ce.jsx)("span",{className:"rd-history-step-amount",children:n}),(0,ce.jsxs)("span",{className:"rd-history-step-tx",children:[i?(0,ce.jsx)("a",{href:i.url,target:"_blank",rel:"noreferrer",title:r,children:wf(r)}):r?(0,ce.jsx)("span",{title:r,children:wf(r)}):(0,ce.jsx)("span",{className:"rd-muted",children:"pending"}),o&&r&&(0,ce.jsx)("span",{className:"rd-history-step-shared",children:"shared"})]})]})}function Kb(e){let t=e.deposits??[],r=e.amountOut||e.expectedOut||void 0;if(t.length>=2){let a=qb(r,t);if(a)return t.map((s,l)=>({key:`${e.orderId}:${s.txHash}:${s.blockNumber}`,order:e,chainId:s.originChainId??Zo,currency:s.originCurrency??"",routes:1,sentRaw:s.amount,receivedRaw:a[l].toString(),receivedIsEstimate:!0,deposit:s,sharedLegs:!0}))}let{chainId:n,currency:o,routes:i}=Yb(e);return[{key:e.orderId,order:e,chainId:n,currency:o,routes:i,sentRaw:e.amountIn,receivedRaw:r,receivedIsEstimate:!e.amountOut&&!!e.expectedOut,sharedLegs:!1}]}function xf({orders:e,isLoading:t,error:r,catalog:n,showTitle:o=!0}){let[i,a]=(0,yf.useState)({}),s=l=>a(c=>({...c,[l]:!c[l]}));return(0,ce.jsxs)("section",{className:"rd-card",children:[o&&(0,ce.jsx)("div",{className:"rd-card-header",children:(0,ce.jsx)("h2",{className:"rd-card-title",children:"Transfer history"})}),t&&e.length===0&&(0,ce.jsxs)("p",{className:"rd-muted",children:[(0,ce.jsx)("span",{className:"rd-spinner"})," Loading orders..."]}),r&&(0,ce.jsxs)("div",{className:"rd-callout rd-callout-danger",children:["Couldn't load your orders: ",r.message]}),!t&&!r&&e.length===0&&(0,ce.jsx)("p",{className:"rd-muted",children:"No deposits yet. Once you send funds to the address above, an order will appear here automatically."}),e.length>0&&(0,ce.jsx)("div",{className:"rd-history-table","data-vaul-no-drag":!0,children:e.flatMap(Kb).map(l=>{let{order:c}=l,u=n?.origins.find(k=>k.chainId===l.chainId&&k.token.address.toLowerCase()===l.currency.toLowerCase()),b=(c.target?n?.targets.find(k=>k.symbol.toLowerCase()===c.target.toLowerCase()):void 0)??n?.targets.find(k=>k.isDefault),h=b?.symbol??n?.destination.symbol??"",d=b?.decimals??n?.destination.decimals,y=n?.origins.find(k=>k.chainId===Zo),f=ka(l.sentRaw,y?.token.decimals),m=ka(l.receivedRaw,d),w=c.deposits??[],x=!!i[l.key],p=Vb(c.completedAt??c.createdAt);return(0,ce.jsxs)("div",{className:"rd-history-group",children:[(0,ce.jsxs)("button",{type:"button",className:"rd-history-row-button",onClick:()=>s(l.key),"aria-expanded":x,"aria-label":`Toggle details for the transfer received on ${p}`,children:[(0,ce.jsxs)("span",{className:"rd-history-card-top",children:[(0,ce.jsx)("span",{className:"rd-history-asset",children:l.routes>1?(0,ce.jsxs)(ce.Fragment,{children:["Multiple ",(0,ce.jsxs)("span",{className:"rd-muted",children:["\xB7 ",l.routes," chains"]})]}):(0,ce.jsxs)(ce.Fragment,{children:[u?.token.symbol??h," ",(0,ce.jsxs)("span",{className:"rd-muted",children:["\xB7 ",Vo(l.chainId)]})]})}),(0,ce.jsx)("span",{className:Qb(c.status),children:c.status})]}),(0,ce.jsxs)("span",{className:"rd-history-card-amounts",children:[(0,ce.jsx)("span",{className:"rd-history-num",title:f,children:f?Ra(f):"-"}),(0,ce.jsx)("span",{className:"rd-history-card-arrow","aria-hidden":"true",children:"\u2192"}),(0,ce.jsx)("span",{className:`rd-history-num rd-history-received${l.receivedIsEstimate?" rd-history-received-estimate":""}`,title:m,children:m?`${l.receivedIsEstimate?"~":"+"}${Ra(m)} ${h}`.trimEnd():"-"})]}),(0,ce.jsxs)("span",{className:"rd-history-card-foot",children:[(0,ce.jsx)("span",{className:"rd-history-date",children:p}),(0,ce.jsx)("span",{className:"rd-history-chevron","aria-hidden":"true",children:x?"\u2303":"\u2304"})]})]}),x&&(0,ce.jsxs)("div",{className:"rd-history-detail",children:[l.deposit?(0,ce.jsx)(Sa,{label:"Deposit",chainId:l.deposit.originChainId??Zo,txHash:l.deposit.originTxHash||l.deposit.txHash,amount:(()=>{let k=ka(l.deposit.amount,y?.token.decimals);return k?Ra(k):void 0})()}):w.length>0?w.map(k=>(0,ce.jsx)(Sa,{label:"Deposit",chainId:k.originChainId??Zo,txHash:k.originTxHash||k.txHash,amount:(()=>{let R=ka(k.amount,y?.token.decimals);return R?Ra(R):void 0})()},`${k.txHash}-${k.blockNumber}`)):(0,ce.jsxs)("div",{className:"rd-history-step",children:[(0,ce.jsx)("span",{className:"rd-history-step-dot"}),(0,ce.jsx)("span",{className:"rd-history-step-label",children:"Deposit"}),(0,ce.jsx)("span",{className:"rd-muted",children:"details not recorded for this transfer"})]}),(0,ce.jsx)(Sa,{label:"Bridge",chainId:Zo,txHash:c.bscBridgeTx,shared:l.sharedLegs}),(0,ce.jsx)(Sa,{label:"Deliver",chainId:n?.destination.chainId??612055,txHash:c.deliveryTxHash,shared:l.sharedLegs})]})]},l.key)})})]})}var nr=require("react/jsx-runtime");function vf({className:e}){let t=Ys(),{open:r}=Er();return fr.useEffect(()=>{r&&Ae("relay","history_opened")},[r]),(0,nr.jsx)(ve,{feature:"relay",children:(0,nr.jsx)(oo,{ariaTitle:"Transfer history",className:e??t.className,children:(0,nr.jsx)(Zb,{})})})}function Zb(){let e=Ys(),{theme:t,isMobile:r,setOpen:n}=Er(),o=fr.useMemo(()=>{if(e.client)return e.client;let x=mn({apiBaseUrl:e.apiBaseUrl,environment:e.environment});return rr({baseUrl:x})},[e.client,e.apiBaseUrl,e.environment]),i=e.recipient??e.walletAddress,a=!!(i&&At(i)),[s,l]=fr.useState(),[c,u]=fr.useState(!1),[b,h]=fr.useState(),d=fr.useRef(e.onError);d.current=e.onError,fr.useEffect(()=>{if(!a){l(void 0),u(!1),h(void 0);return}let x=!1;return l(void 0),u(!0),h(void 0),o.getConfig().then(p=>{x||l(p)}).catch(p=>{if(x)return;let k=p instanceof Error?p:new Error(String(p));h(k),d.current?.(k)}).finally(()=>{x||u(!1)}),()=>{x=!0}},[o,a]);let{orders:y,ordersLoading:f,ordersError:m}=On({client:o,recipient:a?i:void 0,enabled:!!s,onError:e.onError}),w=fr.useCallback(x=>{if(!e.onOutlink)return;let k=x.target.closest?.('a[target="_blank"]');k?.href&&e.onOutlink(k.href)},[e.onOutlink]);return(0,nr.jsxs)("div",{className:"rd-root rd-wizard","data-theme":t,children:[(0,nr.jsxs)("div",{className:"rd-wizard-header",children:[(0,nr.jsx)("h2",{className:"rd-wizard-heading",children:"Transfer history"}),(0,nr.jsx)("div",{className:"rd-wizard-actions",children:!r&&(0,nr.jsx)("button",{type:"button",className:"rd-icon-button","aria-label":"Close","data-track":"close",onClick:()=>n(!1),children:(0,nr.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,nr.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})})]}),a?(0,nr.jsx)("div",{onClick:w,children:(0,nr.jsx)(xf,{orders:y,isLoading:c||f,error:b??m,catalog:s,showTitle:!1})}):(0,nr.jsx)("p",{className:"rd-card rd-muted","data-testid":"rd-history-empty-state",children:"Connect a wallet or provide an address to see transfer history."})]})}var Ca=require("react/jsx-runtime");function kf({asChild:e,children:t}){return(0,Ca.jsx)(ve,{feature:"relay",children:(0,Ca.jsx)(no,{asChild:e??t!=null,children:t??(0,Ca.jsx)("button",{type:"button","data-track":"open",children:"History"})})})}var qs=require("react/jsx-runtime");function Xb(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o="min(640px, calc(100vw - 32px))",drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:c,children:u}=e;return(0,qs.jsx)(Vs.Provider,{value:e,children:(0,qs.jsx)(ro,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:c,children:u})})}var Ks=Object.assign(Xb,{Trigger:kf,Content:vf});var vr=Q(require("react"),1);var Na=Q(require("react"),1);function Rf({client:e,recipient:t,refreshKey:r=0}){let[n,o]=Na.useState(0),i=t&&At(t)?t:void 0;return Na.useEffect(()=>{if(!i){o(0);return}let a=!1;return(async()=>{try{let l=(await e.getConfig()).targets,c=l.length===0?[e.getRecovery({user:i})]:l.map(h=>e.getRecovery({user:i,target:h.symbol})),u=await Promise.all(c.map(h=>h.catch(()=>{})));if(a)return;let b=l.length===0?u[0]?[{symbol:"",isDefault:!0,info:u[0]}]:[]:l.flatMap((h,d)=>u[d]?[{symbol:h.symbol,isDefault:h.isDefault,info:u[d]}]:[]);o(ca($n(b)))}catch{a||o(0)}})(),()=>{a=!0}},[e,i,r]),n}var Ta=require("react"),Zs=(0,Ta.createContext)(null);function Sf(){let e=(0,Ta.useContext)(Zs);if(!e)throw new Error("RelayRecovery compound components must be used within <RelayRecovery>");return e}function Xs(){return Sf().props}function Cf(){return Sf().recoverableCount}var Kt=Q(require("react"),1);var or=require("react/jsx-runtime"),Ia=[];function Nf({className:e}){let t=Xs(),{open:r}=Er();return Kt.useEffect(()=>{r&&Ae("relay","recovery_opened")},[r]),(0,or.jsx)(ve,{feature:"relay",children:(0,or.jsx)(oo,{ariaTitle:"Recover stuck funds",className:e??t.className,children:(0,or.jsx)(Jb,{})})})}function Jb(){let e=Xs(),{theme:t,isMobile:r,setOpen:n}=Er(),o=Kt.useMemo(()=>mn({apiBaseUrl:e.apiBaseUrl,environment:e.environment}),[e.apiBaseUrl,e.environment]),i=Kt.useMemo(()=>e.client?e.client:rr({baseUrl:o}),[e.client,o]),a=Kt.useMemo(()=>({walletAddress:e.walletAddress,walletChainId:e.walletChainId,sendTransaction:e.sendTransaction,writeContract:e.writeContract,readContract:e.readContract,switchChain:e.switchChain,waitForReceipt:e.waitForReceipt,getBalance:e.getBalance}),[e.walletAddress,e.walletChainId,e.sendTransaction,e.writeContract,e.readContract,e.switchChain,e.waitForReceipt,e.getBalance]),s=e.recipient??e.walletAddress,l=!!(s&&At(s)),c=Xe(e.environment),u=Sr("apps.json",c,C=>cr(C?.relay?.trustedFactories,c)),b=Kt.useMemo(()=>e.trustedFactories??la(u),[e.trustedFactories,u]),h=!!(e.writeContract&&e.readContract&&e.waitForReceipt),d=l&&h,[y,f]=Kt.useState(Ia),m=e.onError;Kt.useEffect(()=>{if(!d){f(Ia);return}let C=!1;return i.getConfig().then(M=>{C||f(M.targets.length>0?M.targets:Ia)}).catch(M=>{C||(f(Ia),m?.(M instanceof Error?M:new Error(String(M))))}),()=>{C=!0}},[i,d,m]);let[w,x]=Kt.useState({}),[p,k]=Kt.useState(0),R=Kt.useCallback(()=>k(C=>C+1),[]),S=l?s:void 0;Kt.useEffect(()=>{if(!d||!S||y.length===0){x({});return}let C=!1;return Promise.all(y.map(M=>i.getRecovery({user:S,target:M.symbol}).catch(()=>{}))).then(M=>{if(C)return;let B={};y.forEach((W,L)=>{let $=M[L];$&&(B[W.symbol]=$)}),x(B)}),()=>{C=!0}},[i,d,S,y,p]);let T=Kt.useMemo(()=>y.map(C=>({symbol:C.symbol,isDefault:C.isDefault,info:w[C.symbol]})).filter(C=>C.info!==void 0),[y,w]),{orders:N}=On({client:i,recipient:d?S:void 0,enabled:d});return(0,or.jsxs)("div",{className:"rd-root rd-wizard","data-theme":t,children:[(0,or.jsxs)("div",{className:"rd-wizard-header",children:[(0,or.jsx)("h2",{className:"rd-wizard-heading",children:"Recover stuck funds"}),(0,or.jsx)("div",{className:"rd-wizard-actions",children:!r&&(0,or.jsx)("button",{type:"button",className:"rd-icon-button","aria-label":"Close","data-track":"close",onClick:()=>n(!1),children:(0,or.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,or.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})})]}),!l&&(0,or.jsx)("p",{className:"rd-muted","data-testid":"rd-recovery-connect-note",children:"Connect a wallet to check recoverable funds."}),l&&!h&&(0,or.jsx)("p",{className:"rd-muted","data-testid":"rd-recovery-unsupported-note",children:"This wallet can't sign recovery transactions."}),d&&(0,or.jsx)(ua,{client:e.client,apiBaseUrl:o,recipient:s,wallet:a,trustedFactories:b,targets:T.length>0?T:void 0,orders:N,onRecovered:R,showTitle:!1,onError:e.onError})]})}var Ma=require("react/jsx-runtime");function Tf({asChild:e,children:t}){let r=Cf();return(0,Ma.jsx)(ve,{feature:"relay",children:(0,Ma.jsx)(no,{asChild:e??t!=null,dataAttributes:{"data-rd-recovery-count":r},children:t??(0,Ma.jsx)("button",{type:"button","data-track":"open",children:"Recover"})})})}var Js=require("react/jsx-runtime");function $b(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:c,children:u}=e,[b,h]=vr.useState(!1),d=l!==void 0,y=d?l:b,f=vr.useCallback(S=>{d||h(S),c?.(S)},[d,c]),m=vr.useMemo(()=>{if(e.client)return e.client;let S=mn({apiBaseUrl:e.apiBaseUrl,environment:e.environment});return rr({baseUrl:S})},[e.client,e.apiBaseUrl,e.environment]),[w,x]=vr.useState(0),p=vr.useRef(y);vr.useEffect(()=>{p.current&&!y&&x(S=>S+1),p.current=y},[y]);let k=Rf({client:m,recipient:e.recipient??e.walletAddress,refreshKey:w}),R=vr.useMemo(()=>({props:e,recoverableCount:k}),[e,k]);return(0,Js.jsx)(Zs.Provider,{value:R,children:(0,Js.jsx)(ro,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:y,onOpenChange:f,children:u})})}var $s=Object.assign($b,{Trigger:Tf,Content:Nf});var He=require("react/jsx-runtime"),ew={bscBridge:"https://bscscan.com/tx/",crossFinalize:"https://scan.crosstoken.io/tx/",crossExecute:"https://scan.crosstoken.io/tx/"},tw={bscBridge:"Bridge tx (BSC)",crossFinalize:"Finalize tx (CROSS)",crossExecute:"Execute tx (CROSS)"};function rw(e){return e==="done"?"\u2713":e==="active"?"\u25CF":""}function If(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function nw(e){return e==="done"?"rd-stepper-item rd-stepper-item-done":e==="active"?"rd-stepper-item rd-stepper-item-active":"rd-stepper-item rd-stepper-item-pending"}function tl({orderId:e,order:t,error:r}){let n=!t&&!r;return(0,He.jsxs)("section",{className:"rd-card",children:[(0,He.jsxs)("div",{className:"rd-card-header",children:[(0,He.jsx)("h2",{className:"rd-card-title",children:"4. Status"}),t&&(0,He.jsx)("span",{className:`rd-status-pill${t.status==="COMPLETED"?" rd-status-pill-success":If(t.status)?" rd-status-pill-failure":""}`,children:t.status})]}),(0,He.jsxs)("p",{className:"rd-card-hint",children:["Order ",e]}),n&&(0,He.jsxs)("p",{className:"rd-muted",children:[(0,He.jsx)("span",{className:"rd-spinner"})," Loading status..."]}),r&&(0,He.jsxs)("div",{className:"rd-callout rd-callout-danger",children:["Couldn't load order status: ",r.message]}),t&&(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)("ol",{className:"rd-stepper",children:t.steps.map((o,i)=>(0,He.jsxs)("li",{className:nw(o.status),children:[(0,He.jsxs)("div",{className:"rd-stepper-rail",children:[(0,He.jsx)("span",{className:"rd-stepper-dot",children:rw(o.status)}),i<t.steps.length-1&&(0,He.jsx)("span",{className:"rd-stepper-line"})]}),(0,He.jsxs)("div",{className:"rd-stepper-body",children:[(0,He.jsx)("div",{className:"rd-stepper-label",children:o.label}),o.key==="bridge"&&t.txs.bscBridge&&(0,He.jsx)("div",{className:"rd-stepper-meta",children:(0,He.jsx)(el,{orderTxs:t.txs,txKey:"bscBridge"})}),o.key==="deliver"&&(t.txs.crossFinalize||t.txs.crossExecute)&&(0,He.jsxs)("div",{className:"rd-stepper-meta",children:[t.txs.crossFinalize&&(0,He.jsx)(el,{orderTxs:t.txs,txKey:"crossFinalize"}),t.txs.crossExecute&&(0,He.jsx)(el,{orderTxs:t.txs,txKey:"crossExecute"})]})]})]},o.key))}),If(t.status)&&(0,He.jsxs)("div",{className:"rd-callout rd-callout-danger",children:["This order did not complete successfully (status: ",t.status,"). If funds were deposited, refer to the refund address on the order for recovery."]}),t.status==="COMPLETED"&&(0,He.jsx)("div",{className:"rd-callout rd-callout-success",children:"crossd delivered. This order is complete."})]})]})}function el({orderTxs:e,txKey:t}){let r=e[t];return r?(0,He.jsxs)("a",{href:`${ew[t]}${r}`,target:"_blank",rel:"noreferrer",children:[tw[t],": ",r.slice(0,10),"..."]}):null}oi({mode:"dapp-ui"});0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,BridgeFlow,CHAINS_CONFIG_FILE,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,DEFAULT_SKILLS_HREF,DEFAULT_TRUSTED_FACTORIES,DappUiErrorBoundary,GOOGLE_ICON,METAMASK_ICON,PORTFOLIO_SECTIONS,RelayApiError,RelayDeposit,RelayHistory,RelayRecovery,SOCIAL_REGISTRY,SendFlow,SkillsButton,StatusTracker,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,announceAppLauncherUsage,captureDappUiException,createRelayClient,getChainDisplay,getDappUiSentryScope,initDappUiSentry,normalizeFailureReason,resolveEnvironment,setDappUiAnalyticsUser,trackDappUiEvent,trackDappUiFunnel,useChainDisplay,useChainsConfig,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});
24
26
  //# sourceMappingURL=index.cjs.map