@nexus-cross/dapp-ui 1.4.1-beta.8 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function Hd(e){try{return import.meta.env?.[e]}catch{return}}function _d(e){if(!(typeof process>"u"))return process.env?.[e]}function it(e){if(e)return Qd(e);let t=Hd("VITE_CROSSX_ENVIRONMENT")??Hd("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??_d("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??_d("CROSSX_ENVIRONMENT");return Qd(t)}function Qd(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as mn from"react";var xh={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"},vh=3e3;function Or(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 Xs=new Map;function lo(e,t){let r=`${xh[t]}/${e}`,n=Xs.get(r);return n||(n=(async()=>{let o=new AbortController,i=setTimeout(()=>o.abort(),vh);try{let a=await fetch(r,{cache:"no-store",signal:o.signal});return a.ok?await a.json():null}catch{return null}finally{clearTimeout(i)}})().then(o=>(o===null&&Xs.delete(r),o)),Xs.set(r,n)),n}function kh(e){return typeof e=="string"&&e.startsWith("https://")}async function Ae(e,t){let r=await lo("endpoints.json",t),n=Or(r?.apis?.[e],t);if(!kh(n))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return n}function oa(e,t){let r=Or(e?.relay?.forwarderFactories,t),n=[r?.standingForwarderFactory,r?.depositorForwarderFactory].filter(o=>typeof o=="string");return n.length>0?n:void 0}var ia="chains.json";async function Rh(e,t){return(await lo(ia,t))?.chains?.[String(e)]??{}}function li(e,t){let[r,n]=mn.useState({});return mn.useEffect(()=>{if(e==null){n({});return}let o=!0;return lo(ia,t).then(i=>{o&&n(i?.chains?.[String(e)]??{})}),()=>{o=!1}},[e,t]),r}function Ch(e){let[t,r]=mn.useState({});return mn.useEffect(()=>{let n=!0;return lo(ia,e).then(o=>{n&&r(o?.chains??{})}),()=>{n=!1}},[e]),t}function rr(e,t,r){let[n,o]=mn.useState(void 0),i=mn.useRef(r);return i.current=r,mn.useEffect(()=>{let a=!0;return lo(e,t).then(s=>{if(!a)return;let l=i.current(s);l!==void 0&&o(l)}),()=>{a=!1}},[e,t]),n}var co="1.4.1-beta.8";var aa="__nexusCrossAppLauncherRuntime";function Sh(){if(typeof window>"u")return null;let e=window;return e[aa]??(e[aa]={mode:"dapp-ui"}),e[aa]}function Nh(e){if(e.scheduled)return;e.scheduled=!0;let t=()=>{if(e.scheduled=!1,e.loggedMode!==e.mode){if(e.mode==="connect-kit-react"){let r=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${r} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${co}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${co} \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 Js(e){let t=Sh();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Nh(t))}import{BrowserClient as Th,Scope as Ih,defaultStackParser as Eh,linkedErrorsIntegration as Ah,makeFetchTransport as Mh}from"@sentry/react";var Lh="https://5c82aeb32da33b5a0a14b7c5393992ca@o4511668907081728.ingest.de.sentry.io/4511705324126289",Dh=`dapp-ui@${co}`,Mo=null,Vd=.1;function qd(){return Vd}function Ph(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function di(e){if(Mo)return Mo;if(typeof window>"u")return null;let t=Ph(it(e?.environment));typeof e?.analyticsSampleRate=="number"&&(Vd=Math.min(1,Math.max(0,e.analyticsSampleRate)));let r=new Th({dsn:e?.dsn??Lh,transport:Mh,stackParser:Eh,integrations:[Ah()],environment:t,release:Dh,enabled:e?.enabled??t==="prod"}),n=new Ih;return n.setClient(r),n.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),r.init(),Mo=n,Mo}function sa(){return Mo}function la(e,t){let r=Mo??di();if(r)return r.captureException(e,t?{captureContext:{extra:t}}:void 0)}import{Component as Oh}from"react";var da=class extends Oh{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,n){la(r,{componentStack:n.componentStack??void 0,boundary:this.props.name??"dapp-ui"})}render(){return this.state.hasError?this.props.fallback??null:this.props.children}};function Re(...e){return e.filter(Boolean).join(" ")}var Bh=/CROSSx|ONE\s?wallet|ONE\s?pocket/i;function Lo(){return typeof window>"u"?!1:Bh.test(window.navigator.userAgent)}var Yd="__nexus_dapp_ui_uid",$s=null;function zh(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function el(){if($s)return $s;let e=null;try{e=window.localStorage.getItem(Yd)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${zh()}`;try{window.localStorage.setItem(Yd,e)}catch{}}return $s=e,e}async function Kd(e){if(typeof crypto>"u"||!crypto.subtle)return null;try{let t=new TextEncoder().encode(e.trim().toLowerCase()),r=await crypto.subtle.digest("SHA-256",t);return`wallet_${Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("").slice(0,16)}`}catch{return null}}function Fh(){let e=window.navigator.userAgent;return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|iphone|ipod|android/i.test(e)?"mobile":"desktop"}function Jd(){return{host:window.location.hostname,device_type:Fh(),is_cross_inapp:String(Lo())}}var Zd=!1;function tl(){if(typeof window>"u")return null;let e=sa()??di();return e?(Zd||(Zd=!0,e.setUser({id:el()})),e):null}function $d(){return Math.random()>=qd()}var Xd=0;function Do(e){let t=tl();if(!t)return;let r=++Xd;if(!e){t.setUser({id:el()});return}Kd(e).then(n=>{n&&r===Xd&&t.setUser({id:n})})}function ca(e,t,r){let n=tl();!n||$d()||n.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Jd(),feature:e,action:t,...r}}})}function Qe(e,t,r){let n=tl();if(!n||$d())return;let o=r?.status??"success";n.captureMessage(`funnel: ${e}_${t}`,"info",{captureContext:{tags:{...Jd(),flow:e,funnel_step:`${e}_${t}`,funnel_status:o,...o==="failure"?{failure_reason:r?.reason??"unknown"}:{},...r?.tags}}})}function Ir(e){let t=e,r=String((t&&typeof t=="object"&&"message"in t?t.message:e)??"").toLowerCase();return t?.code===4001||/reject|denied|declin|cancel/i.test(r)?"user-rejected":/insufficient (funds|gas|balance)|exceeds balance/i.test(r)?"insufficient-gas":/timeout|timed out|deadline/i.test(r)?"timeout":/revert|execution failed/i.test(r)?"contract-reverted":/network|fetch|connection|disconnected|offline/i.test(r)?"network":"unknown"}import{useCallback as Uh}from"react";import{jsx as jh}from"react/jsx-runtime";function ye({feature:e,children:t}){let r=Uh(n=>{let o=n.nativeEvent;if(o.__dappUiTracked)return;let a=n.target?.closest?.("[data-track]");if(!a)return;let s=a.getAttribute("data-track");if(!s)return;o.__dappUiTracked=!0;let l=a.getAttribute("data-track-id");ca(e,s,l?{item_id:l}:void 0)},[e]);return jh("div",{style:{display:"contents"},onClick:r,children:t})}import*as Bo from"react";import*as tc from"@radix-ui/react-popover";import{Drawer as Kh}from"vaul";import{createContext as Wh,useContext as Gh}from"react";var rl=Wh(null);function pa(){let e=Gh(rl);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import*as fa from"react";var Hh="__dappUiOverlay",po=[],Po=0,ol=0,ua=!1,nl=!1;function ec(){if(ol>0){ol-=1;return}Po=Math.max(0,Po-1),po.pop()?.close(),il()}function _h(){ua||(window.addEventListener("popstate",ec),ua=!0)}function il(){po.length>0||!ua||(window.removeEventListener("popstate",ec),ua=!1)}function Qh(){nl||(nl=!0,queueMicrotask(()=>{nl=!1;let e=Po-po.length;if(e<=0){il();return}Po-=e,ol+=1,window.history.go(-e),il()}))}function Bn(e,t){let r=fa.useRef(t);r.current=t,fa.useEffect(()=>{if(!(!e||typeof window>"u"))return Vh(()=>r.current())},[e])}function Vh(e){let t={close:e};return po.push(t),Po<po.length&&(window.history.pushState({[Hh]:!0},""),Po+=1),_h(),()=>{let r=po.lastIndexOf(t);r!==-1&&(po.splice(r,1),Qh())}}import{useState as qh,useEffect as Yh}from"react";function Oo(e){let[t,r]=qh(!1);return Yh(()=>{let n=window.matchMedia(e);r(n.matches);let o=i=>r(i.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t}function de(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}de(`[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, #422a1f);--al-badge-text: var(--ds-accent-primary-default, #f0640d);--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, #fff5ee);--al-badge-text: var(--ds-accent-primary-default, #ff8438);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
|
|
1
|
+
function Hd(e){try{return import.meta.env?.[e]}catch{return}}function _d(e){if(!(typeof process>"u"))return process.env?.[e]}function it(e){if(e)return Qd(e);let t=Hd("VITE_CROSSX_ENVIRONMENT")??Hd("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??_d("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??_d("CROSSX_ENVIRONMENT");return Qd(t)}function Qd(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as mn from"react";var xh={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"},vh=3e3;function Or(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 Xs=new Map;function lo(e,t){let r=`${xh[t]}/${e}`,n=Xs.get(r);return n||(n=(async()=>{let o=new AbortController,i=setTimeout(()=>o.abort(),vh);try{let a=await fetch(r,{cache:"no-store",signal:o.signal});return a.ok?await a.json():null}catch{return null}finally{clearTimeout(i)}})().then(o=>(o===null&&Xs.delete(r),o)),Xs.set(r,n)),n}function kh(e){return typeof e=="string"&&e.startsWith("https://")}async function Ae(e,t){let r=await lo("endpoints.json",t),n=Or(r?.apis?.[e],t);if(!kh(n))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return n}function oa(e,t){let r=Or(e?.relay?.forwarderFactories,t),n=[r?.standingForwarderFactory,r?.depositorForwarderFactory].filter(o=>typeof o=="string");return n.length>0?n:void 0}var ia="chains.json";async function Rh(e,t){return(await lo(ia,t))?.chains?.[String(e)]??{}}function li(e,t){let[r,n]=mn.useState({});return mn.useEffect(()=>{if(e==null){n({});return}let o=!0;return lo(ia,t).then(i=>{o&&n(i?.chains?.[String(e)]??{})}),()=>{o=!1}},[e,t]),r}function Ch(e){let[t,r]=mn.useState({});return mn.useEffect(()=>{let n=!0;return lo(ia,e).then(o=>{n&&r(o?.chains??{})}),()=>{n=!1}},[e]),t}function rr(e,t,r){let[n,o]=mn.useState(void 0),i=mn.useRef(r);return i.current=r,mn.useEffect(()=>{let a=!0;return lo(e,t).then(s=>{if(!a)return;let l=i.current(s);l!==void 0&&o(l)}),()=>{a=!1}},[e,t]),n}var co="1.4.1";var aa="__nexusCrossAppLauncherRuntime";function Sh(){if(typeof window>"u")return null;let e=window;return e[aa]??(e[aa]={mode:"dapp-ui"}),e[aa]}function Nh(e){if(e.scheduled)return;e.scheduled=!0;let t=()=>{if(e.scheduled=!1,e.loggedMode!==e.mode){if(e.mode==="connect-kit-react"){let r=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${r} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${co}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${co} \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 Js(e){let t=Sh();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Nh(t))}import{BrowserClient as Th,Scope as Ih,defaultStackParser as Eh,linkedErrorsIntegration as Ah,makeFetchTransport as Mh}from"@sentry/react";var Lh="https://5c82aeb32da33b5a0a14b7c5393992ca@o4511668907081728.ingest.de.sentry.io/4511705324126289",Dh=`dapp-ui@${co}`,Mo=null,Vd=.1;function qd(){return Vd}function Ph(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function di(e){if(Mo)return Mo;if(typeof window>"u")return null;let t=Ph(it(e?.environment));typeof e?.analyticsSampleRate=="number"&&(Vd=Math.min(1,Math.max(0,e.analyticsSampleRate)));let r=new Th({dsn:e?.dsn??Lh,transport:Mh,stackParser:Eh,integrations:[Ah()],environment:t,release:Dh,enabled:e?.enabled??t==="prod"}),n=new Ih;return n.setClient(r),n.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),r.init(),Mo=n,Mo}function sa(){return Mo}function la(e,t){let r=Mo??di();if(r)return r.captureException(e,t?{captureContext:{extra:t}}:void 0)}import{Component as Oh}from"react";var da=class extends Oh{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,n){la(r,{componentStack:n.componentStack??void 0,boundary:this.props.name??"dapp-ui"})}render(){return this.state.hasError?this.props.fallback??null:this.props.children}};function Re(...e){return e.filter(Boolean).join(" ")}var Bh=/CROSSx|ONE\s?wallet|ONE\s?pocket/i;function Lo(){return typeof window>"u"?!1:Bh.test(window.navigator.userAgent)}var Yd="__nexus_dapp_ui_uid",$s=null;function zh(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function el(){if($s)return $s;let e=null;try{e=window.localStorage.getItem(Yd)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${zh()}`;try{window.localStorage.setItem(Yd,e)}catch{}}return $s=e,e}async function Kd(e){if(typeof crypto>"u"||!crypto.subtle)return null;try{let t=new TextEncoder().encode(e.trim().toLowerCase()),r=await crypto.subtle.digest("SHA-256",t);return`wallet_${Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("").slice(0,16)}`}catch{return null}}function Fh(){let e=window.navigator.userAgent;return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|iphone|ipod|android/i.test(e)?"mobile":"desktop"}function Jd(){return{host:window.location.hostname,device_type:Fh(),is_cross_inapp:String(Lo())}}var Zd=!1;function tl(){if(typeof window>"u")return null;let e=sa()??di();return e?(Zd||(Zd=!0,e.setUser({id:el()})),e):null}function $d(){return Math.random()>=qd()}var Xd=0;function Do(e){let t=tl();if(!t)return;let r=++Xd;if(!e){t.setUser({id:el()});return}Kd(e).then(n=>{n&&r===Xd&&t.setUser({id:n})})}function ca(e,t,r){let n=tl();!n||$d()||n.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Jd(),feature:e,action:t,...r}}})}function Qe(e,t,r){let n=tl();if(!n||$d())return;let o=r?.status??"success";n.captureMessage(`funnel: ${e}_${t}`,"info",{captureContext:{tags:{...Jd(),flow:e,funnel_step:`${e}_${t}`,funnel_status:o,...o==="failure"?{failure_reason:r?.reason??"unknown"}:{},...r?.tags}}})}function Ir(e){let t=e,r=String((t&&typeof t=="object"&&"message"in t?t.message:e)??"").toLowerCase();return t?.code===4001||/reject|denied|declin|cancel/i.test(r)?"user-rejected":/insufficient (funds|gas|balance)|exceeds balance/i.test(r)?"insufficient-gas":/timeout|timed out|deadline/i.test(r)?"timeout":/revert|execution failed/i.test(r)?"contract-reverted":/network|fetch|connection|disconnected|offline/i.test(r)?"network":"unknown"}import{useCallback as Uh}from"react";import{jsx as jh}from"react/jsx-runtime";function ye({feature:e,children:t}){let r=Uh(n=>{let o=n.nativeEvent;if(o.__dappUiTracked)return;let a=n.target?.closest?.("[data-track]");if(!a)return;let s=a.getAttribute("data-track");if(!s)return;o.__dappUiTracked=!0;let l=a.getAttribute("data-track-id");ca(e,s,l?{item_id:l}:void 0)},[e]);return jh("div",{style:{display:"contents"},onClick:r,children:t})}import*as Bo from"react";import*as tc from"@radix-ui/react-popover";import{Drawer as Kh}from"vaul";import{createContext as Wh,useContext as Gh}from"react";var rl=Wh(null);function pa(){let e=Gh(rl);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import*as fa from"react";var Hh="__dappUiOverlay",po=[],Po=0,ol=0,ua=!1,nl=!1;function ec(){if(ol>0){ol-=1;return}Po=Math.max(0,Po-1),po.pop()?.close(),il()}function _h(){ua||(window.addEventListener("popstate",ec),ua=!0)}function il(){po.length>0||!ua||(window.removeEventListener("popstate",ec),ua=!1)}function Qh(){nl||(nl=!0,queueMicrotask(()=>{nl=!1;let e=Po-po.length;if(e<=0){il();return}Po-=e,ol+=1,window.history.go(-e),il()}))}function Bn(e,t){let r=fa.useRef(t);r.current=t,fa.useEffect(()=>{if(!(!e||typeof window>"u"))return Vh(()=>r.current())},[e])}function Vh(e){let t={close:e};return po.push(t),Po<po.length&&(window.history.pushState({[Hh]:!0},""),Po+=1),_h(),()=>{let r=po.lastIndexOf(t);r!==-1&&(po.splice(r,1),Qh())}}import{useState as qh,useEffect as Yh}from"react";function Oo(e){let[t,r]=qh(!1);return Yh(()=>{let n=window.matchMedia(e);r(n.matches);let o=i=>r(i.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t}function de(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}de(`[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, #422a1f);--al-badge-text: var(--ds-accent-primary-default, #f0640d);--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, #fff5ee);--al-badge-text: var(--ds-accent-primary-default, #ff8438);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
|
|
2
2
|
`);de(`.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
|
`);de(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
|
|
4
4
|
`);de(`.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
|
-
`);de("");import{jsx as al}from"react/jsx-runtime";function rc({env:e,theme:t="dark",mobileBreakpoint:r=768,domain:n,children:o}){let i=Oo(`(max-width: ${r}px)`),[a,s]=Bo.useState(!1),l=Bo.useCallback(()=>s(!1),[]),d=it(e);Bn(a,l);let c=Bo.useMemo(()=>({env:d,theme:t,isMobile:i,open:a,domain:n,close:l}),[d,t,i,a,n,l]);return al(rl.Provider,{value:c,children:i?al(Kh.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:o},"drawer"):al(tc.Root,{open:a,onOpenChange:s,children:o},"popover")})}import*as ac from"@radix-ui/react-popover";import{Drawer as Xh}from"vaul";import{jsx as Er,jsxs as Zh}from"react/jsx-runtime";function nc({size:e=18}){return Zh("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Er("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function oc(){return Er("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Er("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ic(){return Er("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Er("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as zo}from"react/jsx-runtime";function sc({asChild:e,children:t,className:r,style:n}){let{isMobile:o,theme:i}=pa(),a=t!=null,s=e??!0,l=r?`al-trigger-btn ${r}`:"al-trigger-btn",d=a?t:zo("button",{type:"button",className:l,"data-theme":i,"data-track":"open",style:n,children:zo(nc,{size:18})});return o?zo(ye,{feature:"app_launcher",children:zo(Xh.Trigger,{asChild:s,children:d})}):zo(ye,{feature:"app_launcher",children:zo(ac.Trigger,{asChild:s,children:d})})}import*as gn from"react";import*as ga from"@radix-ui/react-popover";import{Drawer as Fo}from"vaul";import{useQuery as e0}from"@tanstack/react-query";var lc={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 Jh="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",$h="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function rn(e,t){return`${e==="production"?$h:Jh}/${t}.png`}function dc(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:rn(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:rn(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:rn(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:rn(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:rn(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:rn(t,"cross-staking"),order:7500,type:"cross-staking",badge:null,isNew:!0,serviceStatus:"available"},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:rn(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1,serviceStatus:"available"},{id:"play",label:"Quest",description:"Discover and play games on CROSS.",url:{dev:"https://stg.onechain.nexus/quest",stage:"https://stg.onechain.nexus/quest",production:"https://www.onechain.nexus/quest"},iconUrl:rn(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:rn(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:rn(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:rn(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function ma(e){let t=it(e);return e0({queryKey:["global-menu",t],queryFn:async()=>{try{let r=await fetch(lc[t],{cache:"no-store"});if(!r.ok)throw new Error(`Failed to fetch global menu: ${r.status}`);return r.json()}catch{return dc(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function sl(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function pc(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function uc(e){return[...e].sort((t,r)=>{let n=cc(t)-cc(r);return n!==0?n:t.order-r.order})}function cc(e){let t=sl(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as Bt,jsxs as Uo}from"react/jsx-runtime";function t0(e){return e.id==="cross-staking"||e.type==="cross-staking"}function mc({align:e="end",sideOffset:t=8,className:r}){let{env:n,theme:o,isMobile:i,domain:a,close:s}=pa(),{data:l}=ma(n),d=gn.useMemo(()=>uc(l?.items??[]),[l?.items]),c=24,h=gn.useRef(null),u=gn.useRef(!1),m=gn.useCallback(x=>{h.current={x:x.clientX,y:x.clientY},u.current=!1},[]),y=gn.useCallback(x=>{let k=h.current;h.current=null,k&&(u.current=Math.abs(x.clientX-k.x)>c||Math.abs(x.clientY-k.y)>c)},[]),b=gn.useCallback(()=>{h.current=null,u.current=!0},[]),f=typeof window<"u"?window.location.pathname:"",p=gn.useCallback((x,k)=>{let R=u.current;if(u.current=!1,R&&x.detail!==0)return;let I=k.url[n]??k.url.production,C=fc(I,a);if(!C)try{let S=new URL(I);if(S.pathname===window.location.pathname&&S.search===window.location.search&&S.hash===window.location.hash){s();return}}catch{}if(C){let S=window.open(I,"_blank");if(S){S.opener=null,s();return}}window.location.href=I},[n,a,s]),w=x=>{let k=x.url[n]??x.url.production,R=fc(k,a),I=sl(x),C=I==="ending",S=pc(x.iconUrl,n),E=!1;if(!R)try{let M=new URL(k).pathname;E=f===M||f.startsWith(M+"/")}catch{E=!1}return Bt("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":I,onPointerDown:m,onPointerUp:y,onPointerCancel:b,onClick:M=>p(M,x),children:Uo("div",{className:"al-grid-item-left",children:[Uo("div",{className:"al-grid-item-icon",children:[Bt("img",{src:S,alt:x.label,width:24,height:24,loading:"lazy"}),x.isNew&&Bt("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),Uo("span",{className:"al-grid-item-text",children:[Bt("span",{className:"al-grid-item-label",children:x.label}),C&&Bt("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),x.badge&&!t0(x)&&Bt("span",{className:"al-badge al-badge-list",children:x.badge})]})]})},x.id)},g=Bt("div",{className:"al-menu","data-theme":o,children:Bt("div",{className:"al-grid",children:d.map(w)})});return i?Bt(ye,{feature:"app_launcher",children:Uo(Fo.Portal,{children:[Bt(Fo.Overlay,{className:"al-drawer-overlay"}),Uo(Fo.Content,{className:Re("al-drawer-content",r),"data-theme":o,children:[Uo("div",{className:"al-drawer-header",children:[Bt(Fo.Close,{className:"al-drawer-close","data-track":"close",children:Bt(oc,{})}),Bt(Fo.Title,{className:"al-drawer-title",children:"CROSS Services"}),Bt(Fo.Close,{className:"al-drawer-close","data-track":"close",children:Bt(ic,{})})]}),Bt("div",{className:"al-drawer-body",children:g})]})]})}):Bt(ye,{feature:"app_launcher",children:Bt(ga.Portal,{children:Bt(ga.Content,{align:e,sideOffset:t,className:Re("al-popover-content",r),"data-theme":o,children:g})})})}function fc(e,t){try{let r=new URL(e).hostname;return typeof window>"u"?!0:r!==(t??window.location.hostname)}catch{return!1}}import*as Jt from"react";import*as nm from"@radix-ui/react-popover";import{Drawer as By}from"vaul";import{createContext as r0,useContext as n0}from"react";var ll=r0(null);function zn(){let e=n0(ll);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}import{WALLET_LABELS as o0}from"@nexus-cross/crossx-design-system";var dl=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(dl||{}),ha={crossx:{name:o0.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 sp from"react";import{jsx as Me,jsxs as uo}from"react/jsx-runtime";function gc({size:e=16,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("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"}),Me("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 fo({size:e=16,className:t}){return Me("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function Cn({size:e=16,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ar({size:e=24,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function hc({size:e=20,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("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"}),Me("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 ba({size:e=20,className:t}){return Me("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:Me("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 nn({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Br({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function bc({size:e=16,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("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"}),Me("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 wc({size:e=16,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("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"}),Me("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var i0='<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>',a0=`data:image/svg+xml,${encodeURIComponent(i0)}`;function yc({size:e=42,className:t}){return Me("img",{src:a0,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function xc({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("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 vc({size:e=24,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("defs",{children:uo("linearGradient",{id:"wi-send-solid-grad",x1:"3",y1:"21",x2:"21",y2:"3",gradientUnits:"userSpaceOnUse",children:[Me("stop",{stopColor:"var(--wi-send-solid-from, #f62e61)"}),Me("stop",{offset:"1",stopColor:"var(--wi-send-solid-to, #f7564a)"})]})}),Me("path",{d:"M20.98 3.02a1.2 1.2 0 0 0-1.28-.28L3.6 8.9a1.2 1.2 0 0 0 .07 2.26l6.06 1.9a.6.6 0 0 1 .39.4l1.9 6.06a1.2 1.2 0 0 0 2.26.07l6.16-16.1a1.2 1.2 0 0 0-.46-1.47Z",fill:"url(#wi-send-solid-grad)"})]})}function kc({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("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 Rc({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("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 Cc({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("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 Sc({size:e=20,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),Me("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}import*as le from"react";import mo from"bignumber.js";function s0(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return t>0&&e.charCodeAt(t-1)===46&&t--,e.slice(0,t)}function Sn(e,t){if(!e||e==="0")return"0.00";let r=new mo(e).shiftedBy(-t),n=r.isGreaterThanOrEqualTo(1)?2:4;return r.toFormat(n,mo.ROUND_DOWN)}function nr(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function go(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let r=t>=1?2:4,n=Math.pow(10,r);return`$${(Math.floor(t*n)/n).toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function wa(e,t,r){let o=new mo(e).shiftedBy(-t).multipliedBy(new mo(r));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(mo.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,mo.ROUND_DOWN):o.decimalPlaces(4,mo.ROUND_DOWN)).toFormat()}`}function Nc(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let r=t;if(r.includes("e")||r.includes("E")){let a=Number(r);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};r=s0(a.toFixed(18))}let[n="0",o=""]=r.split(".");if(Number(n)>=1){let a=o.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return o.length<4?{displayValue:`${n}.${o}`,isLowerBound:!1}:o.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${o.slice(0,4)}`,isLowerBound:!1}}import{useMemo as Ic}from"react";import{useQuery as l0}from"@tanstack/react-query";var bt={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},ya="https://terms.onechain.nexus/docs/terms-july-23-2026",xa="https://terms.onechain.nexus/docs/pp-july-23-2026",Tc="https://contents.crossdefi.io/Terms/terms/tos-26-07-09-oneusd.html";var d0="send:chain-info";function c0(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let r=t[0];if(!r)throw new Error("Chain info payload is empty.");return r}return t}return e}function cl(e,...t){let r=e.replace(/\/+$/,""),n=t.map(o=>o.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[r,...n].join("/")}function Ec(e,t,r,n){if(n)return t===bt[e].cross?Ac(t,n):r?.explorer_url?cl(r.explorer_url,r.explorer_postfix?.transaction??"tx",n):p0(e,t,n)}function Ac(e,t){return cl("https://explorer.onechain.nexus",String(e),"tx",t)}function p0(e,t,r){let n=bt[e];if(t===n.cross)return Ac(t,r);if(t===n.bsc)return cl(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",r)}function ci(e,t,r,n=!0){let o=l0({queryKey:[d0,e,t],queryFn:async({signal:s})=>{let l=await Ae("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 c=await d.json();if("code"in c&&c.code!==void 0&&c.code!==200)throw new Error(`Chain info API error: ${c.code}`);return c0(c)},enabled:n,staleTime:3e5}),i=o.data;return{transactionUrl:Ic(()=>Ec(e,t,i,r),[t,i,e,r]),chainInfo:i,...o}}function Mc(e,t,r=!0){let{chainInfo:n}=ci(e,t,void 0,r);return{buildTxUrl:Ic(()=>i=>Ec(e,t,n,i),[e,t,n]),chainInfo:n}}var Lc="0x0000000000000000000000000000000000000001";var u0="0xa9059cbb",f0=/^0x[a-fA-F0-9]{40}$/,m0="nexus-cross:dapp-ui:send:recent:",Dc=10;function g0(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function pi(e){return e.toLowerCase()}function hn(e){return f0.test(e)}function Fn(e){return pi(e.address)===Lc}function pl(e){return`${m0}${e.toLowerCase()}`}function jo(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(pl(e));if(!t)return[];let r=JSON.parse(t);return Array.isArray(r)?r.filter(n=>n!==null&&typeof n=="object"&&hn(n.address)&&typeof n.updatedAt=="number").slice(0,Dc):[]}catch{return[]}}function ul(e,t){if(typeof window>"u")return[];let r=pi(t),n=[{address:r,updatedAt:Date.now()},...jo(e).filter(o=>o.address!==r)].slice(0,Dc);try{window.localStorage.setItem(pl(e),JSON.stringify(n))}catch{return jo(e)}return n}function fl(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(pl(e))}catch{}}function ho(e,t){let r=e.trim();if(!r)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(r))return{error:"Enter a valid amount."};let[n="0",o=""]=r.split(".");if(o.length>t)return{error:`Max ${t} decimal places.`};let i=BigInt(n||"0"),a=o.padEnd(t,"0"),s=a?BigInt(a):0n,l=10n**BigInt(t),d=i*l+s;return d<=0n?{error:"Amount must be greater than 0."}:{value:d}}function Wo(e,t){let r=BigInt(e||"0"),n=10n**BigInt(t),o=r/n,i=r%n;if(i===0n)return o.toString();let a=g0(i.toString().padStart(t,"0"));return`${o.toString()}.${a}`}function ml(e,t){let r=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${u0}${r}${n}`}function va(e,t,r=10){if(t<=0)return e.toString();let n=10n**BigInt(t),o=e/n,i=e%n;if(i===0n)return o.toString();let s=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(r,t)));return s=s.replace(/0+$/,""),s?`${o.toString()}.${s}`:o.toString()}function gl(e,t){return va(e,t,6)}function Pc(e){return va(e,9,2)}function Oc(e){return e.toLocaleString("en-US")}function ka(e){return e===56||e===97}function Ra(e){return e.gasPrice??e.maxFeePerGas}function Bc(e,t=!1){return t?Ra(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Ca(e,t=!1){if(t){let r=Ra(e);return r!==void 0?e.gasLimit*r:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function Sa(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function zc(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let r=e,n=[];return typeof r.name=="string"&&n.push(r.name),typeof r.shortMessage=="string"&&n.push(r.shortMessage),typeof r.message=="string"&&n.push(r.message),typeof r.details=="string"&&n.push(r.details),r.cause!==void 0&&n.push(zc(r.cause,t+1)),n.join(`
|
|
5
|
+
`);de("");import{jsx as al}from"react/jsx-runtime";function rc({env:e,theme:t="dark",mobileBreakpoint:r=768,domain:n,children:o}){let i=Oo(`(max-width: ${r}px)`),[a,s]=Bo.useState(!1),l=Bo.useCallback(()=>s(!1),[]),d=it(e);Bn(a,l);let c=Bo.useMemo(()=>({env:d,theme:t,isMobile:i,open:a,domain:n,close:l}),[d,t,i,a,n,l]);return al(rl.Provider,{value:c,children:i?al(Kh.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:o},"drawer"):al(tc.Root,{open:a,onOpenChange:s,children:o},"popover")})}import*as ac from"@radix-ui/react-popover";import{Drawer as Xh}from"vaul";import{jsx as Er,jsxs as Zh}from"react/jsx-runtime";function nc({size:e=18}){return Zh("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Er("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Er("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function oc(){return Er("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Er("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ic(){return Er("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Er("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as zo}from"react/jsx-runtime";function sc({asChild:e,children:t,className:r,style:n}){let{isMobile:o,theme:i}=pa(),a=t!=null,s=e??!0,l=r?`al-trigger-btn ${r}`:"al-trigger-btn",d=a?t:zo("button",{type:"button",className:l,"data-theme":i,"data-track":"open",style:n,children:zo(nc,{size:18})});return o?zo(ye,{feature:"app_launcher",children:zo(Xh.Trigger,{asChild:s,children:d})}):zo(ye,{feature:"app_launcher",children:zo(ac.Trigger,{asChild:s,children:d})})}import*as gn from"react";import*as ga from"@radix-ui/react-popover";import{Drawer as Fo}from"vaul";import{useQuery as e0}from"@tanstack/react-query";var lc={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 Jh="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",$h="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function rn(e,t){return`${e==="production"?$h:Jh}/${t}.png`}function dc(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:rn(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:rn(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:rn(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:rn(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:rn(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:rn(t,"cross-staking"),order:7500,type:"cross-staking",badge:null,isNew:!0,serviceStatus:"available"},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:rn(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1,serviceStatus:"available"},{id:"play",label:"Quest",description:"Discover and play games on CROSS.",url:{dev:"https://stg.onechain.nexus/quest",stage:"https://stg.onechain.nexus/quest",production:"https://www.onechain.nexus/quest"},iconUrl:rn(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:rn(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:rn(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:rn(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function ma(e){let t=it(e);return e0({queryKey:["global-menu",t],queryFn:async()=>{try{let r=await fetch(lc[t],{cache:"no-store"});if(!r.ok)throw new Error(`Failed to fetch global menu: ${r.status}`);return r.json()}catch{return dc(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function sl(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function pc(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function uc(e){return[...e].sort((t,r)=>{let n=cc(t)-cc(r);return n!==0?n:t.order-r.order})}function cc(e){let t=sl(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as Bt,jsxs as Uo}from"react/jsx-runtime";function t0(e){return e.id==="cross-staking"||e.type==="cross-staking"}function mc({align:e="end",sideOffset:t=8,className:r}){let{env:n,theme:o,isMobile:i,domain:a,close:s}=pa(),{data:l}=ma(n),d=gn.useMemo(()=>uc(l?.items??[]),[l?.items]),c=24,h=gn.useRef(null),u=gn.useRef(!1),m=gn.useCallback(x=>{h.current={x:x.clientX,y:x.clientY},u.current=!1},[]),y=gn.useCallback(x=>{let k=h.current;h.current=null,k&&(u.current=Math.abs(x.clientX-k.x)>c||Math.abs(x.clientY-k.y)>c)},[]),b=gn.useCallback(()=>{h.current=null,u.current=!0},[]),f=typeof window<"u"?window.location.pathname:"",p=gn.useCallback((x,k)=>{let R=u.current;if(u.current=!1,R&&x.detail!==0)return;let I=k.url[n]??k.url.production,C=fc(I,a);if(!C)try{let S=new URL(I);if(S.pathname===window.location.pathname&&S.search===window.location.search&&S.hash===window.location.hash){s();return}}catch{}if(C){let S=window.open(I,"_blank");if(S){S.opener=null,s();return}}window.location.href=I},[n,a,s]),w=x=>{let k=x.url[n]??x.url.production,R=fc(k,a),I=sl(x),C=I==="ending",S=pc(x.iconUrl,n),E=!1;if(!R)try{let M=new URL(k).pathname;E=f===M||f.startsWith(M+"/")}catch{E=!1}return Bt("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":I,onPointerDown:m,onPointerUp:y,onPointerCancel:b,onClick:M=>p(M,x),children:Uo("div",{className:"al-grid-item-left",children:[Uo("div",{className:"al-grid-item-icon",children:[Bt("img",{src:S,alt:x.label,width:24,height:24,loading:"lazy"}),x.isNew&&Bt("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),Uo("span",{className:"al-grid-item-text",children:[Bt("span",{className:"al-grid-item-label",children:x.label}),C&&Bt("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),x.badge&&!t0(x)&&Bt("span",{className:"al-badge al-badge-list",children:x.badge})]})]})},x.id)},g=Bt("div",{className:"al-menu","data-theme":o,children:Bt("div",{className:"al-grid",children:d.map(w)})});return i?Bt(ye,{feature:"app_launcher",children:Uo(Fo.Portal,{children:[Bt(Fo.Overlay,{className:"al-drawer-overlay"}),Uo(Fo.Content,{className:Re("al-drawer-content",r),"data-theme":o,children:[Uo("div",{className:"al-drawer-header",children:[Bt(Fo.Close,{className:"al-drawer-close","data-track":"close",children:Bt(oc,{})}),Bt(Fo.Title,{className:"al-drawer-title",children:"ONE Services"}),Bt(Fo.Close,{className:"al-drawer-close","data-track":"close",children:Bt(ic,{})})]}),Bt("div",{className:"al-drawer-body",children:g})]})]})}):Bt(ye,{feature:"app_launcher",children:Bt(ga.Portal,{children:Bt(ga.Content,{align:e,sideOffset:t,className:Re("al-popover-content",r),"data-theme":o,children:g})})})}function fc(e,t){try{let r=new URL(e).hostname;return typeof window>"u"?!0:r!==(t??window.location.hostname)}catch{return!1}}import*as Jt from"react";import*as nm from"@radix-ui/react-popover";import{Drawer as By}from"vaul";import{createContext as r0,useContext as n0}from"react";var ll=r0(null);function zn(){let e=n0(ll);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}import{WALLET_LABELS as o0}from"@nexus-cross/crossx-design-system";var dl=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(dl||{}),ha={crossx:{name:o0.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 sp from"react";import{jsx as Me,jsxs as uo}from"react/jsx-runtime";function gc({size:e=16,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("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"}),Me("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 fo({size:e=16,className:t}){return Me("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function Cn({size:e=16,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ar({size:e=24,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function hc({size:e=20,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("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"}),Me("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 ba({size:e=20,className:t}){return Me("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:Me("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 nn({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Br({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function bc({size:e=16,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("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"}),Me("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 wc({size:e=16,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("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"}),Me("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var i0='<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>',a0=`data:image/svg+xml,${encodeURIComponent(i0)}`;function yc({size:e=42,className:t}){return Me("img",{src:a0,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function xc({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("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 vc({size:e=24,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("defs",{children:uo("linearGradient",{id:"wi-send-solid-grad",x1:"3",y1:"21",x2:"21",y2:"3",gradientUnits:"userSpaceOnUse",children:[Me("stop",{stopColor:"var(--wi-send-solid-from, #f62e61)"}),Me("stop",{offset:"1",stopColor:"var(--wi-send-solid-to, #f7564a)"})]})}),Me("path",{d:"M20.98 3.02a1.2 1.2 0 0 0-1.28-.28L3.6 8.9a1.2 1.2 0 0 0 .07 2.26l6.06 1.9a.6.6 0 0 1 .39.4l1.9 6.06a1.2 1.2 0 0 0 2.26.07l6.16-16.1a1.2 1.2 0 0 0-.46-1.47Z",fill:"url(#wi-send-solid-grad)"})]})}function kc({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("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 Rc({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("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 Cc({size:e=20,className:t}){return Me("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Me("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 Sc({size:e=20,className:t}){return uo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Me("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),Me("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}import*as le from"react";import mo from"bignumber.js";function s0(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return t>0&&e.charCodeAt(t-1)===46&&t--,e.slice(0,t)}function Sn(e,t){if(!e||e==="0")return"0.00";let r=new mo(e).shiftedBy(-t),n=r.isGreaterThanOrEqualTo(1)?2:4;return r.toFormat(n,mo.ROUND_DOWN)}function nr(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function go(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let r=t>=1?2:4,n=Math.pow(10,r);return`$${(Math.floor(t*n)/n).toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function wa(e,t,r){let o=new mo(e).shiftedBy(-t).multipliedBy(new mo(r));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(mo.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,mo.ROUND_DOWN):o.decimalPlaces(4,mo.ROUND_DOWN)).toFormat()}`}function Nc(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let r=t;if(r.includes("e")||r.includes("E")){let a=Number(r);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};r=s0(a.toFixed(18))}let[n="0",o=""]=r.split(".");if(Number(n)>=1){let a=o.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return o.length<4?{displayValue:`${n}.${o}`,isLowerBound:!1}:o.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${o.slice(0,4)}`,isLowerBound:!1}}import{useMemo as Ic}from"react";import{useQuery as l0}from"@tanstack/react-query";var bt={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},ya="https://terms.onechain.nexus/docs/terms-july-23-2026",xa="https://terms.onechain.nexus/docs/pp-july-23-2026",Tc="https://contents.crossdefi.io/Terms/terms/tos-26-07-09-oneusd.html";var d0="send:chain-info";function c0(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let r=t[0];if(!r)throw new Error("Chain info payload is empty.");return r}return t}return e}function cl(e,...t){let r=e.replace(/\/+$/,""),n=t.map(o=>o.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[r,...n].join("/")}function Ec(e,t,r,n){if(n)return t===bt[e].cross?Ac(t,n):r?.explorer_url?cl(r.explorer_url,r.explorer_postfix?.transaction??"tx",n):p0(e,t,n)}function Ac(e,t){return cl("https://explorer.onechain.nexus",String(e),"tx",t)}function p0(e,t,r){let n=bt[e];if(t===n.cross)return Ac(t,r);if(t===n.bsc)return cl(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",r)}function ci(e,t,r,n=!0){let o=l0({queryKey:[d0,e,t],queryFn:async({signal:s})=>{let l=await Ae("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 c=await d.json();if("code"in c&&c.code!==void 0&&c.code!==200)throw new Error(`Chain info API error: ${c.code}`);return c0(c)},enabled:n,staleTime:3e5}),i=o.data;return{transactionUrl:Ic(()=>Ec(e,t,i,r),[t,i,e,r]),chainInfo:i,...o}}function Mc(e,t,r=!0){let{chainInfo:n}=ci(e,t,void 0,r);return{buildTxUrl:Ic(()=>i=>Ec(e,t,n,i),[e,t,n]),chainInfo:n}}var Lc="0x0000000000000000000000000000000000000001";var u0="0xa9059cbb",f0=/^0x[a-fA-F0-9]{40}$/,m0="nexus-cross:dapp-ui:send:recent:",Dc=10;function g0(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function pi(e){return e.toLowerCase()}function hn(e){return f0.test(e)}function Fn(e){return pi(e.address)===Lc}function pl(e){return`${m0}${e.toLowerCase()}`}function jo(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(pl(e));if(!t)return[];let r=JSON.parse(t);return Array.isArray(r)?r.filter(n=>n!==null&&typeof n=="object"&&hn(n.address)&&typeof n.updatedAt=="number").slice(0,Dc):[]}catch{return[]}}function ul(e,t){if(typeof window>"u")return[];let r=pi(t),n=[{address:r,updatedAt:Date.now()},...jo(e).filter(o=>o.address!==r)].slice(0,Dc);try{window.localStorage.setItem(pl(e),JSON.stringify(n))}catch{return jo(e)}return n}function fl(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(pl(e))}catch{}}function ho(e,t){let r=e.trim();if(!r)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(r))return{error:"Enter a valid amount."};let[n="0",o=""]=r.split(".");if(o.length>t)return{error:`Max ${t} decimal places.`};let i=BigInt(n||"0"),a=o.padEnd(t,"0"),s=a?BigInt(a):0n,l=10n**BigInt(t),d=i*l+s;return d<=0n?{error:"Amount must be greater than 0."}:{value:d}}function Wo(e,t){let r=BigInt(e||"0"),n=10n**BigInt(t),o=r/n,i=r%n;if(i===0n)return o.toString();let a=g0(i.toString().padStart(t,"0"));return`${o.toString()}.${a}`}function ml(e,t){let r=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${u0}${r}${n}`}function va(e,t,r=10){if(t<=0)return e.toString();let n=10n**BigInt(t),o=e/n,i=e%n;if(i===0n)return o.toString();let s=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(r,t)));return s=s.replace(/0+$/,""),s?`${o.toString()}.${s}`:o.toString()}function gl(e,t){return va(e,t,6)}function Pc(e){return va(e,9,2)}function Oc(e){return e.toLocaleString("en-US")}function ka(e){return e===56||e===97}function Ra(e){return e.gasPrice??e.maxFeePerGas}function Bc(e,t=!1){return t?Ra(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Ca(e,t=!1){if(t){let r=Ra(e);return r!==void 0?e.gasLimit*r:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function Sa(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function zc(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let r=e,n=[];return typeof r.name=="string"&&n.push(r.name),typeof r.shortMessage=="string"&&n.push(r.shortMessage),typeof r.message=="string"&&n.push(r.message),typeof r.details=="string"&&n.push(r.details),r.cause!==void 0&&n.push(zc(r.cause,t+1)),n.join(`
|
|
6
6
|
`).toLowerCase()}function h0(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 hl(e,t={},r="Failed to send transaction."){let n=zc(e);if(!n)return r;let o=t.nativeSymbol?.trim()||"gas token",i=t.networkName?.trim();if(n.includes("user rejected")||n.includes("userrejected")||n.includes("user denied")||n.includes("user cancelled")||n.includes("user canceled")||n.includes("action_rejected")||n.includes("rejected by user"))return"Transaction was cancelled.";if(n.includes("insufficientfunds")||n.includes("insufficient funds")||n.includes("exceeds the balance of the account")||n.includes("insufficient balance for transfer")){let a=i?` on ${i}`:"";return`Not enough ${o} to cover the gas fee.Please top up your ${o} balance and try again.`}return n.includes("transaction underpriced")||n.includes("replacement transaction underpriced")||n.includes("fee too low")?"Gas fee was too low for the network. Please try again.":n.includes("nonce too low")||n.includes("nonce has already been used")||n.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":n.includes("execution reverted")||n.includes("contractfunctionrevertederror")||n.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":n.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":n.includes("http request failed")||n.includes("failed to fetch")||n.includes("network request failed")||n.includes("timeout")||n.includes("econnreset")||n.includes("rpc error")||n.includes("429")?"Network connection failed. Check your internet and try again.":n.includes("estimategas")||n.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":h0(e)||r}var b0=2000000000n,w0=1000000000n;async function Na(e,t,r){let n=new AbortController,o=setTimeout(()=>n.abort(),8e3),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:r}),signal:n.signal}).finally(()=>clearTimeout(o));if(!i.ok)throw new Error(`RPC ${t} HTTP ${i.status}`);let a=await i.json();if(a.error)throw new Error(`RPC ${t}: ${a.error.message}`);if(a.result===void 0)throw new Error(`RPC ${t}: empty result`);return a.result}function Ta(e){return BigInt(e)}function y0(e){return`0x${e.toString(16)}`}function x0(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=y0(e.value)),e.data&&(t.data=e.data),t}function v0(e){return e===56||e===97}async function Fc(e){try{let t=await Na(e,"eth_gasPrice",[]);return{gasPrice:Ta(t)}}catch{return{gasPrice:b0}}}async function k0(e,t){let r=w0;try{let n=await Na(e,"eth_maxPriorityFeePerGas",[]);r=Ta(n)}catch{}return{maxFeePerGas:t+r,maxPriorityFeePerGas:r}}async function R0(e,t){if(t)return Fc(e);let r;try{r=(await Na(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return r?k0(e,Ta(r)):Fc(e)}async function Uc(e,t){let r=v0(t.chainId),n=x0(t),[o,i]=await Promise.all([Na(e,"eth_estimateGas",[n]),R0(e,r)]);return{gasLimit:Ta(o),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function jc(e){let{estimateGas:t,sendTransaction:r,getTransactionReceipt:n}=e;return{canSend:!!r,canEstimateGas(o){return!!t||!!o},async estimateGas(o,i){if(t)return t(o);if(i)return Uc(i,o);throw new Error("Gas estimation is not available.")},async sendTransaction(o){if(!r)throw new Error("Sending is not available for this wallet.");return r(o)},getTransactionReceipt:n}}var C0=1500,S0=120;function Wc(e){return!!(e.token||e.recipient||e.amount)}function bl({recipient:e,amount:t,token:r,balanceRaw:n}){let o={},i=e.trim(),a=ho(t,r.quantity.decimals),s;return i?hn(i)||(o.recipient="Enter a valid EVM recipient address."):o.recipient="Enter a recipient address.","error"in a?o.amount=a.error:(s=a.value,s>n&&(o.amount="Amount exceeds available balance.")),!Fn(r)&&!hn(r.address)&&(o.token="Token contract address is invalid."),{errors:o,rawAmount:o.amount?void 0:s,recipient:i&&hn(i)?i:void 0}}function wl({token:e,walletAddress:t,recipient:r,rawAmount:n}){let o=t;return Fn(e)?{to:r,value:n,chainId:e.chainId,from:o}:{to:pi(e.address),data:ml(r,n),value:0n,chainId:e.chainId,from:o}}function N0(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var T0=e=>new Promise(t=>setTimeout(t,e));async function Gc({repository:e,args:t,chainId:r,onSubmitted:n,pollIntervalMs:o=C0,pollMaxAttempts:i=S0}){let a=await e.sendTransaction(t);n(a);let{getTransactionReceipt:s}=e;if(!s)return"success";for(let l=0;l<i;l+=1){let d=await s({hash:a,chainId:r}).catch(()=>null);if(d)return N0(d)?"reverted":"success";await T0(o)}return"timeout"}var Hc=["token","recipient","amount","review"];function _c(e){let{env:t,walletAddress:r,accountName:n,accounts:o=[],initialStep:i="recipient",token:a,tokens:s=[],onTokenChange:l,sendTransaction:d,getTransactionReceipt:c,estimateGas:h,getTokenPriceUsd:u,onSubmitted:m,onSuccess:y,onFailed:b,onExit:f,onOutlink:p}=e,w=le.useMemo(()=>jc({sendTransaction:d,getTransactionReceipt:c,estimateGas:h}),[d,c,h]),[g,x]=le.useState(a);le.useEffect(()=>{x(a)},[a.address,a.chainId]);let[k,R]=le.useState(i),[I,C]=le.useState(""),[S,E]=le.useState(""),[M,B]=le.useState({}),[L,z]=le.useState("idle"),[A,U]=le.useState(""),[oe,Y]=le.useState(""),[G,H]=le.useState(null),[ie,re]=le.useState(!1),[O,Z]=le.useState(""),_=le.useRef(0),[ce,xe]=le.useState(null),[he,fe]=le.useState(""),[ge,we]=le.useState(()=>jo(r)),Ye=le.useRef(new Set),be=le.useCallback((P,ae)=>{Ye.current.has(P)||(Ye.current.add(P),Qe("send",P,ae))},[]);le.useEffect(()=>{be("opened"),i!=="token"&&be("token_selected",{tags:{item_id:a.symbol}})},[be,i,a.symbol]);let Te=le.useMemo(()=>it(t),[t]),{transactionUrl:at,chainInfo:je}=ci(Te,g.chainId,A||void 0,!0),He=li(g.chainId,Te),Oe=He.nativeSymbol??je?.currency_symbol??"",nt=He.name??je?.name??`Chain ID ${g.chainId}`,Mt=le.useRef({nativeSymbol:Oe||void 0,networkName:nt,tokenSymbol:g.symbol});Mt.current={nativeSymbol:Oe||void 0,networkName:nt,tokenSymbol:g.symbol};let mt=le.useMemo(()=>BigInt(g.quantity.numeric||"0"),[g.quantity.numeric]),St=le.useMemo(()=>Sn(g.quantity.numeric,g.quantity.decimals),[g.quantity.numeric,g.quantity.decimals]),Se=u?.(g),yt=le.useMemo(()=>{if(Se===void 0)return;let P=parseFloat(S.replace(/,/g,""));return Number.isFinite(P)?P*Se:0},[S,Se]);le.useEffect(()=>{E(""),B({})},[g.address,g.chainId]),le.useEffect(()=>{_.current+=1,H(null),Z(""),re(!1)},[g.address,g.chainId,I,S]),le.useEffect(()=>{we(jo(r))},[r]);let xt=le.useCallback(P=>{C(P),B(ae=>({...ae,recipient:void 0}))},[]),Nt=le.useCallback(P=>{E(P),B(ae=>({...ae,amount:void 0}))},[]),Ke=le.useCallback(()=>{E(St.replace(/,/g,"")),B(P=>({...P,amount:void 0}))},[St]),$e=le.useCallback(P=>{x(P),l?.(P),be("token_selected",{tags:{item_id:P.symbol}}),R("recipient")},[l,be]),er=le.useCallback(()=>R("token"),[]),Lt=le.useCallback(()=>{R(P=>{if(P==="result")return"review";if(P===i)return f?.(),P;let ae=Hc.indexOf(P);return ae<=0?(f?.(),P):Hc[ae-1]})},[i,f]),jt=le.useCallback(()=>{let{errors:P}=bl({recipient:I,amount:"1",token:g,balanceRaw:mt});if(P.recipient){B(ae=>({...ae,recipient:P.recipient}));return}B(ae=>({...ae,recipient:void 0})),be("recipient_entered"),R("amount")},[I,g,mt,be]),Dt=le.useCallback(P=>{C(P),B(ae=>({...ae,recipient:void 0})),be("recipient_entered"),R("amount")},[be]),ot=le.useCallback(()=>{let P=bl({recipient:I,amount:S,token:g,balanceRaw:mt});B(P.errors),!(Wc(P.errors)||P.rawAmount===void 0||!P.recipient)&&(xe(P.rawAmount),fe(P.recipient),H(null),Z(""),z("idle"),be("amount_entered"),R("review"))},[I,S,g,mt,be]);le.useEffect(()=>{if(k!=="review"||!he||ce===null||G!==null||ie||O||!w.canEstimateGas(je?.rpc))return;let P=++_.current;re(!0),Z(""),(async()=>{try{let ae=wl({token:g,walletAddress:r,recipient:he,rawAmount:ce}),pe=await w.estimateGas(ae,je?.rpc);if(_.current!==P)return;H(pe)}catch(ae){if(_.current!==P)return;Z(hl(ae,Mt.current,"Failed to estimate gas."))}finally{_.current===P&&re(!1)}})()},[k,he,ce,G,ie,O,w,je?.rpc,g,r]);let We=le.useMemo(()=>{if(!Fn(g)||!G||ce===null)return!1;let P=Ca(G,ka(g.chainId));return P===null?!1:ce+P>mt},[g,G,ce,mt]),st=le.useCallback(async()=>{if(!(!he||ce===null)&&!We){Y(""),U(""),z("submitting"),be("submitted");try{let P="",ae=await Gc({repository:w,args:wl({token:g,walletAddress:r,recipient:he,rawAmount:ce}),chainId:g.chainId,onSubmitted:pe=>{P=pe,U(pe),z("confirming"),we(ul(r,he)),m?.({txHash:pe,chainId:g.chainId,amount:S,tokenSymbol:g.symbol,recipient:he})}});if(ae==="success")z("success"),be("confirmed"),P&&y?y?.(P):R("result");else if(ae==="reverted"){let pe="Transaction reverted on-chain.";z("error"),Y(pe),be("confirmed",{status:"failure",reason:Ir(new Error(pe))}),P&&b?b({txHash:P,chainId:g.chainId,message:pe}):R("result")}else{let pe="Transaction receipt was not found. Please check again later.";z("error"),Y(pe),be("confirmed",{status:"failure",reason:"timeout"}),P&&b?b({txHash:P,chainId:g.chainId,message:pe}):R("result")}}catch(P){z("error"),be("confirmed",{status:"failure",reason:Ir(P)}),Y(hl(P,{nativeSymbol:Oe||void 0,networkName:nt,tokenSymbol:g.symbol})),R("result")}}},[w,he,ce,We,g,S,r,m,y,b,Oe,nt,be]),[Tt,De]=le.useState(!1),lt=le.useRef(void 0);le.useEffect(()=>()=>clearTimeout(lt.current),[]);let Vt=le.useCallback(async()=>{if(A)try{await navigator.clipboard.writeText(A),De(!0),clearTimeout(lt.current),lt.current=setTimeout(()=>De(!1),2e3)}catch{}},[A]),F=le.useCallback(()=>{if(!at||!A)return;let P=me=>{typeof window<"u"&&window.open(me,"_blank","noopener,noreferrer")};if(!p){P(at);return}let ae=p(at,{category:"send",origin:"send-transaction",payload:{chainId:g.chainId,txHash:A}});if(ae&&typeof ae.then=="function"){let me=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;ae.then(et=>{if(et===null){me?.close();return}let sr=et??at;if(me)try{me.location.href=sr}catch{me.close(),P(sr)}else P(sr)});return}let pe=ae;pe!==null&&P(pe??at)},[p,g.chainId,at,A]),ke=le.useCallback(()=>{Y(""),U(""),z("idle"),H(null),Z(""),Ye.current.delete("submitted"),Ye.current.delete("confirmed"),R("review")},[]);return{step:k,status:L,token:g,tokens:s.length>0?s:[g],recipient:I,amount:S,amountUsd:yt,fieldErrors:M,error:oe,txHash:A,gasEstimate:G,gasLoading:ie,gasError:O,insufficientGas:We,reviewRawAmount:ce,reviewRecipient:he,recentAddresses:ge,accounts:o,accountName:n,walletAddress:r,resolvedEnv:Te,transactionUrl:at,networkName:nt,nativeSymbol:Oe,nativeDecimals:je?.currency_decimals??g.quantity.decimals,balanceRaw:mt,balanceText:St,priceUsd:Se,canSelectToken:(s.length>0?s:[g]).length>1,canSend:w.canSend,getTokenPriceUsd:u,setRecipient:xt,setAmount:Nt,setMax:Ke,selectToken:$e,goToTokenSelect:er,selectRecipient:Dt,submitRecipient:jt,submitAmount:ot,confirmSend:st,retry:ke,back:Lt,hashCopied:Tt,copyHash:Vt,openTransaction:F}}import*as on from"react";import{jsx as ui,jsxs as yl}from"react/jsx-runtime";function Qc({flow:e}){let{amount:t,setAmount:r,amountUsd:n,balanceText:o,balanceRaw:i,token:a,setMax:s}=e,l=on.useRef(null),d=on.useCallback(()=>{requestAnimationFrame(()=>{let b=l.current;if(!b)return;let f=b.value.length;b.setSelectionRange(f,f)})},[]);on.useEffect(()=>{l.current?.focus(),d()},[d]),on.useEffect(()=>{t===""&&(u(!1),d())},[t,d]);let c=on.useMemo(()=>{let b=ho(t,a.quantity.decimals);return"value"in b&&b.value>i},[t,a.quantity.decimals,i]),[h,u]=on.useState(!1),m=!h&&t===""?"0.00":t,y=t.trim()===""||t.trim()==="0";return ui("div",{className:"sf-body sf-amount",children:yl("div",{className:"sf-amount-center",children:[ui("span",{className:"sf-amount-usd",children:n!==void 0?Sa(n):"\xA0"}),ui("div",{className:"sf-amount-input-wrap","data-over":c||void 0,"data-empty":y||void 0,onClick:()=>l.current?.focus(),children:ui("input",{ref:l,className:"sf-amount-input",value:m,onChange:b=>{let f=b.target.value;if(h)r(f);else if(t===""){if(f.length<4)return;u(!0);let p=f.startsWith("0.00")?f.slice(4):f;r(p)}else u(!0),r(f)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),yl("div",{className:"sf-amount-balance",children:[ui("span",{children:"Balance:"}),yl("button",{type:"button",className:"sf-amount-max",onClick:s,"data-track":"amount_max",children:[o," ",a.symbol]})]})]})})}import*as an from"react";var E0=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function xl(e){return E0.has(e.toLowerCase())}var Vc={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function fi(e,t){let r=bt[e];if(t===r.cross)return Vc.cross;if(t===r.bsc)return Vc.bsc}var A0={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Nn(e,t,r={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:o,format:i="png"}=r,a=A0[e],s=o?`&bg=${o}`:"";return`${a}/portrait/evm/${t}.${i}?size=${n}${s}`}import{jsx as zr,jsxs as Ia}from"react/jsx-runtime";function qc({size:e=20,className:t}){return Ia("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[zr("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),zr("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Yc({size:e=20,className:t}){return zr("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:zr("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 Kc({size:e=20,className:t}){return Ia("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[zr("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),zr("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Zc({size:e=16,className:t}){return zr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:zr("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Xc({size:e=56,className:t}){return Ia("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[zr("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-green-default, #00b4b7)"}),zr("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 Jc({size:e=56,className:t}){return Ia("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[zr("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),zr("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import{jsx as zt,jsxs as bn}from"react/jsx-runtime";function $c(e,t){return e.name||`Account ${(e.index??t)+1}`}function ep(e){return e.trim().slice(0,1).toUpperCase()||"A"}function tp(e){return e.toLowerCase()}function rp({flow:e}){let{recipient:t,setRecipient:r,fieldErrors:n,recentAddresses:o,accounts:i,walletAddress:a,resolvedEnv:s,selectRecipient:l}=e,d=an.useMemo(()=>i.filter(g=>g.address.toLowerCase()!==a.toLowerCase()),[i,a]),c=d.length>0,h=an.useMemo(()=>new Map(d.map((g,x)=>[tp(g.address),{account:g,index:x}])),[d]),[u,m]=an.useState("recent"),y=an.useRef(null);an.useEffect(()=>{y.current?.focus()},[]);let b="1A1A2E",f=an.useCallback(async()=>{try{let g=await navigator.clipboard.readText();g&&r(g.trim())}catch{}},[r]),p=t.trim().length>0,w=hn(t.trim());return bn("div",{className:"sf-recipient",children:[bn("div",{className:"sf-recipient-top",children:[bn("div",{className:"sf-address-field","data-filled":p||void 0,"data-invalid":n.recipient||void 0,children:[zt("textarea",{ref:y,className:"sf-address-input",value:t,onChange:g=>r(g.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:p?2:1}),p?zt("button",{type:"button",className:"sf-address-action",onClick:()=>r(""),"aria-label":"Clear","data-track":"recipient_clear",children:zt(Kc,{size:20})}):zt("button",{type:"button",className:"sf-address-action",onClick:f,"aria-label":"Paste from clipboard","data-track":"recipient_paste",children:zt(Yc,{size:20})})]}),n.recipient&&zt("p",{className:"sf-field-error",role:"alert",children:n.recipient}),bn("div",{className:"sf-tabs",role:"tablist",children:[zt("button",{type:"button",role:"tab",className:"sf-tab","data-active":u==="recent"||void 0,"aria-selected":u==="recent",onClick:()=>m("recent"),"data-track":"recipient_tab","data-track-id":"recent",children:"Recent"}),c&&zt("button",{type:"button",role:"tab",className:"sf-tab","data-active":u==="account"||void 0,"aria-selected":u==="account",onClick:()=>m("account"),"data-track":"recipient_tab","data-track-id":"account",children:"My Account"})]})]}),zt("div",{className:"sf-address-list",children:u==="account"&&c?d.map((g,x)=>{let k=$c(g,x),R=Nn(s,g.address,{size:56,bg:b});return bn("button",{type:"button",className:"sf-address-row",onClick:()=>l(g.address),"data-track":"recipient_item",children:[bn("span",{className:"sf-address-avatar",children:[R&&zt("img",{src:R,alt:"",width:40,height:40,draggable:!1,onError:I=>{I.currentTarget.style.display="none"}}),zt("span",{className:"sf-address-avatar-fallback",children:ep(k)})]}),bn("span",{className:"sf-address-meta",children:[zt("span",{className:"sf-address-name",children:k}),zt("span",{className:"sf-address-value",children:nr(g.address)})]})]},g.address)}):o.length>0?o.map(g=>{let x=h.get(tp(g.address)),k=x?$c(x.account,x.index):nr(g.address),R=Nn(s,g.address,{size:56,bg:b});return bn("button",{type:"button",className:"sf-address-row",onClick:()=>l(g.address),"data-track":"recipient_item",children:[bn("span",{className:"sf-address-avatar",children:[R&&zt("img",{src:R,alt:"",width:40,height:40,draggable:!1,onError:I=>{I.currentTarget.style.display="none"}}),zt("span",{className:"sf-address-avatar-fallback",children:ep(k)})]}),bn("span",{className:"sf-address-meta",children:[zt("span",{className:"sf-address-name",children:k}),zt("span",{className:"sf-address-value",children:nr(g.address)})]})]},g.address)}):zt("div",{className:"sf-empty",children:"No send history"})}),p&&!w&&!n.recipient&&zt("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as pr,jsxs as Go}from"react/jsx-runtime";function op({flow:e}){let{status:t,txHash:r,error:n,copyHash:o,hashCopied:i,openTransaction:a}=e,s=t==="error",l=t==="success";return s?Go("div",{className:"sf-body sf-result sf-result--error",children:[pr("span",{className:"sf-result-icon",children:pr(Jc,{size:56})}),Go("div",{className:"sf-result-copy",children:[pr("h3",{className:"sf-result-title",children:"Transaction Failed"}),pr("p",{className:"sf-result-desc",children:n||"Something went wrong. Please try again."})]}),r&&pr(np,{txHash:r,hashCopied:i,onCopy:o,onOpen:a})]}):Go("div",{className:"sf-body sf-result",children:[pr("span",{className:"sf-result-icon","data-pending":!l||void 0,children:l?pr(Xc,{size:56}):pr("span",{className:"sf-result-spinner"})}),Go("div",{className:"sf-result-copy",children:[pr("h3",{className:"sf-result-title",children:l?"Transaction Complete":"Transaction in Progress"}),pr("p",{className:"sf-result-desc",children:l?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),r&&pr(np,{txHash:r,hashCopied:i,onCopy:o,onOpen:a})]})}function np({txHash:e,hashCopied:t,onCopy:r,onOpen:n}){return Go("div",{className:"sf-result-hash-card",children:[pr("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),Go("div",{className:"sf-result-hash-row",children:[pr("button",{type:"button",className:"sf-result-hash-link",onClick:n,"aria-label":"Open transaction in explorer","data-track":"tx_link_open",children:nr(e)}),pr("button",{type:"button",className:"sf-result-copy-btn",onClick:r,"aria-label":"Copy transaction hash","data-track":"tx_hash_copy",children:t?pr(Cn,{size:16}):"Copy"})]})]})}import{jsx as vt,jsxs as ur}from"react/jsx-runtime";var Ea="\u2014";function ip({flow:e}){let{token:t,reviewRawAmount:r,reviewRecipient:n,accountName:o,accounts:i,walletAddress:a,networkName:s,nativeSymbol:l,nativeDecimals:d,gasEstimate:c,gasLoading:h,gasError:u,insufficientGas:m,error:y,resolvedEnv:b}=e,f=Fn(t),p=r!==null?va(r,t.quantity.decimals):"",w=o?.trim()||`Account ${(i[0]?.index??0)+1}`,g=Nn(b,a,{size:56,bg:"1A1A2E"}),x=l||(f?t.symbol:""),k=ka(t.chainId),R=c?Bc(c,k):null,I=c?Ca(c,k):null,C=L=>L!==null&&x?`${gl(L,d)} ${x}`:Ea,S=L=>L!==void 0?`${Pc(L)} Gwei`:Ea,E=(()=>{if(!f||!c||I===null||r===null)return Ea;let L=r+I;return`${gl(L,d)} ${x||t.symbol}`})(),M=L=>h?"\u2026":L,B=[{label:"Est. Tx Fee",value:M(C(I))},...R==="dynamic"?[{label:"Max Priority Fee",value:M(S(c?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:M(S(c?.maxFeePerGas))}]:R==="legacy"?[{label:"Gas Price",value:M(S(c?Ra(c):void 0))}]:[],{label:"Gas Limit",value:M(c?Oc(c.gasLimit):Ea)}];return ur("div",{className:"sf-body sf-review",children:[ur("div",{className:"sf-review-amount",children:[vt("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"}}),ur("span",{className:"sf-review-amount-value",children:[p,vt("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),ur("div",{className:"sf-review-parties",children:[ur("div",{className:"sf-review-card sf-review-party",children:[vt("span",{className:"sf-review-party-label",children:"From"}),ur("div",{className:"sf-review-party-head",children:[vt("span",{className:"sf-review-party-avatar",children:g&&vt("img",{src:g,alt:"",width:28,height:28,draggable:!1,onError:L=>{L.currentTarget.style.display="none"}})}),vt("span",{className:"sf-review-party-name",children:w})]}),vt("span",{className:"sf-review-party-addr",children:a})]}),vt("span",{className:"sf-review-arrow","aria-hidden":!0,children:vt(Zc,{size:16})}),ur("div",{className:"sf-review-card sf-review-party",children:[vt("span",{className:"sf-review-party-label",children:"To"}),vt("span",{className:"sf-review-party-addr",children:n})]})]}),ur("section",{className:"sf-review-card",children:[vt("h3",{className:"sf-review-section-title",children:"Summary"}),ur("div",{className:"sf-review-row",children:[vt("span",{className:"sf-review-row-label",children:"Network"}),vt("span",{className:"sf-review-row-value",children:s})]}),B.map(L=>ur("div",{className:"sf-review-row",children:[vt("span",{className:"sf-review-row-label",children:L.label}),vt("span",{className:"sf-review-row-value",children:L.value})]},L.label))]}),ur("section",{className:"sf-review-card",children:[vt("h3",{className:"sf-review-section-title",children:"Total"}),ur("div",{className:"sf-review-row",children:[vt("span",{className:"sf-review-row-label",children:"Total Amount"}),ur("span",{className:"sf-review-row-value",children:[p," ",t.symbol]})]}),f&&ur("div",{className:"sf-review-row",children:[vt("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),vt("span",{className:"sf-review-row-value",children:M(E)})]})]}),m&&!u&&!y&&ur("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)&&vt("div",{className:"sf-message sf-message--error",role:"alert",children:u||y})]})}import*as Aa from"react";import{jsx as Un,jsxs as bo}from"react/jsx-runtime";function ap({flow:e}){let[t,r]=Aa.useState(""),n=t.trim().toLowerCase(),o=Aa.useMemo(()=>n?e.tokens.filter(i=>i.symbol.toLowerCase().includes(n)||i.name.toLowerCase().includes(n)):e.tokens,[e.tokens,n]);return bo("div",{className:"sf-body sf-token-select",children:[bo("div",{className:"sf-search",children:[Un(qc,{size:20}),Un("input",{className:"sf-search-input",value:t,onChange:i=>r(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),bo("div",{className:"sf-token-list",children:[o.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,s=fi(e.resolvedEnv,i.chainId),l=e.getTokenPriceUsd?.(i);return bo("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),"data-track":"token_item","data-track-id":i.symbol,children:[bo("span",{className:"sf-token-left",children:[bo("span",{className:"sf-token-icon-wrap",children:[Un("img",{className:"sf-token-icon",src:i.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&&Un("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"}})]}),Un("span",{className:"sf-token-name",children:i.symbol})]}),bo("span",{className:"sf-token-right",children:[Un("span",{className:"sf-token-balance",children:Sn(i.quantity.numeric,i.quantity.decimals)}),l!==void 0&&Un("span",{className:"sf-token-price",children:Sa(l)})]})]},a)}),o.length===0&&Un("div",{className:"sf-empty",children:"No tokens found"})]})]})}de(`.sf-root{display:flex;flex-direction:column;flex:1;min-height:0;font-family:inherit}.sf-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px;flex-shrink:0;position:relative;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.sf-header .sf-header-btn:last-child{position:absolute;top:24px;right:24px}.sf-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;filter:none;transition:color .15s ease}.sf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));filter:none}.sf-header-title{position:absolute;left:50%;transform:translate(-50%);text-align:center;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);pointer-events:none}.sf-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .sf-body{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-body::-webkit-scrollbar{width:4px;height:4px}.sf-body::-webkit-scrollbar-track,.sf-body::-webkit-scrollbar-corner{background:transparent}.sf-body::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}.sf-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .sf-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .sf-body::-webkit-scrollbar-thumb:hover{background:#0003}.sf-empty{padding:32px 0;text-align:center;font-family:inherit;font-size:14px;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-field-error{margin:8px 24px 0;font-family:inherit;font-size:12px;line-height:1.5;color:var(--ds-system-red-default, #da0b2e)}.sf-message--error{margin:16px 0 0;padding:12px 16px;background:var(--ds-system-red-low, #ffeeee);color:var(--ds-system-red-high, #d20609);font-family:inherit;font-size:13px;line-height:1.5;border-radius:12px;width:100%;box-sizing:border-box}.sf-footer{display:flex;flex-shrink:0;padding:16px 24px 24px}.sf-footer:empty{display:none}.sf-footer-row{display:flex;gap:8px;width:100%}.sf-footer-row .sf-btn,.sf-footer-row .sf-btn--secondary{flex:1 1 0;min-width:0}.sf-footer>.sf-btn{width:100%}.sf-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:1;height:48px;padding:0 24px;border:none;border-radius:12px;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:background-color .15s ease,transform .1s ease}.sf-btn--primary{background:var(--ds-accent-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){filter:brightness(1.05)}.sf-btn--primary:active:not(:disabled):not([data-disabled]){transform:scale(.97)}.sf-btn--primary[data-disabled],.sf-btn--primary:disabled{background:var(--ds-accent-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff;cursor:default;opacity:.5}.sf-btn--secondary{flex:0 0 120px;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-token-select{padding:0;display:flex;flex-direction:column}.sf-token-select .sf-search{margin:16px 24px}.sf-token-select .sf-token-list{width:100%;margin-top:0}.sf-search{display:flex;align-items:center;gap:8px;padding:12px 16px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-low, rgba(0, 0, 0, .4));box-sizing:border-box;transition:border-color .15s ease}.sf-search:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-search:focus-within{border-color:var(--ds-accent-primary-high, #f0640d)}.sf-search-input{flex:1;min-width:0;border:none;background:transparent;outline:none;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-search-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-token-list{display:flex;flex-direction:column;margin-top:8px}.sf-token-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-token-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-token-left{display:flex;align-items:center;gap:16px;min-width:0}.sf-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.sf-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain}.sf-token-chain-badge{position:absolute;right:-2px;bottom:-2px;width:16px;height:16px;border-radius:50%;object-fit:cover}.sf-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.sf-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.sf-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.sf-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.sf-recipient{display:flex;flex-direction:column;flex:1;min-height:0}.sf-recipient-top{display:flex;flex-direction:column;flex-shrink:0;padding:16px 24px 0}.sf-address-field{display:flex;align-items:center;gap:8px;padding:12px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);transition:border-color .15s ease;box-sizing:border-box}.sf-address-field:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-address-field:focus-within{border-color:var(--ds-accent-primary-high, #f0640d)}.sf-address-field[data-filled]{border-color:var(--ds-accent-primary-high, #f0640d)}.sf-address-field[data-invalid]{border-color:var(--ds-system-red-default, #da0b2e)}.sf-address-input{flex:1;min-width:0;border:none;background:transparent;outline:none;resize:none;overflow:hidden;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));word-break:break-word;overflow-wrap:anywhere}.sf-address-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-address-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;border-radius:6px;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.sf-address-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-address-field[data-filled] .sf-address-action{border-radius:9999px}.sf-tabs{display:flex;gap:0;margin:16px 0 0}.sf-tab{position:relative;padding:8px 12px;border:none;background:transparent;cursor:pointer;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-tab[data-active]{color:var(--ds-accent-primary-high, #f0640d)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-accent-primary-high, #f0640d)}.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, #f0640d);animation:sf-spin .8s linear infinite}@keyframes sf-spin{to{transform:rotate(360deg)}}.sf-result-copy{display:flex;flex-direction:column;gap:8px}.sf-result-title{margin:0;font-family:inherit;font-size:18px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-result-desc{margin:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);text-align:left}.sf-result-hash-label{font-family:inherit;font-size:12px;font-weight:500;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sf-result-hash-link{border:none;background:transparent;padding:0;cursor:pointer;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;color:var(--ds-accent-primary-high, #f0640d)}.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 Gt,jsxs as Ma}from"react/jsx-runtime";var M0={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function La({onClose:e,onBackToWallet:t,onConfirmSuccess:r,onSuccess:n,className:o,...i}){let a=sp.useCallback(p=>{n?.(p),r?.(p)},[r,n]),l=_c({...i,onSuccess:n||r?a:void 0,onExit:t}),{step:d,status:c}=l,h=hn(l.recipient.trim()),u=ho(l.amount,l.token.quantity.decimals),m="value"in u&&u.value<=l.balanceRaw,y=c==="submitting"||c==="confirming",b=d!=="result",f=M0[d]??"";return Gt(ye,{feature:"send",children:Ma("div",{className:Re("sf-root",o),"data-step":d,children:[Ma("header",{className:"sf-header",children:[b?Gt("button",{type:"button",className:"sf-header-btn",onClick:l.back,"aria-label":"Back","data-track":"back",children:Gt(nn,{size:24})}):Gt("span",{className:"sf-header-btn","aria-hidden":!0}),Gt("span",{className:"sf-header-title",children:f}),Gt("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close","data-track":"close",children:Gt(Ar,{size:24})})]}),d==="token"&&Gt(ap,{flow:l}),d==="recipient"&&Gt(rp,{flow:l}),d==="amount"&&Gt(Qc,{flow:l}),d==="review"&&Gt(ip,{flow:l}),d==="result"&&Gt(op,{flow:l}),Ma("footer",{className:"sf-footer","data-step":d,children:[d==="recipient"&&Gt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitRecipient,"data-disabled":!h||void 0,"aria-disabled":!h,"data-track":"recipient_next",children:"Next"}),d==="amount"&&Gt("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"&&Ma("div",{className:"sf-footer-row",children:[Gt("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:l.back,disabled:y,"data-track":"review_cancel",children:"Cancel"}),Gt("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"&&c==="success"&&Gt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>r?.(l.txHash||void 0),"data-track":"result_ok",children:"All done"}),d==="result"&&c==="error"&&Gt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.retry,"data-track":"result_retry",children:"Try Again"})]})]})})}import*as lp from"@radix-ui/react-popover";import{Drawer as L0}from"vaul";import{jsx as Da,jsxs as D0}from"react/jsx-runtime";function dp({asChild:e,className:t,children:r}){let{isMobile:n,theme:o,walletAddress:i}=zn(),a=r!=null,s=e??!0,l=a?r:D0("button",{type:"button",className:Re("wi-trigger-btn",t),"data-theme":o,"data-mobile":n||void 0,children:[Da(gc,{size:n?14:16}),Da("span",{className:"wi-trigger-address",children:nr(i)})]});return n?Da(L0.Trigger,{asChild:s,children:l}):Da(lp.Trigger,{asChild:s,children:l})}import*as q from"react";import*as us from"@radix-ui/react-popover";import{Drawer as ps}from"vaul";import Ai from"bignumber.js";import vl from"bignumber.js";var P0=/^[+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i;function ct(e){if(e==null)return null;if(e instanceof vl)return e.isFinite()?e:null;if(typeof e=="number")return Number.isFinite(e)?new vl(e):null;let t=String(e).replace(/[,%\s]/g,"");if(!P0.test(t))return null;let r=new vl(t);return r.isFinite()?r:null}import{useQueries as O0}from"@tanstack/react-query";import{useMemo as B0}from"react";var kl="user-balance";async function z0(e,t,r,n){let o=new URLSearchParams({networkId:`eip155:${t}`,account:r}),i=await fetch(`${e}/v1/public/token/balance?${o}`,{cache:"no-store",signal:n});if(!i.ok)throw new Error(`Failed to fetch token balance: ${i.status}`);let a=await i.json();if(a.code!==200)throw new Error(`Token balance API error: ${a.code}`);return a.data}function jn(e,t,r=!0){let n=bt[e],o=[n.cross,n.bsc],i=O0({queries:o.map(d=>({queryKey:[kl,e,t,d],queryFn:async({signal:c})=>z0(await Ae("walletServer",e),d,t,c),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1}))}),a=i.some(d=>d.isLoading),s=i.some(d=>d.isError);return{tokens:B0(()=>{let d=[];for(let c of i)c.data&&d.push(...c.data);return d},[i]),isLoading:a,isError:s}}import{useQuery as F0,useQueries as U0}from"@tanstack/react-query";import{useMemo as j0}from"react";var W0="forge-holdings",G0="forge-token-image";async function H0(e,t,r){let n=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:r});if(!n.ok)throw new Error(`Failed to fetch forge holdings: ${n.status}`);let o=await n.json();if(!o.success)throw new Error("Forge holdings API error");return o.data.items}async function _0(e,t,r){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:r});if(!n.ok)return{address:t,image_url:""};let o=await n.json();return o.success?{address:t,image_url:o.data.token.image_url}:{address:t,image_url:""}}function cp(e,t,r=!0){let{data:n,...o}=F0({queryKey:[W0,e,t],queryFn:async({signal:i})=>H0(await Ae("bondingCurve",e),t,i),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1});return{holdings:n??[],...o}}function pp(e,t,r=!0){let n=U0({queries:t.map(i=>({queryKey:[G0,e,i],queryFn:async({signal:a})=>_0(await Ae("bondingCurve",e),i,a),enabled:r,staleTime:1/0}))});return{imageMap:j0(()=>{let i=new Map;for(let a of n)a.data&&i.set(a.data.address,a.data.image_url);return i},[n])}}import{useQuery as Q0}from"@tanstack/react-query";import{useMemo as V0}from"react";var Rl="token-stats";function Fr(e,t){return`${e}:${t.toLowerCase()}`}function Wn(e,t=!0){let{data:r,...n}=Q0({queryKey:[Rl,e],queryFn:async({signal:i})=>{let a=await Ae("walletServer",e),s=await fetch(`${a}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let l=await s.json();if(l.code!==200)throw new Error(`Token stats API error: ${l.code}`);return l},enabled:t,staleTime:3e4});return{statsMap:V0(()=>{let i=new Map;if(!r?.data)return i;for(let a of r.data){let s=Fr(a.chain_id,a.address);i.set(s,a)}return i},[r]),...n}}import{useQuery as q0}from"@tanstack/react-query";var Y0="crossd-apr",up=6e4,K0="https://crossd-dashboard-api.crossdefi.io/api/v1/overview",Pa,mi;function Cl(){return Pa&&Pa.expiresAt>Date.now()?Promise.resolve(Pa.value):mi||(mi=(async()=>{let e=await fetch(K0,{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 r=parseFloat(t.data.est_last_epoch_apy);if(!Number.isFinite(r))throw new Error("CROSSD overview returned a non-numeric APR");let n=r*100;return Pa={value:n,expiresAt:Date.now()+up},n})().finally(()=>{mi=void 0}),mi)}function Oa(e){let t=Math.abs(e),r=(e>=0?Math.floor:Math.ceil)(t*100)/100;return`APR ${e>=0?"+":"-"}${r}%`}function fp(){let{data:e,...t}=q0({queryKey:[Y0],queryFn:Cl,staleTime:up});return{aprPercent:e??null,...t}}import{useQuery as Z0}from"@tanstack/react-query";import{useMemo as mp}from"react";var X0="token-info";function gi(e,t){return`${t.toLowerCase()}_${e}`}function gp(e,t=!0){let{data:r,...n}=Z0({queryKey:[X0,e],queryFn:async({signal:a})=>{let s=await Ae("walletServer",e),l=await fetch(`${s}/v1/public/token/info`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let 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=mp(()=>{let a=new Map;if(!r?.data)return a;for(let s of r.data){let l=gi(s.chain_id,s.address);a.set(l,s.category)}return a},[r]),i=mp(()=>{let a=new Map;if(!r?.data)return a;for(let s of r.data)a.set(gi(s.chain_id,s.address),s);return a},[r]);return{categoryMap:o,infoMap:i,...n}}import{useMemo as J0}from"react";import $0 from"bignumber.js";function hp(e,t,r){let{tokens:n,isLoading:o}=jn(e,t,r),{statsMap:i}=Wn(e,r);return J0(()=>{let a=new $0(0);for(let c of n){let h=i.get(Fr(c.chainId,c.address));if(!h)continue;let u=ct(c.quantity.numeric),m=ct(h.price);if(!u||!m)continue;let y=u.shiftedBy(-c.quantity.decimals).multipliedBy(m);y.isNaN()||(a=a.plus(y))}let s=a.toFixed(),{displayValue:l,isLowerBound:d}=Nc(s);return{totalUsd:s,displayValue:l,isLowerBound:d,isLoading:o}},[n,i,o])}import{QRCodeSVG as Iy}from"qrcode.react";import{WALLET_LABELS as Ey}from"@nexus-cross/crossx-design-system";import{WALLET_LABELS as rb}from"@nexus-cross/crossx-design-system";import{WALLET_LABELS as Sl}from"@nexus-cross/crossx-design-system";import{jsx as ze,jsxs as wo}from"react/jsx-runtime";var eb='<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>',tb=`data:image/svg+xml,${encodeURIComponent(eb)}`;function Ba(){return ze("img",{src:tb,width:40,height:40,alt:"",style:{display:"block"}})}function bp(){return wo("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[wo("g",{clipPath:"url(#clip0_1331_27065)",children:[ze("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"}),ze("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"}),ze("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"}),ze("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"}),ze("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"}),ze("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),ze("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"})]}),ze("defs",{children:ze("clipPath",{id:"clip0_1331_27065",children:ze("rect",{width:"40",height:"40",fill:"white"})})})]})}function wp(){return wo("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ze("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),ze("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),ze("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),ze("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),ze("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 yp(){return wo("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[ze("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),ze("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"}),ze("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),ze("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 xp(){return wo("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[wo("g",{clipPath:"url(#clip0_1185_7785)",children:[ze("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"}),ze("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"})]}),ze("defs",{children:ze("clipPath",{id:"clip0_1185_7785",children:ze("rect",{width:"28",height:"28",fill:"white"})})})]})}function vp(){return wo("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[ze("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"}),ze("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"}),ze("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"}),ze("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 kp(){return ze("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:ze("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 Rp(){return ze("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ze("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var hi={cross_embedded:{id:"cross_embedded",name:Sl.social,description:"Sign in with Google or Apple",icon:Ba},cross_wallet:{id:"cross_wallet",name:Sl.app,description:"App approval is required",icon:Ba,featured:!0},cross_extension:{id:"cross_extension",name:Sl.extension,description:"Browser extension approval is required",icon:Ba,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:bp,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:wp},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:yp,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:xp,badge:"For SHOP"}};function Nl(e){return hi[e]}var Tl={google:{id:"google",name:"Google",icon:vp},apple:{id:"apple",name:"Apple",icon:kp}};function Cp(e){return Tl[e]}var Sp="dappui.wcm.last-selected",nb=new Set(["google","apple"]);function Np(e){try{window.localStorage.setItem(Sp,e)}catch{}}function Tp(){let e=null;try{e=window.localStorage.getItem(Sp)}catch{return}if(e)return nb.has(e)?rb.default:hi[e]?.name}function Ft(e,t,r,n){if(!n||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let o;try{o=n(t,r)}catch(d){console.error("[dapp-ui] onOutlink threw:",d);return}let i=d=>{typeof window>"u"||window.open(d,"_blank","noopener,noreferrer")};if((d=>!!d&&(typeof d=="object"||typeof d=="function")&&typeof d.then=="function")(o)){let d=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,c=h=>{if(h===null){d?.close();return}let u=h??t;if(d)try{d.location.href=u}catch{d.close(),i(u)}else i(u)};o.then(c,h=>{console.error("[dapp-ui] onOutlink rejected:",h),d?.close()});return}let s=o;if(s===null)return;i(s??t)}import*as vo from"react";import{Drawer as Xw}from"vaul";import{createContext as sb,useContext as lb,useMemo as db}from"react";import Ur from"bignumber.js";var ob=/^(\d{4}-\d{2}-\d{2})/;function Ip(e){if(!e||e.length===0)return;let t=new Map,r;for(let{key:o,cumulative:i}of e.map(a=>({key:ob.exec(a.reference_date)?.[1],cumulative:a.cumulative_earned})).filter(a=>!!a.key&&a.cumulative!=null).sort((a,s)=>a.key<s.key?-1:a.key>s.key?1:0))t.set(o,i),r=o;if(r===void 0)return;let n=new Date().toISOString().slice(0,10);return t.get(n)??t.get(r)}function Ep(e){return e.poolType==="Unknown"}function za(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Fa(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}function bi(e,t){let r=e.length+t.length;if(r>32)return"xs";if(r>24)return"sm"}function Il(e){return e?.toUpperCase()==="WONE"?"ONE":e}var ib=["Request Arguments:","Details:","Docs:","Version:","Contract Call:"];function wi(e,t){console.error("[wallet-portfolio] withdraw failed:",e);let n=e instanceof Error?e.message:"";for(let i of ib){let a=n.indexOf(i);a>=0&&(n=n.slice(0,a))}return n.split(`
|
|
8
8
|
`).map(i=>i.trim()).find(i=>i.length>0)||t}var ab="0xe00e8bf3";function Ap(e,t){let r=typeof e=="bigint"?e:BigInt(e);if(r<0n)throw new Error("poolId must be non-negative");if(t<0n)throw new Error("amount must be non-negative");let n=r.toString(16).padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${ab}${n}${o}`}function Ho(e){return!e||e<=0n?"0":new Ur(e.toString()).shiftedBy(-9).toFormat(2,Ur.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Ua(e){return!e||e<=0n?"0":new Ur(e.toString()).toFormat(0,Ur.ROUND_DOWN)}function ja(e){if(!e||e<=0n)return"0";let t=new Ur(e.toString()).shiftedBy(-18),r=t.isLessThan(1e-4)?7:4;return t.toFormat(r,Ur.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function wn(e,t){let r=new Ur(e).shiftedBy(-t);return!r.isFinite()||r.isZero()?"0":r.isGreaterThanOrEqualTo(1)?r.toFormat(2,Ur.ROUND_DOWN):r.toFormat(4,Ur.ROUND_DOWN)}function El(e){return wn(e,0)}var yi={rate:1,symbol:"$"};function yo(e,t=yi){let r=Number.isFinite(t.rate)&&t.rate>0?t.rate:1;return`${t.symbol||"$"}${e.times(r).toFormat(2,Ur.ROUND_DOWN)}`}function Gn(e,t,r,n=yi){let o=new Ur(r||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let i=new Ur(e||"0").shiftedBy(-t).times(o);return i.isFinite()?yo(i,n):null}var xi=sb(null);function kt(){let e=lb(xi);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}function jr(){let{conversionRatio:e,currencySymbol:t}=kt();return db(()=>({rate:typeof e=="number"&&e>0?e:yi.rate,symbol:t||yi.symbol}),[e,t])}import{Drawer as cb}from"vaul";import{jsx as Mp}from"react/jsx-runtime";function Lp({asChild:e,children:t}){let{walletAddress:r}=kt(),n=t!=null,o=e??!0,i=n?t:Mp("button",{type:"button",children:nr(r)});return Mp(cb.Trigger,{asChild:o,children:i})}import{Drawer as Xa}from"vaul";import*as Ct from"react";import{useQueryClient as Kw}from"@tanstack/react-query";import{createContext as pb,useContext as ub}from"react";var Al=pb(null);function Dp(){return ub(Al)}import{jsx as fr,jsxs as _a}from"react/jsx-runtime";function Pp({size:e=22,className:t}){return fr("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fr("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Op({size:e=22,className:t}){return _a("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[fr("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),fr("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 Bp({size:e=12,className:t}){return fr("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fr("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function Wa({size:e=16,className:t}){return _a("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[fr("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"}),fr("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 Ga({size:e=16,className:t}){return fr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fr("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ha({size:e=48,className:t}){return _a("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[fr("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),fr("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 Mr({size:e=12,className:t}){return _a("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:[fr("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"}),fr("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),fr("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import{useQuery as fb}from"@tanstack/react-query";import{useMemo as zp}from"react";var mb="wp:reward-pools";function _o(e,t=!0){let{data:r,...n}=fb({queryKey:[mb,e],queryFn:async({signal:a})=>{let s=await Ae("gameReward",e),l=await fetch(`${s}/v1/pools`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch pools: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Pools API error: ${d.code}`);return d},enabled:t,staleTime:0}),o=zp(()=>r?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[r]),i=zp(()=>r?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[r]);return{crossPools:o,gamePools:i,allPools:r?.data.pools??[],...n}}import{useQuery as gb}from"@tanstack/react-query";import{useMemo as hb}from"react";var bb="wp:user-deposits";function Qa(e,t,r=!0){let n=r&&!!t,{data:o,...i}=gb({queryKey:[bb,e,t],queryFn:async({signal:s})=>{let l=await Ae("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 c=await d.json();if(c.code!==200)throw new Error(`Deposits API error: ${c.code}`);return c},enabled:n,staleTime:0});return{depositMap:hb(()=>{let s=new Map;if(!o?.data.user_deposits)return s;for(let l of o.data.user_deposits)s.set(l.pool_address.toLowerCase(),l);return s},[o]),deposits:o?.data.user_deposits??[],...i}}import{useQuery as wb}from"@tanstack/react-query";import{useMemo as yb}from"react";var Fp={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Up={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var jp={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var Ml={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},Wp={dev:`${Ml.dev}/portfolio`,stage:`${Ml.stage}/portfolio`,production:`${Ml.production}/portfolio`};var Gp={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Wr={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"},Va={dev:"https://stg-swap-api.crossdefi.io",stage:"https://stg-swap-api.crossdefi.io",production:"https://swap-api.crossdefi.io"},Hp={dev:"https://stg.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://www.crossdefi.io"},_p={dev:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",stage:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",production:"0xEFd871aF7D695A0c1709e46b565761F4cd1Ef5ba"},Qp={dev:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",stage:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",production:"0x731a104a4461ae45bfef520468b43c262d35e682"};var xb="wp:token-info",vb="0x0000000000000000000000000000000000000001";function yn(e,t=!0){let r=bt[e].cross,{data:n,...o}=wb({queryKey:[xb,e],queryFn:async({signal:c})=>{let h=await Ae("walletServer",e),u=await fetch(`${h}/v1/public/token/info`,{cache:"no-store",signal:c});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:i,byChainSym:a}=yb(()=>{let c=new Map,h=new Map;if(!n?.data)return{byChainAddr:c,byChainSym:h};for(let u of n.data){let m=u.address.toLowerCase();c.set(`${u.chain_id}:${m}`,u),c.set(m,u);let y=u.symbol.replace(/^t/,"").toUpperCase(),b=`${u.chain_id}:${y}`;h.has(b)||h.set(b,u),h.has(y)||h.set(y,u)}return{byChainAddr:c,byChainSym:h}},[n]);return{getTokenImage:(c,h,u)=>{let m=c.toLowerCase(),y=!!u?.chainOnly,b=i.get(`${r}:${m}`);if(b?.image)return b.image;if(!y){let f=i.get(m);if(f?.image)return f.image}if(h){let f=h.replace(/^t/,"").toUpperCase(),p=a.get(`${r}:${f}`);if(p?.image)return p.image;if(!y){let w=a.get(f);if(w?.image)return w.image}}return""},getTokenSymbol:(c,h,u)=>{let m=c.toLowerCase();return(i.get(`${r}:${m}`)??(u?.chainOnly?void 0:i.get(m)))?.symbol||h},getNativeToken:()=>i.get(`${r}:${vb}`),...o}}import*as Dl from"react";import{jsx as Ll,jsxs as Vp}from"react/jsx-runtime";function Gr({sectionKey:e,title:t,icon:r,iconFit:n="cover",isEmpty:o,loading:i=!1,children:a}){let s=Dp();return Dl.useEffect(()=>{s?.report(e,{loading:i,empty:o})},[s,e,i,o]),Dl.useEffect(()=>()=>s?.unregister(e),[s,e]),o?null:Vp("div",{className:"wp-svc-card",children:[Vp("div",{className:"wp-svc-card-head",children:[Ll("img",{className:"wp-svc-card-icon",src:r,alt:"",style:{objectFit:n}}),Ll("span",{className:"wp-svc-card-title",children:t})]}),Ll("div",{className:"wp-svc-items",children:a})]})}import Pl from"bignumber.js";import{jsx as or,jsxs as mr}from"react/jsx-runtime";var kb="ONErewards";function Rb(e){return new Pl(e||"0").isGreaterThan(0)}function qp(){let{env:e,walletAddress:t,onOutlink:r}=kt(),n=jr(),o=!!t,{allPools:i,isLoading:a}=_o(e,o),{depositMap:s,isLoading:l}=Qa(e,t,o),{getTokenImage:d}=yn(e,o),c=(m,y)=>`${Fp[e]}/gametoken/tokens/${m.deposit_token.address}?mode=rewards${y==="withdraw"?"&trade=withdraw":""}`,h=`${Wr[e]}/reward.png`,u=i.filter(m=>{let y=s.get(m.pool_address.toLowerCase()),b=y?.deposited_amount??"0",f=y?.claimable_reward??"0";return!(new Pl(b).isZero()&&new Pl(f).isZero())});return or(Gr,{sectionKey:"rewards",title:kb,icon:h,isEmpty:u.length===0,loading:a||l,children:u.map(m=>{let y=s.get(m.pool_address.toLowerCase()),b=y?.deposited_amount??"0",f=y?.claimable_reward??"0",p=c(m,"withdraw"),w=c(m,"claim"),g=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),I=R.length>0?`${m.deposit_token.symbol}-${R.join("/")}`:m.deposit_token.symbol,C=x?wn(f,x.decimals):"0",S=x?.symbol??"Reward",E=Gn(b,m.deposit_token.decimals,m.deposit_token.price,n),M=x?Gn(f,x.decimals,x.price,n):null,B=!!y&&Rb(f);return mr("article",{className:"wp-item","data-side":"reward",children:[mr("div",{className:"wp-item-body",children:[mr("div",{className:"wp-item-line",children:[or("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),mr("div",{className:"wp-svc-token",children:[mr("span",{className:"wp-token-stack","aria-hidden":!0,children:[g&&or("img",{className:"wp-svc-token-icon",src:g,alt:""}),k&&or("img",{className:"wp-svc-token-icon",src:k,alt:""})]}),or("span",{children:I})]})]}),mr("div",{className:"wp-item-line",children:[or("span",{className:"wp-item-label",children:"Deposited"}),mr("div",{className:"wp-svc-token wp-svc-token--amount",children:[g&&or("img",{className:"wp-svc-token-icon",src:g,alt:""}),mr("div",{className:"wp-svc-amount",children:[or("span",{className:"wp-svc-amount-main",children:wn(b,m.deposit_token.decimals)}),E&&or("span",{className:"wp-item-usd",children:E})]})]})]}),mr("div",{className:"wp-item-line",children:[mr("span",{className:"wp-item-label",children:["Claimable (",S,")"]}),mr("div",{className:"wp-svc-token wp-svc-token--amount",children:[k&&or("img",{className:"wp-svc-token-icon",src:k,alt:""}),mr("div",{className:"wp-svc-amount",children:[or("span",{className:"wp-svc-amount-main",children:C}),M&&or("span",{className:"wp-item-usd",children:M})]})]})]})]}),mr("div",{className:"wp-item-tags",children:[mr("a",{className:"wp-tag wp-tag--muted",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"rewards_withdraw_open",onClick:L=>Ft(L,p,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:y}},r),children:[or("span",{className:"wp-tag-label",children:"Withdraw"}),or(Mr,{size:12,className:"wp-tag-icon"})]}),mr("a",{className:"wp-tag wp-tag--mint","data-disabled":!B||void 0,"aria-disabled":!B||void 0,href:B?w:void 0,target:B?"_blank":void 0,rel:B?"noopener noreferrer":void 0,onClick:L=>{if(!B){L.preventDefault();return}Ft(L,w,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:y}},r)},children:[or("span",{className:"wp-tag-label",children:"Claim"}),or(Mr,{size:12,className:"wp-tag-icon"})]})]})]},m.pool_address)})})}import*as ru from"react";import{useQuery as Mb}from"@tanstack/react-query";import{useMemo as qa}from"react";var Cb="0x70a08231",Sb="0x18160ddd",Nb="0x313ce567",Tb=8e3;async function Ib(e,t,r,n){let o=new AbortController,i=setTimeout(()=>o.abort(),Tb);n&&n.addEventListener("abort",()=>o.abort(),{once:!0});let a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:r}),signal:o.signal}).finally(()=>clearTimeout(i));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let s=await a.json();if(s.error)throw new Error(`RPC ${t}: ${s.error.message}`);if(s.result===void 0)throw new Error(`RPC ${t}: empty result`);return s.result}function Eb(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function vi(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function Tn(e,t,r,n,o){try{return await Ib(e,"eth_call",[o?{from:o,to:t,data:r}:{to:t,data:r},"latest"],n)}catch{return}}async function Ab(e,t,r,n){let[o,i,a]=await Promise.all([Tn(e,r,Cb+Eb(t),n),Tn(e,r,Sb,n),Tn(e,r,Nb,n)]),s=vi(o);if(s===void 0)return null;let l=vi(a);return{balance:s,totalSupply:vi(i),decimals:l!==void 0?Number(l):void 0}}async function ki(e,t){let r=bt[e].cross,n=await Ae("walletServer",e),o=await fetch(`${n}/v1/public/chain/info/${r}`,{cache:"no-store",signal:t});if(!o.ok)return;let i=await o.json();return("data"in i&&i.data!==void 0?Array.isArray(i.data)?i.data[0]:i.data:i)?.rpc||void 0}async function Yp(e,t,r,n){if(!t||r.length===0)return{};let o;try{o=await ki(e,n)}catch{o=void 0}if(!o)return{};let i=await Promise.all(r.map(async s=>[s.toLowerCase(),await Ab(o,t,s,n)])),a={};for(let[s,l]of i)l&&(a[s]=l);return a}var Lb="wp:withdraw-token-meta",Db="0xc89039c5",Pb="0x95d89b41",Ob="0x313ce567";function Bb(e){if(!(!e||e==="0x"))try{let t=e.replace(/^0x/,""),r=Number(BigInt("0x"+t.slice(64,128)));if(!Number.isFinite(r)||r<=0||r>64)return;let n=t.slice(128,128+r*2),o="";for(let i=0;i<n.length;i+=2)o+=String.fromCharCode(parseInt(n.slice(i,i+2),16));return o||void 0}catch{return}}function zb(e){if(!e||e==="0x")return;let r="0x"+e.replace(/^0x/,"").padStart(64,"0").slice(24,64);return/^0x[a-f0-9]{40}$/.test(r)&&r!=="0x0000000000000000000000000000000000000000"?r:void 0}async function Fb(e,t,r){if(t.length===0)return{};let n;try{n=await ki(e,r)}catch{n=void 0}if(!n)return{};let o=await Promise.all(t.map(async a=>{let s=zb(await Tn(n,a,Db,r));if(!s)return[a.toLowerCase(),null];let[l,d]=await Promise.all([Tn(n,s,Pb,r),Tn(n,s,Ob,r)]),c=Bb(l),h=vi(d);return c?[a.toLowerCase(),{tokenAddress:s,symbol:c,decimals:h!==void 0?Number(h):18}]:[a.toLowerCase(),null]})),i={};for(let[a,s]of o)s&&(i[a]=s);return i}function Kp(e,t,r=!0){let o=r&&!!t,{allPools:i,isLoading:a}=_o(e,o),{deposits:s,isLoading:l}=Qa(e,t,o),d=qa(()=>{let f=new Map;for(let p of i)f.set(p.pool_address.toLowerCase(),p);return f},[i]),c=qa(()=>s.filter(f=>{try{return BigInt(f.deposited_amount||"0")>0n}catch{return!1}}),[s]),h=qa(()=>c.map(f=>f.pool_address.toLowerCase()).filter(f=>!d.has(f)).sort(),[c,d]),{data:u,isLoading:m}=Mb({queryKey:[Lb,e,h],queryFn:({signal:f})=>Fb(e,h,f),enabled:o&&h.length>0,staleTime:1440*60*1e3});return{positions:qa(()=>{let f=[];for(let p of c){let w=p.pool_address.toLowerCase(),g=d.get(w);if(g){f.push({poolId:p.pool_id,poolAddress:p.pool_address,poolType:g.pool_type,tokenSymbol:g.deposit_token.symbol,tokenAddress:g.deposit_token.address,decimals:g.deposit_token.decimals,price:g.deposit_token.price,depositedRaw:p.deposited_amount});continue}let x=u?.[w];x&&f.push({poolId:p.pool_id,poolAddress:p.pool_address,poolType:"Unknown",tokenSymbol:x.symbol,tokenAddress:x.tokenAddress,decimals:x.decimals,depositedRaw:p.deposited_amount})}return f},[c,d,u]),isLoading:a||l||m}}import*as Kt from"react";import{Fragment as Zp,jsx as Le,jsxs as Et}from"react/jsx-runtime";var Ub=400;function jb(e,t,r){if(t==="loading")return"Estimating...";if(!e||t==="error"||t==="unavailable")return"Wallet estimate";let n=e.maxFeePerGas??e.gasPrice;return!n||n<=0n||e.gasLimit<=0n?"Wallet estimate":`${ja(e.gasLimit*n)} ${r??""}`.trim()}function Ol(e,t,r){return r==="loading"?"Estimating...":r==="error"||r==="unavailable"?"-":`${e} ${t}`.trim()}function Wb({position:e,size:t}){return e.icon?Le("img",{src:e.icon,alt:"",width:t,height:t}):Le("span",{children:e.tokenSymbol.slice(0,1)})}function Xp({open:e,status:t,positions:r,initialPoolAddress:n,walletAddress:o,txHash:i,error:a,copied:s=!1,estimateWithdraw:l,onClose:d,onConfirm:c,onCopyHash:h,trackFunnel:u,nativeSymbol:m}){let[y,b]=Kt.useState(null),[f,p]=Kt.useState("idle"),w=Kt.useRef(0),g=Kt.useRef(void 0),x=Kt.useRef(null);Kt.useEffect(()=>()=>clearTimeout(g.current),[]);let k=Kt.useMemo(()=>{let z=n?.toLowerCase();return r.find(A=>A.poolAddress.toLowerCase()===z)??r[0]??null},[r,n]),R=Kt.useMemo(()=>{try{return BigInt(k?.depositedRaw??"0")}catch{return 0n}},[k?.depositedRaw]),I=k?.decimals??18;Kt.useEffect(()=>{!e||!k||u?.("position_selected")},[e,k,u]);let C=Kt.useCallback(()=>{b(null),p(l?"idle":"unavailable"),w.current+=1,x.current=null},[]);if(Kt.useEffect(()=>{e&&C()},[e,C]),Kt.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(g.current);return}if(!l||!k){clearTimeout(g.current),p("unavailable");return}if(R<=0n){clearTimeout(g.current),w.current+=1,x.current=null,b(null),p("idle");return}let z=`${k.poolAddress.toLowerCase()}:${R.toString()}`;if(x.current===z)return;x.current=z,clearTimeout(g.current);let A=w.current+1;w.current=A,p("loading"),g.current=setTimeout(()=>{l(k,R).then(U=>{w.current===A&&(b(U??null),p(U?"ready":"unavailable"))}).catch(()=>{w.current===A&&(b(null),p("error"))})},Ub)},[e,t,R,l,k]),!e||!k)return null;let S=t==="submitting",E=Ho(y?.maxPriorityFeePerGas),M=Ho(y?.maxFeePerGas??y?.gasPrice),B=Ua(y?.gasLimit),L=wn(k.depositedRaw,I);return Le("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:z=>{z.target===z.currentTarget&&!S&&d()},children:Et("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:[Le("div",{className:"wp-claim-grabber","aria-hidden":!0,children:Le("span",{})}),Et("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?Et(Zp,{children:[Le("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:Le(Ha,{})}),Et("div",{className:"wp-claim-copy",children:[Le("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),Le("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),Le("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:Et("div",{className:"wp-claim-list-item",children:[Le("span",{children:"Tx Hash"}),Et("button",{type:"button",className:"wp-claim-hash",onClick:h,"aria-label":"Copy transaction hash","data-track":"withdraw_hash_copy",children:[Le("strong",{children:Fa(i)}),s?Le(Ga,{}):Le(Wa,{})]})]})})]}):Et(Zp,{children:[t==="error"&&Et("div",{className:"wp-claim-heading",children:[Le("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),Le("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),Et("div",{className:"wp-claim-reward-card","data-fit":bi(k.tokenSymbol,L),"aria-label":"Deposited balance",children:[Le("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:Le(Wb,{position:k,size:28})}),Le("strong",{className:"wp-claim-reward-symbol",children:k.tokenSymbol}),Le("strong",{className:"wp-claim-reward-amount",children:L})]}),Et("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[Et("div",{className:"wp-claim-account-row",children:[Et("div",{className:"wp-claim-account",children:[Le("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),Et("strong",{children:[k.tokenSymbol," Pool"]})]}),Le("span",{children:za(o)})]}),Le("span",{className:"wp-claim-divider","aria-hidden":!0}),Et("div",{className:"wp-claim-detail-list",children:[Et("div",{className:"wp-claim-detail-row",children:[Le("span",{children:"Est. Tx Fee"}),Le("strong",{children:jb(y,f,m)})]}),Et("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Le("span",{children:"Priority Fee Per Gas"}),Le("strong",{children:Ol(E,"Gwei",f)})]}),Et("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Le("span",{children:"Max Fee Per Gas"}),Le("strong",{children:Ol(M,"Gwei",f)})]}),Et("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Le("span",{children:"Gas Limit"}),Le("strong",{children:Ol(B,"",f)})]})]})]})]}),Et("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&Le("button",{type:"button",className:"wp-claim-secondary","data-track":"withdraw_cancel",onClick:d,children:t==="error"?"Close":"Cancel"}),Et("button",{type:"button",className:"wp-claim-primary","data-track":"withdraw_confirm",onClick:()=>{if(t==="success"){d();return}k&&R>0n&&c(k,R,y)},disabled:S||(t==="confirm"||t==="error")&&R<=0n,children:[t==="success"&&"Done",t==="submitting"&&Le("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),Le("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:Le("span",{})})]})})}import*as Rt from"react";import{useQueryClient as _b}from"@tanstack/react-query";import{useQuery as Gb}from"@tanstack/react-query";var Hb="wp:reward-factory-info";function Jp(e,t=!0){let{data:r,...n}=Gb({queryKey:[Hb,e],queryFn:async({signal:o})=>{let i=await Ae("gameReward",e),a=await fetch(`${i}/v1/factory/info`,{cache:"no-store",signal:o});if(!a.ok)throw new Error(`Factory info fetch failed: ${a.status}`);let s=await a.json();if(s.code!==200)throw new Error(`Factory info API error: ${s.code}`);return s},enabled:t,staleTime:0});return{factoryInfo:r?.data??null,routerAddress:r?.data.router_address??"",...n}}var $p="wp:";function Hn(e){return e.invalidateQueries({predicate:t=>typeof t.queryKey[0]=="string"&&t.queryKey[0].startsWith("wp:")})}function eu(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function tu(e){let{env:t,walletAddress:r,sendTransaction:n,estimateGas:o}=kt(),i=!!r,a=!!n,s=_b(),{routerAddress:l}=Jp(t,i&&a),d=eu(l),[c,h]=Rt.useState(!1),[u,m]=Rt.useState(void 0),[y,b]=Rt.useState("confirm"),[f,p]=Rt.useState(),[w,g]=Rt.useState(""),[x,k]=Rt.useState(!1),R=Rt.useRef(void 0);Rt.useEffect(()=>()=>clearTimeout(R.current),[]);let I=Rt.useRef(new Set),C=Rt.useCallback((U,oe)=>{I.current.has(U)||(I.current.add(U),Qe("withdraw",U,{...oe,tags:{section:e,...oe?.tags}}))},[e]),S=Rt.useCallback((U,oe)=>d?{to:d,value:0n,data:Ap(U,oe),chainId:bt[t].cross}:null,[t,d]),E=Rt.useCallback(()=>{Hn(s)},[s]),M=Rt.useCallback(U=>{m(U),h(!0),b("confirm"),p(void 0),g(""),k(!1),I.current=new Set,C("opened")},[C]),B=Rt.useCallback(()=>{y!=="submitting"&&(h(!1),m(void 0),b("confirm"),p(void 0),g(""),k(!1),y==="success"&&E())},[y,E]),L=Rt.useCallback(async(U,oe)=>{if(!o)return null;let Y=S(U.poolId,oe),G=eu(r);return!Y||!G?null:o({...Y,from:G})},[S,o,r]),z=Rt.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]),A=Rt.useCallback(async(U,oe,Y)=>{if(!n){b("error"),g("Withdraw is not available for this wallet.");return}if(!d){b("error"),g("Withdraw contract address is not available.");return}try{b("submitting"),g("");let G=S(U.poolId,oe);if(!G){b("error"),g("Withdraw contract address is not available.");return}C("submitted");let H=await n({...G,gas:Y?.gasLimit&&Y.gasLimit>0n?Y.gasLimit:void 0,maxFeePerGas:Y?.maxFeePerGas&&Y.maxFeePerGas>0n?Y.maxFeePerGas:void 0,maxPriorityFeePerGas:Y?.maxPriorityFeePerGas&&Y.maxPriorityFeePerGas>0n?Y.maxPriorityFeePerGas:void 0});p(H),b("success"),C("confirmed"),E()}catch(G){b("error"),g(wi(G,"Failed to request withdraw.")),C("confirmed",{status:"failure",reason:Ir(G)})}},[S,E,d,n,C]);return{canWithdrawInline:a,isOpen:c,initialPoolAddress:u,status:y,txHash:f,error:w,copied:x,hasEstimator:!!o,openWithdraw:M,closeWithdraw:B,estimateWithdraw:L,confirmWithdraw:A,copyHash:z,trackFunnelOnce:C}}import{Fragment as Vb,jsx as vr,jsxs as In}from"react/jsx-runtime";var Qb="ONEpoints";function nu(){let{env:e,walletAddress:t,onOutlink:r}=kt(),n=jr(),o=!!t,{getTokenImage:i,getNativeToken:a}=yn(e,o),s=tu("points"),{positions:l,isLoading:d}=Kp(e,t,o),c=ru.useMemo(()=>l.filter(Ep).map(m=>({...m,icon:i(m.tokenAddress,m.tokenSymbol)})),[l,i]),h=`${Wr[e]}/point.png`,u=Up[e];return In(Vb,{children:[vr(Gr,{sectionKey:"points",title:Qb,icon:h,isEmpty:c.length===0,loading:d,children:c.map(m=>{let y=m.price?Gn(m.depositedRaw,m.decimals,m.price,n):null;return In("article",{className:"wp-item","data-side":"reward",children:[In("div",{className:"wp-item-body",children:[In("div",{className:"wp-item-line",children:[vr("span",{className:"wp-item-label",children:"Token"}),In("div",{className:"wp-svc-token",children:[m.icon&&vr("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),vr("span",{children:m.tokenSymbol})]})]}),In("div",{className:"wp-item-line",children:[vr("span",{className:"wp-item-label",children:"Deposited"}),In("div",{className:"wp-svc-token wp-svc-token--amount",children:[m.icon&&vr("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),In("div",{className:"wp-svc-amount",children:[vr("span",{className:"wp-svc-amount-main",children:wn(m.depositedRaw,m.decimals)}),y&&vr("span",{className:"wp-item-usd",children:y})]})]})]})]}),vr("div",{className:"wp-item-tags",children:s.canWithdrawInline?vr("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"points_withdraw_open",onClick:()=>s.openWithdraw(m.poolAddress),children:vr("span",{className:"wp-tag-label",children:"Withdraw"})}):In("a",{className:"wp-tag wp-tag--muted",href:u,target:"_blank",rel:"noopener noreferrer","data-track":"points_withdraw_open",onClick:b=>Ft(b,u,{category:"portfolio",origin:"portfolio-points",payload:{position:m}},r),children:[vr("span",{className:"wp-tag-label",children:"Withdraw"}),vr(Mr,{size:12,className:"wp-tag-icon"})]})})]},m.poolAddress)})}),vr(Xp,{open:s.isOpen,status:s.status,positions:c,initialPoolAddress:s.initialPoolAddress,walletAddress:t,txHash:s.txHash,error:s.error,copied:s.copied,estimateWithdraw:s.hasEstimator?s.estimateWithdraw:void 0,onClose:s.closeWithdraw,onConfirm:s.confirmWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce,nativeSymbol:a()?.symbol})]})}import*as Bl from"react";import{useQuery as qb}from"@tanstack/react-query";var Yb="wp:stake-info";function ou(e,t,r=!0){let n=r&&!!t,{data:o,...i}=qb({queryKey:[Yb,e,t],queryFn:async({signal:s})=>{let l=await Ae("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 c=await d.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake info API error: ${c.code}`);return c},enabled:n,staleTime:0});return{stakeInfo:o?.data,...i}}import{useQuery as Kb}from"@tanstack/react-query";var Zb="wp:stake-rewards",Xb=31;function iu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=Kb({queryKey:[Zb,e,t],queryFn:async({signal:a})=>{let s=await Ae("posa",e),l=await fetch(`${s}/rewards/${t}?limit=${Xb}`,{cache:"no-store",signal:a});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:n,staleTime:0});return{latestReward:o?.[0]??null,aprAccrued:Ip(o),...i}}import{useQuery as Jb}from"@tanstack/react-query";var $b="wp:staking-onchain";function au(e,t,r=!0){let n=r&&!!t&&!!e,{data:o,...i}=Jb({queryKey:[$b,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:n,staleTime:0});return{onchain:o,...i}}import{useMemo as su}from"react";import ew from"bignumber.js";function lu(e){return e?.trim().toUpperCase()==="ONE"}function du(e){return new ew(e||"0").isGreaterThan(0)}function Ya(e,t,r=!0){let{allPools:n}=_o(e,r),o=su(()=>{for(let d of n)for(let c of[d.deposit_token,...d.reward_tokens])if(lu(c?.symbol)&&du(c.price))return c.price},[n]),i=r&&o===void 0,{tokens:a}=jn(e,t,i),{statsMap:s}=Wn(e,i),l=bt[e].cross;return su(()=>{if(o)return o;let d=a.find(c=>c.chainId===l&&lu(c.symbol));if(d){let c=s.get(Fr(d.chainId,d.address));if(c&&du(c.price))return c.price}return"0"},[o,a,s,l])}import Qn from"bignumber.js";import{jsx as Hr,jsxs as _n}from"react/jsx-runtime";function tw(e){if(!e)return"\u2014";let t=new Qn(e);return t.isFinite()?`${t.toFormat(2,Qn.ROUND_DOWN)}%`:"\u2014"}function cu(){let{env:e,walletAddress:t,onOutlink:r,stakingRewardsReader:n}=kt(),o=jr(),i=!!t,{stakeInfo:a,isLoading:s}=ou(e,t,i),{latestReward:l,aprAccrued:d,isLoading:c}=iu(e,t,i),{onchain:h}=au(t,n,i),u=Ya(e,t,i),{getNativeToken:m}=yn(e,i),y=m()?.symbol,b="ONEstaking",f=`${Wr[e]}/cross-staking.png`,p=Wp[e],w=a?.total_stake??"0",g=Bl.useMemo(()=>h?new Qn(h.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??a?.rewards_earned??"0",[h,l,a]),x=Bl.useMemo(()=>h?new Qn(h.stakedWei.toString()).shiftedBy(-18):new Qn(w),[h,w]),k=d!==void 0?new Qn(d):void 0,R=a?.days_since_first_stake,I=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 Qn(w).isZero()&&new Qn(g).isZero()),S=Gn(w,0,u,o),E=Gn(g,0,u,o);return Hr(Gr,{sectionKey:"staking",title:b,icon:f,iconFit:"contain",isEmpty:!C,loading:s||c,children:_n("article",{className:"wp-item","data-side":"stake",children:[_n("div",{className:"wp-item-body",children:[_n("div",{className:"wp-item-line",children:[Hr("span",{className:"wp-item-label",children:"Staked"}),_n("div",{className:"wp-svc-amount",children:[Hr("span",{className:"wp-svc-amount-main",children:`${El(w)} ${y??""}`.trim()}),S&&Hr("span",{className:"wp-item-usd",children:S})]})]}),_n("div",{className:"wp-item-line",children:[Hr("span",{className:"wp-item-label",children:"Rewards Earned"}),_n("div",{className:"wp-svc-amount",children:[Hr("span",{className:"wp-svc-amount-main",children:`${El(g)} ${y??""}`.trim()}),E&&Hr("span",{className:"wp-item-usd",children:E})]})]}),_n("div",{className:"wp-item-line",children:[Hr("span",{className:"wp-item-label",children:"My APR"}),Hr("span",{children:tw(I?.toString(10))})]})]}),Hr("div",{className:"wp-item-tags",children:_n("a",{className:"wp-tag wp-tag--mint",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"stake_outlink",onClick:M=>Ft(M,p,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a}},r),children:[Hr("span",{className:"wp-tag-label",children:"Manage"}),Hr(Mr,{size:12,className:"wp-tag-icon"})]})})]})})}import*as zl from"react";import{useQuery as rw}from"@tanstack/react-query";var nw="wp:game-swap-pools";function pu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=rw({queryKey:[nw,e,t],queryFn:async({signal:a})=>{let s=await Ae("gameSwap",e),l=await fetch(`${s}/addresses/${t}/portfolio`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Game-swap portfolio fetch failed: ${l.status}`);return(await l.json()).pools??[]},enabled:n,staleTime:0});return{pools:o??[],...i}}import{useQuery as ow}from"@tanstack/react-query";var iw="wp:game-swap-lp-balances";function uu(e,t,r,n){let o=[...r].map(l=>l.toLowerCase()).sort(),i=!!t&&o.length>0,{data:a,...s}=ow({queryKey:[iw,e,t,o,!!n],queryFn:async({signal:l})=>{let d=n?await n(o):await Yp(e,t,o,l),c={};for(let[h,u]of Object.entries(d))c[h.toLowerCase()]=u;return c},enabled:i,staleTime:0});return{balances:a??{},...s}}import En from"bignumber.js";import{jsx as _r,jsxs as sn}from"react/jsx-runtime";var aw="Gametoken LP",mu=18,sw=new En("0.0001");function fu(e){return e?.trim().toUpperCase()==="ONE"}function lw(e){return e&&e>0?e:mu}function dw(e){let t=fu(e.token_a?.symbol)&&!fu(e.token_b?.symbol),r=t?e.reserve_a:e.reserve_b,n=lw(t?e.token_a?.decimals:e.token_b?.decimals),o=new En(r||"0").shiftedBy(-n);return!o.isFinite()||o.isLessThanOrEqualTo(0)?new En(0):o.times(2)}function cw(e,t,r,n){let o=e.token_a?.symbol?.trim()||"TOKEN",i=e.token_b?.symbol?.trim()||n||"?",a=t?.decimals??mu,s,l;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let d=new En(t.balance.toString()),c=new En(t.totalSupply.toString()),h=d.div(c);s=h.times(100);let u=h.times(dw(e));if(u.isGreaterThan(0)){let m=new En(e.quote_usd??e.cross_usd??"0");l=m.isGreaterThan(0)?yo(u.times(m),r):`${u.toFormat(4,En.ROUND_DOWN)} ${n??""}`.trim()}}return{pool:e,tokenASymbol:o,tokenBSymbol:i,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:a,sharePercent:s,valueText:l}}function gu(){let{env:e,walletAddress:t,onOutlink:r,lpBalanceReader:n}=kt(),o=jr(),i=!!t,{pools:a,isLoading:s}=pu(e,t,i),l=zl.useMemo(()=>a.map(p=>p.pair_address).filter(Boolean),[a]),{balances:d,isLoading:c}=uu(e,t,l,n),{getNativeToken:h}=yn(e,i),u=h()?.symbol,m=`${Wr[e]}/game-token.png`,y=Object.keys(d).length>0,b=zl.useMemo(()=>{let p=a.map(w=>cw(w,d[w.pair_address?.toLowerCase()],o,u));return y?p.filter(w=>w.lpAmountRaw?new En(w.lpAmountRaw).shiftedBy(-w.lpDecimals).isGreaterThanOrEqualTo(sw):!1):p},[a,d,y,o,u]),f=p=>{let w=p.token_a?.address??p.pair_address;return`${Gp[e]}/gametoken/tokens/${w}?trade=deposit`};return _r(Gr,{sectionKey:"gameSwap",title:aw,icon:m,iconFit:"contain",isEmpty:b.length===0,loading:s||c,children:b.map(p=>{let{pool:w}=p,g=f(w),x=`${p.tokenASymbol} / ${p.tokenBSymbol}`,k=w.token_a?.logo_url,R=w.token_b?.logo_url;return sn("article",{className:"wp-item","data-side":"game-swap",children:[sn("div",{className:"wp-item-body",children:[sn("div",{className:"wp-item-line",children:[_r("span",{className:"wp-item-label",children:"Pool"}),sn("div",{className:"wp-svc-token",children:[sn("span",{className:"wp-token-stack","aria-hidden":!0,children:[k&&_r("img",{className:"wp-svc-token-icon",src:k,alt:""}),R&&_r("img",{className:"wp-svc-token-icon",src:R,alt:""})]}),_r("span",{children:x})]})]}),p.lpAmountRaw!==void 0&&sn("div",{className:"wp-item-line",children:[_r("span",{className:"wp-item-label",children:"My LP"}),sn("span",{children:[wn(p.lpAmountRaw,p.lpDecimals)," LP"]})]}),p.sharePercent!==void 0&&sn("div",{className:"wp-item-line",children:[_r("span",{className:"wp-item-label",children:"Pool Share"}),sn("span",{children:[p.sharePercent.toFormat(2,En.ROUND_DOWN),"%"]})]}),p.valueText!==void 0&&sn("div",{className:"wp-item-line",children:[_r("span",{className:"wp-item-label",children:"Value"}),_r("span",{children:p.valueText})]})]}),_r("div",{className:"wp-item-tags",children:sn("a",{className:"wp-tag wp-tag--mint",href:g,target:"_blank",rel:"noopener noreferrer","data-track":"gameswap_outlink","data-track-id":x,onClick:I=>Ft(I,g,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:w}},r),children:[_r("span",{className:"wp-tag-label",children:"Manage"}),_r(Mr,{size:12,className:"wp-tag-icon"})]})})]},w.pair_address)})})}import xo from"bignumber.js";import{useMemo as bw}from"react";import{useQuery as pw}from"@tanstack/react-query";var uw="wp:forge-pools";function hu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=pw({queryKey:[uw,e,t],queryFn:async()=>{let s=await Ae("bondingCurve",e),l=await fetch(`${s}/v1/users/${t}/pools`,{cache:"no-store"});if(!l.ok)throw new Error(`forge pools fetch failed: ${l.status}`);return(await l.json()).data?.items??[]},enabled:n,staleTime:0}),a=o??[];return{pools:a,isEmpty:a.length===0,...i}}import{useQueries as fw}from"@tanstack/react-query";import{useMemo as mw}from"react";var gw="wp:forge-token-detail";async function hw(e,t){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return r.ok?(await r.json())?.data?.token??null:null}function bu(e,t,r=!0){let n=fw({queries:t.map(a=>({queryKey:[gw,e,a],queryFn:async()=>hw(await Ae("bondingCurve",e),a),enabled:r&&!!a,staleTime:3e4}))}),o=mw(()=>{let a=new Map;for(let s=0;s<n.length;s++){let l=n[s]?.data,d=t[s];l&&d&&a.set(d.toLowerCase(),l)}return a},[n,t]),i=n.some(a=>a.isLoading);return{detailMap:o,isLoading:i}}import{jsx as kr,jsxs as Vn}from"react/jsx-runtime";var ww="ONEforge",wu=18,yw="https://contents.crosstoken.io/wallet/token/images/FT.png";function xw(e){if(!e||e==="0")return"0";let t=new xo(e).shiftedBy(-wu);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,xo.ROUND_DOWN):t.toFormat(4,xo.ROUND_DOWN)}function vw(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 kw(e,t,r,n){let o=new xo(r||"0");if(!o.isGreaterThan(0))return null;let i=new xo(e.total_supply||"0"),a=new xo(e.lp_balance||"0"),s=new xo(t?.reserve_b||"0").shiftedBy(-wu);if(!i.isGreaterThan(0)||!a.isGreaterThan(0)||!s.isGreaterThan(0))return null;let l=s.times(2),c=a.div(i).times(l).times(o);return c.isFinite()?yo(c,n):null}function yu(){let{env:e,walletAddress:t,onOutlink:r}=kt(),n=jr(),o=!!t,{pools:i,isEmpty:a,isLoading:s}=hu(e,t,o),l=bw(()=>i.map(m=>m.token.address),[i]),{detailMap:d}=bu(e,l,o&&l.length>0),c=Ya(e,t,o),h=m=>`${jp[e]}/forge/token/${m.token.address}`,u=`${Wr[e]}/forge.png`;return kr(Gr,{sectionKey:"forge",title:ww,icon:u,iconFit:"contain",isEmpty:a,loading:s,children:i.map(m=>{let y=d.get(m.token.address.toLowerCase()),b=y?.image_url||y?.image||m.token.image||yw,f=y?.symbol||m.token.symbol,p=h(m),w=kw(m,y,c,n);return Vn("a",{className:"wp-item","data-side":"lp",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"forge_outlink","data-track-id":f,onClick:g=>Ft(g,p,{category:"portfolio",origin:"portfolio-forge",payload:{pool:m,tokenDetail:y}},r),children:[Vn("div",{className:"wp-item-body",children:[Vn("div",{className:"wp-item-line",children:[kr("span",{className:"wp-item-label",children:"Asset"}),Vn("div",{className:"wp-svc-token",children:[kr("img",{className:"wp-svc-token-icon",src:b,alt:""}),kr("span",{children:f}),y?.name&&kr("span",{className:"wp-token-subtle",children:y.name})]})]}),Vn("div",{className:"wp-item-line",children:[kr("span",{className:"wp-item-label",children:"LP Balance"}),kr("div",{className:"wp-svc-token wp-svc-token--amount",children:Vn("div",{className:"wp-svc-amount",children:[kr("span",{className:"wp-svc-amount-main",children:xw(m.lp_balance)}),w&&kr("span",{className:"wp-item-usd",children:w})]})})]}),Vn("div",{className:"wp-item-line",children:[kr("span",{className:"wp-item-label",children:"Ownership"}),kr("span",{className:"wp-line-value",children:vw(m.pool_ownership)})]})]}),kr("div",{className:"wp-item-tags",children:Vn("span",{className:"wp-tag wp-tag--muted",children:[kr("span",{className:"wp-tag-label",children:"Withdraw"}),kr(Mr,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}import{useMemo as Lu}from"react";import Vw from"bignumber.js";import{useQuery as Rw}from"@tanstack/react-query";var Cw="wp:crossd-positions";function Sw(e){let t=e??{};return(t.positions??t.data?.positions??[]).filter(n=>{if(!n?.token_id||!n.liquidity)return!1;try{return BigInt(n.liquidity)>0n}catch{return!1}})}function xu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=Rw({queryKey:[Cw,e,t],queryFn:async()=>{let s=await fetch(`${Va[e]}/api/v1/positions?owner=${t}`,{cache:"no-store"});if(!s.ok)throw new Error(`crossd positions fetch failed: ${s.status}`);return Sw(await s.json())},enabled:n,staleTime:0}),a=o??[];return{positions:a,isEmpty:a.length===0,...i}}import{useQueries as Nw}from"@tanstack/react-query";import{useMemo as Tw}from"react";var Iw="wp:crossd-position-details";function Ew(e){let t=e??{},r=t.data??t;return r?.token_id||r?.pool?r:null}function vu(e,t,r=!0){let n=Nw({queries:t.map(i=>({queryKey:[Iw,e,i],queryFn:async()=>{let a=await fetch(`${Va[e]}/api/v1/positions/${i}`,{cache:"no-store"});if(!a.ok)throw new Error(`crossd position detail failed: ${a.status}`);return Ew(await a.json())},enabled:r&&!!i,staleTime:6e4}))});return{detailMap:Tw(()=>{let i=new Map;return n.forEach((a,s)=>{let l=a.data,d=t[s];l&&d&&i.set(d,l)}),i},[n,t])}}import*as An from"react";import{Fragment as Ru,jsx as Ie,jsxs as Zt}from"react/jsx-runtime";var Aw=300*1e3,ku="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Mw(e,t,r){if(t)return"Estimating...";if(!e)return"Wallet estimate";let n=e.maxFeePerGas??e.gasPrice;return!n||n<=0n||e.gasLimit<=0n?"Wallet estimate":`${ja(e.gasLimit*n)} ${r??""}`.trim()}function Fl(e,t,r){return r?"Estimating...":`${e} ${t}`.trim()}function Cu({open:e,status:t,target:r,token0Icon:n,token1Icon:o,token0Symbol:i,token1Symbol:a,nativeSymbol:s,txHash:l,error:d,copied:c=!1,hasEstimator:h,prepareWithdraw:u,confirmWithdraw:m,onClose:y,onCopyHash:b,trackFunnel:f}){let[p,w]=An.useState(null),[g,x]=An.useState(null),k=An.useRef(0);An.useEffect(()=>{if(!e||!r)return;let _=++k.current;w(null),x(null),f?.("dialog_opened"),u().then(ce=>{k.current===_&&(w(ce),x(ce?Date.now():null))})},[e,r]);let R=t==="submitting",I=t==="estimating"||t==="confirm"&&!p,C=An.useCallback(async()=>{let _=p,ce=!g||Date.now()-g>Aw;if(!_||ce){let xe=++k.current;if(_=await u(),k.current!==xe)return;w(_),x(_?Date.now():null)}_&&await m(_)},[p,g,u,m]);if(!e||!r)return null;let{position:S,detail:E}=r,M=E.pool?.token0,B=E.pool?.token1,L=i||M?.symbol||S.pool?.token0_symbol||"?",z=a||B?.symbol||S.pool?.token1_symbol||"?",A=M?.decimals??18,U=B?.decimals??18,oe=n||M?.logo_url||ku,Y=o||B?.logo_url||ku,G=`${L}/${z}`,H=p?Wo(p.expectedAmount0.toString(),A):null,ie=p?Wo(p.expectedAmount1.toString(),U):null,re=Ho(p?.estimate?.maxPriorityFeePerGas),O=Ho(p?.estimate?.maxFeePerGas??p?.estimate?.gasPrice),Z=Ua(p?.estimate?.gasLimit);return Ie("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:_=>{_.target===_.currentTarget&&!R&&y()},children:Zt("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:[Ie("div",{className:"wp-claim-grabber","aria-hidden":!0,children:Ie("span",{})}),Zt("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&l?Zt(Ru,{children:[Ie("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:Ie(Ha,{})}),Zt("div",{className:"wp-claim-copy",children:[Ie("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),Zt("p",{className:"wp-claim-desc",children:["Your ",G," position withdrawal has been submitted. Balances will update shortly after the transaction settles."]})]}),Ie("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:Zt("div",{className:"wp-claim-list-item",children:[Ie("span",{children:"Tx Hash"}),Zt("button",{type:"button",className:"wp-claim-hash",onClick:b,"aria-label":"Copy transaction hash","data-track":"crossd_withdraw_hash_copy",children:[Ie("strong",{children:Fa(l)}),c?Ie(Ga,{}):Ie(Wa,{})]})]})})]}):Zt(Ru,{children:[t==="error"&&Zt("div",{className:"wp-claim-heading",children:[Ie("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),Ie("p",{className:"wp-claim-error-message",children:d||"The withdraw request could not be completed."})]}),Zt("div",{className:"wp-claim-reward-card","data-fit":bi(L,H??""),"aria-label":`Expected ${L}`,children:[Ie("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:Ie("img",{src:oe,alt:"",width:28,height:28})}),Ie("strong",{className:"wp-claim-reward-symbol",children:L}),Ie("strong",{className:"wp-claim-reward-amount",children:H??"Estimating..."})]}),Zt("div",{className:"wp-claim-reward-card","data-fit":bi(z,ie??""),"aria-label":`Expected ${z}`,children:[Ie("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:Ie("img",{src:Y,alt:"",width:28,height:28})}),Ie("strong",{className:"wp-claim-reward-symbol",children:z}),Ie("strong",{className:"wp-claim-reward-amount",children:ie??"Estimating..."})]}),h&&Ie("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:Zt("div",{className:"wp-claim-detail-list",children:[Zt("div",{className:"wp-claim-detail-row",children:[Ie("span",{children:"Est. Tx Fee"}),Ie("strong",{children:Mw(p?.estimate,I,s)})]}),Zt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ie("span",{children:"Priority Fee Per Gas"}),Ie("strong",{children:Fl(re,"Gwei",I)})]}),Zt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ie("span",{children:"Max Fee Per Gas"}),Ie("strong",{children:Fl(O,"Gwei",I)})]}),Zt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ie("span",{children:"Gas Limit"}),Ie("strong",{children:Fl(Z,"",I)})]})]})})]}),Zt("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&Ie("button",{type:"button",className:"wp-claim-secondary","data-track":"crossd_withdraw_cancel",onClick:y,children:t==="error"?"Close":"Cancel"}),Ie("button",{type:"button",className:"wp-claim-primary","data-track":"crossd_withdraw_confirm",onClick:()=>{if(t==="success"){y();return}R||I||(f?.("confirm_clicked"),C())},disabled:R||I,children:t==="success"?"Done":R?Ie("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}):I?Ie("span",{className:"wp-claim-button-spinner","aria-label":"Estimating"}):t==="error"?"Retry":"Withdraw"})]})]}),Ie("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:Ie("span",{})})]})})}import*as wt from"react";import{useQueryClient as Hw}from"@tanstack/react-query";var Lw="0x0c49ccbe",Dw="0xfc6f7865",Pw="0x49404b7c",Ow="0xdf2ab5bb",Bw="0xac9650d8",Su=(1n<<128n)-1n,Tu=600n,zw=99n,Fw=100n;function Ul(e){return e*zw/Fw}function Nu(e,t){return!!e&&!!t&&e.toLowerCase()===t.toLowerCase()}function Rr(e,t){if(e<0n)throw new Error(`${t} must be non-negative`);let r=e.toString(16);if(r.length>64)throw new Error(`${t} exceeds uint256`);return r.padStart(64,"0")}function Ka(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 jl(e){return Lw+Rr(e.tokenId,"tokenId")+Rr(e.liquidity,"liquidity")+Rr(e.amount0Min,"amount0Min")+Rr(e.amount1Min,"amount1Min")+Rr(e.deadline,"deadline")}function Uw(e){return Dw+Rr(e.tokenId,"tokenId")+Ka(e.recipient,"recipient")+Rr(e.amount0Max,"amount0Max")+Rr(e.amount1Max,"amount1Max")}function jw(e,t){return Pw+Rr(e,"amountMinimum")+Ka(t,"recipient")}function Ww(e,t,r){return Ow+Ka(e,"token")+Rr(t,"amountMinimum")+Ka(r,"recipient")}function Gw(e){if(e.length===0)throw new Error("multicall requires at least one call");let t=e.map(o=>{let i=o.replace(/^0x/,"");if(i.length%2!==0||!/^[0-9a-fA-F]*$/.test(i))throw new Error("multicall element must be valid hex bytes");let a=i.length%64===0?i:i.padEnd(i.length+(64-i.length%64),"0");return Rr(BigInt(i.length/2),"callLength")+a.toLowerCase()}),r=BigInt(e.length)*32n,n=[];for(let o of t)n.push(Rr(r,"callOffset")),r+=BigInt(o.length/2);return Bw+Rr(0x20n,"arrayOffset")+Rr(BigInt(e.length),"arrayLength")+n.join("")+t.join("")}function Iu(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 Eu(e){let t=Nu(e.token0,e.wcrossAddress),r=Nu(e.token1,e.wcrossAddress),n=t||r,o=[jl({tokenId:e.tokenId,liquidity:e.liquidity,amount0Min:e.amount0Min,amount1Min:e.amount1Min,deadline:e.deadline}),Uw({tokenId:e.tokenId,recipient:n?e.positionManagerAddress:e.owner,amount0Max:Su,amount1Max:Su})];return n&&(o.push(jw(0n,e.owner)),o.push(Ww(t?e.token1:e.token0,0n,e.owner))),Gw(o)}async function Au(e,t,r){let n;try{n=await ki(e,r)}catch{n=void 0}if(!n)return null;let o=jl({tokenId:t.tokenId,liquidity:t.liquidity,amount0Min:0n,amount1Min:0n,deadline:t.deadline}),i=await Tn(n,t.positionManager,o,r,t.owner);return Iu(i)}var _w=[1500,3e3,4500,6e3];function Qw(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Mu(){let{env:e,walletAddress:t,sendTransaction:r,estimateGas:n}=kt(),o=!!r,i=Hw(),[a,s]=wt.useState(!1),[l,d]=wt.useState(null),[c,h]=wt.useState("confirm"),[u,m]=wt.useState(),[y,b]=wt.useState(""),[f,p]=wt.useState(!1),[w,g]=wt.useState(new Set),x=wt.useRef(void 0),k=wt.useRef([]),R=wt.useRef(0);wt.useEffect(()=>()=>{clearTimeout(x.current),k.current.forEach(clearTimeout)},[]);let I=wt.useRef(new Set),C=wt.useCallback((A,U)=>{I.current.has(A)||(I.current.add(A),Qe("withdraw",A,{...U,tags:{section:"crossdPool",...U?.tags}}))},[]),S=wt.useCallback(()=>{let A=()=>Hn(i);A(),k.current.forEach(clearTimeout),k.current=_w.map(U=>setTimeout(A,U))},[i]),E=wt.useCallback(A=>{R.current+=1,d(A),s(!0),h("confirm"),m(void 0),b(""),p(!1),I.current=new Set,C("opened")},[C]),M=wt.useCallback(()=>{c!=="submitting"&&(R.current+=1,s(!1),d(null),h("confirm"),m(void 0),b(""),p(!1))},[c]),B=wt.useCallback(async()=>{let A=R.current,U=Qw(t),oe=l?.position.token_id,Y=l?.position.liquidity,G=l?.detail.pool?.token0?.address,H=l?.detail.pool?.token1?.address;if(!U||!oe||!Y||!G||!H)return h("error"),b("Position data is incomplete. Please refresh and retry."),null;try{h("estimating"),b("");let ie=BigInt(oe),re=BigInt(Y),O=BigInt(Math.floor(Date.now()/1e3))+Tu,Z=_p[e],_=await Au(e,{owner:U,positionManager:Z,tokenId:ie,liquidity:re,deadline:O});if(R.current!==A)return null;if(!_)return h("error"),b("Failed to estimate withdrawal amounts. Please retry."),null;let ce=Eu({tokenId:ie,liquidity:re,amount0Min:Ul(_.amount0),amount1Min:Ul(_.amount1),deadline:O,owner:U,positionManagerAddress:Z,token0:G,token1:H,wcrossAddress:Qp[e]}),xe={to:Z,value:0n,data:ce,chainId:bt[e].cross},he=null;if(n){try{he=await n({...xe,from:U})}catch{he=null}if(R.current!==A)return null}return h("confirm"),{tx:xe,estimate:he,expectedAmount0:_.amount0,expectedAmount1:_.amount1}}catch(ie){return R.current!==A||(h("error"),b(wi(ie,"Failed to prepare withdraw."))),null}},[e,n,l,t]),L=wt.useCallback(async A=>{if(!r){h("error"),b("Withdraw is not available for this wallet.");return}try{h("submitting"),b(""),C("submitted");let U=await r({...A.tx,gas:A.estimate?.gasLimit&&A.estimate.gasLimit>0n?A.estimate.gasLimit:void 0,maxFeePerGas:A.estimate?.maxFeePerGas&&A.estimate.maxFeePerGas>0n?A.estimate.maxFeePerGas:void 0,maxPriorityFeePerGas:A.estimate?.maxPriorityFeePerGas&&A.estimate.maxPriorityFeePerGas>0n?A.estimate.maxPriorityFeePerGas:void 0});m(U),h("success");let oe=l?.position.token_id;oe&&g(Y=>{let G=new Set(Y);return G.add(oe),G}),C("confirmed"),S()}catch(U){h("error"),b(wi(U,"Failed to request withdraw.")),C("confirmed",{status:"failure",reason:Ir(U)})}},[S,r,l,C]),z=wt.useCallback(async()=>{if(!(!u||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(u),p(!0),clearTimeout(x.current),x.current=setTimeout(()=>p(!1),1400)}catch{p(!1)}},[u]);return{canWithdrawInline:o,isOpen:a,target:l,withdrawnTokenIds:w,status:c,txHash:u,error:y,copied:f,hasEstimator:!!n,openWithdraw:E,closeWithdraw:M,prepareWithdraw:B,confirmWithdraw:L,copyHash:z,trackFunnelOnce:C}}import{Fragment as Yw,jsx as Cr,jsxs as qn}from"react/jsx-runtime";var qw="ONEusd Pool",Du="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Pu(){let{env:e,walletAddress:t,onOutlink:r}=kt(),n=jr(),o=!!t,{positions:i,isLoading:a}=xu(e,t,o),s=Mu(),l=Lu(()=>i.filter(C=>!C.token_id||!s.withdrawnTokenIds.has(C.token_id)),[i,s.withdrawnTokenIds]),d=Lu(()=>l.map(C=>C.token_id).filter(C=>!!C),[l]),{detailMap:c}=vu(e,d,o&&d.length>0),h=`${Hp[e]}/pool`,{getTokenImage:u,getTokenSymbol:m,getNativeToken:y}=yn(e,o),b=u("","ONEUSD",{chainOnly:!0})||`${Wr[e]}/crossd.png`,f={chainOnly:!0},p=(C,S)=>{let E=Il(m(C?.address??"",C?.symbol??S,f));return E==="ONE"?y()?.symbol??"?":E??"?"},w=(C,S)=>{let E=C?.symbol??S,M=Il(E);return M==="ONE"?y()?.image||Du:u(C?.address??"",M,f)||C?.logo_url||Du},g=s.target?.detail.pool,x=w(g?.token0,s.target?.position.pool?.token0_symbol),k=w(g?.token1,s.target?.position.pool?.token1_symbol),R=p(g?.token0,s.target?.position.pool?.token0_symbol),I=p(g?.token1,s.target?.position.pool?.token1_symbol);return qn(Yw,{children:[Cr(Gr,{sectionKey:"crossdPool",title:qw,icon:b,iconFit:"contain",isEmpty:l.length===0,loading:a,children:l.map(C=>{let S=C.token_id?c.get(C.token_id):void 0,E=`${p(S?.pool?.token0,C.pool?.token0_symbol)}/${p(S?.pool?.token1,C.pool?.token1_symbol)}`,M=C.pool?.fee_tier_percentage,B=w(S?.pool?.token0,C.pool?.token0_symbol),L=w(S?.pool?.token1,C.pool?.token1_symbol),z=yo(new Vw(C.position_value_usd??"0"),n),A=s.canWithdrawInline&&!!S?.pool?.token0?.address&&!!S?.pool?.token1?.address;return qn("article",{className:"wp-item","data-side":"crossd",children:[qn("div",{className:"wp-item-body",children:[qn("div",{className:"wp-item-line",children:[Cr("span",{className:"wp-item-label",children:"Pool"}),qn("div",{className:"wp-svc-token",children:[qn("span",{className:"wp-token-stack","aria-hidden":!0,children:[Cr("img",{className:"wp-svc-token-icon",src:B,alt:""}),Cr("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),Cr("span",{children:E}),M&&Cr("span",{className:"wp-token-subtle",children:M})]})]}),qn("div",{className:"wp-item-line",children:[Cr("span",{className:"wp-item-label",children:"Position Value"}),Cr("span",{className:"wp-line-value",children:z})]})]}),Cr("div",{className:"wp-item-tags",children:A?Cr("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"crossd_pool_withdraw_open","data-track-id":E,onClick:()=>{S&&s.openWithdraw({position:C,detail:S})},children:Cr("span",{className:"wp-tag-label",children:"Withdraw"})}):qn("a",{className:"wp-tag wp-tag--muted",href:h,target:"_blank",rel:"noopener noreferrer","data-track":"crossd_pool_outlink","data-track-id":E,onClick:U=>Ft(U,h,{category:"portfolio",origin:"portfolio-crossd-pool",payload:{position:C,detail:S}},r),children:[Cr("span",{className:"wp-tag-label",children:"Withdraw"}),Cr(Mr,{size:12,className:"wp-tag-icon"})]})})]},C.token_id)})}),Cr(Cu,{open:s.isOpen,status:s.status,target:s.target,token0Icon:x,token1Icon:k,token0Symbol:R,token1Symbol:I,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 Za=["rewards","points","staking","gameSwap","forge","crossdPool"];de(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--ds-bg-default, #202530);--wp-header-bg: var(--ds-surface-default, #252b39);--wp-card: var(--ds-surface-medium, #252b39);--wp-control: #292f40;--wp-border: var(--ds-border-default, #292f40);--wp-panel-border: var(--ds-border-medium, rgba(255, 255, 255, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .28);--wp-text: var(--ds-content-highest, #ffffff);--wp-text-60: var(--ds-content-high, rgba(255, 255, 255, .85));--wp-text-40: var(--ds-content-medium, rgba(255, 255, 255, .65));--wp-text-30: var(--ds-content-low, rgba(255, 255, 255, .4));--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-high, #f0640d);--wp-green: var(--ds-system-green-high, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-lowest, #362519);--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, #f0640d);--wp-green: var(--ds-system-green-high, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, #fff5ee);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--wp-claim-primary-text: #ffffff;--wp-claim-secondary-bg: #ffffff;--wp-claim-success: #019d92;--wp-claim-success-soft: rgba(1, 157, 146, .15);--wp-claim-error: #e70077;--wp-claim-error-soft: rgba(231, 0, 119, .12)}.wp-fullscreen{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:73px;padding:24px;position:relative;border-bottom:1px solid var(--wp-border);background:var(--wp-header-bg);color:var(--wp-chrome-text);flex-shrink:0;box-sizing:border-box}.wp-fullscreen .wp-header{height:60px;min-height:60px;padding:11px 20px;border-bottom:none;background:transparent}.wp-fullscreen .wp-header-btn{width:22px;height:22px;color:var(--wp-chrome-text)}.wp-fullscreen .wp-header-btn:hover{color:var(--wp-chrome-text)}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wp-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wp-header-edge{display:flex;align-items:center;width:24px;min-width:24px}.wp-header-edge--right{justify-content:flex-end}.wp-header-edge--right .wp-header-btn{position:absolute;top:24px;right:24px}.wp-header-spacer{display:block;width:24px;height:24px}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: hsl(221.3 24.6% 25.5%)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;text-align:center;color:var(--ds-content-highest, #000000);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-account-meta{display:flex;flex-direction:column;justify-content:center;min-width:0;gap:2px}.wp-header-wallet-name{min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:1.4;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-btn{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;padding:0;border:0;background:transparent;cursor:pointer;font:inherit}.wp-header-address{min-width:0;font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-copy{display:inline-flex;align-items:center;flex-shrink:0;color:var(--wp-text-40);transition:color .15s ease}.wp-header-address-btn:hover .wp-header-address-copy{color:var(--wp-text-60)}.wp-header-address-copy[data-copied=true]{color:var(--wp-mint)}.wp-top{flex-shrink:0;padding:0 16px 16px;display:flex;flex-direction:column;gap:16px}.wp-identity{display:flex;flex-direction:column;gap:8px}.wp-address{display:inline-flex;align-items:center;gap:8px}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40)}.wp-total{font-size:28px;font-weight:600;line-height:1.3;color:var(--wp-text);margin:0}.wp-asset{display:flex;flex-direction:column;gap:8px}.wp-asset-head{display:flex;align-items:center;gap:4px}.wp-asset-head-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-asset-head-icon{display:inline-flex;color:var(--wp-text-40)}.wp-bar{display:flex;height:20px;border-radius:4px;overflow:hidden}.wp-bar-seg{display:flex;align-items:center;justify-content:center;min-width:8px}.wp-bar-seg-pct{font-size:10px;font-weight:400;line-height:1.3;color:#fff;white-space:nowrap}.wp-legend{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}.wp-legend-item{display:flex;align-items:center;gap:4px}.wp-legend-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.wp-legend-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-tabs{flex-shrink:0;padding:8px 16px}.wp-tabs-inner{display:flex;align-items:center;padding:0 2px}.wp-tabs-list{display:flex;gap:20px;flex:1}.wp-tab{display:flex;flex-direction:column;align-items:center;justify-content:space-between;height:44px;padding-top:12px;background:transparent;border:none;cursor:pointer}.wp-tab-text{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text-30);white-space:nowrap}.wp-tab[data-active=true] .wp-tab-text{color:var(--wp-mint)}.wp-tab-bar{width:20px;height:4px;border-radius:2px;background:var(--wp-mint);opacity:0}.wp-tab[data-active=true] .wp-tab-bar{opacity:1}.wp-tabs-filter-wrap{position:relative;display:flex;align-items:center;width:44px;height:44px;flex-shrink:0}.wp-tabs-filter-grad{position:absolute;inset:0;background:linear-gradient(to left,var(--wp-bg) 74%,transparent);pointer-events:none}.wp-tabs-filter{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text-40)}.wp-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--wp-border) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:var(--wp-border);border-radius:4px}.wp-body-inner{padding:16px 16px 32px;display:flex;flex-direction:column;gap:32px}.wp-fullscreen .wp-body-inner{padding-top:8px;gap:24px}.wp-summary-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-summary-head{position:relative;display:flex;align-items:center;justify-content:flex-start;gap:4px}.wp-summary-label{font-size:14px;font-weight:400;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address{display:inline-flex;align-items:center;gap:8px;min-width:0}.wp-address-avatar{width:16px;height:16px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 68% 34%,#ff78d1 0 18%,transparent 19%),radial-gradient(circle at 34% 66%,#00d4aa 0 20%,transparent 21%),linear-gradient(135deg,#7346f3,#0488fc)}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40);flex-shrink:0}.wp-summary-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;background:#019d921a;color:var(--wp-mint);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;white-space:nowrap}.wp-summary-estimate{position:relative;display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.wp-estimate-info{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--wp-text-40);cursor:help}.wp-estimate-tooltip{position:absolute;top:calc(100% + 8px);left:0;right:auto;z-index:3;display:flex;flex-direction:column;gap:8px;width:min(280px,calc(100vw - 48px));padding:12px;border-radius:8px;background:var(--wp-tooltip-bg);box-shadow:0 12px 32px #0000003d;color:var(--wp-tooltip-text);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-estimate-tooltip-title{display:block;font-size:12px;font-weight:600;line-height:1.3}.wp-estimate-tooltip-group{display:flex;flex-direction:column;gap:4px}.wp-estimate-tooltip-item{display:block;color:#ffffffc7}.wp-estimate-tooltip-item:before{content:"- "}.wp-estimate-info:hover .wp-estimate-tooltip,.wp-estimate-info:focus .wp-estimate-tooltip,.wp-estimate-info:focus-visible .wp-estimate-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-total{font-family:var( --wp-total-font-family, Sora, Inter, system-ui, -apple-system, sans-serif );font-size:36px;font-weight:600;line-height:1.25;letter-spacing:0;color:var(--wp-text);margin:0}.wp-svc-card{display:flex;flex-direction:column;gap:12px;width:100%}.wp-svc-card-head{display:flex;align-items:center;gap:6px}.wp-svc-card-icon{width:24px;height:24px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-item{position:relative;display:flex;flex-direction:column;gap:20px;width:100%;padding:12px;border-radius:12px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box;color:inherit;text-decoration:none;cursor:pointer;outline:none;transition:opacity .15s ease}.wp-item+.wp-item{padding-top:12px;border-top:0}.wp-item:hover{opacity:.88}.wp-item-body{display:flex;flex-direction:column;gap:12px;min-width:0}.wp-order-head{display:flex;align-items:center;width:100%}.wp-item-line{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:21px;min-width:0}.wp-item-label{flex-shrink:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-30);white-space:nowrap}.wp-line-value,.wp-order-side{min-width:0;overflow:hidden;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-order-side--buy{color:var(--wp-mint)}.wp-order-side--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;min-height:21px}.wp-svc-token>span{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:16px;height:16px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-item[data-side=reward] .wp-svc-token-icon{border-radius:0;object-fit:contain}.wp-svc-token--amount{align-items:flex-start}.wp-svc-token--amount>.wp-svc-token-icon{margin-top:2.5px}.wp-token-stack{display:inline-flex;align-items:center;justify-content:flex-end;width:29px;min-width:29px;overflow:visible}.wp-token-stack .wp-svc-token-icon+.wp-svc-token-icon{margin-left:-3.5px}.wp-token-subtle,.wp-item-usd{color:var(--wp-text-30)!important}.wp-svc-amount{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:1px;min-width:0}.wp-svc-amount-main{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.wp-svc-amount .wp-item-usd{font-size:12px;font-weight:500;line-height:1.35}.wp-order-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-order-token .wp-svc-token-icon{width:32px;height:32px}.wp-order-token-meta{display:flex;min-width:0;flex-direction:column;justify-content:center}.wp-order-token-symbol{overflow:hidden;color:var(--wp-text-60);font-size:14px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-order-token-pair{overflow:hidden;color:var(--wp-text-30);font-size:12px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-item-tags{display:flex;align-items:stretch;gap:8px;width:100%}.wp-tag{appearance:none;display:inline-flex;flex:1 1 0;align-items:center;justify-content:center;gap:0;min-width:0;min-height:33px;padding:6px 10px;border-radius:6px;border:0;background:var(--wp-control);font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);text-align:center;text-decoration:none;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}a.wp-tag,button.wp-tag{cursor:pointer}.wp-tag:hover{background:var(--wp-control);transform:none}.wp-tag:focus-visible{outline:2px solid var(--wp-mint);outline-offset:2px}.wp-tag[aria-disabled=true],.wp-tag[data-disabled]{cursor:default;opacity:.48;pointer-events:none}.wp-tag-label{display:inline-flex;align-items:center}.wp-tag-icon{display:none}.wp-tag:hover .wp-tag-icon{transform:none}.wp-tag--mint{color:var(--wp-mint);background:var(--wp-accent-soft)}.wp-tag--mint:hover{background:var(--wp-accent-soft)}.wp-tag--muted{color:var(--wp-text-40)}.wp-body-inner[data-empty]{min-height:100%;box-sizing:border-box;justify-content:center}.wp-portfolio-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:280px;padding:32px 24px;text-align:center}.wp-portfolio-empty-icon{display:flex;align-items:center;justify-content:center;width:56px;height:56px;margin-bottom:6px;border-radius:50%;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);color:var(--wp-text-30)}.wp-portfolio-empty-title{margin:0;font-size:15px;font-weight:600;line-height:1.3;color:var(--wp-text-60)}.wp-portfolio-empty-desc{margin:0;font-size:13px;font-weight:400;line-height:1.4;color:var(--wp-text-30)}.wp-portfolio-loading{display:flex;align-items:center;justify-content:center;min-height:280px;padding:32px 24px}.wp-portfolio-spinner{width:22px;height:22px;border:2px solid var(--wp-border);border-top-color:var(--wp-mint);border-radius:50%;animation:wp-claim-spin .8s linear infinite}.wp-claim-overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:flex-end;justify-content:center;background:#00000094;box-sizing:border-box}.wp-claim-sheet{display:flex;flex-direction:column;width:100%;max-height:calc(100% - 24px);overflow:hidden;border-radius:24px 24px 0 0;background:var(--wp-bg);color:var(--wp-text);box-shadow:0 -18px 48px #00000042;animation:wp-claim-slide-up .22s ease-out}@keyframes wp-claim-slide-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.wi-popover-content .wp-claim-sheet{min-height:min(600px,calc(100% - 24px))}.wi-popover-content .wp-claim-content{flex:1 1 auto}.wi-popover-content .wp-claim-actions{margin-top:auto}.wp-claim-grabber{display:flex;align-items:flex-start;justify-content:center;height:38px;min-height:38px;padding-top:12px;box-sizing:border-box}.wp-claim-grabber span{display:block;width:52px;height:5px;border-radius:999px;background:var(--wp-control)}.wp-claim-content{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;padding:20px;box-sizing:border-box}.wp-claim-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;flex-shrink:0}.wp-claim-icon--success{background:var(--wp-claim-success-soft);color:var(--wp-claim-success)}.wp-claim-icon--pending{background:#9b8cef29;color:var(--wp-claim-primary)}.wp-claim-icon--error{background:var(--wp-claim-error-soft);color:var(--wp-claim-error);font-size:30px;font-weight:600;line-height:1}.wp-claim-icon--token{background:#00d4aa29}.wp-claim-icon--token img{width:48px;height:48px;border-radius:50%;object-fit:cover}.wp-claim-icon--token span{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;background:var(--wp-mint);color:#101820;font-size:18px;font-weight:600}.wp-claim-spinner{width:36px;height:36px;border-radius:50%;border:3px solid rgba(155,140,239,.28);border-top-color:var(--wp-claim-primary);animation:wp-claim-spin .8s linear infinite}@keyframes wp-claim-spin{to{transform:rotate(360deg)}}.wp-claim-copy{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;text-align:center}.wp-claim-title{margin:0;font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text)}.wp-claim-desc{max-width:335px;margin:0;font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-40)}.wp-claim-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.wp-claim-error-message{margin:0;color:var(--wp-claim-error);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0}.wp-claim-reward-card{display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;min-height:60px;padding:16px 8px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-reward-token{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-claim-reward-token img{width:28px;height:28px;object-fit:cover}.wp-claim-reward-token span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-claim-reward-symbol{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wp-text);font-size:18px;font-weight:600;line-height:1.3;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-reward-amount{flex-shrink:0;color:var(--wp-text);font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-reward-card[data-fit=sm] .wp-claim-reward-symbol{font-size:14px}.wp-claim-reward-card[data-fit=sm] .wp-claim-reward-amount{font-size:16px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-symbol{font-size:12px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-amount{font-size:13px}.wp-claim-account-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-account-row{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-height:40px}.wp-claim-account-row>span{flex-shrink:0;color:var(--wp-text-40);font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account{display:flex;align-items:center;gap:8px;min-width:0}.wp-claim-account strong{overflow:hidden;color:var(--wp-text);font-size:15px;font-weight:600;line-height:1.6;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-account-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 30% 28%,#d87aff 0 12%,transparent 13%),radial-gradient(circle at 68% 28%,#f0a1ff 0 12%,transparent 13%),radial-gradient(circle at 32% 70%,#b561e7 0 13%,transparent 14%),radial-gradient(circle at 70% 70%,#d4a2ff 0 13%,transparent 14%),radial-gradient(circle at 50% 50%,#8c4fc4 0 18%,transparent 19%),#4a315f;box-shadow:inset 0 0 0 3.37px var(--wp-control)}.wp-claim-divider{display:block;width:100%;height:1px;background:var(--wp-border)}.wp-claim-detail-list{display:flex;flex-direction:column;gap:8px;width:100%}.wp-claim-detail-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:20px}.wp-claim-detail-row>span{min-width:0;color:var(--wp-text-40);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-detail-row--sub>span:before{content:"";display:inline-block;width:3px;height:3px;margin:0 8px 3px;background:currentColor}.wp-claim-detail-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list{display:flex;flex-direction:column;gap:8px;width:100%;padding-bottom:8px}.wp-claim-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-list-item>span{flex-shrink:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--wp-text-40);white-space:nowrap}.wp-claim-list-item strong{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;overflow:hidden;color:var(--wp-text);font-size:14px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list-item img{width:16px;height:16px;border-radius:50%;flex-shrink:0}.wp-claim-hash{appearance:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);cursor:pointer;font:inherit}.wp-claim-hash svg{flex-shrink:0;color:var(--wp-text-60)}.wp-claim-gas-card{display:flex;flex-direction:column;gap:4px;width:100%;padding:14px 16px;border-radius:8px;border:1px solid var(--wp-border);background:var(--wp-card);box-sizing:border-box}.wp-claim-gas-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:28px}.wp-claim-gas-row>span{min-width:0;font-size:12px;font-weight:400;line-height:1.3;color:var(--wp-text-40)}.wp-claim-gas-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:12px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-gas-row--primary{min-height:32px}.wp-claim-gas-row--primary>span,.wp-claim-gas-row--primary strong{font-size:14px;color:var(--wp-text)}.wp-claim-fee-label{position:relative;display:inline-flex;align-items:center;text-decoration:underline dotted;text-underline-offset:3px;cursor:help;overflow:visible!important}.wp-claim-fee-tooltip{position:absolute;left:0;bottom:calc(100% + 8px);z-index:2;width:min(260px,calc(100vw - 64px));padding:10px 12px;border-radius:8px;background:var(--wp-tooltip-bg);color:var(--wp-tooltip-text);box-shadow:0 12px 32px #0000003d;font-size:11px;font-weight:400;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-claim-fee-label:hover .wp-claim-fee-tooltip,.wp-claim-fee-label:focus .wp-claim-fee-tooltip,.wp-claim-fee-label:focus-visible .wp-claim-fee-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-claim-actions{display:flex;align-items:center;gap:8px;width:100%}.wp-claim-primary,.wp-claim-secondary{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;height:52px;padding:0 24px;border:none;border-radius:40px;font-family:inherit;font-size:15px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap;cursor:pointer}.wp-claim-primary{background:var(--wp-claim-primary);color:var(--wp-claim-primary-text)}.wp-claim-primary:disabled{cursor:default;opacity:.72}.wp-claim-secondary{background:var(--wp-claim-secondary-bg, var(--wp-control));color:var(--wp-claim-primary)}.wp-claim-actions[data-count="2"] .wp-claim-primary{flex:1 1 0}.wp-claim-actions[data-count="2"] .wp-claim-secondary{flex:0 0 120px}.wp-claim-button-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(32,37,48,.28);border-top-color:var(--wp-claim-primary-text);animation:wp-claim-spin .8s linear infinite}.wp-claim-home-indicator{display:flex;align-items:flex-end;justify-content:center;height:34px;min-height:34px;padding-bottom:8px;box-sizing:border-box}.wp-claim-home-indicator span{display:block;width:134px;height:5px;border-radius:16px;background:var(--wp-text-40)}@media(max-width:359px){.wp-header{gap:12px;padding:0 12px}.wp-total{font-size:24px}.wp-body-inner{padding:0 12px 128px;gap:20px}.wp-svc-items,.wp-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.wi-drawer-content .wp-header,.wi-portfolio-body .wp-header{padding:16px}.wi-drawer-content .wp-header-edge--right .wp-header-btn,.wi-portfolio-body .wp-header-edge--right .wp-header-btn{top:16px;right:16px}.wp-withdraw-amount-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-withdraw-amount-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-input{flex:1 1 auto;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);font-family:inherit;font-size:24px;font-weight:600;line-height:1.3;letter-spacing:0;text-align:left;outline:none}.wp-withdraw-input::placeholder{color:var(--wp-text-30)}.wp-withdraw-input[aria-invalid=true]{color:var(--wp-claim-error)}.wp-withdraw-input-symbol{flex-shrink:0;color:var(--wp-text-40);font-size:15px;font-weight:600;line-height:1.3}.wp-withdraw-quick-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-quick{appearance:none;flex:1 1 0;min-width:0;height:32px;padding:0 10px;border:1px solid var(--wp-border);border-radius:999px;background:transparent;color:var(--wp-text-60);font-family:inherit;font-size:13px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer}.wp-withdraw-quick:hover:not(:disabled){border-color:var(--wp-claim-primary);color:var(--wp-claim-primary)}.wp-withdraw-quick:disabled{cursor:default;opacity:.5}.wp-withdraw-content{overflow-y:auto}.wp-withdraw-token-list{display:flex;flex-direction:column;gap:8px;width:100%;max-height:216px;overflow-y:auto}.wp-withdraw-token{appearance:none;display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:10px 12px;border:1px solid var(--wp-border);border-radius:8px;background:var(--wp-card);color:var(--wp-text);font-family:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.wp-withdraw-token[data-selected]{border-color:var(--wp-claim-primary);box-shadow:inset 0 0 0 1px var(--wp-claim-primary)}.wp-withdraw-token:disabled{cursor:default;opacity:.6}.wp-withdraw-token-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-withdraw-token-icon img{width:28px;height:28px;object-fit:cover}.wp-withdraw-token-icon span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-withdraw-token-symbol{flex:1 1 auto;min-width:0;overflow:hidden;font-size:15px;font-weight:600;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.wp-withdraw-token-amount{flex-shrink:0;color:var(--wp-text-40);font-size:13px;font-weight:500;line-height:1.3;white-space:nowrap}
|