@nexus-cross/dapp-ui 1.5.0-beta.2 → 1.5.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- function Bc(e){try{return import.meta.env?.[e]}catch{return}}function zc(e){if(!(typeof process>"u"))return process.env?.[e]}function at(e){if(e)return Fc(e);let t=Bc("VITE_CROSSX_ENVIRONMENT")??Bc("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??zc("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??zc("CROSSX_ENVIRONMENT");return Fc(t)}function Fc(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as wr from"react";var wa="eip155";function jn(e){return`${wa}:${e}`}function Uc(e){let t=e.indexOf(":");return t>0?e.slice(0,t):void 0}function jc(e){let t=Uc(e);return t===void 0||t===wa}function bi(e){if(typeof e=="number")return Number.isSafeInteger(e)&&e>0?e:void 0;if(typeof e!="string")return;let t=e.trim(),n=Uc(t);if(n!==void 0&&n!==wa)return;let r=n===wa?t.slice(wa.length+1):t;if(!/^\d+$/.test(r))return;let o=Number(r);return Number.isSafeInteger(o)&&o>0?o:void 0}function Wc(e){let t=bi(e);return t===void 0?void 0:jn(t)}var gb={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"},hb=3e3;function Wn(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 Pl=new Map;function Mr(e,t){let n=`${gb[t]}/${e}`,r=Pl.get(n);return r||(r=(async()=>{let o=new AbortController,a=setTimeout(()=>o.abort(),hb);try{let i=await fetch(n,{cache:"no-store",signal:o.signal});return i.ok?await i.json():null}catch{return null}finally{clearTimeout(a)}})().then(o=>(o===null&&Pl.delete(n),o)),Pl.set(n,r)),r}function bb(e){return typeof e=="string"&&e.startsWith("https://")}async function Se(e,t){let n=await Mr("endpoints.json",t),r=Wn(n?.apis?.[e],t);if(!bb(r))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return r}var wi="apps.json";function yi(e,t){let n=Wn(e?.relay?.forwarderFactories,t),r=[n?.standingForwarderFactory,n?.depositorForwarderFactory].filter(o=>typeof o=="string");return r.length>0?r:void 0}var Fo="chains.json";function Ol(e,t){return e?e[jn(t)]??e[String(t)]??{}:{}}async function wb(e,t){let n=await Mr(Fo,t);return Ol(n?.chains,e)}function bo(e,t){let[n,r]=wr.useState({});return wr.useEffect(()=>{if(e==null){r({});return}let o=!0;return Mr(Fo,t).then(a=>{o&&r(Ol(a?.chains,e))}),()=>{o=!1}},[e,t]),n}function yb(e){let[t,n]=wr.useState({});return wr.useEffect(()=>{let r=!0;return Mr(Fo,e).then(o=>{r&&n(o?.chains??{})}),()=>{r=!1}},[e]),t}function Ut(e,t,n){let[r,o]=wr.useState(void 0),a=wr.useRef(n);return a.current=n,wr.useEffect(()=>{let i=!0;return Mr(e,t).then(s=>{if(!i)return;let l=a.current(s);l!==void 0&&o(l)}),()=>{i=!1}},[e,t]),r}var wo="1.5.0-beta.2";var xi="__nexusCrossAppLauncherRuntime";function xb(){if(typeof window>"u")return null;let e=window;return e[xi]??(e[xi]={mode:"dapp-ui"}),e[xi]}function vb(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${wo}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${wo} \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 Bl(e){let t=xb();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),vb(t))}import{BrowserClient as kb,Scope as Cb,defaultStackParser as Rb,linkedErrorsIntegration as Nb,makeFetchTransport as Sb}from"@sentry/react";var Tb="https://5c82aeb32da33b5a0a14b7c5393992ca@o4511668907081728.ingest.de.sentry.io/4511705324126289",Ib=`dapp-ui@${wo}`,Uo=null,Gc=.1;function Hc(){return Gc}function Eb(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function ya(e){if(Uo)return Uo;if(typeof window>"u")return null;let t=Eb(at(e?.environment));typeof e?.analyticsSampleRate=="number"&&(Gc=Math.min(1,Math.max(0,e.analyticsSampleRate)));let n=new kb({dsn:e?.dsn??Tb,transport:Sb,stackParser:Rb,integrations:[Nb()],environment:t,release:Ib,enabled:e?.enabled??t==="prod"}),r=new Cb;return r.setClient(n),r.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),n.init(),Uo=r,Uo}function vi(){return Uo}function ki(e,t){let n=Uo??ya();if(n)return n.captureException(e,t?{captureContext:{extra:t}}:void 0)}import{Component as Ab}from"react";var Ci=class extends Ab{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n,r){ki(n,{componentStack:r.componentStack??void 0,boundary:this.props.name??"dapp-ui"})}render(){return this.state.hasError?this.props.fallback??null:this.props.children}};function ye(...e){return e.filter(Boolean).join(" ")}var Mb=/CROSSx|ONE\s?wallet|ONE\s?pocket/i;function jo(){return typeof window>"u"?!1:Mb.test(window.navigator.userAgent)}var _c="__nexus_dapp_ui_uid",zl=null;function Lb(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function Fl(){if(zl)return zl;let e=null;try{e=window.localStorage.getItem(_c)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${Lb()}`;try{window.localStorage.setItem(_c,e)}catch{}}return zl=e,e}async function Vc(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),o=>o.toString(16).padStart(2,"0")).join("").slice(0,16)}`}catch{return null}}function Db(){let e=window.navigator.userAgent;return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|iphone|ipod|android/i.test(e)?"mobile":"desktop"}function Yc(){return{host:window.location.hostname,device_type:Db(),is_cross_inapp:String(jo())}}var Qc=!1;function Ul(){if(typeof window>"u")return null;let e=vi()??ya();return e?(Qc||(Qc=!0,e.setUser({id:Fl()})),e):null}function Kc(){return Math.random()>=Hc()}var qc=0;function Wo(e){let t=Ul();if(!t)return;let n=++qc;if(!e){t.setUser({id:Fl()});return}Vc(e).then(r=>{r&&n===qc&&t.setUser({id:r})})}function Ri(e,t,n){let r=Ul();!r||Kc()||r.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Yc(),feature:e,action:t,...n}}})}function Ye(e,t,n){let r=Ul();if(!r||Kc())return;let o=n?.status??"success";r.captureMessage(`funnel: ${e}_${t}`,"info",{captureContext:{tags:{...Yc(),flow:e,funnel_step:`${e}_${t}`,funnel_status:o,...o==="failure"?{failure_reason:n?.reason??"unknown"}:{},...n?.tags}}})}function Dn(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"}import{useCallback as Pb}from"react";import{jsx as Ob}from"react/jsx-runtime";function xe({feature:e,children:t}){let n=Pb(r=>{let o=r.nativeEvent;if(o.__dappUiTracked)return;let i=r.target?.closest?.("[data-track]");if(!i)return;let s=i.getAttribute("data-track");if(!s)return;o.__dappUiTracked=!0;let l=i.getAttribute("data-track-id");Ri(e,s,l?{item_id:l}:void 0)},[e]);return Ob("div",{style:{display:"contents"},onClick:n,children:t})}import*as _o from"react";import*as Xc from"@radix-ui/react-popover";import{Drawer as _b}from"vaul";import{createContext as Bb,useContext as zb}from"react";var jl=Bb(null);function Ni(){let e=zb(jl);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import*as Ti from"react";var Fb="__dappUiOverlay",yo=[],Go=0,Gl=0,Si=!1,Wl=!1;function Zc(){if(Gl>0){Gl-=1;return}Go=Math.max(0,Go-1),yo.pop()?.close(),Hl()}function Ub(){Si||(window.addEventListener("popstate",Zc),Si=!0)}function Hl(){yo.length>0||!Si||(window.removeEventListener("popstate",Zc),Si=!1)}function jb(){Wl||(Wl=!0,queueMicrotask(()=>{Wl=!1;let e=Go-yo.length;if(e<=0){Hl();return}Go-=e,Gl+=1,window.history.go(-e),Hl()}))}function or(e,t){let n=Ti.useRef(t);n.current=t,Ti.useEffect(()=>{if(!(!e||typeof window>"u"))return Wb(()=>n.current())},[e])}function Wb(e){let t={close:e};return yo.push(t),Go<yo.length&&(window.history.pushState({[Fb]:!0},""),Go+=1),Ub(),()=>{let n=yo.lastIndexOf(t);n!==-1&&(yo.splice(n,1),jb())}}import{useState as Gb,useEffect as Hb}from"react";function Ho(e){let[t,n]=Gb(!1);return Hb(()=>{let r=window.matchMedia(e);n(r.matches);let o=a=>n(a.matches);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[e]),t}function ce(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}ce(`[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, #2e2854);--al-badge-text: var(--ds-accent-primary-default, #a392ff);--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, #f5f3ff);--al-badge-text: var(--ds-accent-primary-default, #7e54f4);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
1
+ function Bc(e){try{return import.meta.env?.[e]}catch{return}}function zc(e){if(!(typeof process>"u"))return process.env?.[e]}function at(e){if(e)return Fc(e);let t=Bc("VITE_CROSSX_ENVIRONMENT")??Bc("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??zc("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??zc("CROSSX_ENVIRONMENT");return Fc(t)}function Fc(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as wr from"react";var wa="eip155";function jn(e){return`${wa}:${e}`}function Uc(e){let t=e.indexOf(":");return t>0?e.slice(0,t):void 0}function jc(e){let t=Uc(e);return t===void 0||t===wa}function bi(e){if(typeof e=="number")return Number.isSafeInteger(e)&&e>0?e:void 0;if(typeof e!="string")return;let t=e.trim(),n=Uc(t);if(n!==void 0&&n!==wa)return;let r=n===wa?t.slice(wa.length+1):t;if(!/^\d+$/.test(r))return;let o=Number(r);return Number.isSafeInteger(o)&&o>0?o:void 0}function Wc(e){let t=bi(e);return t===void 0?void 0:jn(t)}var gb={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"},hb=3e3;function Wn(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 Pl=new Map;function Mr(e,t){let n=`${gb[t]}/${e}`,r=Pl.get(n);return r||(r=(async()=>{let o=new AbortController,a=setTimeout(()=>o.abort(),hb);try{let i=await fetch(n,{cache:"no-store",signal:o.signal});return i.ok?await i.json():null}catch{return null}finally{clearTimeout(a)}})().then(o=>(o===null&&Pl.delete(n),o)),Pl.set(n,r)),r}function bb(e){return typeof e=="string"&&e.startsWith("https://")}async function Se(e,t){let n=await Mr("endpoints.json",t),r=Wn(n?.apis?.[e],t);if(!bb(r))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return r}var wi="apps.json";function yi(e,t){let n=Wn(e?.relay?.forwarderFactories,t),r=[n?.standingForwarderFactory,n?.depositorForwarderFactory].filter(o=>typeof o=="string");return r.length>0?r:void 0}var Fo="chains.json";function Ol(e,t){return e?e[jn(t)]??e[String(t)]??{}:{}}async function wb(e,t){let n=await Mr(Fo,t);return Ol(n?.chains,e)}function bo(e,t){let[n,r]=wr.useState({});return wr.useEffect(()=>{if(e==null){r({});return}let o=!0;return Mr(Fo,t).then(a=>{o&&r(Ol(a?.chains,e))}),()=>{o=!1}},[e,t]),n}function yb(e){let[t,n]=wr.useState({});return wr.useEffect(()=>{let r=!0;return Mr(Fo,e).then(o=>{r&&n(o?.chains??{})}),()=>{r=!1}},[e]),t}function Ut(e,t,n){let[r,o]=wr.useState(void 0),a=wr.useRef(n);return a.current=n,wr.useEffect(()=>{let i=!0;return Mr(e,t).then(s=>{if(!i)return;let l=a.current(s);l!==void 0&&o(l)}),()=>{i=!1}},[e,t]),r}var wo="1.5.0-beta.3";var xi="__nexusCrossAppLauncherRuntime";function xb(){if(typeof window>"u")return null;let e=window;return e[xi]??(e[xi]={mode:"dapp-ui"}),e[xi]}function vb(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${wo}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${wo} \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 Bl(e){let t=xb();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),vb(t))}import{BrowserClient as kb,Scope as Cb,defaultStackParser as Rb,linkedErrorsIntegration as Nb,makeFetchTransport as Sb}from"@sentry/react";var Tb="https://5c82aeb32da33b5a0a14b7c5393992ca@o4511668907081728.ingest.de.sentry.io/4511705324126289",Ib=`dapp-ui@${wo}`,Uo=null,Gc=.1;function Hc(){return Gc}function Eb(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function ya(e){if(Uo)return Uo;if(typeof window>"u")return null;let t=Eb(at(e?.environment));typeof e?.analyticsSampleRate=="number"&&(Gc=Math.min(1,Math.max(0,e.analyticsSampleRate)));let n=new kb({dsn:e?.dsn??Tb,transport:Sb,stackParser:Rb,integrations:[Nb()],environment:t,release:Ib,enabled:e?.enabled??t==="prod"}),r=new Cb;return r.setClient(n),r.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),n.init(),Uo=r,Uo}function vi(){return Uo}function ki(e,t){let n=Uo??ya();if(n)return n.captureException(e,t?{captureContext:{extra:t}}:void 0)}import{Component as Ab}from"react";var Ci=class extends Ab{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n,r){ki(n,{componentStack:r.componentStack??void 0,boundary:this.props.name??"dapp-ui"})}render(){return this.state.hasError?this.props.fallback??null:this.props.children}};function ye(...e){return e.filter(Boolean).join(" ")}var Mb=/CROSSx|ONE\s?wallet|ONE\s?pocket/i;function jo(){return typeof window>"u"?!1:Mb.test(window.navigator.userAgent)}var _c="__nexus_dapp_ui_uid",zl=null;function Lb(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function Fl(){if(zl)return zl;let e=null;try{e=window.localStorage.getItem(_c)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${Lb()}`;try{window.localStorage.setItem(_c,e)}catch{}}return zl=e,e}async function Vc(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),o=>o.toString(16).padStart(2,"0")).join("").slice(0,16)}`}catch{return null}}function Db(){let e=window.navigator.userAgent;return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|iphone|ipod|android/i.test(e)?"mobile":"desktop"}function Yc(){return{host:window.location.hostname,device_type:Db(),is_cross_inapp:String(jo())}}var Qc=!1;function Ul(){if(typeof window>"u")return null;let e=vi()??ya();return e?(Qc||(Qc=!0,e.setUser({id:Fl()})),e):null}function Kc(){return Math.random()>=Hc()}var qc=0;function Wo(e){let t=Ul();if(!t)return;let n=++qc;if(!e){t.setUser({id:Fl()});return}Vc(e).then(r=>{r&&n===qc&&t.setUser({id:r})})}function Ri(e,t,n){let r=Ul();!r||Kc()||r.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Yc(),feature:e,action:t,...n}}})}function Ye(e,t,n){let r=Ul();if(!r||Kc())return;let o=n?.status??"success";r.captureMessage(`funnel: ${e}_${t}`,"info",{captureContext:{tags:{...Yc(),flow:e,funnel_step:`${e}_${t}`,funnel_status:o,...o==="failure"?{failure_reason:n?.reason??"unknown"}:{},...n?.tags}}})}function Dn(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"}import{useCallback as Pb}from"react";import{jsx as Ob}from"react/jsx-runtime";function xe({feature:e,children:t}){let n=Pb(r=>{let o=r.nativeEvent;if(o.__dappUiTracked)return;let i=r.target?.closest?.("[data-track]");if(!i)return;let s=i.getAttribute("data-track");if(!s)return;o.__dappUiTracked=!0;let l=i.getAttribute("data-track-id");Ri(e,s,l?{item_id:l}:void 0)},[e]);return Ob("div",{style:{display:"contents"},onClick:n,children:t})}import*as _o from"react";import*as Xc from"@radix-ui/react-popover";import{Drawer as _b}from"vaul";import{createContext as Bb,useContext as zb}from"react";var jl=Bb(null);function Ni(){let e=zb(jl);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import*as Ti from"react";var Fb="__dappUiOverlay",yo=[],Go=0,Gl=0,Si=!1,Wl=!1;function Zc(){if(Gl>0){Gl-=1;return}Go=Math.max(0,Go-1),yo.pop()?.close(),Hl()}function Ub(){Si||(window.addEventListener("popstate",Zc),Si=!0)}function Hl(){yo.length>0||!Si||(window.removeEventListener("popstate",Zc),Si=!1)}function jb(){Wl||(Wl=!0,queueMicrotask(()=>{Wl=!1;let e=Go-yo.length;if(e<=0){Hl();return}Go-=e,Gl+=1,window.history.go(-e),Hl()}))}function or(e,t){let n=Ti.useRef(t);n.current=t,Ti.useEffect(()=>{if(!(!e||typeof window>"u"))return Wb(()=>n.current())},[e])}function Wb(e){let t={close:e};return yo.push(t),Go<yo.length&&(window.history.pushState({[Fb]:!0},""),Go+=1),Ub(),()=>{let n=yo.lastIndexOf(t);n!==-1&&(yo.splice(n,1),jb())}}import{useState as Gb,useEffect as Hb}from"react";function Ho(e){let[t,n]=Gb(!1);return Hb(()=>{let r=window.matchMedia(e);n(r.matches);let o=a=>n(a.matches);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[e]),t}function ce(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}ce(`[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, #2e2854);--al-badge-text: var(--ds-accent-primary-default, #a392ff);--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, #f5f3ff);--al-badge-text: var(--ds-accent-primary-default, #7e54f4);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
2
2
  `);ce(`.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
3
  `);ce(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
4
  `);ce(`.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
- `);ce("");import{jsx as _l}from"react/jsx-runtime";function Jc({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:r,children:o}){let a=Ho(`(max-width: ${n}px)`),[i,s]=_o.useState(!1),l=_o.useCallback(()=>s(!1),[]),d=at(e);or(i,l);let p=_o.useMemo(()=>({env:d,theme:t,isMobile:a,open:i,domain:r,close:l}),[d,t,a,i,r,l]);return _l(jl.Provider,{value:p,children:a?_l(_b.Root,{direction:"right",open:i,onOpenChange:s,noBodyStyles:!0,children:o},"drawer"):_l(Xc.Root,{open:i,onOpenChange:s,children:o},"popover")})}import*as np from"@radix-ui/react-popover";import{Drawer as Qb}from"vaul";import{jsx as Pn,jsxs as Vb}from"react/jsx-runtime";function $c({size:e=18}){return Vb("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Pn("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function ep(){return Pn("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Pn("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function tp(){return Pn("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Pn("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as Vo}from"react/jsx-runtime";function rp({asChild:e,children:t,className:n,style:r}){let{isMobile:o,theme:a}=Ni(),i=t!=null,s=e??!0,l=n?`al-trigger-btn ${n}`:"al-trigger-btn",d=i?t:Vo("button",{type:"button",className:l,"data-theme":a,"data-track":"open",style:r,children:Vo($c,{size:18})});return o?Vo(xe,{feature:"app_launcher",children:Vo(Qb.Trigger,{asChild:s,children:d})}):Vo(xe,{feature:"app_launcher",children:Vo(np.Trigger,{asChild:s,children:d})})}import*as xr from"react";import*as Ei from"@radix-ui/react-popover";import{Drawer as Qo}from"vaul";import{useQuery as Kb}from"@tanstack/react-query";var op={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 qb="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Yb="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function yr(e,t){return`${e==="production"?Yb:qb}/${t}.png`}function ap(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:yr(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:yr(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:yr(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1,serviceStatus:"ending"},{id:"onepop",label:"ONEpop",description:"Send crypto with just an X handle.",url:{dev:"https://dev.onechain.nexus/pop",stage:"https://stg.onechain.nexus/pop",production:"https://onechain.nexus/pop"},iconUrl:t==="production"?"https://contents.onechain.nexus/frontend/common/app-launcher/icons/onepop.png":"https://stg-contents.onechain.nexus/frontend/common/app-launcher/icons/onepop.png",order:5500,type:"onepop",badge:null,isNew:!0,serviceStatus:"available"},{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:yr(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:yr(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:yr(t,"cross-staking"),order:7500,type:"cross-staking",badge:null,isNew:!0,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:yr(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:yr(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:yr(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:yr(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function Ii(e){let t=at(e);return Kb({queryKey:["global-menu",t],queryFn:async()=>{try{let n=await fetch(op[t],{cache:"no-store"});if(!n.ok)throw new Error(`Failed to fetch global menu: ${n.status}`);return n.json()}catch{return ap(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function Vl(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function sp(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function lp(e){return[...e].sort((t,n)=>{let r=ip(t)-ip(n);return r!==0?r:t.order-n.order})}function ip(e){let t=Vl(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as Vt,jsxs as qo}from"react/jsx-runtime";function Zb(e){return e.id==="cross-staking"||e.type==="cross-staking"}function cp({align:e="end",sideOffset:t=8,className:n}){let{env:r,theme:o,isMobile:a,domain:i,close:s}=Ni(),{data:l}=Ii(r),d=xr.useMemo(()=>lp(l?.items??[]),[l?.items]),p=24,g=xr.useRef(null),u=xr.useRef(!1),m=xr.useCallback(x=>{g.current={x:x.clientX,y:x.clientY},u.current=!1},[]),y=xr.useCallback(x=>{let k=g.current;g.current=null,k&&(u.current=Math.abs(x.clientX-k.x)>p||Math.abs(x.clientY-k.y)>p)},[]),w=xr.useCallback(()=>{g.current=null,u.current=!0},[]),f=typeof window<"u"?window.location.pathname:"",c=xr.useCallback((x,k)=>{let R=u.current;if(u.current=!1,R&&x.detail!==0)return;let S=k.url[r]??k.url.production,C=dp(S,i);if(!C)try{let N=new URL(S);if(N.pathname===window.location.pathname&&N.search===window.location.search&&N.hash===window.location.hash){s();return}}catch{}if(C){let N=window.open(S,"_blank");if(N){N.opener=null,s();return}}window.location.href=S},[r,i,s]),h=x=>{let k=x.url[r]??x.url.production,R=dp(k,i),S=Vl(x),C=S==="ending",N=sp(x.iconUrl,r),E=!1;if(!R)try{let A=new URL(k).pathname;E=f===A||f.startsWith(A+"/")}catch{E=!1}return Vt("button",{type:"button",className:"al-grid-item","data-track":"menu_item_click","data-track-id":x.id,"data-active":E||void 0,"data-service-status":S,onPointerDown:m,onPointerUp:y,onPointerCancel:w,onClick:A=>c(A,x),children:qo("div",{className:"al-grid-item-left",children:[qo("div",{className:"al-grid-item-icon",children:[Vt("img",{src:N,alt:x.label,width:24,height:24,loading:"lazy"}),x.isNew&&Vt("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),qo("span",{className:"al-grid-item-text",children:[Vt("span",{className:"al-grid-item-label",children:x.label}),C&&Vt("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),x.badge&&!Zb(x)&&Vt("span",{className:"al-badge al-badge-list",children:x.badge})]})]})},x.id)},b=Vt("div",{className:"al-menu","data-theme":o,children:Vt("div",{className:"al-grid",children:d.map(h)})});return a?Vt(xe,{feature:"app_launcher",children:qo(Qo.Portal,{children:[Vt(Qo.Overlay,{className:"al-drawer-overlay"}),qo(Qo.Content,{className:ye("al-drawer-content",n),"data-theme":o,children:[qo("div",{className:"al-drawer-header",children:[Vt(Qo.Close,{className:"al-drawer-close","data-track":"close",children:Vt(ep,{})}),Vt(Qo.Title,{className:"al-drawer-title",children:"ONE Services"}),Vt(Qo.Close,{className:"al-drawer-close","data-track":"close",children:Vt(tp,{})})]}),Vt("div",{className:"al-drawer-body",children:b})]})]})}):Vt(xe,{feature:"app_launcher",children:Vt(Ei.Portal,{children:Vt(Ei.Content,{align:e,sideOffset:t,className:ye("al-popover-content",n),"data-theme":o,children:b})})})}function dp(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}import*as Wa from"react";import*as Ig from"@radix-ui/react-popover";import{Drawer as d2}from"vaul";import{createContext as Xb,useContext as Jb}from"react";var xa=Xb(null);function _r(){let e=Jb(xa);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}import*as rn from"react";import{WALLET_LABELS as $b}from"@nexus-cross/crossx-design-system";var Ql=(r=>(r.CROSSx="crossx",r.MetaMask="io.metamask",r.Binance="com.binance.wallet",r))(Ql||{}),Ai={crossx:{name:$b.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"}};import*as ou from"react";import{jsx as ve,jsxs as Vr}from"react/jsx-runtime";function pp({size:e=16,className:t}){return Vr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("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"}),ve("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 Lr({size:e=16,className:t}){return ve("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("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 ar({size:e=16,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function hn({size:e=24,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function up({size:e=20,className:t}){return Vr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("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"}),ve("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 Mi({size:e=20,className:t}){return ve("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:ve("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 On({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Gn({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function fp({size:e=16,className:t}){return Vr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("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"}),ve("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 mp({size:e=16,className:t}){return Vr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("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"}),ve("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var ew='<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>',tw=`data:image/svg+xml,${encodeURIComponent(ew)}`;function gp({size:e=42,className:t}){return ve("img",{src:tw,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function hp({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("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 bp({size:e=24,className:t}){return Vr("svg",{width:e,height:e,viewBox:"-2.5 -2.5 26.67 26.67",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("defs",{children:Vr("linearGradient",{id:"wi-send-solid-grad",x1:"21.6678",y1:"10.8341",x2:"3.99487",y2:"19.2366",gradientUnits:"userSpaceOnUse",children:[ve("stop",{stopColor:"var(--wi-send-solid-from, #f62e61)"}),ve("stop",{offset:"1",stopColor:"var(--wi-send-solid-to, #f7564a)"})]})}),ve("path",{d:"M19.7662 0.0826863C20.8951 -0.311758 21.9796 0.772686 21.5851 1.90158L15.0018 20.7127C14.574 21.9327 12.874 22.0016 12.3496 20.8205L9.1729 13.6738L13.644 9.20158C13.7912 9.0436 13.8713 8.83466 13.8675 8.61877C13.8637 8.40288 13.7763 8.1969 13.6236 8.04422C13.4709 7.89154 13.2649 7.80408 13.049 7.80027C12.8331 7.79646 12.6242 7.8766 12.4662 8.0238L7.99401 12.4949L0.847345 9.31824C-0.333766 8.79269 -0.263766 7.0938 0.955123 6.66602L19.7662 0.0826863Z",fill:"url(#wi-send-solid-grad)"})]})}function wp({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("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 yp({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("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 xp({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("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 vp({size:e=20,className:t}){return Vr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),ve("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}function va({size:e=14,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":!0,children:ve("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"})})}function kp({className:e}){return Vr("svg",{viewBox:"0 0 540 540",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":!0,children:[ve("path",{d:"M341.385 435.217V376.643H326.742V362H370.672V376.643H356.029V435.217H341.385Z"}),ve("path",{d:"M261.725 435.217V362H305.656V376.643H276.369V391.287H305.656V405.93H276.369V435.217H261.725Z"}),ve("path",{d:"M167.422 435.217V362H182.066V376.643H196.709V391.287H211.352V405.93H225.996V362H240.639V435.217H225.996V420.573H211.352V405.93H196.709V391.287H182.066V435.217H167.422Z"}),ve("path",{d:"M237.374 204.563C243.054 204.563 248.502 202.307 252.518 198.29C256.534 194.274 258.791 188.826 258.791 183.146C258.791 177.466 256.534 172.019 252.518 168.002C248.502 163.986 243.054 161.73 237.374 161.73C231.694 161.73 226.247 163.986 222.23 168.002C218.214 172.019 215.957 177.466 215.957 183.146C215.957 188.826 218.214 194.274 222.23 198.29C226.247 202.307 231.694 204.563 237.374 204.563ZM371.228 145.667L269.499 86.7713L167.77 145.667V263.459L269.499 322.355L371.228 263.459V145.667ZM269.499 111.518L349.812 158.014V231.687L300.96 202.389L215.604 266.404L189.187 251.112V158.014L269.499 111.518ZM269.499 297.608L235.746 278.065L302.288 228.164L345.1 253.843L269.499 297.608Z"})]})}import*as pe from"react";import xo from"bignumber.js";function nw(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 Dr(e,t){if(!e||e==="0")return"0.00";let n=new xo(e).shiftedBy(-t),r=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(r,xo.ROUND_DOWN)}function Xt(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function vo(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,r=Math.pow(10,n);return`$${(Math.floor(t*r)/r).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function Li(e,t,n){let o=new xo(e).shiftedBy(-t).multipliedBy(new xo(n));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(xo.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,xo.ROUND_DOWN):o.decimalPlaces(4,xo.ROUND_DOWN)).toFormat()}`}function Cp(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let n=t;if(n.includes("e")||n.includes("E")){let i=Number(n);if(!Number.isFinite(i)||i===0)return{displayValue:"0",isLowerBound:!1};n=nw(i.toFixed(18))}let[r="0",o=""]=n.split(".");if(Number(r)>=1){let i=o.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(r).toLocaleString("en-US")}.${i}`,isLowerBound:!1}}return o.length<4?{displayValue:`${r}.${o}`,isLowerBound:!1}:o.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${o.slice(0,4)}`,isLowerBound:!1}}import{useMemo as Sp}from"react";import{useQuery as rw}from"@tanstack/react-query";var Rt={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},Rp={dev:[jn(612044),jn(97),jn(998)],stage:[jn(612044),jn(97),jn(998)],production:[jn(612055),jn(56)]};function ql(e){return Rp[e]}var Di="https://terms.onechain.nexus/docs/terms-july-23-2026",Pi="https://terms.onechain.nexus/docs/pp-july-23-2026",Np="https://contents.crossdefi.io/Terms/terms/tos-26-07-09-oneusd.html";var ow="send:chain-info";function aw(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 Yl(e,...t){let n=e.replace(/\/+$/,""),r=t.map(o=>o.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...r].join("/")}function Tp(e,t,n,r){if(r)return t===Rt[e].cross?Ip(t,r):n?.explorer_url?Yl(n.explorer_url,n.explorer_postfix?.transaction??"tx",r):iw(e,t,r)}function Ip(e,t){return Yl("https://explorer.onechain.nexus",String(e),"tx",t)}function iw(e,t,n){let r=Rt[e];if(t===r.cross)return Ip(t,n);if(t===r.bsc)return Yl(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function ka(e,t,n,r=!0){let o=rw({queryKey:[ow,e,t],queryFn:async({signal:s})=>{let l=await Se("walletServer",e),d=await fetch(`${l}/v1/public/chain/info/${t}`,{cache:"no-store",signal:s});if(!d.ok)throw new Error(`Failed to fetch chain info: ${d.status}`);let p=await d.json();if("code"in p&&p.code!==void 0&&p.code!==200)throw new Error(`Chain info API error: ${p.code}`);return aw(p)},enabled:r,staleTime:3e5}),a=o.data;return{transactionUrl:Sp(()=>Tp(e,t,a,n),[t,a,e,n]),chainInfo:a,...o}}function Oi(e,t,n=!0){let{chainInfo:r}=ka(e,t,void 0,n);return{buildTxUrl:Sp(()=>a=>Tp(e,t,r,a),[e,t,r]),chainInfo:r}}var Ep="0x0000000000000000000000000000000000000001";var sw="0xa9059cbb",lw=/^0x[a-fA-F0-9]{40}$/,dw="nexus-cross:dapp-ui:send:recent:",Ap=10;function cw(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Ca(e){return e.toLowerCase()}function vr(e){return lw.test(e)}function Qr(e){return Ca(e.address)===Ep}function Kl(e){return`${dw}${e.toLowerCase()}`}function Yo(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Kl(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>r!==null&&typeof r=="object"&&vr(r.address)&&typeof r.updatedAt=="number").slice(0,Ap):[]}catch{return[]}}function Zl(e,t){if(typeof window>"u")return[];let n=Ca(t),r=[{address:n,updatedAt:Date.now()},...Yo(e).filter(o=>o.address!==n)].slice(0,Ap);try{window.localStorage.setItem(Kl(e),JSON.stringify(r))}catch{return Yo(e)}return r}function Xl(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Kl(e))}catch{}}function Pr(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[r="0",o=""]=n.split(".");if(o.length>t)return{error:`Max ${t} decimal places.`};let a=BigInt(r||"0"),i=o.padEnd(t,"0"),s=i?BigInt(i):0n,l=10n**BigInt(t),d=a*l+s;return d<=0n?{error:"Amount must be greater than 0."}:{value:d}}function Ko(e,t){let n=BigInt(e||"0"),r=10n**BigInt(t),o=n/r,a=n%r;if(a===0n)return o.toString();let i=cw(a.toString().padStart(t,"0"));return`${o.toString()}.${i}`}function Jl(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),r=t.toString(16).padStart(64,"0");return`${sw}${n}${r}`}function kr(e,t,n=10){if(t<=0)return e.toString();let r=10n**BigInt(t),o=e/r,a=e%r;if(a===0n)return o.toString();let s=a.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return s=s.replace(/0+$/,""),s?`${o.toString()}.${s}`:o.toString()}function $l(e,t){return kr(e,t,6)}function Mp(e){return kr(e,9,2)}function Lp(e){return e.toLocaleString("en-US")}function Bi(e){return e===56||e===97}function zi(e){return e.gasPrice??e.maxFeePerGas}function Dp(e,t=!1){return t?zi(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Fi(e,t=!1){if(t){let n=zi(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 Ui(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Pp(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,r=[];return typeof n.name=="string"&&r.push(n.name),typeof n.shortMessage=="string"&&r.push(n.shortMessage),typeof n.message=="string"&&r.push(n.message),typeof n.details=="string"&&r.push(n.details),n.cause!==void 0&&r.push(Pp(n.cause,t+1)),r.join(`
5
+ `);ce("");import{jsx as _l}from"react/jsx-runtime";function Jc({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:r,children:o}){let a=Ho(`(max-width: ${n}px)`),[i,s]=_o.useState(!1),l=_o.useCallback(()=>s(!1),[]),d=at(e);or(i,l);let p=_o.useMemo(()=>({env:d,theme:t,isMobile:a,open:i,domain:r,close:l}),[d,t,a,i,r,l]);return _l(jl.Provider,{value:p,children:a?_l(_b.Root,{direction:"right",open:i,onOpenChange:s,noBodyStyles:!0,children:o},"drawer"):_l(Xc.Root,{open:i,onOpenChange:s,children:o},"popover")})}import*as np from"@radix-ui/react-popover";import{Drawer as Qb}from"vaul";import{jsx as Pn,jsxs as Vb}from"react/jsx-runtime";function $c({size:e=18}){return Vb("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Pn("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Pn("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function ep(){return Pn("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Pn("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function tp(){return Pn("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Pn("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as Vo}from"react/jsx-runtime";function rp({asChild:e,children:t,className:n,style:r}){let{isMobile:o,theme:a}=Ni(),i=t!=null,s=e??!0,l=n?`al-trigger-btn ${n}`:"al-trigger-btn",d=i?t:Vo("button",{type:"button",className:l,"data-theme":a,"data-track":"open",style:r,children:Vo($c,{size:18})});return o?Vo(xe,{feature:"app_launcher",children:Vo(Qb.Trigger,{asChild:s,children:d})}):Vo(xe,{feature:"app_launcher",children:Vo(np.Trigger,{asChild:s,children:d})})}import*as xr from"react";import*as Ei from"@radix-ui/react-popover";import{Drawer as Qo}from"vaul";import{useQuery as Kb}from"@tanstack/react-query";var op={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 qb="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Yb="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function yr(e,t){return`${e==="production"?Yb:qb}/${t}.png`}function ap(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:yr(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:yr(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:yr(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:yr(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:yr(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:yr(t,"cross-staking"),order:7500,type:"cross-staking",badge:null,isNew:!0,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:yr(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:yr(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:yr(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:yr(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function Ii(e){let t=at(e);return Kb({queryKey:["global-menu",t],queryFn:async()=>{try{let n=await fetch(op[t],{cache:"no-store"});if(!n.ok)throw new Error(`Failed to fetch global menu: ${n.status}`);return n.json()}catch{return ap(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function Vl(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function sp(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function lp(e){return[...e].sort((t,n)=>{let r=ip(t)-ip(n);return r!==0?r:t.order-n.order})}function ip(e){let t=Vl(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as Vt,jsxs as qo}from"react/jsx-runtime";function Zb(e){return e.id==="cross-staking"||e.type==="cross-staking"}function cp({align:e="end",sideOffset:t=8,className:n}){let{env:r,theme:o,isMobile:a,domain:i,close:s}=Ni(),{data:l}=Ii(r),d=xr.useMemo(()=>lp(l?.items??[]),[l?.items]),p=24,g=xr.useRef(null),u=xr.useRef(!1),m=xr.useCallback(x=>{g.current={x:x.clientX,y:x.clientY},u.current=!1},[]),y=xr.useCallback(x=>{let k=g.current;g.current=null,k&&(u.current=Math.abs(x.clientX-k.x)>p||Math.abs(x.clientY-k.y)>p)},[]),w=xr.useCallback(()=>{g.current=null,u.current=!0},[]),f=typeof window<"u"?window.location.pathname:"",c=xr.useCallback((x,k)=>{let R=u.current;if(u.current=!1,R&&x.detail!==0)return;let S=k.url[r]??k.url.production,C=dp(S,i);if(!C)try{let N=new URL(S);if(N.pathname===window.location.pathname&&N.search===window.location.search&&N.hash===window.location.hash){s();return}}catch{}if(C){let N=window.open(S,"_blank");if(N){N.opener=null,s();return}}window.location.href=S},[r,i,s]),h=x=>{let k=x.url[r]??x.url.production,R=dp(k,i),S=Vl(x),C=S==="ending",N=sp(x.iconUrl,r),E=!1;if(!R)try{let A=new URL(k).pathname;E=f===A||f.startsWith(A+"/")}catch{E=!1}return Vt("button",{type:"button",className:"al-grid-item","data-track":"menu_item_click","data-track-id":x.id,"data-active":E||void 0,"data-service-status":S,onPointerDown:m,onPointerUp:y,onPointerCancel:w,onClick:A=>c(A,x),children:qo("div",{className:"al-grid-item-left",children:[qo("div",{className:"al-grid-item-icon",children:[Vt("img",{src:N,alt:x.label,width:24,height:24,loading:"lazy"}),x.isNew&&Vt("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),qo("span",{className:"al-grid-item-text",children:[Vt("span",{className:"al-grid-item-label",children:x.label}),C&&Vt("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),x.badge&&!Zb(x)&&Vt("span",{className:"al-badge al-badge-list",children:x.badge})]})]})},x.id)},b=Vt("div",{className:"al-menu","data-theme":o,children:Vt("div",{className:"al-grid",children:d.map(h)})});return a?Vt(xe,{feature:"app_launcher",children:qo(Qo.Portal,{children:[Vt(Qo.Overlay,{className:"al-drawer-overlay"}),qo(Qo.Content,{className:ye("al-drawer-content",n),"data-theme":o,children:[qo("div",{className:"al-drawer-header",children:[Vt(Qo.Close,{className:"al-drawer-close","data-track":"close",children:Vt(ep,{})}),Vt(Qo.Title,{className:"al-drawer-title",children:"ONE Services"}),Vt(Qo.Close,{className:"al-drawer-close","data-track":"close",children:Vt(tp,{})})]}),Vt("div",{className:"al-drawer-body",children:b})]})]})}):Vt(xe,{feature:"app_launcher",children:Vt(Ei.Portal,{children:Vt(Ei.Content,{align:e,sideOffset:t,className:ye("al-popover-content",n),"data-theme":o,children:b})})})}function dp(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}import*as Wa from"react";import*as Ig from"@radix-ui/react-popover";import{Drawer as d2}from"vaul";import{createContext as Xb,useContext as Jb}from"react";var xa=Xb(null);function _r(){let e=Jb(xa);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}import*as rn from"react";import{WALLET_LABELS as $b}from"@nexus-cross/crossx-design-system";var Ql=(r=>(r.CROSSx="crossx",r.MetaMask="io.metamask",r.Binance="com.binance.wallet",r))(Ql||{}),Ai={crossx:{name:$b.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"}};import*as ou from"react";import{jsx as ve,jsxs as Vr}from"react/jsx-runtime";function pp({size:e=16,className:t}){return Vr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("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"}),ve("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 Lr({size:e=16,className:t}){return ve("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("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 ar({size:e=16,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function hn({size:e=24,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function up({size:e=20,className:t}){return Vr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("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"}),ve("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 Mi({size:e=20,className:t}){return ve("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:ve("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 On({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Gn({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function fp({size:e=16,className:t}){return Vr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("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"}),ve("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 mp({size:e=16,className:t}){return Vr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("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"}),ve("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var ew='<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>',tw=`data:image/svg+xml,${encodeURIComponent(ew)}`;function gp({size:e=42,className:t}){return ve("img",{src:tw,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function hp({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("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 bp({size:e=24,className:t}){return Vr("svg",{width:e,height:e,viewBox:"-2.5 -2.5 26.67 26.67",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("defs",{children:Vr("linearGradient",{id:"wi-send-solid-grad",x1:"21.6678",y1:"10.8341",x2:"3.99487",y2:"19.2366",gradientUnits:"userSpaceOnUse",children:[ve("stop",{stopColor:"var(--wi-send-solid-from, #f62e61)"}),ve("stop",{offset:"1",stopColor:"var(--wi-send-solid-to, #f7564a)"})]})}),ve("path",{d:"M19.7662 0.0826863C20.8951 -0.311758 21.9796 0.772686 21.5851 1.90158L15.0018 20.7127C14.574 21.9327 12.874 22.0016 12.3496 20.8205L9.1729 13.6738L13.644 9.20158C13.7912 9.0436 13.8713 8.83466 13.8675 8.61877C13.8637 8.40288 13.7763 8.1969 13.6236 8.04422C13.4709 7.89154 13.2649 7.80408 13.049 7.80027C12.8331 7.79646 12.6242 7.8766 12.4662 8.0238L7.99401 12.4949L0.847345 9.31824C-0.333766 8.79269 -0.263766 7.0938 0.955123 6.66602L19.7662 0.0826863Z",fill:"url(#wi-send-solid-grad)"})]})}function wp({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("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 yp({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("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 xp({size:e=20,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ve("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 vp({size:e=20,className:t}){return Vr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ve("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),ve("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}function va({size:e=14,className:t}){return ve("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":!0,children:ve("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"})})}function kp({className:e}){return Vr("svg",{viewBox:"0 0 540 540",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":!0,children:[ve("path",{d:"M341.385 435.217V376.643H326.742V362H370.672V376.643H356.029V435.217H341.385Z"}),ve("path",{d:"M261.725 435.217V362H305.656V376.643H276.369V391.287H305.656V405.93H276.369V435.217H261.725Z"}),ve("path",{d:"M167.422 435.217V362H182.066V376.643H196.709V391.287H211.352V405.93H225.996V362H240.639V435.217H225.996V420.573H211.352V405.93H196.709V391.287H182.066V435.217H167.422Z"}),ve("path",{d:"M237.374 204.563C243.054 204.563 248.502 202.307 252.518 198.29C256.534 194.274 258.791 188.826 258.791 183.146C258.791 177.466 256.534 172.019 252.518 168.002C248.502 163.986 243.054 161.73 237.374 161.73C231.694 161.73 226.247 163.986 222.23 168.002C218.214 172.019 215.957 177.466 215.957 183.146C215.957 188.826 218.214 194.274 222.23 198.29C226.247 202.307 231.694 204.563 237.374 204.563ZM371.228 145.667L269.499 86.7713L167.77 145.667V263.459L269.499 322.355L371.228 263.459V145.667ZM269.499 111.518L349.812 158.014V231.687L300.96 202.389L215.604 266.404L189.187 251.112V158.014L269.499 111.518ZM269.499 297.608L235.746 278.065L302.288 228.164L345.1 253.843L269.499 297.608Z"})]})}import*as pe from"react";import xo from"bignumber.js";function nw(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 Dr(e,t){if(!e||e==="0")return"0.00";let n=new xo(e).shiftedBy(-t),r=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(r,xo.ROUND_DOWN)}function Xt(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function vo(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,r=Math.pow(10,n);return`$${(Math.floor(t*r)/r).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function Li(e,t,n){let o=new xo(e).shiftedBy(-t).multipliedBy(new xo(n));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(xo.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,xo.ROUND_DOWN):o.decimalPlaces(4,xo.ROUND_DOWN)).toFormat()}`}function Cp(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let n=t;if(n.includes("e")||n.includes("E")){let i=Number(n);if(!Number.isFinite(i)||i===0)return{displayValue:"0",isLowerBound:!1};n=nw(i.toFixed(18))}let[r="0",o=""]=n.split(".");if(Number(r)>=1){let i=o.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(r).toLocaleString("en-US")}.${i}`,isLowerBound:!1}}return o.length<4?{displayValue:`${r}.${o}`,isLowerBound:!1}:o.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${o.slice(0,4)}`,isLowerBound:!1}}import{useMemo as Sp}from"react";import{useQuery as rw}from"@tanstack/react-query";var Rt={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},Rp={dev:[jn(612044),jn(97),jn(998)],stage:[jn(612044),jn(97),jn(998)],production:[jn(612055),jn(56)]};function ql(e){return Rp[e]}var Di="https://terms.onechain.nexus/docs/terms-july-23-2026",Pi="https://terms.onechain.nexus/docs/pp-july-23-2026",Np="https://contents.crossdefi.io/Terms/terms/tos-26-07-09-oneusd.html";var ow="send:chain-info";function aw(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 Yl(e,...t){let n=e.replace(/\/+$/,""),r=t.map(o=>o.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...r].join("/")}function Tp(e,t,n,r){if(r)return t===Rt[e].cross?Ip(t,r):n?.explorer_url?Yl(n.explorer_url,n.explorer_postfix?.transaction??"tx",r):iw(e,t,r)}function Ip(e,t){return Yl("https://explorer.onechain.nexus",String(e),"tx",t)}function iw(e,t,n){let r=Rt[e];if(t===r.cross)return Ip(t,n);if(t===r.bsc)return Yl(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function ka(e,t,n,r=!0){let o=rw({queryKey:[ow,e,t],queryFn:async({signal:s})=>{let l=await Se("walletServer",e),d=await fetch(`${l}/v1/public/chain/info/${t}`,{cache:"no-store",signal:s});if(!d.ok)throw new Error(`Failed to fetch chain info: ${d.status}`);let p=await d.json();if("code"in p&&p.code!==void 0&&p.code!==200)throw new Error(`Chain info API error: ${p.code}`);return aw(p)},enabled:r,staleTime:3e5}),a=o.data;return{transactionUrl:Sp(()=>Tp(e,t,a,n),[t,a,e,n]),chainInfo:a,...o}}function Oi(e,t,n=!0){let{chainInfo:r}=ka(e,t,void 0,n);return{buildTxUrl:Sp(()=>a=>Tp(e,t,r,a),[e,t,r]),chainInfo:r}}var Ep="0x0000000000000000000000000000000000000001";var sw="0xa9059cbb",lw=/^0x[a-fA-F0-9]{40}$/,dw="nexus-cross:dapp-ui:send:recent:",Ap=10;function cw(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Ca(e){return e.toLowerCase()}function vr(e){return lw.test(e)}function Qr(e){return Ca(e.address)===Ep}function Kl(e){return`${dw}${e.toLowerCase()}`}function Yo(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Kl(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>r!==null&&typeof r=="object"&&vr(r.address)&&typeof r.updatedAt=="number").slice(0,Ap):[]}catch{return[]}}function Zl(e,t){if(typeof window>"u")return[];let n=Ca(t),r=[{address:n,updatedAt:Date.now()},...Yo(e).filter(o=>o.address!==n)].slice(0,Ap);try{window.localStorage.setItem(Kl(e),JSON.stringify(r))}catch{return Yo(e)}return r}function Xl(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Kl(e))}catch{}}function Pr(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[r="0",o=""]=n.split(".");if(o.length>t)return{error:`Max ${t} decimal places.`};let a=BigInt(r||"0"),i=o.padEnd(t,"0"),s=i?BigInt(i):0n,l=10n**BigInt(t),d=a*l+s;return d<=0n?{error:"Amount must be greater than 0."}:{value:d}}function Ko(e,t){let n=BigInt(e||"0"),r=10n**BigInt(t),o=n/r,a=n%r;if(a===0n)return o.toString();let i=cw(a.toString().padStart(t,"0"));return`${o.toString()}.${i}`}function Jl(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),r=t.toString(16).padStart(64,"0");return`${sw}${n}${r}`}function kr(e,t,n=10){if(t<=0)return e.toString();let r=10n**BigInt(t),o=e/r,a=e%r;if(a===0n)return o.toString();let s=a.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return s=s.replace(/0+$/,""),s?`${o.toString()}.${s}`:o.toString()}function $l(e,t){return kr(e,t,6)}function Mp(e){return kr(e,9,2)}function Lp(e){return e.toLocaleString("en-US")}function Bi(e){return e===56||e===97}function zi(e){return e.gasPrice??e.maxFeePerGas}function Dp(e,t=!1){return t?zi(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Fi(e,t=!1){if(t){let n=zi(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 Ui(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Pp(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,r=[];return typeof n.name=="string"&&r.push(n.name),typeof n.shortMessage=="string"&&r.push(n.shortMessage),typeof n.message=="string"&&r.push(n.message),typeof n.details=="string"&&r.push(n.details),n.cause!==void 0&&r.push(Pp(n.cause,t+1)),r.join(`
6
6
  `).toLowerCase()}function pw(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 ed(e,t={},n="Failed to send transaction."){let r=Pp(e);if(!r)return n;let o=t.nativeSymbol?.trim()||"gas token",a=t.networkName?.trim();if(r.includes("user rejected")||r.includes("userrejected")||r.includes("user denied")||r.includes("user cancelled")||r.includes("user canceled")||r.includes("action_rejected")||r.includes("rejected by user"))return"Transaction was cancelled.";if(r.includes("insufficientfunds")||r.includes("insufficient funds")||r.includes("exceeds the balance of the account")||r.includes("insufficient balance for transfer")){let i=a?` on ${a}`:"";return`Not enough ${o} to cover the gas fee.Please top up your ${o} balance and try again.`}return r.includes("transaction underpriced")||r.includes("replacement transaction underpriced")||r.includes("fee too low")?"Gas fee was too low for the network. Please try again.":r.includes("nonce too low")||r.includes("nonce has already been used")||r.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":r.includes("execution reverted")||r.includes("contractfunctionrevertederror")||r.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":r.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":r.includes("http request failed")||r.includes("failed to fetch")||r.includes("network request failed")||r.includes("timeout")||r.includes("econnreset")||r.includes("rpc error")||r.includes("429")?"Network connection failed. Check your internet and try again.":r.includes("estimategas")||r.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":pw(e)||n}var uw=2000000000n,fw=1000000000n;async function ji(e,t,n){let r=new AbortController,o=setTimeout(()=>r.abort(),8e3),a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:n}),signal:r.signal}).finally(()=>clearTimeout(o));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let i=await a.json();if(i.error)throw new Error(`RPC ${t}: ${i.error.message}`);if(i.result===void 0)throw new Error(`RPC ${t}: empty result`);return i.result}function Wi(e){return BigInt(e)}function mw(e){return`0x${e.toString(16)}`}function gw(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=mw(e.value)),e.data&&(t.data=e.data),t}function hw(e){return e===56||e===97}async function Op(e){try{let t=await ji(e,"eth_gasPrice",[]);return{gasPrice:Wi(t)}}catch{return{gasPrice:uw}}}async function bw(e,t){let n=fw;try{let r=await ji(e,"eth_maxPriorityFeePerGas",[]);n=Wi(r)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function ww(e,t){if(t)return Op(e);let n;try{n=(await ji(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?bw(e,Wi(n)):Op(e)}async function Bp(e,t){let n=hw(t.chainId),r=gw(t),[o,a]=await Promise.all([ji(e,"eth_estimateGas",[r]),ww(e,n)]);return{gasLimit:Wi(o),gasPrice:a.gasPrice,maxFeePerGas:a.maxFeePerGas,maxPriorityFeePerGas:a.maxPriorityFeePerGas}}function zp(e){let{estimateGas:t,sendTransaction:n,getTransactionReceipt:r}=e;return{canSend:!!n,canEstimateGas(o){return!!t||!!o},async estimateGas(o,a){if(t)return t(o);if(a)return Bp(a,o);throw new Error("Gas estimation is not available.")},async sendTransaction(o){if(!n)throw new Error("Sending is not available for this wallet.");return n(o)},getTransactionReceipt:r}}var yw=1500,xw=120;function Fp(e){return!!(e.token||e.recipient||e.amount)}function td({recipient:e,amount:t,token:n,balanceRaw:r}){let o={},a=e.trim(),i=Pr(t,n.quantity.decimals),s;return a?vr(a)||(o.recipient="Enter a valid EVM recipient address."):o.recipient="Enter a recipient address.","error"in i?o.amount=i.error:(s=i.value,s>r&&(o.amount="Amount exceeds available balance.")),!Qr(n)&&!vr(n.address)&&(o.token="Token contract address is invalid."),{errors:o,rawAmount:o.amount?void 0:s,recipient:a&&vr(a)?a:void 0}}function nd({token:e,walletAddress:t,recipient:n,rawAmount:r}){let o=t;return Qr(e)?{to:n,value:r,chainId:e.chainId,from:o}:{to:Ca(e.address),data:Jl(n,r),value:0n,chainId:e.chainId,from:o}}function vw(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var kw=e=>new Promise(t=>setTimeout(t,e));async function Up({repository:e,args:t,chainId:n,onSubmitted:r,pollIntervalMs:o=yw,pollMaxAttempts:a=xw}){let i=await e.sendTransaction(t);r(i);let{getTransactionReceipt:s}=e;if(!s)return"success";for(let l=0;l<a;l+=1){let d=await s({hash:i,chainId:n}).catch(()=>null);if(d)return vw(d)?"reverted":"success";await kw(o)}return"timeout"}var jp=["token","recipient","amount","review"];function Wp(e){let{env:t,walletAddress:n,accountName:r,accounts:o=[],initialStep:a="recipient",token:i,tokens:s=[],onTokenChange:l,sendTransaction:d,getTransactionReceipt:p,estimateGas:g,getTokenPriceUsd:u,onSubmitted:m,onSuccess:y,onFailed:w,onExit:f,onOutlink:c}=e,h=pe.useMemo(()=>zp({sendTransaction:d,getTransactionReceipt:p,estimateGas:g}),[d,p,g]),[b,x]=pe.useState(i);pe.useEffect(()=>{x(i)},[i.address,i.chainId]);let[k,R]=pe.useState(a),[S,C]=pe.useState(""),[N,E]=pe.useState(""),[A,B]=pe.useState({}),[L,U]=pe.useState("idle"),[M,F]=pe.useState(""),[ne,ee]=pe.useState(""),[X,W]=pe.useState(null),[Y,O]=pe.useState(!1),[G,te]=pe.useState(""),_=pe.useRef(0),[ae,be]=pe.useState(null),[Me,le]=pe.useState(""),[ge,me]=pe.useState(()=>Yo(n)),Ke=pe.useRef(new Set),ke=pe.useCallback((j,ue)=>{Ke.current.has(j)||(Ke.current.add(j),Ye("send",j,ue))},[]);pe.useEffect(()=>{ke("opened"),a!=="token"&&ke("token_selected",{tags:{item_id:i.symbol}})},[ke,a,i.symbol]);let Qe=pe.useMemo(()=>at(t),[t]),{transactionUrl:pt,chainInfo:De}=ka(Qe,b.chainId,M||void 0,!0),Ue=bo(b.chainId,Qe),Be=Ue.nativeSymbol??De?.currency_symbol??"",St=Ue.name??De?.name??`Chain ID ${b.chainId}`,Ht=pe.useRef({nativeSymbol:Be||void 0,networkName:St,tokenSymbol:b.symbol});Ht.current={nativeSymbol:Be||void 0,networkName:St,tokenSymbol:b.symbol};let ut=pe.useMemo(()=>BigInt(b.quantity.numeric||"0"),[b.quantity.numeric]),Tt=pe.useMemo(()=>Dr(b.quantity.numeric,b.quantity.decimals),[b.quantity.numeric,b.quantity.decimals]),vt=u?.(b),_t=pe.useMemo(()=>{if(vt===void 0)return;let j=parseFloat(N.replace(/,/g,""));return Number.isFinite(j)?j*vt:0},[N,vt]);pe.useEffect(()=>{E(""),B({})},[b.address,b.chainId]),pe.useEffect(()=>{_.current+=1,W(null),te(""),O(!1)},[b.address,b.chainId,S,N]),pe.useEffect(()=>{me(Yo(n))},[n]);let kt=pe.useCallback(j=>{C(j),B(ue=>({...ue,recipient:void 0}))},[]),it=pe.useCallback(j=>{E(j),B(ue=>({...ue,amount:void 0}))},[]),It=pe.useCallback(()=>{E(Tt.replace(/,/g,"")),B(j=>({...j,amount:void 0}))},[Tt]),et=pe.useCallback(j=>{x(j),l?.(j),ke("token_selected",{tags:{item_id:j.symbol}}),R("recipient")},[l,ke]),qt=pe.useCallback(()=>R("token"),[]),st=pe.useCallback(()=>{R(j=>{if(j==="result")return"review";if(j===a)return f?.(),j;let ue=jp.indexOf(j);return ue<=0?(f?.(),j):jp[ue-1]})},[a,f]),nn=pe.useCallback(()=>{let{errors:j}=td({recipient:S,amount:"1",token:b,balanceRaw:ut});if(j.recipient){B(ue=>({...ue,recipient:j.recipient}));return}B(ue=>({...ue,recipient:void 0})),ke("recipient_entered"),R("amount")},[S,b,ut,ke]),_e=pe.useCallback(j=>{C(j),B(ue=>({...ue,recipient:void 0})),ke("recipient_entered"),R("amount")},[ke]),ot=pe.useCallback(()=>{let j=td({recipient:S,amount:N,token:b,balanceRaw:ut});B(j.errors),!(Fp(j.errors)||j.rawAmount===void 0||!j.recipient)&&(be(j.rawAmount),le(j.recipient),W(null),te(""),U("idle"),ke("amount_entered"),R("review"))},[S,N,b,ut,ke]);pe.useEffect(()=>{if(k!=="review"||!Me||ae===null||X!==null||Y||G||!h.canEstimateGas(De?.rpc))return;let j=++_.current;O(!0),te(""),(async()=>{try{let ue=nd({token:b,walletAddress:n,recipient:Me,rawAmount:ae}),he=await h.estimateGas(ue,De?.rpc);if(_.current!==j)return;W(he)}catch(ue){if(_.current!==j)return;te(ed(ue,Ht.current,"Failed to estimate gas."))}finally{_.current===j&&O(!1)}})()},[k,Me,ae,X,Y,G,h,De?.rpc,b,n]);let Ze=pe.useMemo(()=>{if(!Qr(b)||!X||ae===null)return!1;let j=Fi(X,Bi(b.chainId));return j===null?!1:ae+j>ut},[b,X,ae,ut]),Ct=pe.useCallback(async()=>{if(!(!Me||ae===null)&&!Ze){ee(""),F(""),U("submitting"),ke("submitted");try{let j="",ue=await Up({repository:h,args:nd({token:b,walletAddress:n,recipient:Me,rawAmount:ae}),chainId:b.chainId,onSubmitted:he=>{j=he,F(he),U("confirming"),me(Zl(n,Me)),m?.({txHash:he,chainId:b.chainId,amount:N,tokenSymbol:b.symbol,recipient:Me})}});if(ue==="success")U("success"),ke("confirmed"),j&&y?y?.(j):R("result");else if(ue==="reverted"){let he="Transaction reverted on-chain.";U("error"),ee(he),ke("confirmed",{status:"failure",reason:Dn(new Error(he))}),j&&w?w({txHash:j,chainId:b.chainId,message:he}):R("result")}else{let he="Transaction receipt was not found. Please check again later.";U("error"),ee(he),ke("confirmed",{status:"failure",reason:"timeout"}),j&&w?w({txHash:j,chainId:b.chainId,message:he}):R("result")}}catch(j){U("error"),ke("confirmed",{status:"failure",reason:Dn(j)}),ee(ed(j,{nativeSymbol:Be||void 0,networkName:St,tokenSymbol:b.symbol})),R("result")}}},[h,Me,ae,Ze,b,N,n,m,y,w,Be,St,ke]),[bt,Ve]=pe.useState(!1),Yt=pe.useRef(void 0);pe.useEffect(()=>()=>clearTimeout(Yt.current),[]);let Kt=pe.useCallback(async()=>{if(M)try{await navigator.clipboard.writeText(M),Ve(!0),clearTimeout(Yt.current),Yt.current=setTimeout(()=>Ve(!1),2e3)}catch{}},[M]),Bt=pe.useCallback(()=>{if(!pt||!M)return;let j=Ie=>{typeof window<"u"&&window.open(Ie,"_blank","noopener,noreferrer")};if(!c){j(pt);return}let ue=c(pt,{category:"send",origin:"send-transaction",payload:{chainId:b.chainId,txHash:M}});if(ue&&typeof ue.then=="function"){let Ie=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;ue.then(tt=>{if(tt===null){Ie?.close();return}let zt=tt??pt;if(Ie)try{Ie.location.href=zt}catch{Ie.close(),j(zt)}else j(zt)});return}let he=ue;he!==null&&j(he??pt)},[c,b.chainId,pt,M]),Zt=pe.useCallback(()=>{ee(""),F(""),U("idle"),W(null),te(""),Ke.current.delete("submitted"),Ke.current.delete("confirmed"),R("review")},[]);return{step:k,status:L,token:b,tokens:s.length>0?s:[b],recipient:S,amount:N,amountUsd:_t,fieldErrors:A,error:ne,txHash:M,gasEstimate:X,gasLoading:Y,gasError:G,insufficientGas:Ze,reviewRawAmount:ae,reviewRecipient:Me,recentAddresses:ge,accounts:o,accountName:r,walletAddress:n,resolvedEnv:Qe,transactionUrl:pt,networkName:St,nativeSymbol:Be,nativeDecimals:De?.currency_decimals??b.quantity.decimals,balanceRaw:ut,balanceText:Tt,priceUsd:vt,canSelectToken:(s.length>0?s:[b]).length>1,canSend:h.canSend,getTokenPriceUsd:u,setRecipient:kt,setAmount:it,setMax:It,selectToken:et,goToTokenSelect:qt,selectRecipient:_e,submitRecipient:nn,submitAmount:ot,confirmSend:Ct,retry:Zt,back:st,hashCopied:bt,copyHash:Kt,openTransaction:Bt}}import*as ir from"react";import{jsx as Ra,jsxs as rd}from"react/jsx-runtime";function Gp({flow:e}){let{amount:t,setAmount:n,amountUsd:r,balanceText:o,balanceRaw:a,token:i,setMax:s}=e,l=ir.useRef(null),d=ir.useCallback(()=>{requestAnimationFrame(()=>{let w=l.current;if(!w)return;let f=w.value.length;w.setSelectionRange(f,f)})},[]);ir.useEffect(()=>{l.current?.focus(),d()},[d]),ir.useEffect(()=>{t===""&&(u(!1),d())},[t,d]);let p=ir.useMemo(()=>{let w=Pr(t,i.quantity.decimals);return"value"in w&&w.value>a},[t,i.quantity.decimals,a]),[g,u]=ir.useState(!1),m=!g&&t===""?"0.00":t,y=t.trim()===""||t.trim()==="0";return Ra("div",{className:"sf-body sf-amount",children:rd("div",{className:"sf-amount-center",children:[Ra("span",{className:"sf-amount-usd",children:r!==void 0?Ui(r):"\xA0"}),Ra("div",{className:"sf-amount-input-wrap","data-over":p||void 0,"data-empty":y||void 0,onClick:()=>l.current?.focus(),children:Ra("input",{ref:l,className:"sf-amount-input",value:m,onChange:w=>{let f=w.target.value;if(g)n(f);else if(t===""){if(f.length<4)return;u(!0);let c=f.startsWith("0.00")?f.slice(4):f;n(c)}else u(!0),n(f)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${i.symbol}`,size:1})}),rd("div",{className:"sf-amount-balance",children:[Ra("span",{children:"Balance:"}),rd("button",{type:"button",className:"sf-amount-max",onClick:s,"data-track":"amount_max",children:[o," ",i.symbol]})]})]})})}import*as dr from"react";var Rw=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function od(e){return Rw.has(e.toLowerCase())}var Nw="0x0000000000000000000000000000000000000001",Sw={dev:"0x26ca2a92ea9659e073621bb85b9117dc5944cff1",stage:"0x26ca2a92ea9659e073621bb85b9117dc5944cff1",production:"0x6bf62ca91e397b5a7d1d6bce97d9092065d7a510"},Tw={dev:"0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb",stage:"0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb",production:"0xff42c13d927a6b9265236619161accb227b6d452"};function Gi(e){let t=Rt[e];return[{chainId:t.cross,address:Nw},{chainId:t.bsc,address:Sw[e]},{chainId:t.cross,address:Tw[e]}].map(({chainId:n,address:r})=>({chainId:n,address:r.toLowerCase()}))}var Hp={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Na(e,t){let n=Rt[e];if(t===n.cross)return Hp.cross;if(t===n.bsc)return Hp.bsc}var Iw={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Or(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:r=120,bg:o,format:a="png"}=n,i=Iw[e],s=o?`&bg=${o}`:"";return`${i}/portrait/evm/${t}.${a}?size=${r}${s}`}import{jsx as Hn,jsxs as Hi}from"react/jsx-runtime";function _p({size:e=20,className:t}){return Hi("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[Hn("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),Hn("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Vp({size:e=20,className:t}){return Hn("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:Hn("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 Qp({size:e=20,className:t}){return Hi("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[Hn("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),Hn("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function qp({size:e=16,className:t}){return Hn("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:Hn("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Yp({size:e=56,className:t}){return Hi("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[Hn("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-green-default, #00b4b7)"}),Hn("path",{d:"M17 28.5 24.2 35.5 39 20.5",stroke:"var(--ds-system-green-on, #ffffff)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Kp({size:e=56,className:t}){return Hi("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[Hn("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),Hn("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import*as sr from"react";var Ew=240;function _i(e,t,n,r=[]){let o=sr.useRef(null),[a,i]=sr.useState(null),[s,l]=sr.useState(null),d=sr.useCallback(g=>{g!==e&&(l(n.indexOf(g)>n.indexOf(e)?"from-right":"from-left"),t(g))},[e,t,n]);sr.useEffect(()=>{if(!s)return;let g=window.setTimeout(()=>l(null),Ew+60);return()=>window.clearTimeout(g)},[s,e]),sr.useLayoutEffect(()=>{let g=o.current;if(!g)return;let u=()=>{let y=g.querySelector("[data-active]");y&&i({left:y.offsetLeft+4,width:Math.max(y.offsetWidth-8,0)})};if(u(),typeof ResizeObserver>"u")return;let m=new ResizeObserver(u);return m.observe(g),g.querySelectorAll('[role="tab"]').forEach(y=>m.observe(y)),()=>m.disconnect()},[e,...r]);let p=a?{width:a.width,transform:`translateX(${a.left}px)`}:void 0;return{tabsRef:o,indicatorStyle:p,slide:s,select:d}}import{jsx as wt,jsxs as lr}from"react/jsx-runtime";var Aw=["recent","account"];function Zp(e,t){return e.name||`Account ${(e.index??t)+1}`}function Xp(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Jp(e){return e.toLowerCase()}function $p({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:r,recentAddresses:o,accounts:a,walletAddress:i,resolvedEnv:s,selectRecipient:l}=e,d=dr.useMemo(()=>a.filter(S=>S.address.toLowerCase()!==i.toLowerCase()),[a,i]),p=d.length>0,g=dr.useMemo(()=>new Map(d.map((S,C)=>[Jp(S.address),{account:S,index:C}])),[d]),[u,m]=dr.useState("recent"),{tabsRef:y,indicatorStyle:w,slide:f,select:c}=_i(u,m,Aw,[p]),h=dr.useRef(null);dr.useEffect(()=>{h.current?.focus()},[]);let b="1A1A2E",x=dr.useCallback(async()=>{try{let S=await navigator.clipboard.readText();S&&n(S.trim())}catch{}},[n]),k=t.trim().length>0,R=vr(t.trim());return lr("div",{className:"sf-recipient",children:[lr("div",{className:"sf-recipient-top",children:[lr("div",{className:"sf-address-field","data-filled":k||void 0,"data-invalid":r.recipient||void 0,children:[wt("textarea",{ref:h,className:"sf-address-input",value:t,onChange:S=>n(S.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:k?2:1}),k?wt("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear","data-track":"recipient_clear",children:wt(Qp,{size:20})}):wt("button",{type:"button",className:"sf-address-action",onClick:x,"aria-label":"Paste from clipboard","data-track":"recipient_paste",children:wt(Vp,{size:20})})]}),r.recipient&&wt("p",{className:"sf-field-error",role:"alert",children:r.recipient}),lr("div",{ref:y,className:"sf-tabs",role:"tablist",children:[wt("button",{type:"button",role:"tab",className:"sf-tab","data-active":u==="recent"||void 0,"aria-selected":u==="recent",onClick:()=>c("recent"),"data-track":"recipient_tab","data-track-id":"recent",children:"Recent"}),p&&wt("button",{type:"button",role:"tab",className:"sf-tab","data-active":u==="account"||void 0,"aria-selected":u==="account",onClick:()=>c("account"),"data-track":"recipient_tab","data-track-id":"account",children:"My Account"}),w&&wt("span",{className:"sf-tab-indicator","aria-hidden":!0,"data-animate":f?!0:void 0,style:w})]})]}),wt("div",{className:"sf-address-list","data-tab-slide":f??void 0,children:u==="account"&&p?d.map((S,C)=>{let N=Zp(S,C),E=Or(s,S.address,{size:56,bg:b});return lr("button",{type:"button",className:"sf-address-row",onClick:()=>l(S.address),"data-track":"recipient_item",children:[lr("span",{className:"sf-address-avatar",children:[E&&wt("img",{src:E,alt:"",width:40,height:40,draggable:!1,onError:A=>{A.currentTarget.style.display="none"}}),wt("span",{className:"sf-address-avatar-fallback",children:Xp(N)})]}),lr("span",{className:"sf-address-meta",children:[wt("span",{className:"sf-address-name",children:N}),wt("span",{className:"sf-address-value",children:Xt(S.address)})]})]},S.address)}):o.length>0?o.map(S=>{let C=g.get(Jp(S.address)),N=C?Zp(C.account,C.index):Xt(S.address),E=Or(s,S.address,{size:56,bg:b});return lr("button",{type:"button",className:"sf-address-row",onClick:()=>l(S.address),"data-track":"recipient_item",children:[lr("span",{className:"sf-address-avatar",children:[E&&wt("img",{src:E,alt:"",width:40,height:40,draggable:!1,onError:A=>{A.currentTarget.style.display="none"}}),wt("span",{className:"sf-address-avatar-fallback",children:Xp(N)})]}),lr("span",{className:"sf-address-meta",children:[wt("span",{className:"sf-address-name",children:N}),wt("span",{className:"sf-address-value",children:Xt(S.address)})]})]},S.address)}):lr("div",{className:"sf-history-empty",role:"status",children:[wt("span",{className:"sf-history-empty-icon","aria-hidden":!0,children:wt("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:wt("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8M3 3v5h5M12 7v5l4 2"})})}),wt("p",{className:"sf-history-empty-title",children:"No send history"}),wt("p",{className:"sf-history-empty-desc",children:"Addresses you send to will appear here."})]})},u),k&&!R&&!r.recipient&&wt("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as bn,jsxs as Zo}from"react/jsx-runtime";function tu({flow:e}){let{status:t,txHash:n,error:r,copyHash:o,hashCopied:a,openTransaction:i}=e,s=t==="error",l=t==="success";return s?Zo("div",{className:"sf-body sf-result sf-result--error",children:[bn("span",{className:"sf-result-icon",children:bn(Kp,{size:56})}),Zo("div",{className:"sf-result-copy",children:[bn("h3",{className:"sf-result-title",children:"Transaction Failed"}),bn("p",{className:"sf-result-desc",children:r||"Something went wrong. Please try again."})]}),n&&bn(eu,{txHash:n,hashCopied:a,onCopy:o,onOpen:i})]}):Zo("div",{className:"sf-body sf-result",children:[bn("span",{className:"sf-result-icon","data-pending":!l||void 0,children:l?bn(Yp,{size:56}):bn("span",{className:"sf-result-spinner"})}),Zo("div",{className:"sf-result-copy",children:[bn("h3",{className:"sf-result-title",children:l?"Transaction Complete":"Transaction in Progress"}),bn("p",{className:"sf-result-desc",children:l?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&bn(eu,{txHash:n,hashCopied:a,onCopy:o,onOpen:i})]})}function eu({txHash:e,hashCopied:t,onCopy:n,onOpen:r}){return Zo("div",{className:"sf-result-hash-card",children:[bn("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),Zo("div",{className:"sf-result-hash-row",children:[bn("button",{type:"button",className:"sf-result-hash-link",onClick:r,"aria-label":"Open transaction in explorer","data-track":"tx_link_open",children:Xt(e)}),bn("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash","data-track":"tx_hash_copy",children:t?bn(ar,{size:16}):"Copy"})]})]})}import{jsx as Mt,jsxs as wn}from"react/jsx-runtime";var Vi="\u2014";function nu({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:r,accountName:o,accounts:a,walletAddress:i,networkName:s,nativeSymbol:l,nativeDecimals:d,gasEstimate:p,gasLoading:g,gasError:u,insufficientGas:m,error:y,resolvedEnv:w}=e,f=Qr(t),c=n!==null?kr(n,t.quantity.decimals):"",h=o?.trim()||`Account ${(a[0]?.index??0)+1}`,b=Or(w,i,{size:56,bg:"1A1A2E"}),x=l||(f?t.symbol:""),k=Bi(t.chainId),R=p?Dp(p,k):null,S=p?Fi(p,k):null,C=L=>L!==null&&x?`${$l(L,d)} ${x}`:Vi,N=L=>L!==void 0?`${Mp(L)} Gwei`:Vi,E=(()=>{if(!f||!p||S===null||n===null)return Vi;let L=n+S;return`${$l(L,d)} ${x||t.symbol}`})(),A=L=>g?"\u2026":L,B=[{label:"Est. Tx Fee",value:A(C(S))},...R==="dynamic"?[{label:"Max Priority Fee",value:A(N(p?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:A(N(p?.maxFeePerGas))}]:R==="legacy"?[{label:"Gas Price",value:A(N(p?zi(p):void 0))}]:[],{label:"Gas Limit",value:A(p?Lp(p.gasLimit):Vi)}];return wn("div",{className:"sf-body sf-review",children:[wn("div",{className:"sf-review-amount",children:[Mt("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"}}),wn("span",{className:"sf-review-amount-value",children:[c,Mt("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),wn("div",{className:"sf-review-parties",children:[wn("div",{className:"sf-review-card sf-review-party",children:[Mt("span",{className:"sf-review-party-label",children:"From"}),wn("div",{className:"sf-review-party-head",children:[Mt("span",{className:"sf-review-party-avatar",children:b&&Mt("img",{src:b,alt:"",width:28,height:28,draggable:!1,onError:L=>{L.currentTarget.style.display="none"}})}),Mt("span",{className:"sf-review-party-name",children:h})]}),Mt("span",{className:"sf-review-party-addr",children:i})]}),Mt("span",{className:"sf-review-arrow","aria-hidden":!0,children:Mt(qp,{size:16})}),wn("div",{className:"sf-review-card sf-review-party",children:[Mt("span",{className:"sf-review-party-label",children:"To"}),Mt("span",{className:"sf-review-party-addr",children:r})]})]}),wn("section",{className:"sf-review-card",children:[Mt("h3",{className:"sf-review-section-title",children:"Summary"}),wn("div",{className:"sf-review-row",children:[Mt("span",{className:"sf-review-row-label",children:"Network"}),Mt("span",{className:"sf-review-row-value",children:s})]}),B.map(L=>wn("div",{className:"sf-review-row",children:[Mt("span",{className:"sf-review-row-label",children:L.label}),Mt("span",{className:"sf-review-row-value",children:L.value})]},L.label))]}),wn("section",{className:"sf-review-card",children:[Mt("h3",{className:"sf-review-section-title",children:"Total"}),wn("div",{className:"sf-review-row",children:[Mt("span",{className:"sf-review-row-label",children:"Total Amount"}),wn("span",{className:"sf-review-row-value",children:[c," ",t.symbol]})]}),f&&wn("div",{className:"sf-review-row",children:[Mt("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),Mt("span",{className:"sf-review-row-value",children:A(E)})]})]}),m&&!u&&!y&&wn("div",{className:"sf-message sf-message--error",role:"alert",children:["Not enough ",x||t.symbol," to cover the amount plus the network fee. Reduce the amount and try again."]}),(u||y)&&Mt("div",{className:"sf-message sf-message--error",role:"alert",children:u||y})]})}import*as Qi from"react";import{jsx as qr,jsxs as ko}from"react/jsx-runtime";function ru({flow:e}){let[t,n]=Qi.useState(""),r=t.trim().toLowerCase(),o=Qi.useMemo(()=>r?e.tokens.filter(a=>a.symbol.toLowerCase().includes(r)||a.name.toLowerCase().includes(r)):e.tokens,[e.tokens,r]);return ko("div",{className:"sf-body sf-token-select",children:[ko("div",{className:"sf-search",children:[qr(_p,{size:20}),qr("input",{className:"sf-search-input",value:t,onChange:a=>n(a.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),ko("div",{className:"sf-token-list",children:[o.map(a=>{let i=`${a.chainId}:${a.address.toLowerCase()}`,s=Na(e.resolvedEnv,a.chainId),l=e.getTokenPriceUsd?.(a);return ko("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(a),"data-track":"token_item","data-track-id":a.symbol,children:[ko("span",{className:"sf-token-left",children:[ko("span",{className:"sf-token-icon-wrap",children:[qr("img",{className:"sf-token-icon",src:a.icon_url,alt:"",width:40,height:40,loading:"lazy",draggable:!1,onError:d=>{d.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),s&&qr("img",{className:"sf-token-chain-badge",src:s,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:d=>{d.currentTarget.style.display="none"}})]}),qr("span",{className:"sf-token-name",children:a.symbol})]}),ko("span",{className:"sf-token-right",children:[qr("span",{className:"sf-token-balance",children:Dr(a.quantity.numeric,a.quantity.decimals)}),l!==void 0&&qr("span",{className:"sf-token-price",children:Ui(l)})]})]},i)}),o.length===0&&qr("div",{className:"sf-empty",children:"No tokens found"})]})]})}ce(`.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-history-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:48px 24px;text-align:center}.sf-history-empty-icon{display:flex;align-items:center;justify-content:center;width:56px;height:56px;margin-bottom:6px;border-radius:50%;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-history-empty-title{margin:0;font-size:15px;font-weight:600;line-height:1.3;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-history-empty-desc{margin:0;font-size:13px;line-height:1.4;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-field-error{margin:8px 24px 0;font-family:inherit;font-size:12px;line-height:1.5;color:var(--ds-system-red-default, #da0b2e)}.sf-message--error{margin:16px 0 0;padding:12px 16px;background:var(--ds-system-red-low, #ffeeee);color:var(--ds-system-red-high, #d20609);font-family:inherit;font-size:13px;line-height:1.5;border-radius:12px;width:100%;box-sizing:border-box}.sf-footer{display:flex;flex-shrink:0;padding:16px 24px 24px}.sf-footer:empty{display:none}.sf-footer-row{display:flex;gap:8px;width:100%}.sf-footer-row .sf-btn,.sf-footer-row .sf-btn--secondary{flex:1 1 0;min-width:0}.sf-footer>.sf-btn{width:100%}.sf-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:1;height:48px;padding:0 24px;border:none;border-radius:12px;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:background-color .15s ease,transform .1s ease}.sf-btn--primary{background:var(--ds-accent-primary-default, #7e54f4);color:var(--ds-accent-primary-on, #ffffff)}.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-primary-default, #7e54f4);color:var(--ds-accent-primary-on, #ffffff);cursor:default;opacity:.5}.sf-btn--secondary{flex:0 0 120px;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-token-select{padding:0;display:flex;flex-direction:column}.sf-token-select .sf-search{margin:16px 24px}.sf-token-select .sf-token-list{width:100%;margin-top:0}.sf-search{display:flex;align-items:center;gap:8px;padding:12px 16px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-low, rgba(0, 0, 0, .4));box-sizing:border-box;transition:border-color .15s ease}.sf-search:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-search:focus-within{border-color:var(--ds-accent-primary-high, #7346f3)}.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:36px;height:36px;flex-shrink:0}.sf-token-icon{width:36px;height:36px;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-accent-primary-high, #7346f3)}.sf-address-field[data-filled]{border-color:var(--ds-accent-primary-high, #7346f3)}.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{position:relative;display:flex;gap:20px;margin:16px 0 0}.sf-tab{position:relative;padding:10px 0 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-content-highest, #000000)}.sf-tab-indicator{position:absolute;left:0;bottom:0;height:3px;border-radius:3px;background:var(--ds-content-highest, #000000);pointer-events:none}.sf-tab-indicator[data-animate]{transition:transform .24s cubic-bezier(.22,1,.36,1),width .24s cubic-bezier(.22,1,.36,1)}.sf-address-list[data-tab-slide=from-right]{animation:sf-tab-slide-from-right .24s cubic-bezier(.22,1,.36,1)}.sf-address-list[data-tab-slide=from-left]{animation:sf-tab-slide-from-left .24s cubic-bezier(.22,1,.36,1)}@keyframes sf-tab-slide-from-right{0%{opacity:0;transform:translate(32px)}to{opacity:1;transform:none}}@keyframes sf-tab-slide-from-left{0%{opacity:0;transform:translate(-32px)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.sf-tab-indicator[data-animate]{transition:none}.sf-address-list[data-tab-slide]{animation:none}}.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-accent-primary-high, #7346f3);animation:sf-spin .8s linear infinite}@keyframes sf-spin{to{transform:rotate(360deg)}}.sf-result-copy{display:flex;flex-direction:column;gap:8px}.sf-result-title{margin:0;font-family:inherit;font-size:18px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-result-desc{margin:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);text-align:left}.sf-result-hash-label{font-family:inherit;font-size:12px;font-weight:500;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sf-result-hash-link{border:none;background:transparent;padding:0;cursor:pointer;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;color:var(--ds-accent-primary-high, #7346f3)}.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
7
  `);import{jsx as Jt,jsxs as qi}from"react/jsx-runtime";var Mw={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function Yi({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:r,className:o,...a}){let i=ou.useCallback(c=>{r?.(c),n?.(c)},[n,r]),l=Wp({...a,onSuccess:r||n?i:void 0,onExit:t}),{step:d,status:p}=l,g=vr(l.recipient.trim()),u=Pr(l.amount,l.token.quantity.decimals),m="value"in u&&u.value<=l.balanceRaw,y=p==="submitting"||p==="confirming",w=d!=="result",f=Mw[d]??"";return Jt(xe,{feature:"send",children:qi("div",{className:ye("sf-root",o),"data-step":d,children:[qi("header",{className:"sf-header",children:[w?Jt("button",{type:"button",className:"sf-header-btn",onClick:l.back,"aria-label":"Back","data-track":"back",children:Jt(On,{size:24})}):Jt("span",{className:"sf-header-btn","aria-hidden":!0}),Jt("span",{className:"sf-header-title",children:f}),Jt("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close","data-track":"close","data-wi-close":!0,children:Jt(hn,{size:24})})]}),d==="token"&&Jt(ru,{flow:l}),d==="recipient"&&Jt($p,{flow:l}),d==="amount"&&Jt(Gp,{flow:l}),d==="review"&&Jt(nu,{flow:l}),d==="result"&&Jt(tu,{flow:l}),qi("footer",{className:"sf-footer","data-step":d,children:[d==="recipient"&&Jt("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"}),d==="amount"&&Jt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitAmount,"data-disabled":!m||void 0,"aria-disabled":!m,"data-track":"amount_next",children:"Next"}),d==="review"&&qi("div",{className:"sf-footer-row",children:[Jt("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:l.back,disabled:y,"data-track":"review_cancel",children:"Cancel"}),Jt("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"})]}),d==="result"&&p==="success"&&Jt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(l.txHash||void 0),"data-track":"result_ok",children:"All done"}),d==="result"&&p==="error"&&Jt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.retry,"data-track":"result_retry",children:"Try Again"})]})]})})}function Ki({env:e,theme:t="dark",showBalance:n=!1,showForgeToken:r=!1,showGameToken:o=!0,showQR:a=!0,showBridge:i=!0,showNft:s=!1,qrLogoSrc:l,walletAddress:d,accountName:p,sendAccounts:g,profileImageUrl:u,connectorId:m,connectorName:y,connectorIconUrl:w,preferredTokens:f=[],onSelectWallet:c,onCopyAddress:h,onBuy:b,onBuyDisabledMessage:x,onBridgeDisabledMessage:k,onSendDisabledMessage:R,onDisconnect:S,disconnectLabel:C="Disconnect",termsUrl:N=Di,termsLabel:E="Terms of Service",privacyUrl:A=Pi,privacyLabel:B="Privacy Policy",showPortfolio:L=!1,showOnePop:U=!1,onePopSummary:M,onOnePopOpen:F,onOnePopSend:ne,onOnePopClaim:ee,onOnePopActivity:X,onOnePopRepliesSeen:W,onePopGetTokenSlot:Y,onePopLogoSrc:O,onePopHeroSrc:G,portfolioTitle:te="My Portfolio",portfolioSections:_,showTotalAssets:ae=!0,totalAssetsLabel:be="Total Assets USD",sendTransaction:Me,getTransactionReceipt:le,estimateGas:ge,onOutlink:me,lpBalanceReader:Ke,stakingRewardsReader:ke,bridgeTokens:Qe,bridgeHistory:pt,getBridgeQuote:De,getBridgeToTokens:Ue,getBridgeApproval:Be,approveBridge:St,submitBridge:Ht,onReceive:ut,onBridge:Tt,onSend:vt,style:_t},{presentation:kt,open:it,isMobile:It,drawerDirection:et,modal:qt,close:st}){let nn=at(e),_e=m?Ai[m]:void 0,ot=y??_e?.name,Ze=w??_e?.iconUrl,[Ct,bt]=rn.useState(null),[Ve,Yt]=rn.useState("top"),[Kt,Bt]=rn.useState(null),[Zt,j]=rn.useState("wallet"),[ue,he]=rn.useState(null),[Ie,tt]=rn.useState(null),[zt,Et]=rn.useState(null),[Cn,Rn]=rn.useState(null),P=rn.useCallback(()=>{j("wallet"),he(null),tt(null),Et(null),Rn(null)},[]);rn.useEffect(()=>{it||P()},[it,P]);let Ce=st??P;rn.useEffect(()=>{Wo(d)},[d]);let je=rn.useCallback(()=>{Xl(d),S?.()},[S,d]);return rn.useMemo(()=>({presentation:kt,env:nn,theme:t,isMobile:It,open:it,drawerDirection:et,modal:qt,showBalance:n,showForgeToken:r,showGameToken:o,showQR:a,showBridge:i,showNft:s,qrLogoSrc:l,walletAddress:d,accountName:p,sendAccounts:g,profileImageUrl:u,connectorName:ot,connectorIconUrl:Ze,preferredTokens:f,close:Ce,onSelectWallet:c,onCopyAddress:h,onBuy:b,onBuyDisabledMessage:x,onBridgeDisabledMessage:k,onSendDisabledMessage:R,onDisconnect:S?je:void 0,disconnectLabel:C,termsUrl:N,termsLabel:E,privacyUrl:A,privacyLabel:B,portalStyle:_t,navContent:Ct,navPosition:Ve,setNavContent:bt,setNavPosition:Yt,footerContent:Kt,setFooterContent:Bt,view:Zt,setView:j,selectedSendToken:ue,setSelectedSendToken:he,selectedDetailToken:Ie,setSelectedDetailToken:tt,selectedNftCollection:zt,setSelectedNftCollection:Et,selectedNft:Cn,setSelectedNft:Rn,showPortfolio:L,showOnePop:U,onePopSummary:M,onOnePopOpen:F,onOnePopSend:ne,onOnePopClaim:ee,onOnePopActivity:X,onOnePopRepliesSeen:W,onePopGetTokenSlot:Y,onePopLogoSrc:O,onePopHeroSrc:G,portfolioTitle:te,portfolioSections:_,showTotalAssets:ae,totalAssetsLabel:be,sendTransaction:Me,getTransactionReceipt:le,estimateGas:ge,onOutlink:me,lpBalanceReader:Ke,stakingRewardsReader:ke,bridgeTokens:Qe,bridgeHistory:pt,getBridgeQuote:De,getBridgeToTokens:Ue,getBridgeApproval:Be,approveBridge:St,submitBridge:Ht,onReceive:ut,onBridge:Tt,onSend:vt}),[kt,nn,t,It,it,et,qt,n,r,o,a,i,s,l,d,p,g,u,ot,Ze,f,Ce,c,h,b,x,k,R,S,je,C,N,E,A,B,_t,Ct,Ve,Kt,Zt,ue,Ie,zt,Cn,L,U,M,F,ne,ee,X,W,Y,O,G,te,_,ae,be,Me,le,ge,me,Ke,ke,Qe,pt,De,Ue,Be,St,Ht,ut,Tt,vt])}import*as au from"@radix-ui/react-popover";import{Drawer as Lw}from"vaul";import{jsx as Zi,jsxs as Dw}from"react/jsx-runtime";function iu({asChild:e,className:t,children:n}){let{isMobile:r,theme:o,walletAddress:a}=_r(),i=n!=null,s=e??!0,l=i?n:Dw("button",{type:"button",className:ye("wi-trigger-btn",t),"data-theme":o,"data-mobile":r||void 0,children:[Zi(pp,{size:r?14:16}),Zi("span",{className:"wi-trigger-address",children:Xt(a)})]});return r?Zi(Lw.Trigger,{asChild:s,children:l}):Zi(au.Trigger,{asChild:s,children:l})}import*as Q from"react";import*as Ds from"@radix-ui/react-popover";import{Drawer as Ls}from"vaul";import kg from"bignumber.js";import ad from"bignumber.js";var Pw=/^[+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i;function gt(e){if(e==null)return null;if(e instanceof ad)return e.isFinite()?e:null;if(typeof e=="number")return Number.isFinite(e)?new ad(e):null;let t=String(e).replace(/[,%\s]/g,"");if(!Pw.test(t))return null;let n=new ad(t);return n.isFinite()?n:null}import{useQueries as Ow}from"@tanstack/react-query";import{useMemo as Bw}from"react";import*as Xi from"react";function su(e){if(!e||typeof e!="object")return;let t=[],n=new Set,r=[],o=[];for(let[a,i]of Object.entries(e)){if(i?.balance!==!0)continue;if(!jc(a)){r.push(a);continue}let s=Wc(a);if(s===void 0){o.push(a);continue}n.has(s)||(n.add(s),t.push(s))}if(t.length!==0)return{chainIds:t,skippedNonEvm:r,skippedMalformed:o}}var lu=new Set;function du(e,t){lu.has(e)||(lu.add(e),console.warn(t))}function cu(e){let t=Ut(Fo,e,Xi.useCallback(r=>{let o=su(r?.chains);if(o)return o.skippedNonEvm.length>0&&du(`${e}:non-evm`,`[dapp-ui] chains.json (${e}): EVM \uC774 \uC544\uB2CC \uCCB4\uC778\uC740 \uC790\uC0B0 \uBAA9\uB85D\uC5D0\uC11C \uC81C\uC678\uD569\uB2C8\uB2E4 \u2014 ${o.skippedNonEvm.join(", ")}`),o.skippedMalformed.length>0&&du(`${e}:malformed`,`[dapp-ui] chains.json (${e}): chainId \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC544 \uC81C\uC678\uD569\uB2C8\uB2E4 \u2014 ${o.skippedMalformed.join(", ")}`),o.chainIds},[e])),n=Xi.useMemo(()=>ql(e),[e]);return t??n}var id="user-balance";async function zw(e,t,n,r){let o=new URLSearchParams({networkId:t,account:n}),a=await fetch(`${e}/v1/public/token/balance?${o}`,{cache:"no-store",signal:r});if(!a.ok)throw new Error(`Failed to fetch token balance: ${a.status}`);let i=await a.json();if(i.code!==200)throw new Error(`Token balance API error: ${i.code}`);return i.data}function Yr(e,t,n=!0){let r=cu(e),o=Ow({queries:r.map(l=>({queryKey:[id,e,t,l],queryFn:async({signal:d})=>zw(await Se("walletServer",e),l,t,d),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),a=o.some(l=>l.isLoading),i=o.some(l=>l.isError);return{tokens:Bw(()=>{let l=[];for(let d of o)d.data&&l.push(...d.data);return l},[o]),isLoading:a,isError:i}}import{useQuery as Fw,useQueries as Uw}from"@tanstack/react-query";import{useMemo as jw}from"react";var Ww="forge-holdings",Gw="forge-token-image";async function Hw(e,t,n){let r=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:n});if(!r.ok)throw new Error(`Failed to fetch forge holdings: ${r.status}`);let o=await r.json();if(!o.success)throw new Error("Forge holdings API error");return o.data.items}async function _w(e,t,n){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:n});if(!r.ok)return{address:t,image_url:""};let o=await r.json();return o.success?{address:t,image_url:o.data.token.image_url}:{address:t,image_url:""}}function pu(e,t,n=!0){let{data:r,...o}=Fw({queryKey:[Ww,e,t],queryFn:async({signal:a})=>Hw(await Se("bondingCurve",e),t,a),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:r??[],...o}}function uu(e,t,n=!0){let r=Uw({queries:t.map(a=>({queryKey:[Gw,e,a],queryFn:async({signal:i})=>_w(await Se("bondingCurve",e),a,i),enabled:n,staleTime:1/0}))});return{imageMap:jw(()=>{let a=new Map;for(let i of r)i.data&&a.set(i.data.address,i.data.image_url);return a},[r])}}import{useQuery as Vw}from"@tanstack/react-query";import{useMemo as Qw}from"react";var sd="token-stats";function Cr(e,t){return`${e}:${t.toLowerCase()}`}function Kr(e,t=!0){let{data:n,...r}=Vw({queryKey:[sd,e],queryFn:async({signal:a})=>{let i=await Se("walletServer",e),s=await fetch(`${i}/v1/public/token/stats`,{cache:"no-store",signal:a});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:Qw(()=>{let a=new Map;if(!n?.data)return a;for(let i of n.data){let s=Cr(i.chain_id,i.address);a.set(s,i)}return a},[n]),...r}}import{useQuery as qw}from"@tanstack/react-query";var Yw="crossd-apr",fu=6e4,Kw="https://crossd-dashboard-api.crossdefi.io/api/v1/overview",Ji,Sa;function ld(){return Ji&&Ji.expiresAt>Date.now()?Promise.resolve(Ji.value):Sa||(Sa=(async()=>{let e=await fetch(Kw,{cache:"no-store"});if(!e.ok)throw new Error(`Failed to fetch CROSSD overview: ${e.status}`);let t=await e.json();if(t.code!==200)throw new Error(`CROSSD overview API error: ${t.code}`);let n=parseFloat(t.data.est_last_epoch_apy);if(!Number.isFinite(n))throw new Error("CROSSD overview returned a non-numeric APR");let r=n*100;return Ji={value:r,expiresAt:Date.now()+fu},r})().finally(()=>{Sa=void 0}),Sa)}function $i(e){let t=Math.abs(e),n=(e>=0?Math.floor:Math.ceil)(t*100)/100;return`APR ${e>=0?"+":"-"}${n}%`}function mu(){let{data:e,...t}=qw({queryKey:[Yw],queryFn:ld,staleTime:fu});return{aprPercent:e??null,...t}}import{useQuery as Zw}from"@tanstack/react-query";import{useMemo as gu}from"react";var Xw="token-info";function es(e,t){return`${t.toLowerCase()}_${e}`}function hu(e,t=!0){let{data:n,...r}=Zw({queryKey:[Xw,e],queryFn:async({signal:i})=>{let s=await Se("walletServer",e),l=await fetch(`${s}/v1/public/token/info`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token info API error: ${d.code}`);return d},enabled:t,staleTime:1/0}),o=gu(()=>{let i=new Map;if(!n?.data)return i;for(let s of n.data){let l=es(s.chain_id,s.address);i.set(l,s.category)}return i},[n]),a=gu(()=>{let i=new Map;if(!n?.data)return i;for(let s of n.data)i.set(es(s.chain_id,s.address),s);return i},[n]);return{categoryMap:o,infoMap:a,...r}}import{useMemo as Jw}from"react";import $w from"bignumber.js";function bu(e,t,n){let{tokens:r,isLoading:o}=Yr(e,t,n),{statsMap:a}=Kr(e,n);return Jw(()=>{let i=new $w(0);for(let p of r){let g=a.get(Cr(p.chainId,p.address));if(!g)continue;let u=gt(p.quantity.numeric),m=gt(g.price);if(!u||!m)continue;let y=u.shiftedBy(-p.quantity.decimals).multipliedBy(m);y.isNaN()||(i=i.plus(y))}let s=i.toFixed(),{displayValue:l,isLowerBound:d}=Cp(s);return{totalUsd:s,displayValue:l,isLowerBound:d,isLoading:o}},[r,a,o])}import yu from"bignumber.js";var e1=/^0x[0-9a-f]{40}$/i;function xu(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let n of e){if(!n||typeof n!="object")return;let{chainId:r,address:o}=n,a=bi(r);if(a===void 0||typeof o!="string")return;let i=o.trim();if(!e1.test(i))return;t.push({chainId:a,address:i.toLowerCase()})}return t}function t1(e){return new Map(e.map((t,n)=>[`${t.chainId}:${t.address.toLowerCase()}`,n]))}var n1=new yu("0.0001");function dd(e){return(gt(e.quantity.numeric)??new yu(0)).shiftedBy(-e.quantity.decimals)}function wu(e,t){return`${e}:${t.toLowerCase()}`}function r1(e,t){return`${t.toLowerCase()}_${e}`}function vu({env:e,tokens:t,pinnedTokens:n,preferredTokens:r,statsMap:o,categoryMap:a,showGameToken:i}){let s=[],l=[],d=[],p=[],g=new Set;for(let f of o.values())g.add(f.chain_id);let u=g.size>0,m=t1(n??Gi(e)),y=new Map;(r??[]).forEach((f,c)=>{let h=bi(f.chainId);h!==void 0&&y.set(`${h}:${f.address.toLowerCase()}`,c)});for(let f of t){let c=`${f.chainId}:${f.address.toLowerCase()}`,h=m.has(c),b=y.get(c);if(h)s.push(f);else if(b!==void 0)d.push(f);else if(dd(f).isGreaterThanOrEqualTo(n1)){if(!i&&a.get(r1(f.chainId,f.address))==="game")continue;u&&!g.has(f.chainId)?l.push(f):p.push(f)}}s.sort((f,c)=>{let h=m.get(`${f.chainId}:${f.address.toLowerCase()}`)??99,b=m.get(`${c.chainId}:${c.address.toLowerCase()}`)??99;return h-b}),d.sort((f,c)=>{let h=y.get(`${f.chainId}:${f.address.toLowerCase()}`)??99,b=y.get(`${c.chainId}:${c.address.toLowerCase()}`)??99;return h-b});let w=(f,c)=>{let h=o.get(wu(f.chainId,f.address)),b=o.get(wu(c.chainId,c.address)),x=dd(f).multipliedBy(gt(h?.price)??0);return dd(c).multipliedBy(gt(b?.price)??0).minus(x).toNumber()};return l.sort(w),p.sort(w),[...s,...l,...d,...p]}import*as ts from"react";var ku=new Set;function o1(e){ku.has(e)||(ku.add(e),console.warn(`[dapp-ui] apps.json walletInfo.pinnedTokens (${e}) \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC544 \uBB34\uC2DC\uD569\uB2C8\uB2E4 \u2014 \uAE30\uBCF8 \uACE0\uC815 \uBAA9\uB85D\uC73C\uB85C \uD3F4\uBC31\uD569\uB2C8\uB2E4.`))}function Cu(e){let t=Ut(wi,e,ts.useCallback(r=>{let o=r?.walletInfo?.pinnedTokens;if(o===void 0)return;let a=xu(o);if(!a){o1(e);return}return a},[e])),n=ts.useMemo(()=>Gi(e),[e]);return t??n}import{QRCodeSVG as n2}from"qrcode.react";import{WALLET_LABELS as r2}from"@nexus-cross/crossx-design-system";import{WALLET_LABELS as s1}from"@nexus-cross/crossx-design-system";import{WALLET_LABELS as cd}from"@nexus-cross/crossx-design-system";import{jsx as We,jsxs as Co}from"react/jsx-runtime";var a1='<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>',i1=`data:image/svg+xml,${encodeURIComponent(a1)}`;function ns(){return We("img",{src:i1,width:40,height:40,alt:"",style:{display:"block"}})}function Ru(){return Co("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[Co("g",{clipPath:"url(#clip0_1331_27065)",children:[We("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"}),We("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"}),We("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"}),We("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"}),We("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"}),We("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),We("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"})]}),We("defs",{children:We("clipPath",{id:"clip0_1331_27065",children:We("rect",{width:"40",height:"40",fill:"white"})})})]})}function Nu(){return Co("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[We("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),We("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),We("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),We("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),We("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 Su(){return Co("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[We("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),We("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"}),We("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),We("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 Tu(){return Co("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Co("g",{clipPath:"url(#clip0_1185_7785)",children:[We("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"}),We("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"})]}),We("defs",{children:We("clipPath",{id:"clip0_1185_7785",children:We("rect",{width:"28",height:"28",fill:"white"})})})]})}function Iu(){return Co("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[We("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"}),We("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"}),We("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"}),We("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 Eu(){return We("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:We("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 Au(){return We("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:We("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Ta={cross_embedded:{id:"cross_embedded",name:cd.social,description:"Sign in with Google or Apple",icon:ns},cross_wallet:{id:"cross_wallet",name:cd.app,description:"App approval is required",icon:ns,featured:!0},cross_extension:{id:"cross_extension",name:cd.extension,description:"Browser extension approval is required",icon:ns,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:Ru,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:Nu},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Su,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Tu,badge:"For SHOP"}};function pd(e){return Ta[e]}var ud={google:{id:"google",name:"Google",icon:Iu},apple:{id:"apple",name:"Apple",icon:Eu}};function Mu(e){return ud[e]}var Lu="dappui.wcm.last-selected",l1=new Set(["google","apple"]);function Du(e){try{window.localStorage.setItem(Lu,e)}catch{}}function Pu(){let e=null;try{e=window.localStorage.getItem(Lu)}catch{return}if(e)return l1.has(e)?s1.default:Ta[e]?.name}function Lt(e,t,n,r){if(!r||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let o;try{o=r(t,n)}catch(d){console.error("[dapp-ui] onOutlink threw:",d);return}let a=d=>{typeof window>"u"||window.open(d,"_blank","noopener,noreferrer")};if((d=>!!d&&(typeof d=="object"||typeof d=="function")&&typeof d.then=="function")(o)){let d=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,p=g=>{if(g===null){d?.close();return}let u=g??t;if(d)try{d.location.href=u}catch{d.close(),a(u)}else a(u)};o.then(p,g=>{console.error("[dapp-ui] onOutlink rejected:",g),d?.close()});return}let s=o;if(s===null)return;a(s??t)}import*as So from"react";import{Drawer as nx}from"vaul";import{createContext as u1,useContext as f1,useMemo as m1}from"react";import _n from"bignumber.js";var d1=/^(\d{4}-\d{2}-\d{2})/;function Ou(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:o,cumulative:a}of e.map(i=>({key:d1.exec(i.reference_date)?.[1],cumulative:i.cumulative_earned})).filter(i=>!!i.key&&i.cumulative!=null).sort((i,s)=>i.key<s.key?-1:i.key>s.key?1:0))t.set(o,a),n=o;if(n===void 0)return;let r=new Date().toISOString().slice(0,10);return t.get(r)??t.get(n)}function Bu(e){return e.poolType==="Unknown"}function rs(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function os(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Ia(e,t){let n=e.length+t.length;if(n>32)return"xs";if(n>24)return"sm"}function fd(e){return e?.toUpperCase()==="WONE"?"ONE":e}var c1=["Request Arguments:","Details:","Docs:","Version:","Contract Call:"];function Ea(e,t){console.error("[wallet-portfolio] withdraw failed:",e);let r=e instanceof Error?e.message:"";for(let a of c1){let i=r.indexOf(a);i>=0&&(r=r.slice(0,i))}return r.split(`
8
8
  `).map(a=>a.trim()).find(a=>a.length>0)||t}var p1="0xe00e8bf3";function zu(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 r=n.toString(16).padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${p1}${r}${o}`}function Xo(e){return!e||e<=0n?"0":new _n(e.toString()).shiftedBy(-9).toFormat(2,_n.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function as(e){return!e||e<=0n?"0":new _n(e.toString()).toFormat(0,_n.ROUND_DOWN)}function is(e){if(!e||e<=0n)return"0";let t=new _n(e.toString()).shiftedBy(-18),n=t.isLessThan(1e-4)?7:4;return t.toFormat(n,_n.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Rr(e,t){let n=new _n(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,_n.ROUND_DOWN):n.toFormat(4,_n.ROUND_DOWN)}function md(e){return Rr(e,0)}var Aa={rate:1,symbol:"$"};function Ro(e,t=Aa){let n=Number.isFinite(t.rate)&&t.rate>0?t.rate:1;return`${t.symbol||"$"}${e.times(n).toFormat(2,_n.ROUND_DOWN)}`}function Zr(e,t,n,r=Aa){let o=new _n(n||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let a=new _n(e||"0").shiftedBy(-t).times(o);return a.isFinite()?Ro(a,r):null}var Ma=u1(null);function Dt(){let e=f1(Ma);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}function Vn(){let{conversionRatio:e,currencySymbol:t}=Dt();return m1(()=>({rate:typeof e=="number"&&e>0?e:Aa.rate,symbol:t||Aa.symbol}),[e,t])}import{Drawer as g1}from"vaul";import{jsx as Fu}from"react/jsx-runtime";function Uu({asChild:e,children:t}){let{walletAddress:n}=Dt(),r=t!=null,o=e??!0,a=r?t:Fu("button",{type:"button",children:Xt(n)});return Fu(g1.Trigger,{asChild:o,children:a})}import{Drawer as bs}from"vaul";import*as Ot from"react";import{useQueryClient as ex}from"@tanstack/react-query";import{createContext as h1,useContext as b1}from"react";var gd=h1(null);function ju(){return b1(gd)}import{jsx as yn,jsxs as cs}from"react/jsx-runtime";function Wu({size:e=22,className:t}){return yn("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:yn("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Gu({size:e=22,className:t}){return cs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[yn("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),yn("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 Hu({size:e=12,className:t}){return yn("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:yn("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function ss({size:e=16,className:t}){return cs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[yn("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"}),yn("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 ls({size:e=16,className:t}){return yn("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:yn("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function ds({size:e=48,className:t}){return cs("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[yn("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),yn("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 Bn({size:e=12,className:t}){return cs("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:[yn("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"}),yn("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),yn("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import{useQuery as w1}from"@tanstack/react-query";import{useMemo as _u}from"react";var y1="wp:reward-pools";function Jo(e,t=!0){let{data:n,...r}=w1({queryKey:[y1,e],queryFn:async({signal:i})=>{let s=await Se("gameReward",e),l=await fetch(`${s}/v1/pools`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch pools: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Pools API error: ${d.code}`);return d},enabled:t,staleTime:0}),o=_u(()=>n?.data.pools.filter(i=>i.pool_type==="CrossPool")??[],[n]),a=_u(()=>n?.data.pools.filter(i=>i.pool_type==="GamePool")??[],[n]);return{crossPools:o,gamePools:a,allPools:n?.data.pools??[],...r}}import{useQuery as x1}from"@tanstack/react-query";import{useMemo as v1}from"react";var k1="wp:user-deposits";function ps(e,t,n=!0){let r=n&&!!t,{data:o,...a}=x1({queryKey:[k1,e,t],queryFn:async({signal:s})=>{let l=await Se("gameReward",e),d=await fetch(`${l}/v1/users/${t}/deposits`,{cache:"no-store",signal:s});if(!d.ok)throw new Error(`Deposits fetch failed: ${d.status}`);let p=await d.json();if(p.code!==200)throw new Error(`Deposits API error: ${p.code}`);return p},enabled:r,staleTime:0});return{depositMap:v1(()=>{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??[],...a}}import{useQuery as C1}from"@tanstack/react-query";import{useMemo as R1}from"react";var Vu={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Qu={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var qu={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var hd={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},Yu={dev:`${hd.dev}/portfolio`,stage:`${hd.stage}/portfolio`,production:`${hd.production}/portfolio`};var Ku={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Qn={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"},us={dev:"https://stg-swap-api.crossdefi.io",stage:"https://stg-swap-api.crossdefi.io",production:"https://swap-api.crossdefi.io"},Zu={dev:"https://stg.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://www.crossdefi.io"},Xu={dev:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",stage:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",production:"0xEFd871aF7D695A0c1709e46b565761F4cd1Ef5ba"},Ju={dev:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",stage:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",production:"0x731a104a4461ae45bfef520468b43c262d35e682"};var N1="wp:token-info",S1="0x0000000000000000000000000000000000000001";function Nr(e,t=!0){let n=Rt[e].cross,{data:r,...o}=C1({queryKey:[N1,e],queryFn:async({signal:p})=>{let g=await Se("walletServer",e),u=await fetch(`${g}/v1/public/token/info`,{cache:"no-store",signal:p});if(!u.ok)throw new Error(`Failed to fetch token info: ${u.status}`);let m=await u.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:300*1e3}),{byChainAddr:a,byChainSym:i}=R1(()=>{let p=new Map,g=new Map;if(!r?.data)return{byChainAddr:p,byChainSym:g};for(let u of r.data){let m=u.address.toLowerCase();p.set(`${u.chain_id}:${m}`,u),p.set(m,u);let y=u.symbol.replace(/^t/,"").toUpperCase(),w=`${u.chain_id}:${y}`;g.has(w)||g.set(w,u),g.has(y)||g.set(y,u)}return{byChainAddr:p,byChainSym:g}},[r]);return{getTokenImage:(p,g,u)=>{let m=p.toLowerCase(),y=!!u?.chainOnly,w=a.get(`${n}:${m}`);if(w?.image)return w.image;if(!y){let f=a.get(m);if(f?.image)return f.image}if(g){let f=g.replace(/^t/,"").toUpperCase(),c=i.get(`${n}:${f}`);if(c?.image)return c.image;if(!y){let h=i.get(f);if(h?.image)return h.image}}return""},getTokenSymbol:(p,g,u)=>{let m=p.toLowerCase();return(a.get(`${n}:${m}`)??(u?.chainOnly?void 0:a.get(m)))?.symbol||g},getNativeToken:()=>a.get(`${n}:${S1}`),...o}}import*as wd from"react";import{jsx as bd,jsxs as $u}from"react/jsx-runtime";function qn({sectionKey:e,title:t,icon:n,iconFit:r="cover",isEmpty:o,loading:a=!1,children:i}){let s=ju();return wd.useEffect(()=>{s?.report(e,{loading:a,empty:o})},[s,e,a,o]),wd.useEffect(()=>()=>s?.unregister(e),[s,e]),o?null:$u("div",{className:"wp-svc-card",children:[$u("div",{className:"wp-svc-card-head",children:[bd("img",{className:"wp-svc-card-icon",src:n,alt:"",style:{objectFit:r}}),bd("span",{className:"wp-svc-card-title",children:t})]}),bd("div",{className:"wp-svc-items",children:i})]})}import yd from"bignumber.js";import{jsx as dn,jsxs as cn}from"react/jsx-runtime";var T1="ONErewards";function I1(e){return new yd(e||"0").isGreaterThan(0)}function ef(){let{env:e,walletAddress:t,onOutlink:n}=Dt(),r=Vn(),o=!!t,{allPools:a,isLoading:i}=Jo(e,o),{depositMap:s,isLoading:l}=ps(e,t,o),{getTokenImage:d}=Nr(e,o),p=(m,y)=>`${Vu[e]}/gametoken/tokens/${m.deposit_token.address}?mode=rewards${y==="withdraw"?"&trade=withdraw":""}`,g=`${Qn[e]}/reward.png`,u=a.filter(m=>{let y=s.get(m.pool_address.toLowerCase()),w=y?.deposited_amount??"0",f=y?.claimable_reward??"0";return!(new yd(w).isZero()&&new yd(f).isZero())});return dn(qn,{sectionKey:"rewards",title:T1,icon:g,isEmpty:u.length===0,loading:i||l,children:u.map(m=>{let y=s.get(m.pool_address.toLowerCase()),w=y?.deposited_amount??"0",f=y?.claimable_reward??"0",c=p(m,"withdraw"),h=p(m,"claim"),b=d(m.deposit_token.address,m.deposit_token.symbol),x=m.reward_tokens[0],k=x?d(x.address,x.symbol):"",R=m.reward_tokens.map(L=>L.symbol),S=R.length>0?`${m.deposit_token.symbol}-${R.join("/")}`:m.deposit_token.symbol,C=x?Rr(f,x.decimals):"0",N=x?.symbol??"Reward",E=Zr(w,m.deposit_token.decimals,m.deposit_token.price,r),A=x?Zr(f,x.decimals,x.price,r):null,B=!!y&&I1(f);return cn("article",{className:"wp-item","data-side":"reward",children:[cn("div",{className:"wp-item-body",children:[cn("div",{className:"wp-item-line",children:[cn("span",{className:"wp-item-label",children:["Pool",dn("span",{className:"wp-item-label-sub",children:" (Deposit - Earn)"})]}),cn("div",{className:"wp-svc-token",children:[cn("span",{className:"wp-token-stack","aria-hidden":!0,children:[b&&dn("img",{className:"wp-svc-token-icon",src:b,alt:""}),k&&dn("img",{className:"wp-svc-token-icon",src:k,alt:""})]}),dn("span",{children:S})]})]}),cn("div",{className:"wp-item-line",children:[dn("span",{className:"wp-item-label",children:"Deposited"}),cn("div",{className:"wp-svc-token wp-svc-token--amount",children:[b&&dn("img",{className:"wp-svc-token-icon",src:b,alt:""}),cn("div",{className:"wp-svc-amount",children:[dn("span",{className:"wp-svc-amount-main",children:Rr(w,m.deposit_token.decimals)}),E&&dn("span",{className:"wp-item-usd",children:E})]})]})]}),cn("div",{className:"wp-item-line",children:[cn("span",{className:"wp-item-label",children:["Claimable (",N,")"]}),cn("div",{className:"wp-svc-token wp-svc-token--amount",children:[k&&dn("img",{className:"wp-svc-token-icon",src:k,alt:""}),cn("div",{className:"wp-svc-amount",children:[dn("span",{className:"wp-svc-amount-main",children:C}),A&&dn("span",{className:"wp-item-usd",children:A})]})]})]})]}),cn("div",{className:"wp-item-tags",children:[cn("a",{className:"wp-tag wp-tag--muted",href:c,target:"_blank",rel:"noopener noreferrer","data-track":"rewards_withdraw_open",onClick:L=>Lt(L,c,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:y}},n),children:[dn("span",{className:"wp-tag-label",children:"Withdraw"}),dn(Bn,{size:12,className:"wp-tag-icon"})]}),cn("a",{className:"wp-tag wp-tag--mint","data-disabled":!B||void 0,"aria-disabled":!B||void 0,href:B?h:void 0,target:B?"_blank":void 0,rel:B?"noopener noreferrer":void 0,onClick:L=>{if(!B){L.preventDefault();return}Lt(L,h,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:y}},n)},children:[dn("span",{className:"wp-tag-label",children:"Claim"}),dn(Bn,{size:12,className:"wp-tag-icon"})]})]})]},m.pool_address)})})}import*as cf from"react";import{useQuery as B1}from"@tanstack/react-query";import{useMemo as fs}from"react";var E1="0x70a08231",A1="0x18160ddd",M1="0x313ce567",L1=8e3;async function D1(e,t,n,r){let o=new AbortController,a=setTimeout(()=>o.abort(),L1);r&&r.addEventListener("abort",()=>o.abort(),{once:!0});let 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(a));if(!i.ok)throw new Error(`RPC ${t} HTTP ${i.status}`);let s=await i.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 P1(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function La(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function Br(e,t,n,r,o){try{return await D1(e,"eth_call",[o?{from:o,to:t,data:n}:{to:t,data:n},"latest"],r)}catch{return}}async function O1(e,t,n,r){let[o,a,i]=await Promise.all([Br(e,n,E1+P1(t),r),Br(e,n,A1,r),Br(e,n,M1,r)]),s=La(o);if(s===void 0)return null;let l=La(i);return{balance:s,totalSupply:La(a),decimals:l!==void 0?Number(l):void 0}}async function Da(e,t){let n=Rt[e].cross,r=await Se("walletServer",e),o=await fetch(`${r}/v1/public/chain/info/${n}`,{cache:"no-store",signal:t});if(!o.ok)return;let a=await o.json();return("data"in a&&a.data!==void 0?Array.isArray(a.data)?a.data[0]:a.data:a)?.rpc||void 0}async function tf(e,t,n,r){if(!t||n.length===0)return{};let o;try{o=await Da(e,r)}catch{o=void 0}if(!o)return{};let a=await Promise.all(n.map(async s=>[s.toLowerCase(),await O1(o,t,s,r)])),i={};for(let[s,l]of a)l&&(i[s]=l);return i}var z1="wp:withdraw-token-meta",F1="0xc89039c5",U1="0x95d89b41",j1="0x313ce567";function W1(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 r=t.slice(128,128+n*2),o="";for(let a=0;a<r.length;a+=2)o+=String.fromCharCode(parseInt(r.slice(a,a+2),16));return o||void 0}catch{return}}function G1(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 H1(e,t,n){if(t.length===0)return{};let r;try{r=await Da(e,n)}catch{r=void 0}if(!r)return{};let o=await Promise.all(t.map(async i=>{let s=G1(await Br(r,i,F1,n));if(!s)return[i.toLowerCase(),null];let[l,d]=await Promise.all([Br(r,s,U1,n),Br(r,s,j1,n)]),p=W1(l),g=La(d);return p?[i.toLowerCase(),{tokenAddress:s,symbol:p,decimals:g!==void 0?Number(g):18}]:[i.toLowerCase(),null]})),a={};for(let[i,s]of o)s&&(a[i]=s);return a}function nf(e,t,n=!0){let o=n&&!!t,{allPools:a,isLoading:i}=Jo(e,o),{deposits:s,isLoading:l}=ps(e,t,o),d=fs(()=>{let f=new Map;for(let c of a)f.set(c.pool_address.toLowerCase(),c);return f},[a]),p=fs(()=>s.filter(f=>{try{return BigInt(f.deposited_amount||"0")>0n}catch{return!1}}),[s]),g=fs(()=>p.map(f=>f.pool_address.toLowerCase()).filter(f=>!d.has(f)).sort(),[p,d]),{data:u,isLoading:m}=B1({queryKey:[z1,e,g],queryFn:({signal:f})=>H1(e,g,f),enabled:o&&g.length>0,staleTime:1440*60*1e3});return{positions:fs(()=>{let f=[];for(let c of p){let h=c.pool_address.toLowerCase(),b=d.get(h);if(b){f.push({poolId:c.pool_id,poolAddress:c.pool_address,poolType:b.pool_type,tokenSymbol:b.deposit_token.symbol,tokenAddress:b.deposit_token.address,decimals:b.deposit_token.decimals,price:b.deposit_token.price,depositedRaw:c.deposited_amount});continue}let x=u?.[h];x&&f.push({poolId:c.pool_id,poolAddress:c.pool_address,poolType:"Unknown",tokenSymbol:x.symbol,tokenAddress:x.tokenAddress,decimals:x.decimals,depositedRaw:c.deposited_amount})}return f},[p,d,u]),isLoading:i||l||m}}import*as on from"react";import{Fragment as rf,jsx as Oe,jsxs as jt}from"react/jsx-runtime";var _1=400;function V1(e,t,n){if(t==="loading")return"Estimating...";if(!e||t==="error"||t==="unavailable")return"Wallet estimate";let r=e.maxFeePerGas??e.gasPrice;return!r||r<=0n||e.gasLimit<=0n?"Wallet estimate":`${is(e.gasLimit*r)} ${n??""}`.trim()}function xd(e,t,n){return n==="loading"?"Estimating...":n==="error"||n==="unavailable"?"-":`${e} ${t}`.trim()}function Q1({position:e,size:t}){return e.icon?Oe("img",{src:e.icon,alt:"",width:t,height:t}):Oe("span",{children:e.tokenSymbol.slice(0,1)})}function of({open:e,status:t,positions:n,initialPoolAddress:r,walletAddress:o,txHash:a,error:i,copied:s=!1,estimateWithdraw:l,onClose:d,onConfirm:p,onCopyHash:g,trackFunnel:u,nativeSymbol:m}){let[y,w]=on.useState(null),[f,c]=on.useState("idle"),h=on.useRef(0),b=on.useRef(void 0),x=on.useRef(null);on.useEffect(()=>()=>clearTimeout(b.current),[]);let k=on.useMemo(()=>{let U=r?.toLowerCase();return n.find(M=>M.poolAddress.toLowerCase()===U)??n[0]??null},[n,r]),R=on.useMemo(()=>{try{return BigInt(k?.depositedRaw??"0")}catch{return 0n}},[k?.depositedRaw]),S=k?.decimals??18;on.useEffect(()=>{!e||!k||u?.("position_selected")},[e,k,u]);let C=on.useCallback(()=>{w(null),c(l?"idle":"unavailable"),h.current+=1,x.current=null},[]);if(on.useEffect(()=>{e&&C()},[e,C]),on.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(b.current);return}if(!l||!k){clearTimeout(b.current),c("unavailable");return}if(R<=0n){clearTimeout(b.current),h.current+=1,x.current=null,w(null),c("idle");return}let U=`${k.poolAddress.toLowerCase()}:${R.toString()}`;if(x.current===U)return;x.current=U,clearTimeout(b.current);let M=h.current+1;h.current=M,c("loading"),b.current=setTimeout(()=>{l(k,R).then(F=>{h.current===M&&(w(F??null),c(F?"ready":"unavailable"))}).catch(()=>{h.current===M&&(w(null),c("error"))})},_1)},[e,t,R,l,k]),!e||!k)return null;let N=t==="submitting",E=Xo(y?.maxPriorityFeePerGas),A=Xo(y?.maxFeePerGas??y?.gasPrice),B=as(y?.gasLimit),L=Rr(k.depositedRaw,S);return Oe("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:U=>{U.target===U.currentTarget&&!N&&d()},children:jt("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:[Oe("div",{className:"wp-claim-grabber","aria-hidden":!0,children:Oe("span",{})}),jt("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&a?jt(rf,{children:[Oe("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:Oe(ds,{})}),jt("div",{className:"wp-claim-copy",children:[Oe("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),Oe("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),Oe("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:jt("div",{className:"wp-claim-list-item",children:[Oe("span",{children:"Tx Hash"}),jt("button",{type:"button",className:"wp-claim-hash",onClick:g,"aria-label":"Copy transaction hash","data-track":"withdraw_hash_copy",children:[Oe("strong",{children:os(a)}),s?Oe(ls,{}):Oe(ss,{})]})]})})]}):jt(rf,{children:[t==="error"&&jt("div",{className:"wp-claim-heading",children:[Oe("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),Oe("p",{className:"wp-claim-error-message",children:i||"The withdraw request could not be completed."})]}),jt("div",{className:"wp-claim-reward-card","data-fit":Ia(k.tokenSymbol,L),"aria-label":"Deposited balance",children:[Oe("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:Oe(Q1,{position:k,size:28})}),Oe("strong",{className:"wp-claim-reward-symbol",children:k.tokenSymbol}),Oe("strong",{className:"wp-claim-reward-amount",children:L})]}),jt("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[jt("div",{className:"wp-claim-account-row",children:[jt("div",{className:"wp-claim-account",children:[Oe("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),jt("strong",{children:[k.tokenSymbol," Pool"]})]}),Oe("span",{children:rs(o)})]}),Oe("span",{className:"wp-claim-divider","aria-hidden":!0}),jt("div",{className:"wp-claim-detail-list",children:[jt("div",{className:"wp-claim-detail-row",children:[Oe("span",{children:"Est. Tx Fee"}),Oe("strong",{children:V1(y,f,m)})]}),jt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Oe("span",{children:"Priority Fee Per Gas"}),Oe("strong",{children:xd(E,"Gwei",f)})]}),jt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Oe("span",{children:"Max Fee Per Gas"}),Oe("strong",{children:xd(A,"Gwei",f)})]}),jt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Oe("span",{children:"Gas Limit"}),Oe("strong",{children:xd(B,"",f)})]})]})]})]}),jt("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&Oe("button",{type:"button",className:"wp-claim-secondary","data-track":"withdraw_cancel",onClick:d,children:t==="error"?"Close":"Cancel"}),jt("button",{type:"button",className:"wp-claim-primary","data-track":"withdraw_confirm",onClick:()=>{if(t==="success"){d();return}k&&R>0n&&p(k,R,y)},disabled:N||(t==="confirm"||t==="error")&&R<=0n,children:[t==="success"&&"Done",t==="submitting"&&Oe("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),Oe("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:Oe("span",{})})]})})}import*as Pt from"react";import{useQueryClient as K1}from"@tanstack/react-query";import{useQuery as q1}from"@tanstack/react-query";var Y1="wp:reward-factory-info";function af(e,t=!0){let{data:n,...r}=q1({queryKey:[Y1,e],queryFn:async({signal:o})=>{let a=await Se("gameReward",e),i=await fetch(`${a}/v1/factory/info`,{cache:"no-store",signal:o});if(!i.ok)throw new Error(`Factory info fetch failed: ${i.status}`);let s=await i.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??"",...r}}var sf="wp:";function Xr(e){return e.invalidateQueries({predicate:t=>typeof t.queryKey[0]=="string"&&t.queryKey[0].startsWith("wp:")})}function lf(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function df(e){let{env:t,walletAddress:n,sendTransaction:r,estimateGas:o}=Dt(),a=!!n,i=!!r,s=K1(),{routerAddress:l}=af(t,a&&i),d=lf(l),[p,g]=Pt.useState(!1),[u,m]=Pt.useState(void 0),[y,w]=Pt.useState("confirm"),[f,c]=Pt.useState(),[h,b]=Pt.useState(""),[x,k]=Pt.useState(!1),R=Pt.useRef(void 0);Pt.useEffect(()=>()=>clearTimeout(R.current),[]);let S=Pt.useRef(new Set),C=Pt.useCallback((F,ne)=>{S.current.has(F)||(S.current.add(F),Ye("withdraw",F,{...ne,tags:{section:e,...ne?.tags}}))},[e]),N=Pt.useCallback((F,ne)=>d?{to:d,value:0n,data:zu(F,ne),chainId:Rt[t].cross}:null,[t,d]),E=Pt.useCallback(()=>{Xr(s)},[s]),A=Pt.useCallback(F=>{m(F),g(!0),w("confirm"),c(void 0),b(""),k(!1),S.current=new Set,C("opened")},[C]),B=Pt.useCallback(()=>{y!=="submitting"&&(g(!1),m(void 0),w("confirm"),c(void 0),b(""),k(!1),y==="success"&&E())},[y,E]),L=Pt.useCallback(async(F,ne)=>{if(!o)return null;let ee=N(F.poolId,ne),X=lf(n);return!ee||!X?null:o({...ee,from:X})},[N,o,n]),U=Pt.useCallback(async()=>{if(!(!f||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(f),k(!0),clearTimeout(R.current),R.current=setTimeout(()=>k(!1),1400)}catch{k(!1)}},[f]),M=Pt.useCallback(async(F,ne,ee)=>{if(!r){w("error"),b("Withdraw is not available for this wallet.");return}if(!d){w("error"),b("Withdraw contract address is not available.");return}try{w("submitting"),b("");let X=N(F.poolId,ne);if(!X){w("error"),b("Withdraw contract address is not available.");return}C("submitted");let W=await r({...X,gas:ee?.gasLimit&&ee.gasLimit>0n?ee.gasLimit:void 0,maxFeePerGas:ee?.maxFeePerGas&&ee.maxFeePerGas>0n?ee.maxFeePerGas:void 0,maxPriorityFeePerGas:ee?.maxPriorityFeePerGas&&ee.maxPriorityFeePerGas>0n?ee.maxPriorityFeePerGas:void 0});c(W),w("success"),C("confirmed"),E()}catch(X){w("error"),b(Ea(X,"Failed to request withdraw.")),C("confirmed",{status:"failure",reason:Dn(X)})}},[N,E,d,r,C]);return{canWithdrawInline:i,isOpen:p,initialPoolAddress:u,status:y,txHash:f,error:h,copied:x,hasEstimator:!!o,openWithdraw:A,closeWithdraw:B,estimateWithdraw:L,confirmWithdraw:M,copyHash:U,trackFunnelOnce:C}}import{Fragment as X1,jsx as Nn,jsxs as zr}from"react/jsx-runtime";var Z1="ONEpoints";function pf(){let{env:e,walletAddress:t,onOutlink:n}=Dt(),r=Vn(),o=!!t,{getTokenImage:a,getNativeToken:i}=Nr(e,o),s=df("points"),{positions:l,isLoading:d}=nf(e,t,o),p=cf.useMemo(()=>l.filter(Bu).map(m=>({...m,icon:a(m.tokenAddress,m.tokenSymbol)})),[l,a]),g=`${Qn[e]}/point.png`,u=Qu[e];return zr(X1,{children:[Nn(qn,{sectionKey:"points",title:Z1,icon:g,isEmpty:p.length===0,loading:d,children:p.map(m=>{let y=m.price?Zr(m.depositedRaw,m.decimals,m.price,r):null;return zr("article",{className:"wp-item","data-side":"reward",children:[zr("div",{className:"wp-item-body",children:[zr("div",{className:"wp-item-line",children:[Nn("span",{className:"wp-item-label",children:"Token"}),zr("div",{className:"wp-svc-token",children:[m.icon&&Nn("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),Nn("span",{children:m.tokenSymbol})]})]}),zr("div",{className:"wp-item-line",children:[Nn("span",{className:"wp-item-label",children:"Deposited"}),zr("div",{className:"wp-svc-token wp-svc-token--amount",children:[m.icon&&Nn("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),zr("div",{className:"wp-svc-amount",children:[Nn("span",{className:"wp-svc-amount-main",children:Rr(m.depositedRaw,m.decimals)}),y&&Nn("span",{className:"wp-item-usd",children:y})]})]})]})]}),Nn("div",{className:"wp-item-tags",children:s.canWithdrawInline?Nn("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"points_withdraw_open",onClick:()=>s.openWithdraw(m.poolAddress),children:Nn("span",{className:"wp-tag-label",children:"Withdraw"})}):zr("a",{className:"wp-tag wp-tag--muted",href:u,target:"_blank",rel:"noopener noreferrer","data-track":"points_withdraw_open",onClick:w=>Lt(w,u,{category:"portfolio",origin:"portfolio-points",payload:{position:m}},n),children:[Nn("span",{className:"wp-tag-label",children:"Withdraw"}),Nn(Bn,{size:12,className:"wp-tag-icon"})]})})]},m.poolAddress)})}),Nn(of,{open:s.isOpen,status:s.status,positions:p,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:i()?.symbol})]})}import*as vd from"react";import{useQuery as J1}from"@tanstack/react-query";var $1="wp:stake-info";function uf(e,t,n=!0){let r=n&&!!t,{data:o,...a}=J1({queryKey:[$1,e,t],queryFn:async({signal:s})=>{let l=await Se("posa",e),d=await fetch(`${l}/stake/${t}`,{cache:"no-store",signal:s});if(!d.ok)throw new Error(`Stake info fetch failed: ${d.status}`);let p=await d.json();if(p.code!==0&&p.code!==200)throw new Error(`Stake info API error: ${p.code}`);return p},enabled:r,staleTime:0});return{stakeInfo:o?.data,...a}}import{useQuery as ey}from"@tanstack/react-query";var ty="wp:stake-rewards",ny=31;function ff(e,t,n=!0){let r=n&&!!t,{data:o,...a}=ey({queryKey:[ty,e,t],queryFn:async({signal:i})=>{let s=await Se("posa",e),l=await fetch(`${s}/rewards/${t}?limit=${ny}`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Stake rewards fetch failed: ${l.status}`);let d=await l.json();if(d.code!==0&&d.code!==200)throw new Error(`Stake rewards API error: ${d.code}`);return d.data?.data??[]},enabled:r,staleTime:0});return{latestReward:o?.[0]??null,aprAccrued:Ou(o),...a}}import{useQuery as ry}from"@tanstack/react-query";var oy="wp:staking-onchain";function mf(e,t,n=!0){let r=n&&!!t&&!!e,{data:o,...a}=ry({queryKey:[oy,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:r,staleTime:0});return{onchain:o,...a}}import{useMemo as gf}from"react";import ay from"bignumber.js";function hf(e){return e?.trim().toUpperCase()==="ONE"}function bf(e){return new ay(e||"0").isGreaterThan(0)}function ms(e,t,n=!0){let{allPools:r}=Jo(e,n),o=gf(()=>{for(let d of r)for(let p of[d.deposit_token,...d.reward_tokens])if(hf(p?.symbol)&&bf(p.price))return p.price},[r]),a=n&&o===void 0,{tokens:i}=Yr(e,t,a),{statsMap:s}=Kr(e,a),l=Rt[e].cross;return gf(()=>{if(o)return o;let d=i.find(p=>p.chainId===l&&hf(p.symbol));if(d){let p=s.get(Cr(d.chainId,d.address));if(p&&bf(p.price))return p.price}return"0"},[o,i,s,l])}import $r from"bignumber.js";import{jsx as Yn,jsxs as Jr}from"react/jsx-runtime";function iy(e){if(!e)return"\u2014";let t=new $r(e);return t.isFinite()?`${t.toFormat(2,$r.ROUND_DOWN)}%`:"\u2014"}function wf(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:r}=Dt(),o=Vn(),a=!!t,{stakeInfo:i,isLoading:s}=uf(e,t,a),{latestReward:l,aprAccrued:d,isLoading:p}=ff(e,t,a),{onchain:g}=mf(t,r,a),u=ms(e,t,a),{getNativeToken:m}=Nr(e,a),y=m()?.symbol,w="ONEstaking",f=`${Qn[e]}/cross-staking.png`,c=Yu[e],h=i?.total_stake??"0",b=vd.useMemo(()=>g?new $r(g.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??i?.rewards_earned??"0",[g,l,i]),x=vd.useMemo(()=>g?new $r(g.stakedWei.toString()).shiftedBy(-18):new $r(h),[g,h]),k=d!==void 0?new $r(d):void 0,R=i?.days_since_first_stake,S=k!==void 0&&k.isFinite()&&x.isGreaterThan(0)&&R!==null&&R!==void 0?k.div(x).times(365).div(Math.max(1,R)).times(100):void 0,C=!(new $r(h).isZero()&&new $r(b).isZero()),N=Zr(h,0,u,o),E=Zr(b,0,u,o);return Yn(qn,{sectionKey:"staking",title:w,icon:f,iconFit:"contain",isEmpty:!C,loading:s||p,children:Jr("article",{className:"wp-item","data-side":"stake",children:[Jr("div",{className:"wp-item-body",children:[Jr("div",{className:"wp-item-line",children:[Yn("span",{className:"wp-item-label",children:"Staked"}),Jr("div",{className:"wp-svc-amount",children:[Yn("span",{className:"wp-svc-amount-main",children:`${md(h)} ${y??""}`.trim()}),N&&Yn("span",{className:"wp-item-usd",children:N})]})]}),Jr("div",{className:"wp-item-line",children:[Yn("span",{className:"wp-item-label",children:"Rewards Earned"}),Jr("div",{className:"wp-svc-amount",children:[Yn("span",{className:"wp-svc-amount-main",children:`${md(b)} ${y??""}`.trim()}),E&&Yn("span",{className:"wp-item-usd",children:E})]})]}),Jr("div",{className:"wp-item-line",children:[Yn("span",{className:"wp-item-label",children:"My APR"}),Yn("span",{children:iy(S?.toString(10))})]})]}),Yn("div",{className:"wp-item-tags",children:Jr("a",{className:"wp-tag wp-tag--mint",href:c,target:"_blank",rel:"noopener noreferrer","data-track":"stake_outlink",onClick:A=>Lt(A,c,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:i}},n),children:[Yn("span",{className:"wp-tag-label",children:"Manage"}),Yn(Bn,{size:12,className:"wp-tag-icon"})]})})]})})}import*as kd from"react";import{useQuery as sy}from"@tanstack/react-query";var ly="wp:game-swap-pools";function yf(e,t,n=!0){let r=n&&!!t,{data:o,...a}=sy({queryKey:[ly,e,t],queryFn:async({signal:i})=>{let s=await Se("gameSwap",e),l=await fetch(`${s}/addresses/${t}/portfolio`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Game-swap portfolio fetch failed: ${l.status}`);return(await l.json()).pools??[]},enabled:r,staleTime:0});return{pools:o??[],...a}}import{useQuery as dy}from"@tanstack/react-query";var cy="wp:game-swap-lp-balances";function xf(e,t,n,r){let o=[...n].map(l=>l.toLowerCase()).sort(),a=!!t&&o.length>0,{data:i,...s}=dy({queryKey:[cy,e,t,o,!!r],queryFn:async({signal:l})=>{let d=r?await r(o):await tf(e,t,o,l),p={};for(let[g,u]of Object.entries(d))p[g.toLowerCase()]=u;return p},enabled:a,staleTime:0});return{balances:i??{},...s}}import Fr from"bignumber.js";import{jsx as Kn,jsxs as cr}from"react/jsx-runtime";var py="Gametoken LP",kf=18,uy=new Fr("0.0001");function vf(e){return e?.trim().toUpperCase()==="ONE"}function fy(e){return e&&e>0?e:kf}function my(e){let t=vf(e.token_a?.symbol)&&!vf(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,r=fy(t?e.token_a?.decimals:e.token_b?.decimals),o=new Fr(n||"0").shiftedBy(-r);return!o.isFinite()||o.isLessThanOrEqualTo(0)?new Fr(0):o.times(2)}function gy(e,t,n,r){let o=e.token_a?.symbol?.trim()||"TOKEN",a=e.token_b?.symbol?.trim()||r||"?",i=t?.decimals??kf,s,l;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let d=new Fr(t.balance.toString()),p=new Fr(t.totalSupply.toString()),g=d.div(p);s=g.times(100);let u=g.times(my(e));if(u.isGreaterThan(0)){let m=new Fr(e.quote_usd??e.cross_usd??"0");l=m.isGreaterThan(0)?Ro(u.times(m),n):`${u.toFormat(4,Fr.ROUND_DOWN)} ${r??""}`.trim()}}return{pool:e,tokenASymbol:o,tokenBSymbol:a,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:i,sharePercent:s,valueText:l}}function Cf(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:r}=Dt(),o=Vn(),a=!!t,{pools:i,isLoading:s}=yf(e,t,a),l=kd.useMemo(()=>i.map(c=>c.pair_address).filter(Boolean),[i]),{balances:d,isLoading:p}=xf(e,t,l,r),{getNativeToken:g}=Nr(e,a),u=g()?.symbol,m=`${Qn[e]}/game-token.png`,y=Object.keys(d).length>0,w=kd.useMemo(()=>{let c=i.map(h=>gy(h,d[h.pair_address?.toLowerCase()],o,u));return y?c.filter(h=>h.lpAmountRaw?new Fr(h.lpAmountRaw).shiftedBy(-h.lpDecimals).isGreaterThanOrEqualTo(uy):!1):c},[i,d,y,o,u]),f=c=>{let h=c.token_a?.address??c.pair_address;return`${Ku[e]}/gametoken/tokens/${h}?trade=deposit`};return Kn(qn,{sectionKey:"gameSwap",title:py,icon:m,iconFit:"contain",isEmpty:w.length===0,loading:s||p,children:w.map(c=>{let{pool:h}=c,b=f(h),x=`${c.tokenASymbol} / ${c.tokenBSymbol}`,k=h.token_a?.logo_url,R=h.token_b?.logo_url;return cr("article",{className:"wp-item","data-side":"game-swap",children:[cr("div",{className:"wp-item-body",children:[cr("div",{className:"wp-item-line",children:[Kn("span",{className:"wp-item-label",children:"Pool"}),cr("div",{className:"wp-svc-token",children:[cr("span",{className:"wp-token-stack","aria-hidden":!0,children:[k&&Kn("img",{className:"wp-svc-token-icon",src:k,alt:""}),R&&Kn("img",{className:"wp-svc-token-icon",src:R,alt:""})]}),Kn("span",{children:x})]})]}),c.lpAmountRaw!==void 0&&cr("div",{className:"wp-item-line",children:[Kn("span",{className:"wp-item-label",children:"My LP"}),cr("span",{children:[Rr(c.lpAmountRaw,c.lpDecimals)," LP"]})]}),c.sharePercent!==void 0&&cr("div",{className:"wp-item-line",children:[Kn("span",{className:"wp-item-label",children:"Pool Share"}),cr("span",{children:[c.sharePercent.toFormat(2,Fr.ROUND_DOWN),"%"]})]}),c.valueText!==void 0&&cr("div",{className:"wp-item-line",children:[Kn("span",{className:"wp-item-label",children:"Value"}),Kn("span",{children:c.valueText})]})]}),Kn("div",{className:"wp-item-tags",children:cr("a",{className:"wp-tag wp-tag--mint",href:b,target:"_blank",rel:"noopener noreferrer","data-track":"gameswap_outlink","data-track-id":x,onClick:S=>Lt(S,b,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:h}},n),children:[Kn("span",{className:"wp-tag-label",children:"Manage"}),Kn(Bn,{size:12,className:"wp-tag-icon"})]})})]},h.pair_address)})})}import No from"bignumber.js";import{useMemo as ky}from"react";import{useQuery as hy}from"@tanstack/react-query";var by="wp:forge-pools";function Rf(e,t,n=!0){let r=n&&!!t,{data:o,...a}=hy({queryKey:[by,e,t],queryFn:async()=>{let s=await Se("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:r,staleTime:0}),i=o??[];return{pools:i,isEmpty:i.length===0,...a}}import{useQueries as wy}from"@tanstack/react-query";import{useMemo as yy}from"react";var xy="wp:forge-token-detail";async function vy(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Nf(e,t,n=!0){let r=wy({queries:t.map(i=>({queryKey:[xy,e,i],queryFn:async()=>vy(await Se("bondingCurve",e),i),enabled:n&&!!i,staleTime:3e4}))}),o=yy(()=>{let i=new Map;for(let s=0;s<r.length;s++){let l=r[s]?.data,d=t[s];l&&d&&i.set(d.toLowerCase(),l)}return i},[r,t]),a=r.some(i=>i.isLoading);return{detailMap:o,isLoading:a}}import{jsx as Sn,jsxs as eo}from"react/jsx-runtime";var Cy="ONEforge",Sf=18,Ry="https://contents.crosstoken.io/wallet/token/images/FT.png";function Ny(e){if(!e||e==="0")return"0";let t=new No(e).shiftedBy(-Sf);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,No.ROUND_DOWN):t.toFormat(4,No.ROUND_DOWN)}function Sy(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 Ty(e,t,n,r){let o=new No(n||"0");if(!o.isGreaterThan(0))return null;let a=new No(e.total_supply||"0"),i=new No(e.lp_balance||"0"),s=new No(t?.reserve_b||"0").shiftedBy(-Sf);if(!a.isGreaterThan(0)||!i.isGreaterThan(0)||!s.isGreaterThan(0))return null;let l=s.times(2),p=i.div(a).times(l).times(o);return p.isFinite()?Ro(p,r):null}function Tf(){let{env:e,walletAddress:t,onOutlink:n}=Dt(),r=Vn(),o=!!t,{pools:a,isEmpty:i,isLoading:s}=Rf(e,t,o),l=ky(()=>a.map(m=>m.token.address),[a]),{detailMap:d}=Nf(e,l,o&&l.length>0),p=ms(e,t,o),g=m=>`${qu[e]}/forge/token/${m.token.address}`,u=`${Qn[e]}/forge.png`;return Sn(qn,{sectionKey:"forge",title:Cy,icon:u,iconFit:"contain",isEmpty:i,loading:s,children:a.map(m=>{let y=d.get(m.token.address.toLowerCase()),w=y?.image_url||y?.image||m.token.image||Ry,f=y?.symbol||m.token.symbol,c=g(m),h=Ty(m,y,p,r);return eo("a",{className:"wp-item","data-side":"lp",href:c,target:"_blank",rel:"noopener noreferrer","data-track":"forge_outlink","data-track-id":f,onClick:b=>Lt(b,c,{category:"portfolio",origin:"portfolio-forge",payload:{pool:m,tokenDetail:y}},n),children:[eo("div",{className:"wp-item-body",children:[eo("div",{className:"wp-item-line",children:[Sn("span",{className:"wp-item-label",children:"Asset"}),eo("div",{className:"wp-svc-token",children:[Sn("img",{className:"wp-svc-token-icon",src:w,alt:""}),Sn("span",{children:f}),y?.name&&Sn("span",{className:"wp-token-subtle",children:y.name})]})]}),eo("div",{className:"wp-item-line",children:[Sn("span",{className:"wp-item-label",children:"LP Balance"}),Sn("div",{className:"wp-svc-token wp-svc-token--amount",children:eo("div",{className:"wp-svc-amount",children:[Sn("span",{className:"wp-svc-amount-main",children:Ny(m.lp_balance)}),h&&Sn("span",{className:"wp-item-usd",children:h})]})})]}),eo("div",{className:"wp-item-line",children:[Sn("span",{className:"wp-item-label",children:"Ownership"}),Sn("span",{className:"wp-line-value",children:Sy(m.pool_ownership)})]})]}),Sn("div",{className:"wp-item-tags",children:eo("span",{className:"wp-tag wp-tag--muted",children:[Sn("span",{className:"wp-tag-label",children:"Withdraw"}),Sn(Bn,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}import{useMemo as jf}from"react";import Xy from"bignumber.js";import{useQuery as Iy}from"@tanstack/react-query";var Ey="wp:crossd-positions";function Ay(e){let t=e??{};return(t.positions??t.data?.positions??[]).filter(r=>{if(!r?.token_id||!r.liquidity)return!1;try{return BigInt(r.liquidity)>0n}catch{return!1}})}function If(e,t,n=!0){let r=n&&!!t,{data:o,...a}=Iy({queryKey:[Ey,e,t],queryFn:async()=>{let s=await fetch(`${us[e]}/api/v1/positions?owner=${t}`,{cache:"no-store"});if(!s.ok)throw new Error(`crossd positions fetch failed: ${s.status}`);return Ay(await s.json())},enabled:r,staleTime:0}),i=o??[];return{positions:i,isEmpty:i.length===0,...a}}import{useQueries as My}from"@tanstack/react-query";import{useMemo as Ly}from"react";var Dy="wp:crossd-position-details";function Py(e){let t=e??{},n=t.data??t;return n?.token_id||n?.pool?n:null}function Ef(e,t,n=!0){let r=My({queries:t.map(a=>({queryKey:[Dy,e,a],queryFn:async()=>{let i=await fetch(`${us[e]}/api/v1/positions/${a}`,{cache:"no-store"});if(!i.ok)throw new Error(`crossd position detail failed: ${i.status}`);return Py(await i.json())},enabled:n&&!!a,staleTime:6e4}))});return{detailMap:Ly(()=>{let a=new Map;return r.forEach((i,s)=>{let l=i.data,d=t[s];l&&d&&a.set(d,l)}),a},[r,t])}}import*as Ur from"react";import{Fragment as Mf,jsx as Pe,jsxs as an}from"react/jsx-runtime";var Oy=300*1e3,Af="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function By(e,t,n){if(t)return"Estimating...";if(!e)return"Wallet estimate";let r=e.maxFeePerGas??e.gasPrice;return!r||r<=0n||e.gasLimit<=0n?"Wallet estimate":`${is(e.gasLimit*r)} ${n??""}`.trim()}function Cd(e,t,n){return n?"Estimating...":`${e} ${t}`.trim()}function Lf({open:e,status:t,target:n,token0Icon:r,token1Icon:o,token0Symbol:a,token1Symbol:i,nativeSymbol:s,txHash:l,error:d,copied:p=!1,hasEstimator:g,prepareWithdraw:u,confirmWithdraw:m,onClose:y,onCopyHash:w,trackFunnel:f}){let[c,h]=Ur.useState(null),[b,x]=Ur.useState(null),k=Ur.useRef(0);Ur.useEffect(()=>{if(!e||!n)return;let _=++k.current;h(null),x(null),f?.("dialog_opened"),u().then(ae=>{k.current===_&&(h(ae),x(ae?Date.now():null))})},[e,n]);let R=t==="submitting",S=t==="estimating"||t==="confirm"&&!c,C=Ur.useCallback(async()=>{let _=c,ae=!b||Date.now()-b>Oy;if(!_||ae){let be=++k.current;if(_=await u(),k.current!==be)return;h(_),x(_?Date.now():null)}_&&await m(_)},[c,b,u,m]);if(!e||!n)return null;let{position:N,detail:E}=n,A=E.pool?.token0,B=E.pool?.token1,L=a||A?.symbol||N.pool?.token0_symbol||"?",U=i||B?.symbol||N.pool?.token1_symbol||"?",M=A?.decimals??18,F=B?.decimals??18,ne=r||A?.logo_url||Af,ee=o||B?.logo_url||Af,X=`${L}/${U}`,W=c?Ko(c.expectedAmount0.toString(),M):null,Y=c?Ko(c.expectedAmount1.toString(),F):null,O=Xo(c?.estimate?.maxPriorityFeePerGas),G=Xo(c?.estimate?.maxFeePerGas??c?.estimate?.gasPrice),te=as(c?.estimate?.gasLimit);return Pe("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:_=>{_.target===_.currentTarget&&!R&&y()},children:an("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:[Pe("div",{className:"wp-claim-grabber","aria-hidden":!0,children:Pe("span",{})}),an("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&l?an(Mf,{children:[Pe("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:Pe(ds,{})}),an("div",{className:"wp-claim-copy",children:[Pe("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),an("p",{className:"wp-claim-desc",children:["Your ",X," position withdrawal has been submitted. Balances will update shortly after the transaction settles."]})]}),Pe("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:an("div",{className:"wp-claim-list-item",children:[Pe("span",{children:"Tx Hash"}),an("button",{type:"button",className:"wp-claim-hash",onClick:w,"aria-label":"Copy transaction hash","data-track":"crossd_withdraw_hash_copy",children:[Pe("strong",{children:os(l)}),p?Pe(ls,{}):Pe(ss,{})]})]})})]}):an(Mf,{children:[t==="error"&&an("div",{className:"wp-claim-heading",children:[Pe("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),Pe("p",{className:"wp-claim-error-message",children:d||"The withdraw request could not be completed."})]}),an("div",{className:"wp-claim-reward-card","data-fit":Ia(L,W??""),"aria-label":`Expected ${L}`,children:[Pe("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:Pe("img",{src:ne,alt:"",width:28,height:28})}),Pe("strong",{className:"wp-claim-reward-symbol",children:L}),Pe("strong",{className:"wp-claim-reward-amount",children:W??"Estimating..."})]}),an("div",{className:"wp-claim-reward-card","data-fit":Ia(U,Y??""),"aria-label":`Expected ${U}`,children:[Pe("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:Pe("img",{src:ee,alt:"",width:28,height:28})}),Pe("strong",{className:"wp-claim-reward-symbol",children:U}),Pe("strong",{className:"wp-claim-reward-amount",children:Y??"Estimating..."})]}),g&&Pe("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:an("div",{className:"wp-claim-detail-list",children:[an("div",{className:"wp-claim-detail-row",children:[Pe("span",{children:"Est. Tx Fee"}),Pe("strong",{children:By(c?.estimate,S,s)})]}),an("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Pe("span",{children:"Priority Fee Per Gas"}),Pe("strong",{children:Cd(O,"Gwei",S)})]}),an("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Pe("span",{children:"Max Fee Per Gas"}),Pe("strong",{children:Cd(G,"Gwei",S)})]}),an("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Pe("span",{children:"Gas Limit"}),Pe("strong",{children:Cd(te,"",S)})]})]})})]}),an("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&Pe("button",{type:"button",className:"wp-claim-secondary","data-track":"crossd_withdraw_cancel",onClick:y,children:t==="error"?"Close":"Cancel"}),Pe("button",{type:"button",className:"wp-claim-primary","data-track":"crossd_withdraw_confirm",onClick:()=>{if(t==="success"){y();return}R||S||(f?.("confirm_clicked"),C())},disabled:R||S,children:t==="success"?"Done":R?Pe("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}):S?Pe("span",{className:"wp-claim-button-spinner","aria-label":"Estimating"}):t==="error"?"Retry":"Withdraw"})]})]}),Pe("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:Pe("span",{})})]})})}import*as Nt from"react";import{useQueryClient as Yy}from"@tanstack/react-query";var zy="0x0c49ccbe",Fy="0xfc6f7865",Uy="0x49404b7c",jy="0xdf2ab5bb",Wy="0xac9650d8",Df=(1n<<128n)-1n,Of=600n,Gy=99n,Hy=100n;function Rd(e){return e*Gy/Hy}function Pf(e,t){return!!e&&!!t&&e.toLowerCase()===t.toLowerCase()}function Tn(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 gs(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 Nd(e){return zy+Tn(e.tokenId,"tokenId")+Tn(e.liquidity,"liquidity")+Tn(e.amount0Min,"amount0Min")+Tn(e.amount1Min,"amount1Min")+Tn(e.deadline,"deadline")}function _y(e){return Fy+Tn(e.tokenId,"tokenId")+gs(e.recipient,"recipient")+Tn(e.amount0Max,"amount0Max")+Tn(e.amount1Max,"amount1Max")}function Vy(e,t){return Uy+Tn(e,"amountMinimum")+gs(t,"recipient")}function Qy(e,t,n){return jy+gs(e,"token")+Tn(t,"amountMinimum")+gs(n,"recipient")}function qy(e){if(e.length===0)throw new Error("multicall requires at least one call");let t=e.map(o=>{let a=o.replace(/^0x/,"");if(a.length%2!==0||!/^[0-9a-fA-F]*$/.test(a))throw new Error("multicall element must be valid hex bytes");let i=a.length%64===0?a:a.padEnd(a.length+(64-a.length%64),"0");return Tn(BigInt(a.length/2),"callLength")+i.toLowerCase()}),n=BigInt(e.length)*32n,r=[];for(let o of t)r.push(Tn(n,"callOffset")),n+=BigInt(o.length/2);return Wy+Tn(0x20n,"arrayOffset")+Tn(BigInt(e.length),"arrayLength")+r.join("")+t.join("")}function Bf(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 zf(e){let t=Pf(e.token0,e.wcrossAddress),n=Pf(e.token1,e.wcrossAddress),r=t||n,o=[Nd({tokenId:e.tokenId,liquidity:e.liquidity,amount0Min:e.amount0Min,amount1Min:e.amount1Min,deadline:e.deadline}),_y({tokenId:e.tokenId,recipient:r?e.positionManagerAddress:e.owner,amount0Max:Df,amount1Max:Df})];return r&&(o.push(Vy(0n,e.owner)),o.push(Qy(t?e.token1:e.token0,0n,e.owner))),qy(o)}async function Ff(e,t,n){let r;try{r=await Da(e,n)}catch{r=void 0}if(!r)return null;let o=Nd({tokenId:t.tokenId,liquidity:t.liquidity,amount0Min:0n,amount1Min:0n,deadline:t.deadline}),a=await Br(r,t.positionManager,o,n,t.owner);return Bf(a)}var Ky=[1500,3e3,4500,6e3];function Zy(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Uf(){let{env:e,walletAddress:t,sendTransaction:n,estimateGas:r}=Dt(),o=!!n,a=Yy(),[i,s]=Nt.useState(!1),[l,d]=Nt.useState(null),[p,g]=Nt.useState("confirm"),[u,m]=Nt.useState(),[y,w]=Nt.useState(""),[f,c]=Nt.useState(!1),[h,b]=Nt.useState(new Set),x=Nt.useRef(void 0),k=Nt.useRef([]),R=Nt.useRef(0);Nt.useEffect(()=>()=>{clearTimeout(x.current),k.current.forEach(clearTimeout)},[]);let S=Nt.useRef(new Set),C=Nt.useCallback((M,F)=>{S.current.has(M)||(S.current.add(M),Ye("withdraw",M,{...F,tags:{section:"crossdPool",...F?.tags}}))},[]),N=Nt.useCallback(()=>{let M=()=>Xr(a);M(),k.current.forEach(clearTimeout),k.current=Ky.map(F=>setTimeout(M,F))},[a]),E=Nt.useCallback(M=>{R.current+=1,d(M),s(!0),g("confirm"),m(void 0),w(""),c(!1),S.current=new Set,C("opened")},[C]),A=Nt.useCallback(()=>{p!=="submitting"&&(R.current+=1,s(!1),d(null),g("confirm"),m(void 0),w(""),c(!1))},[p]),B=Nt.useCallback(async()=>{let M=R.current,F=Zy(t),ne=l?.position.token_id,ee=l?.position.liquidity,X=l?.detail.pool?.token0?.address,W=l?.detail.pool?.token1?.address;if(!F||!ne||!ee||!X||!W)return g("error"),w("Position data is incomplete. Please refresh and retry."),null;try{g("estimating"),w("");let Y=BigInt(ne),O=BigInt(ee),G=BigInt(Math.floor(Date.now()/1e3))+Of,te=Xu[e],_=await Ff(e,{owner:F,positionManager:te,tokenId:Y,liquidity:O,deadline:G});if(R.current!==M)return null;if(!_)return g("error"),w("Failed to estimate withdrawal amounts. Please retry."),null;let ae=zf({tokenId:Y,liquidity:O,amount0Min:Rd(_.amount0),amount1Min:Rd(_.amount1),deadline:G,owner:F,positionManagerAddress:te,token0:X,token1:W,wcrossAddress:Ju[e]}),be={to:te,value:0n,data:ae,chainId:Rt[e].cross},Me=null;if(r){try{Me=await r({...be,from:F})}catch{Me=null}if(R.current!==M)return null}return g("confirm"),{tx:be,estimate:Me,expectedAmount0:_.amount0,expectedAmount1:_.amount1}}catch(Y){return R.current!==M||(g("error"),w(Ea(Y,"Failed to prepare withdraw."))),null}},[e,r,l,t]),L=Nt.useCallback(async M=>{if(!n){g("error"),w("Withdraw is not available for this wallet.");return}try{g("submitting"),w(""),C("submitted");let F=await n({...M.tx,gas:M.estimate?.gasLimit&&M.estimate.gasLimit>0n?M.estimate.gasLimit:void 0,maxFeePerGas:M.estimate?.maxFeePerGas&&M.estimate.maxFeePerGas>0n?M.estimate.maxFeePerGas:void 0,maxPriorityFeePerGas:M.estimate?.maxPriorityFeePerGas&&M.estimate.maxPriorityFeePerGas>0n?M.estimate.maxPriorityFeePerGas:void 0});m(F),g("success");let ne=l?.position.token_id;ne&&b(ee=>{let X=new Set(ee);return X.add(ne),X}),C("confirmed"),N()}catch(F){g("error"),w(Ea(F,"Failed to request withdraw.")),C("confirmed",{status:"failure",reason:Dn(F)})}},[N,n,l,C]),U=Nt.useCallback(async()=>{if(!(!u||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(u),c(!0),clearTimeout(x.current),x.current=setTimeout(()=>c(!1),1400)}catch{c(!1)}},[u]);return{canWithdrawInline:o,isOpen:i,target:l,withdrawnTokenIds:h,status:p,txHash:u,error:y,copied:f,hasEstimator:!!r,openWithdraw:E,closeWithdraw:A,prepareWithdraw:B,confirmWithdraw:L,copyHash:U,trackFunnelOnce:C}}import{Fragment as $y,jsx as In,jsxs as to}from"react/jsx-runtime";var Jy="ONEusd Pool",Wf="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Gf(){let{env:e,walletAddress:t,onOutlink:n}=Dt(),r=Vn(),o=!!t,{positions:a,isLoading:i}=If(e,t,o),s=Uf(),l=jf(()=>a.filter(C=>!C.token_id||!s.withdrawnTokenIds.has(C.token_id)),[a,s.withdrawnTokenIds]),d=jf(()=>l.map(C=>C.token_id).filter(C=>!!C),[l]),{detailMap:p}=Ef(e,d,o&&d.length>0),g=`${Zu[e]}/pool`,{getTokenImage:u,getTokenSymbol:m,getNativeToken:y}=Nr(e,o),w=u("","ONEUSD",{chainOnly:!0})||`${Qn[e]}/crossd.png`,f={chainOnly:!0},c=(C,N)=>{let E=fd(m(C?.address??"",C?.symbol??N,f));return E==="ONE"?y()?.symbol??"?":E??"?"},h=(C,N)=>{let E=C?.symbol??N,A=fd(E);return A==="ONE"?y()?.image||Wf:u(C?.address??"",A,f)||C?.logo_url||Wf},b=s.target?.detail.pool,x=h(b?.token0,s.target?.position.pool?.token0_symbol),k=h(b?.token1,s.target?.position.pool?.token1_symbol),R=c(b?.token0,s.target?.position.pool?.token0_symbol),S=c(b?.token1,s.target?.position.pool?.token1_symbol);return to($y,{children:[In(qn,{sectionKey:"crossdPool",title:Jy,icon:w,iconFit:"contain",isEmpty:l.length===0,loading:i,children:l.map(C=>{let N=C.token_id?p.get(C.token_id):void 0,E=`${c(N?.pool?.token0,C.pool?.token0_symbol)}/${c(N?.pool?.token1,C.pool?.token1_symbol)}`,A=C.pool?.fee_tier_percentage,B=h(N?.pool?.token0,C.pool?.token0_symbol),L=h(N?.pool?.token1,C.pool?.token1_symbol),U=Ro(new Xy(C.position_value_usd??"0"),r),M=s.canWithdrawInline&&!!N?.pool?.token0?.address&&!!N?.pool?.token1?.address;return to("article",{className:"wp-item","data-side":"crossd",children:[to("div",{className:"wp-item-body",children:[to("div",{className:"wp-item-line",children:[In("span",{className:"wp-item-label",children:"Pool"}),to("div",{className:"wp-svc-token",children:[to("span",{className:"wp-token-stack","aria-hidden":!0,children:[In("img",{className:"wp-svc-token-icon",src:B,alt:""}),In("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),In("span",{children:E}),A&&In("span",{className:"wp-token-subtle",children:A})]})]}),to("div",{className:"wp-item-line",children:[In("span",{className:"wp-item-label",children:"Position Value"}),In("span",{className:"wp-line-value",children:U})]})]}),In("div",{className:"wp-item-tags",children:M?In("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"crossd_pool_withdraw_open","data-track-id":E,onClick:()=>{N&&s.openWithdraw({position:C,detail:N})},children:In("span",{className:"wp-tag-label",children:"Withdraw"})}):to("a",{className:"wp-tag wp-tag--muted",href:g,target:"_blank",rel:"noopener noreferrer","data-track":"crossd_pool_outlink","data-track-id":E,onClick:F=>Lt(F,g,{category:"portfolio",origin:"portfolio-crossd-pool",payload:{position:C,detail:N}},n),children:[In("span",{className:"wp-tag-label",children:"Withdraw"}),In(Bn,{size:12,className:"wp-tag-icon"})]})})]},C.token_id)})}),In(Lf,{open:s.isOpen,status:s.status,target:s.target,token0Icon:x,token1Icon:k,token0Symbol:R,token1Symbol:S,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 hs=["rewards","points","staking","gameSwap","forge","crossdPool"];ce(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--ds-bg-dim, #191d27);--wp-header-bg: var(--ds-surface-default, #252b39);--wp-card: var(--ds-surface-default, #1e232e);--wp-control: #292f40;--wp-border: var(--ds-border-default, #292f40);--wp-panel-border: var(--ds-border-medium, rgba(255, 255, 255, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .28);--wp-text: var(--ds-content-highest, #ffffff);--wp-text-60: var(--ds-content-high, rgba(255, 255, 255, .85));--wp-text-40: var(--ds-content-medium, rgba(255, 255, 255, .65));--wp-text-30: var(--ds-content-low, rgba(255, 255, 255, .4));--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-high, #a392ff);--wp-green: var(--ds-system-green-high, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, #2e2854);--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-accent-primary-high, #7346f3);--wp-green: var(--ds-system-green-high, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, #f5f3ff);--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:var(--ds-accent-primary-on, #ffffff);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);background:var(--ds-surface-medium, var(--wp-control))}.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:var(--ds-accent-primary-on, #ffffff);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:var(--ds-accent-primary-on, #ffffff);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-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}@media(max-width:360px){.wp-item-label-sub{display:none}}.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:var(--ds-accent-primary-on, #ffffff);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}