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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
- function Hd(e){try{return import.meta.env?.[e]}catch{return}}function _d(e){if(!(typeof process>"u"))return process.env?.[e]}function ot(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 cn from"react";var Ih={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"},Eh=3e3;function Mr(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 Zs=new Map;function no(e,t){let r=`${Ih[t]}/${e}`,n=Zs.get(r);return n||(n=(async()=>{let o=new AbortController,i=setTimeout(()=>o.abort(),Eh);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&&Zs.delete(r),o)),Zs.set(r,n)),n}function Ah(e){return typeof e=="string"&&e.startsWith("https://")}async function Me(e,t){let r=await no("endpoints.json",t),n=Mr(r?.apis?.[e],t);if(!Ah(n))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return n}var Ji="apps.json";function $i(e,t){let r=Mr(e?.relay?.forwarderFactories,t),n=[r?.standingForwarderFactory,r?.depositorForwarderFactory].filter(o=>typeof o=="string");return n.length>0?n:void 0}var ea="chains.json";async function Mh(e,t){return(await no(ea,t))?.chains?.[String(e)]??{}}function ni(e,t){let[r,n]=cn.useState({});return cn.useEffect(()=>{if(e==null){n({});return}let o=!0;return no(ea,t).then(i=>{o&&n(i?.chains?.[String(e)]??{})}),()=>{o=!1}},[e,t]),r}function Lh(e){let[t,r]=cn.useState({});return cn.useEffect(()=>{let n=!0;return no(ea,e).then(o=>{n&&r(o?.chains??{})}),()=>{n=!1}},[e]),t}function Ut(e,t,r){let[n,o]=cn.useState(void 0),i=cn.useRef(r);return i.current=r,cn.useEffect(()=>{let a=!0;return no(e,t).then(s=>{if(!a)return;let l=i.current(s);l!==void 0&&o(l)}),()=>{a=!1}},[e,t]),n}var oo="1.4.2-beta.2";var ta="__nexusCrossAppLauncherRuntime";function Dh(){if(typeof window>"u")return null;let e=window;return e[ta]??(e[ta]={mode:"dapp-ui"}),e[ta]}function Ph(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${oo}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${oo} \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 Xs(e){let t=Dh();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Ph(t))}import{BrowserClient as Oh,Scope as Bh,defaultStackParser as zh,linkedErrorsIntegration as Fh,makeFetchTransport as Uh}from"@sentry/react";var jh="https://5c82aeb32da33b5a0a14b7c5393992ca@o4511668907081728.ingest.de.sentry.io/4511705324126289",Wh=`dapp-ui@${oo}`,No=null,Vd=.1;function qd(){return Vd}function Gh(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function oi(e){if(No)return No;if(typeof window>"u")return null;let t=Gh(ot(e?.environment));typeof e?.analyticsSampleRate=="number"&&(Vd=Math.min(1,Math.max(0,e.analyticsSampleRate)));let r=new Oh({dsn:e?.dsn??jh,transport:Uh,stackParser:zh,integrations:[Fh()],environment:t,release:Wh,enabled:e?.enabled??t==="prod"}),n=new Bh;return n.setClient(r),n.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),r.init(),No=n,No}function ra(){return No}function na(e,t){let r=No??oi();if(r)return r.captureException(e,t?{captureContext:{extra:t}}:void 0)}import{Component as Hh}from"react";var oa=class extends Hh{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,n){na(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 _h=/CROSSx|ONE\s?wallet|ONE\s?pocket/i;function To(){return typeof window>"u"?!1:_h.test(window.navigator.userAgent)}var Yd="__nexus_dapp_ui_uid",Js=null;function Qh(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function $s(){if(Js)return Js;let e=null;try{e=window.localStorage.getItem(Yd)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${Qh()}`;try{window.localStorage.setItem(Yd,e)}catch{}}return Js=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 Vh(){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:Vh(),is_cross_inapp:String(To())}}var Zd=!1;function el(){if(typeof window>"u")return null;let e=ra()??oi();return e?(Zd||(Zd=!0,e.setUser({id:$s()})),e):null}function $d(){return Math.random()>=qd()}var Xd=0;function Io(e){let t=el();if(!t)return;let r=++Xd;if(!e){t.setUser({id:$s()});return}Kd(e).then(n=>{n&&r===Xd&&t.setUser({id:n})})}function ia(e,t,r){let n=el();!n||$d()||n.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Jd(),feature:e,action:t,...r}}})}function Qe(e,t,r){let n=el();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 Cr(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 qh}from"react";import{jsx as Yh}from"react/jsx-runtime";function ye({feature:e,children:t}){let r=qh(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");ia(e,s,l?{item_id:l}:void 0)},[e]);return Yh("div",{style:{display:"contents"},onClick:r,children:t})}import*as Mo from"react";import*as tc from"@radix-ui/react-popover";import{Drawer as n0}from"vaul";import{createContext as Kh,useContext as Zh}from"react";var tl=Kh(null);function aa(){let e=Zh(tl);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import*as la from"react";var Xh="__dappUiOverlay",io=[],Eo=0,nl=0,sa=!1,rl=!1;function ec(){if(nl>0){nl-=1;return}Eo=Math.max(0,Eo-1),io.pop()?.close(),ol()}function Jh(){sa||(window.addEventListener("popstate",ec),sa=!0)}function ol(){io.length>0||!sa||(window.removeEventListener("popstate",ec),sa=!1)}function $h(){rl||(rl=!0,queueMicrotask(()=>{rl=!1;let e=Eo-io.length;if(e<=0){ol();return}Eo-=e,nl+=1,window.history.go(-e),ol()}))}function Ln(e,t){let r=la.useRef(t);r.current=t,la.useEffect(()=>{if(!(!e||typeof window>"u"))return e0(()=>r.current())},[e])}function e0(e){let t={close:e};return io.push(t),Eo<io.length&&(window.history.pushState({[Xh]:!0},""),Eo+=1),Jh(),()=>{let r=io.lastIndexOf(t);r!==-1&&(io.splice(r,1),$h())}}import{useState as t0,useEffect as r0}from"react";function Ao(e){let[t,r]=t0(!1);return r0(()=>{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 ot(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 cn from"react";var Ih={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"},Eh=3e3;function Mr(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 Zs=new Map;function no(e,t){let r=`${Ih[t]}/${e}`,n=Zs.get(r);return n||(n=(async()=>{let o=new AbortController,i=setTimeout(()=>o.abort(),Eh);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&&Zs.delete(r),o)),Zs.set(r,n)),n}function Ah(e){return typeof e=="string"&&e.startsWith("https://")}async function Me(e,t){let r=await no("endpoints.json",t),n=Mr(r?.apis?.[e],t);if(!Ah(n))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return n}var Ji="apps.json";function $i(e,t){let r=Mr(e?.relay?.forwarderFactories,t),n=[r?.standingForwarderFactory,r?.depositorForwarderFactory].filter(o=>typeof o=="string");return n.length>0?n:void 0}var ea="chains.json";async function Mh(e,t){return(await no(ea,t))?.chains?.[String(e)]??{}}function ni(e,t){let[r,n]=cn.useState({});return cn.useEffect(()=>{if(e==null){n({});return}let o=!0;return no(ea,t).then(i=>{o&&n(i?.chains?.[String(e)]??{})}),()=>{o=!1}},[e,t]),r}function Lh(e){let[t,r]=cn.useState({});return cn.useEffect(()=>{let n=!0;return no(ea,e).then(o=>{n&&r(o?.chains??{})}),()=>{n=!1}},[e]),t}function Ut(e,t,r){let[n,o]=cn.useState(void 0),i=cn.useRef(r);return i.current=r,cn.useEffect(()=>{let a=!0;return no(e,t).then(s=>{if(!a)return;let l=i.current(s);l!==void 0&&o(l)}),()=>{a=!1}},[e,t]),n}var oo="1.4.2-beta.4";var ta="__nexusCrossAppLauncherRuntime";function Dh(){if(typeof window>"u")return null;let e=window;return e[ta]??(e[ta]={mode:"dapp-ui"}),e[ta]}function Ph(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${oo}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${oo} \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 Xs(e){let t=Dh();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Ph(t))}import{BrowserClient as Oh,Scope as Bh,defaultStackParser as zh,linkedErrorsIntegration as Fh,makeFetchTransport as Uh}from"@sentry/react";var jh="https://5c82aeb32da33b5a0a14b7c5393992ca@o4511668907081728.ingest.de.sentry.io/4511705324126289",Wh=`dapp-ui@${oo}`,No=null,Vd=.1;function qd(){return Vd}function Gh(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function oi(e){if(No)return No;if(typeof window>"u")return null;let t=Gh(ot(e?.environment));typeof e?.analyticsSampleRate=="number"&&(Vd=Math.min(1,Math.max(0,e.analyticsSampleRate)));let r=new Oh({dsn:e?.dsn??jh,transport:Uh,stackParser:zh,integrations:[Fh()],environment:t,release:Wh,enabled:e?.enabled??t==="prod"}),n=new Bh;return n.setClient(r),n.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),r.init(),No=n,No}function ra(){return No}function na(e,t){let r=No??oi();if(r)return r.captureException(e,t?{captureContext:{extra:t}}:void 0)}import{Component as Hh}from"react";var oa=class extends Hh{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,n){na(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 _h=/CROSSx|ONE\s?wallet|ONE\s?pocket/i;function To(){return typeof window>"u"?!1:_h.test(window.navigator.userAgent)}var Yd="__nexus_dapp_ui_uid",Js=null;function Qh(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function $s(){if(Js)return Js;let e=null;try{e=window.localStorage.getItem(Yd)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${Qh()}`;try{window.localStorage.setItem(Yd,e)}catch{}}return Js=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 Vh(){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:Vh(),is_cross_inapp:String(To())}}var Zd=!1;function el(){if(typeof window>"u")return null;let e=ra()??oi();return e?(Zd||(Zd=!0,e.setUser({id:$s()})),e):null}function $d(){return Math.random()>=qd()}var Xd=0;function Io(e){let t=el();if(!t)return;let r=++Xd;if(!e){t.setUser({id:$s()});return}Kd(e).then(n=>{n&&r===Xd&&t.setUser({id:n})})}function ia(e,t,r){let n=el();!n||$d()||n.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Jd(),feature:e,action:t,...r}}})}function Qe(e,t,r){let n=el();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 Cr(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 qh}from"react";import{jsx as Yh}from"react/jsx-runtime";function ye({feature:e,children:t}){let r=qh(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");ia(e,s,l?{item_id:l}:void 0)},[e]);return Yh("div",{style:{display:"contents"},onClick:r,children:t})}import*as Mo from"react";import*as tc from"@radix-ui/react-popover";import{Drawer as n0}from"vaul";import{createContext as Kh,useContext as Zh}from"react";var tl=Kh(null);function aa(){let e=Zh(tl);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import*as la from"react";var Xh="__dappUiOverlay",io=[],Eo=0,nl=0,sa=!1,rl=!1;function ec(){if(nl>0){nl-=1;return}Eo=Math.max(0,Eo-1),io.pop()?.close(),ol()}function Jh(){sa||(window.addEventListener("popstate",ec),sa=!0)}function ol(){io.length>0||!sa||(window.removeEventListener("popstate",ec),sa=!1)}function $h(){rl||(rl=!0,queueMicrotask(()=>{rl=!1;let e=Eo-io.length;if(e<=0){ol();return}Eo-=e,nl+=1,window.history.go(-e),ol()}))}function Ln(e,t){let r=la.useRef(t);r.current=t,la.useEffect(()=>{if(!(!e||typeof window>"u"))return e0(()=>r.current())},[e])}function e0(e){let t={close:e};return io.push(t),Eo<io.length&&(window.history.pushState({[Xh]:!0},""),Eo+=1),Jh(),()=>{let r=io.lastIndexOf(t);r!==-1&&(io.splice(r,1),$h())}}import{useState as t0,useEffect as r0}from"react";function Ao(e){let[t,r]=t0(!1);return r0(()=>{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
5
  `);de("");import{jsx as il}from"react/jsx-runtime";function rc({env:e,theme:t="dark",mobileBreakpoint:r=768,domain:n,children:o}){let i=Ao(`(max-width: ${r}px)`),[a,s]=Mo.useState(!1),l=Mo.useCallback(()=>s(!1),[]),d=ot(e);Ln(a,l);let c=Mo.useMemo(()=>({env:d,theme:t,isMobile:i,open:a,domain:n,close:l}),[d,t,i,a,n,l]);return il(tl.Provider,{value:c,children:i?il(n0.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:o},"drawer"):il(tc.Root,{open:a,onOpenChange:s,children:o},"popover")})}import*as ac from"@radix-ui/react-popover";import{Drawer as i0}from"vaul";import{jsx as Sr,jsxs as o0}from"react/jsx-runtime";function nc({size:e=18}){return o0("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Sr("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),Sr("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Sr("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Sr("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Sr("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Sr("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Sr("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Sr("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Sr("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function oc(){return Sr("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Sr("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ic(){return Sr("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Sr("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as Lo}from"react/jsx-runtime";function sc({asChild:e,children:t,className:r,style:n}){let{isMobile:o,theme:i}=aa(),a=t!=null,s=e??!0,l=r?`al-trigger-btn ${r}`:"al-trigger-btn",d=a?t:Lo("button",{type:"button",className:l,"data-theme":i,"data-track":"open",style:n,children:Lo(nc,{size:18})});return o?Lo(ye,{feature:"app_launcher",children:Lo(i0.Trigger,{asChild:s,children:d})}):Lo(ye,{feature:"app_launcher",children:Lo(ac.Trigger,{asChild:s,children:d})})}import*as pn from"react";import*as ca from"@radix-ui/react-popover";import{Drawer as Do}from"vaul";import{useQuery as l0}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 a0="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",s0="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Jr(e,t){return`${e==="production"?s0:a0}/${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:Jr(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:Jr(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:Jr(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:Jr(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:Jr(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:Jr(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:Jr(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:Jr(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:Jr(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:Jr(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:Jr(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function da(e){let t=ot(e);return l0({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 al(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=al(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as Dt,jsxs as Po}from"react/jsx-runtime";function d0(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}=aa(),{data:l}=da(n),d=pn.useMemo(()=>uc(l?.items??[]),[l?.items]),c=24,b=pn.useRef(null),f=pn.useRef(!1),m=pn.useCallback(x=>{b.current={x:x.clientX,y:x.clientY},f.current=!1},[]),y=pn.useCallback(x=>{let k=b.current;b.current=null,k&&(f.current=Math.abs(x.clientX-k.x)>c||Math.abs(x.clientY-k.y)>c)},[]),g=pn.useCallback(()=>{b.current=null,f.current=!0},[]),u=typeof window<"u"?window.location.pathname:"",p=pn.useCallback((x,k)=>{let R=f.current;if(f.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=al(x),C=I==="ending",S=pc(x.iconUrl,n),E=!1;if(!R)try{let M=new URL(k).pathname;E=u===M||u.startsWith(M+"/")}catch{E=!1}return Dt("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:g,onClick:M=>p(M,x),children:Po("div",{className:"al-grid-item-left",children:[Po("div",{className:"al-grid-item-icon",children:[Dt("img",{src:S,alt:x.label,width:24,height:24,loading:"lazy"}),x.isNew&&Dt("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),Po("span",{className:"al-grid-item-text",children:[Dt("span",{className:"al-grid-item-label",children:x.label}),C&&Dt("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),x.badge&&!d0(x)&&Dt("span",{className:"al-badge al-badge-list",children:x.badge})]})]})},x.id)},h=Dt("div",{className:"al-menu","data-theme":o,children:Dt("div",{className:"al-grid",children:d.map(w)})});return i?Dt(ye,{feature:"app_launcher",children:Po(Do.Portal,{children:[Dt(Do.Overlay,{className:"al-drawer-overlay"}),Po(Do.Content,{className:Re("al-drawer-content",r),"data-theme":o,children:[Po("div",{className:"al-drawer-header",children:[Dt(Do.Close,{className:"al-drawer-close","data-track":"close",children:Dt(oc,{})}),Dt(Do.Title,{className:"al-drawer-title",children:"ONE Services"}),Dt(Do.Close,{className:"al-drawer-close","data-track":"close",children:Dt(ic,{})})]}),Dt("div",{className:"al-drawer-body",children:h})]})]})}):Dt(ye,{feature:"app_launcher",children:Dt(ca.Portal,{children:Dt(ca.Content,{align:e,sideOffset:t,className:Re("al-popover-content",r),"data-theme":o,children:h})})})}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 Xt from"react";import*as cm from"@radix-ui/react-popover";import{Drawer as Jy}from"vaul";import{createContext as c0,useContext as p0}from"react";var sl=c0(null);function Dn(){let e=p0(sl);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}import{WALLET_LABELS as u0}from"@nexus-cross/crossx-design-system";var ll=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(ll||{}),pa={crossx:{name:u0.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 Le,jsxs as ao}from"react/jsx-runtime";function gc({size:e=16,className:t}){return ao("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Le("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"}),Le("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 so({size:e=16,className:t}){return Le("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Le("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 vn({size:e=16,className:t}){return Le("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Le("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Nr({size:e=24,className:t}){return Le("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Le("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function hc({size:e=20,className:t}){return ao("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Le("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"}),Le("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 ua({size:e=20,className:t}){return Le("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:Le("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 $r({size:e=20,className:t}){return Le("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Le("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Lr({size:e=20,className:t}){return Le("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Le("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function bc({size:e=16,className:t}){return ao("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Le("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"}),Le("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 ao("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Le("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"}),Le("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var f0='<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>',m0=`data:image/svg+xml,${encodeURIComponent(f0)}`;function yc({size:e=42,className:t}){return Le("img",{src:m0,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function xc({size:e=20,className:t}){return Le("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Le("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 ao("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Le("defs",{children:ao("linearGradient",{id:"wi-send-solid-grad",x1:"3",y1:"21",x2:"21",y2:"3",gradientUnits:"userSpaceOnUse",children:[Le("stop",{stopColor:"var(--wi-send-solid-from, #f62e61)"}),Le("stop",{offset:"1",stopColor:"var(--wi-send-solid-to, #f7564a)"})]})}),Le("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 Le("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Le("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 Le("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Le("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 Le("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Le("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 ao("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Le("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),Le("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 lo from"bignumber.js";function g0(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 kn(e,t){if(!e||e==="0")return"0.00";let r=new lo(e).shiftedBy(-t),n=r.isGreaterThanOrEqualTo(1)?2:4;return r.toFormat(n,lo.ROUND_DOWN)}function tr(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function co(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let r=t>=1?2:4,n=Math.pow(10,r);return`$${(Math.floor(t*n)/n).toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function fa(e,t,r){let o=new lo(e).shiftedBy(-t).multipliedBy(new lo(r));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(lo.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,lo.ROUND_DOWN):o.decimalPlaces(4,lo.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=g0(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 h0}from"@tanstack/react-query";var mt={dev:{cross:612044,bsc:97,hyper:998},stage:{cross:612044,bsc:97,hyper:998},production:{cross:612055,bsc:56}};function dl(e){let t=mt[e];return[t.cross,t.bsc,t.hyper].filter(r=>r!==void 0)}var ma="https://terms.onechain.nexus/docs/terms-july-23-2026",ga="https://terms.onechain.nexus/docs/pp-july-23-2026",Tc="https://contents.crossdefi.io/Terms/terms/tos-26-07-09-oneusd.html";var b0="send:chain-info";function w0(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===mt[e].cross?Ac(t,n):r?.explorer_url?cl(r.explorer_url,r.explorer_postfix?.transaction??"tx",n):y0(e,t,n)}function Ac(e,t){return cl("https://explorer.onechain.nexus",String(e),"tx",t)}function y0(e,t,r){let n=mt[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 ii(e,t,r,n=!0){let o=h0({queryKey:[b0,e,t],queryFn:async({signal:s})=>{let l=await Me("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 w0(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}=ii(e,t,void 0,r);return{buildTxUrl:Ic(()=>i=>Ec(e,t,n,i),[e,t,n]),chainInfo:n}}var Lc="0x0000000000000000000000000000000000000001";var x0="0xa9059cbb",v0=/^0x[a-fA-F0-9]{40}$/,k0="nexus-cross:dapp-ui:send:recent:",Dc=10;function R0(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function ai(e){return e.toLowerCase()}function un(e){return v0.test(e)}function Pn(e){return ai(e.address)===Lc}function pl(e){return`${k0}${e.toLowerCase()}`}function Oo(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"&&un(n.address)&&typeof n.updatedAt=="number").slice(0,Dc):[]}catch{return[]}}function ul(e,t){if(typeof window>"u")return[];let r=ai(t),n=[{address:r,updatedAt:Date.now()},...Oo(e).filter(o=>o.address!==r)].slice(0,Dc);try{window.localStorage.setItem(pl(e),JSON.stringify(n))}catch{return Oo(e)}return n}function fl(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(pl(e))}catch{}}function po(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 Bo(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=R0(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`${x0}${r}${n}`}function ha(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 ha(e,t,6)}function Pc(e){return ha(e,9,2)}function Oc(e){return e.toLocaleString("en-US")}function ba(e){return e===56||e===97}function wa(e){return e.gasPrice??e.maxFeePerGas}function Bc(e,t=!1){return t?wa(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function ya(e,t=!1){if(t){let r=wa(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 xa(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
- `).toLowerCase()}function C0(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.":C0(e)||r}var S0=2000000000n,N0=1000000000n;async function va(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 ka(e){return BigInt(e)}function T0(e){return`0x${e.toString(16)}`}function I0(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=T0(e.value)),e.data&&(t.data=e.data),t}function E0(e){return e===56||e===97}async function Fc(e){try{let t=await va(e,"eth_gasPrice",[]);return{gasPrice:ka(t)}}catch{return{gasPrice:S0}}}async function A0(e,t){let r=N0;try{let n=await va(e,"eth_maxPriorityFeePerGas",[]);r=ka(n)}catch{}return{maxFeePerGas:t+r,maxPriorityFeePerGas:r}}async function M0(e,t){if(t)return Fc(e);let r;try{r=(await va(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return r?A0(e,ka(r)):Fc(e)}async function Uc(e,t){let r=E0(t.chainId),n=I0(t),[o,i]=await Promise.all([va(e,"eth_estimateGas",[n]),M0(e,r)]);return{gasLimit:ka(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 L0=1500,D0=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=po(t,r.quantity.decimals),s;return i?un(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.")),!Pn(r)&&!un(r.address)&&(o.token="Token contract address is invalid."),{errors:o,rawAmount:o.amount?void 0:s,recipient:i&&un(i)?i:void 0}}function wl({token:e,walletAddress:t,recipient:r,rawAmount:n}){let o=t;return Pn(e)?{to:r,value:n,chainId:e.chainId,from:o}:{to:ai(e.address),data:ml(r,n),value:0n,chainId:e.chainId,from:o}}function P0(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var O0=e=>new Promise(t=>setTimeout(t,e));async function Gc({repository:e,args:t,chainId:r,onSubmitted:n,pollIntervalMs:o=L0,pollMaxAttempts:i=D0}){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 P0(d)?"reverted":"success";await O0(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:b,getTokenPriceUsd:f,onSubmitted:m,onSuccess:y,onFailed:g,onExit:u,onOutlink:p}=e,w=le.useMemo(()=>jc({sendTransaction:d,getTransactionReceipt:c,estimateGas:b}),[d,c,b]),[h,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,te]=le.useState(!1),[O,Z]=le.useState(""),_=le.useRef(0),[ce,xe]=le.useState(null),[he,fe]=le.useState(""),[ge,we]=le.useState(()=>Oo(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(()=>ot(t),[t]),{transactionUrl:it,chainInfo:We}=ii(Te,h.chainId,A||void 0,!0),_e=ni(h.chainId,Te),Be=_e.nativeSymbol??We?.currency_symbol??"",rt=_e.name??We?.name??`Chain ID ${h.chainId}`,Et=le.useRef({nativeSymbol:Be||void 0,networkName:rt,tokenSymbol:h.symbol});Et.current={nativeSymbol:Be||void 0,networkName:rt,tokenSymbol:h.symbol};let ft=le.useMemo(()=>BigInt(h.quantity.numeric||"0"),[h.quantity.numeric]),Ct=le.useMemo(()=>kn(h.quantity.numeric,h.quantity.decimals),[h.quantity.numeric,h.quantity.decimals]),Se=f?.(h),wt=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({})},[h.address,h.chainId]),le.useEffect(()=>{_.current+=1,H(null),Z(""),te(!1)},[h.address,h.chainId,I,S]),le.useEffect(()=>{we(Oo(r))},[r]);let yt=le.useCallback(P=>{C(P),B(ae=>({...ae,recipient:void 0}))},[]),St=le.useCallback(P=>{E(P),B(ae=>({...ae,amount:void 0}))},[]),Ke=le.useCallback(()=>{E(Ct.replace(/,/g,"")),B(P=>({...P,amount:void 0}))},[Ct]),Xe=le.useCallback(P=>{x(P),l?.(P),be("token_selected",{tags:{item_id:P.symbol}}),R("recipient")},[l,be]),$t=le.useCallback(()=>R("token"),[]),At=le.useCallback(()=>{R(P=>{if(P==="result")return"review";if(P===i)return u?.(),P;let ae=Hc.indexOf(P);return ae<=0?(u?.(),P):Hc[ae-1]})},[i,u]),zt=le.useCallback(()=>{let{errors:P}=bl({recipient:I,amount:"1",token:h,balanceRaw:ft});if(P.recipient){B(ae=>({...ae,recipient:P.recipient}));return}B(ae=>({...ae,recipient:void 0})),be("recipient_entered"),R("amount")},[I,h,ft,be]),Mt=le.useCallback(P=>{C(P),B(ae=>({...ae,recipient:void 0})),be("recipient_entered"),R("amount")},[be]),nt=le.useCallback(()=>{let P=bl({recipient:I,amount:S,token:h,balanceRaw:ft});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,h,ft,be]);le.useEffect(()=>{if(k!=="review"||!he||ce===null||G!==null||ie||O||!w.canEstimateGas(We?.rpc))return;let P=++_.current;te(!0),Z(""),(async()=>{try{let ae=wl({token:h,walletAddress:r,recipient:he,rawAmount:ce}),pe=await w.estimateGas(ae,We?.rpc);if(_.current!==P)return;H(pe)}catch(ae){if(_.current!==P)return;Z(hl(ae,Et.current,"Failed to estimate gas."))}finally{_.current===P&&te(!1)}})()},[k,he,ce,G,ie,O,w,We?.rpc,h,r]);let Ge=le.useMemo(()=>{if(!Pn(h)||!G||ce===null)return!1;let P=ya(G,ba(h.chainId));return P===null?!1:ce+P>ft},[h,G,ce,ft]),at=le.useCallback(async()=>{if(!(!he||ce===null)&&!Ge){Y(""),U(""),z("submitting"),be("submitted");try{let P="",ae=await Gc({repository:w,args:wl({token:h,walletAddress:r,recipient:he,rawAmount:ce}),chainId:h.chainId,onSubmitted:pe=>{P=pe,U(pe),z("confirming"),we(ul(r,he)),m?.({txHash:pe,chainId:h.chainId,amount:S,tokenSymbol:h.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:Cr(new Error(pe))}),P&&g?g({txHash:P,chainId:h.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&&g?g({txHash:P,chainId:h.chainId,message:pe}):R("result")}}catch(P){z("error"),be("confirmed",{status:"failure",reason:Cr(P)}),Y(hl(P,{nativeSymbol:Be||void 0,networkName:rt,tokenSymbol:h.symbol})),R("result")}}},[w,he,ce,Ge,h,S,r,m,y,g,Be,rt,be]),[Nt,Pe]=le.useState(!1),st=le.useRef(void 0);le.useEffect(()=>()=>clearTimeout(st.current),[]);let _t=le.useCallback(async()=>{if(A)try{await navigator.clipboard.writeText(A),Pe(!0),clearTimeout(st.current),st.current=setTimeout(()=>Pe(!1),2e3)}catch{}},[A]),F=le.useCallback(()=>{if(!it||!A)return;let P=me=>{typeof window<"u"&&window.open(me,"_blank","noopener,noreferrer")};if(!p){P(it);return}let ae=p(it,{category:"send",origin:"send-transaction",payload:{chainId:h.chainId,txHash:A}});if(ae&&typeof ae.then=="function"){let me=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;ae.then(Je=>{if(Je===null){me?.close();return}let ir=Je??it;if(me)try{me.location.href=ir}catch{me.close(),P(ir)}else P(ir)});return}let pe=ae;pe!==null&&P(pe??it)},[p,h.chainId,it,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:h,tokens:s.length>0?s:[h],recipient:I,amount:S,amountUsd:wt,fieldErrors:M,error:oe,txHash:A,gasEstimate:G,gasLoading:ie,gasError:O,insufficientGas:Ge,reviewRawAmount:ce,reviewRecipient:he,recentAddresses:ge,accounts:o,accountName:n,walletAddress:r,resolvedEnv:Te,transactionUrl:it,networkName:rt,nativeSymbol:Be,nativeDecimals:We?.currency_decimals??h.quantity.decimals,balanceRaw:ft,balanceText:Ct,priceUsd:Se,canSelectToken:(s.length>0?s:[h]).length>1,canSend:w.canSend,getTokenPriceUsd:f,setRecipient:yt,setAmount:St,setMax:Ke,selectToken:Xe,goToTokenSelect:$t,selectRecipient:Mt,submitRecipient:zt,submitAmount:nt,confirmSend:at,retry:ke,back:At,hashCopied:Nt,copyHash:_t,openTransaction:F}}import*as en from"react";import{jsx as si,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=en.useRef(null),d=en.useCallback(()=>{requestAnimationFrame(()=>{let g=l.current;if(!g)return;let u=g.value.length;g.setSelectionRange(u,u)})},[]);en.useEffect(()=>{l.current?.focus(),d()},[d]),en.useEffect(()=>{t===""&&(f(!1),d())},[t,d]);let c=en.useMemo(()=>{let g=po(t,a.quantity.decimals);return"value"in g&&g.value>i},[t,a.quantity.decimals,i]),[b,f]=en.useState(!1),m=!b&&t===""?"0.00":t,y=t.trim()===""||t.trim()==="0";return si("div",{className:"sf-body sf-amount",children:yl("div",{className:"sf-amount-center",children:[si("span",{className:"sf-amount-usd",children:n!==void 0?xa(n):"\xA0"}),si("div",{className:"sf-amount-input-wrap","data-over":c||void 0,"data-empty":y||void 0,onClick:()=>l.current?.focus(),children:si("input",{ref:l,className:"sf-amount-input",value:m,onChange:g=>{let u=g.target.value;if(b)r(u);else if(t===""){if(u.length<4)return;f(!0);let p=u.startsWith("0.00")?u.slice(4):u;r(p)}else f(!0),r(u)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),yl("div",{className:"sf-amount-balance",children:[si("span",{children:"Balance:"}),yl("button",{type:"button",className:"sf-amount-max",onClick:s,"data-track":"amount_max",children:[o," ",a.symbol]})]})]})})}import*as tn from"react";var z0=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function xl(e){return z0.has(e.toLowerCase())}var F0="0x0000000000000000000000000000000000000001",U0={dev:"0x26ca2a92ea9659e073621bb85b9117dc5944cff1",stage:"0x26ca2a92ea9659e073621bb85b9117dc5944cff1",production:"0x6bf62ca91e397b5a7d1d6bce97d9092065d7a510"},j0={dev:"0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb",stage:"0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb",production:"0xff42c13d927a6b9265236619161accb227b6d452"};function Ra(e){let t=mt[e];return[{chainId:t.cross,address:F0},{chainId:t.bsc,address:U0[e]},{chainId:t.cross,address:j0[e]}].map(({chainId:r,address:n})=>({chainId:r,address:n.toLowerCase()}))}var Vc={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function li(e,t){let r=mt[e];if(t===r.cross)return Vc.cross;if(t===r.bsc)return Vc.bsc}var W0={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Rn(e,t,r={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:o,format:i="png"}=r,a=W0[e],s=o?`&bg=${o}`:"";return`${a}/portrait/evm/${t}.${i}?size=${n}${s}`}import{jsx as Dr,jsxs as Ca}from"react/jsx-runtime";function qc({size:e=20,className:t}){return Ca("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[Dr("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),Dr("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Yc({size:e=20,className:t}){return Dr("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:Dr("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 Ca("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[Dr("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),Dr("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Zc({size:e=16,className:t}){return Dr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:Dr("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 Ca("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[Dr("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-green-default, #00b4b7)"}),Dr("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 Ca("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[Dr("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),Dr("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import{jsx as Pt,jsxs as fn}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=tn.useMemo(()=>i.filter(h=>h.address.toLowerCase()!==a.toLowerCase()),[i,a]),c=d.length>0,b=tn.useMemo(()=>new Map(d.map((h,x)=>[tp(h.address),{account:h,index:x}])),[d]),[f,m]=tn.useState("recent"),y=tn.useRef(null);tn.useEffect(()=>{y.current?.focus()},[]);let g="1A1A2E",u=tn.useCallback(async()=>{try{let h=await navigator.clipboard.readText();h&&r(h.trim())}catch{}},[r]),p=t.trim().length>0,w=un(t.trim());return fn("div",{className:"sf-recipient",children:[fn("div",{className:"sf-recipient-top",children:[fn("div",{className:"sf-address-field","data-filled":p||void 0,"data-invalid":n.recipient||void 0,children:[Pt("textarea",{ref:y,className:"sf-address-input",value:t,onChange:h=>r(h.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:p?2:1}),p?Pt("button",{type:"button",className:"sf-address-action",onClick:()=>r(""),"aria-label":"Clear","data-track":"recipient_clear",children:Pt(Kc,{size:20})}):Pt("button",{type:"button",className:"sf-address-action",onClick:u,"aria-label":"Paste from clipboard","data-track":"recipient_paste",children:Pt(Yc,{size:20})})]}),n.recipient&&Pt("p",{className:"sf-field-error",role:"alert",children:n.recipient}),fn("div",{className:"sf-tabs",role:"tablist",children:[Pt("button",{type:"button",role:"tab",className:"sf-tab","data-active":f==="recent"||void 0,"aria-selected":f==="recent",onClick:()=>m("recent"),"data-track":"recipient_tab","data-track-id":"recent",children:"Recent"}),c&&Pt("button",{type:"button",role:"tab",className:"sf-tab","data-active":f==="account"||void 0,"aria-selected":f==="account",onClick:()=>m("account"),"data-track":"recipient_tab","data-track-id":"account",children:"My Account"})]})]}),Pt("div",{className:"sf-address-list",children:f==="account"&&c?d.map((h,x)=>{let k=$c(h,x),R=Rn(s,h.address,{size:56,bg:g});return fn("button",{type:"button",className:"sf-address-row",onClick:()=>l(h.address),"data-track":"recipient_item",children:[fn("span",{className:"sf-address-avatar",children:[R&&Pt("img",{src:R,alt:"",width:40,height:40,draggable:!1,onError:I=>{I.currentTarget.style.display="none"}}),Pt("span",{className:"sf-address-avatar-fallback",children:ep(k)})]}),fn("span",{className:"sf-address-meta",children:[Pt("span",{className:"sf-address-name",children:k}),Pt("span",{className:"sf-address-value",children:tr(h.address)})]})]},h.address)}):o.length>0?o.map(h=>{let x=b.get(tp(h.address)),k=x?$c(x.account,x.index):tr(h.address),R=Rn(s,h.address,{size:56,bg:g});return fn("button",{type:"button",className:"sf-address-row",onClick:()=>l(h.address),"data-track":"recipient_item",children:[fn("span",{className:"sf-address-avatar",children:[R&&Pt("img",{src:R,alt:"",width:40,height:40,draggable:!1,onError:I=>{I.currentTarget.style.display="none"}}),Pt("span",{className:"sf-address-avatar-fallback",children:ep(k)})]}),fn("span",{className:"sf-address-meta",children:[Pt("span",{className:"sf-address-name",children:k}),Pt("span",{className:"sf-address-value",children:tr(h.address)})]})]},h.address)}):Pt("div",{className:"sf-empty",children:"No send history"})}),p&&!w&&!n.recipient&&Pt("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as dr,jsxs as zo}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?zo("div",{className:"sf-body sf-result sf-result--error",children:[dr("span",{className:"sf-result-icon",children:dr(Jc,{size:56})}),zo("div",{className:"sf-result-copy",children:[dr("h3",{className:"sf-result-title",children:"Transaction Failed"}),dr("p",{className:"sf-result-desc",children:n||"Something went wrong. Please try again."})]}),r&&dr(np,{txHash:r,hashCopied:i,onCopy:o,onOpen:a})]}):zo("div",{className:"sf-body sf-result",children:[dr("span",{className:"sf-result-icon","data-pending":!l||void 0,children:l?dr(Xc,{size:56}):dr("span",{className:"sf-result-spinner"})}),zo("div",{className:"sf-result-copy",children:[dr("h3",{className:"sf-result-title",children:l?"Transaction Complete":"Transaction in Progress"}),dr("p",{className:"sf-result-desc",children:l?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),r&&dr(np,{txHash:r,hashCopied:i,onCopy:o,onOpen:a})]})}function np({txHash:e,hashCopied:t,onCopy:r,onOpen:n}){return zo("div",{className:"sf-result-hash-card",children:[dr("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),zo("div",{className:"sf-result-hash-row",children:[dr("button",{type:"button",className:"sf-result-hash-link",onClick:n,"aria-label":"Open transaction in explorer","data-track":"tx_link_open",children:tr(e)}),dr("button",{type:"button",className:"sf-result-copy-btn",onClick:r,"aria-label":"Copy transaction hash","data-track":"tx_hash_copy",children:t?dr(vn,{size:16}):"Copy"})]})]})}import{jsx as xt,jsxs as cr}from"react/jsx-runtime";var Sa="\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:b,gasError:f,insufficientGas:m,error:y,resolvedEnv:g}=e,u=Pn(t),p=r!==null?ha(r,t.quantity.decimals):"",w=o?.trim()||`Account ${(i[0]?.index??0)+1}`,h=Rn(g,a,{size:56,bg:"1A1A2E"}),x=l||(u?t.symbol:""),k=ba(t.chainId),R=c?Bc(c,k):null,I=c?ya(c,k):null,C=L=>L!==null&&x?`${gl(L,d)} ${x}`:Sa,S=L=>L!==void 0?`${Pc(L)} Gwei`:Sa,E=(()=>{if(!u||!c||I===null||r===null)return Sa;let L=r+I;return`${gl(L,d)} ${x||t.symbol}`})(),M=L=>b?"\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?wa(c):void 0))}]:[],{label:"Gas Limit",value:M(c?Oc(c.gasLimit):Sa)}];return cr("div",{className:"sf-body sf-review",children:[cr("div",{className:"sf-review-amount",children:[xt("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"}}),cr("span",{className:"sf-review-amount-value",children:[p,xt("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),cr("div",{className:"sf-review-parties",children:[cr("div",{className:"sf-review-card sf-review-party",children:[xt("span",{className:"sf-review-party-label",children:"From"}),cr("div",{className:"sf-review-party-head",children:[xt("span",{className:"sf-review-party-avatar",children:h&&xt("img",{src:h,alt:"",width:28,height:28,draggable:!1,onError:L=>{L.currentTarget.style.display="none"}})}),xt("span",{className:"sf-review-party-name",children:w})]}),xt("span",{className:"sf-review-party-addr",children:a})]}),xt("span",{className:"sf-review-arrow","aria-hidden":!0,children:xt(Zc,{size:16})}),cr("div",{className:"sf-review-card sf-review-party",children:[xt("span",{className:"sf-review-party-label",children:"To"}),xt("span",{className:"sf-review-party-addr",children:n})]})]}),cr("section",{className:"sf-review-card",children:[xt("h3",{className:"sf-review-section-title",children:"Summary"}),cr("div",{className:"sf-review-row",children:[xt("span",{className:"sf-review-row-label",children:"Network"}),xt("span",{className:"sf-review-row-value",children:s})]}),B.map(L=>cr("div",{className:"sf-review-row",children:[xt("span",{className:"sf-review-row-label",children:L.label}),xt("span",{className:"sf-review-row-value",children:L.value})]},L.label))]}),cr("section",{className:"sf-review-card",children:[xt("h3",{className:"sf-review-section-title",children:"Total"}),cr("div",{className:"sf-review-row",children:[xt("span",{className:"sf-review-row-label",children:"Total Amount"}),cr("span",{className:"sf-review-row-value",children:[p," ",t.symbol]})]}),u&&cr("div",{className:"sf-review-row",children:[xt("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),xt("span",{className:"sf-review-row-value",children:M(E)})]})]}),m&&!f&&!y&&cr("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."]}),(f||y)&&xt("div",{className:"sf-message sf-message--error",role:"alert",children:f||y})]})}import*as Na from"react";import{jsx as On,jsxs as uo}from"react/jsx-runtime";function ap({flow:e}){let[t,r]=Na.useState(""),n=t.trim().toLowerCase(),o=Na.useMemo(()=>n?e.tokens.filter(i=>i.symbol.toLowerCase().includes(n)||i.name.toLowerCase().includes(n)):e.tokens,[e.tokens,n]);return uo("div",{className:"sf-body sf-token-select",children:[uo("div",{className:"sf-search",children:[On(qc,{size:20}),On("input",{className:"sf-search-input",value:t,onChange:i=>r(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),uo("div",{className:"sf-token-list",children:[o.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,s=li(e.resolvedEnv,i.chainId),l=e.getTokenPriceUsd?.(i);return uo("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),"data-track":"token_item","data-track-id":i.symbol,children:[uo("span",{className:"sf-token-left",children:[uo("span",{className:"sf-token-icon-wrap",children:[On("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&&On("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"}})]}),On("span",{className:"sf-token-name",children:i.symbol})]}),uo("span",{className:"sf-token-right",children:[On("span",{className:"sf-token-balance",children:kn(i.quantity.numeric,i.quantity.decimals)}),l!==void 0&&On("span",{className:"sf-token-price",children:xa(l)})]})]},a)}),o.length===0&&On("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))}
6
+ `).toLowerCase()}function C0(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.":C0(e)||r}var S0=2000000000n,N0=1000000000n;async function va(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 ka(e){return BigInt(e)}function T0(e){return`0x${e.toString(16)}`}function I0(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=T0(e.value)),e.data&&(t.data=e.data),t}function E0(e){return e===56||e===97}async function Fc(e){try{let t=await va(e,"eth_gasPrice",[]);return{gasPrice:ka(t)}}catch{return{gasPrice:S0}}}async function A0(e,t){let r=N0;try{let n=await va(e,"eth_maxPriorityFeePerGas",[]);r=ka(n)}catch{}return{maxFeePerGas:t+r,maxPriorityFeePerGas:r}}async function M0(e,t){if(t)return Fc(e);let r;try{r=(await va(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return r?A0(e,ka(r)):Fc(e)}async function Uc(e,t){let r=E0(t.chainId),n=I0(t),[o,i]=await Promise.all([va(e,"eth_estimateGas",[n]),M0(e,r)]);return{gasLimit:ka(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 L0=1500,D0=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=po(t,r.quantity.decimals),s;return i?un(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.")),!Pn(r)&&!un(r.address)&&(o.token="Token contract address is invalid."),{errors:o,rawAmount:o.amount?void 0:s,recipient:i&&un(i)?i:void 0}}function wl({token:e,walletAddress:t,recipient:r,rawAmount:n}){let o=t;return Pn(e)?{to:r,value:n,chainId:e.chainId,from:o}:{to:ai(e.address),data:ml(r,n),value:0n,chainId:e.chainId,from:o}}function P0(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var O0=e=>new Promise(t=>setTimeout(t,e));async function Gc({repository:e,args:t,chainId:r,onSubmitted:n,pollIntervalMs:o=L0,pollMaxAttempts:i=D0}){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 P0(d)?"reverted":"success";await O0(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:b,getTokenPriceUsd:f,onSubmitted:m,onSuccess:y,onFailed:g,onExit:u,onOutlink:p}=e,w=le.useMemo(()=>jc({sendTransaction:d,getTransactionReceipt:c,estimateGas:b}),[d,c,b]),[h,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,te]=le.useState(!1),[O,Z]=le.useState(""),_=le.useRef(0),[ce,xe]=le.useState(null),[he,fe]=le.useState(""),[ge,we]=le.useState(()=>Oo(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(()=>ot(t),[t]),{transactionUrl:it,chainInfo:We}=ii(Te,h.chainId,A||void 0,!0),_e=ni(h.chainId,Te),Be=_e.nativeSymbol??We?.currency_symbol??"",rt=_e.name??We?.name??`Chain ID ${h.chainId}`,Et=le.useRef({nativeSymbol:Be||void 0,networkName:rt,tokenSymbol:h.symbol});Et.current={nativeSymbol:Be||void 0,networkName:rt,tokenSymbol:h.symbol};let ft=le.useMemo(()=>BigInt(h.quantity.numeric||"0"),[h.quantity.numeric]),Ct=le.useMemo(()=>kn(h.quantity.numeric,h.quantity.decimals),[h.quantity.numeric,h.quantity.decimals]),Se=f?.(h),wt=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({})},[h.address,h.chainId]),le.useEffect(()=>{_.current+=1,H(null),Z(""),te(!1)},[h.address,h.chainId,I,S]),le.useEffect(()=>{we(Oo(r))},[r]);let yt=le.useCallback(P=>{C(P),B(ae=>({...ae,recipient:void 0}))},[]),St=le.useCallback(P=>{E(P),B(ae=>({...ae,amount:void 0}))},[]),Ke=le.useCallback(()=>{E(Ct.replace(/,/g,"")),B(P=>({...P,amount:void 0}))},[Ct]),Xe=le.useCallback(P=>{x(P),l?.(P),be("token_selected",{tags:{item_id:P.symbol}}),R("recipient")},[l,be]),$t=le.useCallback(()=>R("token"),[]),At=le.useCallback(()=>{R(P=>{if(P==="result")return"review";if(P===i)return u?.(),P;let ae=Hc.indexOf(P);return ae<=0?(u?.(),P):Hc[ae-1]})},[i,u]),zt=le.useCallback(()=>{let{errors:P}=bl({recipient:I,amount:"1",token:h,balanceRaw:ft});if(P.recipient){B(ae=>({...ae,recipient:P.recipient}));return}B(ae=>({...ae,recipient:void 0})),be("recipient_entered"),R("amount")},[I,h,ft,be]),Mt=le.useCallback(P=>{C(P),B(ae=>({...ae,recipient:void 0})),be("recipient_entered"),R("amount")},[be]),nt=le.useCallback(()=>{let P=bl({recipient:I,amount:S,token:h,balanceRaw:ft});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,h,ft,be]);le.useEffect(()=>{if(k!=="review"||!he||ce===null||G!==null||ie||O||!w.canEstimateGas(We?.rpc))return;let P=++_.current;te(!0),Z(""),(async()=>{try{let ae=wl({token:h,walletAddress:r,recipient:he,rawAmount:ce}),pe=await w.estimateGas(ae,We?.rpc);if(_.current!==P)return;H(pe)}catch(ae){if(_.current!==P)return;Z(hl(ae,Et.current,"Failed to estimate gas."))}finally{_.current===P&&te(!1)}})()},[k,he,ce,G,ie,O,w,We?.rpc,h,r]);let Ge=le.useMemo(()=>{if(!Pn(h)||!G||ce===null)return!1;let P=ya(G,ba(h.chainId));return P===null?!1:ce+P>ft},[h,G,ce,ft]),at=le.useCallback(async()=>{if(!(!he||ce===null)&&!Ge){Y(""),U(""),z("submitting"),be("submitted");try{let P="",ae=await Gc({repository:w,args:wl({token:h,walletAddress:r,recipient:he,rawAmount:ce}),chainId:h.chainId,onSubmitted:pe=>{P=pe,U(pe),z("confirming"),we(ul(r,he)),m?.({txHash:pe,chainId:h.chainId,amount:S,tokenSymbol:h.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:Cr(new Error(pe))}),P&&g?g({txHash:P,chainId:h.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&&g?g({txHash:P,chainId:h.chainId,message:pe}):R("result")}}catch(P){z("error"),be("confirmed",{status:"failure",reason:Cr(P)}),Y(hl(P,{nativeSymbol:Be||void 0,networkName:rt,tokenSymbol:h.symbol})),R("result")}}},[w,he,ce,Ge,h,S,r,m,y,g,Be,rt,be]),[Nt,Pe]=le.useState(!1),st=le.useRef(void 0);le.useEffect(()=>()=>clearTimeout(st.current),[]);let _t=le.useCallback(async()=>{if(A)try{await navigator.clipboard.writeText(A),Pe(!0),clearTimeout(st.current),st.current=setTimeout(()=>Pe(!1),2e3)}catch{}},[A]),F=le.useCallback(()=>{if(!it||!A)return;let P=me=>{typeof window<"u"&&window.open(me,"_blank","noopener,noreferrer")};if(!p){P(it);return}let ae=p(it,{category:"send",origin:"send-transaction",payload:{chainId:h.chainId,txHash:A}});if(ae&&typeof ae.then=="function"){let me=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;ae.then(Je=>{if(Je===null){me?.close();return}let ar=Je??it;if(me)try{me.location.href=ar}catch{me.close(),P(ar)}else P(ar)});return}let pe=ae;pe!==null&&P(pe??it)},[p,h.chainId,it,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:h,tokens:s.length>0?s:[h],recipient:I,amount:S,amountUsd:wt,fieldErrors:M,error:oe,txHash:A,gasEstimate:G,gasLoading:ie,gasError:O,insufficientGas:Ge,reviewRawAmount:ce,reviewRecipient:he,recentAddresses:ge,accounts:o,accountName:n,walletAddress:r,resolvedEnv:Te,transactionUrl:it,networkName:rt,nativeSymbol:Be,nativeDecimals:We?.currency_decimals??h.quantity.decimals,balanceRaw:ft,balanceText:Ct,priceUsd:Se,canSelectToken:(s.length>0?s:[h]).length>1,canSend:w.canSend,getTokenPriceUsd:f,setRecipient:yt,setAmount:St,setMax:Ke,selectToken:Xe,goToTokenSelect:$t,selectRecipient:Mt,submitRecipient:zt,submitAmount:nt,confirmSend:at,retry:ke,back:At,hashCopied:Nt,copyHash:_t,openTransaction:F}}import*as en from"react";import{jsx as si,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=en.useRef(null),d=en.useCallback(()=>{requestAnimationFrame(()=>{let g=l.current;if(!g)return;let u=g.value.length;g.setSelectionRange(u,u)})},[]);en.useEffect(()=>{l.current?.focus(),d()},[d]),en.useEffect(()=>{t===""&&(f(!1),d())},[t,d]);let c=en.useMemo(()=>{let g=po(t,a.quantity.decimals);return"value"in g&&g.value>i},[t,a.quantity.decimals,i]),[b,f]=en.useState(!1),m=!b&&t===""?"0.00":t,y=t.trim()===""||t.trim()==="0";return si("div",{className:"sf-body sf-amount",children:yl("div",{className:"sf-amount-center",children:[si("span",{className:"sf-amount-usd",children:n!==void 0?xa(n):"\xA0"}),si("div",{className:"sf-amount-input-wrap","data-over":c||void 0,"data-empty":y||void 0,onClick:()=>l.current?.focus(),children:si("input",{ref:l,className:"sf-amount-input",value:m,onChange:g=>{let u=g.target.value;if(b)r(u);else if(t===""){if(u.length<4)return;f(!0);let p=u.startsWith("0.00")?u.slice(4):u;r(p)}else f(!0),r(u)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),yl("div",{className:"sf-amount-balance",children:[si("span",{children:"Balance:"}),yl("button",{type:"button",className:"sf-amount-max",onClick:s,"data-track":"amount_max",children:[o," ",a.symbol]})]})]})})}import*as tn from"react";var z0=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function xl(e){return z0.has(e.toLowerCase())}var F0="0x0000000000000000000000000000000000000001",U0={dev:"0x26ca2a92ea9659e073621bb85b9117dc5944cff1",stage:"0x26ca2a92ea9659e073621bb85b9117dc5944cff1",production:"0x6bf62ca91e397b5a7d1d6bce97d9092065d7a510"},j0={dev:"0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb",stage:"0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb",production:"0xff42c13d927a6b9265236619161accb227b6d452"};function Ra(e){let t=mt[e];return[{chainId:t.cross,address:F0},{chainId:t.bsc,address:U0[e]},{chainId:t.cross,address:j0[e]}].map(({chainId:r,address:n})=>({chainId:r,address:n.toLowerCase()}))}var Vc={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function li(e,t){let r=mt[e];if(t===r.cross)return Vc.cross;if(t===r.bsc)return Vc.bsc}var W0={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Rn(e,t,r={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:o,format:i="png"}=r,a=W0[e],s=o?`&bg=${o}`:"";return`${a}/portrait/evm/${t}.${i}?size=${n}${s}`}import{jsx as Dr,jsxs as Ca}from"react/jsx-runtime";function qc({size:e=20,className:t}){return Ca("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[Dr("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),Dr("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Yc({size:e=20,className:t}){return Dr("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:Dr("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 Ca("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[Dr("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),Dr("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Zc({size:e=16,className:t}){return Dr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:Dr("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 Ca("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[Dr("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-green-default, #00b4b7)"}),Dr("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 Ca("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[Dr("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),Dr("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import{jsx as Pt,jsxs as fn}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=tn.useMemo(()=>i.filter(h=>h.address.toLowerCase()!==a.toLowerCase()),[i,a]),c=d.length>0,b=tn.useMemo(()=>new Map(d.map((h,x)=>[tp(h.address),{account:h,index:x}])),[d]),[f,m]=tn.useState("recent"),y=tn.useRef(null);tn.useEffect(()=>{y.current?.focus()},[]);let g="1A1A2E",u=tn.useCallback(async()=>{try{let h=await navigator.clipboard.readText();h&&r(h.trim())}catch{}},[r]),p=t.trim().length>0,w=un(t.trim());return fn("div",{className:"sf-recipient",children:[fn("div",{className:"sf-recipient-top",children:[fn("div",{className:"sf-address-field","data-filled":p||void 0,"data-invalid":n.recipient||void 0,children:[Pt("textarea",{ref:y,className:"sf-address-input",value:t,onChange:h=>r(h.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:p?2:1}),p?Pt("button",{type:"button",className:"sf-address-action",onClick:()=>r(""),"aria-label":"Clear","data-track":"recipient_clear",children:Pt(Kc,{size:20})}):Pt("button",{type:"button",className:"sf-address-action",onClick:u,"aria-label":"Paste from clipboard","data-track":"recipient_paste",children:Pt(Yc,{size:20})})]}),n.recipient&&Pt("p",{className:"sf-field-error",role:"alert",children:n.recipient}),fn("div",{className:"sf-tabs",role:"tablist",children:[Pt("button",{type:"button",role:"tab",className:"sf-tab","data-active":f==="recent"||void 0,"aria-selected":f==="recent",onClick:()=>m("recent"),"data-track":"recipient_tab","data-track-id":"recent",children:"Recent"}),c&&Pt("button",{type:"button",role:"tab",className:"sf-tab","data-active":f==="account"||void 0,"aria-selected":f==="account",onClick:()=>m("account"),"data-track":"recipient_tab","data-track-id":"account",children:"My Account"})]})]}),Pt("div",{className:"sf-address-list",children:f==="account"&&c?d.map((h,x)=>{let k=$c(h,x),R=Rn(s,h.address,{size:56,bg:g});return fn("button",{type:"button",className:"sf-address-row",onClick:()=>l(h.address),"data-track":"recipient_item",children:[fn("span",{className:"sf-address-avatar",children:[R&&Pt("img",{src:R,alt:"",width:40,height:40,draggable:!1,onError:I=>{I.currentTarget.style.display="none"}}),Pt("span",{className:"sf-address-avatar-fallback",children:ep(k)})]}),fn("span",{className:"sf-address-meta",children:[Pt("span",{className:"sf-address-name",children:k}),Pt("span",{className:"sf-address-value",children:tr(h.address)})]})]},h.address)}):o.length>0?o.map(h=>{let x=b.get(tp(h.address)),k=x?$c(x.account,x.index):tr(h.address),R=Rn(s,h.address,{size:56,bg:g});return fn("button",{type:"button",className:"sf-address-row",onClick:()=>l(h.address),"data-track":"recipient_item",children:[fn("span",{className:"sf-address-avatar",children:[R&&Pt("img",{src:R,alt:"",width:40,height:40,draggable:!1,onError:I=>{I.currentTarget.style.display="none"}}),Pt("span",{className:"sf-address-avatar-fallback",children:ep(k)})]}),fn("span",{className:"sf-address-meta",children:[Pt("span",{className:"sf-address-name",children:k}),Pt("span",{className:"sf-address-value",children:tr(h.address)})]})]},h.address)}):Pt("div",{className:"sf-empty",children:"No send history"})}),p&&!w&&!n.recipient&&Pt("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as cr,jsxs as zo}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?zo("div",{className:"sf-body sf-result sf-result--error",children:[cr("span",{className:"sf-result-icon",children:cr(Jc,{size:56})}),zo("div",{className:"sf-result-copy",children:[cr("h3",{className:"sf-result-title",children:"Transaction Failed"}),cr("p",{className:"sf-result-desc",children:n||"Something went wrong. Please try again."})]}),r&&cr(np,{txHash:r,hashCopied:i,onCopy:o,onOpen:a})]}):zo("div",{className:"sf-body sf-result",children:[cr("span",{className:"sf-result-icon","data-pending":!l||void 0,children:l?cr(Xc,{size:56}):cr("span",{className:"sf-result-spinner"})}),zo("div",{className:"sf-result-copy",children:[cr("h3",{className:"sf-result-title",children:l?"Transaction Complete":"Transaction in Progress"}),cr("p",{className:"sf-result-desc",children:l?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),r&&cr(np,{txHash:r,hashCopied:i,onCopy:o,onOpen:a})]})}function np({txHash:e,hashCopied:t,onCopy:r,onOpen:n}){return zo("div",{className:"sf-result-hash-card",children:[cr("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),zo("div",{className:"sf-result-hash-row",children:[cr("button",{type:"button",className:"sf-result-hash-link",onClick:n,"aria-label":"Open transaction in explorer","data-track":"tx_link_open",children:tr(e)}),cr("button",{type:"button",className:"sf-result-copy-btn",onClick:r,"aria-label":"Copy transaction hash","data-track":"tx_hash_copy",children:t?cr(vn,{size:16}):"Copy"})]})]})}import{jsx as xt,jsxs as pr}from"react/jsx-runtime";var Sa="\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:b,gasError:f,insufficientGas:m,error:y,resolvedEnv:g}=e,u=Pn(t),p=r!==null?ha(r,t.quantity.decimals):"",w=o?.trim()||`Account ${(i[0]?.index??0)+1}`,h=Rn(g,a,{size:56,bg:"1A1A2E"}),x=l||(u?t.symbol:""),k=ba(t.chainId),R=c?Bc(c,k):null,I=c?ya(c,k):null,C=L=>L!==null&&x?`${gl(L,d)} ${x}`:Sa,S=L=>L!==void 0?`${Pc(L)} Gwei`:Sa,E=(()=>{if(!u||!c||I===null||r===null)return Sa;let L=r+I;return`${gl(L,d)} ${x||t.symbol}`})(),M=L=>b?"\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?wa(c):void 0))}]:[],{label:"Gas Limit",value:M(c?Oc(c.gasLimit):Sa)}];return pr("div",{className:"sf-body sf-review",children:[pr("div",{className:"sf-review-amount",children:[xt("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"}}),pr("span",{className:"sf-review-amount-value",children:[p,xt("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),pr("div",{className:"sf-review-parties",children:[pr("div",{className:"sf-review-card sf-review-party",children:[xt("span",{className:"sf-review-party-label",children:"From"}),pr("div",{className:"sf-review-party-head",children:[xt("span",{className:"sf-review-party-avatar",children:h&&xt("img",{src:h,alt:"",width:28,height:28,draggable:!1,onError:L=>{L.currentTarget.style.display="none"}})}),xt("span",{className:"sf-review-party-name",children:w})]}),xt("span",{className:"sf-review-party-addr",children:a})]}),xt("span",{className:"sf-review-arrow","aria-hidden":!0,children:xt(Zc,{size:16})}),pr("div",{className:"sf-review-card sf-review-party",children:[xt("span",{className:"sf-review-party-label",children:"To"}),xt("span",{className:"sf-review-party-addr",children:n})]})]}),pr("section",{className:"sf-review-card",children:[xt("h3",{className:"sf-review-section-title",children:"Summary"}),pr("div",{className:"sf-review-row",children:[xt("span",{className:"sf-review-row-label",children:"Network"}),xt("span",{className:"sf-review-row-value",children:s})]}),B.map(L=>pr("div",{className:"sf-review-row",children:[xt("span",{className:"sf-review-row-label",children:L.label}),xt("span",{className:"sf-review-row-value",children:L.value})]},L.label))]}),pr("section",{className:"sf-review-card",children:[xt("h3",{className:"sf-review-section-title",children:"Total"}),pr("div",{className:"sf-review-row",children:[xt("span",{className:"sf-review-row-label",children:"Total Amount"}),pr("span",{className:"sf-review-row-value",children:[p," ",t.symbol]})]}),u&&pr("div",{className:"sf-review-row",children:[xt("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),xt("span",{className:"sf-review-row-value",children:M(E)})]})]}),m&&!f&&!y&&pr("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."]}),(f||y)&&xt("div",{className:"sf-message sf-message--error",role:"alert",children:f||y})]})}import*as Na from"react";import{jsx as On,jsxs as uo}from"react/jsx-runtime";function ap({flow:e}){let[t,r]=Na.useState(""),n=t.trim().toLowerCase(),o=Na.useMemo(()=>n?e.tokens.filter(i=>i.symbol.toLowerCase().includes(n)||i.name.toLowerCase().includes(n)):e.tokens,[e.tokens,n]);return uo("div",{className:"sf-body sf-token-select",children:[uo("div",{className:"sf-search",children:[On(qc,{size:20}),On("input",{className:"sf-search-input",value:t,onChange:i=>r(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),uo("div",{className:"sf-token-list",children:[o.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,s=li(e.resolvedEnv,i.chainId),l=e.getTokenPriceUsd?.(i);return uo("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),"data-track":"token_item","data-track-id":i.symbol,children:[uo("span",{className:"sf-token-left",children:[uo("span",{className:"sf-token-icon-wrap",children:[On("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&&On("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"}})]}),On("span",{className:"sf-token-name",children:i.symbol})]}),uo("span",{className:"sf-token-right",children:[On("span",{className:"sf-token-balance",children:kn(i.quantity.numeric,i.quantity.decimals)}),l!==void 0&&On("span",{className:"sf-token-price",children:xa(l)})]})]},a)}),o.length===0&&On("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 jt,jsxs as Ta}from"react/jsx-runtime";var G0={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function Ia({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,b=un(l.recipient.trim()),f=po(l.amount,l.token.quantity.decimals),m="value"in f&&f.value<=l.balanceRaw,y=c==="submitting"||c==="confirming",g=d!=="result",u=G0[d]??"";return jt(ye,{feature:"send",children:Ta("div",{className:Re("sf-root",o),"data-step":d,children:[Ta("header",{className:"sf-header",children:[g?jt("button",{type:"button",className:"sf-header-btn",onClick:l.back,"aria-label":"Back","data-track":"back",children:jt($r,{size:24})}):jt("span",{className:"sf-header-btn","aria-hidden":!0}),jt("span",{className:"sf-header-title",children:u}),jt("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close","data-track":"close",children:jt(Nr,{size:24})})]}),d==="token"&&jt(ap,{flow:l}),d==="recipient"&&jt(rp,{flow:l}),d==="amount"&&jt(Qc,{flow:l}),d==="review"&&jt(ip,{flow:l}),d==="result"&&jt(op,{flow:l}),Ta("footer",{className:"sf-footer","data-step":d,children:[d==="recipient"&&jt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitRecipient,"data-disabled":!b||void 0,"aria-disabled":!b,"data-track":"recipient_next",children:"Next"}),d==="amount"&&jt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitAmount,"data-disabled":!m||void 0,"aria-disabled":!m,"data-track":"amount_next",children:"Next"}),d==="review"&&Ta("div",{className:"sf-footer-row",children:[jt("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:l.back,disabled:y,"data-track":"review_cancel",children:"Cancel"}),jt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.confirmSend,disabled:y||!l.canSend||l.insufficientGas,"data-track":"review_send",children:y?"Sending...":"Send"})]}),d==="result"&&c==="success"&&jt("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"&&jt("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 H0}from"vaul";import{jsx as Ea,jsxs as _0}from"react/jsx-runtime";function dp({asChild:e,className:t,children:r}){let{isMobile:n,theme:o,walletAddress:i}=Dn(),a=r!=null,s=e??!0,l=a?r:_0("button",{type:"button",className:Re("wi-trigger-btn",t),"data-theme":o,"data-mobile":n||void 0,children:[Ea(gc,{size:n?14:16}),Ea("span",{className:"wi-trigger-address",children:tr(i)})]});return n?Ea(H0.Trigger,{asChild:s,children:l}):Ea(lp.Trigger,{asChild:s,children:l})}import*as q from"react";import*as cs from"@radix-ui/react-popover";import{Drawer as ds}from"vaul";import om from"bignumber.js";import vl from"bignumber.js";var Q0=/^[+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i;function pt(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(!Q0.test(t))return null;let r=new vl(t);return r.isFinite()?r:null}import{useQueries as V0}from"@tanstack/react-query";import{useMemo as q0}from"react";var kl="user-balance";async function Y0(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 Bn(e,t,r=!0){let n=dl(e),o=V0({queries:n.map(l=>({queryKey:[kl,e,t,l],queryFn:async({signal:d})=>Y0(await Me("walletServer",e),l,t,d),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1}))}),i=o.some(l=>l.isLoading),a=o.some(l=>l.isError);return{tokens:q0(()=>{let l=[];for(let d of o)d.data&&l.push(...d.data);return l},[o]),isLoading:i,isError:a}}import{useQuery as K0,useQueries as Z0}from"@tanstack/react-query";import{useMemo as X0}from"react";var J0="forge-holdings",$0="forge-token-image";async function eb(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 tb(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}=K0({queryKey:[J0,e,t],queryFn:async({signal:i})=>eb(await Me("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=Z0({queries:t.map(i=>({queryKey:[$0,e,i],queryFn:async({signal:a})=>tb(await Me("bondingCurve",e),i,a),enabled:r,staleTime:1/0}))});return{imageMap:X0(()=>{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 rb}from"@tanstack/react-query";import{useMemo as nb}from"react";var Rl="token-stats";function mn(e,t){return`${e}:${t.toLowerCase()}`}function zn(e,t=!0){let{data:r,...n}=rb({queryKey:[Rl,e],queryFn:async({signal:i})=>{let a=await Me("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:nb(()=>{let i=new Map;if(!r?.data)return i;for(let a of r.data){let s=mn(a.chain_id,a.address);i.set(s,a)}return i},[r]),...n}}import{useQuery as ob}from"@tanstack/react-query";var ib="crossd-apr",up=6e4,ab="https://crossd-dashboard-api.crossdefi.io/api/v1/overview",Aa,di;function Cl(){return Aa&&Aa.expiresAt>Date.now()?Promise.resolve(Aa.value):di||(di=(async()=>{let e=await fetch(ab,{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 Aa={value:n,expiresAt:Date.now()+up},n})().finally(()=>{di=void 0}),di)}function Ma(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}=ob({queryKey:[ib],queryFn:Cl,staleTime:up});return{aprPercent:e??null,...t}}import{useQuery as sb}from"@tanstack/react-query";import{useMemo as mp}from"react";var lb="token-info";function La(e,t){return`${t.toLowerCase()}_${e}`}function gp(e,t=!0){let{data:r,...n}=sb({queryKey:[lb,e],queryFn:async({signal:a})=>{let s=await Me("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=La(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(La(s.chain_id,s.address),s);return a},[r]);return{categoryMap:o,infoMap:i,...n}}import{useMemo as db}from"react";import cb from"bignumber.js";function hp(e,t,r){let{tokens:n,isLoading:o}=Bn(e,t,r),{statsMap:i}=zn(e,r);return db(()=>{let a=new cb(0);for(let c of n){let b=i.get(mn(c.chainId,c.address));if(!b)continue;let f=pt(c.quantity.numeric),m=pt(b.price);if(!f||!m)continue;let y=f.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 wp from"bignumber.js";var pb=/^0x[0-9a-f]{40}$/i;function ub(e){if(typeof e=="number")return Number.isSafeInteger(e)&&e>0?e:void 0;if(typeof e!="string")return;let t=e.trim().startsWith("eip155:")?e.trim().slice(7):e.trim();if(!/^\d+$/.test(t))return;let r=Number(t);return Number.isSafeInteger(r)&&r>0?r:void 0}function yp(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let r of e){if(!r||typeof r!="object")return;let{chainId:n,address:o}=r,i=ub(n);if(i===void 0||typeof o!="string")return;let a=o.trim();if(!pb.test(a))return;t.push({chainId:i,address:a.toLowerCase()})}return t}function fb(e){return new Map(e.map((t,r)=>[`${t.chainId}:${t.address.toLowerCase()}`,r]))}var mb=new wp("0.0001");function Sl(e){return(pt(e.quantity.numeric)??new wp(0)).shiftedBy(-e.quantity.decimals)}function gb(e){return parseInt(e.split(":")[1],10)}function bp(e,t){return`${e}:${t.toLowerCase()}`}function hb(e,t){return`${t.toLowerCase()}_${e}`}function xp({env:e,tokens:t,pinnedTokens:r,preferredTokens:n,statsMap:o,categoryMap:i,showGameToken:a}){let s=[],l=[],d=[],c=[],b=mt[e].hyper,f=fb(r??Ra(e)),m=new Map((n??[]).map((g,u)=>[`${gb(g.chainId)}:${g.address.toLowerCase()}`,u]));for(let g of t){let u=`${g.chainId}:${g.address.toLowerCase()}`,p=f.has(u),w=m.get(u);if(p)s.push(g);else if(w!==void 0)d.push(g);else if(Sl(g).isGreaterThanOrEqualTo(mb)){if(!a&&i.get(hb(g.chainId,g.address))==="game")continue;b!==void 0&&g.chainId===b?l.push(g):c.push(g)}}s.sort((g,u)=>{let p=f.get(`${g.chainId}:${g.address.toLowerCase()}`)??99,w=f.get(`${u.chainId}:${u.address.toLowerCase()}`)??99;return p-w}),d.sort((g,u)=>{let p=m.get(`${g.chainId}:${g.address.toLowerCase()}`)??99,w=m.get(`${u.chainId}:${u.address.toLowerCase()}`)??99;return p-w});let y=(g,u)=>{let p=o.get(bp(g.chainId,g.address)),w=o.get(bp(u.chainId,u.address)),h=Sl(g).multipliedBy(pt(p?.price)??0);return Sl(u).multipliedBy(pt(w?.price)??0).minus(h).toNumber()};return l.sort(y),c.sort(y),[...s,...l,...d,...c]}import*as Da from"react";var vp=new Set;function bb(e){vp.has(e)||(vp.add(e),console.warn(`[dapp-ui] apps.json walletInfo.pinnedTokens (${e}) \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC544 \uBB34\uC2DC\uD569\uB2C8\uB2E4 \u2014 \uAE30\uBCF8 \uACE0\uC815 \uBAA9\uB85D\uC73C\uB85C \uD3F4\uBC31\uD569\uB2C8\uB2E4.`))}function kp(e){let t=Ut(Ji,e,Da.useCallback(n=>{let o=n?.walletInfo?.pinnedTokens;if(o===void 0)return;let i=yp(o);if(!i){bb(e);return}return i},[e])),r=Da.useMemo(()=>Ra(e),[e]);return t??r}import{QRCodeSVG as Qy}from"qrcode.react";import{WALLET_LABELS as Vy}from"@nexus-cross/crossx-design-system";import{WALLET_LABELS as xb}from"@nexus-cross/crossx-design-system";import{WALLET_LABELS as Nl}from"@nexus-cross/crossx-design-system";import{jsx as Fe,jsxs as fo}from"react/jsx-runtime";var wb='<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>',yb=`data:image/svg+xml,${encodeURIComponent(wb)}`;function Pa(){return Fe("img",{src:yb,width:40,height:40,alt:"",style:{display:"block"}})}function Rp(){return fo("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[fo("g",{clipPath:"url(#clip0_1331_27065)",children:[Fe("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"}),Fe("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"}),Fe("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"}),Fe("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"}),Fe("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"}),Fe("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),Fe("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"})]}),Fe("defs",{children:Fe("clipPath",{id:"clip0_1331_27065",children:Fe("rect",{width:"40",height:"40",fill:"white"})})})]})}function Cp(){return fo("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Fe("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),Fe("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),Fe("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),Fe("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),Fe("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 Sp(){return fo("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[Fe("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),Fe("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"}),Fe("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),Fe("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 Np(){return fo("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[fo("g",{clipPath:"url(#clip0_1185_7785)",children:[Fe("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"}),Fe("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"})]}),Fe("defs",{children:Fe("clipPath",{id:"clip0_1185_7785",children:Fe("rect",{width:"28",height:"28",fill:"white"})})})]})}function Tp(){return fo("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[Fe("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"}),Fe("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"}),Fe("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"}),Fe("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 Ip(){return Fe("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:Fe("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 Ep(){return Fe("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Fe("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var ci={cross_embedded:{id:"cross_embedded",name:Nl.social,description:"Sign in with Google or Apple",icon:Pa},cross_wallet:{id:"cross_wallet",name:Nl.app,description:"App approval is required",icon:Pa,featured:!0},cross_extension:{id:"cross_extension",name:Nl.extension,description:"Browser extension approval is required",icon:Pa,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:Rp,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:Cp},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Sp,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Np,badge:"For SHOP"}};function Tl(e){return ci[e]}var Il={google:{id:"google",name:"Google",icon:Tp},apple:{id:"apple",name:"Apple",icon:Ip}};function Ap(e){return Il[e]}var Mp="dappui.wcm.last-selected",vb=new Set(["google","apple"]);function Lp(e){try{window.localStorage.setItem(Mp,e)}catch{}}function Dp(){let e=null;try{e=window.localStorage.getItem(Mp)}catch{return}if(e)return vb.has(e)?xb.default:ci[e]?.name}function Ot(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=b=>{if(b===null){d?.close();return}let f=b??t;if(d)try{d.location.href=f}catch{d.close(),i(f)}else i(f)};o.then(c,b=>{console.error("[dapp-ui] onOutlink rejected:",b),d?.close()});return}let s=o;if(s===null)return;i(s??t)}import*as ho from"react";import{Drawer as g1}from"vaul";import{createContext as Sb,useContext as Nb,useMemo as Tb}from"react";import Pr from"bignumber.js";var kb=/^(\d{4}-\d{2}-\d{2})/;function Pp(e){if(!e||e.length===0)return;let t=new Map,r;for(let{key:o,cumulative:i}of e.map(a=>({key:kb.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 Op(e){return e.poolType==="Unknown"}function Oa(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Ba(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}function pi(e,t){let r=e.length+t.length;if(r>32)return"xs";if(r>24)return"sm"}function El(e){return e?.toUpperCase()==="WONE"?"ONE":e}var Rb=["Request Arguments:","Details:","Docs:","Version:","Contract Call:"];function ui(e,t){console.error("[wallet-portfolio] withdraw failed:",e);let n=e instanceof Error?e.message:"";for(let i of Rb){let a=n.indexOf(i);a>=0&&(n=n.slice(0,a))}return n.split(`
8
- `).map(i=>i.trim()).find(i=>i.length>0)||t}var Cb="0xe00e8bf3";function Bp(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`${Cb}${n}${o}`}function Fo(e){return!e||e<=0n?"0":new Pr(e.toString()).shiftedBy(-9).toFormat(2,Pr.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function za(e){return!e||e<=0n?"0":new Pr(e.toString()).toFormat(0,Pr.ROUND_DOWN)}function Fa(e){if(!e||e<=0n)return"0";let t=new Pr(e.toString()).shiftedBy(-18),r=t.isLessThan(1e-4)?7:4;return t.toFormat(r,Pr.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function gn(e,t){let r=new Pr(e).shiftedBy(-t);return!r.isFinite()||r.isZero()?"0":r.isGreaterThanOrEqualTo(1)?r.toFormat(2,Pr.ROUND_DOWN):r.toFormat(4,Pr.ROUND_DOWN)}function Al(e){return gn(e,0)}var fi={rate:1,symbol:"$"};function mo(e,t=fi){let r=Number.isFinite(t.rate)&&t.rate>0?t.rate:1;return`${t.symbol||"$"}${e.times(r).toFormat(2,Pr.ROUND_DOWN)}`}function Fn(e,t,r,n=fi){let o=new Pr(r||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let i=new Pr(e||"0").shiftedBy(-t).times(o);return i.isFinite()?mo(i,n):null}var mi=Sb(null);function vt(){let e=Nb(mi);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}function Or(){let{conversionRatio:e,currencySymbol:t}=vt();return Tb(()=>({rate:typeof e=="number"&&e>0?e:fi.rate,symbol:t||fi.symbol}),[e,t])}import{Drawer as Ib}from"vaul";import{jsx as zp}from"react/jsx-runtime";function Fp({asChild:e,children:t}){let{walletAddress:r}=vt(),n=t!=null,o=e??!0,i=n?t:zp("button",{type:"button",children:tr(r)});return zp(Ib.Trigger,{asChild:o,children:i})}import{Drawer as Ka}from"vaul";import*as Rt from"react";import{useQueryClient as f1}from"@tanstack/react-query";import{createContext as Eb,useContext as Ab}from"react";var Ml=Eb(null);function Up(){return Ab(Ml)}import{jsx as pr,jsxs as Ga}from"react/jsx-runtime";function jp({size:e=22,className:t}){return pr("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:pr("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Wp({size:e=22,className:t}){return Ga("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[pr("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),pr("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 Gp({size:e=12,className:t}){return pr("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:pr("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ua({size:e=16,className:t}){return Ga("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[pr("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"}),pr("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 ja({size:e=16,className:t}){return pr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:pr("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Wa({size:e=48,className:t}){return Ga("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[pr("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),pr("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 Tr({size:e=12,className:t}){return Ga("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:[pr("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"}),pr("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),pr("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import{useQuery as Mb}from"@tanstack/react-query";import{useMemo as Hp}from"react";var Lb="wp:reward-pools";function Uo(e,t=!0){let{data:r,...n}=Mb({queryKey:[Lb,e],queryFn:async({signal:a})=>{let s=await Me("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=Hp(()=>r?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[r]),i=Hp(()=>r?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[r]);return{crossPools:o,gamePools:i,allPools:r?.data.pools??[],...n}}import{useQuery as Db}from"@tanstack/react-query";import{useMemo as Pb}from"react";var Ob="wp:user-deposits";function Ha(e,t,r=!0){let n=r&&!!t,{data:o,...i}=Db({queryKey:[Ob,e,t],queryFn:async({signal:s})=>{let l=await Me("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:Pb(()=>{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 Bb}from"@tanstack/react-query";import{useMemo as zb}from"react";var _p={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Qp={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var Vp={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var Ll={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},qp={dev:`${Ll.dev}/portfolio`,stage:`${Ll.stage}/portfolio`,production:`${Ll.production}/portfolio`};var Yp={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Br={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"},_a={dev:"https://stg-swap-api.crossdefi.io",stage:"https://stg-swap-api.crossdefi.io",production:"https://swap-api.crossdefi.io"},Kp={dev:"https://stg.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://www.crossdefi.io"},Zp={dev:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",stage:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",production:"0xEFd871aF7D695A0c1709e46b565761F4cd1Ef5ba"},Xp={dev:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",stage:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",production:"0x731a104a4461ae45bfef520468b43c262d35e682"};var Fb="wp:token-info",Ub="0x0000000000000000000000000000000000000001";function hn(e,t=!0){let r=mt[e].cross,{data:n,...o}=Bb({queryKey:[Fb,e],queryFn:async({signal:c})=>{let b=await Me("walletServer",e),f=await fetch(`${b}/v1/public/token/info`,{cache:"no-store",signal:c});if(!f.ok)throw new Error(`Failed to fetch token info: ${f.status}`);let m=await f.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:a}=zb(()=>{let c=new Map,b=new Map;if(!n?.data)return{byChainAddr:c,byChainSym:b};for(let f of n.data){let m=f.address.toLowerCase();c.set(`${f.chain_id}:${m}`,f),c.set(m,f);let y=f.symbol.replace(/^t/,"").toUpperCase(),g=`${f.chain_id}:${y}`;b.has(g)||b.set(g,f),b.has(y)||b.set(y,f)}return{byChainAddr:c,byChainSym:b}},[n]);return{getTokenImage:(c,b,f)=>{let m=c.toLowerCase(),y=!!f?.chainOnly,g=i.get(`${r}:${m}`);if(g?.image)return g.image;if(!y){let u=i.get(m);if(u?.image)return u.image}if(b){let u=b.replace(/^t/,"").toUpperCase(),p=a.get(`${r}:${u}`);if(p?.image)return p.image;if(!y){let w=a.get(u);if(w?.image)return w.image}}return""},getTokenSymbol:(c,b,f)=>{let m=c.toLowerCase();return(i.get(`${r}:${m}`)??(f?.chainOnly?void 0:i.get(m)))?.symbol||b},getNativeToken:()=>i.get(`${r}:${Ub}`),...o}}import*as Pl from"react";import{jsx as Dl,jsxs as Jp}from"react/jsx-runtime";function zr({sectionKey:e,title:t,icon:r,iconFit:n="cover",isEmpty:o,loading:i=!1,children:a}){let s=Up();return Pl.useEffect(()=>{s?.report(e,{loading:i,empty:o})},[s,e,i,o]),Pl.useEffect(()=>()=>s?.unregister(e),[s,e]),o?null:Jp("div",{className:"wp-svc-card",children:[Jp("div",{className:"wp-svc-card-head",children:[Dl("img",{className:"wp-svc-card-icon",src:r,alt:"",style:{objectFit:n}}),Dl("span",{className:"wp-svc-card-title",children:t})]}),Dl("div",{className:"wp-svc-items",children:a})]})}import Ol from"bignumber.js";import{jsx as rr,jsxs as ur}from"react/jsx-runtime";var jb="ONErewards";function Wb(e){return new Ol(e||"0").isGreaterThan(0)}function $p(){let{env:e,walletAddress:t,onOutlink:r}=vt(),n=Or(),o=!!t,{allPools:i,isLoading:a}=Uo(e,o),{depositMap:s,isLoading:l}=Ha(e,t,o),{getTokenImage:d}=hn(e,o),c=(m,y)=>`${_p[e]}/gametoken/tokens/${m.deposit_token.address}?mode=rewards${y==="withdraw"?"&trade=withdraw":""}`,b=`${Br[e]}/reward.png`,f=i.filter(m=>{let y=s.get(m.pool_address.toLowerCase()),g=y?.deposited_amount??"0",u=y?.claimable_reward??"0";return!(new Ol(g).isZero()&&new Ol(u).isZero())});return rr(zr,{sectionKey:"rewards",title:jb,icon:b,isEmpty:f.length===0,loading:a||l,children:f.map(m=>{let y=s.get(m.pool_address.toLowerCase()),g=y?.deposited_amount??"0",u=y?.claimable_reward??"0",p=c(m,"withdraw"),w=c(m,"claim"),h=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?gn(u,x.decimals):"0",S=x?.symbol??"Reward",E=Fn(g,m.deposit_token.decimals,m.deposit_token.price,n),M=x?Fn(u,x.decimals,x.price,n):null,B=!!y&&Wb(u);return ur("article",{className:"wp-item","data-side":"reward",children:[ur("div",{className:"wp-item-body",children:[ur("div",{className:"wp-item-line",children:[rr("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),ur("div",{className:"wp-svc-token",children:[ur("span",{className:"wp-token-stack","aria-hidden":!0,children:[h&&rr("img",{className:"wp-svc-token-icon",src:h,alt:""}),k&&rr("img",{className:"wp-svc-token-icon",src:k,alt:""})]}),rr("span",{children:I})]})]}),ur("div",{className:"wp-item-line",children:[rr("span",{className:"wp-item-label",children:"Deposited"}),ur("div",{className:"wp-svc-token wp-svc-token--amount",children:[h&&rr("img",{className:"wp-svc-token-icon",src:h,alt:""}),ur("div",{className:"wp-svc-amount",children:[rr("span",{className:"wp-svc-amount-main",children:gn(g,m.deposit_token.decimals)}),E&&rr("span",{className:"wp-item-usd",children:E})]})]})]}),ur("div",{className:"wp-item-line",children:[ur("span",{className:"wp-item-label",children:["Claimable (",S,")"]}),ur("div",{className:"wp-svc-token wp-svc-token--amount",children:[k&&rr("img",{className:"wp-svc-token-icon",src:k,alt:""}),ur("div",{className:"wp-svc-amount",children:[rr("span",{className:"wp-svc-amount-main",children:C}),M&&rr("span",{className:"wp-item-usd",children:M})]})]})]})]}),ur("div",{className:"wp-item-tags",children:[ur("a",{className:"wp-tag wp-tag--muted",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"rewards_withdraw_open",onClick:L=>Ot(L,p,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:y}},r),children:[rr("span",{className:"wp-tag-label",children:"Withdraw"}),rr(Tr,{size:12,className:"wp-tag-icon"})]}),ur("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}Ot(L,w,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:y}},r)},children:[rr("span",{className:"wp-tag-label",children:"Claim"}),rr(Tr,{size:12,className:"wp-tag-icon"})]})]})]},m.pool_address)})})}import*as lu from"react";import{useQuery as Kb}from"@tanstack/react-query";import{useMemo as Qa}from"react";var Gb="0x70a08231",Hb="0x18160ddd",_b="0x313ce567",Qb=8e3;async function Vb(e,t,r,n){let o=new AbortController,i=setTimeout(()=>o.abort(),Qb);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 qb(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function gi(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function Cn(e,t,r,n,o){try{return await Vb(e,"eth_call",[o?{from:o,to:t,data:r}:{to:t,data:r},"latest"],n)}catch{return}}async function Yb(e,t,r,n){let[o,i,a]=await Promise.all([Cn(e,r,Gb+qb(t),n),Cn(e,r,Hb,n),Cn(e,r,_b,n)]),s=gi(o);if(s===void 0)return null;let l=gi(a);return{balance:s,totalSupply:gi(i),decimals:l!==void 0?Number(l):void 0}}async function hi(e,t){let r=mt[e].cross,n=await Me("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 eu(e,t,r,n){if(!t||r.length===0)return{};let o;try{o=await hi(e,n)}catch{o=void 0}if(!o)return{};let i=await Promise.all(r.map(async s=>[s.toLowerCase(),await Yb(o,t,s,n)])),a={};for(let[s,l]of i)l&&(a[s]=l);return a}var Zb="wp:withdraw-token-meta",Xb="0xc89039c5",Jb="0x95d89b41",$b="0x313ce567";function ew(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 tw(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 rw(e,t,r){if(t.length===0)return{};let n;try{n=await hi(e,r)}catch{n=void 0}if(!n)return{};let o=await Promise.all(t.map(async a=>{let s=tw(await Cn(n,a,Xb,r));if(!s)return[a.toLowerCase(),null];let[l,d]=await Promise.all([Cn(n,s,Jb,r),Cn(n,s,$b,r)]),c=ew(l),b=gi(d);return c?[a.toLowerCase(),{tokenAddress:s,symbol:c,decimals:b!==void 0?Number(b):18}]:[a.toLowerCase(),null]})),i={};for(let[a,s]of o)s&&(i[a]=s);return i}function tu(e,t,r=!0){let o=r&&!!t,{allPools:i,isLoading:a}=Uo(e,o),{deposits:s,isLoading:l}=Ha(e,t,o),d=Qa(()=>{let u=new Map;for(let p of i)u.set(p.pool_address.toLowerCase(),p);return u},[i]),c=Qa(()=>s.filter(u=>{try{return BigInt(u.deposited_amount||"0")>0n}catch{return!1}}),[s]),b=Qa(()=>c.map(u=>u.pool_address.toLowerCase()).filter(u=>!d.has(u)).sort(),[c,d]),{data:f,isLoading:m}=Kb({queryKey:[Zb,e,b],queryFn:({signal:u})=>rw(e,b,u),enabled:o&&b.length>0,staleTime:1440*60*1e3});return{positions:Qa(()=>{let u=[];for(let p of c){let w=p.pool_address.toLowerCase(),h=d.get(w);if(h){u.push({poolId:p.pool_id,poolAddress:p.pool_address,poolType:h.pool_type,tokenSymbol:h.deposit_token.symbol,tokenAddress:h.deposit_token.address,decimals:h.deposit_token.decimals,price:h.deposit_token.price,depositedRaw:p.deposited_amount});continue}let x=f?.[w];x&&u.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 u},[c,d,f]),isLoading:a||l||m}}import*as Yt from"react";import{Fragment as ru,jsx as De,jsxs as Tt}from"react/jsx-runtime";var nw=400;function ow(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":`${Fa(e.gasLimit*n)} ${r??""}`.trim()}function Bl(e,t,r){return r==="loading"?"Estimating...":r==="error"||r==="unavailable"?"-":`${e} ${t}`.trim()}function iw({position:e,size:t}){return e.icon?De("img",{src:e.icon,alt:"",width:t,height:t}):De("span",{children:e.tokenSymbol.slice(0,1)})}function nu({open:e,status:t,positions:r,initialPoolAddress:n,walletAddress:o,txHash:i,error:a,copied:s=!1,estimateWithdraw:l,onClose:d,onConfirm:c,onCopyHash:b,trackFunnel:f,nativeSymbol:m}){let[y,g]=Yt.useState(null),[u,p]=Yt.useState("idle"),w=Yt.useRef(0),h=Yt.useRef(void 0),x=Yt.useRef(null);Yt.useEffect(()=>()=>clearTimeout(h.current),[]);let k=Yt.useMemo(()=>{let z=n?.toLowerCase();return r.find(A=>A.poolAddress.toLowerCase()===z)??r[0]??null},[r,n]),R=Yt.useMemo(()=>{try{return BigInt(k?.depositedRaw??"0")}catch{return 0n}},[k?.depositedRaw]),I=k?.decimals??18;Yt.useEffect(()=>{!e||!k||f?.("position_selected")},[e,k,f]);let C=Yt.useCallback(()=>{g(null),p(l?"idle":"unavailable"),w.current+=1,x.current=null},[]);if(Yt.useEffect(()=>{e&&C()},[e,C]),Yt.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(h.current);return}if(!l||!k){clearTimeout(h.current),p("unavailable");return}if(R<=0n){clearTimeout(h.current),w.current+=1,x.current=null,g(null),p("idle");return}let z=`${k.poolAddress.toLowerCase()}:${R.toString()}`;if(x.current===z)return;x.current=z,clearTimeout(h.current);let A=w.current+1;w.current=A,p("loading"),h.current=setTimeout(()=>{l(k,R).then(U=>{w.current===A&&(g(U??null),p(U?"ready":"unavailable"))}).catch(()=>{w.current===A&&(g(null),p("error"))})},nw)},[e,t,R,l,k]),!e||!k)return null;let S=t==="submitting",E=Fo(y?.maxPriorityFeePerGas),M=Fo(y?.maxFeePerGas??y?.gasPrice),B=za(y?.gasLimit),L=gn(k.depositedRaw,I);return De("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:z=>{z.target===z.currentTarget&&!S&&d()},children:Tt("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:[De("div",{className:"wp-claim-grabber","aria-hidden":!0,children:De("span",{})}),Tt("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?Tt(ru,{children:[De("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:De(Wa,{})}),Tt("div",{className:"wp-claim-copy",children:[De("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),De("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),De("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:Tt("div",{className:"wp-claim-list-item",children:[De("span",{children:"Tx Hash"}),Tt("button",{type:"button",className:"wp-claim-hash",onClick:b,"aria-label":"Copy transaction hash","data-track":"withdraw_hash_copy",children:[De("strong",{children:Ba(i)}),s?De(ja,{}):De(Ua,{})]})]})})]}):Tt(ru,{children:[t==="error"&&Tt("div",{className:"wp-claim-heading",children:[De("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),De("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),Tt("div",{className:"wp-claim-reward-card","data-fit":pi(k.tokenSymbol,L),"aria-label":"Deposited balance",children:[De("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:De(iw,{position:k,size:28})}),De("strong",{className:"wp-claim-reward-symbol",children:k.tokenSymbol}),De("strong",{className:"wp-claim-reward-amount",children:L})]}),Tt("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[Tt("div",{className:"wp-claim-account-row",children:[Tt("div",{className:"wp-claim-account",children:[De("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),Tt("strong",{children:[k.tokenSymbol," Pool"]})]}),De("span",{children:Oa(o)})]}),De("span",{className:"wp-claim-divider","aria-hidden":!0}),Tt("div",{className:"wp-claim-detail-list",children:[Tt("div",{className:"wp-claim-detail-row",children:[De("span",{children:"Est. Tx Fee"}),De("strong",{children:ow(y,u,m)})]}),Tt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[De("span",{children:"Priority Fee Per Gas"}),De("strong",{children:Bl(E,"Gwei",u)})]}),Tt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[De("span",{children:"Max Fee Per Gas"}),De("strong",{children:Bl(M,"Gwei",u)})]}),Tt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[De("span",{children:"Gas Limit"}),De("strong",{children:Bl(B,"",u)})]})]})]})]}),Tt("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&De("button",{type:"button",className:"wp-claim-secondary","data-track":"withdraw_cancel",onClick:d,children:t==="error"?"Close":"Cancel"}),Tt("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"&&De("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),De("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:De("span",{})})]})})}import*as kt from"react";import{useQueryClient as lw}from"@tanstack/react-query";import{useQuery as aw}from"@tanstack/react-query";var sw="wp:reward-factory-info";function ou(e,t=!0){let{data:r,...n}=aw({queryKey:[sw,e],queryFn:async({signal:o})=>{let i=await Me("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 iu="wp:";function Un(e){return e.invalidateQueries({predicate:t=>typeof t.queryKey[0]=="string"&&t.queryKey[0].startsWith("wp:")})}function au(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function su(e){let{env:t,walletAddress:r,sendTransaction:n,estimateGas:o}=vt(),i=!!r,a=!!n,s=lw(),{routerAddress:l}=ou(t,i&&a),d=au(l),[c,b]=kt.useState(!1),[f,m]=kt.useState(void 0),[y,g]=kt.useState("confirm"),[u,p]=kt.useState(),[w,h]=kt.useState(""),[x,k]=kt.useState(!1),R=kt.useRef(void 0);kt.useEffect(()=>()=>clearTimeout(R.current),[]);let I=kt.useRef(new Set),C=kt.useCallback((U,oe)=>{I.current.has(U)||(I.current.add(U),Qe("withdraw",U,{...oe,tags:{section:e,...oe?.tags}}))},[e]),S=kt.useCallback((U,oe)=>d?{to:d,value:0n,data:Bp(U,oe),chainId:mt[t].cross}:null,[t,d]),E=kt.useCallback(()=>{Un(s)},[s]),M=kt.useCallback(U=>{m(U),b(!0),g("confirm"),p(void 0),h(""),k(!1),I.current=new Set,C("opened")},[C]),B=kt.useCallback(()=>{y!=="submitting"&&(b(!1),m(void 0),g("confirm"),p(void 0),h(""),k(!1),y==="success"&&E())},[y,E]),L=kt.useCallback(async(U,oe)=>{if(!o)return null;let Y=S(U.poolId,oe),G=au(r);return!Y||!G?null:o({...Y,from:G})},[S,o,r]),z=kt.useCallback(async()=>{if(!(!u||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(u),k(!0),clearTimeout(R.current),R.current=setTimeout(()=>k(!1),1400)}catch{k(!1)}},[u]),A=kt.useCallback(async(U,oe,Y)=>{if(!n){g("error"),h("Withdraw is not available for this wallet.");return}if(!d){g("error"),h("Withdraw contract address is not available.");return}try{g("submitting"),h("");let G=S(U.poolId,oe);if(!G){g("error"),h("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),g("success"),C("confirmed"),E()}catch(G){g("error"),h(ui(G,"Failed to request withdraw.")),C("confirmed",{status:"failure",reason:Cr(G)})}},[S,E,d,n,C]);return{canWithdrawInline:a,isOpen:c,initialPoolAddress:f,status:y,txHash:u,error:w,copied:x,hasEstimator:!!o,openWithdraw:M,closeWithdraw:B,estimateWithdraw:L,confirmWithdraw:A,copyHash:z,trackFunnelOnce:C}}import{Fragment as cw,jsx as wr,jsxs as Sn}from"react/jsx-runtime";var dw="ONEpoints";function du(){let{env:e,walletAddress:t,onOutlink:r}=vt(),n=Or(),o=!!t,{getTokenImage:i,getNativeToken:a}=hn(e,o),s=su("points"),{positions:l,isLoading:d}=tu(e,t,o),c=lu.useMemo(()=>l.filter(Op).map(m=>({...m,icon:i(m.tokenAddress,m.tokenSymbol)})),[l,i]),b=`${Br[e]}/point.png`,f=Qp[e];return Sn(cw,{children:[wr(zr,{sectionKey:"points",title:dw,icon:b,isEmpty:c.length===0,loading:d,children:c.map(m=>{let y=m.price?Fn(m.depositedRaw,m.decimals,m.price,n):null;return Sn("article",{className:"wp-item","data-side":"reward",children:[Sn("div",{className:"wp-item-body",children:[Sn("div",{className:"wp-item-line",children:[wr("span",{className:"wp-item-label",children:"Token"}),Sn("div",{className:"wp-svc-token",children:[m.icon&&wr("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),wr("span",{children:m.tokenSymbol})]})]}),Sn("div",{className:"wp-item-line",children:[wr("span",{className:"wp-item-label",children:"Deposited"}),Sn("div",{className:"wp-svc-token wp-svc-token--amount",children:[m.icon&&wr("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),Sn("div",{className:"wp-svc-amount",children:[wr("span",{className:"wp-svc-amount-main",children:gn(m.depositedRaw,m.decimals)}),y&&wr("span",{className:"wp-item-usd",children:y})]})]})]})]}),wr("div",{className:"wp-item-tags",children:s.canWithdrawInline?wr("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"points_withdraw_open",onClick:()=>s.openWithdraw(m.poolAddress),children:wr("span",{className:"wp-tag-label",children:"Withdraw"})}):Sn("a",{className:"wp-tag wp-tag--muted",href:f,target:"_blank",rel:"noopener noreferrer","data-track":"points_withdraw_open",onClick:g=>Ot(g,f,{category:"portfolio",origin:"portfolio-points",payload:{position:m}},r),children:[wr("span",{className:"wp-tag-label",children:"Withdraw"}),wr(Tr,{size:12,className:"wp-tag-icon"})]})})]},m.poolAddress)})}),wr(nu,{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 zl from"react";import{useQuery as pw}from"@tanstack/react-query";var uw="wp:stake-info";function cu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=pw({queryKey:[uw,e,t],queryFn:async({signal:s})=>{let l=await Me("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 fw}from"@tanstack/react-query";var mw="wp:stake-rewards",gw=31;function pu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=fw({queryKey:[mw,e,t],queryFn:async({signal:a})=>{let s=await Me("posa",e),l=await fetch(`${s}/rewards/${t}?limit=${gw}`,{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:Pp(o),...i}}import{useQuery as hw}from"@tanstack/react-query";var bw="wp:staking-onchain";function uu(e,t,r=!0){let n=r&&!!t&&!!e,{data:o,...i}=hw({queryKey:[bw,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 fu}from"react";import ww from"bignumber.js";function mu(e){return e?.trim().toUpperCase()==="ONE"}function gu(e){return new ww(e||"0").isGreaterThan(0)}function Va(e,t,r=!0){let{allPools:n}=Uo(e,r),o=fu(()=>{for(let d of n)for(let c of[d.deposit_token,...d.reward_tokens])if(mu(c?.symbol)&&gu(c.price))return c.price},[n]),i=r&&o===void 0,{tokens:a}=Bn(e,t,i),{statsMap:s}=zn(e,i),l=mt[e].cross;return fu(()=>{if(o)return o;let d=a.find(c=>c.chainId===l&&mu(c.symbol));if(d){let c=s.get(mn(d.chainId,d.address));if(c&&gu(c.price))return c.price}return"0"},[o,a,s,l])}import Wn from"bignumber.js";import{jsx as Fr,jsxs as jn}from"react/jsx-runtime";function yw(e){if(!e)return"\u2014";let t=new Wn(e);return t.isFinite()?`${t.toFormat(2,Wn.ROUND_DOWN)}%`:"\u2014"}function hu(){let{env:e,walletAddress:t,onOutlink:r,stakingRewardsReader:n}=vt(),o=Or(),i=!!t,{stakeInfo:a,isLoading:s}=cu(e,t,i),{latestReward:l,aprAccrued:d,isLoading:c}=pu(e,t,i),{onchain:b}=uu(t,n,i),f=Va(e,t,i),{getNativeToken:m}=hn(e,i),y=m()?.symbol,g="ONEstaking",u=`${Br[e]}/cross-staking.png`,p=qp[e],w=a?.total_stake??"0",h=zl.useMemo(()=>b?new Wn(b.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??a?.rewards_earned??"0",[b,l,a]),x=zl.useMemo(()=>b?new Wn(b.stakedWei.toString()).shiftedBy(-18):new Wn(w),[b,w]),k=d!==void 0?new Wn(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 Wn(w).isZero()&&new Wn(h).isZero()),S=Fn(w,0,f,o),E=Fn(h,0,f,o);return Fr(zr,{sectionKey:"staking",title:g,icon:u,iconFit:"contain",isEmpty:!C,loading:s||c,children:jn("article",{className:"wp-item","data-side":"stake",children:[jn("div",{className:"wp-item-body",children:[jn("div",{className:"wp-item-line",children:[Fr("span",{className:"wp-item-label",children:"Staked"}),jn("div",{className:"wp-svc-amount",children:[Fr("span",{className:"wp-svc-amount-main",children:`${Al(w)} ${y??""}`.trim()}),S&&Fr("span",{className:"wp-item-usd",children:S})]})]}),jn("div",{className:"wp-item-line",children:[Fr("span",{className:"wp-item-label",children:"Rewards Earned"}),jn("div",{className:"wp-svc-amount",children:[Fr("span",{className:"wp-svc-amount-main",children:`${Al(h)} ${y??""}`.trim()}),E&&Fr("span",{className:"wp-item-usd",children:E})]})]}),jn("div",{className:"wp-item-line",children:[Fr("span",{className:"wp-item-label",children:"My APR"}),Fr("span",{children:yw(I?.toString(10))})]})]}),Fr("div",{className:"wp-item-tags",children:jn("a",{className:"wp-tag wp-tag--mint",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"stake_outlink",onClick:M=>Ot(M,p,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a}},r),children:[Fr("span",{className:"wp-tag-label",children:"Manage"}),Fr(Tr,{size:12,className:"wp-tag-icon"})]})})]})})}import*as Fl from"react";import{useQuery as xw}from"@tanstack/react-query";var vw="wp:game-swap-pools";function bu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=xw({queryKey:[vw,e,t],queryFn:async({signal:a})=>{let s=await Me("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 kw}from"@tanstack/react-query";var Rw="wp:game-swap-lp-balances";function wu(e,t,r,n){let o=[...r].map(l=>l.toLowerCase()).sort(),i=!!t&&o.length>0,{data:a,...s}=kw({queryKey:[Rw,e,t,o,!!n],queryFn:async({signal:l})=>{let d=n?await n(o):await eu(e,t,o,l),c={};for(let[b,f]of Object.entries(d))c[b.toLowerCase()]=f;return c},enabled:i,staleTime:0});return{balances:a??{},...s}}import Nn from"bignumber.js";import{jsx as Ur,jsxs as rn}from"react/jsx-runtime";var Cw="Gametoken LP",xu=18,Sw=new Nn("0.0001");function yu(e){return e?.trim().toUpperCase()==="ONE"}function Nw(e){return e&&e>0?e:xu}function Tw(e){let t=yu(e.token_a?.symbol)&&!yu(e.token_b?.symbol),r=t?e.reserve_a:e.reserve_b,n=Nw(t?e.token_a?.decimals:e.token_b?.decimals),o=new Nn(r||"0").shiftedBy(-n);return!o.isFinite()||o.isLessThanOrEqualTo(0)?new Nn(0):o.times(2)}function Iw(e,t,r,n){let o=e.token_a?.symbol?.trim()||"TOKEN",i=e.token_b?.symbol?.trim()||n||"?",a=t?.decimals??xu,s,l;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let d=new Nn(t.balance.toString()),c=new Nn(t.totalSupply.toString()),b=d.div(c);s=b.times(100);let f=b.times(Tw(e));if(f.isGreaterThan(0)){let m=new Nn(e.quote_usd??e.cross_usd??"0");l=m.isGreaterThan(0)?mo(f.times(m),r):`${f.toFormat(4,Nn.ROUND_DOWN)} ${n??""}`.trim()}}return{pool:e,tokenASymbol:o,tokenBSymbol:i,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:a,sharePercent:s,valueText:l}}function vu(){let{env:e,walletAddress:t,onOutlink:r,lpBalanceReader:n}=vt(),o=Or(),i=!!t,{pools:a,isLoading:s}=bu(e,t,i),l=Fl.useMemo(()=>a.map(p=>p.pair_address).filter(Boolean),[a]),{balances:d,isLoading:c}=wu(e,t,l,n),{getNativeToken:b}=hn(e,i),f=b()?.symbol,m=`${Br[e]}/game-token.png`,y=Object.keys(d).length>0,g=Fl.useMemo(()=>{let p=a.map(w=>Iw(w,d[w.pair_address?.toLowerCase()],o,f));return y?p.filter(w=>w.lpAmountRaw?new Nn(w.lpAmountRaw).shiftedBy(-w.lpDecimals).isGreaterThanOrEqualTo(Sw):!1):p},[a,d,y,o,f]),u=p=>{let w=p.token_a?.address??p.pair_address;return`${Yp[e]}/gametoken/tokens/${w}?trade=deposit`};return Ur(zr,{sectionKey:"gameSwap",title:Cw,icon:m,iconFit:"contain",isEmpty:g.length===0,loading:s||c,children:g.map(p=>{let{pool:w}=p,h=u(w),x=`${p.tokenASymbol} / ${p.tokenBSymbol}`,k=w.token_a?.logo_url,R=w.token_b?.logo_url;return rn("article",{className:"wp-item","data-side":"game-swap",children:[rn("div",{className:"wp-item-body",children:[rn("div",{className:"wp-item-line",children:[Ur("span",{className:"wp-item-label",children:"Pool"}),rn("div",{className:"wp-svc-token",children:[rn("span",{className:"wp-token-stack","aria-hidden":!0,children:[k&&Ur("img",{className:"wp-svc-token-icon",src:k,alt:""}),R&&Ur("img",{className:"wp-svc-token-icon",src:R,alt:""})]}),Ur("span",{children:x})]})]}),p.lpAmountRaw!==void 0&&rn("div",{className:"wp-item-line",children:[Ur("span",{className:"wp-item-label",children:"My LP"}),rn("span",{children:[gn(p.lpAmountRaw,p.lpDecimals)," LP"]})]}),p.sharePercent!==void 0&&rn("div",{className:"wp-item-line",children:[Ur("span",{className:"wp-item-label",children:"Pool Share"}),rn("span",{children:[p.sharePercent.toFormat(2,Nn.ROUND_DOWN),"%"]})]}),p.valueText!==void 0&&rn("div",{className:"wp-item-line",children:[Ur("span",{className:"wp-item-label",children:"Value"}),Ur("span",{children:p.valueText})]})]}),Ur("div",{className:"wp-item-tags",children:rn("a",{className:"wp-tag wp-tag--mint",href:h,target:"_blank",rel:"noopener noreferrer","data-track":"gameswap_outlink","data-track-id":x,onClick:I=>Ot(I,h,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:w}},r),children:[Ur("span",{className:"wp-tag-label",children:"Manage"}),Ur(Tr,{size:12,className:"wp-tag-icon"})]})})]},w.pair_address)})})}import go from"bignumber.js";import{useMemo as Ow}from"react";import{useQuery as Ew}from"@tanstack/react-query";var Aw="wp:forge-pools";function ku(e,t,r=!0){let n=r&&!!t,{data:o,...i}=Ew({queryKey:[Aw,e,t],queryFn:async()=>{let s=await Me("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 Mw}from"@tanstack/react-query";import{useMemo as Lw}from"react";var Dw="wp:forge-token-detail";async function Pw(e,t){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return r.ok?(await r.json())?.data?.token??null:null}function Ru(e,t,r=!0){let n=Mw({queries:t.map(a=>({queryKey:[Dw,e,a],queryFn:async()=>Pw(await Me("bondingCurve",e),a),enabled:r&&!!a,staleTime:3e4}))}),o=Lw(()=>{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 yr,jsxs as Gn}from"react/jsx-runtime";var Bw="ONEforge",Cu=18,zw="https://contents.crosstoken.io/wallet/token/images/FT.png";function Fw(e){if(!e||e==="0")return"0";let t=new go(e).shiftedBy(-Cu);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,go.ROUND_DOWN):t.toFormat(4,go.ROUND_DOWN)}function Uw(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 jw(e,t,r,n){let o=new go(r||"0");if(!o.isGreaterThan(0))return null;let i=new go(e.total_supply||"0"),a=new go(e.lp_balance||"0"),s=new go(t?.reserve_b||"0").shiftedBy(-Cu);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()?mo(c,n):null}function Su(){let{env:e,walletAddress:t,onOutlink:r}=vt(),n=Or(),o=!!t,{pools:i,isEmpty:a,isLoading:s}=ku(e,t,o),l=Ow(()=>i.map(m=>m.token.address),[i]),{detailMap:d}=Ru(e,l,o&&l.length>0),c=Va(e,t,o),b=m=>`${Vp[e]}/forge/token/${m.token.address}`,f=`${Br[e]}/forge.png`;return yr(zr,{sectionKey:"forge",title:Bw,icon:f,iconFit:"contain",isEmpty:a,loading:s,children:i.map(m=>{let y=d.get(m.token.address.toLowerCase()),g=y?.image_url||y?.image||m.token.image||zw,u=y?.symbol||m.token.symbol,p=b(m),w=jw(m,y,c,n);return Gn("a",{className:"wp-item","data-side":"lp",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"forge_outlink","data-track-id":u,onClick:h=>Ot(h,p,{category:"portfolio",origin:"portfolio-forge",payload:{pool:m,tokenDetail:y}},r),children:[Gn("div",{className:"wp-item-body",children:[Gn("div",{className:"wp-item-line",children:[yr("span",{className:"wp-item-label",children:"Asset"}),Gn("div",{className:"wp-svc-token",children:[yr("img",{className:"wp-svc-token-icon",src:g,alt:""}),yr("span",{children:u}),y?.name&&yr("span",{className:"wp-token-subtle",children:y.name})]})]}),Gn("div",{className:"wp-item-line",children:[yr("span",{className:"wp-item-label",children:"LP Balance"}),yr("div",{className:"wp-svc-token wp-svc-token--amount",children:Gn("div",{className:"wp-svc-amount",children:[yr("span",{className:"wp-svc-amount-main",children:Fw(m.lp_balance)}),w&&yr("span",{className:"wp-item-usd",children:w})]})})]}),Gn("div",{className:"wp-item-line",children:[yr("span",{className:"wp-item-label",children:"Ownership"}),yr("span",{className:"wp-line-value",children:Uw(m.pool_ownership)})]})]}),yr("div",{className:"wp-item-tags",children:Gn("span",{className:"wp-tag wp-tag--muted",children:[yr("span",{className:"wp-tag-label",children:"Withdraw"}),yr(Tr,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}import{useMemo as Fu}from"react";import c1 from"bignumber.js";import{useQuery as Ww}from"@tanstack/react-query";var Gw="wp:crossd-positions";function Hw(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 Nu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=Ww({queryKey:[Gw,e,t],queryFn:async()=>{let s=await fetch(`${_a[e]}/api/v1/positions?owner=${t}`,{cache:"no-store"});if(!s.ok)throw new Error(`crossd positions fetch failed: ${s.status}`);return Hw(await s.json())},enabled:n,staleTime:0}),a=o??[];return{positions:a,isEmpty:a.length===0,...i}}import{useQueries as _w}from"@tanstack/react-query";import{useMemo as Qw}from"react";var Vw="wp:crossd-position-details";function qw(e){let t=e??{},r=t.data??t;return r?.token_id||r?.pool?r:null}function Tu(e,t,r=!0){let n=_w({queries:t.map(i=>({queryKey:[Vw,e,i],queryFn:async()=>{let a=await fetch(`${_a[e]}/api/v1/positions/${i}`,{cache:"no-store"});if(!a.ok)throw new Error(`crossd position detail failed: ${a.status}`);return qw(await a.json())},enabled:r&&!!i,staleTime:6e4}))});return{detailMap:Qw(()=>{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 Tn from"react";import{Fragment as Eu,jsx as Ie,jsxs as Kt}from"react/jsx-runtime";var Yw=300*1e3,Iu="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Kw(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":`${Fa(e.gasLimit*n)} ${r??""}`.trim()}function Ul(e,t,r){return r?"Estimating...":`${e} ${t}`.trim()}function Au({open:e,status:t,target:r,token0Icon:n,token1Icon:o,token0Symbol:i,token1Symbol:a,nativeSymbol:s,txHash:l,error:d,copied:c=!1,hasEstimator:b,prepareWithdraw:f,confirmWithdraw:m,onClose:y,onCopyHash:g,trackFunnel:u}){let[p,w]=Tn.useState(null),[h,x]=Tn.useState(null),k=Tn.useRef(0);Tn.useEffect(()=>{if(!e||!r)return;let _=++k.current;w(null),x(null),u?.("dialog_opened"),f().then(ce=>{k.current===_&&(w(ce),x(ce?Date.now():null))})},[e,r]);let R=t==="submitting",I=t==="estimating"||t==="confirm"&&!p,C=Tn.useCallback(async()=>{let _=p,ce=!h||Date.now()-h>Yw;if(!_||ce){let xe=++k.current;if(_=await f(),k.current!==xe)return;w(_),x(_?Date.now():null)}_&&await m(_)},[p,h,f,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||Iu,Y=o||B?.logo_url||Iu,G=`${L}/${z}`,H=p?Bo(p.expectedAmount0.toString(),A):null,ie=p?Bo(p.expectedAmount1.toString(),U):null,te=Fo(p?.estimate?.maxPriorityFeePerGas),O=Fo(p?.estimate?.maxFeePerGas??p?.estimate?.gasPrice),Z=za(p?.estimate?.gasLimit);return Ie("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:_=>{_.target===_.currentTarget&&!R&&y()},children:Kt("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",{})}),Kt("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&l?Kt(Eu,{children:[Ie("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:Ie(Wa,{})}),Kt("div",{className:"wp-claim-copy",children:[Ie("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),Kt("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:Kt("div",{className:"wp-claim-list-item",children:[Ie("span",{children:"Tx Hash"}),Kt("button",{type:"button",className:"wp-claim-hash",onClick:g,"aria-label":"Copy transaction hash","data-track":"crossd_withdraw_hash_copy",children:[Ie("strong",{children:Ba(l)}),c?Ie(ja,{}):Ie(Ua,{})]})]})})]}):Kt(Eu,{children:[t==="error"&&Kt("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."})]}),Kt("div",{className:"wp-claim-reward-card","data-fit":pi(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..."})]}),Kt("div",{className:"wp-claim-reward-card","data-fit":pi(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..."})]}),b&&Ie("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:Kt("div",{className:"wp-claim-detail-list",children:[Kt("div",{className:"wp-claim-detail-row",children:[Ie("span",{children:"Est. Tx Fee"}),Ie("strong",{children:Kw(p?.estimate,I,s)})]}),Kt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ie("span",{children:"Priority Fee Per Gas"}),Ie("strong",{children:Ul(te,"Gwei",I)})]}),Kt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ie("span",{children:"Max Fee Per Gas"}),Ie("strong",{children:Ul(O,"Gwei",I)})]}),Kt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ie("span",{children:"Gas Limit"}),Ie("strong",{children:Ul(Z,"",I)})]})]})})]}),Kt("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||(u?.("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 bt from"react";import{useQueryClient as s1}from"@tanstack/react-query";var Zw="0x0c49ccbe",Xw="0xfc6f7865",Jw="0x49404b7c",$w="0xdf2ab5bb",e1="0xac9650d8",Mu=(1n<<128n)-1n,Du=600n,t1=99n,r1=100n;function jl(e){return e*t1/r1}function Lu(e,t){return!!e&&!!t&&e.toLowerCase()===t.toLowerCase()}function xr(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 qa(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 Wl(e){return Zw+xr(e.tokenId,"tokenId")+xr(e.liquidity,"liquidity")+xr(e.amount0Min,"amount0Min")+xr(e.amount1Min,"amount1Min")+xr(e.deadline,"deadline")}function n1(e){return Xw+xr(e.tokenId,"tokenId")+qa(e.recipient,"recipient")+xr(e.amount0Max,"amount0Max")+xr(e.amount1Max,"amount1Max")}function o1(e,t){return Jw+xr(e,"amountMinimum")+qa(t,"recipient")}function i1(e,t,r){return $w+qa(e,"token")+xr(t,"amountMinimum")+qa(r,"recipient")}function a1(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 xr(BigInt(i.length/2),"callLength")+a.toLowerCase()}),r=BigInt(e.length)*32n,n=[];for(let o of t)n.push(xr(r,"callOffset")),r+=BigInt(o.length/2);return e1+xr(0x20n,"arrayOffset")+xr(BigInt(e.length),"arrayLength")+n.join("")+t.join("")}function Pu(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 Ou(e){let t=Lu(e.token0,e.wcrossAddress),r=Lu(e.token1,e.wcrossAddress),n=t||r,o=[Wl({tokenId:e.tokenId,liquidity:e.liquidity,amount0Min:e.amount0Min,amount1Min:e.amount1Min,deadline:e.deadline}),n1({tokenId:e.tokenId,recipient:n?e.positionManagerAddress:e.owner,amount0Max:Mu,amount1Max:Mu})];return n&&(o.push(o1(0n,e.owner)),o.push(i1(t?e.token1:e.token0,0n,e.owner))),a1(o)}async function Bu(e,t,r){let n;try{n=await hi(e,r)}catch{n=void 0}if(!n)return null;let o=Wl({tokenId:t.tokenId,liquidity:t.liquidity,amount0Min:0n,amount1Min:0n,deadline:t.deadline}),i=await Cn(n,t.positionManager,o,r,t.owner);return Pu(i)}var l1=[1500,3e3,4500,6e3];function d1(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function zu(){let{env:e,walletAddress:t,sendTransaction:r,estimateGas:n}=vt(),o=!!r,i=s1(),[a,s]=bt.useState(!1),[l,d]=bt.useState(null),[c,b]=bt.useState("confirm"),[f,m]=bt.useState(),[y,g]=bt.useState(""),[u,p]=bt.useState(!1),[w,h]=bt.useState(new Set),x=bt.useRef(void 0),k=bt.useRef([]),R=bt.useRef(0);bt.useEffect(()=>()=>{clearTimeout(x.current),k.current.forEach(clearTimeout)},[]);let I=bt.useRef(new Set),C=bt.useCallback((A,U)=>{I.current.has(A)||(I.current.add(A),Qe("withdraw",A,{...U,tags:{section:"crossdPool",...U?.tags}}))},[]),S=bt.useCallback(()=>{let A=()=>Un(i);A(),k.current.forEach(clearTimeout),k.current=l1.map(U=>setTimeout(A,U))},[i]),E=bt.useCallback(A=>{R.current+=1,d(A),s(!0),b("confirm"),m(void 0),g(""),p(!1),I.current=new Set,C("opened")},[C]),M=bt.useCallback(()=>{c!=="submitting"&&(R.current+=1,s(!1),d(null),b("confirm"),m(void 0),g(""),p(!1))},[c]),B=bt.useCallback(async()=>{let A=R.current,U=d1(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 b("error"),g("Position data is incomplete. Please refresh and retry."),null;try{b("estimating"),g("");let ie=BigInt(oe),te=BigInt(Y),O=BigInt(Math.floor(Date.now()/1e3))+Du,Z=Zp[e],_=await Bu(e,{owner:U,positionManager:Z,tokenId:ie,liquidity:te,deadline:O});if(R.current!==A)return null;if(!_)return b("error"),g("Failed to estimate withdrawal amounts. Please retry."),null;let ce=Ou({tokenId:ie,liquidity:te,amount0Min:jl(_.amount0),amount1Min:jl(_.amount1),deadline:O,owner:U,positionManagerAddress:Z,token0:G,token1:H,wcrossAddress:Xp[e]}),xe={to:Z,value:0n,data:ce,chainId:mt[e].cross},he=null;if(n){try{he=await n({...xe,from:U})}catch{he=null}if(R.current!==A)return null}return b("confirm"),{tx:xe,estimate:he,expectedAmount0:_.amount0,expectedAmount1:_.amount1}}catch(ie){return R.current!==A||(b("error"),g(ui(ie,"Failed to prepare withdraw."))),null}},[e,n,l,t]),L=bt.useCallback(async A=>{if(!r){b("error"),g("Withdraw is not available for this wallet.");return}try{b("submitting"),g(""),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),b("success");let oe=l?.position.token_id;oe&&h(Y=>{let G=new Set(Y);return G.add(oe),G}),C("confirmed"),S()}catch(U){b("error"),g(ui(U,"Failed to request withdraw.")),C("confirmed",{status:"failure",reason:Cr(U)})}},[S,r,l,C]),z=bt.useCallback(async()=>{if(!(!f||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(f),p(!0),clearTimeout(x.current),x.current=setTimeout(()=>p(!1),1400)}catch{p(!1)}},[f]);return{canWithdrawInline:o,isOpen:a,target:l,withdrawnTokenIds:w,status:c,txHash:f,error:y,copied:u,hasEstimator:!!n,openWithdraw:E,closeWithdraw:M,prepareWithdraw:B,confirmWithdraw:L,copyHash:z,trackFunnelOnce:C}}import{Fragment as u1,jsx as vr,jsxs as Hn}from"react/jsx-runtime";var p1="ONEusd Pool",Uu="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function ju(){let{env:e,walletAddress:t,onOutlink:r}=vt(),n=Or(),o=!!t,{positions:i,isLoading:a}=Nu(e,t,o),s=zu(),l=Fu(()=>i.filter(C=>!C.token_id||!s.withdrawnTokenIds.has(C.token_id)),[i,s.withdrawnTokenIds]),d=Fu(()=>l.map(C=>C.token_id).filter(C=>!!C),[l]),{detailMap:c}=Tu(e,d,o&&d.length>0),b=`${Kp[e]}/pool`,{getTokenImage:f,getTokenSymbol:m,getNativeToken:y}=hn(e,o),g=f("","ONEUSD",{chainOnly:!0})||`${Br[e]}/crossd.png`,u={chainOnly:!0},p=(C,S)=>{let E=El(m(C?.address??"",C?.symbol??S,u));return E==="ONE"?y()?.symbol??"?":E??"?"},w=(C,S)=>{let E=C?.symbol??S,M=El(E);return M==="ONE"?y()?.image||Uu:f(C?.address??"",M,u)||C?.logo_url||Uu},h=s.target?.detail.pool,x=w(h?.token0,s.target?.position.pool?.token0_symbol),k=w(h?.token1,s.target?.position.pool?.token1_symbol),R=p(h?.token0,s.target?.position.pool?.token0_symbol),I=p(h?.token1,s.target?.position.pool?.token1_symbol);return Hn(u1,{children:[vr(zr,{sectionKey:"crossdPool",title:p1,icon:g,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=mo(new c1(C.position_value_usd??"0"),n),A=s.canWithdrawInline&&!!S?.pool?.token0?.address&&!!S?.pool?.token1?.address;return Hn("article",{className:"wp-item","data-side":"crossd",children:[Hn("div",{className:"wp-item-body",children:[Hn("div",{className:"wp-item-line",children:[vr("span",{className:"wp-item-label",children:"Pool"}),Hn("div",{className:"wp-svc-token",children:[Hn("span",{className:"wp-token-stack","aria-hidden":!0,children:[vr("img",{className:"wp-svc-token-icon",src:B,alt:""}),vr("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),vr("span",{children:E}),M&&vr("span",{className:"wp-token-subtle",children:M})]})]}),Hn("div",{className:"wp-item-line",children:[vr("span",{className:"wp-item-label",children:"Position Value"}),vr("span",{className:"wp-line-value",children:z})]})]}),vr("div",{className:"wp-item-tags",children:A?vr("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:vr("span",{className:"wp-tag-label",children:"Withdraw"})}):Hn("a",{className:"wp-tag wp-tag--muted",href:b,target:"_blank",rel:"noopener noreferrer","data-track":"crossd_pool_outlink","data-track-id":E,onClick:U=>Ot(U,b,{category:"portfolio",origin:"portfolio-crossd-pool",payload:{position:C,detail:S}},r),children:[vr("span",{className:"wp-tag-label",children:"Withdraw"}),vr(Tr,{size:12,className:"wp-tag-icon"})]})})]},C.token_id)})}),vr(Au,{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 Ya=["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}
8
+ `).map(i=>i.trim()).find(i=>i.length>0)||t}var Cb="0xe00e8bf3";function Bp(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`${Cb}${n}${o}`}function Fo(e){return!e||e<=0n?"0":new Pr(e.toString()).shiftedBy(-9).toFormat(2,Pr.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function za(e){return!e||e<=0n?"0":new Pr(e.toString()).toFormat(0,Pr.ROUND_DOWN)}function Fa(e){if(!e||e<=0n)return"0";let t=new Pr(e.toString()).shiftedBy(-18),r=t.isLessThan(1e-4)?7:4;return t.toFormat(r,Pr.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function gn(e,t){let r=new Pr(e).shiftedBy(-t);return!r.isFinite()||r.isZero()?"0":r.isGreaterThanOrEqualTo(1)?r.toFormat(2,Pr.ROUND_DOWN):r.toFormat(4,Pr.ROUND_DOWN)}function Al(e){return gn(e,0)}var fi={rate:1,symbol:"$"};function mo(e,t=fi){let r=Number.isFinite(t.rate)&&t.rate>0?t.rate:1;return`${t.symbol||"$"}${e.times(r).toFormat(2,Pr.ROUND_DOWN)}`}function Fn(e,t,r,n=fi){let o=new Pr(r||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let i=new Pr(e||"0").shiftedBy(-t).times(o);return i.isFinite()?mo(i,n):null}var mi=Sb(null);function vt(){let e=Nb(mi);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}function Or(){let{conversionRatio:e,currencySymbol:t}=vt();return Tb(()=>({rate:typeof e=="number"&&e>0?e:fi.rate,symbol:t||fi.symbol}),[e,t])}import{Drawer as Ib}from"vaul";import{jsx as zp}from"react/jsx-runtime";function Fp({asChild:e,children:t}){let{walletAddress:r}=vt(),n=t!=null,o=e??!0,i=n?t:zp("button",{type:"button",children:tr(r)});return zp(Ib.Trigger,{asChild:o,children:i})}import{Drawer as Ka}from"vaul";import*as Rt from"react";import{useQueryClient as f1}from"@tanstack/react-query";import{createContext as Eb,useContext as Ab}from"react";var Ml=Eb(null);function Up(){return Ab(Ml)}import{jsx as ur,jsxs as Ga}from"react/jsx-runtime";function jp({size:e=22,className:t}){return ur("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ur("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Wp({size:e=22,className:t}){return Ga("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ur("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),ur("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 Gp({size:e=12,className:t}){return ur("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ur("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ua({size:e=16,className:t}){return Ga("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ur("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"}),ur("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 ja({size:e=16,className:t}){return ur("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ur("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Wa({size:e=48,className:t}){return Ga("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ur("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),ur("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 Tr({size:e=12,className:t}){return Ga("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:[ur("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"}),ur("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),ur("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import{useQuery as Mb}from"@tanstack/react-query";import{useMemo as Hp}from"react";var Lb="wp:reward-pools";function Uo(e,t=!0){let{data:r,...n}=Mb({queryKey:[Lb,e],queryFn:async({signal:a})=>{let s=await Me("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=Hp(()=>r?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[r]),i=Hp(()=>r?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[r]);return{crossPools:o,gamePools:i,allPools:r?.data.pools??[],...n}}import{useQuery as Db}from"@tanstack/react-query";import{useMemo as Pb}from"react";var Ob="wp:user-deposits";function Ha(e,t,r=!0){let n=r&&!!t,{data:o,...i}=Db({queryKey:[Ob,e,t],queryFn:async({signal:s})=>{let l=await Me("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:Pb(()=>{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 Bb}from"@tanstack/react-query";import{useMemo as zb}from"react";var _p={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Qp={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var Vp={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var Ll={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},qp={dev:`${Ll.dev}/portfolio`,stage:`${Ll.stage}/portfolio`,production:`${Ll.production}/portfolio`};var Yp={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Br={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"},_a={dev:"https://stg-swap-api.crossdefi.io",stage:"https://stg-swap-api.crossdefi.io",production:"https://swap-api.crossdefi.io"},Kp={dev:"https://stg.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://www.crossdefi.io"},Zp={dev:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",stage:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",production:"0xEFd871aF7D695A0c1709e46b565761F4cd1Ef5ba"},Xp={dev:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",stage:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",production:"0x731a104a4461ae45bfef520468b43c262d35e682"};var Fb="wp:token-info",Ub="0x0000000000000000000000000000000000000001";function hn(e,t=!0){let r=mt[e].cross,{data:n,...o}=Bb({queryKey:[Fb,e],queryFn:async({signal:c})=>{let b=await Me("walletServer",e),f=await fetch(`${b}/v1/public/token/info`,{cache:"no-store",signal:c});if(!f.ok)throw new Error(`Failed to fetch token info: ${f.status}`);let m=await f.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:a}=zb(()=>{let c=new Map,b=new Map;if(!n?.data)return{byChainAddr:c,byChainSym:b};for(let f of n.data){let m=f.address.toLowerCase();c.set(`${f.chain_id}:${m}`,f),c.set(m,f);let y=f.symbol.replace(/^t/,"").toUpperCase(),g=`${f.chain_id}:${y}`;b.has(g)||b.set(g,f),b.has(y)||b.set(y,f)}return{byChainAddr:c,byChainSym:b}},[n]);return{getTokenImage:(c,b,f)=>{let m=c.toLowerCase(),y=!!f?.chainOnly,g=i.get(`${r}:${m}`);if(g?.image)return g.image;if(!y){let u=i.get(m);if(u?.image)return u.image}if(b){let u=b.replace(/^t/,"").toUpperCase(),p=a.get(`${r}:${u}`);if(p?.image)return p.image;if(!y){let w=a.get(u);if(w?.image)return w.image}}return""},getTokenSymbol:(c,b,f)=>{let m=c.toLowerCase();return(i.get(`${r}:${m}`)??(f?.chainOnly?void 0:i.get(m)))?.symbol||b},getNativeToken:()=>i.get(`${r}:${Ub}`),...o}}import*as Pl from"react";import{jsx as Dl,jsxs as Jp}from"react/jsx-runtime";function zr({sectionKey:e,title:t,icon:r,iconFit:n="cover",isEmpty:o,loading:i=!1,children:a}){let s=Up();return Pl.useEffect(()=>{s?.report(e,{loading:i,empty:o})},[s,e,i,o]),Pl.useEffect(()=>()=>s?.unregister(e),[s,e]),o?null:Jp("div",{className:"wp-svc-card",children:[Jp("div",{className:"wp-svc-card-head",children:[Dl("img",{className:"wp-svc-card-icon",src:r,alt:"",style:{objectFit:n}}),Dl("span",{className:"wp-svc-card-title",children:t})]}),Dl("div",{className:"wp-svc-items",children:a})]})}import Ol from"bignumber.js";import{jsx as rr,jsxs as nr}from"react/jsx-runtime";var jb="ONErewards";function Wb(e){return new Ol(e||"0").isGreaterThan(0)}function $p(){let{env:e,walletAddress:t,onOutlink:r}=vt(),n=Or(),o=!!t,{allPools:i,isLoading:a}=Uo(e,o),{depositMap:s,isLoading:l}=Ha(e,t,o),{getTokenImage:d}=hn(e,o),c=(m,y)=>`${_p[e]}/gametoken/tokens/${m.deposit_token.address}?mode=rewards${y==="withdraw"?"&trade=withdraw":""}`,b=`${Br[e]}/reward.png`,f=i.filter(m=>{let y=s.get(m.pool_address.toLowerCase()),g=y?.deposited_amount??"0",u=y?.claimable_reward??"0";return!(new Ol(g).isZero()&&new Ol(u).isZero())});return rr(zr,{sectionKey:"rewards",title:jb,icon:b,isEmpty:f.length===0,loading:a||l,children:f.map(m=>{let y=s.get(m.pool_address.toLowerCase()),g=y?.deposited_amount??"0",u=y?.claimable_reward??"0",p=c(m,"withdraw"),w=c(m,"claim"),h=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?gn(u,x.decimals):"0",S=x?.symbol??"Reward",E=Fn(g,m.deposit_token.decimals,m.deposit_token.price,n),M=x?Fn(u,x.decimals,x.price,n):null,B=!!y&&Wb(u);return nr("article",{className:"wp-item","data-side":"reward",children:[nr("div",{className:"wp-item-body",children:[nr("div",{className:"wp-item-line",children:[nr("span",{className:"wp-item-label",children:["Pool",rr("span",{className:"wp-item-label-sub",children:" (Deposit - Earn)"})]}),nr("div",{className:"wp-svc-token",children:[nr("span",{className:"wp-token-stack","aria-hidden":!0,children:[h&&rr("img",{className:"wp-svc-token-icon",src:h,alt:""}),k&&rr("img",{className:"wp-svc-token-icon",src:k,alt:""})]}),rr("span",{children:I})]})]}),nr("div",{className:"wp-item-line",children:[rr("span",{className:"wp-item-label",children:"Deposited"}),nr("div",{className:"wp-svc-token wp-svc-token--amount",children:[h&&rr("img",{className:"wp-svc-token-icon",src:h,alt:""}),nr("div",{className:"wp-svc-amount",children:[rr("span",{className:"wp-svc-amount-main",children:gn(g,m.deposit_token.decimals)}),E&&rr("span",{className:"wp-item-usd",children:E})]})]})]}),nr("div",{className:"wp-item-line",children:[nr("span",{className:"wp-item-label",children:["Claimable (",S,")"]}),nr("div",{className:"wp-svc-token wp-svc-token--amount",children:[k&&rr("img",{className:"wp-svc-token-icon",src:k,alt:""}),nr("div",{className:"wp-svc-amount",children:[rr("span",{className:"wp-svc-amount-main",children:C}),M&&rr("span",{className:"wp-item-usd",children:M})]})]})]})]}),nr("div",{className:"wp-item-tags",children:[nr("a",{className:"wp-tag wp-tag--muted",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"rewards_withdraw_open",onClick:L=>Ot(L,p,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:y}},r),children:[rr("span",{className:"wp-tag-label",children:"Withdraw"}),rr(Tr,{size:12,className:"wp-tag-icon"})]}),nr("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}Ot(L,w,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:y}},r)},children:[rr("span",{className:"wp-tag-label",children:"Claim"}),rr(Tr,{size:12,className:"wp-tag-icon"})]})]})]},m.pool_address)})})}import*as lu from"react";import{useQuery as Kb}from"@tanstack/react-query";import{useMemo as Qa}from"react";var Gb="0x70a08231",Hb="0x18160ddd",_b="0x313ce567",Qb=8e3;async function Vb(e,t,r,n){let o=new AbortController,i=setTimeout(()=>o.abort(),Qb);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 qb(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function gi(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function Cn(e,t,r,n,o){try{return await Vb(e,"eth_call",[o?{from:o,to:t,data:r}:{to:t,data:r},"latest"],n)}catch{return}}async function Yb(e,t,r,n){let[o,i,a]=await Promise.all([Cn(e,r,Gb+qb(t),n),Cn(e,r,Hb,n),Cn(e,r,_b,n)]),s=gi(o);if(s===void 0)return null;let l=gi(a);return{balance:s,totalSupply:gi(i),decimals:l!==void 0?Number(l):void 0}}async function hi(e,t){let r=mt[e].cross,n=await Me("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 eu(e,t,r,n){if(!t||r.length===0)return{};let o;try{o=await hi(e,n)}catch{o=void 0}if(!o)return{};let i=await Promise.all(r.map(async s=>[s.toLowerCase(),await Yb(o,t,s,n)])),a={};for(let[s,l]of i)l&&(a[s]=l);return a}var Zb="wp:withdraw-token-meta",Xb="0xc89039c5",Jb="0x95d89b41",$b="0x313ce567";function ew(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 tw(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 rw(e,t,r){if(t.length===0)return{};let n;try{n=await hi(e,r)}catch{n=void 0}if(!n)return{};let o=await Promise.all(t.map(async a=>{let s=tw(await Cn(n,a,Xb,r));if(!s)return[a.toLowerCase(),null];let[l,d]=await Promise.all([Cn(n,s,Jb,r),Cn(n,s,$b,r)]),c=ew(l),b=gi(d);return c?[a.toLowerCase(),{tokenAddress:s,symbol:c,decimals:b!==void 0?Number(b):18}]:[a.toLowerCase(),null]})),i={};for(let[a,s]of o)s&&(i[a]=s);return i}function tu(e,t,r=!0){let o=r&&!!t,{allPools:i,isLoading:a}=Uo(e,o),{deposits:s,isLoading:l}=Ha(e,t,o),d=Qa(()=>{let u=new Map;for(let p of i)u.set(p.pool_address.toLowerCase(),p);return u},[i]),c=Qa(()=>s.filter(u=>{try{return BigInt(u.deposited_amount||"0")>0n}catch{return!1}}),[s]),b=Qa(()=>c.map(u=>u.pool_address.toLowerCase()).filter(u=>!d.has(u)).sort(),[c,d]),{data:f,isLoading:m}=Kb({queryKey:[Zb,e,b],queryFn:({signal:u})=>rw(e,b,u),enabled:o&&b.length>0,staleTime:1440*60*1e3});return{positions:Qa(()=>{let u=[];for(let p of c){let w=p.pool_address.toLowerCase(),h=d.get(w);if(h){u.push({poolId:p.pool_id,poolAddress:p.pool_address,poolType:h.pool_type,tokenSymbol:h.deposit_token.symbol,tokenAddress:h.deposit_token.address,decimals:h.deposit_token.decimals,price:h.deposit_token.price,depositedRaw:p.deposited_amount});continue}let x=f?.[w];x&&u.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 u},[c,d,f]),isLoading:a||l||m}}import*as Yt from"react";import{Fragment as ru,jsx as De,jsxs as Tt}from"react/jsx-runtime";var nw=400;function ow(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":`${Fa(e.gasLimit*n)} ${r??""}`.trim()}function Bl(e,t,r){return r==="loading"?"Estimating...":r==="error"||r==="unavailable"?"-":`${e} ${t}`.trim()}function iw({position:e,size:t}){return e.icon?De("img",{src:e.icon,alt:"",width:t,height:t}):De("span",{children:e.tokenSymbol.slice(0,1)})}function nu({open:e,status:t,positions:r,initialPoolAddress:n,walletAddress:o,txHash:i,error:a,copied:s=!1,estimateWithdraw:l,onClose:d,onConfirm:c,onCopyHash:b,trackFunnel:f,nativeSymbol:m}){let[y,g]=Yt.useState(null),[u,p]=Yt.useState("idle"),w=Yt.useRef(0),h=Yt.useRef(void 0),x=Yt.useRef(null);Yt.useEffect(()=>()=>clearTimeout(h.current),[]);let k=Yt.useMemo(()=>{let z=n?.toLowerCase();return r.find(A=>A.poolAddress.toLowerCase()===z)??r[0]??null},[r,n]),R=Yt.useMemo(()=>{try{return BigInt(k?.depositedRaw??"0")}catch{return 0n}},[k?.depositedRaw]),I=k?.decimals??18;Yt.useEffect(()=>{!e||!k||f?.("position_selected")},[e,k,f]);let C=Yt.useCallback(()=>{g(null),p(l?"idle":"unavailable"),w.current+=1,x.current=null},[]);if(Yt.useEffect(()=>{e&&C()},[e,C]),Yt.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(h.current);return}if(!l||!k){clearTimeout(h.current),p("unavailable");return}if(R<=0n){clearTimeout(h.current),w.current+=1,x.current=null,g(null),p("idle");return}let z=`${k.poolAddress.toLowerCase()}:${R.toString()}`;if(x.current===z)return;x.current=z,clearTimeout(h.current);let A=w.current+1;w.current=A,p("loading"),h.current=setTimeout(()=>{l(k,R).then(U=>{w.current===A&&(g(U??null),p(U?"ready":"unavailable"))}).catch(()=>{w.current===A&&(g(null),p("error"))})},nw)},[e,t,R,l,k]),!e||!k)return null;let S=t==="submitting",E=Fo(y?.maxPriorityFeePerGas),M=Fo(y?.maxFeePerGas??y?.gasPrice),B=za(y?.gasLimit),L=gn(k.depositedRaw,I);return De("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:z=>{z.target===z.currentTarget&&!S&&d()},children:Tt("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:[De("div",{className:"wp-claim-grabber","aria-hidden":!0,children:De("span",{})}),Tt("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?Tt(ru,{children:[De("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:De(Wa,{})}),Tt("div",{className:"wp-claim-copy",children:[De("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),De("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),De("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:Tt("div",{className:"wp-claim-list-item",children:[De("span",{children:"Tx Hash"}),Tt("button",{type:"button",className:"wp-claim-hash",onClick:b,"aria-label":"Copy transaction hash","data-track":"withdraw_hash_copy",children:[De("strong",{children:Ba(i)}),s?De(ja,{}):De(Ua,{})]})]})})]}):Tt(ru,{children:[t==="error"&&Tt("div",{className:"wp-claim-heading",children:[De("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),De("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),Tt("div",{className:"wp-claim-reward-card","data-fit":pi(k.tokenSymbol,L),"aria-label":"Deposited balance",children:[De("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:De(iw,{position:k,size:28})}),De("strong",{className:"wp-claim-reward-symbol",children:k.tokenSymbol}),De("strong",{className:"wp-claim-reward-amount",children:L})]}),Tt("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[Tt("div",{className:"wp-claim-account-row",children:[Tt("div",{className:"wp-claim-account",children:[De("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),Tt("strong",{children:[k.tokenSymbol," Pool"]})]}),De("span",{children:Oa(o)})]}),De("span",{className:"wp-claim-divider","aria-hidden":!0}),Tt("div",{className:"wp-claim-detail-list",children:[Tt("div",{className:"wp-claim-detail-row",children:[De("span",{children:"Est. Tx Fee"}),De("strong",{children:ow(y,u,m)})]}),Tt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[De("span",{children:"Priority Fee Per Gas"}),De("strong",{children:Bl(E,"Gwei",u)})]}),Tt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[De("span",{children:"Max Fee Per Gas"}),De("strong",{children:Bl(M,"Gwei",u)})]}),Tt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[De("span",{children:"Gas Limit"}),De("strong",{children:Bl(B,"",u)})]})]})]})]}),Tt("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&De("button",{type:"button",className:"wp-claim-secondary","data-track":"withdraw_cancel",onClick:d,children:t==="error"?"Close":"Cancel"}),Tt("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"&&De("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),De("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:De("span",{})})]})})}import*as kt from"react";import{useQueryClient as lw}from"@tanstack/react-query";import{useQuery as aw}from"@tanstack/react-query";var sw="wp:reward-factory-info";function ou(e,t=!0){let{data:r,...n}=aw({queryKey:[sw,e],queryFn:async({signal:o})=>{let i=await Me("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 iu="wp:";function Un(e){return e.invalidateQueries({predicate:t=>typeof t.queryKey[0]=="string"&&t.queryKey[0].startsWith("wp:")})}function au(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function su(e){let{env:t,walletAddress:r,sendTransaction:n,estimateGas:o}=vt(),i=!!r,a=!!n,s=lw(),{routerAddress:l}=ou(t,i&&a),d=au(l),[c,b]=kt.useState(!1),[f,m]=kt.useState(void 0),[y,g]=kt.useState("confirm"),[u,p]=kt.useState(),[w,h]=kt.useState(""),[x,k]=kt.useState(!1),R=kt.useRef(void 0);kt.useEffect(()=>()=>clearTimeout(R.current),[]);let I=kt.useRef(new Set),C=kt.useCallback((U,oe)=>{I.current.has(U)||(I.current.add(U),Qe("withdraw",U,{...oe,tags:{section:e,...oe?.tags}}))},[e]),S=kt.useCallback((U,oe)=>d?{to:d,value:0n,data:Bp(U,oe),chainId:mt[t].cross}:null,[t,d]),E=kt.useCallback(()=>{Un(s)},[s]),M=kt.useCallback(U=>{m(U),b(!0),g("confirm"),p(void 0),h(""),k(!1),I.current=new Set,C("opened")},[C]),B=kt.useCallback(()=>{y!=="submitting"&&(b(!1),m(void 0),g("confirm"),p(void 0),h(""),k(!1),y==="success"&&E())},[y,E]),L=kt.useCallback(async(U,oe)=>{if(!o)return null;let Y=S(U.poolId,oe),G=au(r);return!Y||!G?null:o({...Y,from:G})},[S,o,r]),z=kt.useCallback(async()=>{if(!(!u||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(u),k(!0),clearTimeout(R.current),R.current=setTimeout(()=>k(!1),1400)}catch{k(!1)}},[u]),A=kt.useCallback(async(U,oe,Y)=>{if(!n){g("error"),h("Withdraw is not available for this wallet.");return}if(!d){g("error"),h("Withdraw contract address is not available.");return}try{g("submitting"),h("");let G=S(U.poolId,oe);if(!G){g("error"),h("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),g("success"),C("confirmed"),E()}catch(G){g("error"),h(ui(G,"Failed to request withdraw.")),C("confirmed",{status:"failure",reason:Cr(G)})}},[S,E,d,n,C]);return{canWithdrawInline:a,isOpen:c,initialPoolAddress:f,status:y,txHash:u,error:w,copied:x,hasEstimator:!!o,openWithdraw:M,closeWithdraw:B,estimateWithdraw:L,confirmWithdraw:A,copyHash:z,trackFunnelOnce:C}}import{Fragment as cw,jsx as wr,jsxs as Sn}from"react/jsx-runtime";var dw="ONEpoints";function du(){let{env:e,walletAddress:t,onOutlink:r}=vt(),n=Or(),o=!!t,{getTokenImage:i,getNativeToken:a}=hn(e,o),s=su("points"),{positions:l,isLoading:d}=tu(e,t,o),c=lu.useMemo(()=>l.filter(Op).map(m=>({...m,icon:i(m.tokenAddress,m.tokenSymbol)})),[l,i]),b=`${Br[e]}/point.png`,f=Qp[e];return Sn(cw,{children:[wr(zr,{sectionKey:"points",title:dw,icon:b,isEmpty:c.length===0,loading:d,children:c.map(m=>{let y=m.price?Fn(m.depositedRaw,m.decimals,m.price,n):null;return Sn("article",{className:"wp-item","data-side":"reward",children:[Sn("div",{className:"wp-item-body",children:[Sn("div",{className:"wp-item-line",children:[wr("span",{className:"wp-item-label",children:"Token"}),Sn("div",{className:"wp-svc-token",children:[m.icon&&wr("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),wr("span",{children:m.tokenSymbol})]})]}),Sn("div",{className:"wp-item-line",children:[wr("span",{className:"wp-item-label",children:"Deposited"}),Sn("div",{className:"wp-svc-token wp-svc-token--amount",children:[m.icon&&wr("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),Sn("div",{className:"wp-svc-amount",children:[wr("span",{className:"wp-svc-amount-main",children:gn(m.depositedRaw,m.decimals)}),y&&wr("span",{className:"wp-item-usd",children:y})]})]})]})]}),wr("div",{className:"wp-item-tags",children:s.canWithdrawInline?wr("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"points_withdraw_open",onClick:()=>s.openWithdraw(m.poolAddress),children:wr("span",{className:"wp-tag-label",children:"Withdraw"})}):Sn("a",{className:"wp-tag wp-tag--muted",href:f,target:"_blank",rel:"noopener noreferrer","data-track":"points_withdraw_open",onClick:g=>Ot(g,f,{category:"portfolio",origin:"portfolio-points",payload:{position:m}},r),children:[wr("span",{className:"wp-tag-label",children:"Withdraw"}),wr(Tr,{size:12,className:"wp-tag-icon"})]})})]},m.poolAddress)})}),wr(nu,{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 zl from"react";import{useQuery as pw}from"@tanstack/react-query";var uw="wp:stake-info";function cu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=pw({queryKey:[uw,e,t],queryFn:async({signal:s})=>{let l=await Me("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 fw}from"@tanstack/react-query";var mw="wp:stake-rewards",gw=31;function pu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=fw({queryKey:[mw,e,t],queryFn:async({signal:a})=>{let s=await Me("posa",e),l=await fetch(`${s}/rewards/${t}?limit=${gw}`,{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:Pp(o),...i}}import{useQuery as hw}from"@tanstack/react-query";var bw="wp:staking-onchain";function uu(e,t,r=!0){let n=r&&!!t&&!!e,{data:o,...i}=hw({queryKey:[bw,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 fu}from"react";import ww from"bignumber.js";function mu(e){return e?.trim().toUpperCase()==="ONE"}function gu(e){return new ww(e||"0").isGreaterThan(0)}function Va(e,t,r=!0){let{allPools:n}=Uo(e,r),o=fu(()=>{for(let d of n)for(let c of[d.deposit_token,...d.reward_tokens])if(mu(c?.symbol)&&gu(c.price))return c.price},[n]),i=r&&o===void 0,{tokens:a}=Bn(e,t,i),{statsMap:s}=zn(e,i),l=mt[e].cross;return fu(()=>{if(o)return o;let d=a.find(c=>c.chainId===l&&mu(c.symbol));if(d){let c=s.get(mn(d.chainId,d.address));if(c&&gu(c.price))return c.price}return"0"},[o,a,s,l])}import Wn from"bignumber.js";import{jsx as Fr,jsxs as jn}from"react/jsx-runtime";function yw(e){if(!e)return"\u2014";let t=new Wn(e);return t.isFinite()?`${t.toFormat(2,Wn.ROUND_DOWN)}%`:"\u2014"}function hu(){let{env:e,walletAddress:t,onOutlink:r,stakingRewardsReader:n}=vt(),o=Or(),i=!!t,{stakeInfo:a,isLoading:s}=cu(e,t,i),{latestReward:l,aprAccrued:d,isLoading:c}=pu(e,t,i),{onchain:b}=uu(t,n,i),f=Va(e,t,i),{getNativeToken:m}=hn(e,i),y=m()?.symbol,g="ONEstaking",u=`${Br[e]}/cross-staking.png`,p=qp[e],w=a?.total_stake??"0",h=zl.useMemo(()=>b?new Wn(b.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??a?.rewards_earned??"0",[b,l,a]),x=zl.useMemo(()=>b?new Wn(b.stakedWei.toString()).shiftedBy(-18):new Wn(w),[b,w]),k=d!==void 0?new Wn(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 Wn(w).isZero()&&new Wn(h).isZero()),S=Fn(w,0,f,o),E=Fn(h,0,f,o);return Fr(zr,{sectionKey:"staking",title:g,icon:u,iconFit:"contain",isEmpty:!C,loading:s||c,children:jn("article",{className:"wp-item","data-side":"stake",children:[jn("div",{className:"wp-item-body",children:[jn("div",{className:"wp-item-line",children:[Fr("span",{className:"wp-item-label",children:"Staked"}),jn("div",{className:"wp-svc-amount",children:[Fr("span",{className:"wp-svc-amount-main",children:`${Al(w)} ${y??""}`.trim()}),S&&Fr("span",{className:"wp-item-usd",children:S})]})]}),jn("div",{className:"wp-item-line",children:[Fr("span",{className:"wp-item-label",children:"Rewards Earned"}),jn("div",{className:"wp-svc-amount",children:[Fr("span",{className:"wp-svc-amount-main",children:`${Al(h)} ${y??""}`.trim()}),E&&Fr("span",{className:"wp-item-usd",children:E})]})]}),jn("div",{className:"wp-item-line",children:[Fr("span",{className:"wp-item-label",children:"My APR"}),Fr("span",{children:yw(I?.toString(10))})]})]}),Fr("div",{className:"wp-item-tags",children:jn("a",{className:"wp-tag wp-tag--mint",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"stake_outlink",onClick:M=>Ot(M,p,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a}},r),children:[Fr("span",{className:"wp-tag-label",children:"Manage"}),Fr(Tr,{size:12,className:"wp-tag-icon"})]})})]})})}import*as Fl from"react";import{useQuery as xw}from"@tanstack/react-query";var vw="wp:game-swap-pools";function bu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=xw({queryKey:[vw,e,t],queryFn:async({signal:a})=>{let s=await Me("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 kw}from"@tanstack/react-query";var Rw="wp:game-swap-lp-balances";function wu(e,t,r,n){let o=[...r].map(l=>l.toLowerCase()).sort(),i=!!t&&o.length>0,{data:a,...s}=kw({queryKey:[Rw,e,t,o,!!n],queryFn:async({signal:l})=>{let d=n?await n(o):await eu(e,t,o,l),c={};for(let[b,f]of Object.entries(d))c[b.toLowerCase()]=f;return c},enabled:i,staleTime:0});return{balances:a??{},...s}}import Nn from"bignumber.js";import{jsx as Ur,jsxs as rn}from"react/jsx-runtime";var Cw="Gametoken LP",xu=18,Sw=new Nn("0.0001");function yu(e){return e?.trim().toUpperCase()==="ONE"}function Nw(e){return e&&e>0?e:xu}function Tw(e){let t=yu(e.token_a?.symbol)&&!yu(e.token_b?.symbol),r=t?e.reserve_a:e.reserve_b,n=Nw(t?e.token_a?.decimals:e.token_b?.decimals),o=new Nn(r||"0").shiftedBy(-n);return!o.isFinite()||o.isLessThanOrEqualTo(0)?new Nn(0):o.times(2)}function Iw(e,t,r,n){let o=e.token_a?.symbol?.trim()||"TOKEN",i=e.token_b?.symbol?.trim()||n||"?",a=t?.decimals??xu,s,l;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let d=new Nn(t.balance.toString()),c=new Nn(t.totalSupply.toString()),b=d.div(c);s=b.times(100);let f=b.times(Tw(e));if(f.isGreaterThan(0)){let m=new Nn(e.quote_usd??e.cross_usd??"0");l=m.isGreaterThan(0)?mo(f.times(m),r):`${f.toFormat(4,Nn.ROUND_DOWN)} ${n??""}`.trim()}}return{pool:e,tokenASymbol:o,tokenBSymbol:i,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:a,sharePercent:s,valueText:l}}function vu(){let{env:e,walletAddress:t,onOutlink:r,lpBalanceReader:n}=vt(),o=Or(),i=!!t,{pools:a,isLoading:s}=bu(e,t,i),l=Fl.useMemo(()=>a.map(p=>p.pair_address).filter(Boolean),[a]),{balances:d,isLoading:c}=wu(e,t,l,n),{getNativeToken:b}=hn(e,i),f=b()?.symbol,m=`${Br[e]}/game-token.png`,y=Object.keys(d).length>0,g=Fl.useMemo(()=>{let p=a.map(w=>Iw(w,d[w.pair_address?.toLowerCase()],o,f));return y?p.filter(w=>w.lpAmountRaw?new Nn(w.lpAmountRaw).shiftedBy(-w.lpDecimals).isGreaterThanOrEqualTo(Sw):!1):p},[a,d,y,o,f]),u=p=>{let w=p.token_a?.address??p.pair_address;return`${Yp[e]}/gametoken/tokens/${w}?trade=deposit`};return Ur(zr,{sectionKey:"gameSwap",title:Cw,icon:m,iconFit:"contain",isEmpty:g.length===0,loading:s||c,children:g.map(p=>{let{pool:w}=p,h=u(w),x=`${p.tokenASymbol} / ${p.tokenBSymbol}`,k=w.token_a?.logo_url,R=w.token_b?.logo_url;return rn("article",{className:"wp-item","data-side":"game-swap",children:[rn("div",{className:"wp-item-body",children:[rn("div",{className:"wp-item-line",children:[Ur("span",{className:"wp-item-label",children:"Pool"}),rn("div",{className:"wp-svc-token",children:[rn("span",{className:"wp-token-stack","aria-hidden":!0,children:[k&&Ur("img",{className:"wp-svc-token-icon",src:k,alt:""}),R&&Ur("img",{className:"wp-svc-token-icon",src:R,alt:""})]}),Ur("span",{children:x})]})]}),p.lpAmountRaw!==void 0&&rn("div",{className:"wp-item-line",children:[Ur("span",{className:"wp-item-label",children:"My LP"}),rn("span",{children:[gn(p.lpAmountRaw,p.lpDecimals)," LP"]})]}),p.sharePercent!==void 0&&rn("div",{className:"wp-item-line",children:[Ur("span",{className:"wp-item-label",children:"Pool Share"}),rn("span",{children:[p.sharePercent.toFormat(2,Nn.ROUND_DOWN),"%"]})]}),p.valueText!==void 0&&rn("div",{className:"wp-item-line",children:[Ur("span",{className:"wp-item-label",children:"Value"}),Ur("span",{children:p.valueText})]})]}),Ur("div",{className:"wp-item-tags",children:rn("a",{className:"wp-tag wp-tag--mint",href:h,target:"_blank",rel:"noopener noreferrer","data-track":"gameswap_outlink","data-track-id":x,onClick:I=>Ot(I,h,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:w}},r),children:[Ur("span",{className:"wp-tag-label",children:"Manage"}),Ur(Tr,{size:12,className:"wp-tag-icon"})]})})]},w.pair_address)})})}import go from"bignumber.js";import{useMemo as Ow}from"react";import{useQuery as Ew}from"@tanstack/react-query";var Aw="wp:forge-pools";function ku(e,t,r=!0){let n=r&&!!t,{data:o,...i}=Ew({queryKey:[Aw,e,t],queryFn:async()=>{let s=await Me("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 Mw}from"@tanstack/react-query";import{useMemo as Lw}from"react";var Dw="wp:forge-token-detail";async function Pw(e,t){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return r.ok?(await r.json())?.data?.token??null:null}function Ru(e,t,r=!0){let n=Mw({queries:t.map(a=>({queryKey:[Dw,e,a],queryFn:async()=>Pw(await Me("bondingCurve",e),a),enabled:r&&!!a,staleTime:3e4}))}),o=Lw(()=>{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 yr,jsxs as Gn}from"react/jsx-runtime";var Bw="ONEforge",Cu=18,zw="https://contents.crosstoken.io/wallet/token/images/FT.png";function Fw(e){if(!e||e==="0")return"0";let t=new go(e).shiftedBy(-Cu);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,go.ROUND_DOWN):t.toFormat(4,go.ROUND_DOWN)}function Uw(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 jw(e,t,r,n){let o=new go(r||"0");if(!o.isGreaterThan(0))return null;let i=new go(e.total_supply||"0"),a=new go(e.lp_balance||"0"),s=new go(t?.reserve_b||"0").shiftedBy(-Cu);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()?mo(c,n):null}function Su(){let{env:e,walletAddress:t,onOutlink:r}=vt(),n=Or(),o=!!t,{pools:i,isEmpty:a,isLoading:s}=ku(e,t,o),l=Ow(()=>i.map(m=>m.token.address),[i]),{detailMap:d}=Ru(e,l,o&&l.length>0),c=Va(e,t,o),b=m=>`${Vp[e]}/forge/token/${m.token.address}`,f=`${Br[e]}/forge.png`;return yr(zr,{sectionKey:"forge",title:Bw,icon:f,iconFit:"contain",isEmpty:a,loading:s,children:i.map(m=>{let y=d.get(m.token.address.toLowerCase()),g=y?.image_url||y?.image||m.token.image||zw,u=y?.symbol||m.token.symbol,p=b(m),w=jw(m,y,c,n);return Gn("a",{className:"wp-item","data-side":"lp",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"forge_outlink","data-track-id":u,onClick:h=>Ot(h,p,{category:"portfolio",origin:"portfolio-forge",payload:{pool:m,tokenDetail:y}},r),children:[Gn("div",{className:"wp-item-body",children:[Gn("div",{className:"wp-item-line",children:[yr("span",{className:"wp-item-label",children:"Asset"}),Gn("div",{className:"wp-svc-token",children:[yr("img",{className:"wp-svc-token-icon",src:g,alt:""}),yr("span",{children:u}),y?.name&&yr("span",{className:"wp-token-subtle",children:y.name})]})]}),Gn("div",{className:"wp-item-line",children:[yr("span",{className:"wp-item-label",children:"LP Balance"}),yr("div",{className:"wp-svc-token wp-svc-token--amount",children:Gn("div",{className:"wp-svc-amount",children:[yr("span",{className:"wp-svc-amount-main",children:Fw(m.lp_balance)}),w&&yr("span",{className:"wp-item-usd",children:w})]})})]}),Gn("div",{className:"wp-item-line",children:[yr("span",{className:"wp-item-label",children:"Ownership"}),yr("span",{className:"wp-line-value",children:Uw(m.pool_ownership)})]})]}),yr("div",{className:"wp-item-tags",children:Gn("span",{className:"wp-tag wp-tag--muted",children:[yr("span",{className:"wp-tag-label",children:"Withdraw"}),yr(Tr,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}import{useMemo as Fu}from"react";import c1 from"bignumber.js";import{useQuery as Ww}from"@tanstack/react-query";var Gw="wp:crossd-positions";function Hw(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 Nu(e,t,r=!0){let n=r&&!!t,{data:o,...i}=Ww({queryKey:[Gw,e,t],queryFn:async()=>{let s=await fetch(`${_a[e]}/api/v1/positions?owner=${t}`,{cache:"no-store"});if(!s.ok)throw new Error(`crossd positions fetch failed: ${s.status}`);return Hw(await s.json())},enabled:n,staleTime:0}),a=o??[];return{positions:a,isEmpty:a.length===0,...i}}import{useQueries as _w}from"@tanstack/react-query";import{useMemo as Qw}from"react";var Vw="wp:crossd-position-details";function qw(e){let t=e??{},r=t.data??t;return r?.token_id||r?.pool?r:null}function Tu(e,t,r=!0){let n=_w({queries:t.map(i=>({queryKey:[Vw,e,i],queryFn:async()=>{let a=await fetch(`${_a[e]}/api/v1/positions/${i}`,{cache:"no-store"});if(!a.ok)throw new Error(`crossd position detail failed: ${a.status}`);return qw(await a.json())},enabled:r&&!!i,staleTime:6e4}))});return{detailMap:Qw(()=>{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 Tn from"react";import{Fragment as Eu,jsx as Ie,jsxs as Kt}from"react/jsx-runtime";var Yw=300*1e3,Iu="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Kw(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":`${Fa(e.gasLimit*n)} ${r??""}`.trim()}function Ul(e,t,r){return r?"Estimating...":`${e} ${t}`.trim()}function Au({open:e,status:t,target:r,token0Icon:n,token1Icon:o,token0Symbol:i,token1Symbol:a,nativeSymbol:s,txHash:l,error:d,copied:c=!1,hasEstimator:b,prepareWithdraw:f,confirmWithdraw:m,onClose:y,onCopyHash:g,trackFunnel:u}){let[p,w]=Tn.useState(null),[h,x]=Tn.useState(null),k=Tn.useRef(0);Tn.useEffect(()=>{if(!e||!r)return;let _=++k.current;w(null),x(null),u?.("dialog_opened"),f().then(ce=>{k.current===_&&(w(ce),x(ce?Date.now():null))})},[e,r]);let R=t==="submitting",I=t==="estimating"||t==="confirm"&&!p,C=Tn.useCallback(async()=>{let _=p,ce=!h||Date.now()-h>Yw;if(!_||ce){let xe=++k.current;if(_=await f(),k.current!==xe)return;w(_),x(_?Date.now():null)}_&&await m(_)},[p,h,f,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||Iu,Y=o||B?.logo_url||Iu,G=`${L}/${z}`,H=p?Bo(p.expectedAmount0.toString(),A):null,ie=p?Bo(p.expectedAmount1.toString(),U):null,te=Fo(p?.estimate?.maxPriorityFeePerGas),O=Fo(p?.estimate?.maxFeePerGas??p?.estimate?.gasPrice),Z=za(p?.estimate?.gasLimit);return Ie("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:_=>{_.target===_.currentTarget&&!R&&y()},children:Kt("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",{})}),Kt("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&l?Kt(Eu,{children:[Ie("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:Ie(Wa,{})}),Kt("div",{className:"wp-claim-copy",children:[Ie("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),Kt("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:Kt("div",{className:"wp-claim-list-item",children:[Ie("span",{children:"Tx Hash"}),Kt("button",{type:"button",className:"wp-claim-hash",onClick:g,"aria-label":"Copy transaction hash","data-track":"crossd_withdraw_hash_copy",children:[Ie("strong",{children:Ba(l)}),c?Ie(ja,{}):Ie(Ua,{})]})]})})]}):Kt(Eu,{children:[t==="error"&&Kt("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."})]}),Kt("div",{className:"wp-claim-reward-card","data-fit":pi(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..."})]}),Kt("div",{className:"wp-claim-reward-card","data-fit":pi(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..."})]}),b&&Ie("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:Kt("div",{className:"wp-claim-detail-list",children:[Kt("div",{className:"wp-claim-detail-row",children:[Ie("span",{children:"Est. Tx Fee"}),Ie("strong",{children:Kw(p?.estimate,I,s)})]}),Kt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ie("span",{children:"Priority Fee Per Gas"}),Ie("strong",{children:Ul(te,"Gwei",I)})]}),Kt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ie("span",{children:"Max Fee Per Gas"}),Ie("strong",{children:Ul(O,"Gwei",I)})]}),Kt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ie("span",{children:"Gas Limit"}),Ie("strong",{children:Ul(Z,"",I)})]})]})})]}),Kt("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||(u?.("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 bt from"react";import{useQueryClient as s1}from"@tanstack/react-query";var Zw="0x0c49ccbe",Xw="0xfc6f7865",Jw="0x49404b7c",$w="0xdf2ab5bb",e1="0xac9650d8",Mu=(1n<<128n)-1n,Du=600n,t1=99n,r1=100n;function jl(e){return e*t1/r1}function Lu(e,t){return!!e&&!!t&&e.toLowerCase()===t.toLowerCase()}function xr(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 qa(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 Wl(e){return Zw+xr(e.tokenId,"tokenId")+xr(e.liquidity,"liquidity")+xr(e.amount0Min,"amount0Min")+xr(e.amount1Min,"amount1Min")+xr(e.deadline,"deadline")}function n1(e){return Xw+xr(e.tokenId,"tokenId")+qa(e.recipient,"recipient")+xr(e.amount0Max,"amount0Max")+xr(e.amount1Max,"amount1Max")}function o1(e,t){return Jw+xr(e,"amountMinimum")+qa(t,"recipient")}function i1(e,t,r){return $w+qa(e,"token")+xr(t,"amountMinimum")+qa(r,"recipient")}function a1(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 xr(BigInt(i.length/2),"callLength")+a.toLowerCase()}),r=BigInt(e.length)*32n,n=[];for(let o of t)n.push(xr(r,"callOffset")),r+=BigInt(o.length/2);return e1+xr(0x20n,"arrayOffset")+xr(BigInt(e.length),"arrayLength")+n.join("")+t.join("")}function Pu(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 Ou(e){let t=Lu(e.token0,e.wcrossAddress),r=Lu(e.token1,e.wcrossAddress),n=t||r,o=[Wl({tokenId:e.tokenId,liquidity:e.liquidity,amount0Min:e.amount0Min,amount1Min:e.amount1Min,deadline:e.deadline}),n1({tokenId:e.tokenId,recipient:n?e.positionManagerAddress:e.owner,amount0Max:Mu,amount1Max:Mu})];return n&&(o.push(o1(0n,e.owner)),o.push(i1(t?e.token1:e.token0,0n,e.owner))),a1(o)}async function Bu(e,t,r){let n;try{n=await hi(e,r)}catch{n=void 0}if(!n)return null;let o=Wl({tokenId:t.tokenId,liquidity:t.liquidity,amount0Min:0n,amount1Min:0n,deadline:t.deadline}),i=await Cn(n,t.positionManager,o,r,t.owner);return Pu(i)}var l1=[1500,3e3,4500,6e3];function d1(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function zu(){let{env:e,walletAddress:t,sendTransaction:r,estimateGas:n}=vt(),o=!!r,i=s1(),[a,s]=bt.useState(!1),[l,d]=bt.useState(null),[c,b]=bt.useState("confirm"),[f,m]=bt.useState(),[y,g]=bt.useState(""),[u,p]=bt.useState(!1),[w,h]=bt.useState(new Set),x=bt.useRef(void 0),k=bt.useRef([]),R=bt.useRef(0);bt.useEffect(()=>()=>{clearTimeout(x.current),k.current.forEach(clearTimeout)},[]);let I=bt.useRef(new Set),C=bt.useCallback((A,U)=>{I.current.has(A)||(I.current.add(A),Qe("withdraw",A,{...U,tags:{section:"crossdPool",...U?.tags}}))},[]),S=bt.useCallback(()=>{let A=()=>Un(i);A(),k.current.forEach(clearTimeout),k.current=l1.map(U=>setTimeout(A,U))},[i]),E=bt.useCallback(A=>{R.current+=1,d(A),s(!0),b("confirm"),m(void 0),g(""),p(!1),I.current=new Set,C("opened")},[C]),M=bt.useCallback(()=>{c!=="submitting"&&(R.current+=1,s(!1),d(null),b("confirm"),m(void 0),g(""),p(!1))},[c]),B=bt.useCallback(async()=>{let A=R.current,U=d1(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 b("error"),g("Position data is incomplete. Please refresh and retry."),null;try{b("estimating"),g("");let ie=BigInt(oe),te=BigInt(Y),O=BigInt(Math.floor(Date.now()/1e3))+Du,Z=Zp[e],_=await Bu(e,{owner:U,positionManager:Z,tokenId:ie,liquidity:te,deadline:O});if(R.current!==A)return null;if(!_)return b("error"),g("Failed to estimate withdrawal amounts. Please retry."),null;let ce=Ou({tokenId:ie,liquidity:te,amount0Min:jl(_.amount0),amount1Min:jl(_.amount1),deadline:O,owner:U,positionManagerAddress:Z,token0:G,token1:H,wcrossAddress:Xp[e]}),xe={to:Z,value:0n,data:ce,chainId:mt[e].cross},he=null;if(n){try{he=await n({...xe,from:U})}catch{he=null}if(R.current!==A)return null}return b("confirm"),{tx:xe,estimate:he,expectedAmount0:_.amount0,expectedAmount1:_.amount1}}catch(ie){return R.current!==A||(b("error"),g(ui(ie,"Failed to prepare withdraw."))),null}},[e,n,l,t]),L=bt.useCallback(async A=>{if(!r){b("error"),g("Withdraw is not available for this wallet.");return}try{b("submitting"),g(""),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),b("success");let oe=l?.position.token_id;oe&&h(Y=>{let G=new Set(Y);return G.add(oe),G}),C("confirmed"),S()}catch(U){b("error"),g(ui(U,"Failed to request withdraw.")),C("confirmed",{status:"failure",reason:Cr(U)})}},[S,r,l,C]),z=bt.useCallback(async()=>{if(!(!f||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(f),p(!0),clearTimeout(x.current),x.current=setTimeout(()=>p(!1),1400)}catch{p(!1)}},[f]);return{canWithdrawInline:o,isOpen:a,target:l,withdrawnTokenIds:w,status:c,txHash:f,error:y,copied:u,hasEstimator:!!n,openWithdraw:E,closeWithdraw:M,prepareWithdraw:B,confirmWithdraw:L,copyHash:z,trackFunnelOnce:C}}import{Fragment as u1,jsx as vr,jsxs as Hn}from"react/jsx-runtime";var p1="ONEusd Pool",Uu="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function ju(){let{env:e,walletAddress:t,onOutlink:r}=vt(),n=Or(),o=!!t,{positions:i,isLoading:a}=Nu(e,t,o),s=zu(),l=Fu(()=>i.filter(C=>!C.token_id||!s.withdrawnTokenIds.has(C.token_id)),[i,s.withdrawnTokenIds]),d=Fu(()=>l.map(C=>C.token_id).filter(C=>!!C),[l]),{detailMap:c}=Tu(e,d,o&&d.length>0),b=`${Kp[e]}/pool`,{getTokenImage:f,getTokenSymbol:m,getNativeToken:y}=hn(e,o),g=f("","ONEUSD",{chainOnly:!0})||`${Br[e]}/crossd.png`,u={chainOnly:!0},p=(C,S)=>{let E=El(m(C?.address??"",C?.symbol??S,u));return E==="ONE"?y()?.symbol??"?":E??"?"},w=(C,S)=>{let E=C?.symbol??S,M=El(E);return M==="ONE"?y()?.image||Uu:f(C?.address??"",M,u)||C?.logo_url||Uu},h=s.target?.detail.pool,x=w(h?.token0,s.target?.position.pool?.token0_symbol),k=w(h?.token1,s.target?.position.pool?.token1_symbol),R=p(h?.token0,s.target?.position.pool?.token0_symbol),I=p(h?.token1,s.target?.position.pool?.token1_symbol);return Hn(u1,{children:[vr(zr,{sectionKey:"crossdPool",title:p1,icon:g,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=mo(new c1(C.position_value_usd??"0"),n),A=s.canWithdrawInline&&!!S?.pool?.token0?.address&&!!S?.pool?.token1?.address;return Hn("article",{className:"wp-item","data-side":"crossd",children:[Hn("div",{className:"wp-item-body",children:[Hn("div",{className:"wp-item-line",children:[vr("span",{className:"wp-item-label",children:"Pool"}),Hn("div",{className:"wp-svc-token",children:[Hn("span",{className:"wp-token-stack","aria-hidden":!0,children:[vr("img",{className:"wp-svc-token-icon",src:B,alt:""}),vr("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),vr("span",{children:E}),M&&vr("span",{className:"wp-token-subtle",children:M})]})]}),Hn("div",{className:"wp-item-line",children:[vr("span",{className:"wp-item-label",children:"Position Value"}),vr("span",{className:"wp-line-value",children:z})]})]}),vr("div",{className:"wp-item-tags",children:A?vr("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:vr("span",{className:"wp-tag-label",children:"Withdraw"})}):Hn("a",{className:"wp-tag wp-tag--muted",href:b,target:"_blank",rel:"noopener noreferrer","data-track":"crossd_pool_outlink","data-track-id":E,onClick:U=>Ot(U,b,{category:"portfolio",origin:"portfolio-crossd-pool",payload:{position:C,detail:S}},r),children:[vr("span",{className:"wp-tag-label",children:"Withdraw"}),vr(Tr,{size:12,className:"wp-tag-icon"})]})})]},C.token_id)})}),vr(Au,{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 Ya=["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-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}@media(max-width:360px){.wp-item-label-sub{display:none}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.wi-drawer-content .wp-header,.wi-portfolio-body .wp-header{padding:16px}.wi-drawer-content .wp-header-edge--right .wp-header-btn,.wi-portfolio-body .wp-header-edge--right .wp-header-btn{top:16px;right:16px}.wp-withdraw-amount-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-withdraw-amount-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-input{flex:1 1 auto;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);font-family:inherit;font-size:24px;font-weight:600;line-height:1.3;letter-spacing:0;text-align:left;outline:none}.wp-withdraw-input::placeholder{color:var(--wp-text-30)}.wp-withdraw-input[aria-invalid=true]{color:var(--wp-claim-error)}.wp-withdraw-input-symbol{flex-shrink:0;color:var(--wp-text-40);font-size:15px;font-weight:600;line-height:1.3}.wp-withdraw-quick-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-quick{appearance:none;flex:1 1 0;min-width:0;height:32px;padding:0 10px;border:1px solid var(--wp-border);border-radius:999px;background:transparent;color:var(--wp-text-60);font-family:inherit;font-size:13px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer}.wp-withdraw-quick:hover:not(:disabled){border-color:var(--wp-claim-primary);color:var(--wp-claim-primary)}.wp-withdraw-quick:disabled{cursor:default;opacity:.5}.wp-withdraw-content{overflow-y:auto}.wp-withdraw-token-list{display:flex;flex-direction:column;gap:8px;width:100%;max-height:216px;overflow-y:auto}.wp-withdraw-token{appearance:none;display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:10px 12px;border:1px solid var(--wp-border);border-radius:8px;background:var(--wp-card);color:var(--wp-text);font-family:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.wp-withdraw-token[data-selected]{border-color:var(--wp-claim-primary);box-shadow:inset 0 0 0 1px var(--wp-claim-primary)}.wp-withdraw-token:disabled{cursor:default;opacity:.6}.wp-withdraw-token-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-withdraw-token-icon img{width:28px;height:28px;object-fit:cover}.wp-withdraw-token-icon span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-withdraw-token-symbol{flex:1 1 auto;min-width:0;overflow:hidden;font-size:15px;font-weight:600;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.wp-withdraw-token-amount{flex-shrink:0;color:var(--wp-text-40);font-size:13px;font-weight:500;line-height:1.3;white-space:nowrap}
9
9
  `);import{Fragment as m1,jsx as Ve,jsxs as In}from"react/jsx-runtime";var Gl=15;function jo({env:e,theme:t="light",walletAddress:r,walletName:n,onBack:o,showHeader:i=!0,autoRefresh:a=!0,variant:s="embed",className:l,onOutlink:d,lpBalanceReader:c,stakingRewardsReader:b,sendTransaction:f,estimateGas:m,conversionRatio:y,currencySymbol:g,sections:u}){let p=ot(e),w=Rt.useCallback(fe=>!u||u.includes(fe),[u]),h=!!r,x=f1(),[k,R]=Rt.useState({}),I=Rt.useCallback((fe,ge)=>{R(we=>{let Ye=we[fe];return Ye&&Ye.loading===ge.loading&&Ye.empty===ge.empty?we:{...we,[fe]:ge}})},[]),C=Rt.useCallback(fe=>{R(ge=>{if(!(fe in ge))return ge;let we={...ge};return delete we[fe],we})},[]),S=Rt.useMemo(()=>({report:I,unregister:C}),[I,C]),[E,M]=Rt.useState(Gl),[B,L]=Rt.useState(!1),[z,A]=Rt.useState(!1),U=Rt.useRef(void 0),oe=Rt.useCallback(()=>{Un(x)},[x]),Y=Rt.useCallback(()=>{oe(),L(!0),setTimeout(()=>L(!1),600),M(Gl)},[oe]);Rt.useEffect(()=>{if(!h||!a)return;let fe=setInterval(()=>{M(ge=>ge<=1?(Y(),Gl):ge-1)},1e3);return()=>clearInterval(fe)},[h,a,Y]);let G=Rt.useCallback(()=>{o?.()},[o]),H=h?Rn(p,r,{size:64}):void 0,ie=Rt.useCallback(async()=>{if(!(z||!r))try{await navigator.clipboard.writeText(r),A(!0),clearTimeout(U.current),U.current=setTimeout(()=>A(!1),2e3)}catch{}},[r,z]);Rt.useEffect(()=>()=>clearTimeout(U.current),[]);let te=Rt.useMemo(()=>({env:p,theme:t,open:!0,walletAddress:r,close:G,onOutlink:d,lpBalanceReader:c,stakingRewardsReader:b,sendTransaction:f,estimateGas:m,conversionRatio:y,currencySymbol:g}),[p,t,r,G,d,c,b,f,m,y,g]),O=Ya.filter(w),Z=O.length>0&&O.every(fe=>{let ge=k[fe];return!!ge&&!ge.loading}),_=Z&&O.every(fe=>k[fe]?.empty),ce=O.some(fe=>{let ge=k[fe];return!!ge&&!ge.empty}),xe=O.length>0&&!Z&&!ce,he=In(m1,{children:[i&&In("div",{className:"wp-header",children:[In("div",{className:"wp-header-account",children:[o&&Ve("button",{type:"button",className:"wp-header-btn","aria-label":"Back","data-track":"back",onClick:o,children:Ve(jp,{})}),Ve("span",{className:"wp-header-avatar","aria-hidden":!0,children:H&&Ve("img",{src:H,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(n||r)&&In("div",{className:"wp-header-account-meta",children:[n&&Ve("span",{className:"wp-header-wallet-name",title:n,children:n}),r&&In("button",{type:"button",className:"wp-header-address-btn",onClick:ie,"aria-label":"Copy wallet address","data-track":"address_copy",children:[Ve("span",{className:"wp-header-address",children:Oa(r)}),Ve("span",{className:"wp-header-address-copy","data-copied":z,children:z?Ve(vn,{size:14}):Ve(so,{size:14})})]})]})]}),In("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio","data-track":"refresh",onClick:Y,children:[Ve(Wp,{className:B?"wp-spin-once":void 0}),h&&Ve("span",{className:"wp-refresh-badge",children:E})]})]}),Ve("div",{className:"wp-body",children:In("div",{className:"wp-body-inner","data-empty":_||void 0,children:[w("rewards")&&Ve($p,{}),w("points")&&Ve(du,{}),w("staking")&&Ve(hu,{}),w("gameSwap")&&Ve(vu,{}),w("forge")&&Ve(Su,{}),w("crossdPool")&&Ve(ju,{}),xe&&Ve("div",{className:"wp-portfolio-loading",role:"status","aria-label":"Loading portfolio",children:Ve("span",{className:"wp-portfolio-spinner","aria-hidden":!0})}),_&&In("div",{className:"wp-portfolio-empty",role:"status",children:[Ve("span",{className:"wp-portfolio-empty-icon","aria-hidden":!0,children:In("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[Ve("path",{d:"M20 7H5a2 2 0 0 1-2-2 2 2 0 0 1 2-2h13v4"}),Ve("path",{d:"M3 5v13a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1"}),Ve("circle",{cx:"16.5",cy:"13.5",r:"1",fill:"currentColor",stroke:"none"})]})}),Ve("p",{className:"wp-portfolio-empty-title",children:"No assets yet"}),Ve("p",{className:"wp-portfolio-empty-desc",children:"Assets you hold across ONE services will appear here."})]})]})})]});return Ve(mi.Provider,{value:te,children:Ve(Ml.Provider,{value:S,children:Ve(ye,{feature:"wallet_portfolio",children:s==="none"?he:Ve("div",{className:Re(s==="fullscreen"?"wp-fullscreen":"wp-embed",l),"data-theme":t,children:he})})})})}import{jsx as Hl,jsxs as Wu}from"react/jsx-runtime";function Gu({className:e}){let{env:t,theme:r,walletAddress:n,close:o,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s}=vt();return Wu(Ka.Portal,{children:[Hl(Ka.Overlay,{className:"wp-overlay"}),Wu(Ka.Content,{className:Re("wp-fullscreen",e),"data-theme":r,children:[Hl(Ka.Title,{className:"wp-sr-only",children:"Portfolio"}),Hl(jo,{env:t,theme:r,walletAddress:n,onBack:o,variant:"none",onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s})]})]})}import{jsx as Hu}from"react/jsx-runtime";function h1({env:e,theme:t="light",walletAddress:r,open:n,onOpenChange:o,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:d,conversionRatio:c,currencySymbol:b,children:f}){let m=ot(e),y=n!==void 0,[g,u]=ho.useState(!1),p=y?n:g,w=ho.useCallback(k=>{y||u(k),o?.(k)},[y,o]),h=ho.useCallback(()=>w(!1),[w]),x=ho.useMemo(()=>({env:m,theme:t,open:p,walletAddress:r,close:h,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:d,conversionRatio:c,currencySymbol:b}),[m,t,p,r,h,i,a,s,l,d,c,b]);return Hu(mi.Provider,{value:x,children:Hu(g1.Root,{direction:"bottom",open:p,onOpenChange:w,noBodyStyles:!0,children:f})})}var _u=Object.assign(h1,{Trigger:Fp,Content:Gu});import*as se from"react";import{createPortal as vi}from"react-dom";import sf from"bignumber.js";import*as Za from"react";var Qu=120;function Vu(e){return e instanceof HTMLElement&&e.matches("input, textarea, select")}function qu(){let[e,t]=Za.useState(!1);return Za.useEffect(()=>{let r=window.visualViewport,n=()=>r?.height??window.innerHeight,o=n(),i=()=>{let d=n();o=Math.max(o,d),t(o-d>Qu)},a=()=>{o=n(),t(!1)},s=d=>{Vu(d.target)&&o-n()>Qu&&t(!0)},l=d=>{Vu(d.target)&&t(!1)};return i(),r?.addEventListener("resize",i),window.addEventListener("resize",i),window.screen?.orientation?.addEventListener("change",a),document.addEventListener("focusin",s),document.addEventListener("focusout",l),()=>{r?.removeEventListener("resize",i),window.removeEventListener("resize",i),window.screen?.orientation?.removeEventListener("change",a),document.removeEventListener("focusin",s),document.removeEventListener("focusout",l)}},[]),e}import*as Xa from"react";function Ja(e,t=160){let[r,n]=Xa.useState(e||null);return Xa.useEffect(()=>{if(e){n(e);return}let o=window.setTimeout(()=>n(null),t);return()=>window.clearTimeout(o)},[e,t]),[e||r,e?"open":"closed"]}import{jsx as _n,jsxs as Y8}from"react/jsx-runtime";function Yu({size:e=16,className:t}){return _n("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_n("path",{d:"M2.667 8a5.333 5.333 0 1 0 1.562-3.771L2.667 5.79M2.667 2.667v3.124h3.124M8 5.333V8l1.667 1",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ku({size:e=16,className:t}){return _n("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_n("path",{d:"M2.667 4h4M9.333 4h4M6.667 2.667v2.666M2.667 12h4M9.333 12h4M9.333 10.667v2.666M2.667 8h1.666M7 8h6.333M4.333 6.667v2.666",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function _l({size:e=20,className:t}){return _n("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_n("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Zu({size:e=16,className:t}){return _n("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:_n("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}import*as Q from"react";import b1 from"bignumber.js";function Xu(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ju(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,b1.ROUND_DOWN).toFixed()}function w1(e){return e.fromToken.symbol.toLowerCase()===e.toToken.symbol.toLowerCase()||e.fromToken.chainId===e.toToken.chainId&&e.fromToken.address.toLowerCase()===e.toToken.address.toLowerCase()}function y1(e){let t=e.fromToken.priceUsd,r=e.toToken.priceUsd,n=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,o=pt(n);return!o||o.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:Xu(t)&&Xu(r)?e.lastChangedBy==="to"?{fromAmount:Ju(o.multipliedBy(r).dividedBy(t))}:{toAmount:Ju(o.multipliedBy(t).dividedBy(r))}:w1(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function $u({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(r){return e?e(r):y1(r)},async submitBridge(r){if(!t)throw new Error("Bridge submit handler is not configured.");return t(r)}}}var ef=15,x1=18,of="cross_bridge_terms_accepted",v1=3600*24*365;function k1(e){let t=e.replace(/[^\d.]/g,""),r=t.indexOf(".");r!==-1&&(t=t.slice(0,r+1)+t.slice(r+1).replace(/\./g,""));let n=t.indexOf(".");if(n===-1)return t.slice(0,ef);let o=t.slice(0,n).slice(0,ef),i=t.slice(n+1).slice(0,x1);return`${o}.${i}`}function R1(){return typeof document>"u"?!1:document.cookie.split(";").map(e=>e.trim()).some(e=>e===`${of}=true`)}function C1(){if(typeof document>"u")return;let e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=[`${of}=true`,"Path=/",`Max-Age=${v1}`,"SameSite=Lax",e].filter(Boolean).join("; ")}function S1(e){let t=Number(e??"0");if(!Number.isFinite(t)||t<.1)return"1";let r=n=>Math.floor(n*100)/100;if(t<3){let n=r(t*3);return String(n<1?1:n)}return"10"}function tf(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("ONE")?t.slice(1):t}function N1(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let r=new Set([tf(e.symbol),tf(t.symbol)]);return r.has("ONE")&&r.has("ONEUSD")}function nn(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function $a(e){return e[0]}function Ql(e,t,r,n){if(r&&!nn(r,t))return r;let o=t?n?.(t,e):void 0;if(o?.length)return o[0];if(!t)return e[1]??$a(e);let i=e.findIndex(s=>nn(s,t)),a=i>=0?e[i+1]:void 0;return a&&!nn(a,t)?a:e.find(s=>!nn(s,t))??t}function rf({fromToken:e,toToken:t,fromAmount:r,toAmount:n,lastChangedBy:o,slippage:i}){return{fromToken:e,toToken:t,fromAmount:r,toAmount:n,lastChangedBy:o,slippage:i}}function es(e,t=0){if(!e||t>5)return[];if(typeof e=="string")return[e];if(!(e instanceof Error)&&typeof e!="object")return[String(e)];let r=e;return[...[e instanceof Error?e.name:r.name,e instanceof Error?e.message:r.message,r.shortMessage,r.details,r.code].filter(o=>typeof o=="string"||typeof o=="number").map(String),...es(r.cause,t+1),...es(r.data,t+1),...es(r.error,t+1)]}function Vl(e){let t=es(e).join(" ").toLowerCase(),r=t.includes("signature_failed")&&(t.includes("\uD0C0\uC785 \uB370\uC774\uD130 \uC11C\uBA85\uC5D0 \uC2E4\uD328")||t.includes("typed data")||t.includes("signtypeddata"));return t.includes("4001")||t.includes("err_user_rejected")||t.includes("userrejectedrequesterror")||t.includes("user rejected")||t.includes("user denied")||t.includes("user cancelled")||t.includes("user canceled")||t.includes("rejected the request")||t.includes("request rejected")||t.includes("action_rejected")||t.includes("rejected by user")||r}function nf(e,t){return Vl(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
10
- `)[0]?.trim()||t}function af(e){let{tokens:t,initialFromToken:r,initialToToken:n,getToTokens:o,getApproval:i,approveBridge:a,history:s=[],initialSlippage:l="1",termsUrl:d,getQuote:c,submitBridge:b,onSubmitted:f,onSuccess:m,onFailed:y,onExit:g}=e,u=Q.useMemo(()=>$u({getQuote:c,submitBridge:b}),[c,b]),[p,w]=Q.useState("form"),[h,x]=Q.useState(r??$a(t)),[k,R]=Q.useState(()=>Ql(t,r??$a(t),n,o)),[I,C]=Q.useState(""),[S,E]=Q.useState(""),[M,B]=Q.useState("from"),[L,z]=Q.useState(l),[A,U]=Q.useState(null),oe=Q.useMemo(()=>N1(h,k),[h,k]),Y=Q.useMemo(()=>oe?"1":L==="auto"?S1(A?.priceImpact):L,[oe,L,A?.priceImpact]),[G,H]=Q.useState(""),[ie,te]=Q.useState("idle"),[O,Z]=Q.useState(""),[_,ce]=Q.useState(null),[xe,he]=Q.useState([]),[fe,ge]=Q.useState(!1),[we,Ye]=Q.useState(R1),[be,Te]=Q.useState(null),[it,We]=Q.useState(!1),[_e,Be]=Q.useState(null),[rt,Et]=Q.useState(null),[ft,Ct]=Q.useState(!1),[Se,wt]=Q.useState(!1),yt=Q.useRef(0),St=Q.useRef(null),Ke=Q.useRef(!1),Xe=Q.useRef(!1),$t=Q.useRef(!1),At=Q.useRef(!1),zt=Q.useRef(!1),Mt=Q.useRef(!1),nt=Q.useRef(!1);Q.useEffect(()=>{$t.current||($t.current=!0,Qe("bridge","opened"))},[]);let Ge=Q.useCallback(()=>{St.current&&(clearTimeout(St.current),St.current=null)},[]),at=Q.useCallback(j=>{Ge(),Et(j)},[Ge]);Q.useEffect(()=>Ge,[Ge]),Q.useEffect(()=>{let j=t.find($e=>nn($e,h))??$a(t),ze=j?o?.(j,t):void 0,ee=ze?.find($e=>nn($e,k))??(ze?void 0:t.find($e=>nn($e,k)))??Ql(t,j,void 0,o);x(j),R(ee)},[o,t,h,k]);let Nt=Q.useCallback((j,ze)=>{let ee=k1(j);if(!ee){yt.current+=1,C(""),E(""),B(ze),U(null),H(""),te("idle");return}ze==="from"?C(ee):E(ee),B(ze),H(""),!zt.current&&Number(ee)>0&&(zt.current=!0,Qe("bridge","amount_entered"))},[]),Pe=Q.useCallback(()=>{yt.current+=1,C(""),E(""),B("from"),U(null),H(""),Z(""),te("idle"),Te(null),We(!1),Be(null),Ct(!1),at(null)},[at]),st=Q.useCallback(j=>{nn(j,h)||(At.current||(At.current=!0,Qe("bridge","token_selected",{tags:{item_id:`from:${j.symbol}`}})),x(j),R(Ql(t,j,void 0,o)),Pe())},[h,o,Pe,t]),_t=Q.useCallback(j=>{nn(j,k)||nn(j,h)||(At.current||(At.current=!0,Qe("bridge","token_selected",{tags:{item_id:`to:${j.symbol}`}})),R(j),Pe())},[h,Pe,k]),F=Q.useMemo(()=>h?o?.(h,t)??t.filter(j=>!nn(j,h)):[],[h,o,t]),ke=Q.useCallback(()=>{h?.balance&&Nt(h.balance,"from")},[h?.balance,Nt]),P=Q.useCallback(()=>{!h||!k||(x(k),R(h),Pe())},[h,Pe,k]),ae=Q.useCallback(()=>{yt.current+=1,C(""),E(""),B("from"),U(null),H(""),Z("")},[]);Q.useEffect(()=>{if(!h||!k)return;if(!I&&!S){U(null),H(""),te(ee=>ee==="quoting"?"idle":ee);return}let j=++yt.current,ze=rf({fromToken:h,toToken:k,fromAmount:I,toAmount:S,lastChangedBy:M,slippage:L});te(ee=>ee==="submitting"?ee:u.canQuote?"quoting":"idle"),(async()=>{try{let ee=await u.getQuote(ze);if(yt.current!==j)return;ee.fromAmount!==void 0&&M==="to"&&C(ee.fromAmount),ee.toAmount!==void 0&&M==="from"&&E(ee.toAmount),U(ee.summary??null),H(ee.error??"")}catch(ee){if(yt.current!==j)return;H(ee instanceof Error?ee.message:"Failed to quote bridge.")}finally{yt.current===j&&te(ee=>ee==="quoting"?"idle":ee)}})()},[I,h,M,u,L,S,k]);let pe=Q.useCallback(()=>!h||!k?null:rf({fromToken:h,toToken:k,fromAmount:I,toAmount:S,lastChangedBy:M,slippage:Y}),[Y,I,h,M,S,k]),me=Q.useCallback(async(j,ze)=>{if(!Ke.current){Ke.current=!0,Z(""),Ct(!1),We(!1),te("submitting");try{if(!ze?.skipApprovalCheck&&i){let $e=await i(j);if($e){Te($e),Be(j),te("idle");return}}Te(null),Be(null),at("processing");let ee=await u.submitBridge(j);ce(ee),te("success"),he($e=>[{id:ee.txHash,timestamp:new Date().toISOString(),txHash:ee.txHash,fromToken:ee.fromToken,toToken:ee.toToken,fromAmount:ee.fromAmount,toAmount:ee.toAmount,summary:A??void 0,status:"pending"},...$e.filter(xn=>xn.txHash!==ee.txHash)]),ae(),wt(!0),at(null),Ct(!0),Qe("bridge","confirmed"),Mt.current=!1,nt.current=!1,f?.(ee),m?.(ee)}catch(ee){if(at(null),Qe("bridge","confirmed",{status:"failure",reason:Cr(ee)}),Mt.current=!1,nt.current=!1,Vl(ee)){te("idle");return}let $e=nf(ee,"Failed to submit bridge.");Z($e),te("error"),y?.({message:$e})}finally{Ke.current=!1}}},[i,y,f,m,u,ae,at,A]),Je=Q.useCallback(async()=>{if(G)return;let j=pe();if(j){if(Mt.current||(Mt.current=!0,Qe("bridge","submitted")),!we){Be(j),ge(!0);return}await me(j)}},[pe,G,me,we]),ir=Q.useCallback(async()=>{let j=_e??pe();j&&(C1(),Ye(!0),ge(!1),await me(j))},[pe,_e,me]),Qt=Q.useCallback(()=>{ge(!1),Be(null)},[]),Lt=Q.useCallback(async()=>{if(!(Xe.current||ie==="submitting"||!be||!_e||!a)){Xe.current=!0,Z(""),te("submitting");try{await a(_e,be),nt.current||(nt.current=!0,Qe("bridge","approved")),Te(null),te("idle"),We(!0)}catch(j){if(Vl(j)){te("idle");return}let ze=nf(j,"Failed to approve token.");Z(ze),te("error"),y?.({message:ze})}finally{Xe.current=!1}}},[be,a,y,_e,me,ie]),hr=Q.useCallback(()=>{ie!=="submitting"&&(Te(null),We(!1),Be(null),te("idle"))},[ie]),br=Q.useCallback(async()=>{if(ie==="submitting")return;let j=_e??pe();if(!j){We(!1),Z("Bridge input is no longer available. Please try again."),te("error");return}We(!1),await me(j,{skipApprovalCheck:!0})},[pe,_e,me,ie]),Vt=Q.useCallback(()=>{Ct(!1)},[]),ar=Q.useCallback(j=>{w(j),j==="history"&&wt(!1)},[]),X=Q.useCallback(()=>{if(p==="history"){ar("form");return}g?.()},[g,ar,p]),Ee=Q.useMemo(()=>[...s,...xe.filter(j=>!s.some(ze=>ze.txHash===j.txHash))],[s,xe]);return{step:p,setStep:ar,status:ie,error:O,quoteError:G,fromToken:h,toToken:k,tokens:t,availableToTokens:F,fromAmount:I,toAmount:S,lastChangedBy:M,slippage:L,effectiveSlippage:Y,slippageLocked:oe,setSlippage:z,summary:A,history:Ee,submitted:_,canSubmit:u.canSubmit,termsOpen:fe,approvalInfo:be,approvalSuccessOpen:it,approveBridge:a,pendingSubmitInput:_e,submitToast:rt,successDialogOpen:ft,dismissSuccessDialog:Vt,hasNewHistory:Se,termsUrl:d,setFromToken:x,setToToken:R,selectFromToken:st,selectToToken:_t,setAmount:Nt,setMax:ke,swapTokens:P,submit:Je,confirmTerms:ir,cancelTerms:Qt,confirmApproval:Lt,cancelApproval:hr,continueAfterApproval:br,back:X}}de(`.bf-root{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .07));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));--bf-toast-bg: var(--bf-bg);--bf-toast-strong: var(--bf-text-high);--bf-toast-color: var(--bf-text-medium);position:relative;display:flex;flex:1;min-height:0;flex-direction:column;container:bf-flow / inline-size;overflow:hidden;background:var(--bf-bg);color:var(--ds-content-highest, #ffffff);font-family:inherit}[data-theme=dark].wi-popover-content .bf-root,[data-theme=dark].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].wi-popover-content .bf-root,[data-theme=light].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}[data-theme=dark].gou-shell .bf-root,.gou-shell[data-theme=dark] .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].gou-shell .bf-root,.gou-shell[data-theme=light] .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}.bf-root[data-view=history]{background:var(--ds-bg-dim, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid var(--bf-border);background:var(--ds-bg-default, var(--bf-bg));box-sizing:border-box}.bf-root[data-view=history] .bf-header{padding:24px;border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff)}.bf-header-btn{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.bf-header-spacer{width:24px;height:24px;flex-shrink:0}.bf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header .bf-header-btn:last-child{position:absolute;top:24px;right:24px}.bf-header-title{position:absolute;left:50%;transform:translate(-50%);font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--bf-text-high);white-space:nowrap}.bf-header-title[data-clickable=true]{cursor:pointer}.bf-root[data-view=history] .bf-header-title{color:var(--ds-content-highest, #000000)}.bf-body,.bf-history-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.bf-body{padding:24px}.bf-history-body{display:flex;flex-direction:column;gap:12px;padding:24px;background:var(--ds-bg-dim, #f5f7fa)}.bf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.bf-chip{display:inline-flex;align-items:center;gap:4px;min-height:33px;padding:6px 8px;border:0;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-chip:hover:not(:disabled){color:var(--bf-text-high);background:var(--bf-surface-hover)}.bf-chip:disabled{cursor:default}.bf-chip-history{position:relative}.bf-chip-dot{position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-swap-card{position:relative;display:flex;flex-direction:column;gap:12px;margin-bottom:12px}.bf-field-error{margin-top:-4px;color:var(--ds-system-red-default, #ff2b5f);font-size:13px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-amount-panel{display:flex;min-height:110px;flex-direction:column;gap:8px;padding:16px;border:1px solid transparent;border-radius:12px;background:var(--bf-surface);box-sizing:border-box;transition:border-color .2s ease}.bf-amount-panel:hover{border-color:var(--bf-border)}.bf-amount-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--bf-text-high);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-balance{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;color:var(--bf-text-low);font-size:12px;white-space:nowrap}.bf-amount-main{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-amount-input-wrap{display:flex;min-width:0;flex:1;flex-direction:column;gap:4px}.bf-amount-input{width:100%;min-width:0;padding:0;border:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:18px;font-size:clamp(15px,4.5cqi,18px);font-weight:600;line-height:1.5;letter-spacing:-.01em;outline:none}.bf-amount-input[data-size=medium]{font-size:16px;font-size:clamp(14px,4cqi,16px)}.bf-amount-input[data-size=small]{font-size:14px;font-size:clamp(12px,3.5cqi,14px)}.bf-amount-input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-amount-usd{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis}.bf-token-pill{display:inline-flex;flex-shrink:0;align-items:center;gap:6px;min-height:33px;padding:6px 8px 6px 6px;border:1px solid var(--bf-border);border-radius:9999px;background:var(--bf-bg);color:var(--bf-text-high);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;perspective:220px;overflow:hidden;transition:transform .12s ease,background .15s ease}.bf-token-pill:hover:not(:disabled):not([data-locked=true]){background:var(--bf-surface-hover)}.bf-token-pill:disabled{cursor:default;opacity:.6}.bf-token-pill[data-locked=true]{cursor:default}.bf-token-icon{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0;background:var(--ds-accent-primary-default, #f0640d);color:var(--ds-accent-primary-on, #000000);font-size:11px;font-weight:700}.bf-token-icon[data-has-image=true]{background:transparent}.bf-token-icon img{width:100%;height:100%;border-radius:0;object-fit:cover}.bf-token-fallback{line-height:1}.bf-token-pill-face{display:inline-flex;align-items:center;gap:6px;transform-origin:center bottom;animation:bf-token-roll-up .32s cubic-bezier(.22,1,.36,1)}@keyframes bf-token-roll-up{0%{opacity:0;transform:translateY(90%) rotateX(-80deg)}60%{opacity:1}}.bf-token-pill:active:not(:disabled),.bf-embedded-token-pill:active:not(:disabled){transform:scale(.96)}.bf-token-search:focus-within{border-color:var(--ds-accent-primary-default, #f0640d)}.bf-token-search input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-search input::placeholder{color:var(--bf-text-low)}.bf-token-list{display:flex;min-height:0;flex:1;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;padding:0 24px 24px;scrollbar-width:thin;box-sizing:border-box}.bf-token-row{position:relative;display:flex;width:100%;min-height:69px;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid transparent;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.bf-token-row:hover:not([data-selected=true]){background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row[data-selected=true]{border-color:var(--ds-accent-primary-default, #ff8438);background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row-left{display:inline-flex;min-width:0;align-items:center;gap:16px}.bf-token-meta{display:flex;min-width:0;flex-direction:column}.bf-token-symbol{overflow:hidden;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-name{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-row-right{display:flex;min-width:86px;max-width:42%;flex-shrink:0;flex-direction:column;align-items:flex-end}.bf-token-balance,.bf-token-price{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-token-balance{color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-token-price{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-row[data-selected=true] .bf-token-symbol{color:var(--bf-text-high)}.bf-token-row[data-selected=true] .bf-token-balance{color:var(--bf-text-high);font-size:16px}.bf-token-row[data-selected=true] .bf-token-price{color:var(--bf-text-low);font-size:14px}.bf-token-empty{padding:32px 16px;color:var(--bf-text-low);font-size:14px;font-weight:500;line-height:1.5;text-align:center}.bf-slippage-overlay{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-slippage-dialog{display:flex;width:min(480px,calc(100vw - 48px));height:auto;min-height:min(316px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);flex-direction:column;overflow:hidden;border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:24px;background:var(--ds-surface-default, #ffffff);color:var(--ds-content-highest, #000000);box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));box-sizing:border-box}.bf-slippage-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-slippage-head h3{margin:0;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-slippage-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-slippage-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-slippage-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:24px;padding:24px;box-sizing:border-box}.bf-slippage-desc{margin:0;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-controls{display:flex;flex-direction:column;gap:12px;width:100%}.bf-slippage-presets{display:flex;gap:8px;width:100%}.bf-slippage-preset{appearance:none;display:inline-flex;flex:1 1 0;min-width:0;min-height:48px;align-items:center;justify-content:center;padding:12px 8px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-preset:hover,.bf-slippage-preset[data-selected=true]{border-color:var(--ds-accent-primary-default, #ff8438);background:var(--ds-accent-primary-low, #fff5ee)}.bf-slippage-custom{display:flex;min-height:48px;align-items:center;gap:8px;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));box-sizing:border-box}.bf-slippage-custom:focus-within,.bf-slippage-custom[data-selected=true]{border-color:var(--ds-accent-primary-default, #ff8438)}.bf-slippage-custom input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--ds-content-high, rgba(0, 0, 0, .85));font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-custom input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-slippage-custom span:not(.bf-sr-only){flex-shrink:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-apply{appearance:none;margin-top:auto;width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #ff8438);color:var(--ds-accent-primary-on-primary, #ffffff);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-apply:hover{filter:brightness(.96)}.bf-slippage-apply:disabled{cursor:not-allowed;opacity:.5;filter:none}.bf-slippage-message{margin:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-message[data-variant=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-slippage-message[data-variant=error]{color:var(--ds-system-red-default, #da0b2e)}.bf-action-modal-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#040912b8;pointer-events:auto;box-sizing:border-box;animation:bf-overlay-in .18s ease-out}.bf-action-modal-overlay[data-theme=light]{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .08));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .65));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .4))}.bf-action-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;align-items:center;gap:24px;padding:48px 24px 24px;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:#fff;box-shadow:0 24px 80px #00000073;box-sizing:border-box;animation:bf-modal-in .2s cubic-bezier(.16,1,.3,1)}.bf-action-modal-overlay[data-state=closed]{animation:bf-overlay-out .15s ease-in forwards}.bf-action-modal-overlay[data-state=closed] .bf-action-modal{animation:bf-modal-out .15s ease-in forwards}@keyframes bf-overlay-in{0%{opacity:0}}@keyframes bf-overlay-out{to{opacity:0}}@keyframes bf-modal-in{0%{opacity:0;transform:translateY(8px) scale(.96)}}@keyframes bf-modal-out{to{opacity:0;transform:translateY(4px) scale(.98)}}@media(prefers-reduced-motion:reduce){.bf-action-modal-overlay,.bf-action-modal,.bf-action-modal-overlay[data-state=closed],.bf-action-modal-overlay[data-state=closed] .bf-action-modal{animation:none}}.bf-action-modal h3{width:100%;margin:0;color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;text-align:left;letter-spacing:0}.bf-action-modal-desc{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-terms-modal{--bf-terms-accent: #f3742e;padding:24px;gap:24px}.bf-terms-modal h3{font-size:20px;font-weight:600;line-height:1.6;text-align:center}.bf-terms-modal .bf-action-modal-desc{font-size:14px;line-height:1.45}.bf-terms-check-row{display:grid;width:100%;min-height:56px;grid-template-columns:20px minmax(0,1fr);align-items:center;column-gap:12px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.4;box-sizing:border-box}.bf-terms-check-button{appearance:none;display:inline-flex;min-width:0;width:20px;height:20px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-copy{display:flex;width:100%;min-width:0;align-items:baseline;justify-content:space-between;column-gap:12px;row-gap:4px;flex-wrap:wrap}.bf-terms-label{min-width:0;cursor:pointer;touch-action:manipulation}.bf-terms-check-button:focus-visible .bf-terms-checkbox{outline:2px solid var(--ds-accent-primary-default, #f0640d);outline-offset:2px}.bf-terms-checkbox{position:relative;display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;border:1px solid rgba(124,143,180,.72);border-radius:4px;background:transparent;box-sizing:border-box}.bf-terms-checkbox[data-checked=true]{border-color:var(--ds-accent-primary-default, #f0640d);background:var(--ds-accent-primary-default, #f0640d)}.bf-terms-checkbox[data-checked=true]:after{width:8px;height:4px;border:solid #ffffff;border-width:0 0 2px 2px;content:"";transform:rotate(-45deg) translate(1px,-1px)}.bf-terms-check-row a{position:relative;z-index:1;color:var(--ds-accent-primary-default, #f0640d);font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}.bf-terms-check-row a:hover{text-decoration:underline}.bf-terms-privacy{max-width:100%;margin:0;color:var(--bf-text-low);font-size:clamp(8px,2.4vw,12px);white-space:nowrap;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-action-primary,.bf-action-secondary{display:inline-flex;width:100%;min-height:56px;align-items:center;justify-content:center;padding:14px 16px;border:0;border-radius:12px;font:inherit;font-size:18px;font-weight:700;line-height:1.4;letter-spacing:0;cursor:pointer}.bf-action-primary{background:var(--ds-accent-primary-default, #f0640d);color:var(--ds-accent-primary-on, #000000)}.bf-action-primary:disabled{cursor:not-allowed;opacity:.35}.bf-terms-modal .bf-action-primary{min-height:52px;background:var(--bf-terms-accent);color:#fff;font-size:16px;font-weight:600}.bf-terms-modal .bf-action-primary:disabled{background:var(--bf-surface);color:var(--bf-text-low);opacity:1}.bf-action-primary[aria-busy=true]{gap:8px;opacity:1}.bf-action-button-spinner{width:18px;height:18px;border:2px solid rgba(0,0,0,.22);border-top-color:currentColor;border-right-color:currentColor;border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-action-secondary{background:var(--bf-surface);color:var(--bf-text-low)}.bf-action-secondary:disabled{cursor:not-allowed;opacity:.5}.bf-approve-address-box{display:flex;width:100%;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-approve-address-box>span{color:var(--bf-text-low);font-size:14px;font-weight:700;line-height:1.4}.bf-approve-address-box>div{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-approve-address-box strong{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:15px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.bf-copy-button{flex-shrink:0;min-width:48px;min-height:32px;padding:6px 10px;border:1px solid rgba(0,206,178,.65);border-radius:8px;background:transparent;color:var(--ds-accent-primary-default, #f0640d);font:inherit;font-size:12px;font-weight:700;line-height:1.2;cursor:pointer}.bf-copy-button:disabled{cursor:not-allowed;opacity:.45}.bf-action-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:12px}.bf-approval-success-modal{gap:28px}.bf-success-mark{position:relative;display:inline-flex;width:96px;height:96px;flex-shrink:0;align-items:center;justify-content:center;border:12px solid rgba(0,206,178,.12);border-radius:999px;background:#00ceb2a8;box-shadow:0 0 0 10px #00ceb20f;box-sizing:border-box}.bf-success-mark:after{width:34px;height:18px;border:solid #ffffff;border-width:0 0 6px 6px;content:"";transform:rotate(-45deg) translate(2px,-3px)}.bf-status-toast{position:absolute;right:16px;bottom:14px;left:16px;z-index:5;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-toast-bg);color:var(--bf-toast-color);box-shadow:0 8px 24px #0000003d;box-sizing:border-box}.bf-status-toast-icon{display:inline-flex;width:28px;height:28px;flex-shrink:0;align-items:center;justify-content:center;border-radius:999px}.bf-status-spinner{width:20px;height:20px;border:3px solid rgba(255,255,255,.18);border-top-color:var(--ds-accent-primary-default, #f0640d);border-right-color:var(--ds-accent-primary-default, #f0640d);border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-status-check{position:relative;width:20px;height:20px;border-radius:999px;background:var(--ds-system-green-default, #00ceb2)}.bf-status-check:after{position:absolute;top:6px;left:5px;width:8px;height:4px;border:solid var(--ds-system-green-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg)}.bf-status-toast-copy{display:flex;min-width:0;flex:1;flex-direction:column}.bf-status-toast-copy strong,.bf-status-toast-copy span{overflow:hidden;text-overflow:ellipsis}.bf-status-toast-copy strong{color:var(--bf-toast-strong);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-status-toast-copy span{color:var(--bf-toast-color);font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em}.bf-status-toast[data-variant=success] .bf-status-toast-copy span{color:var(--ds-system-green-on-inverted, #00e8c9)}.bf-status-toast[data-variant=error]{border:1px solid rgba(255,43,95,.28);background:var(--bf-toast-bg)}.bf-status-toast[data-variant=error] .bf-status-toast-copy strong{color:var(--bf-toast-strong)}.bf-status-error-mark{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:999px;background:var(--ds-system-red-default, #ff2b5f);color:#fff;font-size:14px;font-weight:700;line-height:1}.bf-status-toast[data-variant=error] .bf-status-toast-copy span{color:var(--bf-toast-color)}.bf-success-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#000000b8;pointer-events:auto;box-sizing:border-box}.bf-success-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-border: rgba(18, 18, 18, .08);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-success-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-success-head{display:flex;min-height:73px;align-items:center;justify-content:space-between;gap:16px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));box-sizing:border-box}.bf-success-head h3{min-width:0;margin:0;overflow:hidden;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.bf-success-close{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-success-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-success-body{display:flex;flex-direction:column;align-items:center;gap:24px;padding:40px 24px 24px;box-sizing:border-box}.bf-success-copy{display:flex;width:100%;flex-direction:column;align-items:center;gap:4px;color:var(--bf-text-medium);text-align:center}.bf-success-copy strong{color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;letter-spacing:0}.bf-success-copy span{color:var(--bf-text-medium);font-size:15px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-success-route{display:flex;align-items:center;justify-content:center;gap:12px}.bf-success-route .bf-token-icon{width:48px!important;height:48px!important;background:transparent;font-size:18px}.bf-success-route-arrow{color:var(--bf-text-low);font-size:24px;font-weight:500;line-height:1}.bf-success-ok{display:inline-flex;width:100%;min-height:48px;align-items:center;justify-content:center;padding:12px;border:0;border-radius:12px;background:#00b4b7e0;color:#fff;font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}@media(max-width:767px){.bf-success-body{padding:40px 24px 24px}.bf-success-copy strong{font-size:22px}.bf-success-copy span{font-size:14px}.bf-success-mark{width:88px;height:88px}.bf-success-route .bf-token-icon{width:44px!important;height:44px!important}}@keyframes bf-loading-spin{to{transform:rotate(360deg)}}.bf-swap-toggle{position:absolute;top:100px;left:50%;z-index:1;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:var(--ds-accent-primary-default, #f0640d);color:var(--ds-accent-primary-on, #000000);box-shadow:0 1px 5px #0000001f;cursor:pointer}.bf-swap-card[data-has-from-error=true] .bf-swap-toggle{top:132px}.bf-details{display:flex;flex-direction:column;gap:24px}.bf-collapse{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows .22s ease,opacity .14s ease,margin-top .22s ease}.bf-collapse[data-open=true]{grid-template-rows:1fr;opacity:1}.bf-collapse:not([data-open=true]){margin-top:calc(-1 * var(--bf-collapse-gap, 0px))}.bf-collapse-inner{overflow:hidden;min-height:0}@keyframes bf-value-in{0%{opacity:.25;transform:translateY(-2px)}}.bf-info-value,.bf-route-amount-value,.bf-route-meta>span{animation:bf-value-in .24s ease-out}@media(prefers-reduced-motion:reduce){.bf-collapse{transition:none}.bf-info-value,.bf-route-amount-value,.bf-route-meta>span{animation:none}}.bf-exchange-rate{display:flex;width:100%;align-items:center;justify-content:center;gap:4px;padding:0 0 24px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-detail-section,.bf-history-card{display:flex;flex-direction:column;gap:12px;padding:0;border-radius:12px;background:transparent;box-sizing:border-box}.bf-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-root[data-view=history] .bf-liquidity,.bf-root[data-view=history] .bf-detail-section,.bf-root[data-view=history] .bf-history-card{background:var(--ds-surface-default, #ffffff)}.bf-detail-section h3{margin:0;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-tx-fee-section{gap:12px}.bf-tx-fee-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-collapse-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin:0;padding:0;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.bf-detail-section[data-open=true] .bf-collapse-head{padding-bottom:12px;border-bottom:1px solid var(--bf-border)}.bf-collapse-chevron{flex-shrink:0;color:var(--bf-text-low);transition:transform .2s ease}.bf-detail-section[data-open=true] .bf-collapse-chevron{transform:rotate(180deg)}.bf-collapse-body{display:flex;flex-direction:column;gap:14px}.bf-root[data-view=history] .bf-detail-section[data-open=true] .bf-collapse-head{border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07))}.bf-root[data-view=history] .bf-collapse-chevron{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-tx-fee-total{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--bf-text-medium);font-size:14px;font-weight:600;line-height:1.4;text-align:right}.bf-tx-fee-total>span[data-delegated=true]{text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:currentColor}.bf-fee-delegated{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:2px 8px;border-radius:6px;background:#379cff2e;color:#4eb3ff;font-size:10px;font-weight:500;line-height:1.3;white-space:nowrap}.bf-tx-fee-token{width:16px;height:16px;flex-shrink:0;border-radius:999px;object-fit:cover}.bf-info-card{gap:14px}.bf-info-section{display:flex;flex-direction:column;gap:10px}.bf-info-section+.bf-info-section{padding-top:2px}.bf-info-section h4{margin:0;color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5}.bf-root[data-view=history] .bf-detail-section h3,.bf-root[data-view=history] .bf-info-section h4{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-route-steps{display:flex;flex-direction:column}.bf-route-step{display:grid;min-width:0;grid-template-columns:18px minmax(0,1fr);column-gap:10px}.bf-route-rail{position:relative;display:flex;justify-content:center}.bf-route-line{position:absolute;top:9px;bottom:-4px;width:1px;background:var(--bf-border)}.bf-route-step[data-last=true] .bf-route-line{display:none}.bf-route-dot{z-index:1;width:9px;height:9px;margin-top:5px;border:2px solid var(--bf-text-low);border-radius:999px;background:var(--bf-bg);box-sizing:border-box}.bf-route-dot[data-final=true]{border-color:var(--ds-accent-primary-default, #00ceb2)}.bf-route-body{display:flex;min-width:0;flex-direction:column;gap:2px;padding-bottom:14px}.bf-route-step[data-last=true] .bf-route-body{padding-bottom:0}.bf-route-head{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-route-title{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:13px;font-weight:620;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.bf-route-amount{display:inline-flex;flex-shrink:0;align-items:center;gap:4px;color:var(--bf-text-medium);font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}.bf-route-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;color:var(--bf-text-low);font-size:12px;line-height:1.45;font-variant-numeric:tabular-nums}.bf-route-step[data-kind=hop] .bf-route-title{color:var(--bf-text-medium);font-weight:600}.bf-route-step[data-kind=hop] .bf-route-amount{color:var(--bf-text-low);font-weight:500}.bf-route-step[data-kind=hop] .bf-route-dot{width:7px;height:7px;margin-top:6px;border-width:1px}.bf-route-meta>span[data-tone=accent]{color:var(--ds-accent-primary-default, #00ceb2);font-weight:600}.bf-route-meta>span[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00);font-weight:600}.bf-route-meta>span[data-tone=danger]{color:var(--ds-system-red-default, #da0b2e);font-weight:600}.bf-route-tag{padding:1px 6px;border-radius:5px;background:var(--ds-accent-primary-low, rgba(0, 206, 178, .12));color:var(--ds-accent-primary-high, #00a0a2);font-size:10px;font-weight:700;letter-spacing:.01em}.bf-info-rows{display:flex;flex-direction:column;gap:8px}.bf-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-liquidity-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-info-label{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--bf-text-low)}.bf-info-value{display:flex;min-width:0;align-items:center;justify-content:flex-end;gap:4px;color:var(--bf-text-medium);text-align:right}.bf-info-route,.bf-info-value-token{display:inline-flex;align-items:center;gap:4px}.bf-info-route .bf-token-icon,.bf-info-value-token .bf-token-icon{flex-shrink:0}.bf-info-route-arrow{display:inline-flex;align-items:center;color:var(--bf-text-medium);font-size:12px;line-height:1}.bf-root[data-view=history] .bf-info-route-arrow{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #f0640d)}.bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-info-value[data-tone=danger]{color:var(--ds-system-red-default, #da0b2e)}.bf-root[data-view=history] .bf-info-label,.bf-root[data-view=history] .bf-liquidity-head{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-root[data-view=history] .bf-info-value{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-root[data-view=history] .bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #f0640d)}.bf-root[data-view=history] .bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-root[data-view=history] .bf-info-value[data-tone=danger]{color:var(--ds-system-red-default, #da0b2e)}.bf-liquidity-status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.4;white-space:nowrap}.bf-liquidity-status:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}.bf-liquidity-status[data-status=normal],.bf-liquidity-status:not([data-status]){background:#00ceb21f;color:var(--ds-accent-primary-default, #f0640d)}.bf-liquidity-status[data-status=normal]:before,.bf-liquidity-status:not([data-status]):before{background:var(--ds-accent-primary-default, #f0640d)}.bf-liquidity-status[data-status=low]{background:#e56f001f;color:#e56f00}.bf-liquidity-status[data-status=low]:before{background:#e56f00}.bf-liquidity-status[data-status=rebalancing]{background:#da0b2e1a;color:#da0b2e}.bf-liquidity-status[data-status=rebalancing]:before{background:#da0b2e}.bf-liquidity-track{height:8px;overflow:hidden;border-radius:999px;background:var(--bf-surface-hover)}.bf-liquidity-track span{display:block;height:100%;border-radius:inherit;background:var(--ds-accent-primary-default, #f0640d)}.bf-error{padding:12px;border-radius:12px;background:#da0b2e1f;color:var(--ds-system-red-default, #da0b2e);font-size:13px;line-height:1.4}.bf-footer{display:flex;flex-shrink:0;flex-direction:column;align-items:center;gap:10px;padding:12px 24px 24px;background:var(--ds-bg-default, var(--bf-bg))}.bf-next{width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #f0640d);color:var(--ds-accent-primary-on, #000000);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-next:disabled{cursor:default;opacity:.6}.bf-powered{display:inline-flex;align-items:center;gap:3px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-decoration:none}.bf-powered:focus-visible{border-radius:4px;outline:2px solid var(--ds-accent-primary-default, #f0640d);outline-offset:2px}.bf-powered-brand{text-decoration:underline;text-underline-offset:2px}.bf-history-tabs{display:flex;align-items:center;gap:4px;width:100%}.bf-history-tab{position:relative;display:inline-flex;min-height:37px;align-items:center;justify-content:center;padding:8px 12px;border:0;background:transparent;color:var(--ds-content-lowest, rgba(0, 0, 0, .25));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;cursor:pointer}.bf-history-tab[data-active=true]{color:var(--ds-accent-primary-high, #f0640d)}.bf-history-tab[data-active=true]:after{position:absolute;right:8px;bottom:0;left:8px;height:3px;border-radius:999px;background:var(--ds-accent-primary-high, #f0640d);content:""}.bf-history-tab-dot{position:absolute;top:8px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-history-list{display:flex;flex-direction:column;gap:12px}.bf-history-item{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-history-item-head,.bf-history-meta,.bf-history-route,.bf-history-route-token{display:inline-flex;align-items:center}.bf-history-item-head{justify-content:space-between;gap:12px;width:100%}.bf-history-status{display:inline-flex;min-height:24px;align-items:center;justify-content:center;padding:3px 8px;border-radius:4px;background:var(--ds-system-orange-low, #fcf5e9);color:var(--ds-system-orange-high, #e56f00);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;white-space:nowrap}.bf-history-status[data-status=completed]{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.bf-history-status[data-status=failed]{background:var(--ds-system-red-low, rgba(218, 11, 46, .12));color:var(--ds-system-red-default, #da0b2e)}.bf-history-time{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-align:right;white-space:nowrap}.bf-history-item-body{display:flex;flex-direction:column;gap:4px}.bf-history-amount{color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-meta{justify-content:space-between;gap:12px;min-width:0}.bf-history-usd{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route{justify-content:flex-end;gap:4px;min-width:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-route-token{gap:4px;min-width:0}.bf-history-route-token span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route-arrow{flex-shrink:0;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-empty{padding:32px 16px;text-align:center;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:14px}.bf-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:767px){.bf-slippage-overlay{align-items:flex-end;padding:0}.bf-slippage-dialog{width:100%;height:auto;min-height:316px;max-height:82dvh;border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}}.wi-drawer-content .bf-header{padding:16px}.wi-drawer-content .bf-header .bf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .bf-body,.wi-drawer-content .bf-history-body{padding:16px}.bf-root[data-variant=embedded]{--bf-bg: #1c1c1d;--bf-surface: #212224;--bf-surface-hover: rgba(255, 255, 255, .08);--bf-border: rgba(255, 255, 255, .1);--bf-text-high: rgba(255, 255, 255, .85);--bf-text-medium: rgba(255, 255, 255, .65);--bf-text-low: rgba(255, 255, 255, .4);--bf-embedded-primary: #f3742e;--bf-embedded-on-primary: #ffffff;background:var(--bf-bg);color:#fff}.gou-shell[data-theme=light] .bf-root[data-variant=embedded]{--bf-bg: #ffffff;--bf-surface: #ffffff;--bf-surface-hover: rgba(0, 0, 0, .03);--bf-border: rgba(0, 0, 0, .06);--bf-text-high: rgba(0, 0, 0, .85);--bf-text-medium: rgba(0, 0, 0, .65);--bf-text-low: rgba(0, 0, 0, .4);color:#000}.bf-root[data-variant=embedded] .bf-header{min-height:64px;justify-content:flex-start;gap:12px;padding:16px 20px 12px;border-bottom-color:var(--bf-border);background:var(--bf-bg)}.bf-root[data-variant=embedded] .bf-header .bf-header-btn:last-child{top:16px;right:20px}.bf-root[data-variant=embedded] .bf-header-btn{color:var(--bf-text-medium)}.bf-root[data-variant=embedded] .bf-header-title{position:static;flex:1;padding-right:36px;transform:none;color:var(--bf-text-high);font-size:18px;font-weight:600;line-height:1.5;text-align:left}.bf-root[data-variant=embedded] .bf-header-spacer{display:none}.bf-root[data-variant=embedded] .bf-embedded-body{padding:20px}.bf-embedded-form{display:flex;width:100%;min-width:0;flex-direction:column;gap:20px;--bf-collapse-gap: 20px}.bf-embedded-fields{position:relative;display:flex;width:100%;flex-direction:column}.bf-embedded-field-group{display:flex;width:100%;flex-direction:column;gap:8px}.bf-embedded-amount-panel{display:flex;width:100%;min-width:0;flex-direction:column;padding:16px;border:1px solid rgba(255,255,255,.025);border-radius:12px;background:#212224;box-sizing:border-box}.gou-shell[data-theme=light] .bf-embedded-amount-panel{border-color:#00000014;background:#fff}.bf-embedded-amount-head{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.bf-embedded-amount-label{display:inline-flex;min-width:0;align-items:center;gap:8px;white-space:nowrap}.bf-embedded-amount-label strong{color:var(--bf-text-medium);font-size:14px;font-weight:700;line-height:1.5}.bf-embedded-amount-label>span{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5}.bf-embedded-amount-label em{padding:2px 6px;border-radius:9999px;background:#f3742e1a;color:var(--bf-embedded-primary);font-size:11px;font-style:normal;font-weight:500;line-height:1.25}.bf-embedded-balance{display:inline-flex;min-width:0;max-width:100%;flex-shrink:1;align-items:center;justify-content:flex-end;gap:6px;overflow:hidden;color:var(--bf-text-medium);font-size:12px;font-weight:600;line-height:1.5;text-align:right;white-space:nowrap}.bf-embedded-balance>svg,.bf-embedded-balance>span:not(.bf-embedded-balance-value){flex-shrink:0}.bf-embedded-balance-value{min-width:0;overflow:hidden;text-overflow:ellipsis}.bf-embedded-balance button{flex-shrink:0;padding:2px 8px;border:0;border-radius:9999px;background:#f3742e26;color:var(--bf-embedded-primary);font:inherit;font-size:11px;font-weight:700;line-height:1.4;cursor:pointer}.bf-embedded-balance button:hover{background:#f3742e40}.bf-embedded-amount-main{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-embedded-token-pill{display:inline-flex;height:32px;flex-shrink:0;align-items:center;gap:6px;padding:0 12px 0 6px;border:1px solid rgba(255,255,255,.1);border-radius:9999px;background:#ffffff0d;color:#fff;font:inherit;font-size:14px;font-weight:700;line-height:1.5;cursor:pointer;perspective:220px;overflow:hidden;transition:transform .12s ease,background .15s ease}.gou-shell[data-theme=light] .bf-embedded-token-pill{border-color:#0000000f;background:#00000008;color:#000}.bf-embedded-token-pill:disabled{cursor:default;opacity:1}.bf-embedded-input-wrap{display:flex;min-width:0;flex:1}.bf-embedded-amount-input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:#fff;font:inherit;font-size:24px;font-size:clamp(18px,6cqi,24px);font-weight:700;line-height:32px;text-align:right}.gou-shell[data-theme=light] .bf-embedded-amount-input{color:#000}.bf-embedded-amount-input[data-size=medium]{font-size:20px;font-size:clamp(16px,5cqi,20px);line-height:28px}.bf-embedded-amount-input[data-size=small]{font-size:16px;font-size:clamp(14px,4cqi,16px);line-height:24px}.bf-embedded-amount-input::placeholder{color:var(--bf-text-low);opacity:1}.bf-embedded-field-error{color:#ff3c53;font-size:12px;font-weight:400;line-height:1.5}.bf-embedded-direction{position:relative;z-index:10;display:flex;width:100%;align-items:center;justify-content:center;margin:-12px 0}.bf-embedded-direction>span{display:inline-flex;width:36px;height:36px;align-items:center;justify-content:center;border-radius:9999px;background:var(--bf-embedded-primary);color:var(--bf-embedded-on-primary)}.bf-embedded-summary{display:flex;width:100%;flex-direction:column;gap:12px}.bf-embedded-details{display:flex;width:100%;flex-direction:column;gap:16px;padding:0 16px 16px;box-sizing:border-box}.bf-embedded-details .bf-info-section{gap:12px}.bf-embedded-details .bf-info-section+.bf-info-section{padding-top:0}.bf-embedded-details .bf-info-section h4{color:#fffc;font-size:14px;font-weight:700}.gou-shell[data-theme=light] .bf-embedded-details .bf-info-section h4{color:#000c}.bf-embedded-details .bf-info-rows{gap:12px}.bf-embedded-details .bf-info-row{min-height:20px;font-size:13px;font-weight:600}.bf-embedded-details .bf-info-label{gap:6px;color:var(--bf-text-medium);font-size:13px;font-weight:400}.bf-embedded-details .bf-info-value{color:var(--bf-text-medium);font-size:13px;font-weight:600}.bf-embedded-details .bf-info-value[data-tone=accent]{color:var(--bf-embedded-primary)}.bf-embedded-details .bf-info-route-arrow{color:var(--bf-text-medium)}.bf-embedded-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface)}.bf-embedded-liquidity>div{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--bf-text-medium);font-size:14px}.bf-embedded-liquidity>div>span:last-child{text-transform:capitalize}.bf-embedded-liquidity-track{display:block;height:8px;overflow:hidden;border-radius:9999px;background:var(--bf-surface-hover)}.bf-embedded-liquidity-track>span{display:block;height:100%;border-radius:inherit;background:var(--bf-embedded-primary)}.bf-embedded-liquidity-error{padding:12px 16px;border:1px solid rgba(255,60,83,.3);border-radius:8px;background:#ff3c531a;color:#ff3c53;font-size:14px;line-height:1.5;text-align:center}.bf-embedded-action-footer{width:100%;flex-shrink:0}.bf-embedded-cta{display:flex;width:100%;height:52px;flex-shrink:0;align-items:center;justify-content:center;padding:0 16px;border:0;border-radius:12px;background:var(--bf-embedded-primary);color:var(--bf-embedded-on-primary);font:inherit;font-size:16px;font-weight:600;line-height:1.5;cursor:pointer;transition:opacity .15s ease,background-color .15s ease;box-sizing:border-box}.bf-embedded-cta:hover:not(:disabled){background:#f3742ee6}.bf-embedded-cta:disabled{cursor:not-allowed;opacity:.6}.bf-embedded-spinner{width:20px;height:20px;border:2px solid var(--bf-embedded-on-primary);border-top-color:transparent;border-radius:9999px;animation:bf-loading-spin .9s linear infinite}@media(max-width:767px){.bf-root[data-variant=embedded] .bf-header{min-height:50px;padding:12px 16px 8px;border-bottom:0}.bf-root[data-variant=embedded] .bf-header .bf-header-btn:last-child{display:none}.bf-root[data-variant=embedded] .bf-embedded-body{padding:12px 16px calc(env(safe-area-inset-bottom,0px) + 12px);overscroll-behavior:contain;scroll-padding-bottom:calc(env(safe-area-inset-bottom,0px) + 76px);-webkit-overflow-scrolling:touch}.bf-root[data-variant=embedded] .bf-embedded-action-footer{position:sticky;bottom:0;z-index:20;padding-top:12px;background:var(--bf-bg);isolation:isolate}.bf-root[data-variant=embedded] .bf-embedded-action-footer:after{position:absolute;z-index:-1;top:100%;right:0;left:0;height:calc(env(safe-area-inset-bottom,0px) + 32px);background:var(--bf-bg);box-shadow:0 16px 0 16px var(--bf-bg);content:"";pointer-events:none}.bf-root[data-variant=embedded][data-soft-keyboard-open=true] .bf-embedded-action-footer{position:static;padding-top:0}.bf-root[data-variant=embedded][data-soft-keyboard-open=true] .bf-embedded-action-footer:after{display:none}.bf-root[data-variant=embedded][data-soft-keyboard-open=true] .bf-embedded-body{scroll-padding-bottom:24px}.bf-embedded-amount-head{gap:8px}.bf-embedded-amount-label{gap:6px}.bf-embedded-balance{gap:4px}}
11
- `);import{Fragment as Ho,jsx as v,jsxs as D}from"react/jsx-runtime";var ff=se.createContext(void 0);function ki(){return se.useContext(ff)}function T1(e){let[t,r]=se.useState(void 0);return se.useEffect(()=>{let n=e.current;if(!n)return;let o=()=>{let a=n.closest("[data-theme]");r(a?.getAttribute("data-theme")??void 0)};o();let i=new MutationObserver(o);return i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>i.disconnect()},[e]),t}var lf=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],I1=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function E1(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function df(e){let t=e.replace(/[^\d.]/g,""),[r="",...n]=t.split("."),o=n.join("");return n.length===0?r:`${r}.${o.slice(0,2)}`}function mf(e){return`${e.chainId}:${e.address.toLowerCase()}`}function gf(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function cf(e,t){let r=Number(e||"0"),n=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(r)?r*n:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function A1(e,t=6){if(!e)return e;let[r,n=""]=e.split(".");if(!n)return r;let o=n.slice(0,t).replace(/0+$/,"");return o?`${r}.${o}`:r}function hf(e,t){if(!t)return!1;let r=pt(e),n=pt(t.balance);return!r||!n?!1:r.isGreaterThan(n)}function wi(e){if(!e.isFinite()||e.isNaN())return"0";let r=e.decimalPlaces(6,sf.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[n="0",o]=r.split("."),i=new sf(n||"0").toFormat(0);return o?`${i}.${o}`:i}function M1(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function L1(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let r=n=>n.toString().padStart(2,"0");return[`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}`,`${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`].join(" ")}function D1(e){let t=pt(e);return t?wi(t):e||"0"}function P1(e,t){if(t?.priceUsd===void 0)return null;let r=pt(e);if(!r)return null;let n=r.multipliedBy(t.priceUsd);return n.isFinite()?`$${n.toFormat(2)}`:null}function is(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function O1(e,t){return t==="all"?!0:is(e)===t}function B1(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function Wo(e){return e===56||e===97?"BSC":e===612044||e===612055||e===5555?"ONEchain":`Chain ${e}`}function bf(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function wf(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":bf(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function yf(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function ts(e){return!e||e==="0"||Number(e)===0}function xf(e){let t=e.trim().toLowerCase();return t?t.startsWith("minimum ")?{from:e}:t.startsWith("available ")&&t.includes("or more")?{to:e}:t.includes("insufficient balance")||t.includes("not enough balance")||t.includes("exceeds balance")||t.includes("insufficient network fee")?{from:e}:t.includes("insufficient liquidity")||t.includes("not enough liquidity")?{to:e}:{}:{}}function vf(e){let t=e.fromToken,r=e.toToken,n=wf(t,r),o=e.fromAmount||"0",i=e.toAmount||"0",a=n!==void 0&&!yf(n),s=n!==void 0&&n!=="bridge";return{pathType:n,bridgeInfo:a?[{label:"Route",value:t&&r?`${Wo(t.chainId)} \u2192 ${Wo(r.chainId)}`:"-"},{label:"Validator Fee",value:ts(o)?"0":"Free",tone:ts(o)?"default":"accent"},{label:"Network Fee",value:ts(o)?"0":"Free",tone:ts(o)?"default":"accent"}]:void 0,swapInfo:s?[t&&r?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:r.symbol,iconUrl:r.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:o,valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Swap Fee",value:"0",valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Out Amount",value:i,valueToken:r?{symbol:r.symbol,iconUrl:r.iconUrl}:void 0}]:void 0,txFee:[{label:"Priority Fee Per Gas",value:"0 Gwei"},{label:"Max Fee Per Gas",value:"0 Gwei"},{label:"Gas Limit",value:"0"}],txFeeInfo:{estTxFee:"0",isDelegateFee:!1}}}function yi({token:e,size:t=20}){let r=e?.iconUrl;return v("span",{className:"bf-token-icon","data-has-image":!!r?"true":"false",style:{width:t,height:t},children:r?v("img",{src:r,alt:"",width:t,height:t,draggable:!1}):v("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function rs(e,t){if(e.length===0)return;let r=e.findIndex(n=>bf(n,t));return e[(r+1)%e.length]}function pf({label:e,token:t,amount:r,usd:n,onAmountChange:o,onTokenClick:i,locked:a=!1}){return D("section",{className:"bf-amount-panel",children:[D("div",{className:"bf-amount-head",children:[v("span",{children:e}),D("span",{className:"bf-balance",children:[gf(t?.balance??"0")," ",t?.symbol??""]})]}),D("div",{className:"bf-amount-main",children:[D("label",{className:"bf-amount-input-wrap",children:[D("span",{className:"bf-sr-only",children:[e," amount"]}),v("input",{type:"text",inputMode:"decimal",value:r,onChange:s=>o(s.target.value),placeholder:"0",className:"bf-amount-input","data-size":kf(r)}),v("span",{className:"bf-amount-usd",children:n})]}),D("button",{type:"button",className:"bf-token-pill",onClick:a?void 0:i,disabled:!a&&!i,"data-locked":a?"true":void 0,"data-track":a?void 0:"token_switch","data-track-id":e.toLowerCase(),"aria-label":`Switch ${e.toLowerCase()} token`,children:[D("span",{className:"bf-token-pill-face",children:[v(yi,{token:t}),v("span",{children:t?.symbol??"Select"})]},t?mf(t):"none"),!a&&v(Lr,{size:16})]})]})]})}function z1(e){if(!e)return"";let[t="",r]=e.replace(/,/g,"").split("."),n=t.replace(/\B(?=(\d{3})+(?!\d))/g,",");return r===void 0?n:`${n}.${r}`}function kf(e){let t=e.replace(/,/g,"").trim().length;return t>26?"small":t>18?"medium":"large"}function F1(){return D("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[v("path",{d:"M2.333 4.667A1.667 1.667 0 0 1 4 3h7.333A1.667 1.667 0 0 1 13 4.667v6.666A1.667 1.667 0 0 1 11.333 13H4a1.667 1.667 0 0 1-1.667-1.667V4.667Z",stroke:"currentColor",strokeWidth:"1.25"}),v("path",{d:"M2.667 5.333h9.666c.737 0 1.334.597 1.334 1.334v2.666c0 .737-.597 1.334-1.334 1.334H9.667A2.667 2.667 0 0 1 7 8a2.667 2.667 0 0 1 2.667-2.667Z",stroke:"currentColor",strokeWidth:"1.25"}),v("circle",{cx:"10",cy:"8",r:".75",fill:"currentColor"})]})}function uf({label:e,token:t,amount:r,onAmountChange:n,onTokenClick:o,onMax:i,locked:a}){return D("section",{className:"bf-embedded-amount-panel",children:[D("div",{className:"bf-embedded-amount-head",children:[D("span",{className:"bf-embedded-amount-label",children:[v("strong",{children:e}),!(e==="From")&&v("em",{children:"estimated"})]}),t&&D("span",{className:"bf-embedded-balance",children:[v(F1,{}),v("span",{className:"bf-embedded-balance-value",children:gf(t.balance)}),v("span",{children:t.symbol}),i&&v("button",{type:"button",onClick:i,"aria-label":"Use maximum available balance",children:"MAX"})]})]}),D("div",{className:"bf-embedded-amount-main",children:[D("button",{type:"button",className:"bf-embedded-token-pill",onClick:a?void 0:o,disabled:a,"data-locked":a?"true":void 0,"aria-label":`Switch ${e.toLowerCase()} token`,children:[D("span",{className:"bf-token-pill-face",children:[v(yi,{token:t}),v("span",{children:t?.symbol??"Select"})]},t?mf(t):"none"),!a&&v(Lr,{size:14})]}),D("label",{className:"bf-embedded-input-wrap",children:[D("span",{className:"bf-sr-only",children:[e," amount"]}),v("input",{type:"text",inputMode:"decimal",value:z1(r),onChange:l=>n(l.target.value),placeholder:"0.00",className:"bf-embedded-amount-input","data-size":kf(r)})]})]})]})}function U1({flow:e,onClose:t}){let r=se.useId(),[n,o]=se.useState(null),i=lf.find(g=>g.value===e.slippage),[a,s]=se.useState(e.slippage&&!i?e.slippage:""),l=a.trim()!==""&&a.trim()!==".",d=l?Number(a):NaN,c=Number.isFinite(d)&&d>50,b=Number.isFinite(d)&&d>5&&!c,f=g=>{e.setSlippage(g),t()},m=()=>{!l||c||(e.setSlippage(df(a)),t())};if(se.useEffect(()=>{o(document.body)},[]),se.useEffect(()=>{let g=u=>{u.key==="Escape"&&t()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[t]),!n)return null;let y=ki();return vi(v("div",{className:"bf-slippage-overlay","data-theme":y,role:"presentation",onMouseDown:g=>{g.target===g.currentTarget&&t()},children:D("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,children:[D("header",{className:"bf-slippage-head",children:[v("h3",{id:r,children:"Slippage Settings"}),v("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:v(Nr,{size:24})})]}),D("div",{className:"bf-slippage-body",children:[v("p",{className:"bf-slippage-desc",children:"The maximum price difference you are willing to accept before the transaction is reverted. Higher slippage increases the chance of execution but may result in a worse price."}),D("div",{className:"bf-slippage-controls",children:[v("div",{className:"bf-slippage-presets",children:lf.map(g=>v("button",{type:"button",className:"bf-slippage-preset","data-selected":!l&&e.slippage===g.value?"true":"false",onClick:()=>f(g.value),children:g.label},g.value))}),D("label",{className:"bf-slippage-custom","data-selected":l?"true":"false",children:[v("span",{className:"bf-sr-only",children:"Custom slippage percent"}),v("input",{value:a,onChange:g=>{s(df(g.target.value))},onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),m())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),v("span",{"aria-hidden":"true",children:"%"})]})]}),c?v("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):b?v("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,l&&v("button",{type:"button",className:"bf-slippage-apply",onClick:m,disabled:c,children:"Apply"})]})]})}),n)}function Rf({flow:e,env:t}){let r=se.useId(),[n,o]=se.useState(!1),[i,a]=se.useState(null),s=ki(),l=Ut("apps.json",t,f=>Mr(f?.legal?.termsUrl,t)),d=e.termsUrl??l??Tc;se.useEffect(()=>{a(document.body)},[]),se.useEffect(()=>{let f=m=>{m.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e]);let[c,b]=Ja(e.termsOpen);return!i||!c?null:vi(v("div",{className:"bf-action-modal-overlay","data-theme":s,"data-state":b,role:"presentation",onPointerDown:f=>{f.target===f.currentTarget&&e.cancelTerms()},children:D("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":r,children:[v("h3",{id:r,children:"Agree to Terms of Service"}),v("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using ONEUSD."}),D("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[v("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,"aria-label":"Agree to Terms of Use","data-track":"terms_check",onClick:()=>o(f=>!f),children:v("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"})}),D("div",{className:"bf-terms-copy",children:[v("span",{className:"bf-terms-label",onClick:()=>o(f=>!f),children:"Agree to Terms of Use"}),d&&v("a",{href:d,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]})]}),v("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use ONEUSD"}),v("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,"data-track":"terms_confirm",children:"Confirm"})]})}),i)}function j1({value:e,disabled:t=!1}){let[r,n]=se.useState(!1);return v("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)})},children:r?"OK":"Copy"})}function Cf({flow:e,approval:t}){let r=se.useId(),[n,o]=se.useState(null),i=ki();se.useEffect(()=>{o(document.body)},[]),se.useEffect(()=>{if(!t)return;let c=b=>{e.status!=="submitting"&&b.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e,t]);let[a,s]=Ja(t);if(!n||!a)return null;let l=e.status==="submitting"||!e.approveBridge,d=e.status==="submitting";return vi(v("div",{className:"bf-action-modal-overlay","data-theme":i,"data-state":s,role:"presentation",children:D("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":r,children:[D("h3",{id:r,children:["Approve ",a.token.symbol]}),v(yi,{token:a.token,size:72}),D("div",{className:"bf-approve-address-box",children:[v("span",{children:"Token Address"}),D("div",{children:[v("strong",{children:a.tokenAddress}),v(j1,{value:a.tokenAddress,disabled:d})]})]}),D("div",{className:"bf-action-buttons",children:[v("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),D("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:l,"aria-busy":d,"data-track":"approve_confirm",children:[d&&v("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),v("span",{children:d?"Approving...":"Approve"})]})]})]})}),n)}function Sf({flow:e}){let t=se.useId(),[r,n]=se.useState(null),o=ki();se.useEffect(()=>{n(document.body)},[]),se.useEffect(()=>{if(!e.approvalSuccessOpen)return;let l=d=>{d.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]);let[i,a]=Ja(e.approvalSuccessOpen);if(!r||!i)return null;let s=e.status==="submitting";return vi(v("div",{className:"bf-action-modal-overlay","data-theme":o,"data-state":a,role:"presentation",children:D("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[v("h3",{id:t,children:"Approval Success"}),v("span",{className:"bf-success-mark","aria-hidden":"true"}),D("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",v("br",{}),"Please continue to the next step."]}),D("div",{className:"bf-action-buttons",children:[v("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:s,children:"Cancel"}),D("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,disabled:s,"aria-busy":s,children:[s&&v("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),v("span",{children:s?"Continuing...":"Continue"})]})]})]})}),r)}function W1({fromAmount:e,toAmount:t,fromToken:r,toToken:n}){let o=se.useMemo(()=>{let a=pt(e),s=pt(t);return!a||!s||a.lte(0)||s.lte(0)?null:s.dividedBy(a)},[e,t]),i=!!(o&&r&&n&&r.symbol!==n.symbol);return v(bi,{open:i,children:D("div",{className:"bf-exchange-rate",children:[D("span",{children:["1 ",r?.symbol]}),v("span",{"aria-hidden":"true",children:"="}),D("span",{children:[o?wi(o):""," ",n?.symbol]})]})})}function Nf({flow:e}){return e.submitToast?D("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[v("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:v("span",{className:"bf-status-spinner"})}),D("span",{className:"bf-status-toast-copy",children:[v("strong",{children:"Transaction Processing"}),v("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function Tf({message:e}){let[t,r]=se.useState(!1);return se.useEffect(()=>{if(!e){r(!1);return}r(!0);let n=window.setTimeout(()=>{r(!1)},3500);return()=>window.clearTimeout(n)},[e]),!e||!t?null:D("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[v("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:v("span",{className:"bf-status-error-mark",children:"!"})}),D("span",{className:"bf-status-toast-copy",children:[v("strong",{children:"Error"}),v("span",{children:e})]})]})}function G1(e){switch(e){case"swap":case"deposit-swap":case"swap-withdraw":return"Swap Transaction Sent";case"bridge":return"Bridge Transaction Sent";case"swap-bridge":return"Swap & Bridge Transaction Sent";case"bridge-swap":return"Bridge & Swap Transaction Sent";default:return"Transaction Sent"}}function If({flow:e}){let t=se.useId(),[r,n]=se.useState(null),o=e.submitted,i=ki();return se.useEffect(()=>{n(document.body)},[]),se.useEffect(()=>{if(!e.successDialogOpen)return;let a=s=>{s.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!r||!e.successDialogOpen||!o?null:vi(v("div",{className:"bf-success-overlay","data-theme":i,role:"presentation",children:v("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:D("div",{className:"bf-success-body",children:[v("span",{className:"bf-success-mark","aria-hidden":"true"}),D("div",{className:"bf-success-copy",children:[v("strong",{id:t,children:G1(o.pathType)}),v("span",{children:"Please check the results in the history."})]}),v("div",{className:"bf-success-route","aria-hidden":"true",children:(o.routeTokens&&o.routeTokens.length>0?o.routeTokens:[{symbol:o.fromToken.symbol,iconUrl:o.fromToken.iconUrl},{symbol:o.toToken.symbol,iconUrl:o.toToken.iconUrl}]).map((a,s)=>D(se.Fragment,{children:[s>0&&v("span",{className:"bf-success-route-arrow",children:"\u2192"}),v(xi,{token:a,size:43})]},`${a.symbol}-${s}`))}),v("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,"data-track":"success_ok",children:"OK"})]})})}),r)}function xi({token:e,size:t=16}){let r=!!e.iconUrl;return v("span",{className:"bf-token-icon","data-has-image":r?"true":"false",style:{width:t,height:t},children:e.iconUrl?v("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):v("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function H1({row:e}){return e.routeTokens&&e.routeTokens.length>0?v("span",{className:"bf-info-route",children:e.routeTokens.map((t,r)=>D(se.Fragment,{children:[r>0&&v("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),v(xi,{token:t})]},`${t.symbol}-${r}`))}):e.valueToken?D("span",{className:"bf-info-value-token",children:[v(xi,{token:e.valueToken}),v("span",{children:e.value})]}):v(Ho,{children:e.value})}function Ef({rows:e}){return!e||e.length===0?null:v("div",{className:"bf-info-rows",children:e.map(t=>D("div",{className:"bf-info-row",children:[v("span",{className:"bf-info-label",children:t.label}),v("span",{className:"bf-info-value","data-tone":t.tone??"default",children:v(H1,{row:t})})]},`${t.label}-${t.value}`))})}function _1(e,t,r){return e.pathType==="bridge"?"Bridge Info":yf(e.pathType)?"Swap Info":t&&r?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function bi({open:e,className:t,children:r}){let n=se.useRef(null);return e&&(n.current=r),v("div",{className:t?`bf-collapse ${t}`:"bf-collapse","data-open":e?"true":"false","aria-hidden":e?void 0:!0,children:v("div",{className:"bf-collapse-inner",children:e?r:n.current})})}function Q1({summary:e,from:t,to:r,feeDelegated:n}){let o=!!e.bridgeInfo?.length,i=!!e.swapInfo?.length,a=!!e.txFee?.length,s=_1(e,o,i),[l,d]=se.useState(!0),[c,b]=se.useState(!0);return D("div",{className:"bf-details",children:[e.liquidity&&D("section",{className:"bf-liquidity",children:[D("div",{className:"bf-liquidity-head",children:[v("span",{children:e.liquidity.label??"Available Liquidity"}),v("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),v("div",{className:"bf-liquidity-track",children:v("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(o||i)&&D("section",{className:"bf-detail-section bf-info-card","data-open":l?"true":"false",children:[D("button",{type:"button",className:"bf-collapse-head","aria-expanded":l,onClick:()=>d(f=>!f),"data-track":"details_toggle",children:[v("h3",{children:s}),v(Lr,{size:16,className:"bf-collapse-chevron"})]}),l&&v("div",{className:"bf-collapse-body",children:v(Lf,{summary:e,from:t,to:r,feeDelegated:n})})]}),a&&D("section",{className:"bf-detail-section bf-tx-fee-section","data-open":c?"true":"false",children:[D("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":c,onClick:()=>b(f=>!f),"data-track":"details_toggle",children:[v("h3",{children:"Est. Tx Fee"}),D("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&v("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&v("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),v("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:A1(e.txFeeInfo?.estTxFee??"0")}),v(Lr,{size:16,className:"bf-collapse-chevron"})]})]}),c&&v("div",{className:"bf-collapse-body",children:v(Ef,{rows:e.txFee})})]})]})}function V1(e){return{...e,bridgeInfo:e.bridgeInfo?.map(t=>({...t,value:t.label==="Route"?t.value.replace(/\bCROSS\b/g,"ONEchain"):t.value})),swapInfo:e.swapInfo?.map(t=>({...t,label:t.label.startsWith("Swap Fee")?"Est. Swap Fee":t.label}))}}function ns(e){let t=pt(e);if(!(!t||t.lte(0)))return wi(t)}function q1(e,t,r,n){if(!r||!n)return;let o=pt(e),i=pt(t);if(!o||!i||o.lte(0)||i.lte(0))return;let a=i.dividedBy(o);if(a.gte("0.001"))return`1 ${r.symbol} = ${wi(a)} ${n.symbol}`;let s=o.dividedBy(i);return`1 ${n.symbol} = ${wi(s)} ${r.symbol}`}var Y1=1,K1=5;function Af(e){return pt(e)?.toNumber()??null}function Mf(e){let t=Af(e);if(t!==null){if(t>=K1)return"danger";if(t>=Y1)return"warning"}}var Z1=/\bin\b.*amount|amount.*\bin\b|^from\b/i,X1=/\bout\b.*amount|amount.*\bout\b|^to\b|receive/i,J1=/fee/i,$1=/impact|rate|slippage|minimum|min\.|received/i,os=/impact/i,ey=/^route$/i;function ty(e,t,r){let n=e.find(c=>Z1.test(c.label)),o=e.find(c=>X1.test(c.label)),i=new Set;n&&i.add(n),o&&i.add(o);let a=e.find(c=>ey.test(c.label)||(c.routeTokens?.length??0)>0),s=a?.routeTokens?.length?a.routeTokens:void 0,l=a&&!s?a.value:void 0;a&&i.add(a);let d=[];for(let c of e){if(i.has(c))continue;let b=J1.test(c.label);if(!b&&!$1.test(c.label))continue;i.add(c);let f=Af(c.value),m=b&&(f===0||/^\s*free\s*$/i.test(String(c.value??"")));m&&t==="swap"||d.push({text:m?`${c.label} Free`:`${c.label} ${c.value}`,tone:m?"accent":os.test(c.label)?c.tone==="danger"||c.tone==="warning"?c.tone:Mf(c.value):void 0})}return{key:t,label:r,routeText:l,routeTokens:s,inRow:n,outRow:o,meta:d,rest:e.filter(c=>!i.has(c))}}function ry({steps:e}){return v("div",{className:"bf-route-steps",children:e.map((t,r)=>D("div",{className:"bf-route-step","data-last":r===e.length-1?"true":"false","data-kind":t.key.startsWith("hop-")?"hop":"endpoint",children:[D("span",{className:"bf-route-rail","aria-hidden":"true",children:[v("span",{className:"bf-route-line"}),v("span",{className:"bf-route-dot","data-final":r===e.length-1?"true":"false"})]}),D("span",{className:"bf-route-body",children:[D("span",{className:"bf-route-head",children:[v("span",{className:"bf-route-title",children:t.title}),v("span",{className:"bf-route-amount",children:t.routeTokens?.length?t.routeTokens.map((n,o)=>D(se.Fragment,{children:[o>0&&v("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),v(xi,{token:n})]},`${n.symbol}-${o}`)):D(Ho,{children:[t.amountToken&&v(xi,{token:t.amountToken}),v("span",{className:"bf-route-amount-value",children:t.amount},t.amount)]})})]}),(t.meta.length>0||t.tags.length>0)&&D("span",{className:"bf-route-meta",children:[t.meta.map(n=>v("span",{"data-tone":n.tone??"default",children:n.text},n.text)),t.tags.map(n=>v("span",{className:"bf-route-tag",children:n},n))]})]})]},t.key))})}function ny(e){if(!os.test(e.label)||e.tone==="danger"||e.tone==="warning")return e;let t=Mf(e.value);return t?{...e,tone:t}:e}function Lf({summary:e,rateLine:t,from:r,to:n,feeDelegated:o,includeTxFee:i=!1}){let a=!!e.txFeeInfo?.isDelegateFee||!!o,s=se.useMemo(()=>(e.pathType==="bridge-swap"?[["bridge","Bridge"],["swap","Swap"]]:[["swap","Swap"],["bridge","Bridge"]]).map(([k,R])=>{let I=k==="swap"?e.swapInfo:e.bridgeInfo;return I?.length?ty(I,k,R):null}).filter(k=>k!==null),[e]);if(s.length===0)return null;let l=s[0],d=s[s.length-1],c=l.inRow?.valueToken??(r?.symbol?{symbol:r.symbol,iconUrl:r.iconUrl}:void 0),b=l.inRow?.value??r?.amount,f=d.outRow?.valueToken??(n?.symbol?{symbol:n.symbol,iconUrl:n.iconUrl}:void 0),m=d.outRow?.value??n?.amount;if(!b)return null;let y=e.txFeeInfo,g=i&&y&&!y.isDelegateFee?[{text:`Gas ${y.estTxFee}${y.tokenSymbol?` ${y.tokenSymbol}`:""}`}]:[],u=s.length>1,p=[{key:"send",title:`Send ${c?.symbol??""}`.trim(),amount:b,amountToken:c,routeTokens:u?void 0:l.routeTokens,meta:[...g.length?[{text:"EST."}]:r?.chain?[{text:`on ${r.chain}`}]:[],...g,...u?[]:[...l.routeText?[{text:l.routeText}]:[],...l.meta.filter(x=>!os.test(x.text))]],tags:a&&!u?["Fee delegated"]:[]},...u?s.map(x=>({key:`hop-${x.key}`,title:x.label,amount:x.routeText??"",routeTokens:x.routeTokens,meta:x.meta,tags:a&&x.key==="swap"?["Fee delegated"]:[]})):[],{key:"receive",title:`Receive ${f?.symbol??""}`.trim(),amount:m??"\u2014",amountToken:f,meta:[...n?.chain?[{text:`on ${n.chain}`}]:[],...u?[]:l.meta.filter(x=>os.test(x.text))],tags:[]}],w=[...s.flatMap(x=>x.rest),...i?e.txFee??[]:[]].map(ny),h=!!t;return D(Ho,{children:[v(ry,{steps:p}),(w.length>0||h)&&v("div",{className:"bf-info-section",children:v(Ef,{rows:[...h?[{label:"Rate",value:t}]:[],...w]})})]})}function oy({summary:e,rateLine:t,from:r,to:n,feeDelegated:o}){let i=se.useMemo(()=>V1(e),[e]);return!i.bridgeInfo?.length&&!i.swapInfo?.length?null:v("div",{className:"bf-embedded-details",children:v(Lf,{summary:i,rateLine:t,from:r,to:n,feeDelegated:o,includeTxFee:!0})})}function iy({flow:e,env:t,toastError:r}){return D(Ho,{children:[v(Rf,{flow:e,env:t}),v(Cf,{flow:e,approval:e.approvalInfo??null}),v(Sf,{flow:e}),v(Nf,{flow:e}),v(Tf,{message:e.submitToast?"":r}),v(If,{flow:e})]})}function ay({flow:e,env:t,isConnected:r,onRequestConnect:n,feeDelegated:o}){let i=Number(e.fromAmount)>0,a=se.useMemo(()=>i?e.summary??vf(e):null,[i,e]),s=xf(e.quoteError),l=hf(e.fromAmount,e.fromToken),d=l?"Insufficient balance":s.from,c=/insufficient liquidity|not enough liquidity/i.test(e.quoteError),b=c?void 0:s.to,f=e.quoteError&&!s.from&&!s.to?e.quoteError:"",m=e.error||f,y=e.status==="submitting",g=!i||!e.toAmount||!e.fromToken||!e.toToken||!e.canSubmit||!!e.quoteError||l||y,u=y?"":c&&i?"Insufficient Liquidity":i?"Continue":"Enter Amount";return D(Ho,{children:[v("main",{className:"bf-body bf-embedded-body","data-rd-scroll-area":!0,children:D("div",{className:"bf-embedded-form",children:[D("div",{className:"bf-embedded-fields",children:[D("div",{className:"bf-embedded-field-group",children:[v(uf,{label:"From",token:e.fromToken,amount:e.fromAmount,onAmountChange:p=>e.setAmount(p,"from"),onTokenClick:()=>{let p=rs(e.tokens,e.fromToken);p&&e.selectFromToken(p)},onMax:e.setMax,locked:e.tokens.length<=1}),d&&v("div",{className:"bf-embedded-field-error",children:d})]}),v("div",{className:"bf-embedded-direction","aria-hidden":"true",children:v("span",{children:v(_l,{size:16})})}),D("div",{className:"bf-embedded-field-group",children:[v(uf,{label:"To",token:e.toToken,amount:e.toAmount,onAmountChange:p=>e.setAmount(p,"to"),onTokenClick:()=>{let p=rs(e.availableToTokens,e.toToken);p&&e.selectToToken(p)},locked:e.availableToTokens.length<=1}),b&&v("div",{className:"bf-embedded-field-error",children:b})]})]}),v(bi,{open:!!a?.liquidity,children:a?.liquidity&&D("section",{className:"bf-embedded-liquidity",children:[D("div",{children:[v("span",{children:a.liquidity.label??"Available Liquidity"}),v("span",{"data-status":a.liquidity.status,children:a.liquidity.status??"normal"})]}),v("span",{className:"bf-embedded-liquidity-track",children:v("span",{style:{width:`${a.liquidity.percentage??50}%`}})})]})}),v(bi,{open:c&&i,children:v("div",{className:"bf-embedded-liquidity-error",role:"alert",children:"Insufficient liquidity in all pools for this pair and amount."})}),v(bi,{open:!!a,children:a&&v("div",{className:"bf-embedded-summary",children:v(oy,{summary:a,feeDelegated:o,rateLine:q1(e.fromAmount,e.toAmount,e.fromToken,e.toToken),from:{symbol:e.fromToken?.symbol,iconUrl:e.fromToken?.iconUrl,amount:ns(e.fromAmount),chain:e.fromToken?Wo(e.fromToken.chainId):void 0},to:{symbol:e.toToken?.symbol,iconUrl:e.toToken?.iconUrl,amount:ns(e.toAmount),chain:e.toToken?Wo(e.toToken.chainId):void 0}})})}),v("div",{className:"bf-embedded-action-footer",children:r?v("button",{type:"button",className:"bf-embedded-cta",onClick:e.submit,"data-track":"next",disabled:g,"aria-busy":y,"aria-label":y?"Processing transaction":c?"Insufficient liquidity":"Continue with swap or bridge",children:y?v("span",{className:"bf-embedded-spinner","aria-hidden":"true"}):u}):v("button",{type:"button",className:"bf-embedded-cta",onClick:n,"data-track":"connect_click","aria-label":"Connect wallet to continue",children:"Connect Wallet"})})]})}),v(iy,{flow:e,env:t,toastError:m})]})}function sy({item:e}){let t=is(e),r=P1(e.fromAmount,e.fromToken);return D("article",{className:"bf-history-item",children:[D("div",{className:"bf-history-item-head",children:[v("span",{className:"bf-history-status","data-status":t,children:B1(t)}),v("time",{className:"bf-history-time",dateTime:e.timestamp,children:L1(e.timestamp)})]}),D("div",{className:"bf-history-item-body",children:[D("strong",{className:"bf-history-amount",children:[D1(e.fromAmount)," ",e.fromToken.symbol]}),D("div",{className:"bf-history-meta",children:[v("span",{className:"bf-history-usd",children:r??M1(e.txHash)}),D("span",{className:"bf-history-route",children:[D("span",{className:"bf-history-route-token",children:[v(yi,{token:e.fromToken,size:16}),v("span",{children:e.fromToken.symbol})]}),v(Zu,{size:16,className:"bf-history-route-arrow"}),D("span",{className:"bf-history-route-token",children:[v(yi,{token:e.toToken,size:16}),v("span",{children:e.toToken.symbol})]})]})]})]})]})}function ly({flow:e}){let[t,r]=se.useState("all"),n=e.history.some(a=>is(a)==="pending"),o=e.history.filter(a=>O1(a,t)),i=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return D("main",{className:"bf-history-body",children:[v("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:I1.map(a=>D("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>r(a.value),"data-track":"history_filter","data-track-id":a.value,children:[v("span",{children:a.label}),a.value==="pending"&&n&&v("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),o.length>0?v("div",{className:"bf-history-list",children:o.map(a=>v(sy,{item:a},a.id||a.txHash))}):v("div",{className:"bf-empty",children:i})]})}function dy({flow:e,env:t,feeDelegated:r}){let[n,o]=se.useState(!1),[i,a]=se.useState(0),s=!!(e.fromAmount.trim()||e.toAmount.trim()),l=se.useMemo(()=>s?e.summary??vf(e):null,[s,e]),d=Ut("apps.json",t,w=>Mr(w?.bridgePoweredBy?.url,t)),c=xf(e.quoteError),b=hf(e.fromAmount,e.fromToken),f=b?"Insufficient balance":c.from,m=e.quoteError&&!c.from&&!c.to?e.quoteError:"",y=e.error||m,g=e.history.some(w=>is(w)==="pending"),p=(l?.pathType??wf(e.fromToken,e.toToken))!=="bridge";return D(Ho,{children:[D("main",{className:"bf-body",children:[D("div",{className:"bf-toolbar",children:[D("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),"data-track":"history_open",children:[v(Yu,{}),v("span",{children:"History"}),(g||e.hasNewHistory)&&v("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),p&&D("button",{type:"button",className:"bf-chip",onClick:()=>o(!0),"data-track":"slippage_open",disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":n,children:[v(Ku,{}),v("span",{children:e.slippageLocked?"Auto 1%":E1(e.slippage,e.effectiveSlippage)})]})]}),D("div",{className:"bf-swap-card","data-has-from-error":f?"true":"false",children:[v(pf,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:cf(e.fromAmount,e.fromToken),onAmountChange:w=>e.setAmount(w,"from"),onTokenClick:()=>{let w=rs(e.tokens,e.fromToken);w&&e.selectFromToken(w)},locked:e.tokens.length<=1}),f&&v("div",{className:"bf-field-error",children:f}),v("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),a(w=>w+360)},"data-track":"token_swap",style:{transform:`translateX(-50%) rotate(${i}deg)`,transition:"transform 0.2s ease"},children:v(_l,{size:22})}),v(pf,{label:"To",token:e.toToken,amount:e.toAmount,usd:cf(e.toAmount,e.toToken),onAmountChange:w=>e.setAmount(w,"to"),onTokenClick:()=>{let w=rs(e.availableToTokens,e.toToken);w&&e.selectToToken(w)},locked:e.availableToTokens.length<=1}),c.to&&v("div",{className:"bf-field-error",children:c.to})]}),v(W1,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),v(bi,{open:!!l,children:l&&v(Q1,{summary:l,feeDelegated:r,from:{symbol:e.fromToken?.symbol,iconUrl:e.fromToken?.iconUrl,amount:ns(e.fromAmount),chain:e.fromToken?Wo(e.fromToken.chainId):void 0},to:{symbol:e.toToken?.symbol,iconUrl:e.toToken?.iconUrl,amount:ns(e.toAmount),chain:e.toToken?Wo(e.toToken.chainId):void 0}})})]}),D("footer",{className:"bf-footer",children:[v("button",{type:"button",className:"bf-next",onClick:e.submit,"data-track":"next",disabled:e.status==="submitting"||!!e.quoteError||b,children:e.status==="submitting"?"Processing...":"Next"}),d&&D("a",{className:"bf-powered",href:d,target:"_blank",rel:"noreferrer",children:["Powered by ",v("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&v(U1,{flow:e,onClose:()=>o(!1)}),v(Rf,{flow:e,env:t}),v(Cf,{flow:e,approval:e.approvalInfo??null}),v(Sf,{flow:e}),v(Nf,{flow:e}),v(Tf,{message:e.submitToast?"":y}),v(If,{flow:e})]})}function Go({onClose:e,onBackToWallet:t,feeDelegated:r,env:n,variant:o="default",title:i,isConnected:a,onRequestConnect:s,className:l,...d}){let c=se.useMemo(()=>ot(n),[n]),b=qu(),f=af({...d,onExit:t}),m=se.useRef(null),y=T1(m),g=f.step==="history"?"History":i??"Swap & Bridge",u=a??!!d.walletAddress,p=o==="embedded"&&f.step==="form"&&!t?null:f.back;return v(ye,{feature:"bridge",children:v(ff.Provider,{value:y,children:D("div",{ref:m,className:Re("bf-root",l),"data-view":f.step,"data-status":f.status,"data-variant":o,"data-soft-keyboard-open":o==="embedded"&&b?"true":"false",children:[D("header",{className:"bf-header",children:[p?v("button",{type:"button",className:"bf-header-btn",onClick:p,"aria-label":"Back",children:v($r,{size:24})}):v("span",{className:"bf-header-spacer","aria-hidden":"true"}),v("span",{className:"bf-header-title","data-clickable":p?"true":"false",onClick:p??void 0,children:g}),v("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:v(Nr,{size:24})})]}),f.step==="history"?v(ly,{flow:f}):o==="embedded"?v(ay,{flow:f,env:c,isConnected:u,onRequestConnect:s,feeDelegated:r}):v(dy,{flow:f,env:c,feeDelegated:r})]})})})}import*as nr from"react";import Sy from"bignumber.js";import{useInfiniteQuery as cy}from"@tanstack/react-query";var py="token-history";function Df(e,t,r,n,o=!0){return cy({queryKey:[py,e,t,r.toLowerCase(),n.toLowerCase()],initialPageParam:void 0,queryFn:async({pageParam:i,signal:a})=>{let s=await Me("walletServer",e),l=new URLSearchParams({chain_id:String(t),token:r,wallet:n}),d=i;d&&(l.set("last_timestamp",String(d.last_timestamp)),l.set("last_log_index",String(d.last_log_index)),l.set("last_tx_index",String(d.last_tx_index)));let c=await fetch(`${s}/v1/public/token/historical?${l}`,{cache:"no-store",signal:a});if(!c.ok)throw new Error(`Failed to fetch token history: ${c.status}`);let b=await c.json();if(b.code!==200)throw new Error(`Token history API error: ${b.code}`);return b.data??[]},getNextPageParam:i=>{if(!i||i.length===0)return;let a=i[i.length-1];return{last_timestamp:a.timestamp,last_log_index:a.log_index,last_tx_index:a.tx_index}},enabled:o&&!!n&&!!r&&t>0,staleTime:1e4})}import*as as from"react";var ql={chart:!1,balance:!0,overview:!1,social:!1,history:!0},uy=Object.keys(ql);function Pf(e){let[t,r]=as.useState({visibility:ql,isLoaded:!1});return as.useEffect(()=>{let n=!0;return no(Ji,e).then(o=>{if(!n)return;let i=o?.tokenDetail?.sections,a={...ql};if(i)for(let s of uy){let l=i[s];typeof l=="boolean"&&(a[s]=l)}r({visibility:a,isLoaded:!0})}),()=>{n=!1}},[e]),t}import*as fr from"react";import{useQuery as fy,keepPreviousData as my}from"@tanstack/react-query";var gy="token-price-history";function Of(e,t,r,n,o=!0){return fy({queryKey:[gy,e,t,r.toLowerCase(),n],queryFn:async({signal:i})=>{let a=await Me("walletServer",e),s=new URLSearchParams({chain_id:String(t),token:r,interval:n}),l=await fetch(`${a}/v1/public/token/price/historical?${s}`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token price history: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token price history API error: ${d.code}`);return d.data??[]},enabled:o&&!!r&&t>0,staleTime:3e4,placeholderData:my})}import{Fragment as Cy,jsx as Zt,jsxs as _o}from"react/jsx-runtime";var hy="var(--ds-system-green-high, #00a869)",by="var(--wi-error, #e70077)",bo=150,ss=3,Yl=18,wy=18,yy=[{key:"10m",label:"10m"},{key:"1h",label:"1H"},{key:"1d",label:"1D"},{key:"7d",label:"1W"},{key:"30d",label:"1M"},{key:"1y",label:"1Y"}],xy=new Set(["7d","30d","1y"]);function vy(){let e=fr.useRef(null),[t,r]=fr.useState(0);return fr.useEffect(()=>{let n=e.current;if(!n)return;let o=new ResizeObserver(i=>{r(i[0]?.contentRect.width??0)});return o.observe(n),r(n.clientWidth),()=>o.disconnect()},[]),[e,t]}function ky(e,t){let r=new Date(e*1e3),n=t?{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}:{hour:"numeric",minute:"2-digit"};return new Intl.DateTimeFormat("en-US",n).format(r)}function Ry(e,t){if(t<=0||e.length===0)return null;let r=e.length===1?[e[0],e[0]]:e,n=r.length,o=r[0],i=r[0],a=0,s=0;for(let w=1;w<n;w++)r[w]>o&&(o=r[w],a=w),r[w]<i&&(i=r[w],s=w);let l=o-i||1,d=Math.max(1,t-ss*2),c=bo-Yl-wy,b=w=>n===1?t/2:ss+w/(n-1)*d,f=w=>Yl+(1-(w-i)/l)*c,m=r.map((w,h)=>({x:b(h),y:f(w)})),y=m.map((w,h)=>`${h===0?"M":"L"}${w.x.toFixed(2)},${w.y.toFixed(2)}`).join(" "),g=m[0],u=m[m.length-1],p=`${y} L${u.x.toFixed(2)},${bo} L${g.x.toFixed(2)},${bo} Z`;return{values:r,points:m,linePath:y,areaPath:p,maxIdx:a,minIdx:s}}function Bf({env:e,chainId:t,tokenAddress:r}){let[n,o]=fr.useState("1d"),[i,a]=fr.useState(null),s=fr.useId(),[l,d]=vy(),{data:c,isLoading:b,isError:f}=Of(e,t,r,n,!0),m=fr.useMemo(()=>(c??[]).filter(U=>Number.isFinite(Number(U.price))).slice().sort((U,oe)=>U.updated_at-oe.updated_at),[c]),y=fr.useMemo(()=>m.map(A=>Number(A.price)),[m]),g=fr.useMemo(()=>Ry(y,d),[y,d]);fr.useEffect(()=>{a(null)},[n]);let u=m.length>0,p=i!==null&&i<y.length?i:y.length-1,w=u?y[p]:0,h=u?y[0]:0,x=h!==0?(w-h)/h*100:0,k=x>=0,R=k?hy:by,I=(k?"+":"-")+(Math.floor(Math.abs(x)*100)/100).toFixed(2)+"%",C=i!==null&&m[i]?ky(m[i].updated_at,xy.has(n)):"",S=A=>{if(!g||d<=0)return;let U=A.currentTarget.getBoundingClientRect(),oe=A.clientX-U.left;if(g.values.length<=1){a(0);return}let G=Math.max(1,d-ss*2),H=Math.min(1,Math.max(0,(oe-ss)/G)),ie=Math.round(H*(m.length-1));a(Math.min(m.length-1,Math.max(0,ie)))},E=()=>a(null);if(!b&&(f||!u))return null;let M=i!==null&&g&&g.points[i]?g.points[i]:null,B=g?.points[g.maxIdx],L=g?.points[g.minIdx],z=A=>Math.min(Math.max(A,24),Math.max(24,d-24));return _o("section",{className:"wi-td-chart",children:[_o("div",{className:"wi-td-chart-panel",children:[Zt("span",{className:"wi-td-chart-price",children:u?co(w):"\u2014"}),u&&_o("span",{className:"wi-td-chart-change","data-positive":k,children:[Zt("span",{children:I}),C&&Zt("span",{className:"wi-td-chart-when",children:C})]})]}),Zt("div",{ref:l,className:"wi-td-chart-plot",children:b&&!u?Zt("div",{className:"wi-skeleton-block wi-td-chart-skeleton"}):g&&d>0&&_o("svg",{className:"wi-td-chart-svg",width:d,height:bo,role:"img","aria-label":"Price chart",children:[Zt("defs",{children:_o("linearGradient",{id:s,x1:"0",y1:"0",x2:"0",y2:"1",children:[Zt("stop",{offset:"0%",stopColor:R,stopOpacity:.28}),Zt("stop",{offset:"100%",stopColor:R,stopOpacity:0})]})}),Zt("path",{d:g.areaPath,fill:`url(#${s})`}),Zt("path",{d:g.linePath,fill:"none",stroke:R,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),B&&Zt("text",{className:"wi-td-chart-minmax",x:z(B.x),y:Math.max(11,B.y-7),textAnchor:"middle",children:co(g.values[g.maxIdx])}),L&&g.minIdx!==g.maxIdx&&Zt("text",{className:"wi-td-chart-minmax",x:z(L.x),y:Math.min(bo-5,L.y+14),textAnchor:"middle",children:co(g.values[g.minIdx])}),M&&_o(Cy,{children:[Zt("line",{className:"wi-td-chart-cursor",x1:M.x,y1:Yl-6,x2:M.x,y2:bo}),Zt("circle",{cx:M.x,cy:M.y,r:4,fill:R,stroke:"var(--wi-surface-bg, #121212)",strokeWidth:2})]}),Zt("rect",{x:0,y:0,width:d,height:bo,fill:"transparent",style:{touchAction:"none"},onPointerMove:S,onPointerDown:S,onPointerLeave:E,onPointerCancel:E})]})}),Zt("div",{className:"wi-td-chart-tabs",role:"tablist",children:yy.map(A=>Zt("button",{type:"button",role:"tab","aria-selected":n===A.key,className:"wi-td-chart-tab","data-active":n===A.key||void 0,onClick:()=>o(A.key),"data-track":"token_detail_interval","data-track-id":A.key,children:A.label},A.key))})]})}import{Fragment as Uf,jsx as K,jsxs as lt}from"react/jsx-runtime";var Ny="https://contents.crosstoken.io/wallet/token/images/FT.png",Ty={receive:"Receive",send:"Send","bridge-in":"Bridge In","bridge-out":"Bridge Out"};function Iy(e){return e.length>24?"xs":e.length>18?"sm":"md"}function Ey(e){if(!e)return"";let t=e<1e12?e*1e3:e,r=Math.max(0,Math.floor((Date.now()-t)/1e3));if(r<60)return"just now";let n=Math.floor(r/60);if(n<60)return`${n}m`;let o=Math.floor(n/60);if(o<24)return`about ${o}h`;let i=Math.floor(o/24);if(i<30)return`${i}d`;let a=Math.floor(i/30);return a<12?`${a}mo`:`${Math.floor(a/12)}y`}function zf(e){let[t,r]=e.split("."),n="";for(let o=0;o<t.length;o++){let i=t.length-o;o>0&&i%3===0&&(n+=","),n+=t[o]}return r?`${n}.${r}`:n}function Ff(e,t){let r=BigInt(e||"0");if(t<=2){let a=10n**BigInt(t),s=r/a,l=r%a*10n**BigInt(2-t);return`${s.toString()}.${l.toString().padStart(2,"0")}`}let n=r/10n**BigInt(t-2),o=n/100n,i=n%100n;return`${o.toString()}.${i.toString().padStart(2,"0")}`}function Ay(e,t,r){let n=nr.useRef(null),o=nr.useRef(null),[i,a]=nr.useState(t);return nr.useLayoutEffect(()=>{let s=n.current,l=o.current;if(!s||!l)return;let d=()=>{let b=s.clientWidth;if(!b)return;let f=window.getComputedStyle(l),m=document.createElement("span");m.textContent=l.textContent,m.style.cssText=["position:absolute","left:-9999px","top:-9999px","visibility:hidden","white-space:nowrap",`font-family:${f.fontFamily}`,`font-weight:${f.fontWeight}`,`letter-spacing:${f.letterSpacing}`,`font-size:${t}px`].join(";"),document.body.appendChild(m);let y=m.offsetWidth;if(document.body.removeChild(m),y<=b){a(t);return}let g=Math.max(r,Math.floor(t*b/y));a(g)};d();let c=new ResizeObserver(d);return c.observe(s),()=>c.disconnect()},[e,t,r]),{containerRef:n,textRef:o,fontSize:i}}function My(e){let t=pt(e);return t?t.decimalPlaces(4,Sy.ROUND_DOWN).toFormat():"-"}function Ly(){return lt("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[K("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.6"}),K("path",{d:"M3 12h18M12 3c2.5 2.5 3.8 5.8 3.8 9s-1.3 6.5-3.8 9c-2.5-2.5-3.8-5.8-3.8-9S9.5 5.5 12 3Z",stroke:"currentColor",strokeWidth:"1.6"})]})}function Dy(){return K("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:K("path",{d:"M21.9 4.3 18.6 20c-.2 1-.9 1.3-1.8.8l-4.9-3.6-2.4 2.3c-.3.3-.5.5-1 .5l.3-4.9 9-8.1c.4-.3-.1-.5-.6-.2L6.2 13.2l-4.8-1.5c-1-.3-1-1 .2-1.5L20.6 3c.9-.3 1.6.2 1.3 1.3Z"})})}function Py(){return K("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:K("path",{d:"M18.9 2H22l-7.3 8.3L23.3 22h-6.8l-5.3-6.9L5.1 22H2l7.8-8.9L1 2h6.9l4.8 6.4L18.9 2Zm-1.2 18h1.9L7.2 4H5.2l12.5 16Z"})})}function Oy(){return K("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:K("path",{d:"M6.9 6.5c0-.2-.1-.5-.3-.6L4.6 3.6V3.3h6.3l4.9 10.7 4.3-10.7H26v.3l-1.8 1.7c-.2.1-.2.3-.2.5v12.4c0 .2 0 .4.2.5l1.7 1.7v.3h-8.7v-.3l1.8-1.7c.2-.2.2-.2.2-.5V8.1l-5 12.6h-.7L7.9 8.1v8.5c0 .3.1.6.3.8l2.3 2.8v.3H4v-.3l2.3-2.8c.2-.2.3-.5.3-.8V6.5Z",transform:"scale(0.85)"})})}function jf({env:e,isMobile:t,token:r,walletAddress:n,stat:o,tokenInfo:i,showBalance:a=!0,onBack:s,onClose:l,onSend:d,onOutlink:c}){let b=r.quantity.decimals,[f,m]=nr.useState(!1),{buildTxUrl:y,chainInfo:g}=Mc(e,r.chainId,!0),{visibility:u}=Pf(e),{data:p,isLoading:w,isError:h,fetchNextPage:x,hasNextPage:k,isFetchingNextPage:R,refetch:I}=Df(e,r.chainId,r.address,n,!0),C=nr.useMemo(()=>p?.pages?p.pages.flat():[],[p]),S=nr.useRef(null);nr.useEffect(()=>{if(!t)return;let O=S.current;if(!O||!k)return;let Z=new IntersectionObserver(_=>{_[0]?.isIntersecting&&!R&&x()},{rootMargin:"120px"});return Z.observe(O),()=>Z.disconnect()},[t,k,R,x]);let E=nr.useCallback(()=>{navigator?.clipboard&&navigator.clipboard.writeText(r.address).then(()=>{m(!0),setTimeout(()=>m(!1),1500)}).catch(()=>{})},[r.address]),M=zf(Ff(r.quantity.numeric,b)),B=o?.price?fa(r.quantity.numeric,b,o.price):null,L=a?M:"\u2022\u2022\u2022\u2022",{containerRef:z,textRef:A,fontSize:U}=Ay(L,30,14),Y=ni(r.chainId,e).name??g?.name??`Chain ${r.chainId}`,G=g?.explorer_url,H=i?.deployed??!0,ie=nr.useMemo(()=>{let O=[];return i?.info_url&&O.push({key:"web",label:"Website",url:i.info_url,icon:K(Ly,{})}),i?.telegram_url&&O.push({key:"tg",label:"Telegram",url:i.telegram_url,icon:K(Dy,{})}),i?.x_url&&O.push({key:"x",label:"X",url:i.x_url,icon:K(Py,{})}),i?.medium_url&&O.push({key:"medium",label:"Medium",url:i.medium_url,icon:K(Oy,{})}),O},[i]),te=(O,Z,_,ce)=>{Ot(O,Z,{category:"token-detail",origin:_,payload:{address:r.address,txHash:ce}},c)};return lt(Uf,{children:[lt("div",{className:"wi-sticky-header",children:[lt("div",{className:"wi-header wi-header--receive",children:[K("button",{type:"button",className:"wi-header-back",onClick:s,"aria-label":"Back",children:K($r,{size:24})}),lt("span",{className:"wi-td-header-title",children:[K("img",{src:r.icon_url,alt:"","aria-hidden":!0,className:"wi-td-header-icon",width:24,height:24,draggable:!1,onError:O=>{O.currentTarget.src=Ny}}),K("span",{className:"wi-td-header-name",children:r.symbol})]}),K("button",{type:"button",className:"wi-header-action",onClick:l,"aria-label":"Close",children:K(Nr,{size:24})})]}),K("hr",{className:"wi-divider"})]}),lt("div",{className:"wi-td-scroll",children:[u.chart&&K(Bf,{env:e,chainId:r.chainId,tokenAddress:r.address}),u.balance&&lt("section",{className:"wi-td-balance-card",children:[lt("div",{className:"wi-td-balance-left",ref:z,children:[K("span",{className:"wi-td-balance-label",children:"My Balance"}),K("span",{className:"wi-td-balance-amount",ref:A,style:{fontSize:U},children:L}),a&&B&&K("span",{className:"wi-td-balance-fiat",children:B})]}),K("button",{type:"button",className:"wi-td-send-btn",onClick:()=>d(r),"aria-label":`Send ${r.symbol}`,"data-track":"token_detail_send","data-track-id":r.symbol,children:K("span",{children:"Send"})})]}),u.overview&&lt("section",{className:"wi-td-section",children:[K("h3",{className:"wi-td-section-title",children:"Crypto Overview"}),lt("div",{className:"wi-td-rows",children:[lt("div",{className:"wi-td-row",children:[K("span",{className:"wi-td-row-label",children:"Network"}),G?lt("a",{className:"wi-td-row-value wi-td-row-link",href:G,target:"_blank",rel:"noopener noreferrer",onClick:O=>te(O,G,"token-network"),children:[K("span",{children:Y}),K(By,{})]}):K("span",{className:"wi-td-row-value",children:Y})]}),lt("div",{className:"wi-td-row",children:[K("span",{className:"wi-td-row-label",children:"Contract Address"}),lt("button",{type:"button",className:"wi-td-row-value wi-td-row-copy",onClick:E,"aria-label":"Copy contract address",children:[K("span",{children:tr(r.address)}),f?K(vn,{size:14}):K(so,{size:14})]})]}),lt("div",{className:"wi-td-row",children:[K("span",{className:"wi-td-row-label",children:"Decimals"}),K("span",{className:"wi-td-row-value",children:b})]}),lt("div",{className:"wi-td-row",children:[K("span",{className:"wi-td-row-label",children:"Total Supply"}),K("span",{className:"wi-td-row-value",children:My(o?.circulating_supply)})]})]})]}),u.social&&ie.length>0&&lt("section",{className:"wi-td-section",children:[K("h3",{className:"wi-td-section-title",children:"Social Media"}),K("div",{className:"wi-td-social-row",children:ie.map(O=>K("a",{className:"wi-td-social-btn",href:O.url,target:"_blank",rel:"noopener noreferrer","aria-label":O.label,onClick:Z=>te(Z,O.url,"token-social"),children:O.icon},O.key))})]}),u.history&&lt("section",{className:"wi-td-section",children:[K("h3",{className:"wi-td-section-title",children:"Token History"}),w&&K("div",{className:"wi-td-history-list",children:Array.from({length:3},(O,Z)=>lt("div",{className:"wi-td-history-skeleton",children:[K("div",{className:"wi-skeleton-block",style:{width:90,height:14}}),K("div",{className:"wi-skeleton-block",style:{width:60,height:14}})]},`td-sk-${Z}`))}),!w&&h&&lt("div",{className:"wi-td-history-empty",children:[K("span",{children:"Failed to load history."}),K("button",{type:"button",className:"wi-td-retry-btn",onClick:()=>I(),children:"Retry"})]}),!w&&!h&&C.length===0&&K("div",{className:"wi-td-history-empty",children:K("span",{children:"No transactions found."})}),!w&&!h&&C.length>0&&lt("div",{className:"wi-td-history-list",children:[C.map((O,Z)=>{let _=O.to_alias?.toLowerCase().includes("bridge")??!1,ce=O.from_alias?.toLowerCase().includes("bridge")??!1,xe=_?"bridge-out":ce?"bridge-in":O.to?.toLowerCase()===n.toLowerCase()?"receive":"send",he=xe==="receive"||xe==="bridge-in",fe=he?O.from:O.to,ge=zf(Ff(O.amount,b)),we=y(O.tx),Ye=Ey(O.timestamp),be=lt(Uf,{children:[lt("div",{className:"wi-td-history-top",children:[K("span",{className:"wi-td-history-type","data-direction":xe,children:Ty[xe]}),K("span",{className:"wi-td-history-counter",children:tr(fe??"")})]}),lt("div",{className:"wi-td-history-bottom",children:[lt("span",{className:"wi-td-history-meta",children:[K("span",{className:"wi-td-history-status","data-status":O.status,children:O.status==="success"?"Success":"Failed"}),Ye&&K("span",{className:"wi-td-history-time",children:Ye})]}),lt("span",{className:"wi-td-history-amount","data-size":Iy(`${he?"+":"-"}${ge} ${r.symbol}`),children:[he?"+":"-",ge," ",r.symbol]})]})]}),Te=`${O.tx}-${O.log_index}-${Z}`;return we?K("a",{className:"wi-td-history-item wi-td-history-item--link",href:we,target:"_blank",rel:"noopener noreferrer",onClick:it=>te(it,we,"token-tx",O.tx),children:be},Te):K("div",{className:"wi-td-history-item",children:be},Te)}),k&&(t?K("div",{ref:S,className:"wi-td-history-sentinel",children:R&&K("span",{className:"wi-td-history-loading",children:"Loading\u2026"})}):K("button",{type:"button",className:"wi-td-loadmore-btn",onClick:()=>x(),disabled:R,children:R?"Loading\u2026":"Load more"}))]})]})]})]})}function By(){return K("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:Re("wi-td-external-icon"),"aria-hidden":!0,children:K("path",{d:"M14 4h6v6M20 4l-9 9M18 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}import*as on from"react";var Wf={dev:"https://dev.onechain.nexus/pop",stage:"https://stg.onechain.nexus/pop",production:"https://onechain.nexus/pop"};function Hf(e,t){let r=Wf[e]??Wf.production;return t==="send"?r:`${r}/${t}`}var Gf={dev:"https://stg.onechain.nexus/gametoken/bridge",stage:"https://stg.onechain.nexus/gametoken/bridge",production:"https://www.onechain.nexus/gametoken/bridge"};function _f(e){return Gf[e]??Gf.production}import{jsx as ne,jsxs as mr}from"react/jsx-runtime";function Kl({size:e=20,className:t}){return mr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("path",{d:"M1.66675 7.91662C1.66677 6.98929 1.94808 6.08377 2.47353 5.31967C2.99898 4.55557 3.74385 3.96883 4.60976 3.63695C5.47567 3.30507 6.42188 3.24366 7.32343 3.46082C8.22497 3.67799 9.03944 4.16352 9.65925 4.85329C9.7029 4.89996 9.75568 4.93718 9.81431 4.96262C9.87294 4.98806 9.93617 5.00119 10.0001 5.00119C10.064 5.00119 10.1272 4.98806 10.1859 4.96262C10.2445 4.93718 10.2973 4.89996 10.3409 4.85329C10.9588 4.15904 11.7734 3.66943 12.6764 3.44962C13.5795 3.22982 14.528 3.29024 15.3958 3.62286C16.2636 3.95547 17.0096 4.5445 17.5343 5.31154C18.0591 6.07858 18.3378 6.98725 18.3334 7.91662C18.3334 9.82495 17.0834 11.25 15.8334 12.5L11.2567 16.9275C11.1015 17.1058 10.91 17.249 10.6951 17.3477C10.4802 17.4464 10.2468 17.4982 10.0103 17.4997C9.77386 17.5012 9.53979 17.4523 9.32365 17.3564C9.10752 17.2605 8.91427 17.1196 8.75675 16.9433L4.16675 12.5C2.91675 11.25 1.66675 9.83329 1.66675 7.91662Z",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),ne("path",{d:"M8.84839 8.28833H10V13.4938",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Qf({size:e=24,className:t}){return mr("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"}),ne("path",{d:"m21.854 2.147-10.94 10.939",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Vf({size:e=24,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mr("g",{stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",children:[ne("path",{d:"M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17"}),ne("path",{d:"m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9"}),ne("path",{d:"m2 16 6 6"}),ne("circle",{cx:"16",cy:"9",r:"2.9"}),ne("circle",{cx:"6",cy:"5",r:"3"})]})})}function qf({size:e=24,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mr("g",{stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",children:[ne("path",{d:"M15 12h-5M15 8h-5"}),ne("path",{d:"M19 17V5a2 2 0 0 0-2-2H4"}),ne("path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3"})]})})}function Ri({size:e=12,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("path",{d:"m9 18 6-6-6-6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Yf({size:e=20,className:t}){return mr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("rect",{width:"20",height:"20",rx:"4.8",fill:"currentColor"}),ne("path",{d:"M11.53 9.05 15.7 4.4h-.99l-3.62 4.04L8.2 4.4H4.86l4.37 6.1-4.37 4.87h.99l3.82-4.26 3.05 4.26h3.34zm-1.35 1.51-.44-.61-3.52-4.9h1.52l2.84 3.96.44.61 3.7 5.14h-1.52z",fill:"var(--wi-op-x-glyph, #ffffff)"})]})}function Kf({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mr("g",{stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[ne("circle",{cx:"9",cy:"7",r:"3.4"}),ne("path",{d:"M2.6 20.4a6.4 6.4 0 0 1 10.2-5.15"}),ne("circle",{cx:"17.5",cy:"17.5",r:"2.1"}),ne("path",{d:"M19.6 17.5v1.05a1.55 1.55 0 0 0 3.1 0v-1.05a5.2 5.2 0 1 0-2.05 4.14"})]})})}function Zf({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mr("g",{stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[ne("path",{d:"M12.5 3 5 13.5h5.5L10 21l7.5-10.5H12z"}),ne("path",{d:"M20 4.5 21.5 3M20.5 8h2M17 2.5V1"})]})})}function Xf({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mr("g",{stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[ne("rect",{x:"2.5",y:"5.5",width:"19",height:"13",rx:"2.5"}),ne("path",{d:"M12 9v6"}),ne("path",{d:"m9.5 12.5 2.5 2.5 2.5-2.5"})]})})}function Jf({className:e}){return mr("svg",{width:"116",height:"24",viewBox:"0 0 116 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"ONEpop",className:e,children:[ne("path",{d:"M38.1949 4.06787C33.7184 4.06787 30.085 7.69479 30.085 12.1647C30.085 16.6346 33.7184 20.2616 38.1949 20.2616C42.6713 20.2616 46.3048 16.6346 46.3048 12.1647C46.3048 7.69479 42.6713 4.06787 38.1949 4.06787ZM38.1949 16.6216C35.7312 16.6216 33.7315 14.6284 33.7315 12.1647C33.7315 9.70103 35.7312 7.70786 38.1949 7.70786C40.6586 7.70786 42.6583 9.70103 42.6583 12.1647C42.6583 14.6284 40.6586 16.6216 38.1949 16.6216Z",fill:"currentColor"}),ne("path",{d:"M52.0033 4.81283C51.6438 4.40113 51.1537 4.11359 50.5721 4.11359C49.5657 4.11359 48.7554 4.93046 48.7554 5.93031V18.4513C48.7554 19.4577 49.5722 20.2681 50.5721 20.2681C51.5719 20.2681 52.3888 19.4512 52.3888 18.4513V10.7727L60.5837 19.5492C60.9431 19.9609 61.4332 20.2485 62.0148 20.2485C63.0212 20.2485 63.8316 19.4316 63.8316 18.4317C63.8316 17.9351 63.6094 17.5038 63.3153 17.1639L51.9967 4.81936L52.0033 4.81283Z",fill:"currentColor"}),ne("path",{d:"M61.8643 12.3934C62.9034 12.3934 63.7398 11.5504 63.7398 10.5179V5.96953C63.7398 4.93047 62.8968 4.09399 61.8643 4.09399C60.8318 4.09399 59.9888 4.93701 59.9888 5.96953V10.5179C59.9888 11.5569 60.8318 12.3934 61.8643 12.3934Z",fill:"currentColor"}),ne("path",{d:"M76.9017 7.74704C77.9081 7.74704 78.7249 6.93016 78.7249 5.93031C78.7249 4.93046 77.9081 4.11359 76.9017 4.11359H68.5108C67.5044 4.11359 66.6875 4.93046 66.6875 5.93031V18.4513C66.6875 19.4577 67.5044 20.2681 68.5108 20.2681H76.9017C77.9081 20.2681 78.7249 19.4512 78.7249 18.4513C78.7249 17.4515 77.9081 16.6346 76.9017 16.6346H70.3275V14.0075H76.2286C77.235 14.0075 78.0518 13.1907 78.0518 12.1908C78.0518 11.191 77.235 10.3741 76.2286 10.3741H70.3275V7.74704H76.9017Z",fill:"currentColor"}),ne("path",{d:"M84.5951 23.1908C84.3206 23.1908 84.105 23.1124 83.9481 22.9555C83.7913 22.7987 83.7129 22.5765 83.7129 22.2889V10.7416C83.7129 10.441 83.7913 10.2188 83.9481 10.0751C84.105 9.91823 84.3206 9.83981 84.5951 9.83981C84.8827 9.83981 85.0983 9.91823 85.2421 10.0751C85.3989 10.2188 85.4773 10.441 85.4773 10.7416V12.5257L85.2617 12.1728C85.4708 11.4539 85.8825 10.8789 86.4968 10.4476C87.1111 10.0163 87.8495 9.8006 88.7122 9.8006C89.5617 9.8006 90.3002 10.0032 90.9275 10.4084C91.5549 10.8004 92.045 11.369 92.3979 12.114C92.7508 12.8459 92.9272 13.7216 92.9272 14.741C92.9272 15.7474 92.7508 16.6297 92.3979 17.3877C92.0581 18.1327 91.5679 18.7078 90.9275 19.1129C90.3002 19.505 89.5617 19.7011 88.7122 19.7011C87.8626 19.7011 87.1307 19.4854 86.5164 19.0541C85.9021 18.6228 85.4904 18.0543 85.2813 17.3485H85.4969V22.2889C85.4969 22.5765 85.4185 22.7987 85.2617 22.9555C85.1048 23.1124 84.8827 23.1908 84.5951 23.1908ZM88.3004 18.2895C88.8625 18.2895 89.3526 18.1523 89.7708 17.8778C90.2021 17.6034 90.5354 17.2047 90.7707 16.6819C91.0059 16.1591 91.1236 15.5122 91.1236 14.741C91.1236 13.5909 90.8687 12.7152 90.359 12.114C89.8492 11.5128 89.1631 11.2122 88.3004 11.2122C87.7254 11.2122 87.2222 11.3494 86.7909 11.6239C86.3726 11.8853 86.0459 12.2774 85.8106 12.8002C85.5884 13.323 85.4773 13.9699 85.4773 14.741C85.4773 15.8912 85.7322 16.7734 86.2419 17.3877C86.7517 17.9889 87.4378 18.2895 88.3004 18.2895Z",fill:"currentColor"}),ne("path",{d:"M99.2775 19.7011C98.3365 19.7011 97.5196 19.4985 96.8269 19.0933C96.1342 18.6882 95.5983 18.1131 95.2193 17.3681C94.8403 16.6231 94.6508 15.7474 94.6508 14.741C94.6508 13.983 94.7553 13.3033 94.9644 12.7021C95.1866 12.0878 95.5003 11.565 95.9055 11.1337C96.3106 10.7024 96.7942 10.3757 97.3562 10.1535C97.9313 9.91823 98.5718 9.8006 99.2775 9.8006C100.219 9.8006 101.035 10.0032 101.728 10.4084C102.421 10.8135 102.957 11.3886 103.336 12.1336C103.715 12.8655 103.904 13.7347 103.904 14.741C103.904 15.4991 103.793 16.1853 103.571 16.7996C103.362 17.4139 103.055 17.9366 102.65 18.368C102.244 18.7993 101.754 19.1326 101.179 19.3678C100.617 19.59 99.9833 19.7011 99.2775 19.7011ZM99.2775 18.2895C99.8526 18.2895 100.349 18.1523 100.768 17.8778C101.199 17.6034 101.526 17.2047 101.748 16.6819C101.983 16.1591 102.101 15.5122 102.101 14.741C102.101 13.5909 101.846 12.7152 101.336 12.114C100.826 11.5128 100.14 11.2122 99.2775 11.2122C98.7155 11.2122 98.2189 11.3494 97.7876 11.6239C97.3693 11.8853 97.0426 12.2774 96.8073 12.8002C96.572 13.323 96.4544 13.9699 96.4544 14.741C96.4544 15.8912 96.7093 16.7734 97.219 17.3877C97.7418 17.9889 98.428 18.2895 99.2775 18.2895Z",fill:"currentColor"}),ne("path",{d:"M107.072 23.1908C106.797 23.1908 106.582 23.1124 106.425 22.9555C106.268 22.7987 106.19 22.5765 106.19 22.2889V10.7416C106.19 10.441 106.268 10.2188 106.425 10.0751C106.582 9.91823 106.797 9.83981 107.072 9.83981C107.359 9.83981 107.575 9.91823 107.719 10.0751C107.876 10.2188 107.954 10.441 107.954 10.7416V12.5257L107.738 12.1728C107.948 11.4539 108.359 10.8789 108.974 10.4476C109.588 10.0163 110.326 9.8006 111.189 9.8006C112.038 9.8006 112.777 10.0032 113.404 10.4084C114.032 10.8004 114.522 11.369 114.875 12.114C115.228 12.8459 115.404 13.7216 115.404 14.741C115.404 15.7474 115.228 16.6297 114.875 17.3877C114.535 18.1327 114.045 18.7078 113.404 19.1129C112.777 19.505 112.038 19.7011 111.189 19.7011C110.339 19.7011 109.607 19.4854 108.993 19.0541C108.379 18.6228 107.967 18.0543 107.758 17.3485H107.974V22.2889C107.974 22.5765 107.895 22.7987 107.738 22.9555C107.582 23.1124 107.359 23.1908 107.072 23.1908ZM110.777 18.2895C111.339 18.2895 111.829 18.1523 112.248 17.8778C112.679 17.6034 113.012 17.2047 113.247 16.6819C113.483 16.1591 113.6 15.5122 113.6 14.741C113.6 13.5909 113.345 12.7152 112.836 12.114C112.326 11.5128 111.64 11.2122 110.777 11.2122C110.202 11.2122 109.699 11.3494 109.268 11.6239C108.849 11.8853 108.523 12.2774 108.287 12.8002C108.065 13.323 107.954 13.9699 107.954 14.741C107.954 15.8912 108.209 16.7734 108.719 17.3877C109.228 17.9889 109.915 18.2895 110.777 18.2895Z",fill:"currentColor"}),ne("path",{d:"M14.7326 0.727918C12.9726 1.59329 11.6096 4.00482 11.0833 5.59357C9.88384 4.95085 7.89924 3.76837 5.7791 4.00482C3.25593 4.28622 1.16093 5.72223 0.333058 8.59505C-0.616745 11.891 0.425001 15.7904 3.97287 17.5788C7.25977 19.2357 10.3262 21.1047 11.8468 22.2197C13.3673 23.3348 14.6332 24.4164 15.5435 23.8398C17.1655 23.054 20.2401 19.6295 22.4534 16.1013C24.3507 13.0769 25.9439 7.65453 23.3488 3.26211C21.2608 -0.0620856 17.6891 -0.725834 14.7326 0.727918Z",fill:"url(#wi-op-logo-heart)"}),ne("mask",{id:"wi-op-logo-mask",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"25",height:"24",children:ne("path",{d:"M14.7326 0.727918C12.9726 1.59329 11.6096 4.00482 11.0833 5.59357C9.88384 4.95085 7.89924 3.76837 5.7791 4.00482C3.25593 4.28622 1.16093 5.72223 0.333058 8.59505C-0.616745 11.891 0.425001 15.7904 3.97287 17.5788C7.25977 19.2357 10.3262 21.1047 11.8468 22.2197C13.3673 23.3348 14.6332 24.4164 15.5435 23.8398C17.1655 23.054 20.2401 19.6295 22.4534 16.1013C24.3507 13.0769 25.9439 7.65453 23.3488 3.26211C21.2608 -0.0620856 17.6891 -0.725834 14.7326 0.727918Z",fill:"white"})}),mr("g",{mask:"url(#wi-op-logo-mask)",children:[ne("path",{d:"M29.5305 -3.85553H-1.43018V24.7597H29.5305V-3.85553Z",fill:"url(#wi-op-logo-base)"}),ne("path",{d:"M12.7993 24.7597H29.5372V1.58752L12.7993 13.5165V24.7597Z",fill:"url(#wi-op-logo-shine-r)"}),ne("path",{d:"M12.8037 24.7598H-1.63916V2.94476L12.8037 13.5166V24.7598Z",fill:"url(#wi-op-logo-shine-l)"})]}),ne("path",{d:"M13.4339 7.58409L9.79429 9.73601C9.1523 10.1136 8.92988 10.962 9.2989 11.6189C9.66791 12.2759 10.4969 12.5035 11.1389 12.1259L14.2174 10.305L12.7515 11.9138V18.2247C12.7515 18.9852 13.3581 19.6059 14.1012 19.6059C14.8442 19.6059 15.4508 18.9852 15.4508 18.2247V8.77903C15.4508 8.51521 15.37 8.25656 15.2689 8.08586C14.8897 7.43407 14.0708 7.20129 13.4288 7.57891L13.4339 7.58409Z",fill:"white"}),mr("defs",{children:[mr("linearGradient",{id:"wi-op-logo-heart",x1:"12.3679",y1:"-0.18782",x2:"12.3679",y2:"23.9797",gradientUnits:"userSpaceOnUse",children:[ne("stop",{stopColor:"#F1603C"}),ne("stop",{offset:"1",stopColor:"#EE2566"})]}),mr("linearGradient",{id:"wi-op-logo-base",x1:"-5.01624",y1:"-7.30565",x2:"28.6827",y2:"29.4172",gradientUnits:"userSpaceOnUse",children:[ne("stop",{stopColor:"#F3752D"}),ne("stop",{offset:"1",stopColor:"#EC1272"})]}),mr("linearGradient",{id:"wi-op-logo-shine-r",x1:"10.2312",y1:"2.71613",x2:"23.8708",y2:"13.2539",gradientUnits:"userSpaceOnUse",children:[ne("stop",{stopColor:"white",stopOpacity:"0.5"}),ne("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),mr("linearGradient",{id:"wi-op-logo-shine-l",x1:"24.1414",y1:"-2.87687",x2:"12.838",y2:"18.379",gradientUnits:"userSpaceOnUse",children:[ne("stop",{stopColor:"white",stopOpacity:"0.5"}),ne("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})}var zy="data:image/webp;base64,UklGRiIfAABXRUJQVlA4WAoAAAAQAAAA9QAA1wAAQUxQSDQJAAABsMf/nzG31uyzu9lNurFtp7Zt27btHtuu3YPatnWM1A2q08bJJmmyu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9e/NWTH1sKcn3/QEaD/ui0vu7Yy6OJ9w90FYYzx0eJPrca0nH0k8XQHcTM9/RHvOlFQF9qnKW5DHLg366FhoEDkxnm1GZafbv+YtFQtJeEZzwIKkKr5uREGvR+kqr0rqvMONg8RdMGe7bfLiEh3DXisaaLWnPVFuGsufuKXDYcaT7KUY2QRrG0w/YBfJ3dL0Iwq+Ts1rVwPw6EW/mf2vvBQN9xEWoQ7eiQkd2E0IL7n3nBdqi3ZPGsI5a6KQiGzXc61A4P9EGBs88qTmQhAkR4mb+ylXAVZh/krFLuC7Ut7uDHtGuiDisDTlO+3/bQP0eH3DWK9n5/JZlbBt9YhJZd1r2yYqNlB/tZVI4EKQkr7qOlC60xl+gRhiolHBYUydO9a4i5+oeMpnPLGwTsCDx/HAmkYUs9yyTzdY4LQ9HBwJDDvPJ67WT/8o69iNhN5r6Pm/nz/XL6FN3HdgPOtkquE0weDfwxCeL1qJz+UNs953SM4sAVvJXTJgJtaDdn5jk26W6qWEeffbz7eFhHZSQT/5CcUc6kLTepaSfDjMMO13nc83Bp1gf9kmweID6+5MqNSxgHbv+z//3BrktV/Rl7DfiqPdxlkFinc/i09y+qlDycF6SDyMXIsRWi1IIvY4rojOw7PdSyYIzuQi1ul2IviqZrwjvgitwN/22Ogzpt6VUaERFfLjCSmwNIwt2hcaH3+ZB4sj7qP784wlWjexf/5iN8j6tHK6zzw4Q+QLcMcNksKjPFBaupKpIcBCUxs8o7wxVHzyRhdr/7JP7qiXejoFAtYPP/bcBCgAAAAAAAAAAA==";function $f({className:e}){return ne("svg",{width:"82",height:"72",viewBox:"0 0 82 72",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:e,children:ne("image",{href:zy,width:"82",height:"72",preserveAspectRatio:"xMidYMid meet"})})}de(`.wi-op-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;display:flex;flex-direction:column;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .wi-op-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-op-scroll::-webkit-scrollbar{width:4px}.wi-op-scroll::-webkit-scrollbar-track{background:transparent}.wi-op-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}[data-theme=light] .wi-op-scroll::-webkit-scrollbar-thumb{background:#0000001f}.wi-op-header-title{position:absolute;left:50%;transform:translate(-50%);display:inline-flex;align-items:center;pointer-events:none}.wi-op-logo{display:block;flex-shrink:0;color:var(--ds-content-highest, #000000)}.wi-op-logo-img{height:24px;width:auto;object-fit:contain}.wi-op-hero{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:24px;flex-shrink:0}.wi-op-hero-copy{display:flex;flex-direction:column;gap:6px;min-width:0}.wi-op-hero-title{display:flex;flex-direction:column;margin:0;font-family:inherit;font-size:18px;font-weight:600;line-height:1.25;color:var(--ds-content-highest, #000000)}.wi-op-hero-title-row{display:inline-flex;align-items:center;gap:4px;flex-wrap:wrap}.wi-op-x-badge{flex-shrink:0;color:var(--ds-content-highest, #000000)}[data-theme=light] .wi-op-x-badge{--wi-op-x-glyph: #ffffff}[data-theme=dark] .wi-op-x-badge{--wi-op-x-glyph: #1e232e}.wi-op-hero-sub{margin:0;font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-op-hero-art{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:120px;height:72px}.wi-op-hero-img{max-width:100%;max-height:72px;object-fit:contain}.wi-op-panel{display:flex;flex-direction:column;gap:8px;padding:0 24px;flex-shrink:0}.wi-op-balance-card{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa)}.wi-op-balance-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.wi-op-balance-label{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.wi-op-balance-body{display:flex;align-items:center;gap:4px;min-width:0}.wi-op-balance-icon{width:24px;height:24px;border-radius:50%;object-fit:cover;flex-shrink:0}.wi-op-balance-value{font-family:inherit;font-size:28px;font-weight:600;line-height:1.25;color:var(--ds-content-highest, #000000);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wi-op-link-btn{appearance:none;display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;flex-shrink:0;transition:color .15s ease}.wi-op-link-btn:hover:not(:disabled){color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-op-link-btn:disabled{cursor:default;opacity:.5}.wi-op-balance-head>[data-gou-mode=button]{display:contents}.wi-op-action-row{display:flex;align-items:stretch;gap:8px}.wi-op-action-card{appearance:none;display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 8px;border:none;border-radius:10px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-align:center;cursor:pointer;transition:background-color .15s ease,transform .1s ease}.wi-op-action-card>svg{flex-shrink:0}.wi-op-action-card:hover:not(:disabled){background:#2e3544}[data-theme=light] .wi-op-action-card:hover:not(:disabled){background:#e4e8ef}.wi-op-action-card:active:not(:disabled){transform:scale(.95)}.wi-op-action-card:disabled{cursor:default;opacity:.45}.wi-op-cta-row{display:flex;flex-direction:column;gap:10px;padding:24px;flex-shrink:0}.wi-op-cta-skeleton{border-radius:10px}.wi-op-cta{appearance:none;display:flex;align-items:center;justify-content:center;width:100%;padding:12px 16px;border:none;border-radius:10px;font-family:inherit;font-size:16px;font-weight:600;line-height:1;cursor:pointer;transition:filter .15s ease,transform .1s ease,background-color .15s ease}.wi-op-cta:active:not(:disabled){transform:scale(.985)}.wi-op-cta:disabled{cursor:default;opacity:.5}.wi-op-cta--gradient{background:linear-gradient(193.7deg,#f62e61 16.1%,#f7564a 83.9%);color:#fff}.wi-op-cta--gradient:hover:not(:disabled){filter:brightness(1.05)}.wi-op-cta--purple{background:var(--ds-system-purple-high, #7346f3);color:var(--ds-system-purple-on, #ffffff)}.wi-op-cta--purple:hover:not(:disabled){filter:brightness(1.08)}.wi-op-cta--outline{background:transparent;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-op-cta--outline:hover:not(:disabled){background:var(--ds-surface-medium, #f5f7fa)}.wi-op-features{display:flex;flex-direction:column;padding:0 24px 8px;flex-shrink:0}.wi-op-feature{display:flex;align-items:center;gap:6px;padding:12px 0}.wi-op-feature+.wi-op-feature{border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-op-feature-icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;flex-shrink:0;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-accent-primary-high, #f0640d)}.wi-op-feature-copy{display:flex;flex-direction:column;min-width:0}.wi-op-feature-title{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))}.wi-op-feature-desc{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-op-activity{display:flex;flex-direction:column;gap:8px;padding:0 24px 8px;flex-shrink:0}.wi-op-activity-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.wi-op-activity-heading{display:flex;flex-direction:column;min-width:0}.wi-op-activity-title{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))}.wi-op-activity-currency{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-op-activity-list{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}.wi-op-activity-item{display:flex;align-items:flex-start;gap:6px;padding:12px 0}.wi-op-activity-item+.wi-op-activity-item{border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-op-activity-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;overflow:hidden;flex-shrink:0;background:var(--ds-surface-medium, #f5f7fa)}.wi-op-activity-avatar img{width:100%;height:100%;object-fit:cover}.wi-op-activity-initial{font-family:inherit;font-size:13px;font-weight:600;line-height:1;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.wi-op-activity-copy{display:flex;flex-direction:column;flex:1 1 0;min-width:0}.wi-op-activity-meta{display:flex;align-items:center;gap:6px;min-width:0}.wi-op-activity-peer{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wi-op-activity-sep{width:1px;height:14px;flex-shrink:0;background:var(--ds-border-medium, rgba(0, 0, 0, .18))}.wi-op-activity-time{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap;flex-shrink:0}.wi-op-activity-amount{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));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wi-op-badge{display:inline-flex;align-items:center;justify-content:center;padding:3px 6px;border-radius:4px;flex-shrink:0;font-family:inherit;font-size:12px;font-weight:500;line-height:1}.wi-op-badge--claimed{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.wi-op-badge--waiting{background:var(--ds-accent-primary-low, #fff5ee);color:var(--ds-accent-primary-high, #f0640d)}.wi-op-badge--refunded{background:var(--ds-system-red-low, #ffeeee);color:var(--ds-system-red-high, #d20609)}.wi-op-badge--ready{background:var(--ds-system-blue-low, #ecf8fc);color:var(--ds-system-blue-high, #008dca)}.wi-op-footer{display:flex;align-items:center;justify-content:center;padding:16px 24px;flex-shrink:0;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));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))}.wi-drawer-content .wi-op-hero,.wi-drawer-content .wi-op-cta-row,.wi-drawer-content .wi-op-panel,.wi-drawer-content .wi-op-features,.wi-drawer-content .wi-op-activity,.wi-drawer-content .wi-op-footer{padding-left:16px;padding-right:16px}
12
- `);import{Fragment as Xl,jsx as J,jsxs as tt}from"react/jsx-runtime";var Fy=6,Uy={claimed:"Claimed",waiting:"Waiting",refunded:"Refunded",ready:"Ready"};function em(e,t){let r;try{r=BigInt(e||"0")}catch{return"0.00"}let n=r<0n;n&&(r=-r);let o,i;if(t<=2){let a=10n**BigInt(t);o=r/a,i=r%a*10n**BigInt(2-t)}else{let a=r/10n**BigInt(t-2);o=a/100n,i=a%100n}return`${n?"-":""}${jy(o.toString())}.${i.toString().padStart(2,"0")}`}function jy(e){let t="";for(let r=0;r<e.length;r++){let n=e.length-r;r>0&&n%3===0&&(t+=","),t+=e[r]}return t}function Wy(e){if(!e)return"";let t=e<1e12?e*1e3:e,r=Math.max(0,Math.floor((Date.now()-t)/1e3));if(r<60)return"just now";let n=Math.floor(r/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);if(o<24)return`${o}h ago`;let i=Math.floor(o/24);if(i<30)return`${i}d ago`;let a=Math.floor(i/30);return a<12?`${a}mo ago`:`${Math.floor(a/12)}y ago`}function Gy(e){let t=e.trim();return t?t.startsWith("@")?t:`@${t}`:""}function ls({env:e="production",balanceDisplay:t,balanceIconUrl:r,isBalanceLoading:n,summary:o,logoSrc:i,heroSrc:a,onBack:s,onClose:l,onSend:d,onClaim:c,onActivity:b,onRepliesSeen:f,onBoard:m,onGetToken:y,getTokenSlot:g}){let u=o?.activity??[],p=u.length>0,w=o?.claimableCount??0,h=o?.repliesWaitingCount??0,x=o?.isLoading??!1,k=o?.xConnected??!1,R=on.useCallback(A=>{window.open(Hf(e,A),"_blank","noopener,noreferrer")},[e]),I=on.useCallback(()=>d?d():R("send"),[d,R]),C=on.useCallback(()=>c?c():R("claim"),[c,R]),S=on.useCallback(()=>{if(f?.(),b)return b();R("activity")},[b,f,R]),E=on.useCallback(()=>m?m():R("board"),[m,R]),M=on.useCallback(()=>{if(y)return y();window.open(_f(e),"_blank","noopener,noreferrer")},[y,e]),B=on.useMemo(()=>!o||w<=0?null:em(o.claimableTotalRaw,o.claimableDecimals??18),[o,w]),L=on.useMemo(()=>u.slice(0,Fy),[u]),z=on.useCallback(A=>{A.currentTarget.style.display="none"},[]);return tt(Xl,{children:[tt("div",{className:"wi-sticky-header",children:[tt("div",{className:"wi-header wi-header--receive",children:[J("button",{type:"button",className:"wi-header-back",onClick:s,"aria-label":"Back",children:J($r,{size:24})}),J("span",{className:"wi-op-header-title",children:i?J("img",{src:i,alt:"ONEpop",className:"wi-op-logo-img",height:24,draggable:!1,onError:z}):J(Jf,{className:"wi-op-logo"})}),J("button",{type:"button",className:"wi-header-action",onClick:l,"aria-label":"Close",children:J(Nr,{size:24})})]}),J("hr",{className:"wi-divider"})]}),tt("div",{className:"wi-op-scroll","data-vaul-no-drag":!0,children:[tt("section",{className:"wi-op-hero",children:[tt("div",{className:"wi-op-hero-copy",children:[tt("h2",{className:"wi-op-hero-title",children:[J("span",{children:"Send money with"}),tt("span",{className:"wi-op-hero-title-row",children:["just an",J(Yf,{size:20,className:"wi-op-x-badge"}),"@handle."]})]}),J("p",{className:"wi-op-hero-sub",children:"They don't even need a wallet yet."})]}),J("div",{className:"wi-op-hero-art","aria-hidden":!0,children:a?J("img",{src:a,alt:"",className:"wi-op-hero-img",draggable:!1,onError:z}):J($f,{})})]}),tt("section",{className:"wi-op-panel",children:[tt("div",{className:"wi-op-balance-card",children:[tt("div",{className:"wi-op-balance-head",children:[J("span",{className:"wi-op-balance-label",children:"Available"}),g??tt("button",{type:"button",className:"wi-op-link-btn",onClick:M,"data-track":"onepop_get_token",children:[J("span",{children:"Get ONEUSD"}),J(Ri,{size:12})]})]}),J("div",{className:"wi-op-balance-body",children:n?J("div",{className:"wi-skeleton-block",style:{width:140,height:32}}):tt(Xl,{children:[r&&J("img",{src:r,alt:"","aria-hidden":!0,className:"wi-op-balance-icon",width:24,height:24,draggable:!1,onError:z}),J("span",{className:"wi-op-balance-value",children:t??"0.00"})]})})]}),tt("div",{className:"wi-op-action-row","aria-label":"ONEpop actions",children:[tt("button",{type:"button",className:"wi-op-action-card",onClick:I,"aria-label":"Send POP","data-track":"onepop_send",children:[J(Qf,{size:24}),J("span",{children:"Send POP"})]}),tt("button",{type:"button",className:"wi-op-action-card",onClick:C,"aria-label":"Claim POPs","data-track":"onepop_claim",children:[J(Vf,{size:24}),J("span",{children:"Claim POPs"})]}),k&&tt("button",{type:"button",className:"wi-op-action-card",onClick:S,"aria-label":"Activity","data-track":"onepop_activity",children:[J(qf,{size:24}),J("span",{children:"Activity"})]})]})]}),J("section",{className:"wi-op-cta-row",children:x?J("div",{className:"wi-skeleton-block wi-op-cta-skeleton",style:{height:40}}):tt(Xl,{children:[!p&&w<=0&&J("button",{type:"button",className:"wi-op-cta wi-op-cta--gradient",onClick:I,"data-track":"onepop_send_first",children:"Send your first POP!"}),w>0?J("button",{type:"button",className:"wi-op-cta wi-op-cta--purple",onClick:C,"data-track":"onepop_claim_banner",children:`${w} POP${w===1?"":"s"} waiting to claim (total ${B})`}):!p&&J("button",{type:"button",className:"wi-op-cta wi-op-cta--purple",onClick:E,"data-track":"onepop_claim_maybe",children:"You might have POPs waiting"}),h>0&&J("button",{type:"button",className:"wi-op-cta wi-op-cta--outline",onClick:S,"data-track":"onepop_replies",children:`${h} ${h===1?"reply":"replies"} waiting`})]})}),p?tt("section",{className:"wi-op-activity",children:[tt("div",{className:"wi-op-activity-head",children:[tt("div",{className:"wi-op-activity-heading",children:[J("span",{className:"wi-op-activity-title",children:"Recent activity"}),J("span",{className:"wi-op-activity-currency",children:"Currency: ONEUSD"})]}),tt("button",{type:"button",className:"wi-op-link-btn",onClick:S,"data-track":"onepop_see_all_activity",children:[J("span",{children:"See all activity"}),J(Ri,{size:16})]})]}),J("ul",{className:"wi-op-activity-list",children:L.map(A=>J(Hy,{item:A},A.id))})]}):tt("section",{className:"wi-op-features",children:[J(Zl,{icon:J(Kf,{size:20}),title:"No wallet address needed",desc:"just their @handle"}),J(Zl,{icon:J(Zf,{size:20}),title:"Claim instantly",desc:"social login, zero gas"}),J(Zl,{icon:J(Xf,{size:20}),title:"Refund anytime",desc:"get it back if unclaimed"})]})]}),J("div",{className:"wi-op-footer",children:J("span",{children:"Powered by ONEpop"})})]})}function Zl({icon:e,title:t,desc:r}){return tt("div",{className:"wi-op-feature",children:[J("span",{className:"wi-op-feature-icon","aria-hidden":!0,children:e}),tt("span",{className:"wi-op-feature-copy",children:[J("span",{className:"wi-op-feature-title",children:t}),J("span",{className:"wi-op-feature-desc",children:r})]})]})}function Hy({item:e}){let t=Gy(e.handle),r=e.direction==="sent"?`Sent to ${t}`:`Claimed from ${t}`,n=t.replace("@","").charAt(0).toUpperCase()||"?";return tt("li",{className:"wi-op-activity-item",children:[J("span",{className:"wi-op-activity-avatar","aria-hidden":!0,children:e.avatarUrl?J("img",{src:e.avatarUrl,alt:"",width:30,height:30,draggable:!1,onError:o=>{o.currentTarget.style.display="none"}}):J("span",{className:"wi-op-activity-initial",children:n})}),tt("span",{className:"wi-op-activity-copy",children:[tt("span",{className:"wi-op-activity-meta",children:[J("span",{className:"wi-op-activity-peer",children:r}),J("span",{className:"wi-op-activity-sep","aria-hidden":!0}),J("span",{className:"wi-op-activity-time",children:Wy(e.timestamp)})]}),J("span",{className:"wi-op-activity-amount",children:em(e.amountRaw,e.decimals)})]}),J("span",{className:Re("wi-op-badge",`wi-op-badge--${e.status}`),"data-status":e.status,children:Uy[e.status]})]})}import*as rm from"react";import{jsx as tm,jsxs as _y}from"react/jsx-runtime";var nm=rm.forwardRef(function({className:t,children:r,...n},o){return _y("button",{...n,ref:o,type:"button",className:"wi-op-link-btn","data-track":"onepop_get_token",children:[tm("span",{children:"Get ONEUSD"}),tm(Ri,{size:12})]})});import{Fragment as Jl,jsx as N,jsxs as V}from"react/jsx-runtime";var qy="On-ramp is not available in your region.";function Yy(e){if(typeof window>"u"||!e?.length)return!1;let{origin:t,pathname:r}=window.location,n=t+r;return e.some(o=>n===o||n.startsWith(`${o}/`))}function Ky(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Zy(e){let t=e.toLowerCase().replace(/^0x/,""),r=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),n=parseInt(r.slice(0,4),16)%360,o=(n+60+parseInt(r.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${n} 85% 65%), hsl(${o} 80% 55%))`}function Xy(e,t=.5){let r=q.useRef(null),n=q.useRef(null),[o,i]=q.useState(1);return q.useLayoutEffect(()=>{let a=r.current,s=n.current;if(!a||!s)return;let l=()=>{let c=a.clientWidth;if(!c)return;let b=s.cloneNode(!0);b.style.setProperty("--wi-total-scale","1"),b.style.position="absolute",b.style.left="-9999px",b.style.top="-9999px",b.style.visibility="hidden",b.style.maxWidth="none",b.style.width="max-content",a.appendChild(b);let f=b.offsetWidth;a.removeChild(b);let m=f>c?Math.max(t,c/f):1;i(m)};l();let d=new ResizeObserver(l);return d.observe(a),()=>d.disconnect()},[e,t]),{containerRef:r,valueRef:n,scale:o}}function im({align:e="end",sideOffset:t=12,className:r,children:n}){let{env:o,theme:i,isMobile:a,open:s,drawerDirection:l,modal:d,showBalance:c,showForgeToken:b,showGameToken:f,showQR:m,showBridge:y,qrLogoSrc:g,walletAddress:u,accountName:p,sendAccounts:w,profileImageUrl:h,connectorName:x,preferredTokens:k,close:R,onSelectWallet:I,onCopyAddress:C,onBuy:S,onDisconnect:E,disconnectLabel:M,termsUrl:B,termsLabel:L,privacyUrl:z,privacyLabel:A,portalStyle:U,navContent:oe,navPosition:Y,footerContent:G,view:H,setView:ie,selectedSendToken:te,setSelectedSendToken:O,selectedDetailToken:Z,setSelectedDetailToken:_,showPortfolio:ce,showOnePop:xe,onePopSummary:he,onOnePopOpen:fe,onOnePopSend:ge,onOnePopClaim:we,onOnePopActivity:Ye,onOnePopRepliesSeen:be,onePopLogoSrc:Te,onePopGetTokenSlot:it,onePopHeroSrc:We,portfolioTitle:_e,portfolioSections:Be,showTotalAssets:rt,totalAssetsLabel:Et,sendTransaction:ft,getTransactionReceipt:Ct,estimateGas:Se,onOutlink:wt,lpBalanceReader:yt,stakingRewardsReader:St,bridgeTokens:Ke,bridgeHistory:Xe,getBridgeQuote:$t,getBridgeToTokens:At,getBridgeApproval:zt,approveBridge:Mt,submitBridge:nt,onReceive:Ge,onSend:at,onBuyDisabledMessage:Nt,onBridgeDisabledMessage:Pe,onSendDisabledMessage:st}=Dn(),[_t,F]=q.useState();q.useEffect(()=>{F(Dp()??(To()?Vy.default:void 0))},[]);let ke=p??x??_t??"Account",[P,ae]=q.useState(null),pe=q.useRef(void 0),me=q.useCallback(T=>{ae(T),clearTimeout(pe.current),pe.current=setTimeout(()=>ae(null),4e3)},[]);q.useEffect(()=>()=>clearTimeout(pe.current),[]);let Je=!!Nt,ir=q.useCallback(()=>{if(Je){me(Nt);return}let T=S?.();T&&typeof T.then=="function"&&T.catch(()=>{me(Nt??qy)})},[Je,Nt,S,me]),Qt=!!Pe,Lt=!!st,{tokens:hr,isLoading:br}=Bn(o,u,s&&c),{statsMap:Vt}=zn(o,c),{aprPercent:ar}=fp(),{categoryMap:X,infoMap:Ee}=gp(o,c),j=c&&rt,{displayValue:ze,isLowerBound:ee,isLoading:$e}=hp(o,u,s&&j),[xn,eo]=q.useState(!1),qr=q.useRef(null),[Yr,Hi]=q.useState(0),{holdings:to,isLoading:_i}=cp(o,u,s&&c&&b),Qi=q.useMemo(()=>to.map(T=>T.token),[to]),{imageMap:ko}=pp(o,Qi,b&&to.length>0),Vi=kp(o),sr=q.useMemo(()=>xp({env:o,tokens:hr,pinnedTokens:Vi,preferredTokens:k,statsMap:Vt,categoryMap:X,showGameToken:f}),[hr,o,Vt,f,X,Vi,k]),qi=q.useMemo(()=>{if(!b)return[];let T=new Set(hr.map(re=>re.address.toLowerCase()));return[...to].filter(re=>!T.has(re.token.toLowerCase())).sort((re,et)=>{let Xr=pt(re.value)??new om(0);return(pt(et.value)??new om(0)).minus(Xr).toNumber()})},[to,b,hr]),Kr=q.useRef(!1),[qt,ro]=q.useState(null),W=q.useRef(void 0),ct=qt?.chainId??te?.chainId??sr[0]?.chainId??0,{transactionUrl:er}=ii(o,ct,qt?.txHash,!!(qt?.txHash&&ct)),Ae=q.useCallback(T=>{Kr.current=!0,ie(T)},[ie]),[Zr,Ft]=q.useState("recipient"),lr=q.useCallback(()=>{O(null),Ft("recipient"),Ae("wallet")},[O,Ae]),He=q.useCallback((T,re="recipient")=>{if(Lt){me(st);return}Ft(re),O(T),Ae("send")},[Lt,st,me,O,Ae]),dn=q.useCallback(T=>{_(T),Ae("token-detail")},[_,Ae]),Ro=q.useCallback(()=>{fe?.(),Ae("onepop")},[fe,Ae]),oh=q.useCallback(()=>{_(null),Ae("wallet")},[_,Ae]),ih=q.useCallback(T=>{He(T,"recipient")},[He]),Yi=Ut("apps.json",o,T=>Mr(T?.gametokenBridge,o)),Ed=Ut("apps.json",o,T=>T?.gametokenSites),ah=q.useCallback(()=>{if(Qt){me(Pe);return}if(Yi){if(Yy(Ed)){window.location.assign(Yi);return}window.open(Yi,"_blank","noopener,noreferrer")}},[Qt,Pe,Yi,Ed,me]),sh=q.useCallback(T=>{clearTimeout(W.current),O(null),Ae("wallet"),ro({status:"pending",txHash:T.txHash,chainId:T.chainId,description:`${T.amount} ${T.tokenSymbol} to ${tr(T.recipient)}`})},[O,Ae]),lh=q.useCallback(T=>{let re=te?.chainId;O(null),Ae("wallet"),!(!T||!re)&&(ro(et=>({status:"success",txHash:T,chainId:re,description:et?.txHash===T?et.description:"Tap to see your transaction"})),clearTimeout(W.current),W.current=setTimeout(()=>ro(null),5e3))},[te?.chainId,O,Ae]),dh=q.useCallback(T=>{let re=T.txHash;re&&(ro({status:"error",txHash:re,chainId:T.chainId,description:T.message}),clearTimeout(W.current),W.current=setTimeout(()=>ro(null),5e3))},[]),ei=q.useMemo(()=>{if(Ge)return Ge;if(m)return()=>Ae("qr")},[Ge,m,Ae]),Ki=q.useMemo(()=>{if(at)return at;if(sr.length===0)return;let T=sr[0];return()=>He(T,"token")},[at,sr,He]),Ad=q.useCallback(()=>{if(Lt){me(st);return}Ki?.()},[Lt,st,Ki,me]);q.useEffect(()=>{s||(Kr.current=!1,Ft("recipient"))},[s]);let Md=q.useRef(null);q.useEffect(()=>{let T=Md.current;if(!T||!a)return;let re=et=>{et.pointerType==="touch"&&et.stopPropagation()};return T.addEventListener("pointerdown",re),()=>T.removeEventListener("pointerdown",re)},[a]);let[Co,Ld]=q.useState(!1),Qs=q.useRef(void 0),[ti,ri]=q.useState(!1);q.useEffect(()=>{if(!ti)return;let T=()=>ri(!1),re=Xr=>{Xr.key==="Escape"&&ri(!1)},et=setTimeout(()=>{document.addEventListener("mousedown",T,!0),document.addEventListener("keydown",re,!0)},0);return()=>{clearTimeout(et),document.removeEventListener("mousedown",T,!0),document.removeEventListener("keydown",re,!0)}},[ti]),q.useEffect(()=>{ri(!1)},[u]),q.useEffect(()=>()=>clearTimeout(Qs.current),[]),q.useEffect(()=>()=>clearTimeout(W.current),[]),q.useEffect(()=>{let T=qr.current;if(!T||G===null){Hi(0);return}let re=()=>{Hi(T.offsetHeight)};if(re(),typeof ResizeObserver>"u")return;let et=new ResizeObserver(re);return et.observe(T),()=>et.disconnect()},[G]);let Dd=q.useCallback(async()=>{if(!Co)try{await navigator.clipboard.writeText(u),Ld(!0),clearTimeout(Qs.current),Qs.current=setTimeout(()=>Ld(!1),2e3),C?.(u,!0)}catch{C?.(u,!1)}},[u,C,Co]),Zi=q.useCallback(T=>{T.currentTarget.setAttribute("data-loaded","true")},[]),Pd=q.useMemo(()=>({background:Zy(u)}),[u]),Xi=q.useMemo(()=>h||Rn(o,u,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[h,o,u,i]),Vs=q.useMemo(()=>Ky(ze),[ze]),{containerRef:ch,valueRef:ph,scale:uh}=Xy(xn?"\u2022\u2022\u2022\u2022\u2022\u2022":ze),Od=B||z?V("div",{className:"wi-legal-links",children:[B&&N("a",{className:"wi-legal-link",href:B,target:"_blank",rel:"noopener noreferrer","data-track":"terms_link",onClick:T=>Ot(T,B,{category:"terms",origin:"terms"},wt),children:L}),B&&z&&N("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),z&&N("a",{className:"wi-legal-link",href:z,target:"_blank",rel:"noopener noreferrer","data-track":"privacy_link",onClick:T=>Ot(T,z,{category:"privacy",origin:"privacy"},wt),children:A})]}):null,Bd=E?V("button",{type:"button",className:"wi-disconnect-btn","data-track":"disconnect",onClick:()=>{E(),R()},children:[N(hc,{size:16}),N("span",{className:"wi-disconnect-label",children:M})]}):null,fh=c&&!oe,mh=!j,gh=V("button",{type:"button",className:Re("wi-action-card",Lt&&"wi-action-card--dimmed"),onClick:Ad,disabled:!Lt&&!Ki,"aria-disabled":Lt||void 0,"aria-label":"Send","data-track":"send_open",children:[N(xc,{size:20}),N("span",{children:"Send"})]}),hh=fh?V("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[V("button",{type:"button",className:Re("wi-action-card",Je&&"wi-action-card--dimmed"),onClick:ir,disabled:!S&&!Je,"aria-disabled":Je||void 0,"aria-label":"Buy","data-track":"buy",children:[N(Rc,{size:20}),N("span",{children:"Buy"})]}),y?V("button",{type:"button",className:Re("wi-action-card",Qt&&"wi-action-card--dimmed"),onClick:ah,"aria-disabled":Qt||void 0,"aria-label":"Bridge","data-track":"bridge_open",children:[N(Cc,{size:20}),N("span",{children:"Bridge"})]}):V("button",{type:"button",className:"wi-action-card",onClick:ei,disabled:!ei,"aria-label":"Receive","data-track":"receive",children:[N(ua,{size:20}),N("span",{children:"Receive"})]}),mh&&gh,xe&&V("button",{type:"button",className:"wi-action-card",onClick:Ro,"aria-label":"Open ONEpop","data-track":"onepop_open",children:[N(Kl,{size:20}),N("span",{children:"ONEpop"})]}),ce?V("button",{type:"button",className:"wi-action-card",onClick:()=>Ae("portfolio"),"aria-label":"View portfolio","data-track":"portfolio_open",children:[N(kc,{size:20}),N("span",{children:"Portfolio"})]}):y?V("button",{type:"button",className:"wi-action-card",onClick:ei,disabled:!ei,"aria-label":"Receive","data-track":"receive",children:[N(ua,{size:20}),N("span",{children:"Receive"})]}):null]}):null,bh=V("div",{className:Re("wi-view-inner",Kr.current&&"wi-view-wallet"),children:[j&&V("div",{className:"wi-total-section",children:[V("div",{className:"wi-total-head",children:[N("span",{className:"wi-total-label",children:Et}),N("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:T=>{T.stopPropagation(),eo(re=>!re)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),T.stopPropagation(),eo(re=>!re))},"aria-label":xn?"Show balance":"Hide balance","data-track":"balance_toggle",children:xn?N(wc,{}):N(bc,{})})]}),V("div",{className:"wi-total-body",children:[N("div",{className:"wi-total-value-wrap",ref:ch,children:$e?N("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):N("div",{className:"wi-total-value","data-hidden":xn||void 0,ref:ph,style:{"--wi-total-scale":uh},children:xn?N("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):V(Jl,{children:[ee&&N("span",{className:"wi-total-lte",children:"\u2264"}),N("span",{className:"wi-total-currency",children:"$"}),N("span",{className:"wi-total-amount",children:Vs.main}),Vs.decimal&&N("span",{className:"wi-total-decimal",children:Vs.decimal})]})})}),N("button",{type:"button",className:Re("wi-total-send",Lt&&"wi-total-send--dimmed"),onClick:Ad,disabled:!Lt&&!Ki,"aria-disabled":Lt||void 0,"aria-label":"Send","data-track":"send_open",children:N(vc,{size:27})})]})]}),Y==="top"&&(oe?N("div",{className:"wi-nav-fixed",children:oe}):hh),c&&N("div",{ref:Md,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:V("div",{className:"wi-token-list",children:[br&&Array.from({length:5},(T,re)=>V("div",{className:"wi-skeleton-item",children:[V("div",{className:"wi-skeleton-left",children:[N("div",{className:"wi-skeleton-block wi-skeleton-icon"}),V("div",{className:"wi-skeleton-lines",children:[N("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),N("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),V("div",{className:"wi-skeleton-right",children:[N("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),N("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},re)),!br&&sr.length===0&&!b&&N("div",{className:"wi-empty",children:"No Tokens Found"}),sr.map(T=>{let re=Vt.get(mn(T.chainId,T.address)),et=re?parseFloat(re.percent_change_24h):null,Xr=et!==null&&et>=0,Ys=li(o,T.chainId),Th=xl(T.address);return V("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>dn(T),"aria-label":`View ${T.symbol} detail`,"data-track":"token_detail","data-track-id":T.symbol,children:[V("div",{className:"wi-token-left",children:[V("div",{className:"wi-token-icon-wrap",children:[N("img",{src:T.icon_url,alt:T.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Zi,onError:Ks=>{Ks.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Ys&&N("img",{src:Ys,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Ks=>{Ks.currentTarget.style.display="none"}})]}),V("div",{className:"wi-token-info",children:[V("span",{className:"wi-token-name-row",children:[N("span",{className:"wi-token-name",children:T.symbol}),Th&&ar!==null&&N("span",{className:"wi-token-apr",children:Ma(ar)})]}),re&&V("div",{className:"wi-token-price-row",children:[N("span",{className:"wi-token-price",children:co(re.price)}),N("span",{className:"wi-token-change","data-positive":Xr,"data-zero":et===0||void 0,children:et!==null&&(et===0?"0%":`${Xr?"+":"-"}${(Xr?Math.floor:Math.ceil)(Math.abs(et)*100)/100}%`)})]})]})]}),V("div",{className:"wi-token-right",children:[N("span",{className:"wi-token-balance",children:kn(T.quantity.numeric,T.quantity.decimals)}),re&&N("span",{className:"wi-token-value",children:fa(T.quantity.numeric,T.quantity.decimals,re.price)})]})]},`${T.address}-${T.chainId}`)}),b&&_i&&Array.from({length:3},(T,re)=>V("div",{className:"wi-skeleton-item",children:[V("div",{className:"wi-skeleton-left",children:[N("div",{className:"wi-skeleton-block wi-skeleton-icon"}),V("div",{className:"wi-skeleton-lines",children:[N("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),N("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),V("div",{className:"wi-skeleton-right",children:[N("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),N("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${re}`)),b&&!_i&&!br&&sr.length===0&&qi.length===0&&N("div",{className:"wi-empty",children:"No Tokens Found"}),b&&qi.map(T=>{let re=ko.get(T.token)||"",et=li(o,mt[o].cross);return V("div",{className:"wi-token-item",children:[V("div",{className:"wi-token-left",children:[V("div",{className:"wi-token-icon-wrap",children:[N("img",{src:re||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:T.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Zi,onError:Xr=>{Xr.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),et&&N("img",{src:et,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Xr=>{Xr.currentTarget.style.display="none"}})]}),V("div",{className:"wi-token-info",children:[N("span",{className:"wi-token-name",children:T.token_name}),N("div",{className:"wi-token-price-row",children:V("span",{className:"wi-token-price",children:[kn(T.current_price,18)," CROSS"]})})]})]}),V("div",{className:"wi-token-right",children:[N("span",{className:"wi-token-balance",children:kn(T.balance,18)}),N("span",{className:"wi-token-value",children:co(T.current_value_usd)})]})]},`forge-${T.token}`)})]})}),Y==="bottom"&&oe&&N("div",{className:"wi-nav-fixed",children:oe}),Bd&&N("div",{className:"wi-wallet-disconnect-row",children:Bd})]},"wallet"),wh=ce?N("div",{className:Re("wi-view-inner wi-portfolio-body",Kr.current&&"wi-view-portfolio"),children:N(jo,{env:o,theme:i,walletAddress:u,showHeader:!1,onOutlink:wt,lpBalanceReader:yt,stakingRewardsReader:St,sendTransaction:ft,estimateGas:Se,sections:Be})},"portfolio"):null,yh=te?N("div",{className:Re("wi-view-inner wi-send-body",Kr.current&&"wi-view-send"),children:N(Ia,{env:o,theme:i,walletAddress:u,accountName:ke,accounts:w,initialStep:Zr,token:te,tokens:sr,onTokenChange:O,sendTransaction:ft,getTransactionReceipt:Ct,estimateGas:Se,getTokenPriceUsd:T=>{let re=Vt.get(mn(T.chainId,T.address));if(!re?.price)return;let et=parseFloat(re.price);return Number.isFinite(et)?et:void 0},onClose:R,onBackToWallet:lr,onSubmitted:sh,onSuccess:lh,onFailed:dh,onOutlink:wt})},"send"):null,xh=q.useMemo(()=>Ke||sr.map(T=>{let re=Vt.get(mn(T.chainId,T.address)),et=re?.price?parseFloat(re.price):void 0;return{name:T.name,symbol:T.symbol,chainId:T.chainId,address:T.address,decimals:T.quantity.decimals,balance:Bo(T.quantity.numeric,T.quantity.decimals),iconUrl:T.icon_url,priceUsd:Number.isFinite(et)?et:void 0}}),[Ke,Vt,sr]),vh=N("div",{className:Re("wi-view-inner wi-bridge-body",Kr.current&&"wi-view-send"),children:N(Go,{env:o,walletAddress:u,tokens:xh,history:Xe,termsUrl:B,getQuote:$t,getToTokens:At,getApproval:zt,approveBridge:Mt,submitBridge:nt,onClose:R,onBackToWallet:lr})},"bridge"),kh=Z?N("div",{className:Re("wi-view-inner wi-token-detail-body",Kr.current&&"wi-view-send"),children:N(jf,{env:o,isMobile:a,token:Z,walletAddress:u,stat:Vt.get(mn(Z.chainId,Z.address)),tokenInfo:Ee.get(La(Z.chainId,Z.address)),showBalance:c,onBack:oh,onClose:R,onSend:ih,onOutlink:wt})},"token-detail"):null,So=q.useMemo(()=>{let T=mt[o].cross;return sr.find(re=>re.chainId===T&&xl(re.address))??sr.find(re=>re.chainId===T&&re.symbol.toUpperCase().includes("ONEUSD"))},[sr,o]),Rh=q.useMemo(()=>{if(So)return kn(So.quantity.numeric,So.quantity.decimals)},[So]),Ch=xe?N("div",{className:Re("wi-view-inner wi-onepop-body",Kr.current&&"wi-view-send"),children:N(ls,{env:o,balanceDisplay:Rh,balanceIconUrl:So?.icon_url,isBalanceLoading:br&&!So,summary:he,logoSrc:Te,heroSrc:We,getTokenSlot:it,onBack:lr,onClose:R,onSend:ge,onClaim:we,onActivity:Ye,onRepliesSeen:be})},"onepop"):null,qs=!!I&&p?.trim().toLowerCase()!=="my wallet",zd=V(Jl,{children:[V("span",{className:"wi-receive-avatar",children:[N("span",{className:"wi-avatar-fallback",style:Pd}),Xi&&N("img",{src:Xi,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:Zi,onError:T=>{T.currentTarget.style.display="none"}})]}),N("span",{className:"wi-receive-account-name",children:ke}),qs&&N("span",{className:"wi-receive-chevron","data-open":ti,"aria-hidden":"true",children:N(Lr,{size:16})})]}),Sh=V("div",{className:Re("wi-view-inner wi-qr-body",Kr.current&&"wi-view-qr"),children:[V("div",{className:"wi-receive-section",children:[qs?N("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{ri(!0),I?.()},"aria-label":"Switch account",children:zd}):N("div",{className:"wi-receive-account",children:zd}),V("div",{className:"wi-qr-block",children:[V("div",{className:"wi-qr-box",children:[N(Qy,{value:u,size:180,level:"H",marginSize:2,...g&&{imageSettings:{src:g,height:33,width:33,excavate:!0}}}),!g&&N("div",{className:"wi-qr-logo",children:N(yc,{size:33})})]}),N("p",{className:"wi-qr-address",children:u})]}),V("button",{type:"button",className:"wi-qr-copy-btn",onClick:Dd,"data-track":"address_copy",children:[N("span",{className:"wi-qr-copy-icon",children:Co?N(vn,{size:16}):N(so,{size:16})}),N("span",{className:"wi-qr-copy-text",children:Co?"Copied!":"Copy address"})]})]}),Od&&N("div",{className:"wi-receive-footer",children:Od})]},"qr"),Nh=H==="qr"||H==="portfolio"||H==="send"||H==="bridge",Fd=G!==null?N("div",{className:"wi-builtin-footer",children:G}):null,Ud=V("div",{className:"wi-account-text",children:[qs?V("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{ri(!0),I?.()},"aria-label":"Switch account","aria-expanded":ti,children:[N("span",{className:"wi-account-name",children:ke}),N("span",{className:"wi-account-switch","data-open":ti,"aria-hidden":"true",children:N(Lr,{size:20})})]}):N("div",{className:"wi-account-row",children:N("span",{className:"wi-account-name",children:ke})}),V("button",{type:"button",className:"wi-address-row-btn",onClick:Dd,"aria-label":"Copy address","data-track":"address_copy",children:[N("span",{className:"wi-account-address",children:tr(u)}),N("span",{className:"wi-account-copy","data-copied":Co,children:Co?N(vn,{size:12}):N(so,{size:12})})]})]}),jd=V(Jl,{children:[n,H==="qr"?N("div",{className:"wi-sticky-header",children:V("div",{className:"wi-header wi-header--receive",children:[N("button",{type:"button",className:"wi-header-back",onClick:lr,"aria-label":"Back",children:N($r,{size:24})}),N("span",{className:"wi-receive-title",children:"Receive"}),N("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:N(Nr,{size:24})})]})}):H==="send"||H==="bridge"||H==="token-detail"||H==="onepop"?null:Nh?V("div",{className:"wi-sticky-header",children:[V("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[N("button",{type:"button",className:"wi-header-back",onClick:lr,"aria-label":"Back",children:N($r,{size:24})}),N("div",{className:"wi-account-block wi-account-block--sub-account",children:Ud}),N("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:N(Nr,{size:24})})]}),N("hr",{className:"wi-divider"})]}):V("div",{className:"wi-sticky-header",children:[V("div",{className:"wi-header wi-header--wallet",children:[V("div",{className:"wi-account-block",children:[V("div",{className:"wi-avatar",children:[N("div",{className:"wi-avatar-fallback",style:Pd}),Xi&&N("img",{src:Xi,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:Zi,onError:T=>{T.currentTarget.style.display="none"}})]}),Ud]}),V("div",{className:"wi-header-actions",children:[m&&y&&N("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:ei,"aria-label":"Show QR code","data-track":"receive",children:N(ua,{size:20})}),N("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:N(Nr,{size:24})})]})]}),N("hr",{className:"wi-divider"})]}),V("div",{className:"wi-view-container",children:[H==="wallet"&&bh,H==="qr"&&Sh,H==="portfolio"&&wh,H==="send"&&yh,H==="bridge"&&vh,H==="token-detail"&&kh,H==="onepop"&&Ch]}),(H==="wallet"||H==="onepop")&&P&&N("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:P}),H==="wallet"&&qt&&V("a",{className:"wi-send-toast",href:er??"#",target:"_blank",rel:"noopener noreferrer",onClick:T=>{if(!er){T.preventDefault();return}Ot(T,er,{category:"send",origin:"send-transaction",payload:{chainId:qt.chainId,txHash:qt.txHash}},wt)},children:[N("span",{className:"wi-send-toast-icon","data-status":qt.status,"aria-hidden":!0,children:qt.status==="pending"?N("span",{className:"wi-send-toast-spinner"}):qt.status==="error"?N("span",{className:"wi-send-toast-error-dot"}):N(Sc,{size:20})}),V("span",{className:"wi-send-toast-copy",children:[N("span",{className:"wi-send-toast-title",children:qt.status==="pending"?"Sending...":qt.status==="error"?"Send failed":"Send complete"}),N("span",{className:"wi-send-toast-desc",children:qt.status==="pending"||qt.status==="error"?qt.description:"Tap to see your transaction"})]})]}),Fd&&H!=="portfolio"&&H!=="send"&&H!=="token-detail"&&H!=="onepop"&&N("div",{className:"wi-sticky-footer",children:N("div",{className:"wi-footer",ref:qr,children:Fd})})]}),Wd={...U,...Yr>0?{"--wi-footer-height":`${Yr}px`}:null},Gd=q.useCallback(T=>{let re=T.detail.originalEvent.target;re instanceof Element&&re.closest("[data-rd-shell]")!==null&&T.preventDefault()},[]);return a?N(ye,{feature:"wallet_info",children:V(ds.Portal,{children:[d&&N(ds.Overlay,{className:"wi-drawer-overlay"}),V(ds.Content,{className:Re("wi-drawer-content",r),"data-theme":i,"data-vaul-no-drag":l==="left"||l==="right"?!0:void 0,style:Wd,"data-direction":l,"data-no-balance":!c||void 0,"data-has-footer":Yr>0||void 0,"data-view":H,onInteractOutside:Gd,children:[N(ds.Title,{className:"wi-sr-only",children:"My Wallet"}),jd]})]})}):V(ye,{feature:"wallet_info",children:[d&&s&&N("div",{className:"wi-drawer-overlay",onClick:R}),N(cs.Portal,{children:N(cs.Content,{align:e,sideOffset:t,className:Re("wi-popover-content",r),"data-theme":i,style:Wd,"data-no-balance":!c||void 0,"data-has-footer":Yr>0||void 0,"data-view":H,onInteractOutside:Gd,children:jd})})]})}import*as am from"react";function sm({position:e="top",children:t}){let{setNavContent:r,setNavPosition:n}=Dn();return am.useEffect(()=>(r(t),n(e),()=>r(null)),[t,e,r,n]),null}import*as lm from"react";function dm({children:e}){let{setFooterContent:t}=Dn();return lm.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}de(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-accent-primary-high, #f0640d);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #121212);--wi-surface-default: var(--ds-surface-medium, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(255, 255, 255, .1));--wi-border-default: var(--ds-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--ds-border-medium, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--ds-content-highest, #ffffff);--wi-texticon-secondary: var(--ds-content-medium, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(255, 255, 255, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--ds-accent-primary-high, #f0640d);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #ffffff);--wi-surface-default: var(--ds-surface-medium, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(18, 18, 18, .1));--wi-border-default: var(--ds-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--ds-border-medium, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--ds-content-highest, #121212);--wi-texticon-secondary: var(--ds-content-medium, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(18, 18, 18, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
10
+ `)[0]?.trim()||t}function af(e){let{tokens:t,initialFromToken:r,initialToToken:n,getToTokens:o,getApproval:i,approveBridge:a,history:s=[],initialSlippage:l="1",termsUrl:d,getQuote:c,submitBridge:b,onSubmitted:f,onSuccess:m,onFailed:y,onExit:g}=e,u=Q.useMemo(()=>$u({getQuote:c,submitBridge:b}),[c,b]),[p,w]=Q.useState("form"),[h,x]=Q.useState(r??$a(t)),[k,R]=Q.useState(()=>Ql(t,r??$a(t),n,o)),[I,C]=Q.useState(""),[S,E]=Q.useState(""),[M,B]=Q.useState("from"),[L,z]=Q.useState(l),[A,U]=Q.useState(null),oe=Q.useMemo(()=>N1(h,k),[h,k]),Y=Q.useMemo(()=>oe?"1":L==="auto"?S1(A?.priceImpact):L,[oe,L,A?.priceImpact]),[G,H]=Q.useState(""),[ie,te]=Q.useState("idle"),[O,Z]=Q.useState(""),[_,ce]=Q.useState(null),[xe,he]=Q.useState([]),[fe,ge]=Q.useState(!1),[we,Ye]=Q.useState(R1),[be,Te]=Q.useState(null),[it,We]=Q.useState(!1),[_e,Be]=Q.useState(null),[rt,Et]=Q.useState(null),[ft,Ct]=Q.useState(!1),[Se,wt]=Q.useState(!1),yt=Q.useRef(0),St=Q.useRef(null),Ke=Q.useRef(!1),Xe=Q.useRef(!1),$t=Q.useRef(!1),At=Q.useRef(!1),zt=Q.useRef(!1),Mt=Q.useRef(!1),nt=Q.useRef(!1);Q.useEffect(()=>{$t.current||($t.current=!0,Qe("bridge","opened"))},[]);let Ge=Q.useCallback(()=>{St.current&&(clearTimeout(St.current),St.current=null)},[]),at=Q.useCallback(j=>{Ge(),Et(j)},[Ge]);Q.useEffect(()=>Ge,[Ge]),Q.useEffect(()=>{let j=t.find($e=>nn($e,h))??$a(t),ze=j?o?.(j,t):void 0,ee=ze?.find($e=>nn($e,k))??(ze?void 0:t.find($e=>nn($e,k)))??Ql(t,j,void 0,o);x(j),R(ee)},[o,t,h,k]);let Nt=Q.useCallback((j,ze)=>{let ee=k1(j);if(!ee){yt.current+=1,C(""),E(""),B(ze),U(null),H(""),te("idle");return}ze==="from"?C(ee):E(ee),B(ze),H(""),!zt.current&&Number(ee)>0&&(zt.current=!0,Qe("bridge","amount_entered"))},[]),Pe=Q.useCallback(()=>{yt.current+=1,C(""),E(""),B("from"),U(null),H(""),Z(""),te("idle"),Te(null),We(!1),Be(null),Ct(!1),at(null)},[at]),st=Q.useCallback(j=>{nn(j,h)||(At.current||(At.current=!0,Qe("bridge","token_selected",{tags:{item_id:`from:${j.symbol}`}})),x(j),R(Ql(t,j,void 0,o)),Pe())},[h,o,Pe,t]),_t=Q.useCallback(j=>{nn(j,k)||nn(j,h)||(At.current||(At.current=!0,Qe("bridge","token_selected",{tags:{item_id:`to:${j.symbol}`}})),R(j),Pe())},[h,Pe,k]),F=Q.useMemo(()=>h?o?.(h,t)??t.filter(j=>!nn(j,h)):[],[h,o,t]),ke=Q.useCallback(()=>{h?.balance&&Nt(h.balance,"from")},[h?.balance,Nt]),P=Q.useCallback(()=>{!h||!k||(x(k),R(h),Pe())},[h,Pe,k]),ae=Q.useCallback(()=>{yt.current+=1,C(""),E(""),B("from"),U(null),H(""),Z("")},[]);Q.useEffect(()=>{if(!h||!k)return;if(!I&&!S){U(null),H(""),te(ee=>ee==="quoting"?"idle":ee);return}let j=++yt.current,ze=rf({fromToken:h,toToken:k,fromAmount:I,toAmount:S,lastChangedBy:M,slippage:L});te(ee=>ee==="submitting"?ee:u.canQuote?"quoting":"idle"),(async()=>{try{let ee=await u.getQuote(ze);if(yt.current!==j)return;ee.fromAmount!==void 0&&M==="to"&&C(ee.fromAmount),ee.toAmount!==void 0&&M==="from"&&E(ee.toAmount),U(ee.summary??null),H(ee.error??"")}catch(ee){if(yt.current!==j)return;H(ee instanceof Error?ee.message:"Failed to quote bridge.")}finally{yt.current===j&&te(ee=>ee==="quoting"?"idle":ee)}})()},[I,h,M,u,L,S,k]);let pe=Q.useCallback(()=>!h||!k?null:rf({fromToken:h,toToken:k,fromAmount:I,toAmount:S,lastChangedBy:M,slippage:Y}),[Y,I,h,M,S,k]),me=Q.useCallback(async(j,ze)=>{if(!Ke.current){Ke.current=!0,Z(""),Ct(!1),We(!1),te("submitting");try{if(!ze?.skipApprovalCheck&&i){let $e=await i(j);if($e){Te($e),Be(j),te("idle");return}}Te(null),Be(null),at("processing");let ee=await u.submitBridge(j);ce(ee),te("success"),he($e=>[{id:ee.txHash,timestamp:new Date().toISOString(),txHash:ee.txHash,fromToken:ee.fromToken,toToken:ee.toToken,fromAmount:ee.fromAmount,toAmount:ee.toAmount,summary:A??void 0,status:"pending"},...$e.filter(xn=>xn.txHash!==ee.txHash)]),ae(),wt(!0),at(null),Ct(!0),Qe("bridge","confirmed"),Mt.current=!1,nt.current=!1,f?.(ee),m?.(ee)}catch(ee){if(at(null),Qe("bridge","confirmed",{status:"failure",reason:Cr(ee)}),Mt.current=!1,nt.current=!1,Vl(ee)){te("idle");return}let $e=nf(ee,"Failed to submit bridge.");Z($e),te("error"),y?.({message:$e})}finally{Ke.current=!1}}},[i,y,f,m,u,ae,at,A]),Je=Q.useCallback(async()=>{if(G)return;let j=pe();if(j){if(Mt.current||(Mt.current=!0,Qe("bridge","submitted")),!we){Be(j),ge(!0);return}await me(j)}},[pe,G,me,we]),ar=Q.useCallback(async()=>{let j=_e??pe();j&&(C1(),Ye(!0),ge(!1),await me(j))},[pe,_e,me]),Qt=Q.useCallback(()=>{ge(!1),Be(null)},[]),Lt=Q.useCallback(async()=>{if(!(Xe.current||ie==="submitting"||!be||!_e||!a)){Xe.current=!0,Z(""),te("submitting");try{await a(_e,be),nt.current||(nt.current=!0,Qe("bridge","approved")),Te(null),te("idle"),We(!0)}catch(j){if(Vl(j)){te("idle");return}let ze=nf(j,"Failed to approve token.");Z(ze),te("error"),y?.({message:ze})}finally{Xe.current=!1}}},[be,a,y,_e,me,ie]),hr=Q.useCallback(()=>{ie!=="submitting"&&(Te(null),We(!1),Be(null),te("idle"))},[ie]),br=Q.useCallback(async()=>{if(ie==="submitting")return;let j=_e??pe();if(!j){We(!1),Z("Bridge input is no longer available. Please try again."),te("error");return}We(!1),await me(j,{skipApprovalCheck:!0})},[pe,_e,me,ie]),Vt=Q.useCallback(()=>{Ct(!1)},[]),sr=Q.useCallback(j=>{w(j),j==="history"&&wt(!1)},[]),X=Q.useCallback(()=>{if(p==="history"){sr("form");return}g?.()},[g,sr,p]),Ee=Q.useMemo(()=>[...s,...xe.filter(j=>!s.some(ze=>ze.txHash===j.txHash))],[s,xe]);return{step:p,setStep:sr,status:ie,error:O,quoteError:G,fromToken:h,toToken:k,tokens:t,availableToTokens:F,fromAmount:I,toAmount:S,lastChangedBy:M,slippage:L,effectiveSlippage:Y,slippageLocked:oe,setSlippage:z,summary:A,history:Ee,submitted:_,canSubmit:u.canSubmit,termsOpen:fe,approvalInfo:be,approvalSuccessOpen:it,approveBridge:a,pendingSubmitInput:_e,submitToast:rt,successDialogOpen:ft,dismissSuccessDialog:Vt,hasNewHistory:Se,termsUrl:d,setFromToken:x,setToToken:R,selectFromToken:st,selectToToken:_t,setAmount:Nt,setMax:ke,swapTokens:P,submit:Je,confirmTerms:ar,cancelTerms:Qt,confirmApproval:Lt,cancelApproval:hr,continueAfterApproval:br,back:X}}de(`.bf-root{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .07));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));--bf-toast-bg: var(--bf-bg);--bf-toast-strong: var(--bf-text-high);--bf-toast-color: var(--bf-text-medium);position:relative;display:flex;flex:1;min-height:0;flex-direction:column;container:bf-flow / inline-size;overflow:hidden;background:var(--bf-bg);color:var(--ds-content-highest, #ffffff);font-family:inherit}[data-theme=dark].wi-popover-content .bf-root,[data-theme=dark].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].wi-popover-content .bf-root,[data-theme=light].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}[data-theme=dark].gou-shell .bf-root,.gou-shell[data-theme=dark] .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].gou-shell .bf-root,.gou-shell[data-theme=light] .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}.bf-root[data-view=history]{background:var(--ds-bg-dim, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid var(--bf-border);background:var(--ds-bg-default, var(--bf-bg));box-sizing:border-box}.bf-root[data-view=history] .bf-header{padding:24px;border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff)}.bf-header-btn{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.bf-header-spacer{width:24px;height:24px;flex-shrink:0}.bf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header .bf-header-btn:last-child{position:absolute;top:24px;right:24px}.bf-header-title{position:absolute;left:50%;transform:translate(-50%);font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--bf-text-high);white-space:nowrap}.bf-header-title[data-clickable=true]{cursor:pointer}.bf-root[data-view=history] .bf-header-title{color:var(--ds-content-highest, #000000)}.bf-body,.bf-history-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.bf-body{padding:24px}.bf-history-body{display:flex;flex-direction:column;gap:12px;padding:24px;background:var(--ds-bg-dim, #f5f7fa)}.bf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.bf-chip{display:inline-flex;align-items:center;gap:4px;min-height:33px;padding:6px 8px;border:0;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-chip:hover:not(:disabled){color:var(--bf-text-high);background:var(--bf-surface-hover)}.bf-chip:disabled{cursor:default}.bf-chip-history{position:relative}.bf-chip-dot{position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-swap-card{position:relative;display:flex;flex-direction:column;gap:12px;margin-bottom:12px}.bf-field-error{margin-top:-4px;color:var(--ds-system-red-default, #ff2b5f);font-size:13px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-amount-panel{display:flex;min-height:110px;flex-direction:column;gap:8px;padding:16px;border:1px solid transparent;border-radius:12px;background:var(--bf-surface);box-sizing:border-box;transition:border-color .2s ease}.bf-amount-panel:hover{border-color:var(--bf-border)}.bf-amount-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--bf-text-high);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-balance{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;color:var(--bf-text-low);font-size:12px;white-space:nowrap}.bf-amount-main{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-amount-input-wrap{display:flex;min-width:0;flex:1;flex-direction:column;gap:4px}.bf-amount-input{width:100%;min-width:0;padding:0;border:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:18px;font-size:clamp(15px,4.5cqi,18px);font-weight:600;line-height:1.5;letter-spacing:-.01em;outline:none}.bf-amount-input[data-size=medium]{font-size:16px;font-size:clamp(14px,4cqi,16px)}.bf-amount-input[data-size=small]{font-size:14px;font-size:clamp(12px,3.5cqi,14px)}.bf-amount-input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-amount-usd{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis}.bf-token-pill{display:inline-flex;flex-shrink:0;align-items:center;gap:6px;min-height:33px;padding:6px 8px 6px 6px;border:1px solid var(--bf-border);border-radius:9999px;background:var(--bf-bg);color:var(--bf-text-high);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;perspective:220px;overflow:hidden;transition:transform .12s ease,background .15s ease}.bf-token-pill:hover:not(:disabled):not([data-locked=true]){background:var(--bf-surface-hover)}.bf-token-pill:disabled{cursor:default;opacity:.6}.bf-token-pill[data-locked=true]{cursor:default}.bf-token-icon{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0;background:var(--ds-accent-primary-default, #f0640d);color:var(--ds-accent-primary-on, #000000);font-size:11px;font-weight:700}.bf-token-icon[data-has-image=true]{background:transparent}.bf-token-icon img{width:100%;height:100%;border-radius:0;object-fit:cover}.bf-token-fallback{line-height:1}.bf-token-pill-face{display:inline-flex;align-items:center;gap:6px;transform-origin:center bottom;animation:bf-token-roll-up .32s cubic-bezier(.22,1,.36,1)}@keyframes bf-token-roll-up{0%{opacity:0;transform:translateY(90%) rotateX(-80deg)}60%{opacity:1}}.bf-token-pill:active:not(:disabled),.bf-embedded-token-pill:active:not(:disabled){transform:scale(.96)}.bf-token-search:focus-within{border-color:var(--ds-accent-primary-default, #f0640d)}.bf-token-search input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-search input::placeholder{color:var(--bf-text-low)}.bf-token-list{display:flex;min-height:0;flex:1;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;padding:0 24px 24px;scrollbar-width:thin;box-sizing:border-box}.bf-token-row{position:relative;display:flex;width:100%;min-height:69px;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid transparent;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.bf-token-row:hover:not([data-selected=true]){background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row[data-selected=true]{border-color:var(--ds-accent-primary-default, #ff8438);background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row-left{display:inline-flex;min-width:0;align-items:center;gap:16px}.bf-token-meta{display:flex;min-width:0;flex-direction:column}.bf-token-symbol{overflow:hidden;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-name{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-row-right{display:flex;min-width:86px;max-width:42%;flex-shrink:0;flex-direction:column;align-items:flex-end}.bf-token-balance,.bf-token-price{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-token-balance{color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-token-price{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-row[data-selected=true] .bf-token-symbol{color:var(--bf-text-high)}.bf-token-row[data-selected=true] .bf-token-balance{color:var(--bf-text-high);font-size:16px}.bf-token-row[data-selected=true] .bf-token-price{color:var(--bf-text-low);font-size:14px}.bf-token-empty{padding:32px 16px;color:var(--bf-text-low);font-size:14px;font-weight:500;line-height:1.5;text-align:center}.bf-slippage-overlay{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-slippage-dialog{display:flex;width:min(480px,calc(100vw - 48px));height:auto;min-height:min(316px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);flex-direction:column;overflow:hidden;border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:24px;background:var(--ds-surface-default, #ffffff);color:var(--ds-content-highest, #000000);box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));box-sizing:border-box}.bf-slippage-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-slippage-head h3{margin:0;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-slippage-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-slippage-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-slippage-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:24px;padding:24px;box-sizing:border-box}.bf-slippage-desc{margin:0;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-controls{display:flex;flex-direction:column;gap:12px;width:100%}.bf-slippage-presets{display:flex;gap:8px;width:100%}.bf-slippage-preset{appearance:none;display:inline-flex;flex:1 1 0;min-width:0;min-height:48px;align-items:center;justify-content:center;padding:12px 8px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-preset:hover,.bf-slippage-preset[data-selected=true]{border-color:var(--ds-accent-primary-default, #ff8438);background:var(--ds-accent-primary-low, #fff5ee)}.bf-slippage-custom{display:flex;min-height:48px;align-items:center;gap:8px;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));box-sizing:border-box}.bf-slippage-custom:focus-within,.bf-slippage-custom[data-selected=true]{border-color:var(--ds-accent-primary-default, #ff8438)}.bf-slippage-custom input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--ds-content-high, rgba(0, 0, 0, .85));font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-custom input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-slippage-custom span:not(.bf-sr-only){flex-shrink:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-apply{appearance:none;margin-top:auto;width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #ff8438);color:var(--ds-accent-primary-on-primary, #ffffff);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-apply:hover{filter:brightness(.96)}.bf-slippage-apply:disabled{cursor:not-allowed;opacity:.5;filter:none}.bf-slippage-message{margin:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-message[data-variant=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-slippage-message[data-variant=error]{color:var(--ds-system-red-default, #da0b2e)}.bf-action-modal-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#040912b8;pointer-events:auto;box-sizing:border-box;animation:bf-overlay-in .18s ease-out}.bf-action-modal-overlay[data-theme=light]{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .08));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .65));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .4))}.bf-action-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;align-items:center;gap:24px;padding:48px 24px 24px;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:#fff;box-shadow:0 24px 80px #00000073;box-sizing:border-box;animation:bf-modal-in .2s cubic-bezier(.16,1,.3,1)}.bf-action-modal-overlay[data-state=closed]{animation:bf-overlay-out .15s ease-in forwards}.bf-action-modal-overlay[data-state=closed] .bf-action-modal{animation:bf-modal-out .15s ease-in forwards}@keyframes bf-overlay-in{0%{opacity:0}}@keyframes bf-overlay-out{to{opacity:0}}@keyframes bf-modal-in{0%{opacity:0;transform:translateY(8px) scale(.96)}}@keyframes bf-modal-out{to{opacity:0;transform:translateY(4px) scale(.98)}}@media(prefers-reduced-motion:reduce){.bf-action-modal-overlay,.bf-action-modal,.bf-action-modal-overlay[data-state=closed],.bf-action-modal-overlay[data-state=closed] .bf-action-modal{animation:none}}.bf-action-modal h3{width:100%;margin:0;color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;text-align:left;letter-spacing:0}.bf-action-modal-desc{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-terms-modal{--bf-terms-accent: #f3742e;padding:24px;gap:24px}.bf-terms-modal h3{font-size:20px;font-weight:600;line-height:1.6;text-align:center}.bf-terms-modal .bf-action-modal-desc{font-size:14px;line-height:1.45}.bf-terms-check-row{display:grid;width:100%;min-height:56px;grid-template-columns:20px minmax(0,1fr);align-items:center;column-gap:12px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.4;box-sizing:border-box}.bf-terms-check-button{appearance:none;display:inline-flex;min-width:0;width:20px;height:20px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-copy{display:flex;width:100%;min-width:0;align-items:baseline;justify-content:space-between;column-gap:12px;row-gap:4px;flex-wrap:wrap}.bf-terms-label{min-width:0;cursor:pointer;touch-action:manipulation}.bf-terms-check-button:focus-visible .bf-terms-checkbox{outline:2px solid var(--ds-accent-primary-default, #f0640d);outline-offset:2px}.bf-terms-checkbox{position:relative;display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;border:1px solid rgba(124,143,180,.72);border-radius:4px;background:transparent;box-sizing:border-box}.bf-terms-checkbox[data-checked=true]{border-color:var(--ds-accent-primary-default, #f0640d);background:var(--ds-accent-primary-default, #f0640d)}.bf-terms-checkbox[data-checked=true]:after{width:8px;height:4px;border:solid #ffffff;border-width:0 0 2px 2px;content:"";transform:rotate(-45deg) translate(1px,-1px)}.bf-terms-check-row a{position:relative;z-index:1;color:var(--ds-accent-primary-default, #f0640d);font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}.bf-terms-check-row a:hover{text-decoration:underline}.bf-terms-privacy{max-width:100%;margin:0;color:var(--bf-text-low);font-size:clamp(8px,2.4vw,12px);white-space:nowrap;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-action-primary,.bf-action-secondary{display:inline-flex;width:100%;min-height:56px;align-items:center;justify-content:center;padding:14px 16px;border:0;border-radius:12px;font:inherit;font-size:18px;font-weight:700;line-height:1.4;letter-spacing:0;cursor:pointer}.bf-action-primary{background:var(--ds-accent-primary-default, #f0640d);color:var(--ds-accent-primary-on, #000000)}.bf-action-primary:disabled{cursor:not-allowed;opacity:.35}.bf-terms-modal .bf-action-primary{min-height:52px;background:var(--bf-terms-accent);color:#fff;font-size:16px;font-weight:600}.bf-terms-modal .bf-action-primary:disabled{background:var(--bf-surface);color:var(--bf-text-low);opacity:1}.bf-action-primary[aria-busy=true]{gap:8px;opacity:1}.bf-action-button-spinner{width:18px;height:18px;border:2px solid rgba(0,0,0,.22);border-top-color:currentColor;border-right-color:currentColor;border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-action-secondary{background:var(--bf-surface);color:var(--bf-text-low)}.bf-action-secondary:disabled{cursor:not-allowed;opacity:.5}.bf-approve-address-box{display:flex;width:100%;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-approve-address-box>span{color:var(--bf-text-low);font-size:14px;font-weight:700;line-height:1.4}.bf-approve-address-box>div{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-approve-address-box strong{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:15px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.bf-copy-button{flex-shrink:0;min-width:48px;min-height:32px;padding:6px 10px;border:1px solid rgba(0,206,178,.65);border-radius:8px;background:transparent;color:var(--ds-accent-primary-default, #f0640d);font:inherit;font-size:12px;font-weight:700;line-height:1.2;cursor:pointer}.bf-copy-button:disabled{cursor:not-allowed;opacity:.45}.bf-action-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:12px}.bf-approval-success-modal{gap:28px}.bf-success-mark{position:relative;display:inline-flex;width:96px;height:96px;flex-shrink:0;align-items:center;justify-content:center;border:12px solid rgba(0,206,178,.12);border-radius:999px;background:#00ceb2a8;box-shadow:0 0 0 10px #00ceb20f;box-sizing:border-box}.bf-success-mark:after{width:34px;height:18px;border:solid #ffffff;border-width:0 0 6px 6px;content:"";transform:rotate(-45deg) translate(2px,-3px)}.bf-status-toast{position:absolute;right:16px;bottom:14px;left:16px;z-index:5;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-toast-bg);color:var(--bf-toast-color);box-shadow:0 8px 24px #0000003d;box-sizing:border-box}.bf-status-toast-icon{display:inline-flex;width:28px;height:28px;flex-shrink:0;align-items:center;justify-content:center;border-radius:999px}.bf-status-spinner{width:20px;height:20px;border:3px solid rgba(255,255,255,.18);border-top-color:var(--ds-accent-primary-default, #f0640d);border-right-color:var(--ds-accent-primary-default, #f0640d);border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-status-check{position:relative;width:20px;height:20px;border-radius:999px;background:var(--ds-system-green-default, #00ceb2)}.bf-status-check:after{position:absolute;top:6px;left:5px;width:8px;height:4px;border:solid var(--ds-system-green-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg)}.bf-status-toast-copy{display:flex;min-width:0;flex:1;flex-direction:column}.bf-status-toast-copy strong,.bf-status-toast-copy span{overflow:hidden;text-overflow:ellipsis}.bf-status-toast-copy strong{color:var(--bf-toast-strong);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-status-toast-copy span{color:var(--bf-toast-color);font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em}.bf-status-toast[data-variant=success] .bf-status-toast-copy span{color:var(--ds-system-green-on-inverted, #00e8c9)}.bf-status-toast[data-variant=error]{border:1px solid rgba(255,43,95,.28);background:var(--bf-toast-bg)}.bf-status-toast[data-variant=error] .bf-status-toast-copy strong{color:var(--bf-toast-strong)}.bf-status-error-mark{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:999px;background:var(--ds-system-red-default, #ff2b5f);color:#fff;font-size:14px;font-weight:700;line-height:1}.bf-status-toast[data-variant=error] .bf-status-toast-copy span{color:var(--bf-toast-color)}.bf-success-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#000000b8;pointer-events:auto;box-sizing:border-box}.bf-success-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-border: rgba(18, 18, 18, .08);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-success-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-success-head{display:flex;min-height:73px;align-items:center;justify-content:space-between;gap:16px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));box-sizing:border-box}.bf-success-head h3{min-width:0;margin:0;overflow:hidden;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.bf-success-close{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-success-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-success-body{display:flex;flex-direction:column;align-items:center;gap:24px;padding:40px 24px 24px;box-sizing:border-box}.bf-success-copy{display:flex;width:100%;flex-direction:column;align-items:center;gap:4px;color:var(--bf-text-medium);text-align:center}.bf-success-copy strong{color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;letter-spacing:0}.bf-success-copy span{color:var(--bf-text-medium);font-size:15px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-success-route{display:flex;align-items:center;justify-content:center;gap:12px}.bf-success-route .bf-token-icon{width:48px!important;height:48px!important;background:transparent;font-size:18px}.bf-success-route-arrow{color:var(--bf-text-low);font-size:24px;font-weight:500;line-height:1}.bf-success-ok{display:inline-flex;width:100%;min-height:48px;align-items:center;justify-content:center;padding:12px;border:0;border-radius:12px;background:#00b4b7e0;color:#fff;font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}@media(max-width:767px){.bf-success-body{padding:40px 24px 24px}.bf-success-copy strong{font-size:22px}.bf-success-copy span{font-size:14px}.bf-success-mark{width:88px;height:88px}.bf-success-route .bf-token-icon{width:44px!important;height:44px!important}}@keyframes bf-loading-spin{to{transform:rotate(360deg)}}.bf-swap-toggle{position:absolute;top:100px;left:50%;z-index:1;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:var(--ds-accent-primary-default, #f0640d);color:var(--ds-accent-primary-on, #000000);box-shadow:0 1px 5px #0000001f;cursor:pointer}.bf-swap-card[data-has-from-error=true] .bf-swap-toggle{top:132px}.bf-details{display:flex;flex-direction:column;gap:24px}.bf-collapse{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows .22s ease,opacity .14s ease,margin-top .22s ease}.bf-collapse[data-open=true]{grid-template-rows:1fr;opacity:1}.bf-collapse:not([data-open=true]){margin-top:calc(-1 * var(--bf-collapse-gap, 0px))}.bf-collapse-inner{overflow:hidden;min-height:0}@keyframes bf-value-in{0%{opacity:.25;transform:translateY(-2px)}}.bf-info-value,.bf-route-amount-value,.bf-route-meta>span{animation:bf-value-in .24s ease-out}@media(prefers-reduced-motion:reduce){.bf-collapse{transition:none}.bf-info-value,.bf-route-amount-value,.bf-route-meta>span{animation:none}}.bf-exchange-rate{display:flex;width:100%;align-items:center;justify-content:center;gap:4px;padding:0 0 24px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-detail-section,.bf-history-card{display:flex;flex-direction:column;gap:12px;padding:0;border-radius:12px;background:transparent;box-sizing:border-box}.bf-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-root[data-view=history] .bf-liquidity,.bf-root[data-view=history] .bf-detail-section,.bf-root[data-view=history] .bf-history-card{background:var(--ds-surface-default, #ffffff)}.bf-detail-section h3{margin:0;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-tx-fee-section{gap:12px}.bf-tx-fee-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-collapse-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin:0;padding:0;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.bf-detail-section[data-open=true] .bf-collapse-head{padding-bottom:12px;border-bottom:1px solid var(--bf-border)}.bf-collapse-chevron{flex-shrink:0;color:var(--bf-text-low);transition:transform .2s ease}.bf-detail-section[data-open=true] .bf-collapse-chevron{transform:rotate(180deg)}.bf-collapse-body{display:flex;flex-direction:column;gap:14px}.bf-root[data-view=history] .bf-detail-section[data-open=true] .bf-collapse-head{border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07))}.bf-root[data-view=history] .bf-collapse-chevron{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-tx-fee-total{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--bf-text-medium);font-size:14px;font-weight:600;line-height:1.4;text-align:right}.bf-tx-fee-total>span[data-delegated=true]{text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:currentColor}.bf-fee-delegated{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:2px 8px;border-radius:6px;background:#379cff2e;color:#4eb3ff;font-size:10px;font-weight:500;line-height:1.3;white-space:nowrap}.bf-tx-fee-token{width:16px;height:16px;flex-shrink:0;border-radius:999px;object-fit:cover}.bf-info-card{gap:14px}.bf-info-section{display:flex;flex-direction:column;gap:10px}.bf-info-section+.bf-info-section{padding-top:2px}.bf-info-section h4{margin:0;color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5}.bf-root[data-view=history] .bf-detail-section h3,.bf-root[data-view=history] .bf-info-section h4{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-route-steps{display:flex;flex-direction:column}.bf-route-step{display:grid;min-width:0;grid-template-columns:18px minmax(0,1fr);column-gap:10px}.bf-route-rail{position:relative;display:flex;justify-content:center}.bf-route-line{position:absolute;top:9px;bottom:-4px;width:1px;background:var(--bf-border)}.bf-route-step[data-last=true] .bf-route-line{display:none}.bf-route-dot{z-index:1;width:9px;height:9px;margin-top:5px;border:2px solid var(--bf-text-low);border-radius:999px;background:var(--bf-bg);box-sizing:border-box}.bf-route-dot[data-final=true]{border-color:var(--ds-accent-primary-default, #00ceb2)}.bf-route-body{display:flex;min-width:0;flex-direction:column;gap:2px;padding-bottom:14px}.bf-route-step[data-last=true] .bf-route-body{padding-bottom:0}.bf-route-head{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-route-title{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:13px;font-weight:620;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.bf-route-amount{display:inline-flex;flex-shrink:0;align-items:center;gap:4px;color:var(--bf-text-medium);font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}.bf-route-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;color:var(--bf-text-low);font-size:12px;line-height:1.45;font-variant-numeric:tabular-nums}.bf-route-step[data-kind=hop] .bf-route-title{color:var(--bf-text-medium);font-weight:600}.bf-route-step[data-kind=hop] .bf-route-amount{color:var(--bf-text-low);font-weight:500}.bf-route-step[data-kind=hop] .bf-route-dot{width:7px;height:7px;margin-top:6px;border-width:1px}.bf-route-meta>span[data-tone=accent]{color:var(--ds-accent-primary-default, #00ceb2);font-weight:600}.bf-route-meta>span[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00);font-weight:600}.bf-route-meta>span[data-tone=danger]{color:var(--ds-system-red-default, #da0b2e);font-weight:600}.bf-route-tag{padding:1px 6px;border-radius:5px;background:var(--ds-accent-primary-low, rgba(0, 206, 178, .12));color:var(--ds-accent-primary-high, #00a0a2);font-size:10px;font-weight:700;letter-spacing:.01em}.bf-info-rows{display:flex;flex-direction:column;gap:8px}.bf-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-liquidity-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-info-label{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--bf-text-low)}.bf-info-value{display:flex;min-width:0;align-items:center;justify-content:flex-end;gap:4px;color:var(--bf-text-medium);text-align:right}.bf-info-route,.bf-info-value-token{display:inline-flex;align-items:center;gap:4px}.bf-info-route .bf-token-icon,.bf-info-value-token .bf-token-icon{flex-shrink:0}.bf-info-route-arrow{display:inline-flex;align-items:center;color:var(--bf-text-medium);font-size:12px;line-height:1}.bf-root[data-view=history] .bf-info-route-arrow{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #f0640d)}.bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-info-value[data-tone=danger]{color:var(--ds-system-red-default, #da0b2e)}.bf-root[data-view=history] .bf-info-label,.bf-root[data-view=history] .bf-liquidity-head{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-root[data-view=history] .bf-info-value{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-root[data-view=history] .bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #f0640d)}.bf-root[data-view=history] .bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-root[data-view=history] .bf-info-value[data-tone=danger]{color:var(--ds-system-red-default, #da0b2e)}.bf-liquidity-status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.4;white-space:nowrap}.bf-liquidity-status:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}.bf-liquidity-status[data-status=normal],.bf-liquidity-status:not([data-status]){background:#00ceb21f;color:var(--ds-accent-primary-default, #f0640d)}.bf-liquidity-status[data-status=normal]:before,.bf-liquidity-status:not([data-status]):before{background:var(--ds-accent-primary-default, #f0640d)}.bf-liquidity-status[data-status=low]{background:#e56f001f;color:#e56f00}.bf-liquidity-status[data-status=low]:before{background:#e56f00}.bf-liquidity-status[data-status=rebalancing]{background:#da0b2e1a;color:#da0b2e}.bf-liquidity-status[data-status=rebalancing]:before{background:#da0b2e}.bf-liquidity-track{height:8px;overflow:hidden;border-radius:999px;background:var(--bf-surface-hover)}.bf-liquidity-track span{display:block;height:100%;border-radius:inherit;background:var(--ds-accent-primary-default, #f0640d)}.bf-error{padding:12px;border-radius:12px;background:#da0b2e1f;color:var(--ds-system-red-default, #da0b2e);font-size:13px;line-height:1.4}.bf-footer{display:flex;flex-shrink:0;flex-direction:column;align-items:center;gap:10px;padding:12px 24px 24px;background:var(--ds-bg-default, var(--bf-bg))}.bf-next{width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #f0640d);color:var(--ds-accent-primary-on, #000000);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-next:disabled{cursor:default;opacity:.6}.bf-powered{display:inline-flex;align-items:center;gap:3px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-decoration:none}.bf-powered:focus-visible{border-radius:4px;outline:2px solid var(--ds-accent-primary-default, #f0640d);outline-offset:2px}.bf-powered-brand{text-decoration:underline;text-underline-offset:2px}.bf-history-tabs{display:flex;align-items:center;gap:4px;width:100%}.bf-history-tab{position:relative;display:inline-flex;min-height:37px;align-items:center;justify-content:center;padding:8px 12px;border:0;background:transparent;color:var(--ds-content-lowest, rgba(0, 0, 0, .25));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;cursor:pointer}.bf-history-tab[data-active=true]{color:var(--ds-accent-primary-high, #f0640d)}.bf-history-tab[data-active=true]:after{position:absolute;right:8px;bottom:0;left:8px;height:3px;border-radius:999px;background:var(--ds-accent-primary-high, #f0640d);content:""}.bf-history-tab-dot{position:absolute;top:8px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-history-list{display:flex;flex-direction:column;gap:12px}.bf-history-item{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-history-item-head,.bf-history-meta,.bf-history-route,.bf-history-route-token{display:inline-flex;align-items:center}.bf-history-item-head{justify-content:space-between;gap:12px;width:100%}.bf-history-status{display:inline-flex;min-height:24px;align-items:center;justify-content:center;padding:3px 8px;border-radius:4px;background:var(--ds-system-orange-low, #fcf5e9);color:var(--ds-system-orange-high, #e56f00);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;white-space:nowrap}.bf-history-status[data-status=completed]{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.bf-history-status[data-status=failed]{background:var(--ds-system-red-low, rgba(218, 11, 46, .12));color:var(--ds-system-red-default, #da0b2e)}.bf-history-time{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-align:right;white-space:nowrap}.bf-history-item-body{display:flex;flex-direction:column;gap:4px}.bf-history-amount{color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-meta{justify-content:space-between;gap:12px;min-width:0}.bf-history-usd{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route{justify-content:flex-end;gap:4px;min-width:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-route-token{gap:4px;min-width:0}.bf-history-route-token span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route-arrow{flex-shrink:0;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-empty{padding:32px 16px;text-align:center;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:14px}.bf-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:767px){.bf-slippage-overlay{align-items:flex-end;padding:0}.bf-slippage-dialog{width:100%;height:auto;min-height:316px;max-height:82dvh;border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}}.wi-drawer-content .bf-header{padding:16px}.wi-drawer-content .bf-header .bf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .bf-body,.wi-drawer-content .bf-history-body{padding:16px}.bf-root[data-variant=embedded]{--bf-bg: #1c1c1d;--bf-surface: #212224;--bf-surface-hover: rgba(255, 255, 255, .08);--bf-border: rgba(255, 255, 255, .1);--bf-text-high: rgba(255, 255, 255, .85);--bf-text-medium: rgba(255, 255, 255, .65);--bf-text-low: rgba(255, 255, 255, .4);--bf-embedded-primary: #f3742e;--bf-embedded-on-primary: #ffffff;background:var(--bf-bg);color:#fff}.gou-shell[data-theme=light] .bf-root[data-variant=embedded]{--bf-bg: #ffffff;--bf-surface: #ffffff;--bf-surface-hover: rgba(0, 0, 0, .03);--bf-border: rgba(0, 0, 0, .06);--bf-text-high: rgba(0, 0, 0, .85);--bf-text-medium: rgba(0, 0, 0, .65);--bf-text-low: rgba(0, 0, 0, .4);color:#000}.bf-root[data-variant=embedded] .bf-header{min-height:64px;justify-content:flex-start;gap:12px;padding:16px 20px 12px;border-bottom-color:var(--bf-border);background:var(--bf-bg)}.bf-root[data-variant=embedded] .bf-header .bf-header-btn:last-child{top:16px;right:20px}.bf-root[data-variant=embedded] .bf-header-btn{color:var(--bf-text-medium)}.bf-root[data-variant=embedded] .bf-header-title{position:static;flex:1;padding-right:36px;transform:none;color:var(--bf-text-high);font-size:18px;font-weight:600;line-height:1.5;text-align:left}.bf-root[data-variant=embedded] .bf-header-spacer{display:none}.bf-root[data-variant=embedded] .bf-embedded-body{padding:20px}.bf-embedded-form{display:flex;width:100%;min-width:0;flex-direction:column;gap:20px;--bf-collapse-gap: 20px}.bf-embedded-fields{position:relative;display:flex;width:100%;flex-direction:column}.bf-embedded-field-group{display:flex;width:100%;flex-direction:column;gap:8px}.bf-embedded-amount-panel{display:flex;width:100%;min-width:0;flex-direction:column;padding:16px;border:1px solid rgba(255,255,255,.025);border-radius:12px;background:#212224;box-sizing:border-box}.gou-shell[data-theme=light] .bf-embedded-amount-panel{border-color:#00000014;background:#fff}.bf-embedded-amount-head{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.bf-embedded-amount-label{display:inline-flex;min-width:0;align-items:center;gap:8px;white-space:nowrap}.bf-embedded-amount-label strong{color:var(--bf-text-medium);font-size:14px;font-weight:700;line-height:1.5}.bf-embedded-amount-label>span{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5}.bf-embedded-amount-label em{padding:2px 6px;border-radius:9999px;background:#f3742e1a;color:var(--bf-embedded-primary);font-size:11px;font-style:normal;font-weight:500;line-height:1.25}.bf-embedded-balance{display:inline-flex;min-width:0;max-width:100%;flex-shrink:1;align-items:center;justify-content:flex-end;gap:6px;overflow:hidden;color:var(--bf-text-medium);font-size:12px;font-weight:600;line-height:1.5;text-align:right;white-space:nowrap}.bf-embedded-balance>svg,.bf-embedded-balance>span:not(.bf-embedded-balance-value){flex-shrink:0}.bf-embedded-balance-value{min-width:0;overflow:hidden;text-overflow:ellipsis}.bf-embedded-balance button{flex-shrink:0;padding:2px 8px;border:0;border-radius:9999px;background:#f3742e26;color:var(--bf-embedded-primary);font:inherit;font-size:11px;font-weight:700;line-height:1.4;cursor:pointer}.bf-embedded-balance button:hover{background:#f3742e40}.bf-embedded-amount-main{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-embedded-token-pill{display:inline-flex;height:32px;flex-shrink:0;align-items:center;gap:6px;padding:0 12px 0 6px;border:1px solid rgba(255,255,255,.1);border-radius:9999px;background:#ffffff0d;color:#fff;font:inherit;font-size:14px;font-weight:700;line-height:1.5;cursor:pointer;perspective:220px;overflow:hidden;transition:transform .12s ease,background .15s ease}.gou-shell[data-theme=light] .bf-embedded-token-pill{border-color:#0000000f;background:#00000008;color:#000}.bf-embedded-token-pill:disabled{cursor:default;opacity:1}.bf-embedded-input-wrap{display:flex;min-width:0;flex:1}.bf-embedded-amount-input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:#fff;font:inherit;font-size:24px;font-size:clamp(18px,6cqi,24px);font-weight:700;line-height:32px;text-align:right}.gou-shell[data-theme=light] .bf-embedded-amount-input{color:#000}.bf-embedded-amount-input[data-size=medium]{font-size:20px;font-size:clamp(16px,5cqi,20px);line-height:28px}.bf-embedded-amount-input[data-size=small]{font-size:16px;font-size:clamp(14px,4cqi,16px);line-height:24px}.bf-embedded-amount-input::placeholder{color:var(--bf-text-low);opacity:1}.bf-embedded-field-error{color:#ff3c53;font-size:12px;font-weight:400;line-height:1.5}.bf-embedded-direction{position:relative;z-index:10;display:flex;width:100%;align-items:center;justify-content:center;margin:-12px 0}.bf-embedded-direction>span{display:inline-flex;width:36px;height:36px;align-items:center;justify-content:center;border-radius:9999px;background:var(--bf-embedded-primary);color:var(--bf-embedded-on-primary)}.bf-embedded-summary{display:flex;width:100%;flex-direction:column;gap:12px}.bf-embedded-details{display:flex;width:100%;flex-direction:column;gap:16px;padding:0 16px 16px;box-sizing:border-box}.bf-embedded-details .bf-info-section{gap:12px}.bf-embedded-details .bf-info-section+.bf-info-section{padding-top:0}.bf-embedded-details .bf-info-section h4{color:#fffc;font-size:14px;font-weight:700}.gou-shell[data-theme=light] .bf-embedded-details .bf-info-section h4{color:#000c}.bf-embedded-details .bf-info-rows{gap:12px}.bf-embedded-details .bf-info-row{min-height:20px;font-size:13px;font-weight:600}.bf-embedded-details .bf-info-label{gap:6px;color:var(--bf-text-medium);font-size:13px;font-weight:400}.bf-embedded-details .bf-info-value{color:var(--bf-text-medium);font-size:13px;font-weight:600}.bf-embedded-details .bf-info-value[data-tone=accent]{color:var(--bf-embedded-primary)}.bf-embedded-details .bf-info-route-arrow{color:var(--bf-text-medium)}.bf-embedded-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface)}.bf-embedded-liquidity>div{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--bf-text-medium);font-size:14px}.bf-embedded-liquidity>div>span:last-child{text-transform:capitalize}.bf-embedded-liquidity-track{display:block;height:8px;overflow:hidden;border-radius:9999px;background:var(--bf-surface-hover)}.bf-embedded-liquidity-track>span{display:block;height:100%;border-radius:inherit;background:var(--bf-embedded-primary)}.bf-embedded-liquidity-error{padding:12px 16px;border:1px solid rgba(255,60,83,.3);border-radius:8px;background:#ff3c531a;color:#ff3c53;font-size:14px;line-height:1.5;text-align:center}.bf-embedded-action-footer{width:100%;flex-shrink:0}.bf-embedded-cta{display:flex;width:100%;height:52px;flex-shrink:0;align-items:center;justify-content:center;padding:0 16px;border:0;border-radius:12px;background:var(--bf-embedded-primary);color:var(--bf-embedded-on-primary);font:inherit;font-size:16px;font-weight:600;line-height:1.5;cursor:pointer;transition:opacity .15s ease,background-color .15s ease;box-sizing:border-box}.bf-embedded-cta:hover:not(:disabled){background:#f3742ee6}.bf-embedded-cta:disabled{cursor:not-allowed;opacity:.6}.bf-embedded-spinner{width:20px;height:20px;border:2px solid var(--bf-embedded-on-primary);border-top-color:transparent;border-radius:9999px;animation:bf-loading-spin .9s linear infinite}@media(max-width:767px){.bf-root[data-variant=embedded] .bf-header{min-height:50px;padding:12px 16px 8px;border-bottom:0}.bf-root[data-variant=embedded] .bf-header .bf-header-btn:last-child{display:none}.bf-root[data-variant=embedded] .bf-embedded-body{padding:12px 16px calc(env(safe-area-inset-bottom,0px) + 12px);overscroll-behavior:contain;scroll-padding-bottom:calc(env(safe-area-inset-bottom,0px) + 76px);-webkit-overflow-scrolling:touch}.bf-root[data-variant=embedded] .bf-embedded-action-footer{position:sticky;bottom:0;z-index:20;padding-top:12px;background:var(--bf-bg);isolation:isolate}.bf-root[data-variant=embedded] .bf-embedded-action-footer:after{position:absolute;z-index:-1;top:100%;right:0;left:0;height:calc(env(safe-area-inset-bottom,0px) + 32px);background:var(--bf-bg);box-shadow:0 16px 0 16px var(--bf-bg);content:"";pointer-events:none}.bf-root[data-variant=embedded][data-soft-keyboard-open=true] .bf-embedded-action-footer{position:static;padding-top:0}.bf-root[data-variant=embedded][data-soft-keyboard-open=true] .bf-embedded-action-footer:after{display:none}.bf-root[data-variant=embedded][data-soft-keyboard-open=true] .bf-embedded-body{scroll-padding-bottom:24px}.bf-embedded-amount-head{gap:8px}.bf-embedded-amount-label{gap:6px}.bf-embedded-balance{gap:4px}}
11
+ `);import{Fragment as Ho,jsx as v,jsxs as D}from"react/jsx-runtime";var ff=se.createContext(void 0);function ki(){return se.useContext(ff)}function T1(e){let[t,r]=se.useState(void 0);return se.useEffect(()=>{let n=e.current;if(!n)return;let o=()=>{let a=n.closest("[data-theme]");r(a?.getAttribute("data-theme")??void 0)};o();let i=new MutationObserver(o);return i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>i.disconnect()},[e]),t}var lf=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],I1=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function E1(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function df(e){let t=e.replace(/[^\d.]/g,""),[r="",...n]=t.split("."),o=n.join("");return n.length===0?r:`${r}.${o.slice(0,2)}`}function mf(e){return`${e.chainId}:${e.address.toLowerCase()}`}function gf(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function cf(e,t){let r=Number(e||"0"),n=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(r)?r*n:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function A1(e,t=6){if(!e)return e;let[r,n=""]=e.split(".");if(!n)return r;let o=n.slice(0,t).replace(/0+$/,"");return o?`${r}.${o}`:r}function hf(e,t){if(!t)return!1;let r=pt(e),n=pt(t.balance);return!r||!n?!1:r.isGreaterThan(n)}function wi(e){if(!e.isFinite()||e.isNaN())return"0";let r=e.decimalPlaces(6,sf.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[n="0",o]=r.split("."),i=new sf(n||"0").toFormat(0);return o?`${i}.${o}`:i}function M1(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function L1(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let r=n=>n.toString().padStart(2,"0");return[`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}`,`${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`].join(" ")}function D1(e){let t=pt(e);return t?wi(t):e||"0"}function P1(e,t){if(t?.priceUsd===void 0)return null;let r=pt(e);if(!r)return null;let n=r.multipliedBy(t.priceUsd);return n.isFinite()?`$${n.toFormat(2)}`:null}function is(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function O1(e,t){return t==="all"?!0:is(e)===t}function B1(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function Wo(e){return e===56||e===97?"BSC":e===612044||e===612055||e===5555?"ONEchain":`Chain ${e}`}function bf(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function wf(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":bf(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function yf(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function ts(e){return!e||e==="0"||Number(e)===0}function xf(e){let t=e.trim().toLowerCase();return t?t.startsWith("minimum ")?{from:e}:t.startsWith("available ")&&t.includes("or more")?{to:e}:t.includes("insufficient balance")||t.includes("not enough balance")||t.includes("exceeds balance")||t.includes("insufficient network fee")?{from:e}:t.includes("insufficient liquidity")||t.includes("not enough liquidity")?{to:e}:{}:{}}function vf(e){let t=e.fromToken,r=e.toToken,n=wf(t,r),o=e.fromAmount||"0",i=e.toAmount||"0",a=n!==void 0&&!yf(n),s=n!==void 0&&n!=="bridge";return{pathType:n,bridgeInfo:a?[{label:"Route",value:t&&r?`${Wo(t.chainId)} \u2192 ${Wo(r.chainId)}`:"-"},{label:"Validator Fee",value:ts(o)?"0":"Free",tone:ts(o)?"default":"accent"},{label:"Network Fee",value:ts(o)?"0":"Free",tone:ts(o)?"default":"accent"}]:void 0,swapInfo:s?[t&&r?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:r.symbol,iconUrl:r.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:o,valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Swap Fee",value:"0",valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Out Amount",value:i,valueToken:r?{symbol:r.symbol,iconUrl:r.iconUrl}:void 0}]:void 0,txFee:[{label:"Priority Fee Per Gas",value:"0 Gwei"},{label:"Max Fee Per Gas",value:"0 Gwei"},{label:"Gas Limit",value:"0"}],txFeeInfo:{estTxFee:"0",isDelegateFee:!1}}}function yi({token:e,size:t=20}){let r=e?.iconUrl;return v("span",{className:"bf-token-icon","data-has-image":!!r?"true":"false",style:{width:t,height:t},children:r?v("img",{src:r,alt:"",width:t,height:t,draggable:!1}):v("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function rs(e,t){if(e.length===0)return;let r=e.findIndex(n=>bf(n,t));return e[(r+1)%e.length]}function pf({label:e,token:t,amount:r,usd:n,onAmountChange:o,onTokenClick:i,locked:a=!1}){return D("section",{className:"bf-amount-panel",children:[D("div",{className:"bf-amount-head",children:[v("span",{children:e}),D("span",{className:"bf-balance",children:[gf(t?.balance??"0")," ",t?.symbol??""]})]}),D("div",{className:"bf-amount-main",children:[D("label",{className:"bf-amount-input-wrap",children:[D("span",{className:"bf-sr-only",children:[e," amount"]}),v("input",{type:"text",inputMode:"decimal",value:r,onChange:s=>o(s.target.value),placeholder:"0",className:"bf-amount-input","data-size":kf(r)}),v("span",{className:"bf-amount-usd",children:n})]}),D("button",{type:"button",className:"bf-token-pill",onClick:a?void 0:i,disabled:!a&&!i,"data-locked":a?"true":void 0,"data-track":a?void 0:"token_switch","data-track-id":e.toLowerCase(),"aria-label":`Switch ${e.toLowerCase()} token`,children:[D("span",{className:"bf-token-pill-face",children:[v(yi,{token:t}),v("span",{children:t?.symbol??"Select"})]},t?mf(t):"none"),!a&&v(Lr,{size:16})]})]})]})}function z1(e){if(!e)return"";let[t="",r]=e.replace(/,/g,"").split("."),n=t.replace(/\B(?=(\d{3})+(?!\d))/g,",");return r===void 0?n:`${n}.${r}`}function kf(e){let t=e.replace(/,/g,"").trim().length;return t>26?"small":t>18?"medium":"large"}function F1(){return D("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[v("path",{d:"M2.333 4.667A1.667 1.667 0 0 1 4 3h7.333A1.667 1.667 0 0 1 13 4.667v6.666A1.667 1.667 0 0 1 11.333 13H4a1.667 1.667 0 0 1-1.667-1.667V4.667Z",stroke:"currentColor",strokeWidth:"1.25"}),v("path",{d:"M2.667 5.333h9.666c.737 0 1.334.597 1.334 1.334v2.666c0 .737-.597 1.334-1.334 1.334H9.667A2.667 2.667 0 0 1 7 8a2.667 2.667 0 0 1 2.667-2.667Z",stroke:"currentColor",strokeWidth:"1.25"}),v("circle",{cx:"10",cy:"8",r:".75",fill:"currentColor"})]})}function uf({label:e,token:t,amount:r,onAmountChange:n,onTokenClick:o,onMax:i,locked:a}){return D("section",{className:"bf-embedded-amount-panel",children:[D("div",{className:"bf-embedded-amount-head",children:[D("span",{className:"bf-embedded-amount-label",children:[v("strong",{children:e}),!(e==="From")&&v("em",{children:"estimated"})]}),t&&D("span",{className:"bf-embedded-balance",children:[v(F1,{}),v("span",{className:"bf-embedded-balance-value",children:gf(t.balance)}),v("span",{children:t.symbol}),i&&v("button",{type:"button",onClick:i,"aria-label":"Use maximum available balance",children:"MAX"})]})]}),D("div",{className:"bf-embedded-amount-main",children:[D("button",{type:"button",className:"bf-embedded-token-pill",onClick:a?void 0:o,disabled:a,"data-locked":a?"true":void 0,"aria-label":`Switch ${e.toLowerCase()} token`,children:[D("span",{className:"bf-token-pill-face",children:[v(yi,{token:t}),v("span",{children:t?.symbol??"Select"})]},t?mf(t):"none"),!a&&v(Lr,{size:14})]}),D("label",{className:"bf-embedded-input-wrap",children:[D("span",{className:"bf-sr-only",children:[e," amount"]}),v("input",{type:"text",inputMode:"decimal",value:z1(r),onChange:l=>n(l.target.value),placeholder:"0.00",className:"bf-embedded-amount-input","data-size":kf(r)})]})]})]})}function U1({flow:e,onClose:t}){let r=se.useId(),[n,o]=se.useState(null),i=lf.find(g=>g.value===e.slippage),[a,s]=se.useState(e.slippage&&!i?e.slippage:""),l=a.trim()!==""&&a.trim()!==".",d=l?Number(a):NaN,c=Number.isFinite(d)&&d>50,b=Number.isFinite(d)&&d>5&&!c,f=g=>{e.setSlippage(g),t()},m=()=>{!l||c||(e.setSlippage(df(a)),t())};if(se.useEffect(()=>{o(document.body)},[]),se.useEffect(()=>{let g=u=>{u.key==="Escape"&&t()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[t]),!n)return null;let y=ki();return vi(v("div",{className:"bf-slippage-overlay","data-theme":y,role:"presentation",onMouseDown:g=>{g.target===g.currentTarget&&t()},children:D("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,children:[D("header",{className:"bf-slippage-head",children:[v("h3",{id:r,children:"Slippage Settings"}),v("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:v(Nr,{size:24})})]}),D("div",{className:"bf-slippage-body",children:[v("p",{className:"bf-slippage-desc",children:"The maximum price difference you are willing to accept before the transaction is reverted. Higher slippage increases the chance of execution but may result in a worse price."}),D("div",{className:"bf-slippage-controls",children:[v("div",{className:"bf-slippage-presets",children:lf.map(g=>v("button",{type:"button",className:"bf-slippage-preset","data-selected":!l&&e.slippage===g.value?"true":"false",onClick:()=>f(g.value),children:g.label},g.value))}),D("label",{className:"bf-slippage-custom","data-selected":l?"true":"false",children:[v("span",{className:"bf-sr-only",children:"Custom slippage percent"}),v("input",{value:a,onChange:g=>{s(df(g.target.value))},onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),m())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),v("span",{"aria-hidden":"true",children:"%"})]})]}),c?v("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):b?v("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,l&&v("button",{type:"button",className:"bf-slippage-apply",onClick:m,disabled:c,children:"Apply"})]})]})}),n)}function Rf({flow:e,env:t}){let r=se.useId(),[n,o]=se.useState(!1),[i,a]=se.useState(null),s=ki(),l=Ut("apps.json",t,f=>Mr(f?.legal?.termsUrl,t)),d=e.termsUrl??l??Tc;se.useEffect(()=>{a(document.body)},[]),se.useEffect(()=>{let f=m=>{m.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e]);let[c,b]=Ja(e.termsOpen);return!i||!c?null:vi(v("div",{className:"bf-action-modal-overlay","data-theme":s,"data-state":b,role:"presentation",onPointerDown:f=>{f.target===f.currentTarget&&e.cancelTerms()},children:D("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":r,children:[v("h3",{id:r,children:"Agree to Terms of Service"}),v("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using ONEUSD."}),D("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[v("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,"aria-label":"Agree to Terms of Use","data-track":"terms_check",onClick:()=>o(f=>!f),children:v("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"})}),D("div",{className:"bf-terms-copy",children:[v("span",{className:"bf-terms-label",onClick:()=>o(f=>!f),children:"Agree to Terms of Use"}),d&&v("a",{href:d,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]})]}),v("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use ONEUSD"}),v("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,"data-track":"terms_confirm",children:"Confirm"})]})}),i)}function j1({value:e,disabled:t=!1}){let[r,n]=se.useState(!1);return v("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)})},children:r?"OK":"Copy"})}function Cf({flow:e,approval:t}){let r=se.useId(),[n,o]=se.useState(null),i=ki();se.useEffect(()=>{o(document.body)},[]),se.useEffect(()=>{if(!t)return;let c=b=>{e.status!=="submitting"&&b.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e,t]);let[a,s]=Ja(t);if(!n||!a)return null;let l=e.status==="submitting"||!e.approveBridge,d=e.status==="submitting";return vi(v("div",{className:"bf-action-modal-overlay","data-theme":i,"data-state":s,role:"presentation",children:D("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":r,children:[D("h3",{id:r,children:["Approve ",a.token.symbol]}),v(yi,{token:a.token,size:72}),D("div",{className:"bf-approve-address-box",children:[v("span",{children:"Token Address"}),D("div",{children:[v("strong",{children:a.tokenAddress}),v(j1,{value:a.tokenAddress,disabled:d})]})]}),D("div",{className:"bf-action-buttons",children:[v("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),D("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:l,"aria-busy":d,"data-track":"approve_confirm",children:[d&&v("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),v("span",{children:d?"Approving...":"Approve"})]})]})]})}),n)}function Sf({flow:e}){let t=se.useId(),[r,n]=se.useState(null),o=ki();se.useEffect(()=>{n(document.body)},[]),se.useEffect(()=>{if(!e.approvalSuccessOpen)return;let l=d=>{d.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]);let[i,a]=Ja(e.approvalSuccessOpen);if(!r||!i)return null;let s=e.status==="submitting";return vi(v("div",{className:"bf-action-modal-overlay","data-theme":o,"data-state":a,role:"presentation",children:D("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[v("h3",{id:t,children:"Approval Success"}),v("span",{className:"bf-success-mark","aria-hidden":"true"}),D("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",v("br",{}),"Please continue to the next step."]}),D("div",{className:"bf-action-buttons",children:[v("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:s,children:"Cancel"}),D("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,disabled:s,"aria-busy":s,children:[s&&v("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),v("span",{children:s?"Continuing...":"Continue"})]})]})]})}),r)}function W1({fromAmount:e,toAmount:t,fromToken:r,toToken:n}){let o=se.useMemo(()=>{let a=pt(e),s=pt(t);return!a||!s||a.lte(0)||s.lte(0)?null:s.dividedBy(a)},[e,t]),i=!!(o&&r&&n&&r.symbol!==n.symbol);return v(bi,{open:i,children:D("div",{className:"bf-exchange-rate",children:[D("span",{children:["1 ",r?.symbol]}),v("span",{"aria-hidden":"true",children:"="}),D("span",{children:[o?wi(o):""," ",n?.symbol]})]})})}function Nf({flow:e}){return e.submitToast?D("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[v("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:v("span",{className:"bf-status-spinner"})}),D("span",{className:"bf-status-toast-copy",children:[v("strong",{children:"Transaction Processing"}),v("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function Tf({message:e}){let[t,r]=se.useState(!1);return se.useEffect(()=>{if(!e){r(!1);return}r(!0);let n=window.setTimeout(()=>{r(!1)},3500);return()=>window.clearTimeout(n)},[e]),!e||!t?null:D("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[v("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:v("span",{className:"bf-status-error-mark",children:"!"})}),D("span",{className:"bf-status-toast-copy",children:[v("strong",{children:"Error"}),v("span",{children:e})]})]})}function G1(e){switch(e){case"swap":case"deposit-swap":case"swap-withdraw":return"Swap Transaction Sent";case"bridge":return"Bridge Transaction Sent";case"swap-bridge":return"Swap & Bridge Transaction Sent";case"bridge-swap":return"Bridge & Swap Transaction Sent";default:return"Transaction Sent"}}function If({flow:e}){let t=se.useId(),[r,n]=se.useState(null),o=e.submitted,i=ki();return se.useEffect(()=>{n(document.body)},[]),se.useEffect(()=>{if(!e.successDialogOpen)return;let a=s=>{s.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!r||!e.successDialogOpen||!o?null:vi(v("div",{className:"bf-success-overlay","data-theme":i,role:"presentation",children:v("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:D("div",{className:"bf-success-body",children:[v("span",{className:"bf-success-mark","aria-hidden":"true"}),D("div",{className:"bf-success-copy",children:[v("strong",{id:t,children:G1(o.pathType)}),v("span",{children:"Please check the results in the history."})]}),v("div",{className:"bf-success-route","aria-hidden":"true",children:(o.routeTokens&&o.routeTokens.length>0?o.routeTokens:[{symbol:o.fromToken.symbol,iconUrl:o.fromToken.iconUrl},{symbol:o.toToken.symbol,iconUrl:o.toToken.iconUrl}]).map((a,s)=>D(se.Fragment,{children:[s>0&&v("span",{className:"bf-success-route-arrow",children:"\u2192"}),v(xi,{token:a,size:43})]},`${a.symbol}-${s}`))}),v("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,"data-track":"success_ok",children:"OK"})]})})}),r)}function xi({token:e,size:t=16}){let r=!!e.iconUrl;return v("span",{className:"bf-token-icon","data-has-image":r?"true":"false",style:{width:t,height:t},children:e.iconUrl?v("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):v("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function H1({row:e}){return e.routeTokens&&e.routeTokens.length>0?v("span",{className:"bf-info-route",children:e.routeTokens.map((t,r)=>D(se.Fragment,{children:[r>0&&v("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),v(xi,{token:t})]},`${t.symbol}-${r}`))}):e.valueToken?D("span",{className:"bf-info-value-token",children:[v(xi,{token:e.valueToken}),v("span",{children:e.value})]}):v(Ho,{children:e.value})}function Ef({rows:e}){return!e||e.length===0?null:v("div",{className:"bf-info-rows",children:e.map(t=>D("div",{className:"bf-info-row",children:[v("span",{className:"bf-info-label",children:t.label}),v("span",{className:"bf-info-value","data-tone":t.tone??"default",children:v(H1,{row:t})})]},`${t.label}-${t.value}`))})}function _1(e,t,r){return e.pathType==="bridge"?"Bridge Info":yf(e.pathType)?"Swap Info":t&&r?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function bi({open:e,className:t,children:r}){let n=se.useRef(null);return e&&(n.current=r),v("div",{className:t?`bf-collapse ${t}`:"bf-collapse","data-open":e?"true":"false","aria-hidden":e?void 0:!0,children:v("div",{className:"bf-collapse-inner",children:e?r:n.current})})}function Q1({summary:e,from:t,to:r,feeDelegated:n}){let o=!!e.bridgeInfo?.length,i=!!e.swapInfo?.length,a=!!e.txFee?.length,s=_1(e,o,i),[l,d]=se.useState(!0),[c,b]=se.useState(!0);return D("div",{className:"bf-details",children:[e.liquidity&&D("section",{className:"bf-liquidity",children:[D("div",{className:"bf-liquidity-head",children:[v("span",{children:e.liquidity.label??"Available Liquidity"}),v("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),v("div",{className:"bf-liquidity-track",children:v("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(o||i)&&D("section",{className:"bf-detail-section bf-info-card","data-open":l?"true":"false",children:[D("button",{type:"button",className:"bf-collapse-head","aria-expanded":l,onClick:()=>d(f=>!f),"data-track":"details_toggle",children:[v("h3",{children:s}),v(Lr,{size:16,className:"bf-collapse-chevron"})]}),l&&v("div",{className:"bf-collapse-body",children:v(Lf,{summary:e,from:t,to:r,feeDelegated:n})})]}),a&&D("section",{className:"bf-detail-section bf-tx-fee-section","data-open":c?"true":"false",children:[D("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":c,onClick:()=>b(f=>!f),"data-track":"details_toggle",children:[v("h3",{children:"Est. Tx Fee"}),D("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&v("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&v("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),v("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:A1(e.txFeeInfo?.estTxFee??"0")}),v(Lr,{size:16,className:"bf-collapse-chevron"})]})]}),c&&v("div",{className:"bf-collapse-body",children:v(Ef,{rows:e.txFee})})]})]})}function V1(e){return{...e,bridgeInfo:e.bridgeInfo?.map(t=>({...t,value:t.label==="Route"?t.value.replace(/\bCROSS\b/g,"ONEchain"):t.value})),swapInfo:e.swapInfo?.map(t=>({...t,label:t.label.startsWith("Swap Fee")?"Est. Swap Fee":t.label}))}}function ns(e){let t=pt(e);if(!(!t||t.lte(0)))return wi(t)}function q1(e,t,r,n){if(!r||!n)return;let o=pt(e),i=pt(t);if(!o||!i||o.lte(0)||i.lte(0))return;let a=i.dividedBy(o);if(a.gte("0.001"))return`1 ${r.symbol} = ${wi(a)} ${n.symbol}`;let s=o.dividedBy(i);return`1 ${n.symbol} = ${wi(s)} ${r.symbol}`}var Y1=1,K1=5;function Af(e){return pt(e)?.toNumber()??null}function Mf(e){let t=Af(e);if(t!==null){if(t>=K1)return"danger";if(t>=Y1)return"warning"}}var Z1=/\bin\b.*amount|amount.*\bin\b|^from\b/i,X1=/\bout\b.*amount|amount.*\bout\b|^to\b|receive/i,J1=/fee/i,$1=/impact|rate|slippage|minimum|min\.|received/i,os=/impact/i,ey=/^route$/i;function ty(e,t,r){let n=e.find(c=>Z1.test(c.label)),o=e.find(c=>X1.test(c.label)),i=new Set;n&&i.add(n),o&&i.add(o);let a=e.find(c=>ey.test(c.label)||(c.routeTokens?.length??0)>0),s=a?.routeTokens?.length?a.routeTokens:void 0,l=a&&!s?a.value:void 0;a&&i.add(a);let d=[];for(let c of e){if(i.has(c))continue;let b=J1.test(c.label);if(!b&&!$1.test(c.label))continue;i.add(c);let f=Af(c.value),m=b&&(f===0||/^\s*free\s*$/i.test(String(c.value??"")));m&&t==="swap"||d.push({text:m?`${c.label} Free`:`${c.label} ${c.value}`,tone:m?"accent":os.test(c.label)?c.tone==="danger"||c.tone==="warning"?c.tone:Mf(c.value):void 0})}return{key:t,label:r,routeText:l,routeTokens:s,inRow:n,outRow:o,meta:d,rest:e.filter(c=>!i.has(c))}}function ry({steps:e}){return v("div",{className:"bf-route-steps",children:e.map((t,r)=>D("div",{className:"bf-route-step","data-last":r===e.length-1?"true":"false","data-kind":t.key.startsWith("hop-")?"hop":"endpoint",children:[D("span",{className:"bf-route-rail","aria-hidden":"true",children:[v("span",{className:"bf-route-line"}),v("span",{className:"bf-route-dot","data-final":r===e.length-1?"true":"false"})]}),D("span",{className:"bf-route-body",children:[D("span",{className:"bf-route-head",children:[v("span",{className:"bf-route-title",children:t.title}),v("span",{className:"bf-route-amount",children:t.routeTokens?.length?t.routeTokens.map((n,o)=>D(se.Fragment,{children:[o>0&&v("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),v(xi,{token:n})]},`${n.symbol}-${o}`)):D(Ho,{children:[t.amountToken&&v(xi,{token:t.amountToken}),v("span",{className:"bf-route-amount-value",children:t.amount},t.amount)]})})]}),(t.meta.length>0||t.tags.length>0)&&D("span",{className:"bf-route-meta",children:[t.meta.map(n=>v("span",{"data-tone":n.tone??"default",children:n.text},n.text)),t.tags.map(n=>v("span",{className:"bf-route-tag",children:n},n))]})]})]},t.key))})}function ny(e){if(!os.test(e.label)||e.tone==="danger"||e.tone==="warning")return e;let t=Mf(e.value);return t?{...e,tone:t}:e}function Lf({summary:e,rateLine:t,from:r,to:n,feeDelegated:o,includeTxFee:i=!1}){let a=!!e.txFeeInfo?.isDelegateFee||!!o,s=se.useMemo(()=>(e.pathType==="bridge-swap"?[["bridge","Bridge"],["swap","Swap"]]:[["swap","Swap"],["bridge","Bridge"]]).map(([k,R])=>{let I=k==="swap"?e.swapInfo:e.bridgeInfo;return I?.length?ty(I,k,R):null}).filter(k=>k!==null),[e]);if(s.length===0)return null;let l=s[0],d=s[s.length-1],c=l.inRow?.valueToken??(r?.symbol?{symbol:r.symbol,iconUrl:r.iconUrl}:void 0),b=l.inRow?.value??r?.amount,f=d.outRow?.valueToken??(n?.symbol?{symbol:n.symbol,iconUrl:n.iconUrl}:void 0),m=d.outRow?.value??n?.amount;if(!b)return null;let y=e.txFeeInfo,g=i&&y&&!y.isDelegateFee?[{text:`Gas ${y.estTxFee}${y.tokenSymbol?` ${y.tokenSymbol}`:""}`}]:[],u=s.length>1,p=[{key:"send",title:`Send ${c?.symbol??""}`.trim(),amount:b,amountToken:c,routeTokens:u?void 0:l.routeTokens,meta:[...g.length?[{text:"EST."}]:r?.chain?[{text:`on ${r.chain}`}]:[],...g,...u?[]:[...l.routeText?[{text:l.routeText}]:[],...l.meta.filter(x=>!os.test(x.text))]],tags:a&&!u?["Fee delegated"]:[]},...u?s.map(x=>({key:`hop-${x.key}`,title:x.label,amount:x.routeText??"",routeTokens:x.routeTokens,meta:x.meta,tags:a&&x.key==="swap"?["Fee delegated"]:[]})):[],{key:"receive",title:`Receive ${f?.symbol??""}`.trim(),amount:m??"\u2014",amountToken:f,meta:[...n?.chain?[{text:`on ${n.chain}`}]:[],...u?[]:l.meta.filter(x=>os.test(x.text))],tags:[]}],w=[...s.flatMap(x=>x.rest),...i?e.txFee??[]:[]].map(ny),h=!!t;return D(Ho,{children:[v(ry,{steps:p}),(w.length>0||h)&&v("div",{className:"bf-info-section",children:v(Ef,{rows:[...h?[{label:"Rate",value:t}]:[],...w]})})]})}function oy({summary:e,rateLine:t,from:r,to:n,feeDelegated:o}){let i=se.useMemo(()=>V1(e),[e]);return!i.bridgeInfo?.length&&!i.swapInfo?.length?null:v("div",{className:"bf-embedded-details",children:v(Lf,{summary:i,rateLine:t,from:r,to:n,feeDelegated:o,includeTxFee:!0})})}function iy({flow:e,env:t,toastError:r}){return D(Ho,{children:[v(Rf,{flow:e,env:t}),v(Cf,{flow:e,approval:e.approvalInfo??null}),v(Sf,{flow:e}),v(Nf,{flow:e}),v(Tf,{message:e.submitToast?"":r}),v(If,{flow:e})]})}function ay({flow:e,env:t,isConnected:r,onRequestConnect:n,feeDelegated:o}){let i=Number(e.fromAmount)>0,a=se.useMemo(()=>i?e.summary??vf(e):null,[i,e]),s=xf(e.quoteError),l=hf(e.fromAmount,e.fromToken),d=l?"Insufficient balance":s.from,c=/insufficient liquidity|not enough liquidity/i.test(e.quoteError),b=c?void 0:s.to,f=e.quoteError&&!s.from&&!s.to?e.quoteError:"",m=e.error||f,y=e.status==="submitting",g=!i||!e.toAmount||!e.fromToken||!e.toToken||!e.canSubmit||!!e.quoteError||l||y,u=y?"":c&&i?"Insufficient Liquidity":i?"Continue":"Enter Amount";return D(Ho,{children:[v("main",{className:"bf-body bf-embedded-body","data-rd-scroll-area":!0,children:D("div",{className:"bf-embedded-form",children:[D("div",{className:"bf-embedded-fields",children:[D("div",{className:"bf-embedded-field-group",children:[v(uf,{label:"From",token:e.fromToken,amount:e.fromAmount,onAmountChange:p=>e.setAmount(p,"from"),onTokenClick:()=>{let p=rs(e.tokens,e.fromToken);p&&e.selectFromToken(p)},onMax:e.setMax,locked:e.tokens.length<=1}),d&&v("div",{className:"bf-embedded-field-error",children:d})]}),v("div",{className:"bf-embedded-direction","aria-hidden":"true",children:v("span",{children:v(_l,{size:16})})}),D("div",{className:"bf-embedded-field-group",children:[v(uf,{label:"To",token:e.toToken,amount:e.toAmount,onAmountChange:p=>e.setAmount(p,"to"),onTokenClick:()=>{let p=rs(e.availableToTokens,e.toToken);p&&e.selectToToken(p)},locked:e.availableToTokens.length<=1}),b&&v("div",{className:"bf-embedded-field-error",children:b})]})]}),v(bi,{open:!!a?.liquidity,children:a?.liquidity&&D("section",{className:"bf-embedded-liquidity",children:[D("div",{children:[v("span",{children:a.liquidity.label??"Available Liquidity"}),v("span",{"data-status":a.liquidity.status,children:a.liquidity.status??"normal"})]}),v("span",{className:"bf-embedded-liquidity-track",children:v("span",{style:{width:`${a.liquidity.percentage??50}%`}})})]})}),v(bi,{open:c&&i,children:v("div",{className:"bf-embedded-liquidity-error",role:"alert",children:"Insufficient liquidity in all pools for this pair and amount."})}),v(bi,{open:!!a,children:a&&v("div",{className:"bf-embedded-summary",children:v(oy,{summary:a,feeDelegated:o,rateLine:q1(e.fromAmount,e.toAmount,e.fromToken,e.toToken),from:{symbol:e.fromToken?.symbol,iconUrl:e.fromToken?.iconUrl,amount:ns(e.fromAmount),chain:e.fromToken?Wo(e.fromToken.chainId):void 0},to:{symbol:e.toToken?.symbol,iconUrl:e.toToken?.iconUrl,amount:ns(e.toAmount),chain:e.toToken?Wo(e.toToken.chainId):void 0}})})}),v("div",{className:"bf-embedded-action-footer",children:r?v("button",{type:"button",className:"bf-embedded-cta",onClick:e.submit,"data-track":"next",disabled:g,"aria-busy":y,"aria-label":y?"Processing transaction":c?"Insufficient liquidity":"Continue with swap or bridge",children:y?v("span",{className:"bf-embedded-spinner","aria-hidden":"true"}):u}):v("button",{type:"button",className:"bf-embedded-cta",onClick:n,"data-track":"connect_click","aria-label":"Connect wallet to continue",children:"Connect Wallet"})})]})}),v(iy,{flow:e,env:t,toastError:m})]})}function sy({item:e}){let t=is(e),r=P1(e.fromAmount,e.fromToken);return D("article",{className:"bf-history-item",children:[D("div",{className:"bf-history-item-head",children:[v("span",{className:"bf-history-status","data-status":t,children:B1(t)}),v("time",{className:"bf-history-time",dateTime:e.timestamp,children:L1(e.timestamp)})]}),D("div",{className:"bf-history-item-body",children:[D("strong",{className:"bf-history-amount",children:[D1(e.fromAmount)," ",e.fromToken.symbol]}),D("div",{className:"bf-history-meta",children:[v("span",{className:"bf-history-usd",children:r??M1(e.txHash)}),D("span",{className:"bf-history-route",children:[D("span",{className:"bf-history-route-token",children:[v(yi,{token:e.fromToken,size:16}),v("span",{children:e.fromToken.symbol})]}),v(Zu,{size:16,className:"bf-history-route-arrow"}),D("span",{className:"bf-history-route-token",children:[v(yi,{token:e.toToken,size:16}),v("span",{children:e.toToken.symbol})]})]})]})]})]})}function ly({flow:e}){let[t,r]=se.useState("all"),n=e.history.some(a=>is(a)==="pending"),o=e.history.filter(a=>O1(a,t)),i=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return D("main",{className:"bf-history-body",children:[v("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:I1.map(a=>D("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>r(a.value),"data-track":"history_filter","data-track-id":a.value,children:[v("span",{children:a.label}),a.value==="pending"&&n&&v("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),o.length>0?v("div",{className:"bf-history-list",children:o.map(a=>v(sy,{item:a},a.id||a.txHash))}):v("div",{className:"bf-empty",children:i})]})}function dy({flow:e,env:t,feeDelegated:r}){let[n,o]=se.useState(!1),[i,a]=se.useState(0),s=!!(e.fromAmount.trim()||e.toAmount.trim()),l=se.useMemo(()=>s?e.summary??vf(e):null,[s,e]),d=Ut("apps.json",t,w=>Mr(w?.bridgePoweredBy?.url,t)),c=xf(e.quoteError),b=hf(e.fromAmount,e.fromToken),f=b?"Insufficient balance":c.from,m=e.quoteError&&!c.from&&!c.to?e.quoteError:"",y=e.error||m,g=e.history.some(w=>is(w)==="pending"),p=(l?.pathType??wf(e.fromToken,e.toToken))!=="bridge";return D(Ho,{children:[D("main",{className:"bf-body",children:[D("div",{className:"bf-toolbar",children:[D("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),"data-track":"history_open",children:[v(Yu,{}),v("span",{children:"History"}),(g||e.hasNewHistory)&&v("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),p&&D("button",{type:"button",className:"bf-chip",onClick:()=>o(!0),"data-track":"slippage_open",disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":n,children:[v(Ku,{}),v("span",{children:e.slippageLocked?"Auto 1%":E1(e.slippage,e.effectiveSlippage)})]})]}),D("div",{className:"bf-swap-card","data-has-from-error":f?"true":"false",children:[v(pf,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:cf(e.fromAmount,e.fromToken),onAmountChange:w=>e.setAmount(w,"from"),onTokenClick:()=>{let w=rs(e.tokens,e.fromToken);w&&e.selectFromToken(w)},locked:e.tokens.length<=1}),f&&v("div",{className:"bf-field-error",children:f}),v("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),a(w=>w+360)},"data-track":"token_swap",style:{transform:`translateX(-50%) rotate(${i}deg)`,transition:"transform 0.2s ease"},children:v(_l,{size:22})}),v(pf,{label:"To",token:e.toToken,amount:e.toAmount,usd:cf(e.toAmount,e.toToken),onAmountChange:w=>e.setAmount(w,"to"),onTokenClick:()=>{let w=rs(e.availableToTokens,e.toToken);w&&e.selectToToken(w)},locked:e.availableToTokens.length<=1}),c.to&&v("div",{className:"bf-field-error",children:c.to})]}),v(W1,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),v(bi,{open:!!l,children:l&&v(Q1,{summary:l,feeDelegated:r,from:{symbol:e.fromToken?.symbol,iconUrl:e.fromToken?.iconUrl,amount:ns(e.fromAmount),chain:e.fromToken?Wo(e.fromToken.chainId):void 0},to:{symbol:e.toToken?.symbol,iconUrl:e.toToken?.iconUrl,amount:ns(e.toAmount),chain:e.toToken?Wo(e.toToken.chainId):void 0}})})]}),D("footer",{className:"bf-footer",children:[v("button",{type:"button",className:"bf-next",onClick:e.submit,"data-track":"next",disabled:e.status==="submitting"||!!e.quoteError||b,children:e.status==="submitting"?"Processing...":"Next"}),d&&D("a",{className:"bf-powered",href:d,target:"_blank",rel:"noreferrer",children:["Powered by ",v("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&v(U1,{flow:e,onClose:()=>o(!1)}),v(Rf,{flow:e,env:t}),v(Cf,{flow:e,approval:e.approvalInfo??null}),v(Sf,{flow:e}),v(Nf,{flow:e}),v(Tf,{message:e.submitToast?"":y}),v(If,{flow:e})]})}function Go({onClose:e,onBackToWallet:t,feeDelegated:r,env:n,variant:o="default",title:i,isConnected:a,onRequestConnect:s,className:l,...d}){let c=se.useMemo(()=>ot(n),[n]),b=qu(),f=af({...d,onExit:t}),m=se.useRef(null),y=T1(m),g=f.step==="history"?"History":i??"Swap & Bridge",u=a??!!d.walletAddress,p=o==="embedded"&&f.step==="form"&&!t?null:f.back;return v(ye,{feature:"bridge",children:v(ff.Provider,{value:y,children:D("div",{ref:m,className:Re("bf-root",l),"data-view":f.step,"data-status":f.status,"data-variant":o,"data-soft-keyboard-open":o==="embedded"&&b?"true":"false",children:[D("header",{className:"bf-header",children:[p?v("button",{type:"button",className:"bf-header-btn",onClick:p,"aria-label":"Back",children:v($r,{size:24})}):v("span",{className:"bf-header-spacer","aria-hidden":"true"}),v("span",{className:"bf-header-title","data-clickable":p?"true":"false",onClick:p??void 0,children:g}),v("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:v(Nr,{size:24})})]}),f.step==="history"?v(ly,{flow:f}):o==="embedded"?v(ay,{flow:f,env:c,isConnected:u,onRequestConnect:s,feeDelegated:r}):v(dy,{flow:f,env:c,feeDelegated:r})]})})})}import*as or from"react";import Sy from"bignumber.js";import{useInfiniteQuery as cy}from"@tanstack/react-query";var py="token-history";function Df(e,t,r,n,o=!0){return cy({queryKey:[py,e,t,r.toLowerCase(),n.toLowerCase()],initialPageParam:void 0,queryFn:async({pageParam:i,signal:a})=>{let s=await Me("walletServer",e),l=new URLSearchParams({chain_id:String(t),token:r,wallet:n}),d=i;d&&(l.set("last_timestamp",String(d.last_timestamp)),l.set("last_log_index",String(d.last_log_index)),l.set("last_tx_index",String(d.last_tx_index)));let c=await fetch(`${s}/v1/public/token/historical?${l}`,{cache:"no-store",signal:a});if(!c.ok)throw new Error(`Failed to fetch token history: ${c.status}`);let b=await c.json();if(b.code!==200)throw new Error(`Token history API error: ${b.code}`);return b.data??[]},getNextPageParam:i=>{if(!i||i.length===0)return;let a=i[i.length-1];return{last_timestamp:a.timestamp,last_log_index:a.log_index,last_tx_index:a.tx_index}},enabled:o&&!!n&&!!r&&t>0,staleTime:1e4})}import*as as from"react";var ql={chart:!1,balance:!0,overview:!1,social:!1,history:!0},uy=Object.keys(ql);function Pf(e){let[t,r]=as.useState({visibility:ql,isLoaded:!1});return as.useEffect(()=>{let n=!0;return no(Ji,e).then(o=>{if(!n)return;let i=o?.tokenDetail?.sections,a={...ql};if(i)for(let s of uy){let l=i[s];typeof l=="boolean"&&(a[s]=l)}r({visibility:a,isLoaded:!0})}),()=>{n=!1}},[e]),t}import*as fr from"react";import{useQuery as fy,keepPreviousData as my}from"@tanstack/react-query";var gy="token-price-history";function Of(e,t,r,n,o=!0){return fy({queryKey:[gy,e,t,r.toLowerCase(),n],queryFn:async({signal:i})=>{let a=await Me("walletServer",e),s=new URLSearchParams({chain_id:String(t),token:r,interval:n}),l=await fetch(`${a}/v1/public/token/price/historical?${s}`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token price history: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token price history API error: ${d.code}`);return d.data??[]},enabled:o&&!!r&&t>0,staleTime:3e4,placeholderData:my})}import{Fragment as Cy,jsx as Zt,jsxs as _o}from"react/jsx-runtime";var hy="var(--ds-system-green-high, #00a869)",by="var(--wi-error, #e70077)",bo=150,ss=3,Yl=18,wy=18,yy=[{key:"10m",label:"10m"},{key:"1h",label:"1H"},{key:"1d",label:"1D"},{key:"7d",label:"1W"},{key:"30d",label:"1M"},{key:"1y",label:"1Y"}],xy=new Set(["7d","30d","1y"]);function vy(){let e=fr.useRef(null),[t,r]=fr.useState(0);return fr.useEffect(()=>{let n=e.current;if(!n)return;let o=new ResizeObserver(i=>{r(i[0]?.contentRect.width??0)});return o.observe(n),r(n.clientWidth),()=>o.disconnect()},[]),[e,t]}function ky(e,t){let r=new Date(e*1e3),n=t?{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}:{hour:"numeric",minute:"2-digit"};return new Intl.DateTimeFormat("en-US",n).format(r)}function Ry(e,t){if(t<=0||e.length===0)return null;let r=e.length===1?[e[0],e[0]]:e,n=r.length,o=r[0],i=r[0],a=0,s=0;for(let w=1;w<n;w++)r[w]>o&&(o=r[w],a=w),r[w]<i&&(i=r[w],s=w);let l=o-i||1,d=Math.max(1,t-ss*2),c=bo-Yl-wy,b=w=>n===1?t/2:ss+w/(n-1)*d,f=w=>Yl+(1-(w-i)/l)*c,m=r.map((w,h)=>({x:b(h),y:f(w)})),y=m.map((w,h)=>`${h===0?"M":"L"}${w.x.toFixed(2)},${w.y.toFixed(2)}`).join(" "),g=m[0],u=m[m.length-1],p=`${y} L${u.x.toFixed(2)},${bo} L${g.x.toFixed(2)},${bo} Z`;return{values:r,points:m,linePath:y,areaPath:p,maxIdx:a,minIdx:s}}function Bf({env:e,chainId:t,tokenAddress:r}){let[n,o]=fr.useState("1d"),[i,a]=fr.useState(null),s=fr.useId(),[l,d]=vy(),{data:c,isLoading:b,isError:f}=Of(e,t,r,n,!0),m=fr.useMemo(()=>(c??[]).filter(U=>Number.isFinite(Number(U.price))).slice().sort((U,oe)=>U.updated_at-oe.updated_at),[c]),y=fr.useMemo(()=>m.map(A=>Number(A.price)),[m]),g=fr.useMemo(()=>Ry(y,d),[y,d]);fr.useEffect(()=>{a(null)},[n]);let u=m.length>0,p=i!==null&&i<y.length?i:y.length-1,w=u?y[p]:0,h=u?y[0]:0,x=h!==0?(w-h)/h*100:0,k=x>=0,R=k?hy:by,I=(k?"+":"-")+(Math.floor(Math.abs(x)*100)/100).toFixed(2)+"%",C=i!==null&&m[i]?ky(m[i].updated_at,xy.has(n)):"",S=A=>{if(!g||d<=0)return;let U=A.currentTarget.getBoundingClientRect(),oe=A.clientX-U.left;if(g.values.length<=1){a(0);return}let G=Math.max(1,d-ss*2),H=Math.min(1,Math.max(0,(oe-ss)/G)),ie=Math.round(H*(m.length-1));a(Math.min(m.length-1,Math.max(0,ie)))},E=()=>a(null);if(!b&&(f||!u))return null;let M=i!==null&&g&&g.points[i]?g.points[i]:null,B=g?.points[g.maxIdx],L=g?.points[g.minIdx],z=A=>Math.min(Math.max(A,24),Math.max(24,d-24));return _o("section",{className:"wi-td-chart",children:[_o("div",{className:"wi-td-chart-panel",children:[Zt("span",{className:"wi-td-chart-price",children:u?co(w):"\u2014"}),u&&_o("span",{className:"wi-td-chart-change","data-positive":k,children:[Zt("span",{children:I}),C&&Zt("span",{className:"wi-td-chart-when",children:C})]})]}),Zt("div",{ref:l,className:"wi-td-chart-plot",children:b&&!u?Zt("div",{className:"wi-skeleton-block wi-td-chart-skeleton"}):g&&d>0&&_o("svg",{className:"wi-td-chart-svg",width:d,height:bo,role:"img","aria-label":"Price chart",children:[Zt("defs",{children:_o("linearGradient",{id:s,x1:"0",y1:"0",x2:"0",y2:"1",children:[Zt("stop",{offset:"0%",stopColor:R,stopOpacity:.28}),Zt("stop",{offset:"100%",stopColor:R,stopOpacity:0})]})}),Zt("path",{d:g.areaPath,fill:`url(#${s})`}),Zt("path",{d:g.linePath,fill:"none",stroke:R,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),B&&Zt("text",{className:"wi-td-chart-minmax",x:z(B.x),y:Math.max(11,B.y-7),textAnchor:"middle",children:co(g.values[g.maxIdx])}),L&&g.minIdx!==g.maxIdx&&Zt("text",{className:"wi-td-chart-minmax",x:z(L.x),y:Math.min(bo-5,L.y+14),textAnchor:"middle",children:co(g.values[g.minIdx])}),M&&_o(Cy,{children:[Zt("line",{className:"wi-td-chart-cursor",x1:M.x,y1:Yl-6,x2:M.x,y2:bo}),Zt("circle",{cx:M.x,cy:M.y,r:4,fill:R,stroke:"var(--wi-surface-bg, #121212)",strokeWidth:2})]}),Zt("rect",{x:0,y:0,width:d,height:bo,fill:"transparent",style:{touchAction:"none"},onPointerMove:S,onPointerDown:S,onPointerLeave:E,onPointerCancel:E})]})}),Zt("div",{className:"wi-td-chart-tabs",role:"tablist",children:yy.map(A=>Zt("button",{type:"button",role:"tab","aria-selected":n===A.key,className:"wi-td-chart-tab","data-active":n===A.key||void 0,onClick:()=>o(A.key),"data-track":"token_detail_interval","data-track-id":A.key,children:A.label},A.key))})]})}import{Fragment as Uf,jsx as K,jsxs as lt}from"react/jsx-runtime";var Ny="https://contents.crosstoken.io/wallet/token/images/FT.png",Ty={receive:"Receive",send:"Send","bridge-in":"Bridge In","bridge-out":"Bridge Out"};function Iy(e){return e.length>24?"xs":e.length>18?"sm":"md"}function Ey(e){if(!e)return"";let t=e<1e12?e*1e3:e,r=Math.max(0,Math.floor((Date.now()-t)/1e3));if(r<60)return"just now";let n=Math.floor(r/60);if(n<60)return`${n}m`;let o=Math.floor(n/60);if(o<24)return`about ${o}h`;let i=Math.floor(o/24);if(i<30)return`${i}d`;let a=Math.floor(i/30);return a<12?`${a}mo`:`${Math.floor(a/12)}y`}function zf(e){let[t,r]=e.split("."),n="";for(let o=0;o<t.length;o++){let i=t.length-o;o>0&&i%3===0&&(n+=","),n+=t[o]}return r?`${n}.${r}`:n}function Ff(e,t){let r=BigInt(e||"0");if(t<=2){let a=10n**BigInt(t),s=r/a,l=r%a*10n**BigInt(2-t);return`${s.toString()}.${l.toString().padStart(2,"0")}`}let n=r/10n**BigInt(t-2),o=n/100n,i=n%100n;return`${o.toString()}.${i.toString().padStart(2,"0")}`}function Ay(e,t,r){let n=or.useRef(null),o=or.useRef(null),[i,a]=or.useState(t);return or.useLayoutEffect(()=>{let s=n.current,l=o.current;if(!s||!l)return;let d=()=>{let b=s.clientWidth;if(!b)return;let f=window.getComputedStyle(l),m=document.createElement("span");m.textContent=l.textContent,m.style.cssText=["position:absolute","left:-9999px","top:-9999px","visibility:hidden","white-space:nowrap",`font-family:${f.fontFamily}`,`font-weight:${f.fontWeight}`,`letter-spacing:${f.letterSpacing}`,`font-size:${t}px`].join(";"),document.body.appendChild(m);let y=m.offsetWidth;if(document.body.removeChild(m),y<=b){a(t);return}let g=Math.max(r,Math.floor(t*b/y));a(g)};d();let c=new ResizeObserver(d);return c.observe(s),()=>c.disconnect()},[e,t,r]),{containerRef:n,textRef:o,fontSize:i}}function My(e){let t=pt(e);return t?t.decimalPlaces(4,Sy.ROUND_DOWN).toFormat():"-"}function Ly(){return lt("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[K("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.6"}),K("path",{d:"M3 12h18M12 3c2.5 2.5 3.8 5.8 3.8 9s-1.3 6.5-3.8 9c-2.5-2.5-3.8-5.8-3.8-9S9.5 5.5 12 3Z",stroke:"currentColor",strokeWidth:"1.6"})]})}function Dy(){return K("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:K("path",{d:"M21.9 4.3 18.6 20c-.2 1-.9 1.3-1.8.8l-4.9-3.6-2.4 2.3c-.3.3-.5.5-1 .5l.3-4.9 9-8.1c.4-.3-.1-.5-.6-.2L6.2 13.2l-4.8-1.5c-1-.3-1-1 .2-1.5L20.6 3c.9-.3 1.6.2 1.3 1.3Z"})})}function Py(){return K("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:K("path",{d:"M18.9 2H22l-7.3 8.3L23.3 22h-6.8l-5.3-6.9L5.1 22H2l7.8-8.9L1 2h6.9l4.8 6.4L18.9 2Zm-1.2 18h1.9L7.2 4H5.2l12.5 16Z"})})}function Oy(){return K("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:K("path",{d:"M6.9 6.5c0-.2-.1-.5-.3-.6L4.6 3.6V3.3h6.3l4.9 10.7 4.3-10.7H26v.3l-1.8 1.7c-.2.1-.2.3-.2.5v12.4c0 .2 0 .4.2.5l1.7 1.7v.3h-8.7v-.3l1.8-1.7c.2-.2.2-.2.2-.5V8.1l-5 12.6h-.7L7.9 8.1v8.5c0 .3.1.6.3.8l2.3 2.8v.3H4v-.3l2.3-2.8c.2-.2.3-.5.3-.8V6.5Z",transform:"scale(0.85)"})})}function jf({env:e,isMobile:t,token:r,walletAddress:n,stat:o,tokenInfo:i,showBalance:a=!0,onBack:s,onClose:l,onSend:d,onOutlink:c}){let b=r.quantity.decimals,[f,m]=or.useState(!1),{buildTxUrl:y,chainInfo:g}=Mc(e,r.chainId,!0),{visibility:u}=Pf(e),{data:p,isLoading:w,isError:h,fetchNextPage:x,hasNextPage:k,isFetchingNextPage:R,refetch:I}=Df(e,r.chainId,r.address,n,!0),C=or.useMemo(()=>p?.pages?p.pages.flat():[],[p]),S=or.useRef(null);or.useEffect(()=>{if(!t)return;let O=S.current;if(!O||!k)return;let Z=new IntersectionObserver(_=>{_[0]?.isIntersecting&&!R&&x()},{rootMargin:"120px"});return Z.observe(O),()=>Z.disconnect()},[t,k,R,x]);let E=or.useCallback(()=>{navigator?.clipboard&&navigator.clipboard.writeText(r.address).then(()=>{m(!0),setTimeout(()=>m(!1),1500)}).catch(()=>{})},[r.address]),M=zf(Ff(r.quantity.numeric,b)),B=o?.price?fa(r.quantity.numeric,b,o.price):null,L=a?M:"\u2022\u2022\u2022\u2022",{containerRef:z,textRef:A,fontSize:U}=Ay(L,30,14),Y=ni(r.chainId,e).name??g?.name??`Chain ${r.chainId}`,G=g?.explorer_url,H=i?.deployed??!0,ie=or.useMemo(()=>{let O=[];return i?.info_url&&O.push({key:"web",label:"Website",url:i.info_url,icon:K(Ly,{})}),i?.telegram_url&&O.push({key:"tg",label:"Telegram",url:i.telegram_url,icon:K(Dy,{})}),i?.x_url&&O.push({key:"x",label:"X",url:i.x_url,icon:K(Py,{})}),i?.medium_url&&O.push({key:"medium",label:"Medium",url:i.medium_url,icon:K(Oy,{})}),O},[i]),te=(O,Z,_,ce)=>{Ot(O,Z,{category:"token-detail",origin:_,payload:{address:r.address,txHash:ce}},c)};return lt(Uf,{children:[lt("div",{className:"wi-sticky-header",children:[lt("div",{className:"wi-header wi-header--receive",children:[K("button",{type:"button",className:"wi-header-back",onClick:s,"aria-label":"Back",children:K($r,{size:24})}),lt("span",{className:"wi-td-header-title",children:[K("img",{src:r.icon_url,alt:"","aria-hidden":!0,className:"wi-td-header-icon",width:24,height:24,draggable:!1,onError:O=>{O.currentTarget.src=Ny}}),K("span",{className:"wi-td-header-name",children:r.symbol})]}),K("button",{type:"button",className:"wi-header-action",onClick:l,"aria-label":"Close",children:K(Nr,{size:24})})]}),K("hr",{className:"wi-divider"})]}),lt("div",{className:"wi-td-scroll",children:[u.chart&&K(Bf,{env:e,chainId:r.chainId,tokenAddress:r.address}),u.balance&&lt("section",{className:"wi-td-balance-card",children:[lt("div",{className:"wi-td-balance-left",ref:z,children:[K("span",{className:"wi-td-balance-label",children:"My Balance"}),K("span",{className:"wi-td-balance-amount",ref:A,style:{fontSize:U},children:L}),a&&B&&K("span",{className:"wi-td-balance-fiat",children:B})]}),K("button",{type:"button",className:"wi-td-send-btn",onClick:()=>d(r),"aria-label":`Send ${r.symbol}`,"data-track":"token_detail_send","data-track-id":r.symbol,children:K("span",{children:"Send"})})]}),u.overview&&lt("section",{className:"wi-td-section",children:[K("h3",{className:"wi-td-section-title",children:"Crypto Overview"}),lt("div",{className:"wi-td-rows",children:[lt("div",{className:"wi-td-row",children:[K("span",{className:"wi-td-row-label",children:"Network"}),G?lt("a",{className:"wi-td-row-value wi-td-row-link",href:G,target:"_blank",rel:"noopener noreferrer",onClick:O=>te(O,G,"token-network"),children:[K("span",{children:Y}),K(By,{})]}):K("span",{className:"wi-td-row-value",children:Y})]}),lt("div",{className:"wi-td-row",children:[K("span",{className:"wi-td-row-label",children:"Contract Address"}),lt("button",{type:"button",className:"wi-td-row-value wi-td-row-copy",onClick:E,"aria-label":"Copy contract address",children:[K("span",{children:tr(r.address)}),f?K(vn,{size:14}):K(so,{size:14})]})]}),lt("div",{className:"wi-td-row",children:[K("span",{className:"wi-td-row-label",children:"Decimals"}),K("span",{className:"wi-td-row-value",children:b})]}),lt("div",{className:"wi-td-row",children:[K("span",{className:"wi-td-row-label",children:"Total Supply"}),K("span",{className:"wi-td-row-value",children:My(o?.circulating_supply)})]})]})]}),u.social&&ie.length>0&&lt("section",{className:"wi-td-section",children:[K("h3",{className:"wi-td-section-title",children:"Social Media"}),K("div",{className:"wi-td-social-row",children:ie.map(O=>K("a",{className:"wi-td-social-btn",href:O.url,target:"_blank",rel:"noopener noreferrer","aria-label":O.label,onClick:Z=>te(Z,O.url,"token-social"),children:O.icon},O.key))})]}),u.history&&lt("section",{className:"wi-td-section",children:[K("h3",{className:"wi-td-section-title",children:"Token History"}),w&&K("div",{className:"wi-td-history-list",children:Array.from({length:3},(O,Z)=>lt("div",{className:"wi-td-history-skeleton",children:[K("div",{className:"wi-skeleton-block",style:{width:90,height:14}}),K("div",{className:"wi-skeleton-block",style:{width:60,height:14}})]},`td-sk-${Z}`))}),!w&&h&&lt("div",{className:"wi-td-history-empty",children:[K("span",{children:"Failed to load history."}),K("button",{type:"button",className:"wi-td-retry-btn",onClick:()=>I(),children:"Retry"})]}),!w&&!h&&C.length===0&&K("div",{className:"wi-td-history-empty",children:K("span",{children:"No transactions found."})}),!w&&!h&&C.length>0&&lt("div",{className:"wi-td-history-list",children:[C.map((O,Z)=>{let _=O.to_alias?.toLowerCase().includes("bridge")??!1,ce=O.from_alias?.toLowerCase().includes("bridge")??!1,xe=_?"bridge-out":ce?"bridge-in":O.to?.toLowerCase()===n.toLowerCase()?"receive":"send",he=xe==="receive"||xe==="bridge-in",fe=he?O.from:O.to,ge=zf(Ff(O.amount,b)),we=y(O.tx),Ye=Ey(O.timestamp),be=lt(Uf,{children:[lt("div",{className:"wi-td-history-top",children:[K("span",{className:"wi-td-history-type","data-direction":xe,children:Ty[xe]}),K("span",{className:"wi-td-history-counter",children:tr(fe??"")})]}),lt("div",{className:"wi-td-history-bottom",children:[lt("span",{className:"wi-td-history-meta",children:[K("span",{className:"wi-td-history-status","data-status":O.status,children:O.status==="success"?"Success":"Failed"}),Ye&&K("span",{className:"wi-td-history-time",children:Ye})]}),lt("span",{className:"wi-td-history-amount","data-size":Iy(`${he?"+":"-"}${ge} ${r.symbol}`),children:[he?"+":"-",ge," ",r.symbol]})]})]}),Te=`${O.tx}-${O.log_index}-${Z}`;return we?K("a",{className:"wi-td-history-item wi-td-history-item--link",href:we,target:"_blank",rel:"noopener noreferrer",onClick:it=>te(it,we,"token-tx",O.tx),children:be},Te):K("div",{className:"wi-td-history-item",children:be},Te)}),k&&(t?K("div",{ref:S,className:"wi-td-history-sentinel",children:R&&K("span",{className:"wi-td-history-loading",children:"Loading\u2026"})}):K("button",{type:"button",className:"wi-td-loadmore-btn",onClick:()=>x(),disabled:R,children:R?"Loading\u2026":"Load more"}))]})]})]})]})}function By(){return K("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:Re("wi-td-external-icon"),"aria-hidden":!0,children:K("path",{d:"M14 4h6v6M20 4l-9 9M18 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}import*as on from"react";var Wf={dev:"https://dev.onechain.nexus/pop",stage:"https://stg.onechain.nexus/pop",production:"https://onechain.nexus/pop"};function Hf(e,t){let r=Wf[e]??Wf.production;return t==="send"?r:`${r}/${t}`}var Gf={dev:"https://stg.onechain.nexus/gametoken/bridge",stage:"https://stg.onechain.nexus/gametoken/bridge",production:"https://www.onechain.nexus/gametoken/bridge"};function _f(e){return Gf[e]??Gf.production}import{jsx as ne,jsxs as mr}from"react/jsx-runtime";function Kl({size:e=20,className:t}){return mr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("path",{d:"M1.66675 7.91662C1.66677 6.98929 1.94808 6.08377 2.47353 5.31967C2.99898 4.55557 3.74385 3.96883 4.60976 3.63695C5.47567 3.30507 6.42188 3.24366 7.32343 3.46082C8.22497 3.67799 9.03944 4.16352 9.65925 4.85329C9.7029 4.89996 9.75568 4.93718 9.81431 4.96262C9.87294 4.98806 9.93617 5.00119 10.0001 5.00119C10.064 5.00119 10.1272 4.98806 10.1859 4.96262C10.2445 4.93718 10.2973 4.89996 10.3409 4.85329C10.9588 4.15904 11.7734 3.66943 12.6764 3.44962C13.5795 3.22982 14.528 3.29024 15.3958 3.62286C16.2636 3.95547 17.0096 4.5445 17.5343 5.31154C18.0591 6.07858 18.3378 6.98725 18.3334 7.91662C18.3334 9.82495 17.0834 11.25 15.8334 12.5L11.2567 16.9275C11.1015 17.1058 10.91 17.249 10.6951 17.3477C10.4802 17.4464 10.2468 17.4982 10.0103 17.4997C9.77386 17.5012 9.53979 17.4523 9.32365 17.3564C9.10752 17.2605 8.91427 17.1196 8.75675 16.9433L4.16675 12.5C2.91675 11.25 1.66675 9.83329 1.66675 7.91662Z",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),ne("path",{d:"M8.84839 8.28833H10V13.4938",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Qf({size:e=24,className:t}){return mr("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"}),ne("path",{d:"m21.854 2.147-10.94 10.939",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Vf({size:e=24,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mr("g",{stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",children:[ne("path",{d:"M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17"}),ne("path",{d:"m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9"}),ne("path",{d:"m2 16 6 6"}),ne("circle",{cx:"16",cy:"9",r:"2.9"}),ne("circle",{cx:"6",cy:"5",r:"3"})]})})}function qf({size:e=24,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mr("g",{stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",children:[ne("path",{d:"M15 12h-5M15 8h-5"}),ne("path",{d:"M19 17V5a2 2 0 0 0-2-2H4"}),ne("path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3"})]})})}function Ri({size:e=12,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("path",{d:"m9 18 6-6-6-6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Yf({size:e=20,className:t}){return mr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("rect",{width:"20",height:"20",rx:"4.8",fill:"currentColor"}),ne("path",{d:"M11.53 9.05 15.7 4.4h-.99l-3.62 4.04L8.2 4.4H4.86l4.37 6.1-4.37 4.87h.99l3.82-4.26 3.05 4.26h3.34zm-1.35 1.51-.44-.61-3.52-4.9h1.52l2.84 3.96.44.61 3.7 5.14h-1.52z",fill:"var(--wi-op-x-glyph, #ffffff)"})]})}function Kf({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mr("g",{stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[ne("circle",{cx:"9",cy:"7",r:"3.4"}),ne("path",{d:"M2.6 20.4a6.4 6.4 0 0 1 10.2-5.15"}),ne("circle",{cx:"17.5",cy:"17.5",r:"2.1"}),ne("path",{d:"M19.6 17.5v1.05a1.55 1.55 0 0 0 3.1 0v-1.05a5.2 5.2 0 1 0-2.05 4.14"})]})})}function Zf({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mr("g",{stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[ne("path",{d:"M12.5 3 5 13.5h5.5L10 21l7.5-10.5H12z"}),ne("path",{d:"M20 4.5 21.5 3M20.5 8h2M17 2.5V1"})]})})}function Xf({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mr("g",{stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[ne("rect",{x:"2.5",y:"5.5",width:"19",height:"13",rx:"2.5"}),ne("path",{d:"M12 9v6"}),ne("path",{d:"m9.5 12.5 2.5 2.5 2.5-2.5"})]})})}function Jf({className:e}){return mr("svg",{width:"116",height:"24",viewBox:"0 0 116 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"ONEpop",className:e,children:[ne("path",{d:"M38.1949 4.06787C33.7184 4.06787 30.085 7.69479 30.085 12.1647C30.085 16.6346 33.7184 20.2616 38.1949 20.2616C42.6713 20.2616 46.3048 16.6346 46.3048 12.1647C46.3048 7.69479 42.6713 4.06787 38.1949 4.06787ZM38.1949 16.6216C35.7312 16.6216 33.7315 14.6284 33.7315 12.1647C33.7315 9.70103 35.7312 7.70786 38.1949 7.70786C40.6586 7.70786 42.6583 9.70103 42.6583 12.1647C42.6583 14.6284 40.6586 16.6216 38.1949 16.6216Z",fill:"currentColor"}),ne("path",{d:"M52.0033 4.81283C51.6438 4.40113 51.1537 4.11359 50.5721 4.11359C49.5657 4.11359 48.7554 4.93046 48.7554 5.93031V18.4513C48.7554 19.4577 49.5722 20.2681 50.5721 20.2681C51.5719 20.2681 52.3888 19.4512 52.3888 18.4513V10.7727L60.5837 19.5492C60.9431 19.9609 61.4332 20.2485 62.0148 20.2485C63.0212 20.2485 63.8316 19.4316 63.8316 18.4317C63.8316 17.9351 63.6094 17.5038 63.3153 17.1639L51.9967 4.81936L52.0033 4.81283Z",fill:"currentColor"}),ne("path",{d:"M61.8643 12.3934C62.9034 12.3934 63.7398 11.5504 63.7398 10.5179V5.96953C63.7398 4.93047 62.8968 4.09399 61.8643 4.09399C60.8318 4.09399 59.9888 4.93701 59.9888 5.96953V10.5179C59.9888 11.5569 60.8318 12.3934 61.8643 12.3934Z",fill:"currentColor"}),ne("path",{d:"M76.9017 7.74704C77.9081 7.74704 78.7249 6.93016 78.7249 5.93031C78.7249 4.93046 77.9081 4.11359 76.9017 4.11359H68.5108C67.5044 4.11359 66.6875 4.93046 66.6875 5.93031V18.4513C66.6875 19.4577 67.5044 20.2681 68.5108 20.2681H76.9017C77.9081 20.2681 78.7249 19.4512 78.7249 18.4513C78.7249 17.4515 77.9081 16.6346 76.9017 16.6346H70.3275V14.0075H76.2286C77.235 14.0075 78.0518 13.1907 78.0518 12.1908C78.0518 11.191 77.235 10.3741 76.2286 10.3741H70.3275V7.74704H76.9017Z",fill:"currentColor"}),ne("path",{d:"M84.5951 23.1908C84.3206 23.1908 84.105 23.1124 83.9481 22.9555C83.7913 22.7987 83.7129 22.5765 83.7129 22.2889V10.7416C83.7129 10.441 83.7913 10.2188 83.9481 10.0751C84.105 9.91823 84.3206 9.83981 84.5951 9.83981C84.8827 9.83981 85.0983 9.91823 85.2421 10.0751C85.3989 10.2188 85.4773 10.441 85.4773 10.7416V12.5257L85.2617 12.1728C85.4708 11.4539 85.8825 10.8789 86.4968 10.4476C87.1111 10.0163 87.8495 9.8006 88.7122 9.8006C89.5617 9.8006 90.3002 10.0032 90.9275 10.4084C91.5549 10.8004 92.045 11.369 92.3979 12.114C92.7508 12.8459 92.9272 13.7216 92.9272 14.741C92.9272 15.7474 92.7508 16.6297 92.3979 17.3877C92.0581 18.1327 91.5679 18.7078 90.9275 19.1129C90.3002 19.505 89.5617 19.7011 88.7122 19.7011C87.8626 19.7011 87.1307 19.4854 86.5164 19.0541C85.9021 18.6228 85.4904 18.0543 85.2813 17.3485H85.4969V22.2889C85.4969 22.5765 85.4185 22.7987 85.2617 22.9555C85.1048 23.1124 84.8827 23.1908 84.5951 23.1908ZM88.3004 18.2895C88.8625 18.2895 89.3526 18.1523 89.7708 17.8778C90.2021 17.6034 90.5354 17.2047 90.7707 16.6819C91.0059 16.1591 91.1236 15.5122 91.1236 14.741C91.1236 13.5909 90.8687 12.7152 90.359 12.114C89.8492 11.5128 89.1631 11.2122 88.3004 11.2122C87.7254 11.2122 87.2222 11.3494 86.7909 11.6239C86.3726 11.8853 86.0459 12.2774 85.8106 12.8002C85.5884 13.323 85.4773 13.9699 85.4773 14.741C85.4773 15.8912 85.7322 16.7734 86.2419 17.3877C86.7517 17.9889 87.4378 18.2895 88.3004 18.2895Z",fill:"currentColor"}),ne("path",{d:"M99.2775 19.7011C98.3365 19.7011 97.5196 19.4985 96.8269 19.0933C96.1342 18.6882 95.5983 18.1131 95.2193 17.3681C94.8403 16.6231 94.6508 15.7474 94.6508 14.741C94.6508 13.983 94.7553 13.3033 94.9644 12.7021C95.1866 12.0878 95.5003 11.565 95.9055 11.1337C96.3106 10.7024 96.7942 10.3757 97.3562 10.1535C97.9313 9.91823 98.5718 9.8006 99.2775 9.8006C100.219 9.8006 101.035 10.0032 101.728 10.4084C102.421 10.8135 102.957 11.3886 103.336 12.1336C103.715 12.8655 103.904 13.7347 103.904 14.741C103.904 15.4991 103.793 16.1853 103.571 16.7996C103.362 17.4139 103.055 17.9366 102.65 18.368C102.244 18.7993 101.754 19.1326 101.179 19.3678C100.617 19.59 99.9833 19.7011 99.2775 19.7011ZM99.2775 18.2895C99.8526 18.2895 100.349 18.1523 100.768 17.8778C101.199 17.6034 101.526 17.2047 101.748 16.6819C101.983 16.1591 102.101 15.5122 102.101 14.741C102.101 13.5909 101.846 12.7152 101.336 12.114C100.826 11.5128 100.14 11.2122 99.2775 11.2122C98.7155 11.2122 98.2189 11.3494 97.7876 11.6239C97.3693 11.8853 97.0426 12.2774 96.8073 12.8002C96.572 13.323 96.4544 13.9699 96.4544 14.741C96.4544 15.8912 96.7093 16.7734 97.219 17.3877C97.7418 17.9889 98.428 18.2895 99.2775 18.2895Z",fill:"currentColor"}),ne("path",{d:"M107.072 23.1908C106.797 23.1908 106.582 23.1124 106.425 22.9555C106.268 22.7987 106.19 22.5765 106.19 22.2889V10.7416C106.19 10.441 106.268 10.2188 106.425 10.0751C106.582 9.91823 106.797 9.83981 107.072 9.83981C107.359 9.83981 107.575 9.91823 107.719 10.0751C107.876 10.2188 107.954 10.441 107.954 10.7416V12.5257L107.738 12.1728C107.948 11.4539 108.359 10.8789 108.974 10.4476C109.588 10.0163 110.326 9.8006 111.189 9.8006C112.038 9.8006 112.777 10.0032 113.404 10.4084C114.032 10.8004 114.522 11.369 114.875 12.114C115.228 12.8459 115.404 13.7216 115.404 14.741C115.404 15.7474 115.228 16.6297 114.875 17.3877C114.535 18.1327 114.045 18.7078 113.404 19.1129C112.777 19.505 112.038 19.7011 111.189 19.7011C110.339 19.7011 109.607 19.4854 108.993 19.0541C108.379 18.6228 107.967 18.0543 107.758 17.3485H107.974V22.2889C107.974 22.5765 107.895 22.7987 107.738 22.9555C107.582 23.1124 107.359 23.1908 107.072 23.1908ZM110.777 18.2895C111.339 18.2895 111.829 18.1523 112.248 17.8778C112.679 17.6034 113.012 17.2047 113.247 16.6819C113.483 16.1591 113.6 15.5122 113.6 14.741C113.6 13.5909 113.345 12.7152 112.836 12.114C112.326 11.5128 111.64 11.2122 110.777 11.2122C110.202 11.2122 109.699 11.3494 109.268 11.6239C108.849 11.8853 108.523 12.2774 108.287 12.8002C108.065 13.323 107.954 13.9699 107.954 14.741C107.954 15.8912 108.209 16.7734 108.719 17.3877C109.228 17.9889 109.915 18.2895 110.777 18.2895Z",fill:"currentColor"}),ne("path",{d:"M14.7326 0.727918C12.9726 1.59329 11.6096 4.00482 11.0833 5.59357C9.88384 4.95085 7.89924 3.76837 5.7791 4.00482C3.25593 4.28622 1.16093 5.72223 0.333058 8.59505C-0.616745 11.891 0.425001 15.7904 3.97287 17.5788C7.25977 19.2357 10.3262 21.1047 11.8468 22.2197C13.3673 23.3348 14.6332 24.4164 15.5435 23.8398C17.1655 23.054 20.2401 19.6295 22.4534 16.1013C24.3507 13.0769 25.9439 7.65453 23.3488 3.26211C21.2608 -0.0620856 17.6891 -0.725834 14.7326 0.727918Z",fill:"url(#wi-op-logo-heart)"}),ne("mask",{id:"wi-op-logo-mask",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"25",height:"24",children:ne("path",{d:"M14.7326 0.727918C12.9726 1.59329 11.6096 4.00482 11.0833 5.59357C9.88384 4.95085 7.89924 3.76837 5.7791 4.00482C3.25593 4.28622 1.16093 5.72223 0.333058 8.59505C-0.616745 11.891 0.425001 15.7904 3.97287 17.5788C7.25977 19.2357 10.3262 21.1047 11.8468 22.2197C13.3673 23.3348 14.6332 24.4164 15.5435 23.8398C17.1655 23.054 20.2401 19.6295 22.4534 16.1013C24.3507 13.0769 25.9439 7.65453 23.3488 3.26211C21.2608 -0.0620856 17.6891 -0.725834 14.7326 0.727918Z",fill:"white"})}),mr("g",{mask:"url(#wi-op-logo-mask)",children:[ne("path",{d:"M29.5305 -3.85553H-1.43018V24.7597H29.5305V-3.85553Z",fill:"url(#wi-op-logo-base)"}),ne("path",{d:"M12.7993 24.7597H29.5372V1.58752L12.7993 13.5165V24.7597Z",fill:"url(#wi-op-logo-shine-r)"}),ne("path",{d:"M12.8037 24.7598H-1.63916V2.94476L12.8037 13.5166V24.7598Z",fill:"url(#wi-op-logo-shine-l)"})]}),ne("path",{d:"M13.4339 7.58409L9.79429 9.73601C9.1523 10.1136 8.92988 10.962 9.2989 11.6189C9.66791 12.2759 10.4969 12.5035 11.1389 12.1259L14.2174 10.305L12.7515 11.9138V18.2247C12.7515 18.9852 13.3581 19.6059 14.1012 19.6059C14.8442 19.6059 15.4508 18.9852 15.4508 18.2247V8.77903C15.4508 8.51521 15.37 8.25656 15.2689 8.08586C14.8897 7.43407 14.0708 7.20129 13.4288 7.57891L13.4339 7.58409Z",fill:"white"}),mr("defs",{children:[mr("linearGradient",{id:"wi-op-logo-heart",x1:"12.3679",y1:"-0.18782",x2:"12.3679",y2:"23.9797",gradientUnits:"userSpaceOnUse",children:[ne("stop",{stopColor:"#F1603C"}),ne("stop",{offset:"1",stopColor:"#EE2566"})]}),mr("linearGradient",{id:"wi-op-logo-base",x1:"-5.01624",y1:"-7.30565",x2:"28.6827",y2:"29.4172",gradientUnits:"userSpaceOnUse",children:[ne("stop",{stopColor:"#F3752D"}),ne("stop",{offset:"1",stopColor:"#EC1272"})]}),mr("linearGradient",{id:"wi-op-logo-shine-r",x1:"10.2312",y1:"2.71613",x2:"23.8708",y2:"13.2539",gradientUnits:"userSpaceOnUse",children:[ne("stop",{stopColor:"white",stopOpacity:"0.5"}),ne("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),mr("linearGradient",{id:"wi-op-logo-shine-l",x1:"24.1414",y1:"-2.87687",x2:"12.838",y2:"18.379",gradientUnits:"userSpaceOnUse",children:[ne("stop",{stopColor:"white",stopOpacity:"0.5"}),ne("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})}var zy="data:image/webp;base64,UklGRiIfAABXRUJQVlA4WAoAAAAQAAAA9QAA1wAAQUxQSDQJAAABsMf/nzG31uyzu9lNurFtp7Zt27btHtuu3YPatnWM1A2q08bJJmmyu/P7XfSm+2Bm/rsnIiaA/JNAndnDLyQiJi4uN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YYzx0eJPrca0nH0k8XQHcTM9/RHvOlFQF9qnKW5DHLg366FhoEDkxnm1GZafbv+YtFQtJeEZzwIKkKr5uREGvR+kqr0rqvMONg8RdMGe7bfLiEh3DXisaaLWnPVFuGsufuKXDYcaT7KUY2QRrG0w/YBfJ3dL0Iwq+Ts1rVwPw6EW/mf2vvBQN9xEWoQ7eiQkd2E0IL7n3nBdqi3ZPGsI5a6KQiGzXc61A4P9EGBs88qTmQhAkR4mb+ylXAVZh/krFLuC7Ut7uDHtGuiDisDTlO+3/bQP0eH3DWK9n5/JZlbBt9YhJZd1r2yYqNlB/tZVI4EKQkr7qOlC60xl+gRhiolHBYUydO9a4i5+oeMpnPLGwTsCDx/HAmkYUs9yyTzdY4LQ9HBwJDDvPJ67WT/8o69iNhN5r6Pm/nz/XL6FN3HdgPOtkquE0weDfwxCeL1qJz+UNs953SM4sAVvJXTJgJtaDdn5jk26W6qWEeffbz7eFhHZSQT/5CcUc6kLTepaSfDjMMO13nc83Bp1gf9kmweID6+5MqNSxgHbv+z//3BrktV/Rl7DfiqPdxlkFinc/i09y+qlDycF6SDyMXIsRWi1IIvY4rojOw7PdSyYIzuQi1ul2IviqZrwjvgitwN/22Ogzpt6VUaERFfLjCSmwNIwt2hcaH3+ZB4sj7qP784wlWjexf/5iN8j6tHK6zzw4Q+QLcMcNksKjPFBaupKpIcBCUxs8o7wxVHzyRhdr/7JP7qiXejoFAtYPP/bcBCgAAAAAAAAAAA==";function $f({className:e}){return ne("svg",{width:"82",height:"72",viewBox:"0 0 82 72",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:e,children:ne("image",{href:zy,width:"82",height:"72",preserveAspectRatio:"xMidYMid meet"})})}de(`.wi-op-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;display:flex;flex-direction:column;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .wi-op-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-op-scroll::-webkit-scrollbar{width:4px}.wi-op-scroll::-webkit-scrollbar-track{background:transparent}.wi-op-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}[data-theme=light] .wi-op-scroll::-webkit-scrollbar-thumb{background:#0000001f}.wi-op-header-title{position:absolute;left:50%;transform:translate(-50%);display:inline-flex;align-items:center;pointer-events:none}.wi-op-logo{display:block;flex-shrink:0;color:var(--ds-content-highest, #000000)}.wi-op-logo-img{height:24px;width:auto;object-fit:contain}.wi-op-hero{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:24px;flex-shrink:0}.wi-op-hero-copy{display:flex;flex-direction:column;gap:6px;min-width:0}.wi-op-hero-title{display:flex;flex-direction:column;margin:0;font-family:inherit;font-size:18px;font-weight:600;line-height:1.25;color:var(--ds-content-highest, #000000)}.wi-op-hero-title-row{display:inline-flex;align-items:center;gap:4px;flex-wrap:wrap}.wi-op-x-badge{flex-shrink:0;color:var(--ds-content-highest, #000000)}[data-theme=light] .wi-op-x-badge{--wi-op-x-glyph: #ffffff}[data-theme=dark] .wi-op-x-badge{--wi-op-x-glyph: #1e232e}.wi-op-hero-sub{margin:0;font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-op-hero-art{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:120px;height:72px}.wi-op-hero-img{max-width:100%;max-height:72px;object-fit:contain}.wi-op-panel{display:flex;flex-direction:column;gap:8px;padding:0 24px;flex-shrink:0}.wi-op-balance-card{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa)}.wi-op-balance-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.wi-op-balance-label{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.wi-op-balance-body{display:flex;align-items:center;gap:4px;min-width:0}.wi-op-balance-icon{width:24px;height:24px;border-radius:50%;object-fit:cover;flex-shrink:0}.wi-op-balance-value{font-family:inherit;font-size:28px;font-weight:600;line-height:1.25;color:var(--ds-content-highest, #000000);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wi-op-link-btn{appearance:none;display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;flex-shrink:0;transition:color .15s ease}.wi-op-link-btn:hover:not(:disabled){color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-op-link-btn:disabled{cursor:default;opacity:.5}.wi-op-balance-head>[data-gou-mode=button]{display:contents}.wi-op-action-row{display:flex;align-items:stretch;gap:8px}.wi-op-action-card{appearance:none;display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 8px;border:none;border-radius:10px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-align:center;cursor:pointer;transition:background-color .15s ease,transform .1s ease}.wi-op-action-card>svg{flex-shrink:0}.wi-op-action-card:hover:not(:disabled){background:#2e3544}[data-theme=light] .wi-op-action-card:hover:not(:disabled){background:#e4e8ef}.wi-op-action-card:active:not(:disabled){transform:scale(.95)}.wi-op-action-card:disabled{cursor:default;opacity:.45}.wi-op-cta-row{display:flex;flex-direction:column;gap:10px;padding:24px;flex-shrink:0}.wi-op-cta-skeleton{border-radius:10px}.wi-op-cta{appearance:none;display:flex;align-items:center;justify-content:center;width:100%;padding:12px 16px;border:none;border-radius:10px;font-family:inherit;font-size:16px;font-weight:600;line-height:1;cursor:pointer;transition:filter .15s ease,transform .1s ease,background-color .15s ease}.wi-op-cta:active:not(:disabled){transform:scale(.985)}.wi-op-cta:disabled{cursor:default;opacity:.5}.wi-op-cta--gradient{background:linear-gradient(193.7deg,#f62e61 16.1%,#f7564a 83.9%);color:#fff}.wi-op-cta--gradient:hover:not(:disabled){filter:brightness(1.05)}.wi-op-cta--purple{background:var(--ds-system-purple-high, #7346f3);color:var(--ds-system-purple-on, #ffffff)}.wi-op-cta--purple:hover:not(:disabled){filter:brightness(1.08)}.wi-op-cta--outline{background:transparent;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-op-cta--outline:hover:not(:disabled){background:var(--ds-surface-medium, #f5f7fa)}.wi-op-features{display:flex;flex-direction:column;padding:0 24px 8px;flex-shrink:0}.wi-op-feature{display:flex;align-items:center;gap:6px;padding:12px 0}.wi-op-feature+.wi-op-feature{border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-op-feature-icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;flex-shrink:0;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-accent-primary-high, #f0640d)}.wi-op-feature-copy{display:flex;flex-direction:column;min-width:0}.wi-op-feature-title{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))}.wi-op-feature-desc{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-op-activity{display:flex;flex-direction:column;gap:8px;padding:0 24px 8px;flex-shrink:0}.wi-op-activity-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.wi-op-activity-heading{display:flex;flex-direction:column;min-width:0}.wi-op-activity-title{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))}.wi-op-activity-currency{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-op-activity-list{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}.wi-op-activity-item{display:flex;align-items:flex-start;gap:6px;padding:12px 0}.wi-op-activity-item+.wi-op-activity-item{border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-op-activity-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;overflow:hidden;flex-shrink:0;background:var(--ds-surface-medium, #f5f7fa)}.wi-op-activity-avatar img{width:100%;height:100%;object-fit:cover}.wi-op-activity-initial{font-family:inherit;font-size:13px;font-weight:600;line-height:1;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.wi-op-activity-copy{display:flex;flex-direction:column;flex:1 1 0;min-width:0}.wi-op-activity-meta{display:flex;align-items:center;gap:6px;min-width:0}.wi-op-activity-peer{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wi-op-activity-sep{width:1px;height:14px;flex-shrink:0;background:var(--ds-border-medium, rgba(0, 0, 0, .18))}.wi-op-activity-time{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap;flex-shrink:0}.wi-op-activity-amount{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));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wi-op-badge{display:inline-flex;align-items:center;justify-content:center;padding:3px 6px;border-radius:4px;flex-shrink:0;font-family:inherit;font-size:12px;font-weight:500;line-height:1}.wi-op-badge--claimed{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.wi-op-badge--waiting{background:var(--ds-accent-primary-low, #fff5ee);color:var(--ds-accent-primary-high, #f0640d)}.wi-op-badge--refunded{background:var(--ds-system-red-low, #ffeeee);color:var(--ds-system-red-high, #d20609)}.wi-op-badge--ready{background:var(--ds-system-blue-low, #ecf8fc);color:var(--ds-system-blue-high, #008dca)}.wi-op-footer{display:flex;align-items:center;justify-content:center;padding:16px 24px;flex-shrink:0;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));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))}.wi-drawer-content .wi-op-hero,.wi-drawer-content .wi-op-cta-row,.wi-drawer-content .wi-op-panel,.wi-drawer-content .wi-op-features,.wi-drawer-content .wi-op-activity,.wi-drawer-content .wi-op-footer{padding-left:16px;padding-right:16px}
12
+ `);import{Fragment as Xl,jsx as J,jsxs as tt}from"react/jsx-runtime";var Fy=6,Uy={claimed:"Claimed",waiting:"Waiting",refunded:"Refunded",ready:"Ready"};function em(e,t){let r;try{r=BigInt(e||"0")}catch{return"0.00"}let n=r<0n;n&&(r=-r);let o,i;if(t<=2){let a=10n**BigInt(t);o=r/a,i=r%a*10n**BigInt(2-t)}else{let a=r/10n**BigInt(t-2);o=a/100n,i=a%100n}return`${n?"-":""}${jy(o.toString())}.${i.toString().padStart(2,"0")}`}function jy(e){let t="";for(let r=0;r<e.length;r++){let n=e.length-r;r>0&&n%3===0&&(t+=","),t+=e[r]}return t}function Wy(e){if(!e)return"";let t=e<1e12?e*1e3:e,r=Math.max(0,Math.floor((Date.now()-t)/1e3));if(r<60)return"just now";let n=Math.floor(r/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);if(o<24)return`${o}h ago`;let i=Math.floor(o/24);if(i<30)return`${i}d ago`;let a=Math.floor(i/30);return a<12?`${a}mo ago`:`${Math.floor(a/12)}y ago`}function Gy(e){let t=e.trim();return t?t.startsWith("@")?t:`@${t}`:""}function ls({env:e="production",balanceDisplay:t,balanceIconUrl:r,isBalanceLoading:n,summary:o,logoSrc:i,heroSrc:a,onBack:s,onClose:l,onSend:d,onClaim:c,onActivity:b,onRepliesSeen:f,onBoard:m,onGetToken:y,getTokenSlot:g}){let u=o?.activity??[],p=u.length>0,w=o?.claimableCount??0,h=o?.repliesWaitingCount??0,x=o?.isLoading??!1,k=o?.xConnected??!1,R=on.useCallback(A=>{window.open(Hf(e,A),"_blank","noopener,noreferrer")},[e]),I=on.useCallback(()=>d?d():R("send"),[d,R]),C=on.useCallback(()=>c?c():R("claim"),[c,R]),S=on.useCallback(()=>{if(f?.(),b)return b();R("activity")},[b,f,R]),E=on.useCallback(()=>m?m():R("board"),[m,R]),M=on.useCallback(()=>{if(y)return y();window.open(_f(e),"_blank","noopener,noreferrer")},[y,e]),B=on.useMemo(()=>!o||w<=0?null:em(o.claimableTotalRaw,o.claimableDecimals??18),[o,w]),L=on.useMemo(()=>u.slice(0,Fy),[u]),z=on.useCallback(A=>{A.currentTarget.style.display="none"},[]);return tt(Xl,{children:[tt("div",{className:"wi-sticky-header",children:[tt("div",{className:"wi-header wi-header--receive",children:[J("button",{type:"button",className:"wi-header-back",onClick:s,"aria-label":"Back",children:J($r,{size:24})}),J("span",{className:"wi-op-header-title",children:i?J("img",{src:i,alt:"ONEpop",className:"wi-op-logo-img",height:24,draggable:!1,onError:z}):J(Jf,{className:"wi-op-logo"})}),J("button",{type:"button",className:"wi-header-action",onClick:l,"aria-label":"Close",children:J(Nr,{size:24})})]}),J("hr",{className:"wi-divider"})]}),tt("div",{className:"wi-op-scroll","data-vaul-no-drag":!0,children:[tt("section",{className:"wi-op-hero",children:[tt("div",{className:"wi-op-hero-copy",children:[tt("h2",{className:"wi-op-hero-title",children:[J("span",{children:"Send money with"}),tt("span",{className:"wi-op-hero-title-row",children:["just an",J(Yf,{size:20,className:"wi-op-x-badge"}),"@handle."]})]}),J("p",{className:"wi-op-hero-sub",children:"They don't even need a wallet yet."})]}),J("div",{className:"wi-op-hero-art","aria-hidden":!0,children:a?J("img",{src:a,alt:"",className:"wi-op-hero-img",draggable:!1,onError:z}):J($f,{})})]}),tt("section",{className:"wi-op-panel",children:[tt("div",{className:"wi-op-balance-card",children:[tt("div",{className:"wi-op-balance-head",children:[J("span",{className:"wi-op-balance-label",children:"Available"}),g??tt("button",{type:"button",className:"wi-op-link-btn",onClick:M,"data-track":"onepop_get_token",children:[J("span",{children:"Get ONEUSD"}),J(Ri,{size:12})]})]}),J("div",{className:"wi-op-balance-body",children:n?J("div",{className:"wi-skeleton-block",style:{width:140,height:32}}):tt(Xl,{children:[r&&J("img",{src:r,alt:"","aria-hidden":!0,className:"wi-op-balance-icon",width:24,height:24,draggable:!1,onError:z}),J("span",{className:"wi-op-balance-value",children:t??"0.00"})]})})]}),tt("div",{className:"wi-op-action-row","aria-label":"ONEpop actions",children:[tt("button",{type:"button",className:"wi-op-action-card",onClick:I,"aria-label":"Send POP","data-track":"onepop_send",children:[J(Qf,{size:24}),J("span",{children:"Send POP"})]}),tt("button",{type:"button",className:"wi-op-action-card",onClick:C,"aria-label":"Claim POPs","data-track":"onepop_claim",children:[J(Vf,{size:24}),J("span",{children:"Claim POPs"})]}),k&&tt("button",{type:"button",className:"wi-op-action-card",onClick:S,"aria-label":"Activity","data-track":"onepop_activity",children:[J(qf,{size:24}),J("span",{children:"Activity"})]})]})]}),J("section",{className:"wi-op-cta-row",children:x?J("div",{className:"wi-skeleton-block wi-op-cta-skeleton",style:{height:40}}):tt(Xl,{children:[!p&&w<=0&&J("button",{type:"button",className:"wi-op-cta wi-op-cta--gradient",onClick:I,"data-track":"onepop_send_first",children:"Send your first POP!"}),w>0?J("button",{type:"button",className:"wi-op-cta wi-op-cta--purple",onClick:C,"data-track":"onepop_claim_banner",children:`${w} POP${w===1?"":"s"} waiting to claim (total ${B})`}):!p&&J("button",{type:"button",className:"wi-op-cta wi-op-cta--purple",onClick:E,"data-track":"onepop_claim_maybe",children:"You might have POPs waiting"}),h>0&&J("button",{type:"button",className:"wi-op-cta wi-op-cta--outline",onClick:S,"data-track":"onepop_replies",children:`${h} ${h===1?"reply":"replies"} waiting`})]})}),p?tt("section",{className:"wi-op-activity",children:[tt("div",{className:"wi-op-activity-head",children:[tt("div",{className:"wi-op-activity-heading",children:[J("span",{className:"wi-op-activity-title",children:"Recent activity"}),J("span",{className:"wi-op-activity-currency",children:"Currency: ONEUSD"})]}),tt("button",{type:"button",className:"wi-op-link-btn",onClick:S,"data-track":"onepop_see_all_activity",children:[J("span",{children:"See all activity"}),J(Ri,{size:16})]})]}),J("ul",{className:"wi-op-activity-list",children:L.map(A=>J(Hy,{item:A},A.id))})]}):tt("section",{className:"wi-op-features",children:[J(Zl,{icon:J(Kf,{size:20}),title:"No wallet address needed",desc:"just their @handle"}),J(Zl,{icon:J(Zf,{size:20}),title:"Claim instantly",desc:"social login, zero gas"}),J(Zl,{icon:J(Xf,{size:20}),title:"Refund anytime",desc:"get it back if unclaimed"})]})]}),J("div",{className:"wi-op-footer",children:J("span",{children:"Powered by ONEpop"})})]})}function Zl({icon:e,title:t,desc:r}){return tt("div",{className:"wi-op-feature",children:[J("span",{className:"wi-op-feature-icon","aria-hidden":!0,children:e}),tt("span",{className:"wi-op-feature-copy",children:[J("span",{className:"wi-op-feature-title",children:t}),J("span",{className:"wi-op-feature-desc",children:r})]})]})}function Hy({item:e}){let t=Gy(e.handle),r=e.direction==="sent"?`Sent to ${t}`:`Claimed from ${t}`,n=t.replace("@","").charAt(0).toUpperCase()||"?";return tt("li",{className:"wi-op-activity-item",children:[J("span",{className:"wi-op-activity-avatar","aria-hidden":!0,children:e.avatarUrl?J("img",{src:e.avatarUrl,alt:"",width:30,height:30,draggable:!1,onError:o=>{o.currentTarget.style.display="none"}}):J("span",{className:"wi-op-activity-initial",children:n})}),tt("span",{className:"wi-op-activity-copy",children:[tt("span",{className:"wi-op-activity-meta",children:[J("span",{className:"wi-op-activity-peer",children:r}),J("span",{className:"wi-op-activity-sep","aria-hidden":!0}),J("span",{className:"wi-op-activity-time",children:Wy(e.timestamp)})]}),J("span",{className:"wi-op-activity-amount",children:em(e.amountRaw,e.decimals)})]}),J("span",{className:Re("wi-op-badge",`wi-op-badge--${e.status}`),"data-status":e.status,children:Uy[e.status]})]})}import*as rm from"react";import{jsx as tm,jsxs as _y}from"react/jsx-runtime";var nm=rm.forwardRef(function({className:t,children:r,...n},o){return _y("button",{...n,ref:o,type:"button",className:"wi-op-link-btn","data-track":"onepop_get_token",children:[tm("span",{children:"Get ONEUSD"}),tm(Ri,{size:12})]})});import{Fragment as Jl,jsx as N,jsxs as V}from"react/jsx-runtime";var qy="On-ramp is not available in your region.";function Yy(e){if(typeof window>"u"||!e?.length)return!1;let{origin:t,pathname:r}=window.location,n=t+r;return e.some(o=>n===o||n.startsWith(`${o}/`))}function Ky(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Zy(e){let t=e.toLowerCase().replace(/^0x/,""),r=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),n=parseInt(r.slice(0,4),16)%360,o=(n+60+parseInt(r.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${n} 85% 65%), hsl(${o} 80% 55%))`}function Xy(e,t=.5){let r=q.useRef(null),n=q.useRef(null),[o,i]=q.useState(1);return q.useLayoutEffect(()=>{let a=r.current,s=n.current;if(!a||!s)return;let l=()=>{let c=a.clientWidth;if(!c)return;let b=s.cloneNode(!0);b.style.setProperty("--wi-total-scale","1"),b.style.position="absolute",b.style.left="-9999px",b.style.top="-9999px",b.style.visibility="hidden",b.style.maxWidth="none",b.style.width="max-content",a.appendChild(b);let f=b.offsetWidth;a.removeChild(b);let m=f>c?Math.max(t,c/f):1;i(m)};l();let d=new ResizeObserver(l);return d.observe(a),()=>d.disconnect()},[e,t]),{containerRef:r,valueRef:n,scale:o}}function im({align:e="end",sideOffset:t=12,className:r,children:n}){let{env:o,theme:i,isMobile:a,open:s,drawerDirection:l,modal:d,showBalance:c,showForgeToken:b,showGameToken:f,showQR:m,showBridge:y,qrLogoSrc:g,walletAddress:u,accountName:p,sendAccounts:w,profileImageUrl:h,connectorName:x,preferredTokens:k,close:R,onSelectWallet:I,onCopyAddress:C,onBuy:S,onDisconnect:E,disconnectLabel:M,termsUrl:B,termsLabel:L,privacyUrl:z,privacyLabel:A,portalStyle:U,navContent:oe,navPosition:Y,footerContent:G,view:H,setView:ie,selectedSendToken:te,setSelectedSendToken:O,selectedDetailToken:Z,setSelectedDetailToken:_,showPortfolio:ce,showOnePop:xe,onePopSummary:he,onOnePopOpen:fe,onOnePopSend:ge,onOnePopClaim:we,onOnePopActivity:Ye,onOnePopRepliesSeen:be,onePopLogoSrc:Te,onePopGetTokenSlot:it,onePopHeroSrc:We,portfolioTitle:_e,portfolioSections:Be,showTotalAssets:rt,totalAssetsLabel:Et,sendTransaction:ft,getTransactionReceipt:Ct,estimateGas:Se,onOutlink:wt,lpBalanceReader:yt,stakingRewardsReader:St,bridgeTokens:Ke,bridgeHistory:Xe,getBridgeQuote:$t,getBridgeToTokens:At,getBridgeApproval:zt,approveBridge:Mt,submitBridge:nt,onReceive:Ge,onSend:at,onBuyDisabledMessage:Nt,onBridgeDisabledMessage:Pe,onSendDisabledMessage:st}=Dn(),[_t,F]=q.useState();q.useEffect(()=>{F(Dp()??(To()?Vy.default:void 0))},[]);let ke=p??x??_t??"Account",[P,ae]=q.useState(null),pe=q.useRef(void 0),me=q.useCallback(T=>{ae(T),clearTimeout(pe.current),pe.current=setTimeout(()=>ae(null),4e3)},[]);q.useEffect(()=>()=>clearTimeout(pe.current),[]);let Je=!!Nt,ar=q.useCallback(()=>{if(Je){me(Nt);return}let T=S?.();T&&typeof T.then=="function"&&T.catch(()=>{me(Nt??qy)})},[Je,Nt,S,me]),Qt=!!Pe,Lt=!!st,{tokens:hr,isLoading:br}=Bn(o,u,s&&c),{statsMap:Vt}=zn(o,c),{aprPercent:sr}=fp(),{categoryMap:X,infoMap:Ee}=gp(o,c),j=c&&rt,{displayValue:ze,isLowerBound:ee,isLoading:$e}=hp(o,u,s&&j),[xn,eo]=q.useState(!1),qr=q.useRef(null),[Yr,Hi]=q.useState(0),{holdings:to,isLoading:_i}=cp(o,u,s&&c&&b),Qi=q.useMemo(()=>to.map(T=>T.token),[to]),{imageMap:ko}=pp(o,Qi,b&&to.length>0),Vi=kp(o),lr=q.useMemo(()=>xp({env:o,tokens:hr,pinnedTokens:Vi,preferredTokens:k,statsMap:Vt,categoryMap:X,showGameToken:f}),[hr,o,Vt,f,X,Vi,k]),qi=q.useMemo(()=>{if(!b)return[];let T=new Set(hr.map(re=>re.address.toLowerCase()));return[...to].filter(re=>!T.has(re.token.toLowerCase())).sort((re,et)=>{let Xr=pt(re.value)??new om(0);return(pt(et.value)??new om(0)).minus(Xr).toNumber()})},[to,b,hr]),Kr=q.useRef(!1),[qt,ro]=q.useState(null),W=q.useRef(void 0),ct=qt?.chainId??te?.chainId??lr[0]?.chainId??0,{transactionUrl:er}=ii(o,ct,qt?.txHash,!!(qt?.txHash&&ct)),Ae=q.useCallback(T=>{Kr.current=!0,ie(T)},[ie]),[Zr,Ft]=q.useState("recipient"),dr=q.useCallback(()=>{O(null),Ft("recipient"),Ae("wallet")},[O,Ae]),He=q.useCallback((T,re="recipient")=>{if(Lt){me(st);return}Ft(re),O(T),Ae("send")},[Lt,st,me,O,Ae]),dn=q.useCallback(T=>{_(T),Ae("token-detail")},[_,Ae]),Ro=q.useCallback(()=>{fe?.(),Ae("onepop")},[fe,Ae]),oh=q.useCallback(()=>{_(null),Ae("wallet")},[_,Ae]),ih=q.useCallback(T=>{He(T,"recipient")},[He]),Yi=Ut("apps.json",o,T=>Mr(T?.gametokenBridge,o)),Ed=Ut("apps.json",o,T=>T?.gametokenSites),ah=q.useCallback(()=>{if(Qt){me(Pe);return}if(Yi){if(Yy(Ed)){window.location.assign(Yi);return}window.open(Yi,"_blank","noopener,noreferrer")}},[Qt,Pe,Yi,Ed,me]),sh=q.useCallback(T=>{clearTimeout(W.current),O(null),Ae("wallet"),ro({status:"pending",txHash:T.txHash,chainId:T.chainId,description:`${T.amount} ${T.tokenSymbol} to ${tr(T.recipient)}`})},[O,Ae]),lh=q.useCallback(T=>{let re=te?.chainId;O(null),Ae("wallet"),!(!T||!re)&&(ro(et=>({status:"success",txHash:T,chainId:re,description:et?.txHash===T?et.description:"Tap to see your transaction"})),clearTimeout(W.current),W.current=setTimeout(()=>ro(null),5e3))},[te?.chainId,O,Ae]),dh=q.useCallback(T=>{let re=T.txHash;re&&(ro({status:"error",txHash:re,chainId:T.chainId,description:T.message}),clearTimeout(W.current),W.current=setTimeout(()=>ro(null),5e3))},[]),ei=q.useMemo(()=>{if(Ge)return Ge;if(m)return()=>Ae("qr")},[Ge,m,Ae]),Ki=q.useMemo(()=>{if(at)return at;if(lr.length===0)return;let T=lr[0];return()=>He(T,"token")},[at,lr,He]),Ad=q.useCallback(()=>{if(Lt){me(st);return}Ki?.()},[Lt,st,Ki,me]);q.useEffect(()=>{s||(Kr.current=!1,Ft("recipient"))},[s]);let Md=q.useRef(null);q.useEffect(()=>{let T=Md.current;if(!T||!a)return;let re=et=>{et.pointerType==="touch"&&et.stopPropagation()};return T.addEventListener("pointerdown",re),()=>T.removeEventListener("pointerdown",re)},[a]);let[Co,Ld]=q.useState(!1),Qs=q.useRef(void 0),[ti,ri]=q.useState(!1);q.useEffect(()=>{if(!ti)return;let T=()=>ri(!1),re=Xr=>{Xr.key==="Escape"&&ri(!1)},et=setTimeout(()=>{document.addEventListener("mousedown",T,!0),document.addEventListener("keydown",re,!0)},0);return()=>{clearTimeout(et),document.removeEventListener("mousedown",T,!0),document.removeEventListener("keydown",re,!0)}},[ti]),q.useEffect(()=>{ri(!1)},[u]),q.useEffect(()=>()=>clearTimeout(Qs.current),[]),q.useEffect(()=>()=>clearTimeout(W.current),[]),q.useEffect(()=>{let T=qr.current;if(!T||G===null){Hi(0);return}let re=()=>{Hi(T.offsetHeight)};if(re(),typeof ResizeObserver>"u")return;let et=new ResizeObserver(re);return et.observe(T),()=>et.disconnect()},[G]);let Dd=q.useCallback(async()=>{if(!Co)try{await navigator.clipboard.writeText(u),Ld(!0),clearTimeout(Qs.current),Qs.current=setTimeout(()=>Ld(!1),2e3),C?.(u,!0)}catch{C?.(u,!1)}},[u,C,Co]),Zi=q.useCallback(T=>{T.currentTarget.setAttribute("data-loaded","true")},[]),Pd=q.useMemo(()=>({background:Zy(u)}),[u]),Xi=q.useMemo(()=>h||Rn(o,u,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[h,o,u,i]),Vs=q.useMemo(()=>Ky(ze),[ze]),{containerRef:ch,valueRef:ph,scale:uh}=Xy(xn?"\u2022\u2022\u2022\u2022\u2022\u2022":ze),Od=B||z?V("div",{className:"wi-legal-links",children:[B&&N("a",{className:"wi-legal-link",href:B,target:"_blank",rel:"noopener noreferrer","data-track":"terms_link",onClick:T=>Ot(T,B,{category:"terms",origin:"terms"},wt),children:L}),B&&z&&N("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),z&&N("a",{className:"wi-legal-link",href:z,target:"_blank",rel:"noopener noreferrer","data-track":"privacy_link",onClick:T=>Ot(T,z,{category:"privacy",origin:"privacy"},wt),children:A})]}):null,Bd=E?V("button",{type:"button",className:"wi-disconnect-btn","data-track":"disconnect",onClick:()=>{E(),R()},children:[N(hc,{size:16}),N("span",{className:"wi-disconnect-label",children:M})]}):null,fh=c&&!oe,mh=!j,gh=V("button",{type:"button",className:Re("wi-action-card",Lt&&"wi-action-card--dimmed"),onClick:Ad,disabled:!Lt&&!Ki,"aria-disabled":Lt||void 0,"aria-label":"Send","data-track":"send_open",children:[N(xc,{size:20}),N("span",{children:"Send"})]}),hh=fh?V("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[V("button",{type:"button",className:Re("wi-action-card",Je&&"wi-action-card--dimmed"),onClick:ar,disabled:!S&&!Je,"aria-disabled":Je||void 0,"aria-label":"Buy","data-track":"buy",children:[N(Rc,{size:20}),N("span",{children:"Buy"})]}),y?V("button",{type:"button",className:Re("wi-action-card",Qt&&"wi-action-card--dimmed"),onClick:ah,"aria-disabled":Qt||void 0,"aria-label":"Bridge","data-track":"bridge_open",children:[N(Cc,{size:20}),N("span",{children:"Bridge"})]}):V("button",{type:"button",className:"wi-action-card",onClick:ei,disabled:!ei,"aria-label":"Receive","data-track":"receive",children:[N(ua,{size:20}),N("span",{children:"Receive"})]}),mh&&gh,xe&&V("button",{type:"button",className:"wi-action-card",onClick:Ro,"aria-label":"Open ONEpop","data-track":"onepop_open",children:[N(Kl,{size:20}),N("span",{children:"ONEpop"})]}),ce?V("button",{type:"button",className:"wi-action-card",onClick:()=>Ae("portfolio"),"aria-label":"View portfolio","data-track":"portfolio_open",children:[N(kc,{size:20}),N("span",{children:"Portfolio"})]}):y?V("button",{type:"button",className:"wi-action-card",onClick:ei,disabled:!ei,"aria-label":"Receive","data-track":"receive",children:[N(ua,{size:20}),N("span",{children:"Receive"})]}):null]}):null,bh=V("div",{className:Re("wi-view-inner",Kr.current&&"wi-view-wallet"),children:[j&&V("div",{className:"wi-total-section",children:[V("div",{className:"wi-total-head",children:[N("span",{className:"wi-total-label",children:Et}),N("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:T=>{T.stopPropagation(),eo(re=>!re)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),T.stopPropagation(),eo(re=>!re))},"aria-label":xn?"Show balance":"Hide balance","data-track":"balance_toggle",children:xn?N(wc,{}):N(bc,{})})]}),V("div",{className:"wi-total-body",children:[N("div",{className:"wi-total-value-wrap",ref:ch,children:$e?N("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):N("div",{className:"wi-total-value","data-hidden":xn||void 0,ref:ph,style:{"--wi-total-scale":uh},children:xn?N("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):V(Jl,{children:[ee&&N("span",{className:"wi-total-lte",children:"\u2264"}),N("span",{className:"wi-total-currency",children:"$"}),N("span",{className:"wi-total-amount",children:Vs.main}),Vs.decimal&&N("span",{className:"wi-total-decimal",children:Vs.decimal})]})})}),N("button",{type:"button",className:Re("wi-total-send",Lt&&"wi-total-send--dimmed"),onClick:Ad,disabled:!Lt&&!Ki,"aria-disabled":Lt||void 0,"aria-label":"Send","data-track":"send_open",children:N(vc,{size:27})})]})]}),Y==="top"&&(oe?N("div",{className:"wi-nav-fixed",children:oe}):hh),c&&N("div",{ref:Md,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:V("div",{className:"wi-token-list",children:[br&&Array.from({length:5},(T,re)=>V("div",{className:"wi-skeleton-item",children:[V("div",{className:"wi-skeleton-left",children:[N("div",{className:"wi-skeleton-block wi-skeleton-icon"}),V("div",{className:"wi-skeleton-lines",children:[N("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),N("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),V("div",{className:"wi-skeleton-right",children:[N("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),N("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},re)),!br&&lr.length===0&&!b&&N("div",{className:"wi-empty",children:"No Tokens Found"}),lr.map(T=>{let re=Vt.get(mn(T.chainId,T.address)),et=re?parseFloat(re.percent_change_24h):null,Xr=et!==null&&et>=0,Ys=li(o,T.chainId),Th=xl(T.address);return V("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>dn(T),"aria-label":`View ${T.symbol} detail`,"data-track":"token_detail","data-track-id":T.symbol,children:[V("div",{className:"wi-token-left",children:[V("div",{className:"wi-token-icon-wrap",children:[N("img",{src:T.icon_url,alt:T.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Zi,onError:Ks=>{Ks.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Ys&&N("img",{src:Ys,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Ks=>{Ks.currentTarget.style.display="none"}})]}),V("div",{className:"wi-token-info",children:[V("span",{className:"wi-token-name-row",children:[N("span",{className:"wi-token-name",children:T.symbol}),Th&&sr!==null&&N("span",{className:"wi-token-apr",children:Ma(sr)})]}),re&&V("div",{className:"wi-token-price-row",children:[N("span",{className:"wi-token-price",children:co(re.price)}),N("span",{className:"wi-token-change","data-positive":Xr,"data-zero":et===0||void 0,children:et!==null&&(et===0?"0%":`${Xr?"+":"-"}${(Xr?Math.floor:Math.ceil)(Math.abs(et)*100)/100}%`)})]})]})]}),V("div",{className:"wi-token-right",children:[N("span",{className:"wi-token-balance",children:kn(T.quantity.numeric,T.quantity.decimals)}),re&&N("span",{className:"wi-token-value",children:fa(T.quantity.numeric,T.quantity.decimals,re.price)})]})]},`${T.address}-${T.chainId}`)}),b&&_i&&Array.from({length:3},(T,re)=>V("div",{className:"wi-skeleton-item",children:[V("div",{className:"wi-skeleton-left",children:[N("div",{className:"wi-skeleton-block wi-skeleton-icon"}),V("div",{className:"wi-skeleton-lines",children:[N("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),N("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),V("div",{className:"wi-skeleton-right",children:[N("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),N("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${re}`)),b&&!_i&&!br&&lr.length===0&&qi.length===0&&N("div",{className:"wi-empty",children:"No Tokens Found"}),b&&qi.map(T=>{let re=ko.get(T.token)||"",et=li(o,mt[o].cross);return V("div",{className:"wi-token-item",children:[V("div",{className:"wi-token-left",children:[V("div",{className:"wi-token-icon-wrap",children:[N("img",{src:re||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:T.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Zi,onError:Xr=>{Xr.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),et&&N("img",{src:et,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Xr=>{Xr.currentTarget.style.display="none"}})]}),V("div",{className:"wi-token-info",children:[N("span",{className:"wi-token-name",children:T.token_name}),N("div",{className:"wi-token-price-row",children:V("span",{className:"wi-token-price",children:[kn(T.current_price,18)," CROSS"]})})]})]}),V("div",{className:"wi-token-right",children:[N("span",{className:"wi-token-balance",children:kn(T.balance,18)}),N("span",{className:"wi-token-value",children:co(T.current_value_usd)})]})]},`forge-${T.token}`)})]})}),Y==="bottom"&&oe&&N("div",{className:"wi-nav-fixed",children:oe}),Bd&&N("div",{className:"wi-wallet-disconnect-row",children:Bd})]},"wallet"),wh=ce?N("div",{className:Re("wi-view-inner wi-portfolio-body",Kr.current&&"wi-view-portfolio"),children:N(jo,{env:o,theme:i,walletAddress:u,showHeader:!1,onOutlink:wt,lpBalanceReader:yt,stakingRewardsReader:St,sendTransaction:ft,estimateGas:Se,sections:Be})},"portfolio"):null,yh=te?N("div",{className:Re("wi-view-inner wi-send-body",Kr.current&&"wi-view-send"),children:N(Ia,{env:o,theme:i,walletAddress:u,accountName:ke,accounts:w,initialStep:Zr,token:te,tokens:lr,onTokenChange:O,sendTransaction:ft,getTransactionReceipt:Ct,estimateGas:Se,getTokenPriceUsd:T=>{let re=Vt.get(mn(T.chainId,T.address));if(!re?.price)return;let et=parseFloat(re.price);return Number.isFinite(et)?et:void 0},onClose:R,onBackToWallet:dr,onSubmitted:sh,onSuccess:lh,onFailed:dh,onOutlink:wt})},"send"):null,xh=q.useMemo(()=>Ke||lr.map(T=>{let re=Vt.get(mn(T.chainId,T.address)),et=re?.price?parseFloat(re.price):void 0;return{name:T.name,symbol:T.symbol,chainId:T.chainId,address:T.address,decimals:T.quantity.decimals,balance:Bo(T.quantity.numeric,T.quantity.decimals),iconUrl:T.icon_url,priceUsd:Number.isFinite(et)?et:void 0}}),[Ke,Vt,lr]),vh=N("div",{className:Re("wi-view-inner wi-bridge-body",Kr.current&&"wi-view-send"),children:N(Go,{env:o,walletAddress:u,tokens:xh,history:Xe,termsUrl:B,getQuote:$t,getToTokens:At,getApproval:zt,approveBridge:Mt,submitBridge:nt,onClose:R,onBackToWallet:dr})},"bridge"),kh=Z?N("div",{className:Re("wi-view-inner wi-token-detail-body",Kr.current&&"wi-view-send"),children:N(jf,{env:o,isMobile:a,token:Z,walletAddress:u,stat:Vt.get(mn(Z.chainId,Z.address)),tokenInfo:Ee.get(La(Z.chainId,Z.address)),showBalance:c,onBack:oh,onClose:R,onSend:ih,onOutlink:wt})},"token-detail"):null,So=q.useMemo(()=>{let T=mt[o].cross;return lr.find(re=>re.chainId===T&&xl(re.address))??lr.find(re=>re.chainId===T&&re.symbol.toUpperCase().includes("ONEUSD"))},[lr,o]),Rh=q.useMemo(()=>{if(So)return kn(So.quantity.numeric,So.quantity.decimals)},[So]),Ch=xe?N("div",{className:Re("wi-view-inner wi-onepop-body",Kr.current&&"wi-view-send"),children:N(ls,{env:o,balanceDisplay:Rh,balanceIconUrl:So?.icon_url,isBalanceLoading:br&&!So,summary:he,logoSrc:Te,heroSrc:We,getTokenSlot:it,onBack:dr,onClose:R,onSend:ge,onClaim:we,onActivity:Ye,onRepliesSeen:be})},"onepop"):null,qs=!!I&&p?.trim().toLowerCase()!=="my wallet",zd=V(Jl,{children:[V("span",{className:"wi-receive-avatar",children:[N("span",{className:"wi-avatar-fallback",style:Pd}),Xi&&N("img",{src:Xi,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:Zi,onError:T=>{T.currentTarget.style.display="none"}})]}),N("span",{className:"wi-receive-account-name",children:ke}),qs&&N("span",{className:"wi-receive-chevron","data-open":ti,"aria-hidden":"true",children:N(Lr,{size:16})})]}),Sh=V("div",{className:Re("wi-view-inner wi-qr-body",Kr.current&&"wi-view-qr"),children:[V("div",{className:"wi-receive-section",children:[qs?N("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{ri(!0),I?.()},"aria-label":"Switch account",children:zd}):N("div",{className:"wi-receive-account",children:zd}),V("div",{className:"wi-qr-block",children:[V("div",{className:"wi-qr-box",children:[N(Qy,{value:u,size:180,level:"H",marginSize:2,...g&&{imageSettings:{src:g,height:33,width:33,excavate:!0}}}),!g&&N("div",{className:"wi-qr-logo",children:N(yc,{size:33})})]}),N("p",{className:"wi-qr-address",children:u})]}),V("button",{type:"button",className:"wi-qr-copy-btn",onClick:Dd,"data-track":"address_copy",children:[N("span",{className:"wi-qr-copy-icon",children:Co?N(vn,{size:16}):N(so,{size:16})}),N("span",{className:"wi-qr-copy-text",children:Co?"Copied!":"Copy address"})]})]}),Od&&N("div",{className:"wi-receive-footer",children:Od})]},"qr"),Nh=H==="qr"||H==="portfolio"||H==="send"||H==="bridge",Fd=G!==null?N("div",{className:"wi-builtin-footer",children:G}):null,Ud=V("div",{className:"wi-account-text",children:[qs?V("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{ri(!0),I?.()},"aria-label":"Switch account","aria-expanded":ti,children:[N("span",{className:"wi-account-name",children:ke}),N("span",{className:"wi-account-switch","data-open":ti,"aria-hidden":"true",children:N(Lr,{size:20})})]}):N("div",{className:"wi-account-row",children:N("span",{className:"wi-account-name",children:ke})}),V("button",{type:"button",className:"wi-address-row-btn",onClick:Dd,"aria-label":"Copy address","data-track":"address_copy",children:[N("span",{className:"wi-account-address",children:tr(u)}),N("span",{className:"wi-account-copy","data-copied":Co,children:Co?N(vn,{size:12}):N(so,{size:12})})]})]}),jd=V(Jl,{children:[n,H==="qr"?N("div",{className:"wi-sticky-header",children:V("div",{className:"wi-header wi-header--receive",children:[N("button",{type:"button",className:"wi-header-back",onClick:dr,"aria-label":"Back",children:N($r,{size:24})}),N("span",{className:"wi-receive-title",children:"Receive"}),N("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:N(Nr,{size:24})})]})}):H==="send"||H==="bridge"||H==="token-detail"||H==="onepop"?null:Nh?V("div",{className:"wi-sticky-header",children:[V("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[N("button",{type:"button",className:"wi-header-back",onClick:dr,"aria-label":"Back",children:N($r,{size:24})}),N("div",{className:"wi-account-block wi-account-block--sub-account",children:Ud}),N("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:N(Nr,{size:24})})]}),N("hr",{className:"wi-divider"})]}):V("div",{className:"wi-sticky-header",children:[V("div",{className:"wi-header wi-header--wallet",children:[V("div",{className:"wi-account-block",children:[V("div",{className:"wi-avatar",children:[N("div",{className:"wi-avatar-fallback",style:Pd}),Xi&&N("img",{src:Xi,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:Zi,onError:T=>{T.currentTarget.style.display="none"}})]}),Ud]}),V("div",{className:"wi-header-actions",children:[m&&y&&N("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:ei,"aria-label":"Show QR code","data-track":"receive",children:N(ua,{size:20})}),N("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:N(Nr,{size:24})})]})]}),N("hr",{className:"wi-divider"})]}),V("div",{className:"wi-view-container",children:[H==="wallet"&&bh,H==="qr"&&Sh,H==="portfolio"&&wh,H==="send"&&yh,H==="bridge"&&vh,H==="token-detail"&&kh,H==="onepop"&&Ch]}),(H==="wallet"||H==="onepop")&&P&&N("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:P}),H==="wallet"&&qt&&V("a",{className:"wi-send-toast",href:er??"#",target:"_blank",rel:"noopener noreferrer",onClick:T=>{if(!er){T.preventDefault();return}Ot(T,er,{category:"send",origin:"send-transaction",payload:{chainId:qt.chainId,txHash:qt.txHash}},wt)},children:[N("span",{className:"wi-send-toast-icon","data-status":qt.status,"aria-hidden":!0,children:qt.status==="pending"?N("span",{className:"wi-send-toast-spinner"}):qt.status==="error"?N("span",{className:"wi-send-toast-error-dot"}):N(Sc,{size:20})}),V("span",{className:"wi-send-toast-copy",children:[N("span",{className:"wi-send-toast-title",children:qt.status==="pending"?"Sending...":qt.status==="error"?"Send failed":"Send complete"}),N("span",{className:"wi-send-toast-desc",children:qt.status==="pending"||qt.status==="error"?qt.description:"Tap to see your transaction"})]})]}),Fd&&H!=="portfolio"&&H!=="send"&&H!=="token-detail"&&H!=="onepop"&&N("div",{className:"wi-sticky-footer",children:N("div",{className:"wi-footer",ref:qr,children:Fd})})]}),Wd={...U,...Yr>0?{"--wi-footer-height":`${Yr}px`}:null},Gd=q.useCallback(T=>{let re=T.detail.originalEvent.target;re instanceof Element&&re.closest("[data-rd-shell]")!==null&&T.preventDefault()},[]);return a?N(ye,{feature:"wallet_info",children:V(ds.Portal,{children:[d&&N(ds.Overlay,{className:"wi-drawer-overlay"}),V(ds.Content,{className:Re("wi-drawer-content",r),"data-theme":i,"data-vaul-no-drag":l==="left"||l==="right"?!0:void 0,style:Wd,"data-direction":l,"data-no-balance":!c||void 0,"data-has-footer":Yr>0||void 0,"data-view":H,onInteractOutside:Gd,children:[N(ds.Title,{className:"wi-sr-only",children:"My Wallet"}),jd]})]})}):V(ye,{feature:"wallet_info",children:[d&&s&&N("div",{className:"wi-drawer-overlay",onClick:R}),N(cs.Portal,{children:N(cs.Content,{align:e,sideOffset:t,className:Re("wi-popover-content",r),"data-theme":i,style:Wd,"data-no-balance":!c||void 0,"data-has-footer":Yr>0||void 0,"data-view":H,onInteractOutside:Gd,children:jd})})]})}import*as am from"react";function sm({position:e="top",children:t}){let{setNavContent:r,setNavPosition:n}=Dn();return am.useEffect(()=>(r(t),n(e),()=>r(null)),[t,e,r,n]),null}import*as lm from"react";function dm({children:e}){let{setFooterContent:t}=Dn();return lm.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}de(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-accent-primary-high, #f0640d);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #121212);--wi-surface-default: var(--ds-surface-medium, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(255, 255, 255, .1));--wi-border-default: var(--ds-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--ds-border-medium, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--ds-content-highest, #ffffff);--wi-texticon-secondary: var(--ds-content-medium, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(255, 255, 255, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--ds-accent-primary-high, #f0640d);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #ffffff);--wi-surface-default: var(--ds-surface-medium, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(18, 18, 18, .1));--wi-border-default: var(--ds-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--ds-border-medium, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--ds-content-highest, #121212);--wi-texticon-secondary: var(--ds-content-medium, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(18, 18, 18, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
13
13
  `);de(`.wi-trigger-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border:1px solid rgba(255,255,255,.2);background:#1a2332;border-radius:9999px;cursor:pointer;color:#fff;font-family:inherit;font-size:16px;font-weight:500;line-height:24px;letter-spacing:-.3125px;transition:opacity .15s ease}.wi-trigger-btn:hover{opacity:.85}.wi-trigger-btn[data-theme=light]{background:#f3f6f8;border-color:#1212121a;color:#121212}.wi-trigger-btn[data-mobile]{font-size:14px;padding:6px 12px;gap:6px;line-height:20px}.wi-trigger-address{white-space:nowrap}.wi-divider{height:1px;background:var(--wi-border-default);margin:0;border:none;flex-shrink:0}[data-theme=light] .wi-divider{background:#1212121a}[data-theme=dark] .wi-divider{background:#ffffff1a}
14
14
  `);de(`@keyframes wi-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes wi-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@keyframes wi-slide-in-right{0%{transform:translate(40px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes wi-slide-in-left{0%{transform:translate(-40px);opacity:0}to{transform:translate(0);opacity:1}}
15
15
  `);de(`.wi-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;width:393px;border-radius:24px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--wi-surface-bg);box-shadow:var(--ds-shadow-modal, var(--wi-shadow));animation:wi-fade-in .15s ease-out;height:min(680px,calc(100dvh - 32px));overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(680px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:0;left:0;right:0;width:100%;max-height:100dvh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:100dvh}.wi-popover-content[data-view=qr]{max-height:calc(100dvh - 32px)}.wi-sticky-header{flex-shrink:0;position:relative}.wi-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px}.wi-header--wallet{align-items:flex-start;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--wallet+.wi-divider{display:none}.wi-header--sub-account{align-items:center}.wi-header--sub-account .wi-header-back{width:32px;height:38px}.wi-header--sub-account .wi-header-action{flex-shrink:0}.wi-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wi-account-block--sub-account{align-items:center}.wi-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border-radius:50%;background:var(--wi-surface-bg);box-sizing:border-box;overflow:hidden}.wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-avatar-img{position:relative;z-index:1;width:32px;height:32px;border-radius:50%;object-fit:cover;background:transparent}.wi-account-text{display:flex;flex-direction:column;gap:2px;min-width:0}.wi-account-row{display:flex;align-items:center;gap:8px;min-width:0}.wi-account-row--btn{padding:2px;margin:0;width:fit-content;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;border-radius:6px;transition:background-color .15s ease,opacity .15s ease}.wi-account-row--btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .06))}.wi-account-row--btn:focus-visible{outline:2px solid var(--wi-primary, #f0640d);outline-offset:2px}.wi-account-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-switch{display:inline-flex;align-items:center;justify-content:center;padding:2px 0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));border-radius:4px;flex-shrink:0;transition:color .15s ease,transform .2s ease}.wi-account-switch[data-open=true]{transform:rotate(180deg)}.wi-account-row--btn:hover .wi-account-switch{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-address-row-btn{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;text-align:left;min-width:0;transition:color .15s ease}.wi-address-row-btn:hover .wi-account-address,.wi-address-row-btn:hover .wi-account-copy{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-account-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-copy{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:var(--wi-texticon-tertiary);flex-shrink:0;transition:color .15s ease}.wi-account-copy[data-copied=true]{color:var(--ds-system-green-high, #00a869)}.wi-header-actions{display:flex;align-items:center;gap:16px;flex-shrink:0;margin-top:-4px}.wi-header-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;border-radius:0;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header-action--qr{width:32px;height:32px;border-radius:8px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));transition:background-color .15s ease,color .15s ease}.wi-header-action--qr:hover{background:var(--ds-surface-high, rgba(0, 0, 0, .08));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header--receive{align-items:center;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--receive .wi-header-action,.wi-header--sub-account .wi-header-action{position:absolute;top:24px;right:24px}.wi-receive-title{position:absolute;left:50%;transform:translate(-50%);font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);text-align:center;pointer-events:none}.wi-header-info{flex:1;display:flex;flex-direction:column;gap:8px;min-width:0}.wi-header-title{font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);margin:0}.wi-header-close{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--ds-content-low, #00000066);transition:opacity .15s ease}.wi-header-close:hover{opacity:.7}.wi-total-section{margin:24px 24px 0;padding:0;flex-shrink:0;display:flex;flex-direction:column;gap:8px;border:none;background:transparent;border-radius:12px;color:inherit;font:inherit;text-align:left;width:auto}.wi-action-row{display:flex;align-items:flex-start;gap:8px;width:auto;margin:24px 24px 0}.wi-action-card{appearance:none;display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 8px;border:none;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-align:center;cursor:pointer;transition:background-color .15s ease,color .15s ease}.wi-action-card:hover:not(:disabled){background:#2e3544!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}:root[data-ds-theme=light] .wi-action-card:hover:not(:disabled){background:#e4e8ef!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-action-card:disabled{cursor:default}.wi-action-card>svg{flex-shrink:0}.wi-action-card:not(:disabled){transition:background-color .15s ease,transform .1s ease}.wi-action-card:active:not(:disabled){transform:scale(.93)}.wi-total-head{display:flex;align-items:center;gap:4px}.wi-total-body{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.wi-total-value-wrap{position:relative;flex:1 1 auto;min-width:0}.wi-total-send{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;flex-shrink:0;border:none;border-radius:9px;background:var(--ds-surface-medium, #f5f7fa);cursor:pointer;transition:background-color .15s ease,transform .1s ease}.wi-total-send:hover:not(:disabled){background:#2e3544}:root[data-ds-theme=light] .wi-total-send:hover:not(:disabled){background:#e4e8ef}.wi-total-send:active:not(:disabled){transform:scale(.93)}.wi-total-send:disabled{cursor:default;opacity:.45}.wi-total-send--dimmed{opacity:.4;cursor:pointer}.wi-total-send--dimmed:hover{opacity:.5}.wi-total-label{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.wi-total-eye{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease;border-radius:4px}.wi-total-eye:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-total-eye:focus-visible{outline:1px solid var(--wi-texticon-secondary);outline-offset:2px}.wi-total-value{display:flex;align-items:baseline;gap:0;font-family:inherit;font-weight:600;line-height:1.25;color:var(--ds-content-highest, #000000);font-variant-numeric:tabular-nums;min-height:45px;white-space:nowrap}.wi-total-currency,.wi-total-amount,.wi-total-decimal{font-size:calc(36px * var(--wi-total-scale, 1));color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:calc(22px * var(--wi-total-scale, 1));color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:calc(32px * var(--wi-total-scale, 1));color:var(--wi-texticon-secondary)}.wi-total-skeleton{border-radius:6px}.wi-scrollable-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:8px 0 0;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}.wi-drawer-content .wi-scrollable-body{touch-action:pan-y}[data-theme=light] .wi-scrollable-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-scrollable-body::-webkit-scrollbar{width:4px}.wi-scrollable-body::-webkit-scrollbar-track{background:transparent}.wi-scrollable-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#0003}.wi-nav-fixed{flex-shrink:0;padding:0 24px}.wi-token-list{display:flex;flex-direction:column;gap:0;padding:8px 0}.wi-token-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 24px;border:none;background:transparent;text-align:left;font-family:inherit;width:100%;box-sizing:border-box}.wi-token-item--button{cursor:pointer;background:var(--ds-surface-default, #ffffff);transition:none}.wi-token-item--button:hover{background:#252b39!important}:root[data-ds-theme=light] .wi-token-item--button:hover{background:#eff3f8!important}button.wi-token-item:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px;border-radius:4px}.wi-token-left{display:flex;align-items:center;gap:16px;min-width:0}.wi-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.wi-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain;opacity:0;transition:opacity .2s ease}.wi-token-icon[data-loaded=true]{opacity:1}.wi-token-chain-badge{position:absolute;right:0;bottom:0;width:14px;height:14px;border-radius:50%;background:var(--wi-surface-bg);box-shadow:0 0 0 1.5px var(--wi-surface-bg);object-fit:contain}.wi-token-info{display:flex;flex-direction:column;min-width:0}.wi-token-name-row{display:flex;align-items:center;gap:6px;min-width:0}.wi-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-token-apr{flex-shrink:0;font-family:inherit;font-size:12px;font-weight:600;line-height:1;color:var(--ds-system-purple-high, #9b78ff);background:var(--ds-system-purple-low, #2e2854);padding:4px;border-radius:6px;white-space:nowrap}.wi-token-price-row{display:flex;align-items:center;gap:8px}.wi-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wi-token-change{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap}.wi-token-change[data-positive=true]{color:var(--ds-system-green-high, #00a0a2)}.wi-token-change[data-positive=false]{color:var(--ds-system-red-high, #a80927)}.wi-token-change[data-zero]{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.wi-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.wi-token-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wi-sticky-footer{flex-shrink:0}.wi-footer{padding:16px 24px 24px}.wi-builtin-footer{display:flex;flex-direction:column;gap:8px;align-items:stretch}.wi-wallet-disconnect-row{display:flex;justify-content:flex-end;flex-shrink:0;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-send-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:2;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);box-sizing:border-box;text-decoration:none}.wi-action-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:3;padding:12px 14px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);font-size:14px;line-height:1.4;text-align:center;box-sizing:border-box;animation:wi-action-toast-in .18s ease-out}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-action-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-action-toast{bottom:72px}@keyframes wi-action-toast-in{0%{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}.wi-action-card--dimmed{opacity:.4;cursor:pointer}.wi-action-card--dimmed:hover{opacity:.5}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-send-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-send-toast{bottom:72px}.wi-send-toast:hover{opacity:.92}.wi-send-toast-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;color:var(--ds-accent-primary-high, #f0640d)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(255,159,33,.22);border-top-color:var(--ds-accent-primary-on-inverted, #ff8438);border-radius:50%;animation:wi-send-toast-spin .8s linear infinite}.wi-send-toast-error-dot{width:18px;height:18px;border-radius:50%;background:var(--ds-system-red-default, #ff3358)}@keyframes wi-send-toast-spin{to{transform:rotate(360deg)}}.wi-send-toast-copy{display:flex;min-width:0;flex-direction:column}.wi-send-toast-title{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-inverted, #ffffff)}.wi-send-toast-desc{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-accent-primary-on-inverted, #ff8438)}.wi-send-toast-icon[data-status=error]+.wi-send-toast-copy .wi-send-toast-desc{color:var(--ds-system-red-default, #ff3358)}.wi-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:16px;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:color .15s ease}.wi-disconnect-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;flex-shrink:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-receive-avatar .wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-receive-avatar .wi-avatar-img{width:24px;height:24px}.wi-legal-link{color:var(--ds-content-low, rgba(0, 0, 0, .4));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.wi-legal-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-legal-sep{color:inherit}.wi-empty{display:flex;align-items:center;justify-content:center;padding:32px 0;font-family:inherit;font-size:16px;color:var(--wi-texticon-secondary)}.wi-skeleton-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-skeleton-left{display:flex;align-items:center;gap:12px}.wi-skeleton-block{border-radius:6px;background:var(--wi-border-default);position:relative;overflow:hidden}.wi-skeleton-block:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.06) 50%,transparent 100%);animation:wi-shimmer 1.5s ease-in-out infinite}[data-theme=light] .wi-skeleton-block:after{background:linear-gradient(90deg,transparent 0%,rgba(0,0,0,.04) 50%,transparent 100%)}.wi-skeleton-icon{width:32px;height:32px;border-radius:50%;flex-shrink:0}.wi-skeleton-lines{display:flex;flex-direction:column;gap:6px}.wi-skeleton-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.wi-header-back{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-back:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-view-container{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-popover-content[data-view=qr] .wi-view-container,.wi-drawer-content[data-view=qr] .wi-view-container{flex:1;min-height:0}.wi-view-inner{display:flex;flex-direction:column;flex:1;min-height:0}.wi-view-wallet{animation:wi-slide-in-left .25s ease-out}.wi-view-qr,.wi-view-portfolio{animation:wi-slide-in-right .25s ease-out}.wi-qr-body{flex:1;min-height:0;display:flex;flex-direction:column}.wi-portfolio-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-portfolio-body>.wp-embed{flex:1;min-height:0}.wi-portfolio-body .wp-body-inner{padding:16px 16px 32px;gap:32px}.wi-receive-section{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:24px}.wi-receive-account{display:inline-flex;align-items:center;gap:8px;padding:4px 8px 4px 4px;border:0;background:var(--ds-surface-high, #edf1f2);border-radius:9999px;font-family:inherit;color:inherit}.wi-receive-account--btn{cursor:pointer;transition:none}.wi-receive-account--btn:hover{background:#2e3544}:root[data-ds-theme=light] .wi-receive-account--btn:hover{background:#e4e8ef}.wi-receive-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;overflow:hidden;flex-shrink:0}.wi-receive-account-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-receive-account>svg{color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0}.wi-receive-chevron{display:inline-flex;align-items:center;color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0;transition:transform .2s ease}.wi-receive-chevron[data-open=true]{transform:rotate(180deg)}.wi-qr-block{display:flex;flex-direction:column;align-items:center;gap:16px}.wi-qr-box{position:relative;display:flex;align-items:center;justify-content:center;padding:10px;background:#fff;border-radius:6px;overflow:hidden}.wi-qr-logo{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none}.wi-qr-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:16px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;word-break:break-all;max-width:281px;margin:0}.wi-qr-copy-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:12px 16px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);border-radius:12px;cursor:pointer;transition:border-color .15s ease}.wi-qr-copy-btn:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.wi-qr-copy-icon{display:inline-flex;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-qr-copy-text{font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-receive-footer{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-drawer-content .wi-header{padding:16px}.wi-drawer-content .wi-header--receive .wi-header-action,.wi-drawer-content .wi-header--sub-account .wi-header-action{top:16px;right:16px}.wi-drawer-content .wi-total-section,.wi-drawer-content .wi-action-row{margin:16px 16px 0}.wi-drawer-content .wi-nav-fixed{padding:0 16px}.wi-drawer-content .wi-token-item{padding:12px 16px}.wi-drawer-content .wi-wallet-disconnect-row{padding:16px}
16
16
  `);de(`.wi-td-header-title{position:absolute;left:50%;transform:translate(-50%);display:inline-flex;align-items:center;gap:8px;pointer-events:none}.wi-td-header-icon{width:24px;height:24px;object-fit:contain;flex-shrink:0}.wi-td-header-name{font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--wi-texticon-primary, #ffffff)}.wi-td-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;display:flex;flex-direction:column;gap:24px;padding:20px 24px 24px;background:transparent;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .wi-td-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-td-scroll::-webkit-scrollbar{width:4px}.wi-td-scroll::-webkit-scrollbar-track{background:transparent}.wi-td-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-td-scroll::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-td-scroll::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-td-scroll::-webkit-scrollbar-thumb:hover{background:#0003}.wi-td-chart{display:flex;flex-direction:column;gap:14px}.wi-td-chart-panel{display:flex;flex-direction:column;gap:4px}.wi-td-chart-price{font-size:26px;font-weight:700;line-height:1.15;color:var(--wi-texticon-primary, #ffffff)}.wi-td-chart-change{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--ds-system-green-high, #00a869)}.wi-td-chart-change[data-positive=false]{color:var(--wi-error, #e70077)}.wi-td-chart-when{font-weight:400;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-chart-plot{position:relative;width:100%;height:150px}.wi-td-chart-svg{display:block;width:100%;height:150px;overflow:visible;touch-action:none}.wi-td-chart-minmax{fill:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));font-size:11px;font-family:inherit}.wi-td-chart-cursor{stroke:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));stroke-width:1;stroke-dasharray:3 3}.wi-td-chart-skeleton{width:100%;height:150px;border-radius:12px}.wi-td-chart-tabs{display:flex;gap:6px;justify-content:space-between}.wi-td-chart-tab{flex:1;padding:7px 0;border:none;border-radius:8px;background:transparent;cursor:pointer;font-family:inherit;font-size:13px;font-weight:600;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));transition:background .15s ease,color .15s ease}.wi-td-chart-tab[data-active]{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1));color:var(--wi-texticon-primary, #ffffff)}.wi-td-chart-tab:hover:not([data-active]){color:var(--wi-texticon-primary, #ffffff)}.wi-td-balance-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px;border-radius:16px;background:var(--wi-surface-default, rgba(255, 255, 255, .05))}.wi-td-balance-left{display:flex;flex-direction:column;gap:4px;flex:1 1 0;min-width:0}.wi-td-balance-label{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff)}.wi-td-balance-amount{font-size:30px;font-weight:700;line-height:1.15;color:var(--wi-texticon-primary, #ffffff);white-space:nowrap;max-width:100%}.wi-td-balance-fiat{font-size:14px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-send-btn{display:inline-flex;align-items:center;gap:6px;flex-shrink:0;padding:12px 22px;border:none;border-radius:999px;cursor:pointer;font-family:inherit;font-size:15px;font-weight:600;color:var(--wi-on-primary, #ffffff);background:var(--wi-primary, #f0640d);transition:filter .15s ease}.wi-td-send-btn:hover{filter:brightness(1.06)}.wi-td-send-btn:active{filter:brightness(.94)}.wi-td-section{display:flex;flex-direction:column;gap:14px}.wi-td-section-title{margin:0;font-size:18px;font-weight:700;letter-spacing:-.01em;color:var(--wi-texticon-primary, #ffffff)}.wi-td-rows{display:flex;flex-direction:column;gap:12px}.wi-td-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.wi-td-row-label{font-size:15px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-row-value{font-size:15px;font-weight:500;color:var(--wi-texticon-primary, #ffffff);text-align:right;word-break:break-all}.wi-td-row-link,.wi-td-row-copy{display:inline-flex;align-items:center;gap:6px;border:none;background:transparent;padding:0;cursor:pointer;font-family:inherit;text-decoration:none}.wi-td-row-link:hover,.wi-td-row-copy:hover{opacity:.8}.wi-td-external-icon{color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));flex-shrink:0}.wi-td-row-copy svg{color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));flex-shrink:0}.wi-td-social-row{display:flex;flex-wrap:wrap;gap:10px}.wi-td-social-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;color:var(--wi-texticon-primary, #ffffff);background:var(--wi-surface-default, rgba(255, 255, 255, .05));text-decoration:none;transition:background .15s ease}.wi-td-social-btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-list{display:flex;flex-direction:column;gap:10px}.wi-td-history-item{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05));text-decoration:none}.wi-td-history-item--link{cursor:pointer;transition:background .15s ease}.wi-td-history-item--link:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-top,.wi-td-history-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}.wi-td-history-type{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff)}.wi-td-history-type[data-direction=receive],.wi-td-history-type[data-direction=bridge-in]{color:var(--ds-system-green-high, #00a869)}.wi-td-history-counter{font-size:14px;color:var(--wi-primary, #f0640d);font-variant-numeric:tabular-nums}.wi-td-history-meta{display:inline-flex;align-items:center;gap:8px;min-width:0}.wi-td-history-status{font-size:14px;font-weight:500}.wi-td-history-status[data-status=success]{color:var(--ds-system-green-high, #00a869)}.wi-td-history-status[data-status=fail]{color:var(--wi-error, #e70077)}.wi-td-history-time{font-size:14px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-history-amount{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff);text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.wi-td-history-amount[data-size=sm]{font-size:13px}.wi-td-history-amount[data-size=xs]{font-size:11px;white-space:normal;word-break:break-all}.wi-td-history-skeleton{display:flex;align-items:center;justify-content:space-between;padding:16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05))}.wi-td-history-empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:28px 16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05));color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));font-size:14px;text-align:center}.wi-td-retry-btn{padding:8px 18px;border:1px solid var(--wi-border-subtle, rgba(255, 255, 255, .1));border-radius:999px;background:transparent;color:var(--wi-texticon-primary, #ffffff);font-family:inherit;font-size:13px;font-weight:600;cursor:pointer}.wi-td-retry-btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-sentinel{display:flex;align-items:center;justify-content:center;min-height:32px}.wi-td-history-loading{font-size:13px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-loadmore-btn{align-self:center;margin-top:2px;padding:10px 24px;border:1px solid var(--wi-border-subtle, rgba(255, 255, 255, .1));border-radius:999px;background:transparent;color:var(--wi-texticon-primary, #ffffff);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:background .15s ease}.wi-td-loadmore-btn:hover:not(:disabled){background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-loadmore-btn:disabled{cursor:default;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}
17
17
  `);de(`.wi-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
18
- `);import{jsx as $l}from"react/jsx-runtime";function $y({env:e,theme:t="dark",mobileBreakpoint:r=768,drawerDirection:n,modal:o,showBalance:i=!1,showForgeToken:a=!1,showGameToken:s=!0,showQR:l=!0,showBridge:d=!0,qrLogoSrc:c,walletAddress:b,accountName:f,sendAccounts:m,profileImageUrl:y,connectorId:g,connectorName:u,connectorIconUrl:p,preferredTokens:w=[],onSelectWallet:h,onCopyAddress:x,onBuy:k,onBuyDisabledMessage:R,onBridgeDisabledMessage:I,onSendDisabledMessage:C,onDisconnect:S,disconnectLabel:E="Disconnect",termsUrl:M=ma,termsLabel:B="Terms of Service",privacyUrl:L=ga,privacyLabel:z="Privacy Policy",open:A,onOpenChange:U,showPortfolio:oe=!1,showOnePop:Y=!1,onePopSummary:G,onOnePopOpen:H,onOnePopSend:ie,onOnePopClaim:te,onOnePopActivity:O,onOnePopRepliesSeen:Z,onePopGetTokenSlot:_,onePopLogoSrc:ce,onePopHeroSrc:xe,portfolioTitle:he="My Portfolio",portfolioSections:fe,showTotalAssets:ge=!0,totalAssetsLabel:we="Total Assets USD",sendTransaction:Ye,getTransactionReceipt:be,estimateGas:Te,onOutlink:it,lpBalanceReader:We,stakingRewardsReader:_e,bridgeTokens:Be,bridgeHistory:rt,getBridgeQuote:Et,getBridgeToTokens:ft,getBridgeApproval:Ct,approveBridge:Se,submitBridge:wt,onReceive:yt,onBridge:St,onSend:Ke,style:Xe,children:$t}){let At=ot(e),zt=g?pa[g]:void 0,Mt=u??zt?.name,nt=p??zt?.iconUrl,Ge=Ao(`(max-width: ${r}px)`),at=n??(i?"right":"bottom"),Nt=at==="left"||at==="right",Pe=o??!1,st=A!==void 0,[_t,F]=Xt.useState(!1),ke=st?A:_t,P=Xt.useCallback(ee=>{st||F(ee),U?.(ee)},[st,U]),ae=Xt.useCallback(()=>P(!1),[P]);Ln(ke,ae);let[pe,me]=Xt.useState(null),[Je,ir]=Xt.useState("top"),[Qt,Lt]=Xt.useState(null),[hr,br]=Xt.useState("wallet"),[Vt,ar]=Xt.useState(null),[X,Ee]=Xt.useState(null);Xt.useEffect(()=>{ke||(br("wallet"),ar(null),Ee(null))},[ke]),Xt.useEffect(()=>{Io(b)},[b]);let j=Xt.useCallback(()=>{fl(b),S?.()},[S,b]),ze=Xt.useMemo(()=>({env:At,theme:t,isMobile:Ge,open:ke,drawerDirection:at,modal:Pe,showBalance:i,showForgeToken:a,showGameToken:s,showQR:l,showBridge:d,qrLogoSrc:c,walletAddress:b,accountName:f,sendAccounts:m,profileImageUrl:y,connectorName:Mt,connectorIconUrl:nt,preferredTokens:w,close:ae,onSelectWallet:h,onCopyAddress:x,onBuy:k,onBuyDisabledMessage:R,onBridgeDisabledMessage:I,onSendDisabledMessage:C,onDisconnect:S?j:void 0,disconnectLabel:E,termsUrl:M,termsLabel:B,privacyUrl:L,privacyLabel:z,portalStyle:Xe,navContent:pe,navPosition:Je,setNavContent:me,setNavPosition:ir,footerContent:Qt,setFooterContent:Lt,view:hr,setView:br,selectedSendToken:Vt,setSelectedSendToken:ar,selectedDetailToken:X,setSelectedDetailToken:Ee,showPortfolio:oe,showOnePop:Y,onePopSummary:G,onOnePopOpen:H,onOnePopSend:ie,onOnePopClaim:te,onOnePopActivity:O,onOnePopRepliesSeen:Z,onePopGetTokenSlot:_,onePopLogoSrc:ce,onePopHeroSrc:xe,portfolioTitle:he,portfolioSections:fe,showTotalAssets:ge,totalAssetsLabel:we,sendTransaction:Ye,getTransactionReceipt:be,estimateGas:Te,onOutlink:it,lpBalanceReader:We,stakingRewardsReader:_e,bridgeTokens:Be,bridgeHistory:rt,getBridgeQuote:Et,getBridgeToTokens:ft,getBridgeApproval:Ct,approveBridge:Se,submitBridge:wt,onReceive:yt,onBridge:St,onSend:Ke}),[At,t,Ge,ke,at,Pe,i,a,s,l,d,c,b,f,m,y,Mt,nt,w,ae,h,x,k,R,I,C,S,j,E,M,B,L,z,Xe,pe,Je,Qt,hr,Vt,X,oe,Y,G,H,ie,te,O,Z,_,ce,xe,he,fe,ge,we,Ye,be,Te,it,We,_e,Be,rt,Et,ft,Ct,Se,wt,yt,St,Ke]);return $l(sl.Provider,{value:ze,children:Ge?$l(Jy.Root,{direction:at,open:ke,onOpenChange:P,handleOnly:Nt,noBodyStyles:!0,repositionInputs:!1,children:$t},"drawer"):$l(cm.Root,{open:ke,onOpenChange:P,children:$t},"popover")})}var Qo=Object.assign($y,{Trigger:dp,Content:im,Nav:sm,Footer:dm});import*as qe from"react";import*as Is from"react";import{createContext as ex,useContext as tx}from"react";var ed=ex(null);function Ci(){let e=tx(ed);if(!e)throw new Error("RelayDeposit compound components must be used within <RelayDeposit>");return e}import*as Vm from"react";import{createContext as rx,useContext as nx}from"react";var ps=rx(null);function an(){let e=nx(ps);if(!e)throw new Error("ResponsiveShell compound components must be used within <ResponsiveShell>");return e}import{createContext as ox,useContext as ix,useLayoutEffect as ax,useState as sx}from"react";function pm(){let e=null,t=new Set;return{getSnapshot:()=>e,publish(r){if(r!==e){e=r;for(let n of[...t])n()}},subscribe(r){return t.add(r),()=>{t.delete(r)}}}}var td=ox(null);function lx(){let e=ix(td);if(!e)throw new Error("RelayDeposit compound components must be used within <RelayDeposit>");return e}function um(){let e=lx(),[t,r]=sx(e.getSnapshot);return ax(()=>(r(e.getSnapshot()),e.subscribe(()=>r(e.getSnapshot()))),[e]),t}de(`.rd-root{--rd-bg: var(--ds-bg-dim, #f7f8fb);--rd-surface: var(--ds-surface-default, #ffffff);--rd-surface-alt: var(--ds-surface-medium, #f0f1f6);--rd-border: var(--ds-border-default, #e2e4ec);--rd-text: var(--ds-content-highest, #14161f);--rd-text-muted: var(--ds-content-medium, #676b7a);--rd-accent: var(--ds-accent-primary-high, #5b5bf6);--rd-accent-contrast: var(--ds-accent-primary-on, #ffffff);--rd-success: var(--ds-system-green-default, #1e9e6a);--rd-success-bg: var(--ds-system-green-low, #e6f7f0);--rd-warning: #b8860b;--rd-warning-bg: #fdf3d9;--rd-danger: var(--ds-system-red-default, #d1394a);--rd-danger-bg: var(--ds-system-red-low, #fbe8ea);--rd-radius: 14px;--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(20, 22, 31, .04), 0 8px 24px rgba(20, 22, 31, .06));--rd-on-accent: #ffffff;width:100%;max-width:640px;box-sizing:border-box;margin:0 auto;display:flex;flex-direction:column;gap:1.25rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--rd-bg);color:var(--rd-text);-webkit-font-smoothing:antialiased;color-scheme:light dark}.rd-root[data-theme=dark]{color-scheme:dark;--rd-bg: var(--ds-bg-default, #0f1117);--rd-surface: var(--ds-surface-default, #171923);--rd-surface-alt: var(--ds-surface-medium, #1e212c);--rd-border: var(--ds-border-default, #2a2d3a);--rd-text: var(--ds-content-highest, #eef0f6);--rd-text-muted: var(--ds-content-medium, #9498a8);--rd-accent: var(--ds-accent-primary-high, #8181ff);--rd-accent-contrast: var(--ds-accent-primary-on, #0f1117);--rd-success: var(--ds-system-green-default, #3fd68f);--rd-success-bg: var(--ds-system-green-low, #123626);--rd-warning: #e0b23c;--rd-warning-bg: #3a2f10;--rd-danger: var(--ds-system-red-default, #ff6b7a);--rd-danger-bg: var(--ds-system-red-low, #3a1418);--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35))}.rd-root[data-theme=light]{color-scheme:light;--rd-bg: var(--ds-bg-dim, #f7f8fb);--rd-surface: var(--ds-surface-default, #ffffff);--rd-surface-alt: var(--ds-surface-medium, #f0f1f6);--rd-border: var(--ds-border-default, #e2e4ec);--rd-text: var(--ds-content-highest, #14161f);--rd-text-muted: var(--ds-content-medium, #676b7a);--rd-accent: var(--ds-accent-primary-high, #5b5bf6);--rd-accent-contrast: var(--ds-accent-primary-on, #ffffff);--rd-success: var(--ds-system-green-default, #1e9e6a);--rd-success-bg: var(--ds-system-green-low, #e6f7f0);--rd-warning: #b8860b;--rd-warning-bg: #fdf3d9;--rd-danger: var(--ds-system-red-default, #d1394a);--rd-danger-bg: var(--ds-system-red-low, #fbe8ea);--rd-radius: 14px;--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(20, 22, 31, .04), 0 8px 24px rgba(20, 22, 31, .06))}.rd-root *{box-sizing:border-box}.rd-card{background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:var(--rd-radius);box-shadow:var(--rd-shadow);padding:1.25rem;display:flex;flex-direction:column;gap:.9rem}.rd-card-header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.rd-card-title{font-size:1rem;font-weight:650;margin:0}.rd-card-hint{font-size:.8rem;color:var(--rd-text-muted)}.rd-token-address{display:flex;flex-direction:column;gap:.1rem}.rd-token-address-addr{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.78rem;color:var(--rd-text);overflow-wrap:anywhere;user-select:all}.rd-token-address-meta{font-size:.72rem;color:var(--rd-text-muted)}.rd-field{display:flex;flex-direction:column;gap:.35rem}.rd-field-label{font-size:.69rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-root .rd-field-label-row{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.rd-root .rd-token-explorer-link{font-size:.75rem;font-weight:500;color:var(--rd-accent);text-decoration:none;white-space:nowrap}.rd-root .rd-token-explorer-link:hover{text-decoration:underline}.rd-field-row{display:grid;grid-template-columns:1fr 1fr;gap:.625rem}.rd-root select,.rd-root input[type=text],.rd-root input[type=number]{width:100%;padding:.6rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:16px;font-family:inherit}.rd-root select:focus,.rd-root input:focus{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-dropdown{position:relative;min-width:0}.rd-root .rd-dropdown-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.55rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:.9rem;font-family:inherit;font-weight:600;text-align:left;cursor:pointer}.rd-root .rd-static-target{display:flex;align-items:center;gap:.55rem;padding:.55rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:.9rem;font-weight:600;min-width:0;overflow-wrap:anywhere}.rd-root .rd-dropdown-trigger:disabled{cursor:not-allowed}.rd-dropdown-trigger:focus,.rd-dropdown-trigger:focus-visible{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-dropdown-trigger-content{display:flex;align-items:center;gap:.55rem;min-width:0}.rd-dropdown-trigger-label{display:flex;flex-direction:column;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.rd-dropdown-trigger-sub{font-size:.66rem;font-weight:500;line-height:1.3;color:var(--rd-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-dropdown-chevron{display:inline-flex;flex:none;color:var(--rd-text-muted);line-height:1}.rd-dropdown-popover{z-index:100002;width:var(--radix-popover-trigger-width);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;--rd-surface: var(--ds-surface-default, #ffffff);--rd-surface-alt: var(--ds-surface-medium, #f0f1f6);--rd-border: var(--ds-border-default, #e2e4ec);--rd-text: var(--ds-content-highest, #14161f);--rd-accent: var(--ds-system-orange-default, #5b5bf6);--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(20, 22, 31, .04), 0 8px 24px rgba(20, 22, 31, .06))}.rd-dropdown-popover[data-theme=dark]{color-scheme:dark;--rd-surface: var(--ds-surface-default, #171923);--rd-surface-alt: var(--ds-surface-medium, #1e212c);--rd-border: var(--ds-border-default, #2a2d3a);--rd-text: var(--ds-content-highest, #eef0f6);--rd-accent: var(--ds-system-orange-default, #8181ff);--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35))}.rd-dropdown-popover *{box-sizing:border-box}.rd-dropdown-listbox{margin:0;padding:.3rem;list-style:none;max-height:min(15rem,var(--radix-popover-content-available-height, 15rem));overflow-y:auto;overscroll-behavior:contain;background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:10px;box-shadow:var(--rd-shadow);font-family:inherit;color:var(--rd-text)}.rd-dropdown-option{display:flex;align-items:center;gap:.55rem;padding:.5rem .6rem;border-radius:8px;font-size:.9rem;color:var(--rd-text);cursor:pointer}.rd-dropdown-option-active{background:var(--rd-surface-alt)}.rd-dropdown-option-selected{font-weight:650}.rd-dropdown-option-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-dropdown-option-check{flex:none;color:var(--rd-accent);font-size:.8rem}.rd-amount-input{display:flex;align-items:baseline;gap:.5rem;padding:.6rem .75rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt)}.rd-amount-input:focus-within{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-amount-input[data-rd-invalid]{border-color:var(--rd-danger)}.rd-root .rd-amount-input input[type=text]{flex:1 1 auto;width:auto;min-width:0;padding:0;border:0;border-radius:0;background:none;font-size:22px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.2}.rd-root .rd-amount-input input[type=text]:focus{outline:none}.rd-amount-input-suffix{flex:none;font-size:.8rem;font-weight:700;color:var(--rd-text-muted);pointer-events:none}.rd-root .rd-amount-input-max{flex:none;padding:0;font-size:.69rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-accent);background:transparent;border:0;border-radius:0;cursor:pointer;line-height:1}.rd-amount-input-max:hover:not(:disabled){text-decoration:underline}.rd-amount-input-max:disabled{opacity:.5;cursor:not-allowed}.rd-amount-meta{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;font-size:.75rem;color:var(--rd-text-muted);padding:0 .15rem;font-variant-numeric:tabular-nums}.rd-root button{font-family:inherit;font-size:.95rem;font-weight:650;border-radius:10px;border:1px solid transparent;padding:.7rem 1.1rem;cursor:pointer;transition:opacity .12s ease,transform .12s ease}.rd-root button:active:not(:disabled){transform:translateY(1px)}.rd-root button:disabled{cursor:not-allowed;opacity:.55}.rd-button-primary{background:var(--rd-accent);color:var(--rd-accent-contrast)}.rd-button-secondary{background:var(--rd-surface-alt);color:var(--rd-text);border-color:var(--rd-border)}.rd-button-block{width:100%}.rd-callout{border-radius:10px;padding:.65rem .85rem;font-size:.85rem;line-height:1.4}.rd-callout-warning{background:var(--rd-warning-bg);color:var(--rd-warning)}.rd-callout-danger{background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-callout-success{background:var(--rd-success-bg);color:var(--rd-success)}.rd-callout-muted{background:var(--rd-surface-alt);color:var(--rd-text-muted)}.rd-quote-strip{display:flex;align-items:center;justify-content:space-between;gap:.625rem;padding:.7rem .85rem;border-radius:14px;background:color-mix(in srgb,var(--rd-accent) 10%,var(--rd-surface));border:1px solid color-mix(in srgb,var(--rd-accent) 35%,transparent)}.rd-quote-strip-side{display:flex;flex-direction:column;min-width:0;gap:.1rem;font-size:.9rem;font-weight:700;color:var(--rd-text);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.rd-quote-strip-end{text-align:right;align-items:flex-end}.rd-quote-strip-side small{font-size:.69rem;font-weight:600;color:var(--rd-text-muted);letter-spacing:.02em}.rd-quote-strip-arrow{flex:none;color:var(--rd-accent);font-weight:800}.rd-quote-strip-hint{font-size:.72rem;line-height:1.45;color:var(--rd-text-muted);padding:0 .15rem}.rd-deposit-address{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 1fr auto;align-items:start;gap:.7rem;min-height:172px;background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:16px;box-shadow:var(--rd-shadow);padding:.85rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;color:var(--rd-text-muted)}.rd-deposit-address-label{grid-column:1;grid-row:1;position:relative;display:inline-flex;align-items:center;gap:.35rem;width:fit-content;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif}.rd-root button.rd-address-term{position:static;width:auto;height:auto;display:inline;padding:0 0 2px;border:0;border-bottom:1px dotted currentColor;border-radius:0;background:transparent;color:var(--rd-text-muted);font:700 .69rem/1 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;letter-spacing:.08em;text-transform:uppercase}.rd-root button.rd-address-term:hover,.rd-root button.rd-address-term:focus-visible{color:var(--rd-accent);outline:none}.rd-address-tooltip{position:absolute;z-index:20;top:calc(100% + 8px);left:0;width:min(250px,calc(100vw - 48px));padding:9px 11px;border:1px solid var(--rd-border);border-radius:10px;background:var(--rd-surface);box-shadow:var(--rd-shadow);color:var(--rd-text);font-size:11.5px;font-weight:500;line-height:1.45;letter-spacing:normal;text-align:left;text-transform:none;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(-3px);transition:opacity .12s ease,transform .12s ease,visibility .12s ease}.rd-address-term:hover .rd-address-tooltip,.rd-address-term:focus .rd-address-tooltip,.rd-address-term:focus-visible .rd-address-tooltip{opacity:1;visibility:visible;transform:translateY(0)}.rd-address-full{grid-column:1 / -1;grid-row:2;align-self:center;min-width:0;color:var(--rd-text);font-weight:600;line-height:1.55;overflow-wrap:anywhere;word-break:break-all}.rd-root .rd-address-copy{grid-column:1 / -1;grid-row:3;width:100%;min-height:36px;display:inline-flex;align-items:center;justify-content:center;gap:.4rem;margin:0;padding:.5rem .7rem;border-radius:10px;border:0;background:var(--rd-accent);color:var(--rd-accent-contrast);font-family:inherit;font-size:.75rem;font-weight:800;letter-spacing:.03em;line-height:1}.rd-root .rd-address-copy svg{flex:none}.rd-root .rd-address-copy:hover:not(:disabled){opacity:.92}.rd-root button.rd-mobile-qr-toggle,.rd-root button.rd-mobile-address-toggle{display:none;place-items:center;width:34px;height:34px;padding:0;border:1px solid color-mix(in srgb,var(--rd-accent) 24%,var(--rd-border));border-radius:11px;background:color-mix(in srgb,var(--rd-accent) 10%,var(--rd-surface));color:var(--rd-accent);box-shadow:0 1px 2px color-mix(in srgb,var(--rd-text) 8%,transparent);transition:transform .15s ease,background-color .15s ease,border-color .15s ease,box-shadow .15s ease}.rd-root button.rd-mobile-qr-toggle{grid-column:2;grid-row:1;justify-self:end;align-self:start}.rd-root button.rd-mobile-address-toggle{position:absolute;z-index:2;top:.85rem;right:.85rem;background:var(--rd-surface);color:var(--rd-text-muted);box-shadow:0 4px 14px color-mix(in srgb,var(--rd-text) 16%,transparent)}.rd-root button.rd-mobile-qr-toggle:hover:not(:disabled),.rd-root button.rd-mobile-address-toggle:hover:not(:disabled){border-color:color-mix(in srgb,var(--rd-accent) 45%,var(--rd-border));color:var(--rd-accent);background:color-mix(in srgb,var(--rd-accent) 15%,var(--rd-surface));box-shadow:0 5px 16px color-mix(in srgb,var(--rd-accent) 18%,transparent);transform:translateY(-1px)}.rd-root button.rd-mobile-qr-toggle:active:not(:disabled),.rd-root button.rd-mobile-address-toggle:active:not(:disabled){transform:scale(.96)}.rd-deposit-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.9rem;container:rd-deposit-head / inline-size}.rd-deposit-head>.rd-deposit-qr-pane{flex:none}.rd-deposit-head>.rd-deposit-address{flex:1 1 12rem;min-width:0}@container rd-deposit-head (max-width: 23.75rem){.rd-deposit-head>.rd-deposit-address{flex-basis:100%;width:100%}.rd-deposit-head>.rd-skeleton-qr{display:none}.rd-deposit-head>.rd-skeleton-address{flex-basis:100%;width:100%}.rd-root button.rd-mobile-qr-toggle,.rd-root button.rd-mobile-address-toggle{display:grid}.rd-deposit-head[data-compact-view=address]>.rd-deposit-qr-pane,.rd-deposit-head[data-compact-view=qr]>.rd-deposit-address{display:none}.rd-deposit-head[data-compact-view=address]>.rd-deposit-address,.rd-deposit-head[data-compact-view=qr]>.rd-deposit-qr-pane{animation:rd-compact-pane-in .26s cubic-bezier(.22,1,.36,1)}.rd-deposit-head[data-compact-view=qr]>.rd-deposit-qr-pane{width:100%}}@keyframes rd-compact-pane-in{0%{opacity:0;transform:translateY(6px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}.rd-deposit-qr{position:relative;display:grid;place-items:center;width:172px;height:172px;background:#fff;border-radius:16px;border:1px solid var(--rd-border);box-shadow:var(--rd-shadow);margin:0 auto}.rd-deposit-qr-pane{position:relative;display:grid;place-items:center;min-height:172px}.rd-deposit-qr-badge{position:absolute;inset:0;margin:auto;width:36px;height:36px;display:grid;place-items:center;background:#fff;border-radius:50%;pointer-events:none}.rd-stepper{display:flex;flex-direction:column;gap:0}.rd-stepper-item{display:flex;gap:.75rem;position:relative;padding-bottom:1.25rem}.rd-stepper-item:last-child{padding-bottom:0}.rd-stepper-rail{display:flex;flex-direction:column;align-items:center}.rd-stepper-dot{width:22px;height:22px;border-radius:50%;border:2px solid var(--rd-border);background:var(--rd-surface);display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:700;flex:none;color:var(--rd-text-muted)}.rd-stepper-item-done .rd-stepper-dot{background:var(--rd-success);border-color:var(--rd-success);color:var(--rd-on-accent)}.rd-stepper-item-active .rd-stepper-dot{border-color:var(--rd-accent);color:var(--rd-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--rd-accent) 20%,transparent)}.rd-stepper-line{flex:1;width:2px;background:var(--rd-border);margin:2px 0}.rd-stepper-item-done .rd-stepper-line{background:var(--rd-success)}.rd-stepper-body{padding-top:1px}.rd-stepper-label{font-weight:600;font-size:.9rem}.rd-stepper-item-pending .rd-stepper-label{color:var(--rd-text-muted)}.rd-stepper-meta{margin-top:.25rem;font-size:.78rem;color:var(--rd-text-muted);display:flex;flex-direction:column;gap:.15rem}.rd-stepper-meta a{color:var(--rd-accent);text-decoration:none}.rd-stepper-meta a:hover{text-decoration:underline}.rd-status-pill{display:inline-flex;align-items:center;gap:.35rem;font-size:.75rem;font-weight:650;padding:.2rem .55rem;border-radius:999px;background:var(--rd-surface-alt);color:var(--rd-text-muted);width:fit-content}.rd-status-pill-success{background:var(--rd-success-bg);color:var(--rd-success)}.rd-status-pill-failure{background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-spinner{display:inline-block;width:1em;height:1em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:rd-spin .7s linear infinite;vertical-align:-.15em}@keyframes rd-spin{to{transform:rotate(360deg)}}.rd-muted{color:var(--rd-text-muted)}.rd-settings-row{display:flex;justify-content:flex-end}.rd-root .rd-icon-button{position:relative;display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border-radius:50%;border:1px solid var(--rd-border);background:var(--rd-surface);color:var(--rd-text-muted)}.rd-root .rd-icon-button:hover:not(:disabled){color:var(--rd-text);background:var(--rd-surface-alt)}.rd-recovery-badge{position:absolute;top:-.3rem;right:-.3rem;display:flex;align-items:center;justify-content:center;min-width:1.05rem;height:1.05rem;padding:0 .25rem;border-radius:999px;background:var(--rd-danger, #d1394a);color:#fff;font-size:.65rem;font-weight:700;line-height:1;border:2px solid var(--rd-surface, #ffffff)}.rd-recover-group{display:flex;flex-direction:column;gap:.75rem}.rd-recover-group+.rd-recover-group{border-top:1px solid var(--rd-border);padding-top:1rem;margin-top:.5rem}.rd-recover-group-label{margin:0;font-size:.8rem;color:var(--rd-text-muted)}.rd-recover-made-of{display:block;padding:.65rem .8rem;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:10px}.rd-recover-made-of-label{cursor:pointer;font-size:.72rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-recover-made-of-body{display:flex;flex-direction:column;gap:.4rem;margin-top:.6rem}.rd-error-details{margin-top:-.4rem;padding:0 .15rem;color:var(--rd-text-muted);font-size:.72rem}.rd-error-details summary{width:max-content;cursor:pointer;list-style:none;font-weight:600}.rd-error-details summary::-webkit-details-marker{display:none}.rd-error-details summary:before{display:inline-block;margin-right:.35rem;content:"\\203a";transition:transform .12s ease}.rd-error-details[open] summary:before{transform:rotate(90deg)}.rd-error-log{position:relative;margin-top:.5rem}.rd-root button.rd-error-copy{position:absolute;z-index:1;top:.45rem;right:.45rem;display:inline-flex;align-items:center;justify-content:center;width:1.65rem;height:1.65rem;padding:0;border:1px solid var(--rd-border);border-radius:6px;background:var(--rd-surface);color:var(--rd-text-muted)}.rd-root button.rd-error-copy:hover:not(:disabled){background:var(--rd-surface-alt);color:var(--rd-text)}.rd-error-details code{display:block;max-height:6rem;overflow:auto;padding:.6rem 2.7rem .6rem .7rem;border:1px solid var(--rd-border);border-radius:8px;background:var(--rd-surface-alt);color:var(--rd-text-muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.68rem;line-height:1.45;overflow-wrap:anywhere;scrollbar-color:var(--rd-border) transparent;scrollbar-width:thin;white-space:pre-wrap}.rd-error-details code::-webkit-scrollbar{width:4px;height:4px}.rd-error-details code::-webkit-scrollbar-thumb{border-radius:999px;background:var(--rd-border)}.rd-token-list{display:flex;flex-direction:column;gap:.5rem}.rd-token-row{display:flex;align-items:center;gap:10px;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:12px 14px}.rd-token-row-info{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;overflow-wrap:anywhere}.rd-token-row-symbol{font-weight:700}.rd-token-row-amount{font-variant-numeric:tabular-nums;font-size:14px;font-weight:700;color:var(--rd-text);white-space:nowrap}.rd-token-row-status{font-size:11.5px;line-height:1.45;color:var(--rd-text-muted)}.rd-token-row-warn{font-size:11.5px;line-height:1.45;color:var(--rd-warning)}.rd-token-row-warn b{font-weight:750;font-variant-numeric:tabular-nums}.rd-token-row-step{font-size:11.5px;line-height:1.45;font-weight:650;color:var(--rd-accent)}.rd-root .rd-token-row-action{flex:none;width:auto;padding:9px 16px;font-size:13px;font-weight:700}.rd-token-row-spinner{flex:none;font-size:18px;color:var(--rd-accent)}.rd-recover-sum{display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:16px 14px;container:rd-recover-sum / inline-size}.rd-recover-sum-label{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-recover-sum-value{max-width:100%;overflow:hidden;font-size:22px;font-size:clamp(18px,7cqi,28px);font-weight:800;line-height:1.15;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;color:var(--rd-text)}.rd-recover-sum-unit{display:block;margin:.35rem 0 0;font-size:15px;font-weight:700;color:var(--rd-text-muted)}.rd-recover-sum-empty{font-size:17px;font-weight:700;color:var(--rd-text-muted)}.rd-recover-empty{display:flex;min-height:min(20rem,48vh);flex:1 1 auto;flex-direction:column;align-items:center;justify-content:center;gap:.7rem;padding:2.5rem 1.5rem;border:1px solid var(--rd-border);border-radius:16px;background:radial-gradient(circle at 50% 0%,color-mix(in srgb,var(--rd-accent) 11%,transparent),transparent 48%),var(--rd-surface-alt);text-align:center;box-sizing:border-box}.rd-recover-empty-icon{display:grid;width:4.25rem;height:4.25rem;place-items:center;margin-bottom:.2rem;border:1px solid color-mix(in srgb,var(--rd-accent) 30%,var(--rd-border));border-radius:50%;background:color-mix(in srgb,var(--rd-accent) 12%,var(--rd-surface));color:var(--rd-accent);box-shadow:0 10px 30px color-mix(in srgb,var(--rd-accent) 12%,transparent)}.rd-recover-empty[data-variant=unavailable] .rd-recover-empty-icon{border-color:var(--rd-border);background:var(--rd-surface);color:var(--rd-text-muted);box-shadow:none}.rd-recover-empty-title,.rd-recover-sum-value.rd-recover-empty-title{max-width:100%;margin:0;overflow:visible;color:var(--rd-text);font-size:1.15rem;font-weight:750;line-height:1.35;white-space:normal}.rd-recover-empty-copy{max-width:23rem;margin:0;color:var(--rd-text-muted);font-size:.82rem;line-height:1.55;text-wrap:balance}.rd-root button.rd-recover-empty-refresh{display:inline-flex;min-height:2.6rem;align-items:center;justify-content:center;gap:.45rem;margin-top:.45rem;padding:.65rem 1rem;color:var(--rd-text);font-size:.82rem}.rd-root button.rd-recover-empty-refresh:hover:not(:disabled){border-color:color-mix(in srgb,var(--rd-accent) 35%,var(--rd-border));background:color-mix(in srgb,var(--rd-accent) 9%,var(--rd-surface));color:var(--rd-accent)}[data-rd-recover-funds].rd-stack{flex:1 1 auto}.rd-recover-foot{margin-top:auto;padding-top:.5rem;text-align:center;font-size:11.5px;line-height:1.45;color:var(--rd-text-muted)}.rd-history-table{display:flex;min-width:0;flex-direction:column;gap:.6rem;font-size:.875rem}.rd-history-empty{display:flex;min-height:min(20rem,48vh);flex:1 1 auto;flex-direction:column;align-items:center;justify-content:center;gap:.7rem;padding:2.5rem 1.5rem;border:1px solid var(--rd-border);border-radius:16px;background:radial-gradient(circle at 50% 0%,color-mix(in srgb,var(--rd-accent) 10%,transparent),transparent 48%),var(--rd-surface-alt);text-align:center;box-sizing:border-box}.rd-history-empty-icon{display:grid;width:4.25rem;height:4.25rem;place-items:center;margin-bottom:.2rem;border:1px solid color-mix(in srgb,var(--rd-accent) 30%,var(--rd-border));border-radius:50%;background:color-mix(in srgb,var(--rd-accent) 12%,var(--rd-surface));color:var(--rd-accent);box-shadow:0 10px 30px color-mix(in srgb,var(--rd-accent) 12%,transparent)}.rd-history-empty[data-variant=disconnected] .rd-history-empty-icon{border-color:var(--rd-border);background:var(--rd-surface);color:var(--rd-text-muted);box-shadow:none}.rd-history-empty-title{margin:0;color:var(--rd-text);font-size:1.15rem;font-weight:750;line-height:1.35}.rd-history-empty-copy{max-width:22rem;margin:0;color:var(--rd-text-muted);font-size:.82rem;line-height:1.55;text-wrap:balance}.rd-history-empty-live{display:inline-flex;align-items:center;gap:.4rem;margin-top:.35rem;color:var(--rd-text-muted);font-size:.72rem;font-weight:650}.rd-history-empty-live>span{width:.45rem;height:.45rem;border-radius:50%;background:var(--rd-success);box-shadow:0 0 0 3px color-mix(in srgb,var(--rd-success) 15%,transparent)}.rd-history-group{min-width:0;max-width:100%;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;overflow:hidden}.rd-history-row-button{width:100%;min-width:0;display:flex;flex-direction:column;gap:.75rem;padding:1rem;background:none;border:none;border-radius:inherit;color:inherit;font:inherit;text-align:left;cursor:pointer}.rd-history-row-button[aria-expanded=true]{border-radius:12px 12px 0 0}.rd-history-row-button:hover{background:color-mix(in srgb,var(--rd-border) 30%,transparent)}.rd-history-row-button:focus-visible{outline:2px solid var(--rd-accent);outline-offset:-2px}.rd-history-card-top{display:flex;align-items:center;gap:.5rem;min-width:0}.rd-history-card-top>.rd-status-pill{margin-left:auto;flex:none}.rd-history-card-top>.rd-status-pill:not(.rd-status-pill-success):not(.rd-status-pill-failure){background:color-mix(in srgb,var(--rd-accent) 12%,transparent);color:var(--rd-accent)}.rd-history-asset{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-history-card-amounts{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:.75rem;padding:.75rem;border-radius:10px;background:var(--rd-surface)}.rd-history-amount-block{display:flex;max-width:100%;flex-direction:column;gap:.15rem;min-width:0}.rd-history-amount-block:last-child{align-items:flex-end;text-align:right}.rd-history-amount-label{color:var(--rd-text-muted);font-size:.68rem;font-weight:650;line-height:1.2}.rd-history-num{max-width:100%;overflow:hidden;font-variant-numeric:tabular-nums;font-size:.875rem;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.rd-history-num[data-full-value],.rd-history-step-amount[data-full-value]{cursor:help}[data-rd-history-floating-tooltip]{position:fixed;z-index:100100;width:max-content;max-width:calc(100vw - 1.5rem);padding:.45rem .65rem;border:1px solid;border-radius:8px;font-size:.72rem;font-weight:600;line-height:1.35;text-align:left;white-space:normal;overflow-wrap:anywhere;pointer-events:none}.rd-history-card-arrow{display:inline-flex;align-items:center;justify-content:center;color:var(--rd-text-muted);font-size:.85rem}.rd-history-received{color:var(--rd-success)}.rd-history-received-estimate{color:var(--rd-text-muted);font-weight:600}.rd-history-card-foot{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.rd-history-date{color:var(--rd-text-muted);font-size:.78rem;font-variant-numeric:tabular-nums}.rd-history-chevron{display:inline-flex;flex:none;align-items:center;justify-content:center;color:var(--rd-text-muted);text-align:center;transition:transform .16s ease}.rd-history-row-button[aria-expanded=true] .rd-history-chevron{transform:rotate(180deg)}.rd-history-detail{display:flex;min-width:0;flex-direction:column;gap:.375rem;padding:.65rem .9rem .8rem;border-top:1px solid var(--rd-border)}.rd-history-step{display:grid;min-width:0;grid-template-columns:.5rem auto 1fr auto auto;gap:.5rem;align-items:center}.rd-history-step-dot{width:.5rem;height:.5rem;border-radius:50%;background:var(--rd-border)}.rd-history-step-dot-done{background:var(--rd-success)}.rd-history-step-label{font-weight:600}.rd-history-step-chain{color:var(--rd-text-muted)}.rd-history-step-amount{font-variant-numeric:tabular-nums;color:var(--rd-text-muted)}.rd-history-step-tx{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.rd-history-step-shared{margin-left:.4rem;color:var(--rd-text-muted);font-size:.72rem}.rd-skeleton{border-radius:10px;background:linear-gradient(90deg,var(--rd-surface-alt) 25%,color-mix(in srgb,var(--rd-surface-alt) 55%,var(--rd-surface)) 42%,var(--rd-surface-alt) 60%);background-size:220% 100%;animation:rd-skeleton-wave 1.4s ease-in-out infinite}@keyframes rd-skeleton-wave{0%{background-position:130% 0}to{background-position:-90% 0}}@media(prefers-reduced-motion:reduce){.rd-skeleton,.rd-checklist-status,.rd-deposit-head[data-compact-view=address]>.rd-deposit-address,.rd-deposit-head[data-compact-view=qr]>.rd-deposit-qr-pane,.rd-checklist-status-waiting .rd-checklist-status-dot,.rd-checklist-status-detected .rd-checklist-status-dot{animation:none}}.rd-skeleton-form{display:flex;flex-direction:column;gap:.85rem}.rd-skeleton-qr{flex:none;width:172px;height:172px;border-radius:16px}.rd-skeleton-address{flex:1 1 12rem;min-width:0;height:172px;border-radius:16px}.rd-skeleton-line{height:.9rem;width:40%}.rd-skeleton-field{height:48px}.rd-skeleton-notice{height:96px}.rd-skeleton-cta{height:48px}.rd-wizard{flex:1 1 auto;min-height:0;overflow-y:auto;container:rd-wizard / inline-size;padding:1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom,0px));scroll-padding:1.5rem 0 calc(1.5rem + env(safe-area-inset-bottom,0px));overscroll-behavior:contain;-webkit-overflow-scrolling:touch;max-width:none;gap:.85rem}.rd-deposit-tabs{--rd-tab-count: 3;--rd-active-tab-index: 0;position:sticky;top:-1rem;z-index:2;display:flex;flex:0 0 auto;justify-content:space-around;margin:-1rem -1.25rem 0;padding:1rem 1.25rem 0;border-bottom:1px solid var(--rd-border);background:var(--rd-surface)}.rd-deposit-tabs[data-active-index="1"]{--rd-active-tab-index: 1}.rd-deposit-tabs[data-active-index="2"]{--rd-active-tab-index: 2}.rd-deposit-tabs:after{position:absolute;bottom:-1px;left:1.25rem;width:calc((100% - 2.5rem) / var(--rd-tab-count));height:2px;background:var(--rd-accent);content:"";pointer-events:none;transform:translate(calc(var(--rd-active-tab-index) * 100%));transition:transform .22s cubic-bezier(.22,1,.36,1),width .18s ease}.rd-root .rd-deposit-tab{position:relative;display:inline-flex;flex:1 1 0;min-width:0;min-height:2.75rem;align-items:center;justify-content:center;gap:.4rem;padding:.85rem .35rem;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--rd-text-muted);font:inherit;font-size:.875rem;font-weight:650;line-height:1.2;transition:border-color .16s ease,background-color .16s ease,color .16s ease}.rd-root .rd-deposit-tab[data-active=true]{color:var(--rd-text)}.rd-root .rd-deposit-tab:hover:not(:disabled),.rd-root .rd-deposit-tab:focus-visible{outline:none;background:color-mix(in srgb,var(--rd-accent) 7%,transparent);color:var(--rd-text)}.rd-deposit-tab>.rd-recovery-badge{position:static;flex:none;min-width:1rem;height:1rem;padding:0 .2rem;border-width:0}.rd-deposit-tab-panel{display:flex;min-width:0;flex:1 1 auto;flex-direction:column;gap:.85rem;transform-origin:top center;animation:rd-deposit-tab-in .18s cubic-bezier(.22,1,.36,1)}@keyframes rd-deposit-tab-in{0%{opacity:0;transform:translateY(.35rem)}to{opacity:1;transform:translateY(0)}}.rd-stack{display:flex;min-width:0;flex-direction:column;gap:.75rem}.rd-wizard-header{display:flex;align-items:center;gap:.5rem;margin-bottom:0}.rd-wizard-heading{font-size:1rem;font-weight:700;color:var(--rd-text);margin:0}.rd-wizard-actions{margin-left:auto;display:flex;align-items:center;gap:.25rem}.rd-min-notice-pending{color:var(--rd-text-muted)}.rd-min-notice-pending b{font-weight:750;color:var(--rd-warning);font-variant-numeric:tabular-nums}.rd-locked-card{display:flex;width:100%;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;padding:1.5rem 1.25rem;border:1px solid var(--rd-border);border-radius:16px;background:radial-gradient(circle at 50% 0%,color-mix(in srgb,var(--rd-accent) 12%,transparent),transparent 52%),var(--rd-surface-alt);text-align:center;box-sizing:border-box}.rd-locked-glyph{display:grid;width:3rem;height:3rem;place-items:center;margin-bottom:.1rem;border:1px solid color-mix(in srgb,var(--rd-accent) 30%,var(--rd-border));border-radius:50%;background:color-mix(in srgb,var(--rd-accent) 12%,var(--rd-surface));color:var(--rd-accent);line-height:0;box-shadow:0 10px 30px color-mix(in srgb,var(--rd-accent) 12%,transparent)}.rd-locked-title{margin:0;color:var(--rd-text);font-size:1rem;font-weight:750;line-height:1.3}.rd-locked-text{max-width:22rem;margin:0;color:var(--rd-text-muted);font-size:.8rem;line-height:1.45}.rd-locked-card>.rd-card-hint{max-width:22rem;margin:-.2rem 0 0;text-wrap:balance}.rd-root button.rd-locked-action{display:inline-flex;width:min(18rem,100%);min-height:2.6rem;align-items:center;justify-content:center;gap:.5rem;margin-top:.25rem}.rd-delivery-recipient{display:flex;flex-direction:column;gap:.3rem;margin-top:.5rem}.rd-checklist-credit{font-size:clamp(10px,2.7vw,11.5px);white-space:nowrap}.rd-checklist{background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:14px;padding:11px 14px;display:flex;flex-direction:column;gap:7px}.rd-checklist-row{display:flex;align-items:flex-start;gap:.5rem;font-size:12.5px;line-height:1.5;color:var(--rd-text)}.rd-checklist-row[data-rd-checklist-only]{align-items:center;white-space:nowrap;font-size:clamp(10.5px,2.8vw,12.5px)}.rd-checklist-mark{flex:none;width:1.05rem;text-align:center;font-weight:800;color:var(--rd-text-muted)}.rd-checklist-mark-warn{color:var(--rd-warning)}.rd-checklist-accent{color:var(--rd-accent);font-weight:750;font-variant-numeric:tabular-nums}.rd-checklist-status{min-height:54px;display:flex;align-items:center;gap:.65rem;padding:10px 12px;border:1px solid color-mix(in srgb,var(--rd-accent) 30%,var(--rd-border));border-radius:12px;background:var(--rd-surface-alt);color:var(--rd-text-muted);font-size:12.5px;line-height:1.45;transform-origin:top center;animation:rd-status-enter .48s cubic-bezier(.22,1,.36,1)}.rd-checklist-status-waiting,.rd-checklist-status-detected{border-color:color-mix(in srgb,var(--rd-warning) 42%,var(--rd-border));box-shadow:0 0 0 1px color-mix(in srgb,var(--rd-warning) 10%,transparent)}@keyframes rd-status-enter{0%{opacity:0;transform:translateY(-10px) scale(.985);box-shadow:0 0 color-mix(in srgb,var(--rd-accent) 28%,transparent)}65%{opacity:1;transform:translateY(1px) scale(1);box-shadow:0 0 0 4px color-mix(in srgb,var(--rd-accent) 16%,transparent)}to{opacity:1;transform:translateY(0);box-shadow:0 0 0 0 transparent}}.rd-checklist-status-dot{flex:none;width:9px;height:9px;border-radius:50%;background:var(--rd-warning);box-shadow:0 0 0 4px color-mix(in srgb,var(--rd-warning) 14%,transparent)}.rd-checklist-status-waiting .rd-checklist-status-dot,.rd-checklist-status-detected .rd-checklist-status-dot{animation:rd-status-breathe 1.8s ease-in-out infinite}@keyframes rd-status-breathe{0%,to{opacity:.82;transform:scale(.96);box-shadow:0 0 0 3px color-mix(in srgb,var(--rd-warning) 10%,transparent)}50%{opacity:1;transform:scale(1);box-shadow:0 0 0 5px color-mix(in srgb,var(--rd-warning) 15%,transparent)}}.rd-checklist-status-funded,.rd-checklist-status-processing{color:var(--rd-text);border-color:color-mix(in srgb,var(--rd-accent) 40%,transparent)}.rd-checklist-status-funded .rd-checklist-status-dot,.rd-checklist-status-processing .rd-checklist-status-dot{background:var(--rd-accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--rd-accent) 14%,transparent)}.rd-checklist-status-completed{border-color:color-mix(in srgb,var(--rd-success) 40%,transparent);background:var(--rd-success-bg);color:var(--rd-success)}.rd-checklist-status-completed .rd-checklist-status-dot{background:var(--rd-success);box-shadow:0 0 0 4px color-mix(in srgb,var(--rd-success) 14%,transparent)}.rd-checklist-status-failed{border-color:color-mix(in srgb,var(--rd-danger) 40%,transparent);background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-checklist-status-failed .rd-checklist-status-dot{background:var(--rd-danger);box-shadow:0 0 0 4px color-mix(in srgb,var(--rd-danger) 14%,transparent)}@container rd-wizard (max-width: 30rem){.rd-recover-sum{padding-inline:.75rem}.rd-recover-sum-value{font-size:clamp(1rem,6cqi,1.5rem)}[data-rd-recover-funds] .rd-callout,.rd-token-row-status,.rd-token-row-warn,.rd-token-row-step,.rd-recover-foot{overflow-wrap:anywhere}.rd-token-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;padding:.875rem}.rd-root .rd-token-row-action{width:100%;min-height:2.75rem;grid-column:1 / -1}.rd-token-row-spinner{grid-column:1 / -1;justify-self:center}}@container rd-wizard (max-width: 24rem){.rd-history-card-top{flex-direction:column;align-items:flex-start}.rd-history-card-top>.rd-status-pill{max-width:100%;margin-left:0;white-space:normal}.rd-history-asset{overflow:visible;text-overflow:clip;white-space:normal}.rd-history-card-amounts{grid-template-columns:minmax(0,1fr);gap:.45rem}.rd-history-amount-block{width:100%}.rd-history-amount-block:last-child{align-items:flex-start;text-align:left}.rd-history-card-arrow{display:inline-flex;justify-self:center;margin:0;transform:rotate(90deg);transform-origin:center}.rd-history-card-foot{align-items:flex-start}.rd-history-date{min-width:0;line-height:1.4;overflow-wrap:anywhere}.rd-history-step{grid-template-columns:.5rem minmax(0,1fr);grid-template-areas:"dot label" ". chain" ". amount" ". tx";column-gap:.5rem;row-gap:.25rem;align-items:start;padding-block:.65rem;line-height:1.35}.rd-history-step+.rd-history-step{border-top:1px solid var(--rd-border)}.rd-history-step-dot{grid-area:dot;margin-top:.35rem}.rd-history-step-label{grid-area:label}.rd-history-step-chain{grid-area:chain}.rd-history-step-amount{grid-area:amount}.rd-history-step-tx{grid-area:tx;min-width:0;max-width:100%}.rd-history-step-tx a{overflow-wrap:anywhere}.rd-history-step-shared{display:block;margin:.15rem 0 0}.rd-history-step>.rd-muted{grid-area:tx}}@container rd-wizard (max-width: 22rem){.rd-root .rd-deposit-tab{gap:.2rem;padding-inline:.15rem;font-size:.8rem}.rd-history-row-button,.rd-history-detail{padding-inline:.75rem}}@media(prefers-reduced-motion:reduce){.rd-deposit-tabs:after,.rd-root .rd-deposit-tab{transition:none}.rd-deposit-tab-panel{animation:none}}
18
+ `);import{jsx as $l}from"react/jsx-runtime";function $y({env:e,theme:t="dark",mobileBreakpoint:r=768,drawerDirection:n,modal:o,showBalance:i=!1,showForgeToken:a=!1,showGameToken:s=!0,showQR:l=!0,showBridge:d=!0,qrLogoSrc:c,walletAddress:b,accountName:f,sendAccounts:m,profileImageUrl:y,connectorId:g,connectorName:u,connectorIconUrl:p,preferredTokens:w=[],onSelectWallet:h,onCopyAddress:x,onBuy:k,onBuyDisabledMessage:R,onBridgeDisabledMessage:I,onSendDisabledMessage:C,onDisconnect:S,disconnectLabel:E="Disconnect",termsUrl:M=ma,termsLabel:B="Terms of Service",privacyUrl:L=ga,privacyLabel:z="Privacy Policy",open:A,onOpenChange:U,showPortfolio:oe=!1,showOnePop:Y=!1,onePopSummary:G,onOnePopOpen:H,onOnePopSend:ie,onOnePopClaim:te,onOnePopActivity:O,onOnePopRepliesSeen:Z,onePopGetTokenSlot:_,onePopLogoSrc:ce,onePopHeroSrc:xe,portfolioTitle:he="My Portfolio",portfolioSections:fe,showTotalAssets:ge=!0,totalAssetsLabel:we="Total Assets USD",sendTransaction:Ye,getTransactionReceipt:be,estimateGas:Te,onOutlink:it,lpBalanceReader:We,stakingRewardsReader:_e,bridgeTokens:Be,bridgeHistory:rt,getBridgeQuote:Et,getBridgeToTokens:ft,getBridgeApproval:Ct,approveBridge:Se,submitBridge:wt,onReceive:yt,onBridge:St,onSend:Ke,style:Xe,children:$t}){let At=ot(e),zt=g?pa[g]:void 0,Mt=u??zt?.name,nt=p??zt?.iconUrl,Ge=Ao(`(max-width: ${r}px)`),at=n??(i?"right":"bottom"),Nt=at==="left"||at==="right",Pe=o??!1,st=A!==void 0,[_t,F]=Xt.useState(!1),ke=st?A:_t,P=Xt.useCallback(ee=>{st||F(ee),U?.(ee)},[st,U]),ae=Xt.useCallback(()=>P(!1),[P]);Ln(ke,ae);let[pe,me]=Xt.useState(null),[Je,ar]=Xt.useState("top"),[Qt,Lt]=Xt.useState(null),[hr,br]=Xt.useState("wallet"),[Vt,sr]=Xt.useState(null),[X,Ee]=Xt.useState(null);Xt.useEffect(()=>{ke||(br("wallet"),sr(null),Ee(null))},[ke]),Xt.useEffect(()=>{Io(b)},[b]);let j=Xt.useCallback(()=>{fl(b),S?.()},[S,b]),ze=Xt.useMemo(()=>({env:At,theme:t,isMobile:Ge,open:ke,drawerDirection:at,modal:Pe,showBalance:i,showForgeToken:a,showGameToken:s,showQR:l,showBridge:d,qrLogoSrc:c,walletAddress:b,accountName:f,sendAccounts:m,profileImageUrl:y,connectorName:Mt,connectorIconUrl:nt,preferredTokens:w,close:ae,onSelectWallet:h,onCopyAddress:x,onBuy:k,onBuyDisabledMessage:R,onBridgeDisabledMessage:I,onSendDisabledMessage:C,onDisconnect:S?j:void 0,disconnectLabel:E,termsUrl:M,termsLabel:B,privacyUrl:L,privacyLabel:z,portalStyle:Xe,navContent:pe,navPosition:Je,setNavContent:me,setNavPosition:ar,footerContent:Qt,setFooterContent:Lt,view:hr,setView:br,selectedSendToken:Vt,setSelectedSendToken:sr,selectedDetailToken:X,setSelectedDetailToken:Ee,showPortfolio:oe,showOnePop:Y,onePopSummary:G,onOnePopOpen:H,onOnePopSend:ie,onOnePopClaim:te,onOnePopActivity:O,onOnePopRepliesSeen:Z,onePopGetTokenSlot:_,onePopLogoSrc:ce,onePopHeroSrc:xe,portfolioTitle:he,portfolioSections:fe,showTotalAssets:ge,totalAssetsLabel:we,sendTransaction:Ye,getTransactionReceipt:be,estimateGas:Te,onOutlink:it,lpBalanceReader:We,stakingRewardsReader:_e,bridgeTokens:Be,bridgeHistory:rt,getBridgeQuote:Et,getBridgeToTokens:ft,getBridgeApproval:Ct,approveBridge:Se,submitBridge:wt,onReceive:yt,onBridge:St,onSend:Ke}),[At,t,Ge,ke,at,Pe,i,a,s,l,d,c,b,f,m,y,Mt,nt,w,ae,h,x,k,R,I,C,S,j,E,M,B,L,z,Xe,pe,Je,Qt,hr,Vt,X,oe,Y,G,H,ie,te,O,Z,_,ce,xe,he,fe,ge,we,Ye,be,Te,it,We,_e,Be,rt,Et,ft,Ct,Se,wt,yt,St,Ke]);return $l(sl.Provider,{value:ze,children:Ge?$l(Jy.Root,{direction:at,open:ke,onOpenChange:P,handleOnly:Nt,noBodyStyles:!0,repositionInputs:!1,children:$t},"drawer"):$l(cm.Root,{open:ke,onOpenChange:P,children:$t},"popover")})}var Qo=Object.assign($y,{Trigger:dp,Content:im,Nav:sm,Footer:dm});import*as qe from"react";import*as Is from"react";import{createContext as ex,useContext as tx}from"react";var ed=ex(null);function Ci(){let e=tx(ed);if(!e)throw new Error("RelayDeposit compound components must be used within <RelayDeposit>");return e}import*as Vm from"react";import{createContext as rx,useContext as nx}from"react";var ps=rx(null);function an(){let e=nx(ps);if(!e)throw new Error("ResponsiveShell compound components must be used within <ResponsiveShell>");return e}import{createContext as ox,useContext as ix,useLayoutEffect as ax,useState as sx}from"react";function pm(){let e=null,t=new Set;return{getSnapshot:()=>e,publish(r){if(r!==e){e=r;for(let n of[...t])n()}},subscribe(r){return t.add(r),()=>{t.delete(r)}}}}var td=ox(null);function lx(){let e=ix(td);if(!e)throw new Error("RelayDeposit compound components must be used within <RelayDeposit>");return e}function um(){let e=lx(),[t,r]=sx(e.getSnapshot);return ax(()=>(r(e.getSnapshot()),e.subscribe(()=>r(e.getSnapshot()))),[e]),t}de(`.rd-root{--rd-bg: var(--ds-bg-dim, #f7f8fb);--rd-surface: var(--ds-surface-default, #ffffff);--rd-surface-alt: var(--ds-surface-medium, #f0f1f6);--rd-border: var(--ds-border-default, #e2e4ec);--rd-text: var(--ds-content-highest, #14161f);--rd-text-muted: var(--ds-content-medium, #676b7a);--rd-accent: var(--ds-accent-primary-high, #5b5bf6);--rd-accent-contrast: var(--ds-accent-primary-on, #ffffff);--rd-success: var(--ds-system-green-default, #1e9e6a);--rd-success-bg: var(--ds-system-green-low, #e6f7f0);--rd-warning: #b8860b;--rd-warning-bg: #fdf3d9;--rd-danger: var(--ds-system-red-default, #d1394a);--rd-danger-bg: var(--ds-system-red-low, #fbe8ea);--rd-radius: 14px;--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(20, 22, 31, .04), 0 8px 24px rgba(20, 22, 31, .06));--rd-on-accent: #ffffff;width:100%;max-width:640px;box-sizing:border-box;margin:0 auto;display:flex;flex-direction:column;gap:1.25rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--rd-bg);color:var(--rd-text);-webkit-font-smoothing:antialiased;color-scheme:light dark}.rd-root[data-theme=dark]{color-scheme:dark;--rd-bg: var(--ds-bg-default, #0f1117);--rd-surface: var(--ds-surface-default, #171923);--rd-surface-alt: var(--ds-surface-medium, #1e212c);--rd-border: var(--ds-border-default, #2a2d3a);--rd-text: var(--ds-content-highest, #eef0f6);--rd-text-muted: var(--ds-content-medium, #9498a8);--rd-accent: var(--ds-accent-primary-high, #8181ff);--rd-accent-contrast: var(--ds-accent-primary-on, #0f1117);--rd-success: var(--ds-system-green-default, #3fd68f);--rd-success-bg: var(--ds-system-green-low, #123626);--rd-warning: #e0b23c;--rd-warning-bg: #3a2f10;--rd-danger: var(--ds-system-red-default, #ff6b7a);--rd-danger-bg: var(--ds-system-red-low, #3a1418);--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35))}.rd-root[data-theme=light]{color-scheme:light;--rd-bg: var(--ds-bg-dim, #f7f8fb);--rd-surface: var(--ds-surface-default, #ffffff);--rd-surface-alt: var(--ds-surface-medium, #f0f1f6);--rd-border: var(--ds-border-default, #e2e4ec);--rd-text: var(--ds-content-highest, #14161f);--rd-text-muted: var(--ds-content-medium, #676b7a);--rd-accent: var(--ds-accent-primary-high, #5b5bf6);--rd-accent-contrast: var(--ds-accent-primary-on, #ffffff);--rd-success: var(--ds-system-green-default, #1e9e6a);--rd-success-bg: var(--ds-system-green-low, #e6f7f0);--rd-warning: #b8860b;--rd-warning-bg: #fdf3d9;--rd-danger: var(--ds-system-red-default, #d1394a);--rd-danger-bg: var(--ds-system-red-low, #fbe8ea);--rd-radius: 14px;--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(20, 22, 31, .04), 0 8px 24px rgba(20, 22, 31, .06))}.rd-root *{box-sizing:border-box}.rd-card{background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:var(--rd-radius);box-shadow:var(--rd-shadow);padding:1.25rem;display:flex;flex-direction:column;gap:.9rem}.rd-card-header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.rd-card-title{font-size:1rem;font-weight:650;margin:0}.rd-card-hint{font-size:.8rem;color:var(--rd-text-muted)}.rd-token-address{display:flex;flex-direction:column;gap:.1rem}.rd-token-address-addr{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.78rem;color:var(--rd-text);overflow-wrap:anywhere;user-select:all}.rd-token-address-meta{font-size:.72rem;color:var(--rd-text-muted)}.rd-field{display:flex;flex-direction:column;gap:.35rem}.rd-field-label{font-size:.69rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-root .rd-field-label-row{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.rd-root .rd-token-explorer-link{font-size:.75rem;font-weight:500;color:var(--rd-accent);text-decoration:none;white-space:nowrap}.rd-root .rd-token-explorer-link:hover{text-decoration:underline}.rd-field-row{display:grid;grid-template-columns:1fr 1fr;gap:.625rem}.rd-root select,.rd-root input[type=text],.rd-root input[type=number]{width:100%;padding:.6rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:16px;font-family:inherit}.rd-root select:focus,.rd-root input:focus{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-dropdown{position:relative;min-width:0}.rd-root .rd-dropdown-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.55rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:.9rem;font-family:inherit;font-weight:600;text-align:left;cursor:pointer}.rd-root .rd-static-target{display:flex;align-items:center;gap:.55rem;padding:.55rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:.9rem;font-weight:600;min-width:0;overflow-wrap:anywhere}.rd-root .rd-dropdown-trigger:disabled{cursor:not-allowed}.rd-dropdown-trigger:focus,.rd-dropdown-trigger:focus-visible{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-dropdown-trigger-content{display:flex;align-items:center;gap:.55rem;min-width:0}.rd-dropdown-trigger-label{display:flex;flex-direction:column;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.rd-dropdown-trigger-sub{font-size:.66rem;font-weight:500;line-height:1.3;color:var(--rd-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-dropdown-chevron{display:inline-flex;flex:none;color:var(--rd-text-muted);line-height:1}.rd-dropdown-popover{z-index:100002;width:var(--radix-popover-trigger-width);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;--rd-surface: var(--ds-surface-default, #ffffff);--rd-surface-alt: var(--ds-surface-medium, #f0f1f6);--rd-border: var(--ds-border-default, #e2e4ec);--rd-text: var(--ds-content-highest, #14161f);--rd-accent: var(--ds-system-orange-default, #5b5bf6);--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(20, 22, 31, .04), 0 8px 24px rgba(20, 22, 31, .06))}.rd-dropdown-popover[data-theme=dark]{color-scheme:dark;--rd-surface: var(--ds-surface-default, #171923);--rd-surface-alt: var(--ds-surface-medium, #1e212c);--rd-border: var(--ds-border-default, #2a2d3a);--rd-text: var(--ds-content-highest, #eef0f6);--rd-accent: var(--ds-system-orange-default, #8181ff);--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35))}.rd-dropdown-popover *{box-sizing:border-box}.rd-dropdown-listbox{margin:0;padding:.3rem;list-style:none;max-height:min(15rem,var(--radix-popover-content-available-height, 15rem));overflow-y:auto;overscroll-behavior:contain;background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:10px;box-shadow:var(--rd-shadow);font-family:inherit;color:var(--rd-text)}.rd-dropdown-option{display:flex;align-items:center;gap:.55rem;padding:.5rem .6rem;border-radius:8px;font-size:.9rem;color:var(--rd-text);cursor:pointer}.rd-dropdown-option-active{background:var(--rd-surface-alt)}.rd-dropdown-option-selected{font-weight:650}.rd-dropdown-option-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-dropdown-option-check{flex:none;color:var(--rd-accent);font-size:.8rem}.rd-amount-input{display:flex;align-items:baseline;gap:.5rem;padding:.6rem .75rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt)}.rd-amount-input:focus-within{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-amount-input[data-rd-invalid]{border-color:var(--rd-danger)}.rd-root .rd-amount-input input[type=text]{flex:1 1 auto;width:auto;min-width:0;padding:0;border:0;border-radius:0;background:none;font-size:22px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.2}.rd-root .rd-amount-input input[type=text]:focus{outline:none}.rd-amount-input-suffix{flex:none;font-size:.8rem;font-weight:700;color:var(--rd-text-muted);pointer-events:none}.rd-root .rd-amount-input-max{flex:none;padding:0;font-size:.69rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-accent);background:transparent;border:0;border-radius:0;cursor:pointer;line-height:1}.rd-amount-input-max:hover:not(:disabled){text-decoration:underline}.rd-amount-input-max:disabled{opacity:.5;cursor:not-allowed}.rd-amount-meta{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;font-size:.75rem;color:var(--rd-text-muted);padding:0 .15rem;font-variant-numeric:tabular-nums}.rd-root button{font-family:inherit;font-size:.95rem;font-weight:650;border-radius:10px;border:1px solid transparent;padding:.7rem 1.1rem;cursor:pointer;transition:opacity .12s ease,transform .12s ease}.rd-root button:active:not(:disabled){transform:translateY(1px)}.rd-root button:disabled{cursor:not-allowed;opacity:.55}.rd-button-primary{background:var(--rd-accent);color:var(--rd-accent-contrast)}.rd-button-secondary{background:var(--rd-surface-alt);color:var(--rd-text);border-color:var(--rd-border)}.rd-button-block{width:100%}.rd-callout{border-radius:10px;padding:.65rem .85rem;font-size:.85rem;line-height:1.4}.rd-callout-warning{background:var(--rd-warning-bg);color:var(--rd-warning)}.rd-callout-danger{background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-callout-success{background:var(--rd-success-bg);color:var(--rd-success)}.rd-callout-muted{background:var(--rd-surface-alt);color:var(--rd-text-muted)}.rd-quote-strip{display:flex;align-items:center;justify-content:space-between;gap:.625rem;padding:.7rem .85rem;border-radius:14px;background:color-mix(in srgb,var(--rd-accent) 10%,var(--rd-surface));border:1px solid color-mix(in srgb,var(--rd-accent) 35%,transparent)}.rd-quote-strip-side{display:flex;flex-direction:column;min-width:0;gap:.1rem;font-size:.9rem;font-weight:700;color:var(--rd-text);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.rd-quote-strip-end{text-align:right;align-items:flex-end}.rd-quote-strip-side small{font-size:.69rem;font-weight:600;color:var(--rd-text-muted);letter-spacing:.02em}.rd-quote-strip-arrow{flex:none;color:var(--rd-accent);font-weight:800}.rd-quote-strip-hint{font-size:.72rem;line-height:1.45;color:var(--rd-text-muted);padding:0 .15rem}.rd-deposit-address{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 1fr auto;align-items:start;gap:.7rem;min-height:172px;background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:16px;box-shadow:var(--rd-shadow);padding:.85rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;color:var(--rd-text-muted)}.rd-deposit-address-label{grid-column:1;grid-row:1;position:relative;display:inline-flex;align-items:center;gap:.35rem;width:fit-content;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif}.rd-root button.rd-address-term{position:static;width:auto;height:auto;display:inline;padding:0 0 2px;border:0;border-bottom:1px dotted currentColor;border-radius:0;background:transparent;color:var(--rd-text-muted);font:700 .69rem/1 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;letter-spacing:.08em;text-transform:uppercase}.rd-root button.rd-address-term:hover,.rd-root button.rd-address-term:focus-visible{color:var(--rd-accent);outline:none}.rd-address-tooltip{position:absolute;z-index:20;top:calc(100% + 8px);left:0;width:min(250px,calc(100vw - 48px));padding:9px 11px;border:1px solid var(--rd-border);border-radius:10px;background:var(--rd-surface);box-shadow:var(--rd-shadow);color:var(--rd-text);font-size:11.5px;font-weight:500;line-height:1.45;letter-spacing:normal;text-align:left;text-transform:none;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(-3px);transition:opacity .12s ease,transform .12s ease,visibility .12s ease}.rd-address-term:hover .rd-address-tooltip,.rd-address-term:focus .rd-address-tooltip,.rd-address-term:focus-visible .rd-address-tooltip{opacity:1;visibility:visible;transform:translateY(0)}.rd-address-full{grid-column:1 / -1;grid-row:2;align-self:center;min-width:0;color:var(--rd-text);font-weight:600;line-height:1.55;overflow-wrap:anywhere;word-break:break-all}.rd-root .rd-address-copy{grid-column:1 / -1;grid-row:3;width:100%;min-height:36px;display:inline-flex;align-items:center;justify-content:center;gap:.4rem;margin:0;padding:.5rem .7rem;border-radius:10px;border:0;background:var(--rd-accent);color:var(--rd-accent-contrast);font-family:inherit;font-size:.75rem;font-weight:800;letter-spacing:.03em;line-height:1}.rd-root .rd-address-copy svg{flex:none}.rd-root .rd-address-copy:hover:not(:disabled){opacity:.92}.rd-root button.rd-mobile-qr-toggle,.rd-root button.rd-mobile-address-toggle{display:none;place-items:center;width:34px;height:34px;padding:0;border:1px solid color-mix(in srgb,var(--rd-accent) 24%,var(--rd-border));border-radius:11px;background:color-mix(in srgb,var(--rd-accent) 10%,var(--rd-surface));color:var(--rd-accent);box-shadow:0 1px 2px color-mix(in srgb,var(--rd-text) 8%,transparent);transition:transform .15s ease,background-color .15s ease,border-color .15s ease,box-shadow .15s ease}.rd-root button.rd-mobile-qr-toggle{grid-column:2;grid-row:1;justify-self:end;align-self:start}.rd-root button.rd-mobile-address-toggle{position:absolute;z-index:2;top:.85rem;right:.85rem;background:var(--rd-surface);color:var(--rd-text-muted);box-shadow:0 4px 14px color-mix(in srgb,var(--rd-text) 16%,transparent)}.rd-root button.rd-mobile-qr-toggle:hover:not(:disabled),.rd-root button.rd-mobile-address-toggle:hover:not(:disabled){border-color:color-mix(in srgb,var(--rd-accent) 45%,var(--rd-border));color:var(--rd-accent);background:color-mix(in srgb,var(--rd-accent) 15%,var(--rd-surface));box-shadow:0 5px 16px color-mix(in srgb,var(--rd-accent) 18%,transparent);transform:translateY(-1px)}.rd-root button.rd-mobile-qr-toggle:active:not(:disabled),.rd-root button.rd-mobile-address-toggle:active:not(:disabled){transform:scale(.96)}.rd-deposit-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.9rem;container:rd-deposit-head / inline-size}.rd-deposit-head>.rd-deposit-qr-pane{flex:none}.rd-deposit-head>.rd-deposit-address{flex:1 1 12rem;min-width:0}@container rd-deposit-head (max-width: 23.75rem){.rd-deposit-head>.rd-deposit-address{flex-basis:100%;width:100%}.rd-deposit-head>.rd-skeleton-qr{display:none}.rd-deposit-head>.rd-skeleton-address{flex-basis:100%;width:100%}.rd-root button.rd-mobile-qr-toggle,.rd-root button.rd-mobile-address-toggle{display:grid}.rd-deposit-head[data-compact-view=address]>.rd-deposit-qr-pane,.rd-deposit-head[data-compact-view=qr]>.rd-deposit-address{display:none}.rd-deposit-head[data-compact-view=address]>.rd-deposit-address,.rd-deposit-head[data-compact-view=qr]>.rd-deposit-qr-pane{animation:rd-compact-pane-in .26s cubic-bezier(.22,1,.36,1)}.rd-deposit-head[data-compact-view=qr]>.rd-deposit-qr-pane{width:100%}}@keyframes rd-compact-pane-in{0%{opacity:0;transform:translateY(6px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}.rd-deposit-qr{position:relative;display:grid;place-items:center;width:172px;height:172px;background:#fff;border-radius:16px;border:1px solid var(--rd-border);box-shadow:var(--rd-shadow);margin:0 auto}.rd-deposit-qr-pane{position:relative;display:grid;place-items:center;min-height:172px}.rd-deposit-qr-badge{position:absolute;inset:0;margin:auto;width:36px;height:36px;display:grid;place-items:center;background:#fff;border-radius:50%;pointer-events:none}.rd-stepper{display:flex;flex-direction:column;gap:0}.rd-stepper-item{display:flex;gap:.75rem;position:relative;padding-bottom:1.25rem}.rd-stepper-item:last-child{padding-bottom:0}.rd-stepper-rail{display:flex;flex-direction:column;align-items:center}.rd-stepper-dot{width:22px;height:22px;border-radius:50%;border:2px solid var(--rd-border);background:var(--rd-surface);display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:700;flex:none;color:var(--rd-text-muted)}.rd-stepper-item-done .rd-stepper-dot{background:var(--rd-success);border-color:var(--rd-success);color:var(--rd-on-accent)}.rd-stepper-item-active .rd-stepper-dot{border-color:var(--rd-accent);color:var(--rd-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--rd-accent) 20%,transparent)}.rd-stepper-line{flex:1;width:2px;background:var(--rd-border);margin:2px 0}.rd-stepper-item-done .rd-stepper-line{background:var(--rd-success)}.rd-stepper-body{padding-top:1px}.rd-stepper-label{font-weight:600;font-size:.9rem}.rd-stepper-item-pending .rd-stepper-label{color:var(--rd-text-muted)}.rd-stepper-meta{margin-top:.25rem;font-size:.78rem;color:var(--rd-text-muted);display:flex;flex-direction:column;gap:.15rem}.rd-stepper-meta a{color:var(--rd-accent);text-decoration:none}.rd-stepper-meta a:hover{text-decoration:underline}.rd-status-pill{display:inline-flex;align-items:center;gap:.35rem;font-size:.75rem;font-weight:650;padding:.2rem .55rem;border-radius:999px;background:var(--rd-surface-alt);color:var(--rd-text-muted);width:fit-content}.rd-status-pill-success{background:var(--rd-success-bg);color:var(--rd-success)}.rd-status-pill-failure{background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-spinner{display:inline-block;width:1em;height:1em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:rd-spin .7s linear infinite;vertical-align:-.15em}@keyframes rd-spin{to{transform:rotate(360deg)}}.rd-muted{color:var(--rd-text-muted)}.rd-settings-row{display:flex;justify-content:flex-end}.rd-root .rd-icon-button{position:relative;display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border-radius:50%;border:1px solid var(--rd-border);background:var(--rd-surface);color:var(--rd-text-muted)}.rd-root .rd-icon-button:hover:not(:disabled){color:var(--rd-text);background:var(--rd-surface-alt)}.rd-recovery-badge{position:absolute;top:-.3rem;right:-.3rem;display:flex;align-items:center;justify-content:center;min-width:1.05rem;height:1.05rem;padding:0 .25rem;border-radius:999px;background:var(--rd-danger, #d1394a);color:#fff;font-size:.65rem;font-weight:700;line-height:1;border:2px solid var(--rd-surface, #ffffff)}.rd-recover-group{display:flex;flex-direction:column;gap:.75rem}.rd-recover-group+.rd-recover-group{border-top:1px solid var(--rd-border);padding-top:1rem;margin-top:.5rem}.rd-recover-group-label{margin:0;font-size:.8rem;color:var(--rd-text-muted)}.rd-recover-made-of{display:block;padding:.65rem .8rem;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:10px}.rd-recover-made-of-label{cursor:pointer;font-size:.72rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-recover-made-of-body{display:flex;flex-direction:column;gap:.4rem;margin-top:.6rem}.rd-error-details{margin-top:-.4rem;padding:0 .15rem;color:var(--rd-text-muted);font-size:.72rem}.rd-error-details summary{width:max-content;cursor:pointer;list-style:none;font-weight:600}.rd-error-details summary::-webkit-details-marker{display:none}.rd-error-details summary:before{display:inline-block;margin-right:.35rem;content:"\\203a";transition:transform .12s ease}.rd-error-details[open] summary:before{transform:rotate(90deg)}.rd-error-log{position:relative;margin-top:.5rem}.rd-root button.rd-error-copy{position:absolute;z-index:1;top:.45rem;right:.45rem;display:inline-flex;align-items:center;justify-content:center;width:1.65rem;height:1.65rem;padding:0;border:1px solid var(--rd-border);border-radius:6px;background:var(--rd-surface);color:var(--rd-text-muted)}.rd-root button.rd-error-copy:hover:not(:disabled){background:var(--rd-surface-alt);color:var(--rd-text)}.rd-error-details code{display:block;max-height:6rem;overflow:auto;padding:.6rem 2.7rem .6rem .7rem;border:1px solid var(--rd-border);border-radius:8px;background:var(--rd-surface-alt);color:var(--rd-text-muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.68rem;line-height:1.45;overflow-wrap:anywhere;scrollbar-color:var(--rd-border) transparent;scrollbar-width:thin;white-space:pre-wrap}.rd-error-details code::-webkit-scrollbar{width:4px;height:4px}.rd-error-details code::-webkit-scrollbar-thumb{border-radius:999px;background:var(--rd-border)}.rd-token-list{display:flex;flex-direction:column;gap:.5rem}.rd-token-row{display:flex;align-items:center;gap:10px;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:12px 14px}.rd-token-row-info{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;overflow-wrap:anywhere}.rd-token-row-symbol{font-weight:700}.rd-token-row-amount{font-variant-numeric:tabular-nums;font-size:14px;font-weight:700;color:var(--rd-text);white-space:nowrap}.rd-token-row-status{font-size:11.5px;line-height:1.45;color:var(--rd-text-muted)}.rd-token-row-warn{font-size:11.5px;line-height:1.45;color:var(--rd-warning)}.rd-token-row-warn b{font-weight:750;font-variant-numeric:tabular-nums}.rd-token-row-step{font-size:11.5px;line-height:1.45;font-weight:650;color:var(--rd-accent)}.rd-root .rd-token-row-action{flex:none;width:auto;padding:9px 16px;font-size:13px;font-weight:700}.rd-token-row-spinner{flex:none;font-size:18px;color:var(--rd-accent)}.rd-recover-sum{display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:16px 14px;container:rd-recover-sum / inline-size}.rd-recover-sum-label{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-recover-sum-value{max-width:100%;overflow:hidden;font-size:22px;font-size:clamp(18px,7cqi,28px);font-weight:800;line-height:1.15;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;color:var(--rd-text)}.rd-recover-sum-unit{display:block;margin:.35rem 0 0;font-size:15px;font-weight:700;color:var(--rd-text-muted)}.rd-recover-sum-empty{font-size:17px;font-weight:700;color:var(--rd-text-muted)}.rd-recover-empty{display:flex;min-height:min(20rem,48vh);flex:1 1 auto;flex-direction:column;align-items:center;justify-content:center;gap:.7rem;padding:2.5rem 1.5rem;border:1px solid var(--rd-border);border-radius:16px;background:radial-gradient(circle at 50% 0%,color-mix(in srgb,var(--rd-accent) 11%,transparent),transparent 48%),var(--rd-surface-alt);text-align:center;box-sizing:border-box}.rd-recover-empty-icon{display:grid;width:4.25rem;height:4.25rem;place-items:center;margin-bottom:.2rem;border:1px solid color-mix(in srgb,var(--rd-accent) 30%,var(--rd-border));border-radius:50%;background:color-mix(in srgb,var(--rd-accent) 12%,var(--rd-surface));color:var(--rd-accent);box-shadow:0 10px 30px color-mix(in srgb,var(--rd-accent) 12%,transparent)}.rd-recover-empty[data-variant=unavailable] .rd-recover-empty-icon{border-color:var(--rd-border);background:var(--rd-surface);color:var(--rd-text-muted);box-shadow:none}.rd-recover-empty-title,.rd-recover-sum-value.rd-recover-empty-title{max-width:100%;margin:0;overflow:visible;color:var(--rd-text);font-size:1.15rem;font-weight:750;line-height:1.35;white-space:normal}.rd-recover-empty-copy{max-width:23rem;margin:0;color:var(--rd-text-muted);font-size:.82rem;line-height:1.55;text-wrap:balance}.rd-root button.rd-recover-empty-refresh{display:inline-flex;min-height:2.6rem;align-items:center;justify-content:center;gap:.45rem;margin-top:.45rem;padding:.65rem 1rem;color:var(--rd-text);font-size:.82rem}.rd-root button.rd-recover-empty-refresh:hover:not(:disabled){border-color:color-mix(in srgb,var(--rd-accent) 35%,var(--rd-border));background:color-mix(in srgb,var(--rd-accent) 9%,var(--rd-surface));color:var(--rd-accent)}[data-rd-recover-funds].rd-stack{flex:1 1 auto}.rd-recover-foot{margin-top:auto;padding-top:.5rem;text-align:center;font-size:11.5px;line-height:1.45;color:var(--rd-text-muted)}.rd-history-table{display:flex;min-width:0;flex-direction:column;gap:.6rem;font-size:.875rem}.rd-history-empty{display:flex;min-height:min(20rem,48vh);flex:1 1 auto;flex-direction:column;align-items:center;justify-content:center;gap:.7rem;padding:2.5rem 1.5rem;border:1px solid var(--rd-border);border-radius:16px;background:radial-gradient(circle at 50% 0%,color-mix(in srgb,var(--rd-accent) 10%,transparent),transparent 48%),var(--rd-surface-alt);text-align:center;box-sizing:border-box}.rd-history-empty-icon{display:grid;width:4.25rem;height:4.25rem;place-items:center;margin-bottom:.2rem;border:1px solid color-mix(in srgb,var(--rd-accent) 30%,var(--rd-border));border-radius:50%;background:color-mix(in srgb,var(--rd-accent) 12%,var(--rd-surface));color:var(--rd-accent);box-shadow:0 10px 30px color-mix(in srgb,var(--rd-accent) 12%,transparent)}.rd-history-empty[data-variant=disconnected] .rd-history-empty-icon{border-color:var(--rd-border);background:var(--rd-surface);color:var(--rd-text-muted);box-shadow:none}.rd-history-empty-title{margin:0;color:var(--rd-text);font-size:1.15rem;font-weight:750;line-height:1.35}.rd-history-empty-copy{max-width:22rem;margin:0;color:var(--rd-text-muted);font-size:.82rem;line-height:1.55;text-wrap:balance}.rd-history-empty-live{display:inline-flex;align-items:center;gap:.4rem;margin-top:.35rem;color:var(--rd-text-muted);font-size:.72rem;font-weight:650}.rd-history-empty-live>span{width:.45rem;height:.45rem;border-radius:50%;background:var(--rd-success);box-shadow:0 0 0 3px color-mix(in srgb,var(--rd-success) 15%,transparent)}.rd-history-group{min-width:0;max-width:100%;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;overflow:hidden}.rd-history-row-button{width:100%;min-width:0;display:flex;flex-direction:column;gap:.75rem;padding:1rem;background:none;border:none;border-radius:inherit;color:inherit;font:inherit;text-align:left;cursor:pointer}.rd-history-row-button[aria-expanded=true]{border-radius:12px 12px 0 0}.rd-history-row-button:hover{background:color-mix(in srgb,var(--rd-border) 30%,transparent)}.rd-history-row-button:focus-visible{outline:2px solid var(--rd-accent);outline-offset:-2px}.rd-history-card-top{display:flex;align-items:center;gap:.5rem;min-width:0}.rd-history-card-top>.rd-status-pill{margin-left:auto;flex:none}.rd-history-card-top>.rd-status-pill:not(.rd-status-pill-success):not(.rd-status-pill-failure){background:color-mix(in srgb,var(--rd-accent) 12%,transparent);color:var(--rd-accent)}.rd-history-asset{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-history-card-amounts{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:.75rem;padding:.75rem;border-radius:10px;background:var(--rd-surface)}.rd-history-amount-block{display:flex;max-width:100%;flex-direction:column;gap:.15rem;min-width:0}.rd-history-amount-block:last-child{align-items:flex-end;text-align:right}.rd-history-amount-label{color:var(--rd-text-muted);font-size:.68rem;font-weight:650;line-height:1.2}.rd-history-num{max-width:100%;overflow:hidden;font-variant-numeric:tabular-nums;font-size:.875rem;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.rd-history-num[data-full-value],.rd-history-step-amount[data-full-value]{cursor:help}[data-rd-history-floating-tooltip]{position:fixed;z-index:100100;width:max-content;max-width:calc(100vw - 1.5rem);padding:.45rem .65rem;border:1px solid;border-radius:8px;font-size:.72rem;font-weight:600;line-height:1.35;text-align:left;white-space:normal;overflow-wrap:anywhere;pointer-events:none}.rd-history-card-arrow{display:inline-flex;align-items:center;justify-content:center;color:var(--rd-text-muted);font-size:.85rem}.rd-history-received{color:var(--rd-success)}.rd-history-received-estimate{color:var(--rd-text-muted);font-weight:600}.rd-history-card-foot{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.rd-history-date{color:var(--rd-text-muted);font-size:.78rem;font-variant-numeric:tabular-nums}.rd-history-chevron{display:inline-flex;flex:none;align-items:center;justify-content:center;color:var(--rd-text-muted);text-align:center;transition:transform .16s ease}.rd-history-row-button[aria-expanded=true] .rd-history-chevron{transform:rotate(180deg)}.rd-history-detail{display:flex;min-width:0;flex-direction:column;gap:.375rem;padding:.65rem .9rem .8rem;border-top:1px solid var(--rd-border)}.rd-history-step{display:grid;min-width:0;grid-template-columns:.5rem auto 1fr auto auto;gap:.5rem;align-items:center}.rd-history-step-dot{width:.5rem;height:.5rem;border-radius:50%;background:var(--rd-border)}.rd-history-step-dot-done{background:var(--rd-success)}.rd-history-step-label{font-weight:600}.rd-history-step-chain{color:var(--rd-text-muted)}.rd-history-step-amount{font-variant-numeric:tabular-nums;color:var(--rd-text-muted)}.rd-history-step-tx{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.rd-history-step-shared{margin-left:.4rem;color:var(--rd-text-muted);font-size:.72rem}.rd-skeleton{border-radius:10px;background:linear-gradient(90deg,var(--rd-surface-alt) 25%,color-mix(in srgb,var(--rd-surface-alt) 55%,var(--rd-surface)) 42%,var(--rd-surface-alt) 60%);background-size:220% 100%;animation:rd-skeleton-wave 1.4s ease-in-out infinite}@keyframes rd-skeleton-wave{0%{background-position:130% 0}to{background-position:-90% 0}}@media(prefers-reduced-motion:reduce){.rd-skeleton,.rd-checklist-status,.rd-deposit-head[data-compact-view=address]>.rd-deposit-address,.rd-deposit-head[data-compact-view=qr]>.rd-deposit-qr-pane,.rd-checklist-status-waiting .rd-checklist-status-dot,.rd-checklist-status-detected .rd-checklist-status-dot{animation:none}}.rd-skeleton-form{display:flex;flex-direction:column;gap:.85rem}.rd-skeleton-qr{flex:none;width:172px;height:172px;border-radius:16px}.rd-skeleton-address{flex:1 1 12rem;min-width:0;height:172px;border-radius:16px}.rd-skeleton-line{height:.9rem;width:40%}.rd-skeleton-field{height:48px}.rd-skeleton-notice{height:96px}.rd-skeleton-cta{height:48px}.rd-wizard{flex:1 1 auto;min-height:0;overflow-y:auto;container:rd-wizard / inline-size;padding:1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom,0px));scroll-padding:1.5rem 0 calc(1.5rem + env(safe-area-inset-bottom,0px));overscroll-behavior:contain;-webkit-overflow-scrolling:touch;max-width:none;gap:.85rem}.rd-deposit-tabs{--rd-tab-count: 3;--rd-active-tab-index: 0;position:sticky;top:-1rem;z-index:2;display:flex;flex:0 0 auto;justify-content:space-around;margin:-1rem -1.25rem 0;padding:1rem 1.25rem 0;border-bottom:1px solid var(--rd-border);background:var(--rd-surface)}.rd-deposit-tabs[data-active-index="1"]{--rd-active-tab-index: 1}.rd-deposit-tabs[data-active-index="2"]{--rd-active-tab-index: 2}.rd-deposit-tabs:after{position:absolute;bottom:-1px;left:1.25rem;width:calc((100% - 2.5rem) / var(--rd-tab-count));height:2px;background:var(--rd-accent);content:"";pointer-events:none;transform:translate(calc(var(--rd-active-tab-index) * 100%));transition:transform .22s cubic-bezier(.22,1,.36,1),width .18s ease}.rd-root .rd-deposit-tab{position:relative;display:inline-flex;flex:1 1 0;min-width:0;min-height:2.75rem;align-items:center;justify-content:center;gap:.4rem;padding:.85rem .35rem;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--rd-text-muted);font:inherit;font-size:.875rem;font-weight:650;line-height:1.2;transition:border-color .16s ease,background-color .16s ease,color .16s ease}.rd-root .rd-deposit-tab[data-active=true]{color:var(--rd-text)}.rd-root .rd-deposit-tab:hover:not(:disabled),.rd-root .rd-deposit-tab:focus-visible{outline:none;background:color-mix(in srgb,var(--rd-accent) 7%,transparent);color:var(--rd-text)}.rd-deposit-tab>.rd-recovery-badge{position:static;flex:none;min-width:1rem;height:1rem;padding:0 .2rem;border-width:0}.rd-deposit-tab-panel{display:flex;min-width:0;flex:1 1 auto;flex-direction:column;gap:.85rem;transform-origin:top center;animation:rd-deposit-tab-in .18s cubic-bezier(.22,1,.36,1)}@keyframes rd-deposit-tab-in{0%{opacity:0;transform:translateY(.35rem)}to{opacity:1;transform:translateY(0)}}.rd-stack{display:flex;min-width:0;flex-direction:column;gap:.75rem}.rd-wizard-header{display:flex;align-items:center;gap:.5rem;margin-bottom:0}.rd-wizard-heading{font-size:1rem;font-weight:700;color:var(--rd-text);margin:0}.rd-wizard-actions{margin-left:auto;display:flex;align-items:center;gap:.25rem}.rd-min-notice-pending{color:var(--rd-text-muted)}.rd-min-notice-pending b{font-weight:750;color:var(--rd-warning);font-variant-numeric:tabular-nums}.rd-locked-card{display:flex;width:100%;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;padding:1.5rem 1.25rem;border:1px solid var(--rd-border);border-radius:16px;background:radial-gradient(circle at 50% 0%,color-mix(in srgb,var(--rd-accent) 12%,transparent),transparent 52%),var(--rd-surface-alt);text-align:center;box-sizing:border-box}.rd-locked-glyph{display:grid;width:3rem;height:3rem;place-items:center;margin-bottom:.1rem;border:1px solid color-mix(in srgb,var(--rd-accent) 30%,var(--rd-border));border-radius:50%;background:color-mix(in srgb,var(--rd-accent) 12%,var(--rd-surface));color:var(--rd-accent);line-height:0;box-shadow:0 10px 30px color-mix(in srgb,var(--rd-accent) 12%,transparent)}.rd-locked-title{margin:0;color:var(--rd-text);font-size:1rem;font-weight:750;line-height:1.3}.rd-locked-text{max-width:22rem;margin:0;color:var(--rd-text-muted);font-size:.8rem;line-height:1.45}.rd-locked-card>.rd-card-hint{max-width:22rem;margin:-.2rem 0 0;text-wrap:balance}.rd-root button.rd-locked-action{display:inline-flex;width:min(18rem,100%);min-height:2.6rem;align-items:center;justify-content:center;gap:.5rem;margin-top:.25rem}.rd-delivery-recipient{display:flex;flex-direction:column;gap:.3rem;margin-top:.5rem}.rd-checklist-credit{font-size:clamp(10px,2.7vw,11.5px);white-space:nowrap}.rd-checklist{background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:14px;padding:11px 14px;display:flex;flex-direction:column;gap:7px}.rd-checklist-row{display:flex;align-items:flex-start;gap:.5rem;font-size:12.5px;line-height:1.5;color:var(--rd-text)}.rd-checklist-row[data-rd-checklist-only]{align-items:center;white-space:nowrap;font-size:clamp(10.5px,2.8vw,12.5px)}.rd-checklist-mark{flex:none;width:1.05rem;text-align:center;font-weight:800;color:var(--rd-text-muted)}.rd-checklist-mark-warn{color:var(--rd-warning)}.rd-checklist-accent{color:var(--rd-accent);font-weight:750;font-variant-numeric:tabular-nums}.rd-checklist-status{min-height:54px;display:flex;align-items:center;gap:.65rem;padding:10px 12px;border:1px solid color-mix(in srgb,var(--rd-accent) 30%,var(--rd-border));border-radius:12px;background:var(--rd-surface-alt);color:var(--rd-text-muted);font-size:12.5px;line-height:1.45;transform-origin:top center;animation:rd-status-enter .48s cubic-bezier(.22,1,.36,1)}.rd-checklist-status-waiting,.rd-checklist-status-detected{border-color:color-mix(in srgb,var(--rd-warning) 42%,var(--rd-border));box-shadow:0 0 0 1px color-mix(in srgb,var(--rd-warning) 10%,transparent)}@keyframes rd-status-enter{0%{opacity:0;transform:translateY(-10px) scale(.985);box-shadow:0 0 color-mix(in srgb,var(--rd-accent) 28%,transparent)}65%{opacity:1;transform:translateY(1px) scale(1);box-shadow:0 0 0 4px color-mix(in srgb,var(--rd-accent) 16%,transparent)}to{opacity:1;transform:translateY(0);box-shadow:0 0 0 0 transparent}}.rd-checklist-status-dot{flex:none;width:9px;height:9px;border-radius:50%;background:var(--rd-warning);box-shadow:0 0 0 4px color-mix(in srgb,var(--rd-warning) 14%,transparent)}.rd-checklist-status-waiting .rd-checklist-status-dot,.rd-checklist-status-detected .rd-checklist-status-dot{animation:rd-status-breathe 1.8s ease-in-out infinite}@keyframes rd-status-breathe{0%,to{opacity:.82;transform:scale(.96);box-shadow:0 0 0 3px color-mix(in srgb,var(--rd-warning) 10%,transparent)}50%{opacity:1;transform:scale(1);box-shadow:0 0 0 5px color-mix(in srgb,var(--rd-warning) 15%,transparent)}}.rd-checklist-status-funded,.rd-checklist-status-processing{color:var(--rd-text);border-color:color-mix(in srgb,var(--rd-accent) 40%,transparent)}.rd-checklist-status-funded .rd-checklist-status-dot,.rd-checklist-status-processing .rd-checklist-status-dot{background:var(--rd-accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--rd-accent) 14%,transparent)}.rd-checklist-status-completed{border-color:color-mix(in srgb,var(--rd-success) 40%,transparent);background:var(--rd-success-bg);color:var(--rd-success)}.rd-checklist-status-completed .rd-checklist-status-dot{background:var(--rd-success);box-shadow:0 0 0 4px color-mix(in srgb,var(--rd-success) 14%,transparent)}.rd-checklist-status-failed{border-color:color-mix(in srgb,var(--rd-danger) 40%,transparent);background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-checklist-status-failed .rd-checklist-status-dot{background:var(--rd-danger);box-shadow:0 0 0 4px color-mix(in srgb,var(--rd-danger) 14%,transparent)}@container rd-wizard (max-width: 30rem){.rd-recover-sum{padding-inline:.75rem}.rd-recover-sum-value{font-size:clamp(1rem,6cqi,1.5rem)}[data-rd-recover-funds] .rd-callout,.rd-token-row-status,.rd-token-row-warn,.rd-token-row-step,.rd-recover-foot{overflow-wrap:anywhere}.rd-token-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;padding:.875rem}.rd-root .rd-token-row-action{width:100%;min-height:2.75rem;grid-column:1 / -1}.rd-token-row-spinner{grid-column:1 / -1;justify-self:center}}@container rd-wizard (max-width: 24rem){.rd-history-card-top{flex-direction:column;align-items:flex-start}.rd-history-card-top>.rd-status-pill{max-width:100%;margin-left:0;white-space:normal}.rd-history-asset{overflow:visible;text-overflow:clip;white-space:normal}.rd-history-card-amounts{grid-template-columns:minmax(0,1fr);gap:.45rem}.rd-history-amount-block{width:100%}.rd-history-amount-block:last-child{align-items:flex-start;text-align:left}.rd-history-card-arrow{display:inline-flex;justify-self:center;margin:0;transform:rotate(90deg);transform-origin:center}.rd-history-card-foot{align-items:flex-start}.rd-history-date{min-width:0;line-height:1.4;overflow-wrap:anywhere}.rd-history-step{grid-template-columns:.5rem minmax(0,1fr);grid-template-areas:"dot label" ". chain" ". amount" ". tx";column-gap:.5rem;row-gap:.25rem;align-items:start;padding-block:.65rem;line-height:1.35}.rd-history-step+.rd-history-step{border-top:1px solid var(--rd-border)}.rd-history-step-dot{grid-area:dot;margin-top:.35rem}.rd-history-step-label{grid-area:label}.rd-history-step-chain{grid-area:chain}.rd-history-step-amount{grid-area:amount}.rd-history-step-tx{grid-area:tx;min-width:0;max-width:100%}.rd-history-step-tx a{overflow-wrap:anywhere}.rd-history-step-shared{display:block;margin:.15rem 0 0}.rd-history-step>.rd-muted{grid-area:tx}}@container rd-wizard (max-width: 22rem){.rd-root .rd-deposit-tab{gap:.2rem;padding-inline:.15rem;font-size:.8rem}.rd-history-row-button,.rd-history-detail{padding-inline:.75rem}}@media(prefers-reduced-motion:reduce){.rd-deposit-tabs:after,.rd-root .rd-deposit-tab{transition:none}.rd-deposit-tab-panel{animation:none}}
19
19
  `);import{jsx as Qn,jsxs as sn}from"react/jsx-runtime";function fm({minNotice:e,arrivalStatus:t}){let r=t.amount&&t.symbol?`${t.amount} ${t.symbol} arrived`:t.amount?`${t.amount} arrived`:void 0,n=(()=>{switch(t.phase){case"detected":if(e.remaining!==void 0){let o=`${e.remaining} ${e.symbol}`;return r?`${r} at the processing address. Waiting for ${o} more to reach the minimum.`:`Deposit detected. Waiting for ${o} more to reach the minimum.`}return r?`${r} at the processing address. Checking the minimum.`:"Deposit detected. Checking the minimum.";case"funded":return`${e.min} ${e.symbol} received at the processing address. Preparing delivery.`;case"processing":return"Minimum reached. Bridging and delivering to ONEchain.";case"completed":return"Transfer completed. Funds were delivered to ONEchain.";case"failed":return`Transfer needs attention${t.backendStatus?` (${t.backendStatus})`:""}.`;case"unavailable":return e.remaining===void 0?"Live status is temporarily unavailable. Retrying automatically.":void 0;default:return e.remaining===void 0?"Waiting for your deposit.":void 0}})();return n?sn("div",{className:`rd-checklist-status rd-checklist-status-${t.phase}`,"data-rd-deposit-status":"","data-phase":t.phase,role:"status","aria-live":"polite","aria-atomic":"true",children:[Qn("span",{className:"rd-checklist-status-dot","aria-hidden":"true"}),Qn("span",{children:n})]},`live:${t.phase}:${n}`):e.remaining!==void 0?sn("div",{className:"rd-checklist-status rd-checklist-status-waiting rd-min-notice-pending","data-rd-min-notice-pending":"",role:"status","aria-live":"polite","aria-atomic":"true",children:[Qn("span",{className:"rd-checklist-status-dot","aria-hidden":"true"}),sn("span",{children:["Waiting for"," ",sn("b",{children:[e.remaining," ",e.symbol]})," ","more to arrive at the processing address."]})]},`pending:${e.remaining}:${e.symbol}`):null}function mm({minNotice:e,onlySend:t,showWalletCreditNote:r=!1}){return sn("div",{className:"rd-checklist","data-rd-checklist":"",children:[sn("div",{className:"rd-checklist-row","data-rd-checklist-only":"",children:[Qn("span",{className:"rd-checklist-mark rd-checklist-mark-warn","aria-hidden":"true",children:"!"}),sn("span",{children:[sn("b",{children:[t.chainName," ",t.symbol," only"]})," \xB7 ",sn("b",{className:"rd-checklist-accent",children:[e.min," ",e.symbol," minimum"]})]})]}),sn("div",{className:"rd-checklist-row",children:[Qn("span",{className:"rd-checklist-mark","aria-hidden":"true",children:"\u21BB"}),Qn("span",{children:"Reusable \u2014 deposit as many times as you like"})]}),r&&sn("div",{className:"rd-checklist-row rd-checklist-credit","data-rd-checklist-credit":"",children:[Qn("span",{className:"rd-checklist-mark","aria-hidden":"true",children:"\u2192"}),Qn("span",{children:"Credited to your ONEchain wallet"})]})]})}import{useEffect as xx,useId as vx,useState as bm}from"react";var Si="0x0000000000000000000000000000000000000000",dx=/^0x[0-9a-fA-F]{40}$/;function dt(e){return dx.test(e)}function Wt(e,t){let r=e<0n,o=(r?-e:e).toString().padStart(t+1,"0"),i=t===0?o:o.slice(0,-t),a=t===0?"":o.slice(-t).replace(/0+$/,""),s=a?`${i}.${a}`:i;return r?`-${s}`:s}function us(e,t){let r=e.match(/^(-?)(\d+)(?:\.(\d+))?$/);if(!r)throw new Error(`parseUnits: invalid decimal string "${e}"`);let[,n,o,i=""]=r;if(i.length>t)throw new Error(`parseUnits: too many decimal places for ${t} decimals`);let a=BigInt(o+i.padEnd(t,"0"));return n==="-"?-a:a}import{useId as Vn}from"react";var rd="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTQwIDU0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzc0MDAwXzM4NTkwKSI+CjxtYXNrIGlkPSJtYXNrMF83NDAwMF8zODU5MCIgc3R5bGU9Im1hc2stdHlwZTpsdW1pbmFuY2UiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSI1NDAiIGhlaWdodD0iNTQwIj4KPHBhdGggZD0iTTI3MCAwQzU2Ljg1NjMgMCAwIDU2Ljg1NjMgMCAyNzBDMCA0ODMuMTQ0IDU2Ljg1NjMgNTQwIDI3MCA1NDBDNDgzLjE0NCA1NDAgNTQwIDQ4My4xNDQgNTQwIDI3MEM1NDAgNTYuODU2MyA0ODMuMTQ0IDAgMjcwIDBaIiBmaWxsPSJ3aGl0ZSI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5samCp6KoCbTYCbGwpgYG2NkrIyZseuz5u0fuA48I//jsP1f4BDIQ6FEXvnEbzeJJT+SARgLY2JsjNG8MLv/uOjW7xW5hMmnT9t74DZor5CQzgPFCOPaDJnpMw5Og/YNVuyiTaRpelXrJjN94BAuQ1pTFHQsXU72hp+2TjLTB+7gMEjxm4kGN7cuQtMHzoIU2dTrywzKbzLTB44Ude5SbHRN0YpiuNfzltD0eR2OghRRuoOVnCsGHJM3ZKbPGDgJUuSGDa8qW09Sft5Nlsz0gQO4CFLEeb1ecgg11vySmT7YHNsHKQyj/TplrhWf6ARbMtMHG2Nrf9F1qV+7UFaQF2zITB9si42DFP6xfufizWRF+TAeMtMHW2LTIEU+rNwl+wsh70QjMn2wHTYMUuQfCjsWbSn7wFeEqIl/SmT6TMRW2CxIkf+gemaYjNC7JZHpg02wDTYKUrQ+rHVZxVJynXu0PJ8LmXPasZDnYANsgU2CFG0DhVdkCsKMm+J2JOZi5szcgxRt/SKnaPeCTiU3eqrS6r2KKHNjjkGK9of1Lu73r/W79OpQ2KXkHHk+o7G7CGNuKxLxXMbM2JkDc2FOQYoUAOx2049/l4Cd3UQs10mS60vhtfzsPBLxbMbE2BgjY2XMQYoU2UIavS+2XseiDaQQ+d4iovOpeB8W5WkM3YazDIQ7K/zsRn4Xv5PfzRgYC2MKUqSIs1tC4dWZZTl4UVtZ9q7HiUehi/h775H//4aI7z0OZ5LeVJvNw/fyM/wsn8Fn8Zl8Nr+D36Wvsp/if7BfCn8ECvocAAAAAElFTkSuQmCC";function gm(e){switch(e.toUpperCase()){case"ONEUSD":return rd;case"PONEUSD":return cx;case"USDT":return px;case"USDC":return ux;default:return}}import{jsx as $,jsxs as Jt}from"react/jsx-runtime";function hm(e){let t=e.trim();return t?t.slice(0,2).toUpperCase():"?"}function fx({size:e,bg:t,fg:r="#ffffff",children:n}){return Jt("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",style:{display:"block",flex:"none",borderRadius:"50%"},children:[$("circle",{cx:"12",cy:"12",r:"12",fill:t}),$("g",{fill:r,stroke:r,children:n})]})}function nd({size:e,bg:t,fg:r="#ffffff",text:n}){return $(fx,{size:e,bg:t,fg:r,children:$("text",{x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",fontSize:"10",fontWeight:700,fontFamily:"inherit",stroke:"none",fill:r,children:n})})}function Vo({size:e,viewBox:t="0 0 24 24",children:r}){return $("svg",{width:e,height:e,viewBox:t,"aria-hidden":"true",focusable:"false",style:{display:"block",flex:"none",borderRadius:"50%"},children:r})}function mx({size:e}){let t=Vn();return Jt(Vo,{size:e,children:[Jt("g",{clipPath:`url(#${t})`,children:[$("path",{fill:"#000",d:"M24 0H0v24h24z"}),$("path",{fill:"#8FFCF3",d:"M12 4v5.912l5 2.237z"}),$("path",{fill:"#CABCF8",d:"m12 4-5 8.148 5-2.235z"}),$("path",{fill:"#CBA7F5",d:"M12 15.98V20l5-6.92z"}),$("path",{fill:"#74A0F3",d:"M12 20v-4.02l-5-2.9z"}),$("path",{fill:"#CBA7F5",d:"m12 15.049 5-2.9-5-2.236z"}),$("path",{fill:"#74A0F3",d:"m7 12.149 5 2.9V9.913z"}),$("path",{fill:"#202699",fillRule:"evenodd",clipRule:"evenodd",d:"m12 15.048-5-2.9L12 4l5 8.148zm-4.67-3.136 4.588-7.475v5.435zm-.068.204 4.656-2.068v4.768zm4.816-2.068v4.768l4.653-2.7zm0-.176 4.588 2.04-4.588-7.475z"}),$("path",{fill:"#202699",fillRule:"evenodd",clipRule:"evenodd",d:"m12 15.917-5-2.84L12 20l5-6.924zm-4.44-2.341 4.36 2.48v3.56zm4.519 2.48v3.56l4.36-6.04z"})]}),$("defs",{children:$("clipPath",{id:t,children:$("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]})}function gx({size:e}){let t=Vn();return Jt(Vo,{size:e,children:[Jt("g",{clipPath:`url(#${t})`,children:[$("path",{fill:"#F0B90B",d:"M24 0H0v24h24z"}),$("path",{fill:"#fff",d:"M7.635 6.449 12 4l4.364 2.449-1.6.907L12 5.809 9.24 7.356zm8.73 3.093-1.6-.906L12 10.182 9.24 8.636l-1.605.906v1.81l2.756 1.546v3.089l1.609.906 1.604-.906v-3.09l2.76-1.546zm0 4.903V12.63l-1.6.907v1.809zm1.141.64-2.76 1.542v1.813l4.365-2.453v-4.898l-1.605.902zm-1.604-7.09 1.6.907v1.81l1.609-.903V7.996l-1.605-.907L15.902 8zm-5.511 9.29v1.808L12 20l1.604-.907V17.29l-1.604.9-1.605-.907zM7.635 14.44l1.6.907v-1.81l-1.6-.906v1.813zm2.756-6.444L12 8.902l1.604-.906L12 7.089 10.395 8zm-3.898.906 1.605-.906-1.6-.907L4.888 8v1.813l1.605.903zm0 3.09-1.604-.903v4.898l4.364 2.453v-1.818L6.498 15.08v-3.093z"})]}),$("defs",{children:$("clipPath",{id:t,children:$("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]})}function hx({size:e}){let t=Vn();return Jt(Vo,{size:e,viewBox:"0 0 111 111",children:[Jt("g",{clipPath:`url(#${t})`,children:[$("path",{fill:"#fff",d:"M0 0h111v111H0z"}),$("path",{fill:"#0052FF",d:"M54.921 110.034C85.359 110.034 110.034 85.402 110.034 55.017C110.034 24.6319 85.359 0 54.921 0C26.0432 0 2.35281 22.1714 0 50.3923H72.8467V59.6416H0C2.35281 87.8625 26.0432 110.034 54.921 110.034Z"})]}),$("defs",{children:$("clipPath",{id:t,children:$("path",{fill:"#fff",d:"M0 0h111v111H0z"})})})]})}function bx({size:e}){let t=Vn();return Jt(Vo,{size:e,children:[Jt("g",{clipPath:`url(#${t})`,children:[$("path",{fill:"#213147",d:"M24 0H0v24h24z"}),$("path",{fill:"#fff",d:"m13.203 13.216-.787 2.124a.27.27 0 0 0 0 .183l1.354 3.655 1.565-.89-1.879-5.072c-.042-.117-.21-.117-.253 0m1.577-3.573a.135.135 0 0 0-.253 0l-.787 2.124a.27.27 0 0 0 0 .183l2.217 5.985 1.565-.89z"}),$("path",{fill:"#fff",d:"M11.999 4.991a.24.24 0 0 1 .111.03l5.969 3.393a.22.22 0 0 1 .112.19v6.787a.22.22 0 0 1-.112.19l-5.969 3.395a.2.2 0 0 1-.111.029.24.24 0 0 1-.113-.03l-5.968-3.39a.22.22 0 0 1-.112-.19v-6.79a.22.22 0 0 1 .112-.19l5.969-3.393a.23.23 0 0 1 .111-.03m0-.991c-.213 0-.426.054-.616.163L5.416 7.556a1.21 1.21 0 0 0-.616 1.05v6.787c0 .433.234.834.616 1.05l5.968 3.394a1.25 1.25 0 0 0 1.232 0l5.968-3.394a1.21 1.21 0 0 0 .616-1.05V8.606a1.21 1.21 0 0 0-.616-1.05l-5.97-3.393A1.24 1.24 0 0 0 11.998 4"}),$("path",{fill:"#fff",d:"m8.052 17.943.55-1.482 1.105.905-1.034.93zm3.445-9.823H9.984a.27.27 0 0 0-.254.175l-3.243 8.757 1.565.89L11.623 8.3a.132.132 0 0 0-.127-.179"}),$("path",{fill:"#fff",d:"M14.144 8.12h-1.513a.27.27 0 0 0-.253.175l-3.704 10 1.565.89 4.032-10.886a.133.133 0 0 0-.127-.179"})]}),$("defs",{children:$("clipPath",{id:t,children:$("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]})}function wx({size:e}){let t=Vn(),r=Vn();return Jt(Vo,{size:e,children:[Jt("g",{clipPath:`url(#${t})`,children:[$("path",{fill:`url(#${r})`,d:"M24 0H0v24h24z"}),$("path",{fill:"#fff",d:"m15.88 14.86 3.794-2.165a.64.64 0 0 0 .326-.558v-4.33a.64.64 0 0 0-.326-.556L15.88 5.086a.66.66 0 0 0-.65 0L11.432 7.25a.64.64 0 0 0-.325.557v7.737l-2.662 1.517-2.661-1.517v-3.036l2.661-1.517 1.755 1.001V9.958l-1.43-.816a.66.66 0 0 0-.65 0l-3.796 2.165a.64.64 0 0 0-.325.557v4.33c0 .229.124.442.325.557l3.796 2.165c.2.114.45.114.65 0l3.796-2.165a.64.64 0 0 0 .325-.557V8.455l.048-.026 2.613-1.49 2.661 1.516v3.036l-2.661 1.517-1.753-.999v2.037l1.427.814a.66.66 0 0 0 .651 0z"})]}),Jt("defs",{children:[Jt("linearGradient",{id:r,x1:"3.948",x2:"19.217",y1:"16.617",y2:"7.645",gradientUnits:"userSpaceOnUse",children:[$("stop",{stopColor:"#A726C1"}),$("stop",{offset:".88",stopColor:"#803BDF"}),$("stop",{offset:"1",stopColor:"#7B3FE4"})]}),$("clipPath",{id:t,children:$("path",{fill:"#fff",d:"M0 0h24v24H0z"})})]})]})}function yx({size:e}){let t=Vn(),r=Vn();return Jt(Vo,{size:e,children:[Jt("g",{clipPath:`url(#${t})`,children:[$("path",{fill:`url(#${r})`,d:"M24 0H0v24h24z"}),$("path",{fill:"#fff",d:"M17.7 8.358a.55.55 0 0 1-.365.145H4.515c-.455 0-.684-.52-.37-.825l2.106-2.03a.54.54 0 0 1 .364-.15h12.87c.46 0 .685.524.365.83zm0 10.005c-.1.09-.23.14-.365.14H4.515c-.455 0-.684-.516-.37-.82l2.106-2.036a.53.53 0 0 1 .364-.145h12.87c.46 0 .685.52.365.825zm0-7.72a.55.55 0 0 0-.365-.14H4.515c-.455 0-.684.515-.37.82l2.106 2.035c.1.091.23.143.364.144h12.87c.46 0 .685-.52.365-.824z"})]}),Jt("defs",{children:[Jt("linearGradient",{id:r,x1:"4.001",x2:"20.408",y1:"50.258",y2:"50.108",gradientUnits:"userSpaceOnUse",children:[$("stop",{stopColor:"#599DB0"}),$("stop",{offset:"1",stopColor:"#47F8C3"})]}),$("clipPath",{id:t,children:$("path",{fill:"#fff",d:"M0 0h24v24H0z"})})]})]})}function fs({chainId:e,chainName:t,size:r=20}){switch(e){case 1:return $(mx,{size:r});case 56:return $(gx,{size:r});case 8453:return $(hx,{size:r});case 42161:return $(bx,{size:r});case 137:return $(wx,{size:r});case 792703809:return $(yx,{size:r});case 612055:return $(nd,{size:r,bg:"#0b1f3a",text:"CR"});default:return $(nd,{size:r,bg:"#676b7a",text:hm(t??String(e))})}}function wo({symbol:e,logoUrl:t,size:r=20}){let n=t&&t.trim().length>0?t.trim():gm(e);return n?$("img",{src:n,alt:"","aria-hidden":"true",width:r,height:r,style:{display:"block",flex:"none",borderRadius:"50%",objectFit:"cover"}}):$(nd,{size:r,bg:"#676b7a",text:hm(e)})}import{QRCodeSVG as kx}from"qrcode.react";import{Fragment as ms,jsx as ut,jsxs as Bt}from"react/jsx-runtime";function gs(){return Bt("div",{className:"rd-deposit-head","data-testid":"rd-address-skeleton","aria-hidden":"true",children:[ut("span",{className:"rd-skeleton rd-skeleton-qr"}),ut("span",{className:"rd-skeleton rd-skeleton-address"})]})}function Rx(e){let{depositAddress:t,originChainId:r,originCurrency:n,amountWei:o,isNative:i}=e;if(i)return o!==void 0?`ethereum:${t}@${r}?value=${o.toString()}`:`ethereum:${t}@${r}`;let a=new URLSearchParams({address:t});return o!==void 0&&a.set("uint256",o.toString()),`ethereum:${n}@${r}/transfer?${a.toString()}`}function Cx(e){let{depositAddress:t,splMint:r,humanAmount:n}=e,o=new URLSearchParams;return n&&o.set("amount",n),o.set("spl-token",r),`solana:${t}?${o.toString()}`}function wm({depositAddress:e,originChainId:t,originChainName:r,originCurrency:n,amount:o,tokenSymbol:i,tokenDecimals:a,kind:s="evm",depositState:l,onDeposit:d,canDeposit:c,oneClickEnabled:b=!0}){let[f,m]=bm(!1),[y,g]=bm("address"),u=vx();xx(()=>{g("address")},[e]);let p=n.toLowerCase()===Si,w=s==="svm";async function h(){try{await navigator.clipboard.writeText(e),m(!0),setTimeout(()=>m(!1),1500)}catch{}}let x;if(o)try{let A=BigInt(o);A>0n&&(x=A)}catch{}let k=x!==void 0,R;if(k)try{R=Wt(x,a)}catch{R=o}let I=w?Cx({depositAddress:e,splMint:n,humanAmount:R??""}):Rx({depositAddress:e,originChainId:t,originCurrency:n,amountWei:x,isNative:p}),{isSubmitting:C,isConfirming:S,isConfirmed:E,needsSwitch:M,txHash:B,reverted:L,error:z}=l;return Bt("section",{className:"rd-stack",children:[Bt("div",{className:"rd-deposit-head","data-compact-view":y,children:[Bt("div",{className:"rd-deposit-qr-pane",children:[Bt("div",{className:"rd-deposit-qr",children:[ut(kx,{value:I,size:144,level:"H"}),ut("span",{className:"rd-deposit-qr-badge","aria-hidden":"true",children:ut(fs,{chainId:t,chainName:r,size:28})})]}),ut("button",{type:"button",className:"rd-mobile-address-toggle","aria-label":"Show address and copy",onClick:()=>g("address"),children:Bt("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[ut("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2.25",stroke:"currentColor",strokeWidth:"1.8"}),ut("path",{d:"M16 8V6.25A2.25 2.25 0 0 0 13.75 4h-7.5A2.25 2.25 0 0 0 4 6.25v7.5A2.25 2.25 0 0 0 6.25 16H8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})})]}),Bt("div",{className:"rd-deposit-address",children:[ut("span",{className:"rd-deposit-address-label",children:Bt("button",{type:"button",className:"rd-address-term","aria-describedby":u,children:["Deposit address",ut("span",{id:u,className:"rd-address-tooltip",role:"tooltip",children:"This is a reusable, open deposit address. A wrong token or wrong chain will not be processed automatically, and recovery has weaker guarantees than a one-time order address and may require a manual request."})]})}),ut("button",{type:"button",className:"rd-mobile-qr-toggle","aria-label":"Show deposit QR code","aria-pressed":y==="qr",onClick:()=>g("qr"),children:ut("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:ut("path",{d:"M7.913 10.833c.69 0 1.25.56 1.25 1.25v4.163c0 .69-.56 1.25-1.25 1.25H3.75c-.69 0-1.25-.56-1.25-1.25v-4.163c0-.69.56-1.25 1.25-1.25h4.163Zm6.255 6.663h-1.665V15.83h1.665v1.666Zm3.332 0h-1.666V15.83H17.5v1.666Zm-13.334-5v3.334h3.331v-3.333H4.166Zm8.337 3.334h-1.666v-1.666h1.666v1.666Zm3.331 0h-1.666v-1.666h1.666v1.666Zm-1.666-1.666h-1.665v-1.667h1.665v1.667Zm3.332 0h-1.666v-1.667H17.5v1.667Zm-4.997-1.667h-1.666v-1.664h1.666v1.664Zm3.331 0h-1.666v-1.664h1.666v1.664ZM7.913 2.504c.69 0 1.25.56 1.25 1.25v4.163c0 .69-.56 1.25-1.25 1.25H3.75c-.69 0-1.25-.56-1.25-1.25V3.754c0-.69.56-1.25 1.25-1.25h4.163Zm8.329 0c.69 0 1.25.56 1.25 1.25v4.163c0 .69-.56 1.25-1.25 1.25h-4.163c-.69 0-1.25-.56-1.25-1.25V3.754c0-.69.56-1.25 1.25-1.25h4.163ZM4.166 4.17V7.5h3.331V4.17H4.166Zm8.329 0V7.5h3.331V4.17h-3.331Z",fill:"currentColor"})})}),ut("span",{className:"rd-address-full",title:e,children:e}),Bt("button",{type:"button",className:"rd-address-copy",onClick:h,"aria-label":`Copy deposit address ${e}`,children:[f?ut("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:ut("path",{d:"m5 12 4 4L19 6",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})}):Bt("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[ut("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.8"}),ut("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),ut("span",{"aria-live":"polite",children:f?"Copied":"Copy address"})]})]})]}),!w&&c&&Bt(ms,{children:[ut("button",{type:"button",className:"rd-button-primary rd-button-block",onClick:d,disabled:C||S||E&&!L,children:E&&!L?"Deposit sent":S?"Confirming...":C?M?"Switching network...":"Confirm in wallet...":`One-click deposit ${i}${M?` (switch to ${r})`:""}`}),z&&ut("div",{className:"rd-callout rd-callout-danger",children:z}),B&&Bt("p",{className:"rd-card-hint",children:["Tx: ",ut("span",{style:{fontFamily:"monospace"},children:B})]}),E&&L&&ut("div",{className:"rd-callout rd-callout-danger",children:"The deposit transaction reverted on-chain. Please check your wallet and try again."}),E&&!L&&ut("div",{className:"rd-callout rd-callout-success",children:"Deposit confirmed on-chain. Waiting for it to be swept..."})]}),w&&Bt("div",{className:"rd-callout rd-callout-muted",children:["Pay from a Solana wallet (e.g. Phantom). Scan the QR or copy the address above and send"," ",k?Bt(ms,{children:["exactly"," ",Bt("strong",{children:[R," ",i]})]}):Bt(ms,{children:["any amount of ",ut("strong",{children:i})]}),"."]}),(k||!w&&!c&&b)&&Bt("p",{className:"rd-card-hint",children:[k&&Bt(ms,{children:["Send exactly"," ",Bt("strong",{children:[R," ",i]})," ","on ",r," to this address."]}),!w&&!c&&b&&!k&&"Enter an amount to deposit in one click."]})]})}import{useEffect as Sx,useId as Nx,useRef as ym,useState as od}from"react";import*as qn from"@radix-ui/react-popover";import{jsx as bn,jsxs as Ni}from"react/jsx-runtime";function Ti({value:e,options:t,onChange:r,disabled:n,ariaLabel:o,id:i}){let a=Nx(),s=i??a,l=`${s}-listbox`,[d,c]=od(!1),b=t.findIndex(E=>E.value===e),[f,m]=od(b>=0?b:0),y=ym(null),g=ym([]),u=!!n||t.length===0,p=b>=0?t[b]:void 0;Sx(()=>{d&&g.current[f]?.scrollIntoView?.({block:"nearest"})},[d,f]);let[w,h]=od(null);function x(){u||(h(y.current?.closest("[data-theme]")?.getAttribute("data-theme")??null),m(b>=0?b:0),c(!0))}function k(E){c(!1),E&&y.current?.focus()}function R(E){let M=t[E];M&&(r(M.value),k(!0))}function I(){u||(d?k(!1):x())}function C(E){if(!u)switch(E.key){case"ArrowDown":E.preventDefault(),d?m(M=>Math.min(M+1,t.length-1)):x();break;case"ArrowUp":E.preventDefault(),d?m(M=>Math.max(M-1,0)):x();break;case"Enter":case" ":E.preventDefault(),d?R(f):x();break;case"Escape":d&&(E.preventDefault(),k(!0));break;case"Tab":d&&c(!1);break;default:break}}let S=d&&t[f]?`${s}-option-${f}`:void 0;return bn(qn.Root,{open:d,onOpenChange:E=>E?x():k(!1),children:Ni("div",{className:"rd-dropdown",children:[bn(qn.Trigger,{asChild:!0,children:Ni("button",{type:"button",id:s,ref:y,className:"rd-dropdown-trigger","aria-haspopup":"listbox","aria-expanded":d,"aria-controls":l,"aria-activedescendant":S,"aria-label":o,disabled:u,onClick:I,onKeyDown:C,children:[Ni("span",{className:"rd-dropdown-trigger-content",children:[p?.icon,Ni("span",{className:"rd-dropdown-trigger-label",children:[p?.label??"",p?.subLabel&&bn("small",{className:"rd-dropdown-trigger-sub",children:p.subLabel})]})]}),bn("span",{className:"rd-dropdown-chevron","aria-hidden":"true",children:bn(Lr,{size:16})})]})}),d&&bn(qn.Portal,{children:bn(qn.Content,{className:"rd-dropdown-popover","data-theme":w??void 0,side:"bottom",align:"start",sideOffset:5,collisionPadding:12,onOpenAutoFocus:E=>E.preventDefault(),onCloseAutoFocus:E=>E.preventDefault(),children:bn("ul",{className:"rd-dropdown-listbox",role:"listbox",id:l,"aria-label":o,tabIndex:-1,"data-vaul-no-drag":!0,children:t.map((E,M)=>{let B=E.value===e,L=M===f;return Ni("li",{id:`${s}-option-${M}`,role:"option","aria-selected":B,ref:z=>{g.current[M]=z},className:["rd-dropdown-option",L?"rd-dropdown-option-active":"",B?"rd-dropdown-option-selected":""].filter(Boolean).join(" "),onPointerEnter:()=>m(M),onClick:z=>{z.preventDefault(),R(M)},children:[E.icon,bn("span",{className:"rd-dropdown-option-label",children:E.label}),B&&bn("span",{className:"rd-dropdown-option-check","aria-hidden":"true",children:"\u2713"})]},E.value)})})})})]})})}import{Fragment as id,jsx as Yn,jsxs as jr}from"react/jsx-runtime";function Tx(e,t){if(!e)return"--";try{return Wt(BigInt(e),t)}catch{return"--"}}function xm({quote:e,isLoading:t,error:r,humanAmount:n,originSymbol:o,destination:i}){return jr("div",{className:"rd-stack","data-rd-quote-preview":"",children:[t&&jr("div",{className:"rd-quote-strip","data-testid":"rd-quote-skeleton",children:[Yn("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"30%"},"aria-hidden":"true"}),Yn("span",{className:"rd-quote-strip-arrow","aria-hidden":"true",children:"\u2192"}),Yn("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"30%"},"aria-hidden":"true"})]}),!t&&r&&jr("div",{className:"rd-callout rd-callout-danger",children:["Couldn't fetch a quote: ",r.message]}),!t&&!r&&e&&o&&jr(id,{children:[jr("div",{className:"rd-quote-strip",children:[jr("span",{className:"rd-quote-strip-side",children:[jr("b",{children:[n," ",o]}),Yn("small",{children:"You send"})]}),Yn("span",{className:"rd-quote-strip-arrow","aria-hidden":"true",children:"\u2192"}),jr("span",{className:"rd-quote-strip-side rd-quote-strip-end",children:[jr("b",{children:["~",Tx(e.expectedCrossd,i.decimals)," ",i.symbol]}),Yn("small",{children:"You receive"})]})]}),e.belowMin&&Yn("div",{className:"rd-callout rd-callout-warning",children:"This amount is below the minimum the bridge will accept. Increase the amount to continue."}),(e.assumesParity||e.feeUsd)&&jr("p",{className:"rd-quote-strip-hint",children:[e.feeUsd&&jr(id,{children:["Bridge fee: $",e.feeUsd,", already deducted from the amount above. You also pay your own network fee to send the deposit."," "]}),e.assumesParity&&jr(id,{children:["Assumes 1:1 parity between bridged USDT and ",i.symbol,"; the final amount may differ slightly."]})]})]}),!t&&!r&&!e&&Yn("p",{className:"rd-muted",children:"Enter an amount to see a quote."})]})}import{useMemo as Rm}from"react";var vm={1:{base:"https://etherscan.io",name:"Etherscan",kind:"evm"},56:{base:"https://bscscan.com",name:"BscScan",kind:"evm"},137:{base:"https://polygonscan.com",name:"PolygonScan",kind:"evm"},8453:{base:"https://basescan.org",name:"BaseScan",kind:"evm"},42161:{base:"https://arbiscan.io",name:"Arbiscan",kind:"evm"},612055:{base:"https://scan.crosstoken.io",name:"ONEchain Scan",kind:"evm"},792703809:{base:"https://solscan.io",name:"Solscan",kind:"svm"}};function km(e,t){let r=vm[e];if(!(!r||!t))return{url:`${r.base}/token/${t}`,name:r.name}}var Ix={1:"Ethereum",56:"BNB Smart Chain",137:"Polygon",8453:"Base",42161:"Arbitrum",612055:"ONEchain",792703809:"Solana"};function qo(e){return Ix[e]??`Chain ${e}`}function hs(e,t){let r=vm[e];if(!(!r||!t))return{url:`${r.base}/tx/${t}`,name:r.name}}import{jsx as Wr,jsxs as Kn}from"react/jsx-runtime";function Ex(e){let t=new Map;for(let r of e.origins)t.has(r.chainId)||t.set(r.chainId,r.chainName);return Array.from(t,([r,n])=>({chainId:r,chainName:n}))}function Cm(e,t){return t===void 0?[]:e.origins.filter(r=>r.chainId===t)}function Ax(e,t){let r=Wt(e,t),n=r.indexOf(".");return n===-1?r:`${r.slice(0,n)}.${r.slice(n+1,n+1+4)}`.replace(/\.?0+$/,"")||r.slice(0,n)}function Sm({catalog:e,origin:t,onChangeOrigin:r,amount:n,onChangeAmount:o,showAmountInput:i=!0,balance:a,balanceLoading:s,insufficientBalance:l,onMax:d,disabled:c}){let b=Rm(()=>Ex(e),[e]),f=Rm(()=>Cm(e,t?.chainId),[e,t?.chainId]);function m(p){let w=Number(p),h=Cm(e,w)[0];h&&r(h)}function y(p){let w=f.find(h=>h.token.address.toLowerCase()===p.toLowerCase());w&&r(w)}let g=a?`${Ax(a.value,a.decimals)} ${a.symbol}`:void 0,u=l?`Amount exceeds your balance${g?` (${g})`:""}`:void 0;return Kn("section",{className:"rd-stack","data-rd-source-form":"",children:[Kn("div",{className:"rd-field",children:[Kn("div",{className:"rd-field-label-row",children:[Wr("span",{className:"rd-field-label",children:"From"}),t&&(()=>{let p=km(t.chainId,t.token.address);return p?Kn("a",{className:"rd-token-explorer-link",href:p.url,target:"_blank",rel:"noopener noreferrer",title:`View ${t.token.symbol} on ${p.name}`,children:[p.name," \u2197"]}):null})()]}),Kn("div",{className:"rd-field-row",children:[Wr(Ti,{ariaLabel:"Origin chain",value:t?String(t.chainId):"",onChange:m,disabled:c,options:b.map(p=>({value:String(p.chainId),label:p.chainName,subLabel:"Network",icon:Wr(fs,{chainId:p.chainId,chainName:p.chainName,size:22})}))}),Wr(Ti,{ariaLabel:"Token",value:t?.token.address??"",onChange:y,disabled:c||f.length===0,options:f.map(p=>({value:p.token.address,label:p.token.symbol,subLabel:`${p.token.decimals} decimals`,icon:Wr(wo,{symbol:p.token.symbol,logoUrl:p.token.logoUrl,size:22})}))})]})]}),i&&Kn("label",{className:"rd-field",children:[Wr("span",{className:"rd-field-label",children:"Amount (optional)"}),Kn("div",{className:"rd-amount-input","data-rd-invalid":u?"":void 0,children:[Wr("input",{type:"text",inputMode:"decimal",placeholder:"0.0",value:n,onChange:p=>{let w=p.target.value;if(w===""){o(w);return}w.startsWith(".")&&(w=`0${w}`),/^\d*\.?\d{0,4}$/.test(w)&&(w=w.replace(/^0+(?=\d)/,""),!((w.split(".")[0]??"").length>12)&&o(w))},disabled:c||!t,"data-vaul-no-drag":!0}),t&&Wr("span",{className:"rd-amount-input-suffix",children:t.token.symbol}),d&&!c&&Wr("button",{type:"button",className:"rd-amount-input-max",onClick:d,disabled:c||!t,children:"Max"})]}),(g||s)&&Kn("span",{className:"rd-amount-meta",children:[Wr("span",{}),Wr("span",{children:s?"Balance: \u2026":g?`Balance: ${g}`:""})]}),u&&Wr("span",{className:"rd-callout rd-callout-danger",children:u})]})]})}import{Fragment as Nm,jsx as Ue,jsxs as gr}from"react/jsx-runtime";function Tm({catalog:e,origin:t,onChangeOrigin:r,amount:n,onChangeAmount:o,showAmountInput:i,minNotice:a,amountHint:s,onMax:l,recipient:d,onChangeRecipient:c,showRecipientInput:b,recipientValid:f,balance:m,balanceLoading:y,insufficientBalance:g,targetOptions:u,selectedTarget:p,onChangeTarget:w,showTargetSelector:h,quote:x,quoteLoading:k,quoteError:R,depositAddress:I,depositAddressLoading:C,depositAddressError:S,arrivalStatus:E,amountSmallestUnits:M,depositState:B,onDeposit:L,canDeposit:z,oneClickEnabled:A,locked:U,onRequestConnect:oe}){let Y=u.length>1&&h,{phase:G,isSubmitting:H,isConfirming:ie,isConfirmed:te,needsSwitch:O,reverted:Z,error:_}=B,ce=p?.symbol??e.destination.symbol;return gr(Nm,{children:[a&&Ue(fm,{minNotice:a,arrivalStatus:E}),U?gr("section",{className:"rd-locked-card","data-rd-locked":"",children:[Ue("span",{className:"rd-locked-glyph","aria-hidden":"true",children:gr("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",focusable:"false",children:[Ue("path",{d:"M4 7.5A2.5 2.5 0 0 1 6.5 5h10A2.5 2.5 0 0 1 19 7.5v9a2.5 2.5 0 0 1-2.5 2.5h-10A2.5 2.5 0 0 1 4 16.5v-9Z",stroke:"currentColor",strokeWidth:"1.7"}),Ue("path",{d:"M4 9h15",stroke:"currentColor",strokeWidth:"1.7"}),Ue("path",{d:"M15 11.5h5v4h-5a2 2 0 0 1 0-4Z",fill:"currentColor",opacity:"0.18",stroke:"currentColor",strokeWidth:"1.5"}),Ue("circle",{cx:"15.7",cy:"13.5",r:"0.8",fill:"currentColor"})]})}),Ue("h3",{className:"rd-locked-title",children:"Connect your wallet"}),Ue("p",{className:"rd-locked-text",children:"Connect to get your personal deposit address."}),b&&Ue("p",{className:"rd-card-hint",children:"Or enter a recipient address to get one without connecting."}),oe&&gr("button",{type:"button",className:"rd-button-primary rd-locked-action","data-track":"connect",onClick:oe,children:[gr("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[Ue("path",{d:"M5 6.5h11.5A2.5 2.5 0 0 1 19 9v8.5H7A3 3 0 0 1 4 14.5v-8A2.5 2.5 0 0 1 6.5 4H16",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),Ue("path",{d:"M15 10.5h5v4h-5a2 2 0 0 1 0-4Z",stroke:"currentColor",strokeWidth:"1.8"})]}),"Connect Wallet"]})]}):I?Ue(wm,{depositAddress:I,originChainId:t.chainId,originChainName:t.chainName,originCurrency:t.token.address,amount:M,tokenSymbol:t.token.symbol,tokenDecimals:t.token.decimals,depositState:B,onDeposit:L,canDeposit:z,oneClickEnabled:A}):C?gr(Nm,{children:[Ue(gs,{}),A&&M&&Ue("span",{className:"rd-skeleton rd-skeleton-cta","aria-hidden":"true"}),Ue("p",{className:"rd-sr-only",role:"status",children:"Preparing your deposit address..."})]}):S?gr("div",{className:"rd-callout rd-callout-danger",children:["Couldn't fetch a deposit address: ",S.message]}):null,Ue(Sm,{catalog:e,origin:t,onChangeOrigin:r,amount:n,onChangeAmount:o,showAmountInput:i,balance:m,balanceLoading:y,insufficientBalance:g,onMax:l}),gr("div",{className:"rd-field","data-rd-delivery":"",children:[Ue("span",{className:"rd-field-label",children:"Deliver as"}),Y?Ue(Ti,{ariaLabel:"Delivery token",value:p?.symbol??"",onChange:w,options:u.map(xe=>({value:xe.symbol,label:xe.symbol,subLabel:"on ONEchain",icon:Ue(wo,{symbol:xe.symbol,size:22})}))}):gr("div",{className:"rd-static-target",children:[Ue(wo,{symbol:ce,size:22}),Ue("span",{children:ce})]}),b&&gr("label",{className:"rd-delivery-recipient",children:[Ue("input",{type:"text",placeholder:"0x...","aria-label":"ONEchain recipient address",value:d,onChange:xe=>c(xe.target.value),"data-vaul-no-drag":!0}),Ue("span",{className:"rd-card-hint",children:"Defaults to your connected wallet. It can differ from the address you deposit from, and is also used as the refund address if anything goes wrong."}),!f&&Ue("span",{className:"rd-callout rd-callout-danger",children:"Not a valid address"})]})]}),p?.external&&gr("div",{className:"rd-callout rd-callout-muted",children:["Delivered as ",p.symbol," via an external adapter."]}),s&&Ue("div",{className:"rd-callout rd-callout-warning","data-rd-amount-hint":"",children:s}),n.trim()&&Ue(xm,{quote:x,isLoading:k,error:R,humanAmount:n,originSymbol:t.token.symbol,destination:e.destination}),a&&Ue(mm,{minNotice:a,onlySend:{symbol:t.token.symbol,chainName:t.chainName},showWalletCreditNote:!b&&f}),A&&G!=="idle"&&!z&&gr("div",{className:"rd-card",children:[H&&gr("p",{className:"rd-muted",children:[Ue("span",{className:"rd-spinner"})," ",O?"Switching network...":"Confirm in wallet..."]}),ie&&gr("p",{className:"rd-muted",children:[Ue("span",{className:"rd-spinner"})," Confirming..."]}),B.txHash&&gr("p",{className:"rd-card-hint",children:["Tx: ",Ue("span",{style:{fontFamily:"monospace"},children:B.txHash})]}),te&&Z&&Ue("div",{className:"rd-callout rd-callout-danger",children:"The deposit transaction reverted on-chain. Please check your wallet and try again."}),te&&!Z&&Ue("div",{className:"rd-callout rd-callout-success",children:"Deposit confirmed on-chain. Waiting for it to be swept..."}),_&&Ue("div",{className:"rd-callout rd-callout-danger",children:_})]})]})}import{useEffect as Mx,useId as Lx,useRef as Im,useState as ad}from"react";import{createPortal as Dx}from"react-dom";import{Fragment as ld,jsx as ve,jsxs as gt}from"react/jsx-runtime";function Ei({requiresIdentity:e=!1}){return gt("div",{className:"rd-history-empty",role:"status","data-variant":e?"disconnected":"empty","data-testid":e?"rd-history-empty-state":"rd-history-no-transfers",children:[ve("span",{className:"rd-history-empty-icon","aria-hidden":"true",children:gt("svg",{width:"34",height:"34",viewBox:"0 0 24 24",fill:"none",focusable:"false",children:[ve("path",{d:"M7 3.8h7l3 3V12M7 3.8A2.2 2.2 0 0 0 4.8 6v12A2.2 2.2 0 0 0 7 20.2h5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"}),ve("path",{d:"M14 3.8V7h3",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),ve("circle",{cx:"16.5",cy:"16.5",r:"3.7",stroke:"currentColor",strokeWidth:"1.7"}),ve("path",{d:"M16.5 14.5v2.2l1.4.8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})]})}),ve("h3",{className:"rd-history-empty-title",children:e?"Connect to view history":"No transfers yet"}),ve("p",{className:"rd-history-empty-copy",children:e?"Connect a wallet or provide an address to see transfer history.":"Your deposits and their delivery progress will appear here."}),!e&&gt("span",{className:"rd-history-empty-live",children:[ve("span",{"aria-hidden":"true"}),"Updates automatically"]})]})}var Ii=56;function Am(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function Px(e){let t=e.trim().toUpperCase(),n={AWAITING_DEPOSIT:"Waiting for deposit",BSC_FUNDED:"Deposit confirmed",RELAY_PENDING:"Bridging",RELAY_SUBMITTED:"Bridging",BRIDGING:"Bridging",CROSS_PENDING:"Delivering",FINALIZING:"Delivering",EXECUTING:"Delivering",COMPLETED:"Completed",RELAY_REFUNDED:"Refunded",REFUNDED:"Refunded",EXPIRED:"Expired",FAILED:"Failed"}[t];if(n)return n;let o=t.toLowerCase().replace(/_/g," ").trim();return o?`${o[0].toUpperCase()}${o.slice(1)}`:"Processing"}function Ox(e){return e==="COMPLETED"?"rd-status-pill rd-status-pill-success":Am(e)?"rd-status-pill rd-status-pill-failure":"rd-status-pill"}function bs(e,t){if(e){if(t===void 0)return e;try{return Wt(BigInt(e),t)}catch{return e}}}function Bx(e,t=4){let r=e.indexOf(".");if(r<0)return e;let n=e.slice(0,r+1+t).replace(/0+$/,"").replace(/\.$/,"");return n===""?"0":n}function zx(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Em(e){return e.length>14?`${e.slice(0,8)}...${e.slice(-4)}`:e}function sd({amount:e,symbol:t,className:r}){let n=e?`${e}${t?` ${t}`:""}`:"",o=Lx(),i=Im(null),a=Im(null),[s,l]=ad(!1),[d,c]=ad({top:-9999,left:-9999,visibility:"hidden"});return Mx(()=>{if(!s)return;let b=()=>{let f=i.current,m=a.current;if(!f||!m)return;let y=f.getBoundingClientRect(),g=m.getBoundingClientRect(),u=12,p=8,w=Math.max(u,window.innerWidth-g.width-u),h=Math.min(Math.max(y.left+y.width/2-g.width/2,u),w),x=y.top-g.height-p,k=x>=u?x:y.bottom+p,R=Math.max(u,window.innerHeight-g.height-u),I=Math.min(Math.max(k,u),R),C=window.getComputedStyle(f);c({top:I,left:h,visibility:"visible",backgroundColor:C.getPropertyValue("--rd-text").trim()||"#eef0f6",borderColor:C.getPropertyValue("--rd-border").trim()||"#2a2d3a",boxShadow:C.getPropertyValue("--rd-shadow").trim()||"0 8px 24px rgba(0, 0, 0, 0.35)",color:C.getPropertyValue("--rd-surface").trim()||"#171923"})};return b(),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[s]),e?gt(ld,{children:[gt("span",{ref:i,className:r,"aria-label":n,"aria-describedby":s?o:void 0,"data-full-value":n,onMouseEnter:()=>{c({top:-9999,left:-9999,visibility:"hidden"}),l(!0)},onMouseLeave:()=>l(!1),children:[Bx(e),t?` ${t}`:""]}),s&&typeof document<"u"&&Dx(ve("span",{ref:a,id:o,role:"tooltip","data-rd-history-floating-tooltip":"",style:d,children:n}),document.body)]}):ve("span",{className:r,children:"-"})}function Fx(e){let t=(e.deposits??[]).filter(n=>n.originChainId),r=new Set(t.map(n=>`${n.originChainId}:${(n.originCurrency??"").toLowerCase()}`));if(t.length>0){let n=t[0];return{chainId:n.originChainId,currency:n.originCurrency??"",routes:r.size}}return{chainId:e.originChainId,currency:e.originCurrency,routes:1}}function Ux(e,t){if(!e)return;let r,n;try{r=BigInt(e),n=t.map(s=>BigInt(s.amount))}catch{return}let o=n.reduce((s,l)=>s+l,0n);if(o<=0n)return;let i=n.map(s=>r*s/o),a=i.reduce((s,l)=>s+l,0n);return i[i.length-1]+=r-a,i}function ws({label:e,chainId:t,txHash:r,amount:n,shared:o,missingLabel:i="Pending"}){let a=r?hs(t,r):void 0;return gt("div",{className:"rd-history-step",children:[ve("span",{className:`rd-history-step-dot${r?" rd-history-step-dot-done":""}`}),ve("span",{className:"rd-history-step-label",children:e}),ve("span",{className:"rd-history-step-chain",children:qo(t)}),n&&ve(sd,{amount:n,className:"rd-history-step-amount"}),gt("span",{className:"rd-history-step-tx",children:[a?ve("a",{href:a.url,target:"_blank",rel:"noreferrer",title:r,"aria-label":`${e} transaction on ${qo(t)}`,children:Em(r)}):r?ve("span",{title:r,children:Em(r)}):ve("span",{className:"rd-muted",children:i}),o&&r&&ve("span",{className:"rd-history-step-shared",title:"Shared by deposits processed together",children:"combined transfer"})]})]})}function jx(e){let t=e.deposits??[],r=e.amountOut||e.expectedOut||void 0;if(t.length>=2){let a=Ux(r,t);if(a)return t.map((s,l)=>({key:`${e.orderId}:${s.txHash}:${s.blockNumber}`,order:e,chainId:s.originChainId??Ii,currency:s.originCurrency??"",routes:1,sentRaw:s.amount,receivedRaw:a[l].toString(),receivedIsEstimate:!0,deposit:s,sharedLegs:!0}))}let{chainId:n,currency:o,routes:i}=Fx(e);return[{key:e.orderId,order:e,chainId:n,currency:o,routes:i,sentRaw:e.amountIn,receivedRaw:r,receivedIsEstimate:!e.amountOut&&!!e.expectedOut,sharedLegs:!1}]}function ys({orders:e,isLoading:t,error:r,catalog:n,showTitle:o=!0}){let[i,a]=ad({}),s=l=>a(d=>({...d,[l]:!d[l]}));return gt("section",{className:o?"rd-card":"rd-stack","data-rd-orders-list":"",children:[o&&ve("div",{className:"rd-card-header",children:ve("h2",{className:"rd-card-title",children:"Transfer history"})}),t&&e.length===0&&gt("p",{className:"rd-muted",role:"status","aria-live":"polite",children:[ve("span",{className:"rd-spinner"})," Loading orders..."]}),r&&gt("div",{className:"rd-callout rd-callout-danger",children:["Couldn't load your orders: ",r.message]}),!t&&!r&&e.length===0&&ve(Ei,{}),e.length>0&&ve("div",{className:"rd-history-table","data-vaul-no-drag":!0,children:e.flatMap(jx).map(l=>{let{order:d}=l,c=n?.origins.find(S=>S.chainId===l.chainId&&S.token.address.toLowerCase()===l.currency.toLowerCase()),b=(d.target?n?.targets.find(S=>S.symbol.toLowerCase()===d.target.toLowerCase()):void 0)??n?.targets.find(S=>S.isDefault),f=b?.symbol??n?.destination.symbol??"",m=b?.decimals??n?.destination.decimals,y=n?.origins.find(S=>S.chainId===Ii),g=bs(l.sentRaw,y?.token.decimals),u=y?.token.symbol??"USDT",p=bs(l.receivedRaw,m),w=d.deposits??[],h=!!i[l.key],x=zx(d.completedAt??d.createdAt),k=Px(d.status),I=d.status==="COMPLETED"||Am(d.status)?"Details unavailable":"Pending",C=l.receivedIsEstimate?"Estimated on ONEchain":"Received on ONEchain";return gt("div",{className:"rd-history-group",children:[gt("button",{type:"button",className:"rd-history-row-button",onClick:()=>s(l.key),"aria-expanded":h,"aria-label":`Toggle transfer details: ${k}, ${x}`,children:[gt("span",{className:"rd-history-card-top",children:[ve("span",{className:"rd-history-asset",children:l.routes>1?gt(ld,{children:["Multiple deposits ",gt("span",{className:"rd-muted",children:["\xB7 ",l.routes," chains"]})]}):gt(ld,{children:[c?.token.symbol??f," ",gt("span",{className:"rd-muted",children:["from ",qo(l.chainId)]})]})}),ve("span",{className:Ox(d.status),title:d.status,children:k})]}),gt("span",{className:"rd-history-card-amounts",children:[gt("span",{className:"rd-history-amount-block",children:[ve("span",{className:"rd-history-amount-label",children:"Processing address"}),ve(sd,{amount:g,symbol:u,className:"rd-history-num"})]}),ve("span",{className:"rd-history-card-arrow","aria-hidden":"true",children:"\u2192"}),gt("span",{className:"rd-history-amount-block",children:[ve("span",{className:"rd-history-amount-label",children:C}),ve(sd,{amount:p,symbol:f,className:`rd-history-num rd-history-received${l.receivedIsEstimate?" rd-history-received-estimate":""}`})]})]}),gt("span",{className:"rd-history-card-foot",children:[gt("span",{className:"rd-history-date",children:[d.completedAt?"Completed":"Started"," \xB7 ",x]}),ve("span",{className:"rd-history-chevron","aria-hidden":"true",children:ve(Lr,{size:16})})]})]}),h&&gt("div",{className:"rd-history-detail",children:[l.deposit?ve(ws,{label:"Deposit confirmed",chainId:l.deposit.originChainId??Ii,txHash:l.deposit.originTxHash||l.deposit.txHash,amount:bs(l.deposit.amount,y?.token.decimals)}):w.length>0?w.map(S=>ve(ws,{label:"Deposit confirmed",chainId:S.originChainId??Ii,txHash:S.originTxHash||S.txHash,amount:bs(S.amount,y?.token.decimals)},`${S.txHash}-${S.blockNumber}`)):gt("div",{className:"rd-history-step",children:[ve("span",{className:"rd-history-step-dot"}),ve("span",{className:"rd-history-step-label",children:"Deposit confirmed"}),ve("span",{className:"rd-muted",children:"Details unavailable"})]}),ve(ws,{label:"Bridge",chainId:Ii,txHash:d.bscBridgeTx,shared:l.sharedLegs,missingLabel:I}),ve(ws,{label:"ONEchain delivery",chainId:n?.destination.chainId??612055,txHash:d.deliveryTxHash,shared:l.sharedLegs,missingLabel:I})]})]},l.key)})})]})}import{useEffect as Gm,useState as ud}from"react";import{useCallback as Mi,useEffect as Gx,useMemo as Om,useRef as Bm,useState as Ai}from"react";var ln=class extends Error{constructor(t,r,n){super(r),this.name="RelayApiError",this.status=t,this.body=n}};function Gt(e){let t=e.baseUrl.replace(/\/+$/,"");async function r(n,o){let i={...o?.headers};o?.body!=null&&(i["Content-Type"]="application/json");let a;try{a=await fetch(`${t}${n}`,{...o,headers:i})}catch(l){throw new ln(0,`network error calling ${n}: ${l.message}`)}let s=await a.text();if(!a.ok){let l=`request to ${n} failed with status ${a.status}`,d;try{d=JSON.parse(s);let c=d;c?.error&&(l=c.error)}catch{d=s||void 0}throw new ln(a.status,l,d)}try{return JSON.parse(s)}catch{throw new ln(a.status,`expected a JSON response from ${n} but got ${s?"a non-JSON body":"an empty body"}`,s||void 0)}}return{getConfig(){return r("/v1/config").then(n=>({...n,targets:n.targets??[]}))},getQuote(n){return r("/v1/quote",{method:"POST",body:JSON.stringify(n)})},getDepositAddress(n,o){let i=new URLSearchParams({user:n.user,originChainId:String(n.originChainId),originCurrency:n.originCurrency});return o&&i.set("target",o),r(`/v1/deposit-address?${i.toString()}`)},getOrder(n){return r(`/v1/orders/${encodeURIComponent(n)}`)},listOrders(n){let o=new URLSearchParams({user:n});return r(`/v1/orders?${o.toString()}`).then(i=>i.orders??[])},ordersStreamUrl(n){return`${t}/v1/orders/stream?user=${encodeURIComponent(n)}`},getRecovery(n){let o=new URLSearchParams({user:n.user});return n.target&&o.set("target",n.target),r(`/v1/recovery?${o.toString()}`)}}}var Mm=[{type:"function",name:"deploy",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"version",type:"uint256"}],outputs:[{name:"",type:"address"}]}],dd=[{type:"function",name:"execute",stateMutability:"nonpayable",inputs:[],outputs:[]},{type:"function",name:"sweepToUser",stateMutability:"nonpayable",inputs:[{name:"tokenAddr",type:"address"}],outputs:[]}],cd=[{type:"function",name:"computeAddress",stateMutability:"view",inputs:[{name:"recipient",type:"address"},{name:"version",type:"uint256"}],outputs:[{name:"",type:"address"}]}];var Yo=["0x486BEEc35A9a9915213Ea02AD3709738335F7702","0x3438735303911aBe113AdF14b18eE730cC24893b","0xA3B548Ab23043e6B24A087515fe1306379683533","0x44317d07378390543d99Ee76374E86C1Ef6cF832"];function xs(e,t){return!e||!t?!1:e.toLowerCase()===t.toLowerCase()}function Wx(e,t){return t.some(r=>xs(r,e))}function vs(e){if(!e||e.length===0)return Yo;let t=new Set,r=[];for(let n of e){if(typeof n!="string"||!dt(n))continue;let o=n.toLowerCase();t.has(o)||(t.add(o),r.push(n))}return r.length>0?r:Yo}async function Lm(e,t,{factory:r,forwarder:n,recipient:o,version:i,trusted:a=Yo}){if(!r||!n||!o||i===void 0)return{ok:!1,reason:"address verification is missing inputs (factory/forwarder/recipient/version)"};if(!Wx(r,a))return{ok:!1,reason:`factory ${r} is not a recognized deposit-address factory -- refusing to sign against it`};if(!e)return{ok:!1,reason:"no chain connection available to verify the forwarder address"};let s;try{s=await e({chainId:t,address:r,abi:cd,functionName:"computeAddress",args:[o,BigInt(i)]})}catch(l){return{ok:!1,reason:`could not verify the forwarder address on-chain: ${l instanceof Error?l.message:String(l)}`}}return xs(s,n)?{ok:!0}:{ok:!1,reason:`forwarder address mismatch: the API returned ${n}, but factory ${r} derives ${s} for this account -- refusing to sign`}}async function Dm(e,t,{forwarder:r,recipient:n,version:o,trusted:i=Yo}){if(!r||!n||o===void 0)return{ok:!1,reason:"address verification is missing inputs (forwarder/recipient/version)"};if(!e)return{ok:!1,reason:"no BSC chain connection available to verify the deposit forwarder -- add BNB Smart Chain (chain 56) to your wagmi config"};let a=await Promise.all(i.map(async s=>{try{return await e({chainId:t,address:s,abi:cd,functionName:"computeAddress",args:[n,BigInt(o)]})}catch{return}}));return a.some(s=>xs(s,r))?{ok:!0}:a.every(s=>s===void 0)?{ok:!1,reason:"could not reach any deposit-address factory on BSC to verify the forwarder"}:{ok:!1,reason:`forwarder address mismatch: ${r} is not the address any known factory derives for this account -- refusing to deposit`}}function Pm(e,t){return xs(e,t)}var Zn=56,pd={step:"idle"};function Hx(e){return e.tokens?.find(t=>t.recoverable)?.address??e.token}function Li(e={}){let t=Bm(e);t.current=e;let r=e.wallet,n=r?.walletChainId,o=e.recipient,i=o&&dt(o)?o:void 0,[a,s]=Ai({}),l=Mi((f,m)=>{s(y=>({...y,[f.toLowerCase()]:m}))},[]),d=Mi(f=>f?a[f.toLowerCase()]??pd:pd,[a]),c=Om(()=>Object.values(a).some(f=>f.step==="switching"||f.step==="deploying"||f.step==="recovering"),[a]);return{recover:Mi(async(f,m,y)=>{if(!i||!f?.forwarder)return;let g=f.forwarder;l(g,{step:"switching"});try{if(n!==Zn){if(!r?.switchChain)throw new Error("wallet cannot switch chains");await r.switchChain(Zn)}if(!r?.writeContract||!r?.readContract||!r?.waitForReceipt)throw new Error("wallet is missing contract capabilities required for recovery");let u=await Lm(r.readContract,Zn,{factory:f.factory,forwarder:f.forwarder,recipient:i,version:f.version,trusted:t.current.trustedFactories});if(!u.ok)throw new Error(`address verification failed: ${u.reason}`);let p;if(!f.isDeployed){if(l(g,{step:"deploying"}),p=await r.writeContract({address:f.factory,abi:Mm,functionName:"deploy",args:[i,BigInt(f.version)],chainId:Zn}),l(g,{step:"deploying",deployTxHash:p}),(await r.waitForReceipt({chainId:Zn,hash:p})).status==="reverted")throw new Error(`forwarder deploy reverted on-chain (tx ${p})`);t.current.onChanged?.()}l(g,{step:"recovering",deployTxHash:p});let w=m==="execute"?await r.writeContract({address:f.forwarder,abi:dd,functionName:"execute",args:[],chainId:Zn}):await r.writeContract({address:f.forwarder,abi:dd,functionName:"sweepToUser",args:[y??Hx(f)],chainId:Zn});if(l(g,{step:"recovering",deployTxHash:p,actionTxHash:w}),(await r.waitForReceipt({chainId:Zn,hash:w})).status==="reverted")throw new Error(`recovery transaction reverted on-chain (tx ${w})`);l(g,{step:"done",deployTxHash:p,actionTxHash:w}),t.current.onRecoverySuccess?.({action:m,forwarder:f.forwarder,actionTxHash:w,...p?{deployTxHash:p}:{}}),t.current.onChanged?.()}catch(u){let p=u instanceof Error?u:new Error(String(u));s(w=>{let h=g.toLowerCase();return{...w,[h]:{...w[h]??pd,step:"error",error:p.message}}}),t.current.onError?.(p)}},[i,n,r,l]),stateFor:d,busy:c}}function zm(e={}){let t=Bm(e);t.current=e;let r=Om(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useRecovery: either `client` or `apiBaseUrl` must be provided");return Gt({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.recipient,o=n&&dt(n)?n:void 0,[i,a]=Ai(),[s,l]=Ai(!1),[d,c]=Ai(),[b,f]=Ai(0),m=e.target,y=e.enabled??!0,g=e.refetchInterval;Gx(()=>{if(!o||!y){a(void 0),c(void 0),l(!1);return}let x=!1,k=!1,R=!0;async function I(){if(!(x||k)){k=!0,R&&l(!0);try{let S=await r.getRecovery({user:o,target:m});if(x)return;a(S),c(void 0)}catch(S){if(x)return;let E=S instanceof Error?S:new Error(String(S));c(E),t.current.onError?.(E),E instanceof ln&&E.status===401&&t.current.onUnauthorized?.()}finally{k=!1,!x&&R&&l(!1),R=!1}}}I();let C=typeof g=="number"&&Number.isFinite(g)&&g>0?setInterval(()=>{I()},g):void 0;return()=>{x=!0,C&&clearInterval(C)}},[r,o,b,m,y,g]);let u=Mi(()=>f(x=>x+1),[]),p=Li({recipient:e.recipient,wallet:e.wallet,trustedFactories:e.trustedFactories,onError:e.onError,onRecoverySuccess:e.onRecoverySuccess,onChanged:u}),w=Mi(async(x,k)=>{i&&await p.recover(i,x,k)},[p,i]),h=p.stateFor(i?.forwarder);return{info:i,loading:s,error:d,refresh:u,recover:w,recoveryState:h}}var _x="BSC_FUNDED";function Fm(e){if(!e)return 0n;try{let t=BigInt(e);return t>0n?t:0n}catch{return 0n}}function Qx(e,t){return e.target||t}function Ko(e,t=[]){let r=e.find(o=>o.isDefault)?.symbol,n=new Map;for(let o of e){if(!o.info?.forwarder)continue;let i=o.info.forwarder.toLowerCase(),a=n.get(i);if(a){a.targets.push(o.symbol);continue}n.set(i,{forwarder:o.info.forwarder,targets:[o.symbol],info:o.info,deposits:[],depositsTotal:0n})}for(let o of n.values()){let i=new Set(o.targets);for(let a of t){if(a.status!==_x)continue;let s=Qx(a,r);if(!(!s||!i.has(s)))for(let l of a.deposits??[])o.deposits.push({amount:l.amount,originChainId:l.originChainId,originTxHash:l.originTxHash,txHash:l.txHash,blockNumber:l.blockNumber}),o.depositsTotal+=Fm(l.amount)}o.deposits.sort((a,s)=>a.blockNumber-s.blockNumber)}return[...n.values()]}function Um(e){return e.filter(t=>(t.info.tokens??[]).some(r=>r.recoverable)?!0:Fm(t.info.balance)>0n&&t.info.suggestedAction!=="none")}function ks(e){return e.reduce((t,r)=>t+(r.info.tokens??[]).filter(n=>n.recoverable).length,0)}import{Fragment as Cs,jsx as ue,jsxs as Ze}from"react/jsx-runtime";var Vx=56;function qx(e){return{client:e.client,apiBaseUrl:e.apiBaseUrl,recipient:e.recipient,target:e.target,enabled:e.targets===void 0,wallet:e.wallet,trustedFactories:e.trustedFactories,onUnauthorized:e.onUnauthorized,onError:e.onError}}var Yx="This balance may already be processing. Recover only if it remains stuck.",Rs="USDT",jm="primary";function Kx(e){return`${e} more recoverable under other delivery tokens -- switch the delivery token above to recover ${e===1?"it":"them"}.`}function Zx(e){let t=e.toLowerCase();return t.includes("insufficient funds")||t.includes("insufficientfunds")||t.includes("exceeds the balance of the account")||t.includes("insufficient balance for transfer")?"Not enough BNB for the network fee. Add BNB to your connected wallet and try again.":t.includes("user rejected")||t.includes("userrejected")||t.includes("user denied")||t.includes("user cancelled")||t.includes("user canceled")||t.includes("action_rejected")||t.includes("rejected by user")?"Transaction cancelled in your wallet.":"Recovery couldn't be completed. Check your wallet and try again."}function Hm({message:e}){let[t,r]=ud("idle");Gm(()=>{if(t==="idle")return;let i=window.setTimeout(()=>r("idle"),1500);return()=>window.clearTimeout(i)},[t]);async function n(){if(typeof navigator>"u"||!navigator.clipboard){r("failed");return}try{await navigator.clipboard.writeText(e),r("copied")}catch{r("failed")}}let o=t==="copied"?"Copied technical details":t==="failed"?"Copy failed":"Copy technical details";return Ze("details",{className:"rd-error-details",children:[ue("summary",{children:"View technical details"}),Ze("div",{className:"rd-error-log",children:[ue("button",{type:"button",className:"rd-error-copy",onClick:()=>{n()},"aria-label":o,"aria-live":"polite",title:o,children:t==="copied"?ue("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:ue("path",{d:"m5 12 4 4L19 6",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})}):Ze("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[ue("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.8"}),ue("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})}),ue("code",{children:e})]})]})}function Di(e){if(!e)return 0n;try{return BigInt(e)}catch{return 0n}}function En(e,t){try{return Wt(e,t)}catch{return e.toString()}}function Wm(e){return e.length>14?`${e.slice(0,8)}...${e.slice(-4)}`:e}function Xx(e){let t=Di(e.bridgeMinWei),r=[];for(let i of e.tokens??[]){let a=Di(i.balance);if(!(a<=0n)){if(i.suggestedAction==="execute"){r.push({key:i.address,symbol:i.symbol,decimals:i.decimals,balance:a,action:{kind:"execute"}});continue}if(i.recoverable){r.push({key:i.address,symbol:i.symbol,decimals:i.decimals,balance:a,action:{kind:"sweep",tokenAddress:i.address}});continue}r.push({key:i.address,symbol:i.symbol,decimals:i.decimals,balance:a,...t>a?{shortfall:t-a,minimum:t}:{}})}}let n=Di(e.balance),o=r.some(i=>i.action?.kind==="execute");return n>0n&&e.suggestedAction==="execute"&&!o?r.unshift({key:jm,symbol:Rs,decimals:e.decimals,balance:n,action:{kind:"execute"}}):r.length===0&&n>0n&&e.suggestedAction!=="none"&&r.push({key:jm,symbol:Rs,decimals:e.decimals,balance:n,action:{kind:"sweep"}}),r}function Jx({deposit:e,decimals:t}){let r=e.originChainId??Vx,n=e.originTxHash||e.txHash,o=n?hs(r,n):void 0;return Ze("div",{className:"rd-history-step","data-testid":"recovery-deposit-row",children:[ue("span",{className:"rd-history-step-dot rd-history-step-dot-done"}),ue("span",{className:"rd-history-step-chain",children:qo(r)}),ue("span",{className:"rd-history-step-amount",children:En(Di(e.amount),t)}),ue("span",{className:"rd-history-step-tx",children:o?ue("a",{href:o.url,target:"_blank",rel:"noreferrer",title:n,children:Wm(n)}):n?ue("span",{title:n,children:Wm(n)}):null})]})}function $x({group:e,showTargetLabel:t,busy:r,state:n,onRecover:o,actingRowKey:i,rowKeyOf:a}){let{info:s}=e,l=Xx(s),d=Di(s.balance),c=l.length===1?`${En(l[0].balance,l[0].decimals)}`:`${l.length} assets`,b=e.deposits.length>0&&e.depositsTotal>=d,f=d>e.depositsTotal?d-e.depositsTotal:0n,m=n.step==="switching"||n.step==="deploying"||n.step==="recovering",g=l.find(p=>a(p)===i)?.action?.kind;function u(){if(n.step==="switching")return"Switching to BNB Chain\u2026";if(n.step==="deploying")return"Confirm in wallet\u2026 (1/2 \u2014 preparing your deposit address)";let p=g==="execute"?"continuing ONEchain delivery":"returning funds";return n.deployTxHash?`Confirm in wallet\u2026 (2/2 \u2014 ${p})`:`Confirm in wallet\u2026 (${p})`}return Ze("div",{className:"rd-recover-group","data-testid":"forwarder-section",children:[t&&Ze("p",{className:"rd-recover-group-label",children:["Delivery target \xB7 ",ue("b",{children:e.targets.join(", ")})]}),Ze("div",{className:"rd-recover-sum",children:[ue("span",{className:"rd-recover-sum-label",children:"Funds awaiting processing"}),Ze("span",{className:"rd-recover-sum-value",title:l.length===1?`${c} ${l[0].symbol}`:c,children:[c,l.length===1&&Ze(Cs,{children:[" ",ue("span",{className:"rd-recover-sum-unit",children:l[0].symbol})]})]})]}),e.deposits.length>0&&Ze("details",{className:"rd-recover-made-of",children:[Ze("summary",{className:"rd-recover-made-of-label",children:["Deposit history \xB7 ",e.deposits.length," ",e.deposits.length===1?"transfer":"transfers"]}),Ze("div",{className:"rd-recover-made-of-body",children:[e.deposits.map(p=>ue(Jx,{deposit:p,decimals:s.decimals},`${p.txHash}-${p.blockNumber}`)),!b&&Ze("p",{className:"rd-token-row-status","data-testid":"deposits-incomplete-note",children:["These transfers explain ",En(e.depositsTotal,s.decimals)," of"," ",En(d,s.decimals)," ",Rs,". The remaining"," ",En(f,s.decimals)," ",Rs," is still included when you act."]})]})]}),ue("div",{className:"rd-token-list",children:l.map(p=>{let w=a(p),h=m&&i===w;return Ze("div",{className:"rd-token-row","data-token-symbol":p.symbol,children:[ue(wo,{symbol:p.symbol,size:26}),Ze("div",{className:"rd-token-row-info",children:[l.length>1&&Ze("span",{className:"rd-token-row-amount",children:[En(p.balance,p.decimals)," ",ue("span",{className:"rd-token-row-symbol",children:p.symbol})]}),h?ue("span",{className:"rd-token-row-step",role:"status","aria-live":"polite",children:u()}):p.shortfall!==void 0&&p.minimum!==void 0?Ze("span",{className:"rd-token-row-warn",children:["Needs ",Ze("b",{children:[En(p.shortfall,p.decimals)," ",p.symbol]})," more to reach the"," ",En(p.minimum,p.decimals)," ",p.symbol," minimum. Add it through"," ",ue("b",{children:"Deposit to CROSS"})," and both amounts will process together."]}):p.action?ue("span",{className:"rd-token-row-status",children:p.action.kind==="execute"?"Ready to continue delivery to ONEchain":"Ready to return to your BNB Chain wallet"}):ue("span",{className:"rd-token-row-status",children:"Waiting for processing"})]}),h?ue("span",{className:"rd-spinner rd-token-row-spinner"}):p.action&&ue("button",{type:"button",className:"rd-button-primary rd-token-row-action",onClick:()=>o(p),disabled:r,children:p.action.kind==="execute"?"Continue delivery":"Return to wallet"})]},p.key)})}),!s.isDeployed&&n.step==="idle"&&Ze("div",{className:"rd-callout rd-callout-warning","data-testid":"two-tx-notice",children:["The first action from this address needs ",ue("b",{children:"two wallet confirmations"}),": prepare the address, then move the funds. Later actions need one."]}),s.inFlight&&ue("p",{className:"rd-muted rd-token-row-status",children:s.inFlightReason||Yx}),n.step==="done"&&ue("div",{className:"rd-callout rd-callout-success",role:"status","aria-live":"polite",children:g==="execute"?"ONEchain delivery restarted.":"Funds returned to your connected BNB Chain wallet."}),n.step==="error"&&n.error&&Ze(Cs,{children:[ue("div",{className:"rd-callout rd-callout-danger",role:"alert",children:Zx(n.error)}),ue(Hm,{message:n.error})]})]})}function Ss(e){let{info:t,loading:r,error:n,refresh:o}=zm(qx(e)),i=r||e.targets!==void 0&&e.targetsLoading===!0,a=Li({recipient:e.recipient,wallet:e.wallet,trustedFactories:e.trustedFactories,onError:e.onError,onRecoverySuccess:e.onRecoverySuccess,onChanged:e.targets!==void 0?e.onRecovered:o}),[s,l]=ud(),d=e.targets!==void 0?[...e.targets]:t?[{symbol:e.target??"",isDefault:!0,info:t}]:[],c=Um(Ko(d,e.orders??[])),b=c.length>0,f=e.targets!==void 0?e.onRecovered:o,m=e.wallet?.walletAddress,y=e.wallet?.getBalance,[g,u]=ud();return Gm(()=>{if(!b||!y||!m){u(void 0);return}let p=!1;return y({chainId:56,address:m}).then(w=>{p||u({value:w.value,decimals:w.decimals})}).catch(()=>{p||u(void 0)}),()=>{p=!0}},[b,y,m]),Ze("section",{className:e.showTitle??!0?"rd-card":"rd-stack","data-rd-recover-funds":"",children:[(e.showTitle??!0)&&ue("div",{className:"rd-card-header",children:ue("h2",{className:"rd-card-title",children:"Recover stuck funds"})}),typeof e.otherTargetsRecoverable=="number"&&e.otherTargetsRecoverable>0&&ue("div",{className:"rd-callout rd-callout-muted","data-testid":"other-targets-recoverable-note",children:Kx(e.otherTargetsRecoverable)}),i&&Ze("p",{className:"rd-muted",role:"status","aria-live":"polite",children:[ue("span",{className:"rd-spinner"})," Checking for recoverable funds\u2026"]}),n&&Ze(Cs,{children:[ue("div",{className:"rd-callout rd-callout-danger",role:"alert",children:"Couldn't check recoverable funds. Please try again."}),ue(Hm,{message:n.message})]}),!i&&!n&&!b&&Ze("div",{className:"rd-recover-empty",role:"status","data-testid":"rd-recover-empty-state",children:[ue("span",{className:"rd-recover-empty-icon","aria-hidden":"true",children:Ze("svg",{width:"34",height:"34",viewBox:"0 0 24 24",fill:"none",focusable:"false",children:[ue("path",{d:"M5 11.5V8.8A2.8 2.8 0 0 1 7.8 6h8.4A2.8 2.8 0 0 1 19 8.8v6.4a2.8 2.8 0 0 1-2.8 2.8H7.8A2.8 2.8 0 0 1 5 15.2v-3.7Z",stroke:"currentColor",strokeWidth:"1.7"}),ue("path",{d:"M5 10h14",stroke:"currentColor",strokeWidth:"1.7"}),ue("path",{d:"m9.2 14 1.7 1.7 3.9-4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}),ue("h3",{className:"rd-recover-sum-value rd-recover-sum-empty rd-recover-empty-title",children:"Nothing to recover"}),ue("p",{className:"rd-recover-empty-copy",children:"No funds are waiting at your deposit addresses. If funds become stuck, they will appear here."}),f&&Ze("button",{type:"button",className:"rd-button-secondary rd-recover-empty-refresh",onClick:f,"data-track":"refresh_recovery",children:[ue("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:ue("path",{d:"M20 7v5h-5M4 17v-5h5M6.1 9A7 7 0 0 1 18.6 7M5.4 17A7 7 0 0 0 17.9 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),"Check again"]})]}),!i&&!n&&c.map(p=>ue($x,{group:p,showTargetLabel:c.length>1||p.targets.length>1,busy:a.busy,state:a.stateFor(p.forwarder),actingRowKey:s,rowKeyOf:w=>`${p.forwarder.toLowerCase()}:${w.key}`,onRecover:w=>{w.action&&(l(`${p.forwarder.toLowerCase()}:${w.key}`),a.recover(p.info,w.action.kind,w.action.tokenAddress))}},p.forwarder.toLowerCase())),!i&&!n&&b&&Ze("div",{className:"rd-callout rd-callout-muted","data-testid":"rd-recover-gas-note",children:["You submit this transaction from your connected wallet and pay the BNB Chain network fee in BNB. Available balance:",g&&Ze(Cs,{children:[" ",Ze("b",{children:[En(g.value,g.decimals)," BNB"]})]}),!g&&" unavailable","."]}),!i&&!n&&b&&ue("p",{className:"rd-recover-foot",children:"Delivery continues to ONEchain; returned funds go to your connected BNB Chain wallet."})]})}import*as It from"react";import*as kr from"@radix-ui/react-dialog";import{Drawer as Zo}from"vaul";de(`html body[data-scroll-locked]{overflow-y:auto!important;margin-right:0!important}.rd-overlay{position:fixed;inset:0;z-index:100000;background:var(--ds-overlay-dim, rgba(0, 0, 0, .5));-webkit-backdrop-filter:var(--ds-bg-blur-7, blur(3.5px));backdrop-filter:var(--ds-bg-blur-7, blur(3.5px))}.rd-dialog-content{-webkit-font-smoothing:antialiased;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--rd-dialog-width, 480px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-radius:24px;box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));outline:none;font-family:inherit}.rd-dialog-content.rd-deposit-shell{height:min(40rem,90vh)}.rd-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--rd-drawer-max-width, none);min-width:var(--rd-drawer-min-width, 0);max-height:min(85dvh,calc(100svh - env(safe-area-inset-top,0px)));margin:0 auto;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-top-left-radius:16px;border-top-right-radius:16px;outline:none;font-family:inherit;box-sizing:border-box;overscroll-behavior:contain}.rd-drawer-content.rd-deposit-shell[data-vaul-drawer-direction=bottom],.rd-drawer-content.rd-deposit-shell[data-vaul-drawer-direction=top]{height:min(40rem,85dvh,calc(100svh - env(safe-area-inset-top,0px)))}.rd-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--rd-drawer-max-width, 400px);max-width:100vw;border-radius:16px 0 0 16px}.rd-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--rd-drawer-max-width, 400px);max-width:100vw;border-radius:0 16px 16px 0}.rd-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.rd-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--ds-border-medium, rgba(0, 0, 0, .18));margin:12px auto 8px;flex-shrink:0}.rd-drawer-content[data-vaul-drawer-direction=left] .rd-drawer-handle,.rd-drawer-content[data-vaul-drawer-direction=right] .rd-drawer-handle{display:none}.rd-overlay{animation:rd-overlay-show .18s ease-out}.rd-overlay[data-state=closed]{animation:rd-overlay-hide .15s ease-in}.rd-dialog-content{animation:rd-dialog-show .2s ease-out}.rd-dialog-content[data-state=closed]{animation:rd-dialog-hide .15s ease-in}@keyframes rd-overlay-show{0%{opacity:0}}@keyframes rd-overlay-hide{to{opacity:0}}@keyframes rd-dialog-show{0%{opacity:0;transform:translate(-50%,-48%) scale(.96)}}@keyframes rd-dialog-hide{to{opacity:0;transform:translate(-50%,-48%) scale(.96)}}@media(prefers-reduced-motion:reduce){.rd-overlay,.rd-overlay[data-state=closed],.rd-dialog-content,.rd-dialog-content[data-state=closed]{animation:none}}.rd-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
20
- `);import{jsx as Gr,jsxs as Ns}from"react/jsx-runtime";var _m=24;function Qm(e){return e instanceof HTMLElement&&e.matches("input, textarea, select")}function ev(e,t,r){let n=r?.offsetTop??t.top,o=r?r.offsetTop+r.height:t.bottom,i=Math.max(t.top,n)+_m,a=Math.min(t.bottom,o)-_m;return e.top<i?e.top-i:e.bottom>a?e.bottom-a:0}function tv(){let e=It.useRef(0),[t,r]=It.useState({keyboardHeight:0,keyboardOverlap:0,viewportHeight:0});return It.useEffect(()=>{let n=window.visualViewport;if(!n)return;let o=()=>{let i=Math.max(window.innerHeight,document.documentElement.clientHeight);e.current=Math.max(e.current,i,n.height+n.offsetTop);let a=Math.max(0,e.current-n.height-n.offsetTop),s=Math.max(0,e.current-i),l=Math.max(0,a-s),d=n.height;r(c=>c.keyboardHeight===a&&c.keyboardOverlap===l&&c.viewportHeight===d?c:{keyboardHeight:a,keyboardOverlap:l,viewportHeight:d})};return o(),n.addEventListener("resize",o),n.addEventListener("scroll",o),()=>{n.removeEventListener("resize",o),n.removeEventListener("scroll",o)}},[]),t}function rv(e){let t=`(max-width: ${e}px)`,[r,n]=It.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(t).matches);return It.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia(t);n(o.matches);let i=a=>n(a.matches);return o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[t]),r}function An({theme:e="dark",mobileBreakpoint:t=768,drawerDirection:r="bottom",dialogWidth:n,drawerMaxWidth:o,drawerMinWidth:i,style:a,open:s,onOpenChange:l,children:d}){let c=rv(t),[b,f]=It.useState(!1),m=s!==void 0,y=m?s:b,g=It.useCallback(h=>{m||f(h),l?.(h)},[m,l]);Ln(y,It.useCallback(()=>g(!1),[g]));let u=It.useMemo(()=>{let h={};return n&&(h["--rd-dialog-width"]=n),o&&(h["--rd-drawer-max-width"]=o),i&&(h["--rd-drawer-min-width"]=i),{...h,...a}},[n,o,i,a]),p=It.useMemo(()=>({open:y,setOpen:g,isMobile:c,theme:e,drawerDirection:r,portalStyle:u}),[y,g,c,e,r,u]),w=Gr("div",{"data-theme":e,style:u,children:d});return c?Gr(ps.Provider,{value:p,children:Gr(Zo.Root,{direction:r,open:y,onOpenChange:g,noBodyStyles:!0,children:w},"drawer")}):Gr(ps.Provider,{value:p,children:Gr(kr.Root,{open:y,onOpenChange:g,children:w})})}function Xo({asChild:e,children:t,dataAttributes:r}){let{isMobile:n}=an(),o=n?Zo.Trigger:kr.Trigger;return Gr(o,{asChild:e,...r,children:t})}function Mn({className:e,ariaTitle:t,children:r}){let{open:n,isMobile:o,theme:i,drawerDirection:a,portalStyle:s}=an(),{keyboardHeight:l,keyboardOverlap:d,viewportHeight:c}=tv(),b=To(),f=It.useRef(null),m=It.useRef(null);It.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),It.useEffect(()=>{m.current&&clearTimeout(m.current);let p=document.activeElement;!n&&Qm(p)&&f.current?.contains(p)&&p.blur(),f.current?.querySelectorAll("[data-rd-scroll-area]").forEach(w=>{w.scrollTo?.({top:0,behavior:"auto"})})},[n]);let y=o&&a==="bottom"&&l>0,g=y?{bottom:d,maxHeight:`min(85dvh, calc(${c}px - env(safe-area-inset-top, 0px)))`}:void 0,u=It.useCallback(p=>{if(!o||a!=="bottom"||!Qm(p.target))return;let w=p.target,h=w.closest("[data-rd-scroll-area]");h&&(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{let x=ev(w.getBoundingClientRect(),h.getBoundingClientRect(),window.visualViewport);Math.abs(x)>=1&&h.scrollBy?.({top:x,behavior:"auto"}),m.current=null},280))},[a,o]);return o?Ns(Zo.Portal,{children:[Gr(Zo.Overlay,{className:"rd-overlay"}),Ns(Zo.Content,{ref:f,className:Re("rd-drawer-content",e),"data-theme":i,"data-rd-shell":"drawer","data-rd-in-app":b?"true":"false","data-rd-keyboard-adjusted":y?"true":"false",style:{...s,...g},onFocusCapture:u,children:[Gr(Zo.Title,{className:"rd-sr-only",children:t}),Gr("div",{className:"rd-drawer-handle"}),r]})]}):Ns(kr.Portal,{children:[Gr(kr.Overlay,{className:"rd-overlay"}),Ns(kr.Content,{className:Re("rd-dialog-content",e),"data-theme":i,"data-rd-shell":"dialog",style:s,children:[Gr(kr.Title,{className:"rd-sr-only",children:t}),Gr(kr.Description,{className:"rd-sr-only",children:t}),r]})]})}import{Fragment as iv,jsx as Oe,jsxs as Ir}from"react/jsx-runtime";function nv({id:e,activeView:t,recoverableCount:r,onChange:n}){let o=["deposit","history","recover"];return Oe("div",{className:"rd-deposit-tabs",role:"tablist","aria-label":"Deposit navigation","data-tab-count":o.length,"data-active-index":o.indexOf(t),children:o.map(i=>{let a=i==="deposit"?"Deposit":i==="history"?"History":"Recover";return Ir("button",{type:"button",id:`${e}-${i}-tab`,className:"rd-deposit-tab",role:"tab","aria-selected":t===i,"aria-controls":`${e}-${i}-panel`,tabIndex:t===i?0:-1,"data-active":t===i?"true":"false","data-track":`${i}_tab`,onClick:()=>n(i),onKeyDown:s=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(s.key))return;s.preventDefault();let l=o.indexOf(i),d=s.key==="Home"?0:s.key==="End"?o.length-1:(l+(s.key==="ArrowRight"?1:-1)+o.length)%o.length,c=o[d];n(c),document.getElementById(`${e}-${c}-tab`)?.focus()},children:[Oe("span",{children:a}),i==="recover"&&r>0&&Oe("span",{className:"rd-recovery-badge","data-testid":"recovery-badge",children:r})]},i)})})}function qm({className:e}){let t=Ci();return Oe(ye,{feature:"relay",children:Oe(Mn,{ariaTitle:"Deposit",className:["rd-deposit-shell",e??t.className].filter(Boolean).join(" "),children:Oe(ov,{})})})}function ov(){let e=Ci(),{theme:t}=an(),r=um(),n=Vm.useId();if(!r)return null;let{activeView:o,setActiveView:i,recoveryOpen:a,resolvedApiBaseUrl:s,wallet:l,catalog:d,catalogLoading:c,catalogError:b,origin:f,setOrigin:m,amount:y,setAmount:g,recipient:u,setRecipient:p,recipientValid:w,balance:h,balanceLoading:x,insufficientBalance:k,depositAddress:R,depositAddressLoading:I,depositAddressError:C,arrivalStatus:S,quote:E,quoteLoading:M,quoteError:B,canDeposit:L,deposit:z,depositState:A,targetOptions:U,selectedTarget:oe,setSelectedTarget:Y,showAmountInput:G,minNotice:H,showRecipientInput:ie,showTargetSelector:te,showOneClick:O,showConnectPrompt:Z,showRecipientHint:_,canRecover:ce,recoverableCount:xe,recoveryTargetsLoading:he,recoveryTargets:fe,recoveryOrders:ge,historyOrdersLoading:we,historyOrdersError:Ye,refreshRecovery:be,trustedFactories:Te,amountHint:it,amountSmallestUnits:We,onMax:_e}=r;return Ir("div",{className:"rd-root rd-wizard","data-theme":t,"data-rd-scroll-area":!0,children:[Oe(nv,{id:n,activeView:o,recoverableCount:xe,onChange:i}),a&&Oe("div",{className:"rd-deposit-tab-panel",id:`${n}-recover-panel`,role:"tabpanel","aria-labelledby":`${n}-recover-tab`,children:ce?Oe(Ss,{client:e.client,apiBaseUrl:s,recipient:u,target:oe?.symbol,wallet:l,trustedFactories:Te,targets:(d?.targets.length??0)>0?fe:void 0,targetsLoading:he,orders:ge,onRecovered:be,onRecoverySuccess:e.onRecoverySuccess,onError:e.onError,showTitle:!1}):Ir("div",{className:"rd-recover-empty",role:"status","data-variant":"unavailable","data-testid":"rd-recovery-unavailable-note",children:[Oe("span",{className:"rd-recover-empty-icon","aria-hidden":"true",children:Ir("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",focusable:"false",children:[Oe("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2.5",stroke:"currentColor",strokeWidth:"1.7"}),Oe("path",{d:"M8 10V7.5a4 4 0 0 1 8 0V10",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),Oe("circle",{cx:"12",cy:"15",r:"1.2",fill:"currentColor"})]})}),Oe("h3",{className:"rd-recover-empty-title",children:"Recovery unavailable"}),Oe("p",{className:"rd-recover-empty-copy",children:"Connect a wallet that supports recovery transactions to continue."})]})}),o==="history"&&Oe("div",{className:"rd-deposit-tab-panel",id:`${n}-history-panel`,role:"tabpanel","aria-labelledby":`${n}-history-tab`,children:w&&u.trim()?Oe(ys,{orders:ge,isLoading:c||we,error:b??Ye,catalog:d,showTitle:!1}):Oe(Ei,{requiresIdentity:!0})}),o==="deposit"&&Ir("div",{className:"rd-deposit-tab-panel",id:`${n}-deposit-panel`,role:"tabpanel","aria-labelledby":`${n}-deposit-tab`,children:[c&&Ir("div",{className:"rd-skeleton-form","data-testid":"rd-source-skeleton","aria-hidden":"true",children:[Oe(gs,{}),Z&&e.onRequestConnect&&Oe("span",{className:"rd-skeleton rd-skeleton-cta"}),Ir("section",{className:"rd-stack",children:[Ir("div",{className:"rd-field",children:[Oe("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"18%"}}),Ir("div",{className:"rd-field-row",children:[Oe("span",{className:"rd-skeleton rd-skeleton-field"}),Oe("span",{className:"rd-skeleton rd-skeleton-field"})]})]}),G&&Ir("div",{className:"rd-field",children:[Oe("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"34%"}}),Oe("span",{className:"rd-skeleton rd-skeleton-field"})]})]}),Ir("div",{className:"rd-field",children:[Oe("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"24%"}}),Oe("span",{className:"rd-skeleton rd-skeleton-field"}),(ie||u.trim().length>0)&&Ir(iv,{children:[Oe("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"58%",marginTop:"0.5rem"}}),Oe("span",{className:"rd-skeleton rd-skeleton-field"}),ie&&Oe("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"82%"}})]})]}),Oe("span",{className:"rd-skeleton rd-skeleton-notice"})]}),c&&Oe("p",{className:"rd-sr-only",role:"status",children:"Loading deposit options..."}),b&&Ir("div",{className:"rd-callout rd-callout-danger",children:["Failed to load configuration: ",b.message]}),_&&Oe("div",{className:"rd-callout rd-callout-muted",children:ie?"Connect a wallet or provide a recipient address to fetch your deposit address.":"Connect a wallet to fetch your deposit address."}),d&&f&&Oe(Tm,{catalog:d,origin:f,onChangeOrigin:m,amount:y,onChangeAmount:g,showAmountInput:G,minNotice:H,amountHint:it,onMax:_e,recipient:u,onChangeRecipient:p,showRecipientInput:ie,recipientValid:w,balance:h,balanceLoading:x,insufficientBalance:k,targetOptions:U,selectedTarget:oe,onChangeTarget:Y,showTargetSelector:te,quote:E,quoteLoading:M,quoteError:B,depositAddress:R,depositAddressLoading:I,depositAddressError:C,arrivalStatus:S,amountSmallestUnits:We,depositState:A,onDeposit:()=>{z()},canDeposit:L&&O,oneClickEnabled:O,locked:Z,onRequestConnect:e.onRequestConnect})]})]})}import{jsx as fd}from"react/jsx-runtime";function Ym({asChild:e,children:t}){return fd(ye,{feature:"relay",children:fd(Xo,{asChild:e??t!=null,children:t??fd("button",{type:"button","data-track":"open",children:"Deposit"})})})}import*as Ne from"react";import{useCallback as Pi,useEffect as Xn,useMemo as md,useRef as gd,useState as ht}from"react";import{useEffect as av,useState as sv}from"react";function Km(e,t){let[r,n]=sv(e);return av(()=>{let o=setTimeout(()=>n(e),t);return()=>clearTimeout(o)},[e,t]),r}var lv=500,Xm=56,Zm={chainId:Xm,token:"0x55d398326f99059fF775485246999027B3197955"},Jm=3e4,dv=5e3;function cv(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?Jm:Math.max(dv,e*1e3)}var pv=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];function hd(e,t){let r=e.trim();if(!r)return null;try{let n=us(r,t);return n>0n?n:null}catch{return null}}function $m(e={}){let t=gd(e);t.current=e;let r=md(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useDepositAddress: either `client` or `apiBaseUrl` must be provided");return Gt({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.wallet,o=n?.walletAddress,i=!!o,a=n?.walletChainId,[s,l]=ht(),[d,c]=ht(!0),[b,f]=ht();Xn(()=>{let X=!1;return c(!0),r.getConfig().then(Ee=>{X||(l(Ee),f(void 0))}).catch(Ee=>{X||f(Ee instanceof Error?Ee:new Error(String(Ee)))}).finally(()=>{X||c(!1)}),()=>{X=!0}},[r]);let m=e.chains,y=md(()=>{if(!s)return[];if(!m||m.length===0)return s.origins;let X=new Set(m);return s.origins.filter(Ee=>X.has(Ee.chainId))},[s,m]),g=md(()=>s?{...s,origins:y}:void 0,[s,y]),[u,p]=ht();Xn(()=>{if(u||y.length===0)return;let X=t.current.defaultToken,Ee=X?y.find(j=>j.chainId===X.chainId&&j.token.address.toLowerCase()===X.address.toLowerCase()):void 0;p(Ee??y[0])},[y,u]);let[w,h]=ht(),x=Pi(()=>{Ge(void 0),st(!1),F(!1),P(!1),Nt(void 0)},[]),k=Pi(X=>{p(X),h(void 0),x()},[x]),R=u?.kind==="svm",[I,C]=ht(""),S=e.amount!==void 0?e.amount:I,E=Pi(X=>{C(X),h(void 0),x()},[x]),M=Km(S,lv),B=u?hd(M,u.token.decimals):null,L=u?hd(S,u.token.decimals):null,[z,A]=ht(""),[U,oe]=ht(!1),Y=e.recipient!==void 0?e.recipient:z,G=Pi(X=>{A(X),oe(!0),h(void 0),x()},[x]);Xn(()=>{e.recipient===void 0&&o&&!U&&A(o)},[o,U,e.recipient]);let H=Y.length===0||dt(Y),ie=Y.length>0&&dt(Y)?Y:void 0,[te,O]=ht(),[Z,_]=ht(!1),[ce,xe]=ht(0),he=n?.getBalance;Xn(()=>{if(!he||!o||!u||R){O(void 0),_(!1);return}let X=!1;_(!0);let Ee=u.token.address.toLowerCase()===Si?void 0:u.token.address;return he({chainId:u.chainId,address:o,token:Ee}).then(j=>{X||O({...j,formatted:Wt(j.value,j.decimals)})}).catch(()=>{X||O(void 0)}).finally(()=>{X||_(!1)}),()=>{X=!0}},[he,o,u,R,ce]);let fe=te?.value??null,ge=!R&&L!==null&&fe!==null&&L>fe,[we,Ye]=ht(),[be,Te]=ht(!1),[it,We]=ht(),_e=u?.chainId,Be=u?.token.address,rt=e.target;Xn(()=>{if(!ie||!_e||!Be){Ye(void 0),We(void 0),Te(!1);return}let X=!1;return Ye(void 0),We(void 0),Te(!0),(rt?r.getDepositAddress({user:ie,originChainId:_e,originCurrency:Be},rt):r.getDepositAddress({user:ie,originChainId:_e,originCurrency:Be})).then(j=>{X||(Ye(j),We(void 0),t.current.onDepositAddress?.(j))}).catch(j=>{if(X)return;Ye(void 0);let ze=j instanceof Error?j:new Error(String(j));We(ze),t.current.onError?.(ze)}).finally(()=>{X||Te(!1)}),()=>{X=!0}},[r,ie,_e,Be,rt]);let Et=[_e??"",(Be??"").toLowerCase(),(ie??"").toLowerCase(),rt??"",S.trim()].join("|"),ft=gd(Et);Xn(()=>{ft.current!==Et&&(ft.current=Et,h(void 0),x())},[Et,x]);let[Ct,Se]=ht(),[wt,yt]=ht(!1),[St,Ke]=ht(),Xe=B?.toString();Xn(()=>{if(!_e||!Be||!Xe){Se(void 0),Ke(void 0),yt(!1);return}let X=!1,Ee,j=!0;async function ze(){j&&yt(!0);let ee=Jm;try{let $e=await r.getQuote({originChainId:_e,originCurrency:Be,amount:Xe});if(X)return;Se($e),Ke(void 0),ee=cv($e.ttl)}catch($e){if(X)return;Se(void 0),Ke($e instanceof Error?$e:new Error(String($e)))}finally{X||yt(!1),j=!1}X||(Ee=setTimeout(ze,ee))}return ze(),()=>{X=!0,Ee&&clearTimeout(Ee)}},[r,_e,Be,Xe]);let[$t,At]=ht(!1),[zt,Mt]=ht(!1),[nt,Ge]=ht(),[at,Nt]=ht(),[Pe,st]=ht(!1),[_t,F]=ht(!1),[ke,P]=ht(!1),ae=n?.waitForReceipt,pe=gd(void 0);Xn(()=>{if(!nt||!u||!ae)return;let X=!1;return st(!0),F(!1),P(!1),ae({chainId:u.chainId,hash:nt}).then(Ee=>{X||(F(!0),P(Ee.status==="reverted"),xe(j=>j+1),Ee.status!=="reverted"&&nt!==pe.current&&(pe.current=nt,t.current.onDeposited?.(nt)))}).catch(Ee=>{X||Nt(Ee instanceof Error?Ee.message:String(Ee))}).finally(()=>{X||st(!1)}),()=>{X=!0}},[nt,ae]);let me=a!==void 0&&u!==void 0&&a!==u.chainId,Je=$t||zt,ir=w??at,Qt="idle";ir?Qt="error":_t?Qt="confirmed":Pe?Qt="confirming":Je&&(Qt=$t?"switching":"pending");let Lt={phase:Qt,isSubmitting:Je,isConfirming:Pe,isConfirmed:_t,needsSwitch:me,txHash:nt,reverted:_t&&ke,error:ir},hr=!!(u&&we&&we.originChainId===u.chainId&&we.originCurrency.toLowerCase()===u.token.address.toLowerCase()),br=!!(n?.sendTransaction&&n?.writeContract&&n?.readContract&&n?.waitForReceipt),Vt=!!(i&&br&&u&&!R&&we&&hr&&L&&L>0n&&!ge&&!Je&&!Pe),ar=Pi(async()=>{if(R||!u||!we||!n?.sendTransaction||!n?.writeContract)return;h(void 0);let X=hd(S,u.token.decimals);if(!X||X<=0n){h("enter an amount to use the one-click deposit");return}let Ee=u.token.address.toLowerCase()===Si,j=we.depositAddress,ze=await Dm(n?.readContract,Xm,{forwarder:we.forwarder,recipient:ie,version:we.version,trusted:t.current.trustedFactories});if(!ze.ok){h(`address verification failed: ${ze.reason}`);return}if(u.chainId===Zm.chainId&&u.token.address.toLowerCase()===Zm.token.toLowerCase()&&!Pm(j,we.forwarder)){h("address verification failed: deposit address does not match the verified forwarder (expected them to be identical on this route; check the backend's direct_same_token setting)");return}try{if(me){if(!n?.switchChain)throw new Error("wallet cannot switch chains");At(!0);try{await n.switchChain(u.chainId)}finally{At(!1)}}x(),Mt(!0);try{let $e=Ee?await n.sendTransaction({chainId:u.chainId,to:j,value:X}):await n.writeContract({chainId:u.chainId,address:u.token.address,abi:pv,functionName:"transfer",args:[j,X]});Ge($e)}finally{Mt(!1)}}catch($e){h($e.message)}},[R,u,we,S,me,n,ie,x]);return{address:o,isConnected:i,catalog:g,catalogLoading:d,catalogError:b,origin:u,setOrigin:k,recipient:Y,setRecipient:G,recipientValid:H,amount:S,setAmount:E,balance:te,balanceLoading:Z,insufficientBalance:ge,isSvmOrigin:R,depositAddress:we?.depositAddress,depositAddressResult:we,depositAddressLoading:be,depositAddressError:it,quote:Ct,quoteLoading:wt,quoteError:St,canDeposit:Vt,deposit:ar,depositState:Lt}}import{useEffect as uv,useRef as fv,useState as Jo}from"react";var mv=3e4,gv=300;function Jn(e){let t=fv(e);t.current=e;let{client:r,enabled:n=!0,live:o=!0}=e,i=e.refetchInterval??e.fallbackPollMs??mv,a=e.recipient&&dt(e.recipient)?e.recipient:void 0,[s,l]=Jo([]),[d,c]=Jo(!1),[b,f]=Jo(),[m,y]=Jo(!1),[g,u]=Jo(),[p,w]=Jo(0);return uv(()=>{if(!a){l([]),f(void 0),c(!1),y(!1),u(void 0),w(0);return}if(!n){l([]),f(void 0),c(!1),y(!1),u(void 0),w(0);return}let h=!1,x=!0,k,R=0,I=0;async function C(){let B=++R;I+=1,x&&c(!0);try{let L=await r.listOrders(a);if(h)return;B===R&&(l(L),f(void 0))}catch(L){if(h)return;let z=L instanceof Error?L:new Error(String(L));B===R&&(f(z),t.current.onError?.(z))}finally{I-=1,!h&&B===R&&(c(!1),y(!0),u(a),w(L=>L+1)),x=!1}}function S(){k&&clearTimeout(k),k=setTimeout(()=>{k=void 0,h||C()},gv)}C();let E;o&&typeof EventSource<"u"&&(E=new EventSource(r.ordersStreamUrl(a)),E.addEventListener("orders-changed",S),E.onopen=()=>{S()});let M=o&&Number.isFinite(i)&&i>0?setInterval(()=>{I===0&&C()},i):void 0;return()=>{h=!0,k&&clearTimeout(k),M&&clearInterval(M),E?.close()}},[r,a,n,o,i]),{orders:s,ordersLoading:d,ordersError:b,ordersInitialized:m,ordersForRecipient:g,ordersRevision:p}}import{useMemo as hv,useState as bv}from"react";function eg(e,t){if(t){let r=e.find(n=>n.symbol===t);if(r)return r}return e.find(r=>r.isDefault)??e[0]}function tg({catalogTargets:e,filter:t,defaultTarget:r}){let n=hv(()=>{if(!t||t.length===0)return e;let l=new Set(t);return e.filter(d=>l.has(d.symbol))},[e,t]),[o,i]=bv(()=>eg(n,r)?.symbol),a=(o!==void 0?n.find(l=>l.symbol===o):void 0)??eg(n,r);function s(l){n.some(d=>d.symbol===l)&&i(l)}return{options:n,selected:a,setSelected:s}}var wv={dev:"https://dev-relay-protocol-api.onechain.nexus",stage:"https://dev-relay-protocol-api.onechain.nexus",production:"https://relay-protocol-api.onechain.nexus"};function $n(e){return e.apiBaseUrl?e.apiBaseUrl:wv[ot(e.environment)]}import{jsx as Rv,jsxs as Cv}from"react/jsx-runtime";var rg=1e3;function yv(e,t,r,n,o){let i=e.requireWalletConnection??e.showRecipientInput===!1,a=r.walletAddress&&dt(r.walletAddress)?r.walletAddress:void 0;return{client:e.client,apiBaseUrl:n,wallet:r,chains:e.chains,recipient:i?a??"":e.recipient,amount:i&&!a?"":e.amount,defaultToken:e.defaultToken,target:t,trustedFactories:o,onDepositAddress:e.onDepositAddress,onDeposited:e.onDeposited,onError:e.onError}}function Ts(e,t){let r=e.trim();if(!r)return 0n;try{let n=us(r,t);return n>0n?n:0n}catch{return 0n}}function xv(e,t,r,n){if(t!==void 0&&e.forwarderVersion!==t)return!1;let o=e.target?.trim();return o?!!(r&&o.toLowerCase()===r.toLowerCase()):n}function ng(e,t,r){return`${e}:${t.toLowerCase()}:${r}`}function vv(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function og({open:e,children:t}){let[r]=Ne.useState(pm);return Cv(td.Provider,{value:r,children:[e&&Rv(kv,{store:r}),t]})}function kv({store:e}){let t=Ci(),{showTargetSelector:r=!0}=t,n=t.requireWalletConnection??t.showRecipientInput===!1,o=!!(t.walletAddress&&dt(t.walletAddress)),[i,a]=Ne.useState("deposit"),s=i==="recover",l=Ne.useCallback(W=>{a(ct=>(typeof W=="function"?W(ct==="recover"):W)?"recover":"deposit")},[]);Ne.useEffect(()=>{Qe("relay","opened")},[]);let[d,c]=Ne.useState(void 0),b=Ne.useMemo(()=>$n({apiBaseUrl:t.apiBaseUrl,environment:t.environment}),[t.apiBaseUrl,t.environment]),f=Ne.useMemo(()=>({walletAddress:t.walletAddress,walletChainId:t.walletChainId,sendTransaction:t.sendTransaction,writeContract:t.writeContract,readContract:t.readContract,switchChain:t.switchChain,waitForReceipt:t.waitForReceipt,getBalance:t.getBalance}),[t.walletAddress,t.walletChainId,t.sendTransaction,t.writeContract,t.readContract,t.switchChain,t.waitForReceipt,t.getBalance]),m=ot(t.environment),y=Ut("apps.json",m,W=>({min:Mr(W?.relay?.minDepositAmount,m),max:Mr(W?.relay?.maxDepositAmount,m),trustedFactories:$i(W,m)})),g=Ne.useMemo(()=>t.trustedFactories??vs(y?.trustedFactories),[t.trustedFactories,y?.trustedFactories]),{isConnected:u,catalog:p,catalogLoading:w,catalogError:h,origin:x,setOrigin:k,amount:R,setAmount:I,recipient:C,setRecipient:S,recipientValid:E,balance:M,balanceLoading:B,insufficientBalance:L,depositAddress:z,depositAddressResult:A,depositAddressLoading:U,depositAddressError:oe,quote:Y,quoteLoading:G,quoteError:H,canDeposit:ie,deposit:te,depositState:O}=$m(yv(t,d,f,b,g)),{options:Z,selected:_,setSelected:ce}=tg({catalogTargets:p?.targets??[],filter:t.targetTokens,defaultTarget:t.defaultTarget});Ne.useEffect(()=>{c(_?.symbol)},[_?.symbol]);let xe=t.amount===void 0&&!t.hideAmount,he=!n&&(t.showRecipientInput??!0)&&t.recipient===void 0,fe=E&&C.trim().length>0&&dt(C),ge=!n&&t.recipient!==void 0&&t.recipient.trim().length>0,we=n?!o||!fe:!u&&!ge&&!fe,Ye=!!p&&!fe&&!we,be=(t.showRecovery??!1)&&o&&!!(f.writeContract&&f.readContract&&f.waitForReceipt),Te=Ne.useMemo(()=>t.client?t.client:Gt({baseUrl:b}),[t.client,b]),[it,We]=Ne.useState({}),[_e,Be]=Ne.useState(!1),[rt,Et]=Ne.useState(0),ft=Ne.useCallback(()=>Et(W=>W+1),[]),Ct=O.isConfirmed,Se=fe&&(!!A||i!=="deposit"),{orders:wt,ordersLoading:yt,ordersError:St,ordersInitialized:Ke,ordersForRecipient:Xe}=Jn({client:Te,recipient:Se?C:void 0,enabled:Se,refetchInterval:rg}),$t=wt,At=_??p?.targets.find(W=>W.isDefault),zt=At?.symbol??p?.destination.symbol,Mt=At?.isDefault??!0,nt=A?.version,Ge=Ne.useMemo(()=>wt.filter(W=>xv(W,nt,zt,Mt)),[wt,nt,zt,Mt]),at=Ne.useRef(void 0),[Nt,Pe]=Ne.useState(),[st,_t]=Ne.useState(),F=`${C.toLowerCase()}:${zt?.toLowerCase()??""}:${nt??""}`;Ne.useEffect(()=>{let W=Xe?.toLowerCase()===C.toLowerCase();if(!Se||!Ke||!W||St){Se||(at.current=void 0,Pe(void 0),_t(void 0));return}let ct=new Set(Ge.map(He=>He.orderId)),er=new Set(Ge.flatMap(He=>(He.deposits??[]).map(dn=>ng(He.orderId,dn.txHash,dn.blockNumber)))),Ae=at.current;if(!Ae||Ae.key!==F){at.current={key:F,orderIds:ct,depositKeys:er,statuses:new Map(Ge.map(He=>[He.orderId,He.status]))},Pe(void 0),_t(void 0);return}let Zr,Ft=0n,lr=!1;for(let He of Ge)for(let dn of He.deposits??[]){let Ro=ng(He.orderId,dn.txHash,dn.blockNumber);if(!Ae.depositKeys.has(Ro)){Zr??(Zr=He);try{Ft+=BigInt(dn.amount),lr=!0}catch{}}}Zr??(Zr=Ge.find(He=>!Ae.orderIds.has(He.orderId))),Zr??(Zr=Ge.find(He=>Ae.statuses.get(He.orderId)!==He.status));for(let He of ct)Ae.orderIds.add(He);for(let He of er)Ae.depositKeys.add(He);for(let He of Ge)Ae.statuses.set(He.orderId,He.status);Zr&&(Pe(Zr.orderId),lr&&_t(Ft))},[F,Ge,Xe,Se,C,St,Ke]),Ne.useEffect(()=>{let W=p?.targets??[];if(!be||!fe||W.length===0){We({}),Be(!1);return}let ct=!1;return Be(!0),Promise.all(W.map(er=>Te.getRecovery({user:C,target:er.symbol}).catch(()=>{}))).then(er=>{if(ct)return;let Ae={};W.forEach((Zr,Ft)=>{let lr=er[Ft];lr&&(Ae[Zr.symbol]=lr)}),We(Ae),Be(!1)}),()=>{ct=!0}},[Te,be,fe,C,p,Ct,rt]);let ke=Ne.useMemo(()=>(p?.targets??[]).map(W=>({symbol:W.symbol,isDefault:W.isDefault,info:it[W.symbol]})).filter(W=>W.info!==void 0),[p,it]),P=Ne.useMemo(()=>ks(Ko(ke)),[ke]),[ae,pe]=Ne.useState(void 0),[me,Je]=Ne.useState(),ir=!!p&&(p?.targets.length??0)>0&&!d;Ne.useEffect(()=>{if(!fe||!x||!A||ir){pe(void 0),Je(void 0);return}let W=!1,ct=!1,er=A.forwarder.toLowerCase();pe(void 0),Je(void 0);async function Ae(){if(!(W||ct)){ct=!0;try{let Ft=await Te.getRecovery({user:C,target:d||void 0});if(W)return;if(Ft?.forwarder&&Ft.forwarder.toLowerCase()!==er){pe(void 0),Je(void 0);return}if(Je(Ft),!Ft||Ft.suggestedAction!=="sweep"){pe(void 0);return}let lr;try{lr=BigInt(Ft.balance)}catch{pe(void 0);return}let He=Number(Ft.decimals);if(lr<=0n||!Number.isInteger(He)||He<0){pe(void 0);return}let dn=Ft.tokens?.find(Ro=>Ro.address?.toLowerCase()===Ft.token?.toLowerCase()&&Ro.symbol)?.symbol;pe({balance:lr,decimals:He,symbol:dn})}catch{}finally{ct=!1}}}Ae();let Zr=setInterval(()=>{Ae()},rg);return()=>{W=!0,clearInterval(Zr)}},[Te,fe,C,d,ir,x,A,Ct]);let Qt=Ne.useCallback(()=>{!x||!M||I(Wt(M.value,x.token.decimals))},[x,M,I]),Lt=Ne.useRef(!1),hr=!!z;Ne.useEffect(()=>{!hr||Lt.current||(Lt.current=!0,Qe("relay","deposit_address_shown"))},[hr]);let br=O.txHash;Ne.useEffect(()=>{br&&Qe("relay","deposit_submitted")},[br]);let Vt=(()=>{let W=Number(y?.min);return Number.isFinite(W)&&W>=0?String(y?.min):"6"})(),ar=(()=>{let W=Number(y?.max);return Number.isFinite(W)&&W>0?String(y?.max):void 0})(),X=(()=>{if(!x)return 0n;let W=Ts(Vt,x.token.decimals),ct=BigInt(x.minAmount);return W>ct?W:ct})(),Ee=x?Wt(X,x.token.decimals):Vt,j=(()=>{if(!x||!ae||X<=0n)return;let W=x.token.decimals,ct=ae.decimals,er=W>=ct?ae.balance*10n**BigInt(W-ct):ae.balance/10n**BigInt(ct-W);if(er>=X)return;let Ae=X-er;return{pending:Wt(ae.balance,ct),pendingSymbol:ae.symbol,remaining:Wt(Ae,W)}})(),ze=p?.origins.find(W=>W.chainId===56&&!!(me?.token&&W.token.address.toLowerCase()===me.token.toLowerCase()))??p?.origins.find(W=>W.chainId===56&&W.token.symbol.toUpperCase()==="USDT"),ee=Number.isInteger(me?.decimals)&&(me?.decimals??-1)>=0?me.decimals:ze?.token.decimals,$e=me?.tokens?.find(W=>W.address?.toLowerCase()===me.token?.toLowerCase()&&W.symbol)?.symbol??ze?.token.symbol,xn=st!==void 0&&ee!==void 0?Wt(st,ee):void 0,eo=(()=>{if(!x||ee===void 0)return;let W=x.token.decimals;if(ee>=W)return X*10n**BigInt(ee-W);let ct=10n**BigInt(W-ee);return(X+ct-1n)/ct})(),qr=Nt?Ge.find(W=>W.orderId===Nt):void 0,Yr=qr??Ge.find(W=>W.status==="BSC_FUNDED"||W.status==="BRIDGE_INITIATED"||W.status==="BRIDGE_PENDING"),Hi=(()=>{if(!Yr||eo===void 0)return!1;try{return BigInt(Yr.amountIn)>=eo}catch{return!1}})(),to=(()=>{if(!me||eo===void 0)return!1;try{return BigInt(me.balance)>0n&&BigInt(me.balance)>=eo}catch{return!1}})(),_i=(()=>{let W={amount:xn,symbol:$e,backendStatus:Yr?.status};return!A||!Se||!Ke?{phase:"connecting",...W}:Xe?.toLowerCase()!==C.toLowerCase()||St?{phase:"unavailable",...W}:qr?.status==="COMPLETED"?{phase:"completed",...W,backendStatus:qr.status}:qr&&vv(qr.status)?{phase:"failed",...W,backendStatus:qr.status}:Yr?.status==="BRIDGE_INITIATED"||Yr?.status==="BRIDGE_PENDING"?{phase:"processing",...W}:Yr?.status==="BSC_FUNDED"&&Hi||to?{phase:"funded",...W}:qr?{phase:"detected",...W,backendStatus:qr.status}:{phase:"waiting",...W}})(),Qi=x&&ar?Ts(ar,x.token.decimals):void 0,ko=x&&R.trim()?Ts(R,x.token.decimals):0n,Vi=!!(x&&ko>0n&&ko<X),sr=!!(x&&Qi!==void 0&&ko>0n&&ko>Qi),qi=(()=>{if(x){if(Vi)return`Amount is below the ${Ee} ${x.token.symbol} minimum.`;if(sr)return`Amount is above the ${ar} ${x.token.symbol} maximum.`}})(),Kr=t.showOneClickDeposit??!1,qt=x&&R.trim()?Ts(R,x.token.decimals).toString():void 0,ro={activeView:i,setActiveView:a,recoveryOpen:s,setRecoveryOpen:l,resolvedApiBaseUrl:b,wallet:f,catalog:p,catalogLoading:w,catalogError:h,origin:x,setOrigin:k,amount:R,setAmount:I,recipient:C,setRecipient:S,recipientValid:E,balance:M,balanceLoading:B,insufficientBalance:L,depositAddress:z,depositAddressLoading:U,depositAddressError:oe,arrivalStatus:_i,quote:Y,quoteLoading:G,quoteError:H,canDeposit:ie,deposit:te,depositState:O,targetOptions:Z,selectedTarget:_,setSelectedTarget:ce,showAmountInput:xe,minNotice:x?{min:Ee,symbol:x.token.symbol,...j}:void 0,showRecipientInput:he,showTargetSelector:r,showOneClick:Kr,showConnectPrompt:we,showRecipientHint:Ye,canRecover:be,recoverableCount:P,recoveryTargetsLoading:_e,recoveryTargets:ke,recoveryOrders:$t,historyOrdersLoading:yt,historyOrdersError:St,refreshRecovery:ft,trustedFactories:g,amountHint:qi,amountSmallestUnits:qt,onMax:xe&&M&&M.value>0n?Qt:void 0};return Ne.useLayoutEffect(()=>{e.publish(ro)}),Ne.useLayoutEffect(()=>()=>e.publish(null),[e]),null}import{jsx as bd}from"react/jsx-runtime";function Sv(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:d,children:c}=e,[b,f]=Is.useState(!1),m=l!==void 0,y=m?l:b,g=Is.useCallback(u=>{m||f(u),d?.(u)},[m,d]);return bd(ed.Provider,{value:e,children:bd(og,{open:y,children:bd(An,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:y,onOpenChange:g,children:c})})})}var Oi=Object.assign(Sv,{Trigger:Ym,Content:qm});import{createContext as Nv,useContext as Tv}from"react";var wd=Nv(null);function yd(){let e=Tv(wd);if(!e)throw new Error("RelayHistory compound components must be used within <RelayHistory>");return e}import*as Er from"react";import{jsx as yo}from"react/jsx-runtime";function ig({className:e}){let t=yd(),{open:r}=an();return Er.useEffect(()=>{r&&Qe("relay","history_opened")},[r]),yo(ye,{feature:"relay",children:yo(Mn,{ariaTitle:"Transfer history",className:e??t.className,children:yo(Iv,{})})})}function Iv(){let e=yd(),{theme:t}=an(),r=Er.useMemo(()=>{if(e.client)return e.client;let u=$n({apiBaseUrl:e.apiBaseUrl,environment:e.environment});return Gt({baseUrl:u})},[e.client,e.apiBaseUrl,e.environment]),n=e.recipient??e.walletAddress,o=!!(n&&dt(n)),[i,a]=Er.useState(),[s,l]=Er.useState(!1),[d,c]=Er.useState(),b=Er.useRef(e.onError);b.current=e.onError,Er.useEffect(()=>{if(!o){a(void 0),l(!1),c(void 0);return}let u=!1;return a(void 0),l(!0),c(void 0),r.getConfig().then(p=>{u||a(p)}).catch(p=>{if(u)return;let w=p instanceof Error?p:new Error(String(p));c(w),b.current?.(w)}).finally(()=>{u||l(!1)}),()=>{u=!0}},[r,o]);let{orders:f,ordersLoading:m,ordersError:y}=Jn({client:r,recipient:o?n:void 0,enabled:!!i,onError:e.onError}),g=Er.useCallback(u=>{if(!e.onOutlink)return;let w=u.target.closest?.('a[target="_blank"]');w?.href&&e.onOutlink(w.href)},[e.onOutlink]);return yo("div",{className:"rd-root rd-wizard","data-theme":t,children:o?yo("div",{onClick:g,children:yo(ys,{orders:f,isLoading:s||m,error:d??y,catalog:i,showTitle:!1})}):yo(Ei,{requiresIdentity:!0})})}import{jsx as xd}from"react/jsx-runtime";function ag({asChild:e,children:t}){return xd(ye,{feature:"relay",children:xd(Xo,{asChild:e??t!=null,children:t??xd("button",{type:"button","data-track":"open",children:"History"})})})}import{jsx as sg}from"react/jsx-runtime";function Ev(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o="min(640px, calc(100vw - 32px))",drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:d,children:c}=e;return sg(wd.Provider,{value:e,children:sg(An,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:d,children:c})})}var lg=Object.assign(Ev,{Trigger:ag,Content:ig});import*as Hr from"react";import*as Ar from"react";var Es=[],Av=3e4;function dg({client:e,recipient:t}){let[r,n]=Ar.useState({targets:Es}),[o,i]=Ar.useState(0),a=Ar.useRef(void 0),s=Ar.useRef(void 0),l=t&&dt(t)?t.toLowerCase():void 0;Ar.useEffect(()=>{if(!l){n({targets:Es});return}let g=!1,u=a.current;if(!u||u.client!==e||u.recipientKey!==l||u.generation!==o){let p=(async()=>{let w,h=[];try{h=(await e.getConfig()).targets}catch(C){w=C instanceof Error?C:new Error(String(C))}let x=h.length===0?[()=>e.getRecovery({user:l})]:h.map(C=>()=>e.getRecovery({user:l,target:C.symbol})),k=await Promise.all(x.map(async C=>{try{return{info:await C()}}catch(S){return{error:S instanceof Error?S:new Error(String(S))}}})),R=h.length===0?k[0]?.info?[{symbol:"",isDefault:!0,info:k[0].info}]:[]:h.flatMap((C,S)=>k[S]?.info?[{symbol:C.symbol,isDefault:C.isDefault,info:k[S].info}]:[]),I=k.find(C=>C.error)?.error;return{targets:R,badgeFailed:!!(w||I&&R.length===0),error:w??I}})().catch(w=>({targets:Es,badgeFailed:!0,error:w instanceof Error?w:new Error(String(w))}));u={client:e,recipientKey:l,generation:o,promise:p},a.current=u,p.finally(()=>{s.current={client:e,recipientKey:l,at:Date.now()},a.current?.promise===p&&(a.current=void 0)})}return u.promise.then(p=>{g||n({recipientKey:l,targets:p.targets,badgeFailed:p.badgeFailed,error:p.error})}),()=>{g=!0}},[e,l,o]);let d=Ar.useCallback(()=>i(g=>g+1),[]),c=Ar.useCallback(()=>{if(!l)return;let g=a.current;if(g?.client===e&&g.recipientKey===l)return;let u=s.current;u?.client===e&&u.recipientKey===l&&Date.now()-u.at<Av||i(p=>p+1)},[e,l]),b=l&&r.recipientKey===l?r.targets:Es,f=l&&r.recipientKey===l?r.error:void 0,m=!!(l&&r.recipientKey!==l),y=!!(l&&r.recipientKey===l&&r.badgeFailed);return Ar.useMemo(()=>({count:y?0:ks(Ko(b)),targets:b,loading:m,error:f,refresh:d,refreshIfStale:c}),[b,m,y,f,d,c])}import{createContext as Mv,useContext as Lv}from"react";var vd=Mv(null);function kd(){let e=Lv(vd);if(!e)throw new Error("RelayRecovery compound components must be used within <RelayRecovery>");return e}function Rd(){return kd().props}function cg(){return kd().recovery}function pg(){return kd().recovery.count}import*as xo from"react";import{jsx as vo,jsxs as Pv}from"react/jsx-runtime";function ug({className:e}){let t=Rd(),{open:r}=an();return xo.useEffect(()=>{r&&Qe("relay","recovery_opened")},[r]),vo(ye,{feature:"relay",children:vo(Mn,{ariaTitle:"Recover stuck funds",className:e??t.className,children:vo(Dv,{})})})}function Dv(){let e=Rd(),{targets:t,loading:r,refresh:n}=cg(),{theme:o}=an(),i=xo.useMemo(()=>$n({apiBaseUrl:e.apiBaseUrl,environment:e.environment}),[e.apiBaseUrl,e.environment]),a=xo.useMemo(()=>e.client?e.client:Gt({baseUrl:i}),[e.client,i]),s=xo.useMemo(()=>({walletAddress:e.walletAddress,walletChainId:e.walletChainId,sendTransaction:e.sendTransaction,writeContract:e.writeContract,readContract:e.readContract,switchChain:e.switchChain,waitForReceipt:e.waitForReceipt,getBalance:e.getBalance}),[e.walletAddress,e.walletChainId,e.sendTransaction,e.writeContract,e.readContract,e.switchChain,e.waitForReceipt,e.getBalance]),l=e.walletAddress&&dt(e.walletAddress)?e.walletAddress:void 0,d=!!(l&&(!e.recipient||dt(e.recipient)&&e.recipient.toLowerCase()===l.toLowerCase())),c=d?l:void 0,b=ot(e.environment),f=Ut("apps.json",b,w=>$i(w,b)),m=xo.useMemo(()=>e.trustedFactories??vs(f),[e.trustedFactories,f]),y=!!(e.writeContract&&e.readContract&&e.waitForReceipt),g=!!c&&y,u=c,{orders:p}=Jn({client:a,recipient:g?u:void 0,enabled:g,live:!1});return Pv("div",{className:"rd-root rd-wizard","data-theme":o,children:[!l&&vo("p",{className:"rd-muted","data-testid":"rd-recovery-connect-note",children:"Connect a wallet to check recoverable funds."}),l&&!d&&vo("p",{className:"rd-muted","data-testid":"rd-recovery-recipient-note",children:"Recovery is only available for the connected wallet."}),d&&!y&&vo("p",{className:"rd-muted","data-testid":"rd-recovery-unsupported-note",children:"This wallet can't sign recovery transactions."}),g&&vo(Ss,{client:e.client,apiBaseUrl:i,recipient:c,wallet:s,trustedFactories:m,targets:t,targetsLoading:r,orders:p,onRecovered:n,onRecoverySuccess:e.onRecoverySuccess,showTitle:!1,onError:e.onError})]})}import{jsx as Cd}from"react/jsx-runtime";function fg({asChild:e,children:t}){let r=pg();return Cd(ye,{feature:"relay",children:Cd(Xo,{asChild:e??t!=null,dataAttributes:{"data-rd-recovery-count":r},children:t??Cd("button",{type:"button","data-track":"open",children:"Recover"})})})}import{jsx as mg}from"react/jsx-runtime";function Ov(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:d,children:c}=e,[b,f]=Hr.useState(!1),m=l!==void 0,y=m?l:b,g=Hr.useCallback(R=>{m||f(R),d?.(R)},[m,d]),u=Hr.useMemo(()=>{if(e.client)return e.client;let R=$n({apiBaseUrl:e.apiBaseUrl,environment:e.environment});return Gt({baseUrl:R})},[e.client,e.apiBaseUrl,e.environment]),p=e.walletAddress&&dt(e.walletAddress)?e.walletAddress:void 0,w=p&&(!e.recipient||dt(e.recipient)&&e.recipient.toLowerCase()===p.toLowerCase())?p:void 0,h=dg({client:u,recipient:w});Hr.useEffect(()=>{y&&h.refreshIfStale()},[y,h.refreshIfStale]);let x=Hr.useRef(void 0);Hr.useEffect(()=>{!y||!h.error||x.current===h.error||(x.current=h.error,e.onError?.(h.error))},[y,h.error,e.onError]);let k=Hr.useMemo(()=>({props:e,recovery:h}),[e,h]);return mg(vd.Provider,{value:k,children:mg(An,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:y,onOpenChange:g,children:c})})}var gg=Object.assign(Ov,{Trigger:fg,Content:ug});import{useCallback as Bv,useEffect as zv,useMemo as Fv,useRef as Uv,useState as As}from"react";function hg(e={}){let t=Uv(e);t.current=e;let r=Fv(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useRelayConfig: either `client` or `apiBaseUrl` must be provided");return Gt({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.enabled??!0,o=e.refetchInterval,[i,a]=As(),[s,l]=As(!1),[d,c]=As(),[b,f]=As(0);zv(()=>{if(!n){a(void 0),l(!1),c(void 0);return}let y=!1,g=!1;a(void 0),l(!0),c(void 0);async function u(){if(!(y||g)){g=!0;try{let w=await r.getConfig();if(y)return;a(w),c(void 0)}catch(w){if(y)return;let h=w instanceof Error?w:new Error(String(w));c(h),t.current.onError?.(h)}finally{g=!1,y||l(!1)}}}u();let p=typeof o=="number"&&Number.isFinite(o)&&o>0?setInterval(()=>{u()},o):void 0;return()=>{y=!0,p&&clearInterval(p)}},[r,n,b,o]);let m=Bv(()=>f(y=>y+1),[]);return{config:i,loading:s,error:d,refresh:m}}import{useQuery as jv}from"@tanstack/react-query";import{useCallback as bg,useEffect as Wv,useMemo as Sd,useRef as wg}from"react";var Gv=1,yg=new WeakMap;function Hv(e){let t=yg.get(e);if(t!==void 0)return t;let r=Gv++;return yg.set(e,r),r}function xg(e={}){let t=wg(e);t.current=e;let r=Sd(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useRelayRecovery: either `client` or `apiBaseUrl` must be provided");return Gt({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.recipient,o=n&&dt(n)?n:void 0,i=e.target,a=e.query,s=Sd(()=>Hv(r),[r]),l=Sd(()=>["relay","recovery",s,o??null,i??null],[s,o,i]),d=jv({retry:!1,...a,queryKey:l,queryFn:async()=>{if(!o)throw new Error("useRelayRecovery: a valid EVM recipient is required");return r.getRecovery({user:o,target:i})},enabled:o?a?.enabled:!1}),c=wg(0);Wv(()=>{let g=d.error,u=d.errorUpdatedAt;!g||u===c.current||(c.current=u,t.current.onError?.(g),g instanceof ln&&g.status===401&&t.current.onUnauthorized?.())},[d.error,d.errorUpdatedAt]);let b=bg(()=>{d.refetch()},[d.refetch]),f=Li({recipient:e.recipient,wallet:e.wallet,trustedFactories:e.trustedFactories,onError:e.onError,onRecoverySuccess:e.onRecoverySuccess,onChanged:b}),m=d.data,y=bg(async(g,u)=>{m&&await f.recover(m,g,u)},[f,m]);return{info:m,loading:d.isLoading,error:d.error??void 0,isFetching:d.isFetching,refresh:b,recover:y,recoveryState:f.stateFor(m?.forwarder)}}import{Fragment as Yv,jsx as _r,jsxs as Qr}from"react/jsx-runtime";var _v={bscBridge:"https://bscscan.com/tx/",crossFinalize:"https://scan.crosstoken.io/tx/",crossExecute:"https://scan.crosstoken.io/tx/"},Qv={bscBridge:"Bridge tx (BSC)",crossFinalize:"Finalize tx (CROSS)",crossExecute:"Execute tx (CROSS)"};function Vv(e){return e==="done"?"\u2713":e==="active"?"\u25CF":""}function vg(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function qv(e){return e==="done"?"rd-stepper-item rd-stepper-item-done":e==="active"?"rd-stepper-item rd-stepper-item-active":"rd-stepper-item rd-stepper-item-pending"}function kg({orderId:e,order:t,error:r}){let n=!t&&!r;return Qr("section",{className:"rd-card",children:[Qr("div",{className:"rd-card-header",children:[_r("h2",{className:"rd-card-title",children:"4. Status"}),t&&_r("span",{className:`rd-status-pill${t.status==="COMPLETED"?" rd-status-pill-success":vg(t.status)?" rd-status-pill-failure":""}`,children:t.status})]}),Qr("p",{className:"rd-card-hint",children:["Order ",e]}),n&&Qr("p",{className:"rd-muted",children:[_r("span",{className:"rd-spinner"})," Loading status..."]}),r&&Qr("div",{className:"rd-callout rd-callout-danger",children:["Couldn't load order status: ",r.message]}),t&&Qr(Yv,{children:[_r("ol",{className:"rd-stepper",children:t.steps.map((o,i)=>Qr("li",{className:qv(o.status),children:[Qr("div",{className:"rd-stepper-rail",children:[_r("span",{className:"rd-stepper-dot",children:Vv(o.status)}),i<t.steps.length-1&&_r("span",{className:"rd-stepper-line"})]}),Qr("div",{className:"rd-stepper-body",children:[_r("div",{className:"rd-stepper-label",children:o.label}),o.key==="bridge"&&t.txs.bscBridge&&_r("div",{className:"rd-stepper-meta",children:_r(Nd,{orderTxs:t.txs,txKey:"bscBridge"})}),o.key==="deliver"&&(t.txs.crossFinalize||t.txs.crossExecute)&&Qr("div",{className:"rd-stepper-meta",children:[t.txs.crossFinalize&&_r(Nd,{orderTxs:t.txs,txKey:"crossFinalize"}),t.txs.crossExecute&&_r(Nd,{orderTxs:t.txs,txKey:"crossExecute"})]})]})]},o.key))}),vg(t.status)&&Qr("div",{className:"rd-callout rd-callout-danger",children:["This order did not complete successfully (status: ",t.status,"). If funds were deposited, refer to the refund address on the order for recovery."]}),t.status==="COMPLETED"&&_r("div",{className:"rd-callout rd-callout-success",children:"crossd delivered. This order is complete."})]})]})}function Nd({orderTxs:e,txKey:t}){let r=e[t];return r?Qr("a",{href:`${_v[t]}${r}`,target:"_blank",rel:"noreferrer",children:[Qv[t],": ",r.slice(0,10),"..."]}):null}function Ms(e){return`${e.chainId}:${e.address.toLowerCase()}`}function Td(e,t){return Ms(e)===Ms(t)}function Ls(e,t){if(t)return e.find(r=>Td(r,t))}function Bi(e,t,r){return t?{fromTokens:(r==="swap"?[t.swap.from]:t.bridge.from).map(o=>Ls(e,o)).filter(o=>!!o),targetToken:Ls(e,t.target)}:{fromTokens:[],targetToken:void 0}}function Ds(e,t){return e.some(r=>r.chainId===t.chainId&&r.address.toLowerCase()===t.address.toLowerCase())}function Rg(e){let t=/^v?(\d+(?:\.\d+)*)(?:-([0-9A-Za-z.-]+))?$/.exec(e.trim());return t?{parts:t[1].split(".").map(r=>Number(r)),prerelease:t[2]??null}:null}function Kv(e,t){let r=Rg(e),n=Rg(t);if(!r||!n)return null;let o=Math.max(r.parts.length,n.parts.length);for(let i=0;i<o;i+=1){let a=(r.parts[i]??0)-(n.parts[i]??0);if(a!==0)return a<0?-1:1}return r.prerelease===n.prerelease?0:r.prerelease===null?1:n.prerelease===null||r.prerelease<n.prerelease?-1:1}function Cg(e,t=oo){if(!e)return!0;let r=Kv(t,e);return r===null?!0:r>=0}var Sg={swap:"swap",bridge:"bridge",transfer:"transferCrypto"};function zi(e,t){return t?.[Sg[e]]??e!=="transfer"}function Fi(e,t){return Cg(t?.[Sg[e]])}function Ps(e,t,r){return zi(e,t)&&Fi(e,r)}var Ng={dev:"https://stg.oneusd.money/",stage:"https://stg.oneusd.money/",production:"https://www.oneusd.money/"};function Tg(e){let t=e.trim().toLowerCase().replace(/\.$/,"");return t==="oneusd.money"||t.endsWith(".oneusd.money")}function Ig(e,t){return e?.items?.find(({id:n,type:o})=>n.toLowerCase()==="oneusd"||o.toLowerCase()==="oneusd")?.url[t]}import*as Os from"react";function Eg(e){let[t,r]=Os.useState(null);return Os.useEffect(()=>{if(!e)return;let n=!0;return Cl().then(o=>{n&&r(o)}).catch(()=>{}),()=>{n=!1}},[e]),t}function Ag(e,t){return t==="bridge"?!0:e==="bridge"||e==="bridge-swap"||e==="swap-bridge"}function Zv(e){if(!e)return"";let[t="0",r=""]=e.replace(/,/g,"").split("."),o=(t.replace(/^0+(?=\d)/,"")||"0").replace(/\B(?=(\d{3})+(?!\d))/g,","),i=r.slice(0,6).replace(/0+$/,"");return i?`${o}.${i}`:o}function Xv(e){return e===56||e===97?"BSC":e===612044||e===612055||e===5555?"ONEchain":`Chain ${e}`}function Mg(e,t){return Ag(e.pathType,t)?"Bridging":"Swapping"}function Lg(e,t){let r=Zv(e.toAmount);if(Ag(e.pathType,t)){let n=`arriving on ${Xv(e.toToken.chainId)}`;return r?`${r} ${n}`:n}return r?`${r} Swapped`:"Transaction completed"}import{jsx as Vr,jsxs as Fg}from"react/jsx-runtime";function Dg(e){return Vr("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:Vr("path",{d:"m7 3-3 3 3 3M4 6h13a3 3 0 0 1 3 3v1M17 21l3-3-3-3m3 3H7a3 3 0 0 1-3-3v-1",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function Pg(e){return Fg("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[Vr("path",{d:"M10 13a4 4 0 0 0 5.66 0l2.83-2.83a4 4 0 0 0-5.66-5.66L11.4 5.94",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),Vr("path",{d:"M14 11a4 4 0 0 0-5.66 0L5.51 13.8a4 4 0 0 0 5.66 5.66l1.42-1.41",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Og(e){return Fg("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[Vr("rect",{x:"4",y:"4",width:"6",height:"6",rx:"1.4",stroke:"currentColor",strokeWidth:"1.7"}),Vr("rect",{x:"14",y:"4",width:"6",height:"6",rx:"1.4",stroke:"currentColor",strokeWidth:"1.7"}),Vr("rect",{x:"4",y:"14",width:"6",height:"6",rx:"1.4",stroke:"currentColor",strokeWidth:"1.7"}),Vr("path",{d:"M14 14h2v2h-2zM18 18h2v2h-2z",fill:"currentColor"})]})}function Bg(e){return Vr("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:Vr("path",{d:"m9 6 6 6-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function zg(e){return Vr("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:Vr("path",{d:"m6 6 12 12M18 6 6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}de(`.gou-fab{--gou-collapse-duration: .24s;--gou-collapse-ease: cubic-bezier(.32, .72, 0, 1);position:fixed;right:var(--gou-right, 2rem);bottom:calc(env(safe-area-inset-bottom,0px) + var(--gou-bottom, 2rem));z-index:var(--gou-z-index, 40);display:inline-flex;width:max-content;align-items:center;gap:8px;padding:4px 20px 4px 4px;border:0;border-radius:9999px;background:#fff;color:#121212;box-shadow:0 4px 20px #00000073;font:inherit;cursor:pointer;transition:gap var(--gou-collapse-duration) var(--gou-collapse-ease),padding var(--gou-collapse-duration) var(--gou-collapse-ease),transform .15s ease,background .15s ease;-webkit-tap-highlight-color:transparent}[data-theme=light] .gou-fab{background:#121212;color:#fff;box-shadow:0 4px 20px #00000040}.gou-fab:active:not(:disabled){transform:scale(.96)}.gou-fab:focus-visible{outline:3px solid #f3742e;outline-offset:3px}.gou-fab[data-icon-only=true]{gap:0;padding:0}.gou-fab:disabled{cursor:default}.gou-fab[data-trigger-mode=button]{position:relative;right:auto;bottom:auto;z-index:auto;vertical-align:middle}[data-gou-mode=button]{display:inline-block}.gou-fab-status{pointer-events:none;cursor:default}.gou-fab-icon-frame{position:relative;display:inline-flex;width:38px;height:38px;flex-shrink:0;border-radius:9999px;transition:width var(--gou-collapse-duration) var(--gou-collapse-ease),height var(--gou-collapse-duration) var(--gou-collapse-ease)}.gou-fab-icon{display:block;width:100%;height:100%;border-radius:inherit;object-fit:contain}.gou-fab[data-icon-only=true] .gou-fab-icon-frame{width:52px;height:52px}.gou-fab-progress-ring{position:absolute;inset:-2px;border:2px solid rgba(243,116,46,.25);border-top-color:#f3742e;border-radius:9999px;animation:gou-spin .9s linear infinite}.gou-fab-label{overflow:hidden;max-width:180px;opacity:1;font-size:14px;font-weight:600;line-height:1.5;white-space:nowrap;transition:max-width var(--gou-collapse-duration) var(--gou-collapse-ease),opacity calc(var(--gou-collapse-duration) * .6) var(--gou-collapse-ease)}.gou-fab[data-icon-only=true] .gou-fab-label{max-width:0;opacity:0}.gou-fab[data-tx-phase] .gou-fab-label{max-width:260px}.gou-fab-trigger-copy{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;line-height:1.25}.gou-fab-apr{color:var(--ds-system-orange-high, #ff7a3d);font-size:11px;font-weight:600;line-height:1.25}.gou-fab[data-tx-phase=success]{animation:gou-result-success 1.2s ease-out}.gou-fab[data-tx-phase=failure]{animation:gou-result-failure 1.2s ease-out}.gou-fab-dots>span{animation:gou-status-dot 1.4s ease-in-out infinite}.gou-fab-dots>span:nth-child(2){animation-delay:.2s}.gou-fab-dots>span:nth-child(3){animation-delay:.4s}.gou-tooltip{position:absolute;right:0;bottom:calc(100% + 8px);pointer-events:none;padding:6px 10px;border-radius:8px;background:#121212;color:#fff;box-shadow:0 8px 24px #0000002e;font-size:12px;font-weight:500;opacity:0;white-space:nowrap;transition:opacity .2s ease}[data-theme=dark] .gou-tooltip{background:#f5f5f5;color:#121212}.gou-fab:hover .gou-tooltip{opacity:1}.gou-shell{--ds-bg-default: #1c1c1d;--ds-bg-dim: #181819;--ds-surface-default: #1c1c1d;--ds-surface-medium: #212224;--ds-surface-high: rgba(255, 255, 255, .08);--ds-border-default: rgba(255, 255, 255, .1);--ds-content-highest: #ffffff;--ds-content-high: rgba(255, 255, 255, .85);--ds-content-medium: rgba(255, 255, 255, .65);--ds-content-low: rgba(255, 255, 255, .4);--ds-accent-primary-default: #f3742e;--ds-accent-primary-high: #f3742e;--ds-accent-primary-low: rgba(243, 116, 46, .1);--ds-accent-primary-on: #ffffff;--gou-bg: #1c1c1d;--gou-card: #212224;--gou-card-hover: rgba(255, 255, 255, .08);--gou-border: rgba(255, 255, 255, .1);--gou-text: #ffffff;--gou-muted: rgba(255, 255, 255, .65);background:var(--gou-bg);color:var(--gou-text)}.gou-shell[data-theme=light]{--ds-bg-default: #ffffff;--ds-bg-dim: #fafbfd;--ds-surface-default: #ffffff;--ds-surface-medium: rgba(0, 0, 0, .01);--ds-surface-high: rgba(0, 0, 0, .03);--ds-border-default: rgba(0, 0, 0, .06);--ds-content-highest: #000000;--ds-content-high: rgba(0, 0, 0, .85);--ds-content-medium: rgba(0, 0, 0, .65);--ds-content-low: rgba(0, 0, 0, .4);--gou-bg: #ffffff;--gou-card: #ffffff;--gou-card-hover: rgba(0, 0, 0, .03);--gou-border: rgba(0, 0, 0, .06);--gou-text: #000000;--gou-muted: rgba(0, 0, 0, .65)}.gou-chooser{overflow:hidden}.gou-chooser-body{position:relative;display:flex;flex-direction:column;gap:24px;padding:24px}.gou-close{position:absolute;top:16px;right:16px;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:transparent;color:var(--gou-muted);cursor:pointer}.gou-close:hover{background:var(--gou-card-hover);color:var(--gou-text)}.gou-close svg{width:20px;height:20px}.gou-intro{display:flex;flex-direction:column;gap:6px;padding:0 32px 0 0;text-align:left}.gou-intro h2{margin:0;color:var(--gou-text);font-size:20px;font-weight:650;line-height:1.6}.gou-intro-link{display:inline-flex;width:fit-content;align-items:center;gap:4px;color:var(--ds-accent-primary-default, #f3742e);font-size:14px;font-weight:600;line-height:1.5;text-decoration:none}.gou-intro-link-icon{flex-shrink:0}.gou-intro-link>span{text-decoration:underline;text-underline-offset:3px}.gou-intro-link:focus-visible{outline:2px solid #f3742e;outline-offset:3px;border-radius:4px}.gou-actions{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.gou-action{display:flex;width:100%;min-width:0;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--gou-border);border-radius:12px;background:var(--gou-card);color:var(--gou-text);font:inherit;text-align:left;cursor:pointer;transition:border-color .15s ease,background .15s ease}.gou-action:hover:not(:disabled){border-color:#f3742e;background:var(--gou-card-hover)}.gou-action:disabled{cursor:not-allowed;opacity:.5}.gou-action:focus-visible{outline:2px solid #f3742e;outline-offset:2px}.gou-action-icon{display:inline-flex;width:32px;height:32px;flex-shrink:0;align-items:center;justify-content:center;border:1px solid var(--gou-border);border-radius:9px;color:var(--gou-text);transition:border-color .15s ease,color .15s ease}.gou-action:hover:not(:disabled) .gou-action-icon{border-color:var(--ds-accent-primary-default, #f3742e);color:var(--ds-accent-primary-default, #f3742e)}.gou-action-icon svg{width:17px;height:17px}.gou-action-copy{display:flex;min-width:0;flex:1;flex-direction:column;gap:2px}.gou-action-title{display:flex;min-width:0;align-items:center;gap:6px;font-size:16px;font-weight:650}.gou-action-description{color:var(--gou-muted);font-size:14px;line-height:1.45}.gou-action-chevron{width:18px;height:18px;flex-shrink:0;color:var(--gou-muted)}.gou-badge{flex-shrink:0;padding:2px 6px;border-radius:5px;background:#f3742e24;color:#f3742e;font-size:10px;font-weight:650}.gou-badge[data-tone=muted]{background:var(--gou-card-hover);color:var(--gou-muted)}.gou-execution{height:auto;max-height:90dvh;overflow:hidden}.gou-execution .bf-root{width:100%;max-height:90dvh}.gou-connect-required,.gou-route-state{display:flex;min-height:360px;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px;text-align:center}.gou-connect-required h3,.gou-route-state h3{margin:0;color:var(--gou-text);font-size:18px}.gou-connect-required p,.gou-route-state p{max-width:320px;margin:0;color:var(--gou-muted);font-size:14px;line-height:1.5}.gou-lock{font-size:28px}.gou-connect-required button{width:100%;max-width:320px;margin-top:10px;padding:12px 16px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #001b18);font:inherit;font-size:16px;font-weight:650;cursor:pointer}.gou-spinner{width:28px;height:28px;border:3px solid var(--gou-border);border-top-color:var(--ds-accent-primary-default, #00ceb2);border-radius:9999px;animation:gou-spin .8s linear infinite}@keyframes gou-spin{to{transform:rotate(360deg)}}@keyframes gou-status-dot{0%,60%,to{opacity:.2}30%{opacity:1}}@keyframes gou-result-success{0%{outline:0 solid rgba(30,202,119,0)}30%{outline:3px solid rgba(30,202,119,.75)}to{outline:0 solid rgba(30,202,119,0)}}@keyframes gou-result-failure{0%{outline:0 solid rgba(255,60,83,0)}30%{outline:3px solid rgba(255,60,83,.75)}to{outline:0 solid rgba(255,60,83,0)}}@media(max-width:767px){.gou-fab{right:var(--gou-right-mobile, 1rem)}.gou-fab-icon-frame{width:32px;height:32px}.gou-fab[data-icon-only=true] .gou-fab-icon-frame{width:40px;height:40px}.gou-chooser-body{padding:24px 16px 28px}.gou-execution{height:auto;max-height:70dvh}.gou-execution .bf-root{max-height:calc(70dvh - 24px)}}@media(prefers-reduced-motion:reduce){.gou-fab,.gou-fab-icon-frame,.gou-fab-label,.gou-tooltip{transition:none}.gou-spinner,.gou-fab-progress-ring{animation-duration:1.6s}.gou-fab[data-tx-phase=success],.gou-fab[data-tx-phase=failure],.gou-fab-dots>span{animation:none}}
21
- `);import{Fragment as r2,jsx as je,jsxs as Ht}from"react/jsx-runtime";var Jv=[{id:"swap",label:"Swap",eta:"Instant",Icon:Dg},{id:"bridge",label:"Bridge",Icon:Pg},{id:"transfer",label:"Transfer Crypto",eta:"QR deposit",Icon:Og}],$v=4e3;function Ug(e){return e instanceof Error?e.message:typeof e=="string"?e:"Unknown error"}function Bs(e,t){try{e?.(t)}catch{}}function e2({compactTrigger:e,collapseOnScroll:t,scrollThreshold:r}){let[n,o]=qe.useState(!1);return qe.useEffect(()=>{if(t===!1){o(!1);return}let i=r??200,a=i+24,s=Math.max(0,i-24),l=0,d=window.scrollY>i;o(d);let c=()=>{l=0;let f=d?window.scrollY>s:window.scrollY>a;f!==d&&(d=f,o(f))},b=()=>{l||(l=requestAnimationFrame(c))};return window.addEventListener("scroll",b,{passive:!0}),()=>{l&&cancelAnimationFrame(l),window.removeEventListener("scroll",b)}},[t,r]),!!(e||n)}function t2({loading:e}){return Ht("div",{className:"gou-route-state",role:"status",children:[e&&je("span",{className:"gou-spinner","aria-hidden":"true"}),je("h3",{children:e?"Preparing route":"Route unavailable"}),je("p",{children:e?"Loading token and contract configuration.":"The configured ONEUSD route is not available in this environment."})]})}function jg({walletAddress:e,tokens:t,pairs:r,loading:n=!1,bridge:o,relay:i,env:a,targetSymbol:s,relayTargetSymbol:l="ONEUSD",targetIconUrl:d,mode:c="floating",buttonComponent:b,theme:f="dark",mobileBreakpoint:m=768,drawerDirection:y="bottom",dialogWidth:g="480px",drawerMaxWidth:u,drawerMinWidth:p,style:w,className:h,contentClassName:x,hidden:k=!1,compactTrigger:R,collapseOnScroll:I=!0,scrollThreshold:C=200,waitForTransaction:S,transactionResultDurationMs:E=$v,onRequestConnect:M,onEvent:B}){let[L,z]=qe.useState(!1),[A,U]=qe.useState(null),[oe,Y]=qe.useState(!1),[G,H]=qe.useState(null),[ie,te]=qe.useState(!1),O=qe.useRef(0),Z=qe.useRef(!1),_=qe.useRef(null),ce=qe.useRef(!0),xe=e2({compactTrigger:R,collapseOnScroll:I,scrollThreshold:C}),he=qe.useMemo(()=>ot(a),[a]),fe=Ut("apps.json",he,F=>F?.getOneUsd?.modes),ge=Ut("apps.json",he,F=>F?.getOneUsd?.minVersions),Ye=Ut("app-launcher-v2.json",he,F=>Ig(F,he))??Ng[he],be=qe.useMemo(()=>Jv.filter(({id:F})=>zi(F,fe)),[fe]),Te=be.length>0,it=Eg(!k&&Te),We=qe.useMemo(()=>Bi(t,r,"swap"),[r,t]),_e=qe.useMemo(()=>Bi(t,r,"bridge"),[r,t]),Be=We.targetToken??_e.targetToken,rt=s??Be?.symbol??"ONEUSD",Et=d??Be?.iconUrl??rd,ft=c==="floating"&&xe,Ct=c==="button"&&b?b:"button";qe.useEffect(()=>(ce.current=!0,()=>{ce.current=!1,_.current&&clearTimeout(_.current)}),[]),qe.useEffect(()=>{te(!Tg(window.location.hostname))},[]),qe.useEffect(()=>{Te||z(!1)},[Te]);let Se=qe.useCallback(F=>B?.(F),[B]),wt=qe.useCallback(()=>{G||!Te||(Se({name:"fab_click",state:ft?"icon_only":"expanded"}),z(!0))},[Se,Te,G,ft]),yt=qe.useCallback(F=>{G||!Ps(F,fe,ge)||(Se({name:"action_select",action:F}),z(!1),F==="transfer"&&Y(!0),U(F))},[Se,fe,ge,G]),St=qe.useCallback(F=>{Se({name:"connect_click",action:F}),Promise.resolve(M?.()).catch(ke=>{Se({name:"failure",action:F,message:Ug(ke)})})},[Se,M]),Ke=A==="swap"||A==="bridge"?A:null,Xe=Ke==="swap"?We:_e,$t=!!(r&&Xe.targetToken&&Xe.fromTokens.length>0),At=qe.useMemo(()=>{if(!Xe.targetToken)return;let F=Xe.targetToken;return ke=>{let P=o.getToTokens?.(ke,t);return P&&!Ds(P,F)?[]:[F]}},[o.getToTokens,Xe.targetToken,t]),{onSubmitted:zt,onSuccess:Mt,onFailed:nt,...Ge}=o,{onDeposited:at,onError:Nt,...Pe}=i??{},st=qe.useCallback((F,ke,P,ae,pe)=>{!ce.current||O.current!==F||(H({id:F,phase:ke,action:P,label:ae,txHash:pe}),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{!ce.current||O.current!==F||(Z.current=!1,H(null),_.current=null)},Math.max(0,E)))},[E]),_t=qe.useCallback((F,ke)=>{if(Z.current)return;Z.current=!0;let P=++O.current,ae=Mg(F,ke);H({id:P,phase:"pending",action:ke,label:ae,txHash:F.txHash}),z(!1),U(null),Bs(zt,F),Promise.resolve().then(()=>S?.(F)).then(()=>{!ce.current||O.current!==P||(st(P,"success",ke,Lg(F,ke),F.txHash),Se({name:"success",action:ke,txHash:F.txHash}))}).catch(pe=>{if(!ce.current||O.current!==P)return;let me=Ug(pe);st(P,"failure",ke,"Transaction failed",F.txHash),Bs(nt,{message:me,txHash:F.txHash}),Se({name:"failure",action:ke,message:me})})},[Se,nt,zt,st,S]);return je(ye,{feature:"get_one_usd",children:Ht("div",{className:h,"data-theme":f,"data-gou-mode":c,children:[Ht(An,{theme:f,mobileBreakpoint:m,drawerDirection:y,dialogWidth:g,drawerMaxWidth:u,drawerMinWidth:p,open:L,onOpenChange:z,children:[!k&&Te&&(c==="button"||!G)&&Ht(Ct,{type:"button",className:"gou-fab",style:w,"data-trigger-mode":c,"data-icon-only":ft?"true":"false",onClick:wt,disabled:!!G,"aria-label":`Get ${rt}`,"data-track":"fab_click",children:[c==="floating"&&Ht("span",{className:"gou-tooltip",children:["Choose how to get ",rt]}),je("span",{className:"gou-fab-icon-frame",children:je("img",{className:"gou-fab-icon",src:Et,alt:""})}),Ht("span",{className:"gou-fab-label gou-fab-trigger-copy",children:[Ht("span",{children:["Get ",rt]}),it!==null&&je("span",{className:"gou-fab-apr",children:Ma(it)})]})]}),G&&Ht("div",{className:"gou-fab gou-fab-status",style:c==="floating"?w:void 0,"data-floating-status":"true","data-icon-only":"false","data-tx-phase":G.phase,role:"status","aria-live":"polite","aria-label":G.phase==="pending"?`${G.label} transaction in progress`:G.label,children:[Ht("span",{className:"gou-fab-icon-frame",children:[je("img",{className:"gou-fab-icon",src:Et,alt:""}),G.phase==="pending"&&je("span",{className:"gou-fab-progress-ring","aria-hidden":"true"})]}),je("span",{className:"gou-fab-label",children:G.phase==="pending"?Ht(r2,{children:[G.label,Ht("span",{className:"gou-fab-dots","aria-hidden":"true",children:[je("span",{children:"."}),je("span",{children:"."}),je("span",{children:"."})]})]}):G.label})]}),je(Mn,{ariaTitle:`Get ${rt}`,className:`gou-shell gou-chooser ${x??""}`,children:Ht("div",{className:"gou-chooser-body",children:[je("button",{type:"button",className:"gou-close",onClick:()=>z(!1),"aria-label":"Close",children:je(zg,{})}),Ht("header",{className:"gou-intro",children:[Ht("h2",{children:["Get ",rt]}),ie&&Ht("a",{className:"gou-intro-link",href:Ye,target:"_blank",rel:"noopener noreferrer","aria-label":"What is ONEUSD? Opens in a new tab","data-track":"oneusd_learn_more",children:[je(Gp,{size:16,className:"gou-intro-link-icon"}),je("span",{children:"What is ONEUSD?"})]})]}),je("ul",{className:"gou-actions",children:be.map(({id:F,label:ke,eta:P,Icon:ae})=>{let pe=F==="swap"?`Swap the ${We.fromTokens[0]?.symbol??"ONE"} you already hold`:F==="bridge"?`Bridge USDT to ${rt}`:"Deposit from any chain or exchange",me=F==="swap"?r?.swap.feeDelegated:F==="bridge"?r?.bridge.feeDelegated:!1,Je=Fi(F,ge);return je("li",{children:Ht("button",{type:"button",className:"gou-action",onClick:()=>yt(F),disabled:!Je,"data-supported":Je?"true":"false","data-track":"action_select","data-track-id":F,children:[je("span",{className:"gou-action-icon",children:je(ae,{})}),Ht("span",{className:"gou-action-copy",children:[Ht("span",{className:"gou-action-title",children:[je("span",{children:ke}),me&&Je&&je("span",{className:"gou-badge",children:"Fee Delegated"}),!Je&&je("span",{className:"gou-badge","data-tone":"muted",children:"Update required"})]}),je("span",{className:"gou-action-description",children:Je?P?`${pe} \xB7 ${P}`:pe:"Update the app to use this option"})]}),je(Bg,{className:"gou-action-chevron"})]})},F)})})]})})]}),je(An,{theme:f,mobileBreakpoint:m,drawerDirection:y,dialogWidth:g,drawerMaxWidth:u,drawerMinWidth:p,open:!!Ke,onOpenChange:F=>{F||U(null)},children:je(Mn,{ariaTitle:`${Ke==="bridge"?"Bridge":"Swap"} to ${rt}`,className:`gou-shell gou-execution ${x??""}`,children:$t?je(Go,{...Ge,env:a,variant:"embedded",title:Ke==="bridge"?"Bridge":"Swap",feeDelegated:r?.swap.feeDelegated,walletAddress:e??"",isConnected:!!e,onRequestConnect:()=>St(Ke??"swap"),tokens:Xe.fromTokens,initialFromToken:Xe.fromTokens[0],initialToToken:Xe.targetToken,getToTokens:At,onClose:()=>U(null),onBackToWallet:()=>{U(null),z(!0)},onSubmitted:F=>{_t(F,Ke??"swap")},onSuccess:F=>{Bs(Mt,F)},onFailed:F=>{Bs(nt,F),Se({name:"failure",action:Ke??"swap",message:F.message})}},`${Ke}:${Xe.fromTokens.map(F=>`${F.chainId}:${F.address}`).join(",")}`):je(t2,{loading:n||!r})})}),oe&&je(Oi,{...Pe,environment:Pe.environment??a,theme:Pe.theme??f,mobileBreakpoint:Pe.mobileBreakpoint??m,drawerDirection:Pe.drawerDirection??y,dialogWidth:Pe.dialogWidth??g,drawerMaxWidth:Pe.drawerMaxWidth??u,drawerMinWidth:Pe.drawerMinWidth??p,walletAddress:e,open:A==="transfer",onOpenChange:F=>{F||U(null)},requireWalletConnection:!0,showRecovery:Pe.showRecovery??!0,showRecipientInput:!1,hideAmount:!0,targetTokens:[l],defaultTarget:l,onRequestConnect:()=>St("transfer"),onDeposited:F=>{at?.(F),Se({name:"success",action:"transfer",txHash:F})},onError:F=>{Nt?.(F),Se({name:"failure",action:"transfer",message:F.message})},children:je(Oi.Content,{})})]})})}import*as yn from"react";import*as Kg from"@radix-ui/react-dialog";import{Drawer as u2}from"vaul";import{createContext as n2,useContext as o2}from"react";var zs=n2(null);function Ui(){let e=o2(zs);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}import{useState as Wg,useEffect as i2,useCallback as a2}from"react";function Fs(){let[e,t]=Wg([]),[r,n]=Wg(!0);i2(()=>{if(typeof window>"u"){n(!1);return}let i=[],a=l=>{let{info:d}=l.detail;d?.rdns&&!i.some(c=>c.rdns===d.rdns)&&(i.push({rdns:d.rdns,name:d.name,icon:d.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let s=setTimeout(()=>n(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(s)}},[]);let o=a2(i=>e.some(a=>a.rdns===i),[e]);return{wallets:e,isDetected:o,isLoading:r}}import*as Gg from"@radix-ui/react-dialog";import{Drawer as s2}from"vaul";import{jsx as Id}from"react/jsx-runtime";function Hg({asChild:e,children:t}){let{isMobile:r}=Ui(),n=r?s2.Trigger:Gg.Trigger;return Id(ye,{feature:"wallet_connect",children:Id(n,{asChild:e??t!=null,children:t??Id("button",{type:"button","data-track":"open",children:"Connect Wallet"})})})}import{useEffect as l2}from"react";import{WALLET_LABELS as d2}from"@nexus-cross/crossx-design-system";import*as wn from"@radix-ui/react-dialog";import{Drawer as Us}from"vaul";import{Fragment as qg,jsx as Ce,jsxs as or}from"react/jsx-runtime";function _g(e,t){Qe("connect","wallet_selected",{tags:{item_id:e}}),Lp(e);let r=t?.();r instanceof Promise&&r.then(()=>Qe("connect","connected"),n=>Qe("connect","connected",{status:"failure",reason:Cr(n)}))}function c2({wallet:e,detected:t,onConnect:r}){let n=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}r()},o=e.icon,i=e.featured===!0;return or("button",{type:"button",className:Re("wcm-wallet-item",i&&"wcm-wallet-item--featured"),"data-track":"wallet_item_click","data-track-id":e.id,onClick:n,children:[or("div",{className:"wcm-wallet-item-left",children:[Ce("div",{className:"wcm-wallet-icon",children:Ce(o,{})}),or("div",{className:"wcm-wallet-name-row",children:[Ce("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&Ce("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?Ce("span",{className:"wcm-installed-label",children:"Installed"}):Ce("span",{className:"wcm-install-btn",children:"Install"}))]})}function p2({social:e,onSignIn:t}){let r=e.icon,n=`Sign in with ${e.name}`;return or("button",{type:"button",className:"wcm-social-item","data-provider":e.id,"data-track":"social_provider_click","data-track-id":e.id,onClick:t,"aria-label":n,children:[Ce("span",{className:"wcm-social-icon",children:Ce(r,{})}),Ce("span",{className:"wcm-social-name",children:n})]})}function Qg(){let{wallets:e,activeWalletIds:t,socialProviders:r,activeSocialIds:n,termsUrl:o,privacyUrl:i,isDetected:a,close:s,isMobile:l}=Ui(),d=t.filter(f=>{let m=Tl(f).visibility;return!m||m==="always"?!0:m==="desktop-only"?!l:m==="mobile-only"?l:!0}),c=n.length>0,b=d.length>0;return or(qg,{children:[or("div",{className:"wcm-header",children:[or("div",{className:"wcm-header-text",children:[Ce("h2",{className:"wcm-title",children:d2.default}),!l&&Ce("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),Ce("button",{type:"button",className:"wcm-close-btn","data-track":"close",onClick:s,"aria-label":"Close",children:Ce(Ep,{})})]}),or("div",{className:"wcm-body",children:[c&&or(qg,{children:[!l&&or("div",{className:"wcm-section-header",children:[Ce("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),Ce("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),Ce("div",{className:"wcm-social-grid",children:n.map(f=>{let m=Ap(f);return Ce(p2,{social:m,onSignIn:()=>{_g(f,r[f]),s()}},f)})}),b&&or("div",{className:"wcm-separator",children:[Ce("div",{className:"wcm-separator-line"}),Ce("span",{className:"wcm-separator-text",children:"Other Wallets"}),Ce("div",{className:"wcm-separator-line"})]})]}),b&&Ce("div",{className:"wcm-wallet-list",children:d.map(f=>{let m=Tl(f),y=m.rdns?a(m.rdns):!1;return Ce(c2,{wallet:m,detected:y,onConnect:()=>{_g(f,e[f]),s()}},f)})}),or("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",Ce(Vg,{href:o,track:"terms_link",children:"Terms of Service"})," ","and consent to its"," ",Ce(Vg,{href:i,track:"privacy_link",children:"Privacy Policy"}),"."]})]})]})}function Vg({href:e,track:t,children:r}){return e?Ce("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer","data-track":t,children:r}):Ce("span",{className:"wcm-terms-link",children:r})}function Yg({className:e}){let{isMobile:t,theme:r,portalStyle:n,open:o}=Ui();return l2(()=>{o&&Qe("connect","opened")},[o]),t?Ce(ye,{feature:"wallet_connect",children:or(Us.Portal,{children:[Ce(Us.Overlay,{className:"wcm-overlay"}),or(Us.Content,{className:Re("wcm-drawer-content",e),"data-theme":r,style:n,children:[Ce(Us.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),Ce("div",{className:"wcm-drawer-handle"}),Ce("div",{className:"wcm-drawer-body",children:Ce(Qg,{})})]})]})}):Ce(ye,{feature:"wallet_connect",children:or(wn.Portal,{children:[Ce(wn.Overlay,{className:"wcm-overlay"}),or(wn.Content,{className:Re("wcm-dialog-content",e),"data-theme":r,style:n,children:[Ce(wn.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),Ce(wn.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),Ce("div",{className:"wcm-dialog-body",children:Ce(Qg,{})})]})]})})}de(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:var(--ds-overlay-dim, rgba(0, 0, 0, .5));-webkit-backdrop-filter:var(--ds-bg-blur-7, blur(3.5px));backdrop-filter:var(--ds-bg-blur-7, blur(3.5px))}.wcm-dialog-content{-webkit-font-smoothing:antialiased;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--wcm-dialog-width, 480px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-radius:24px;box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));outline:none;animation:wcm-dialog-show .2s ease-out;font-family:inherit}.wcm-dialog-content[data-state=closed]{animation:wcm-dialog-hide .15s ease-in}.wcm-dialog-body,.wcm-drawer-body{scrollbar-width:thin;scrollbar-color:var(--ds-border-medium, rgba(0, 0, 0, .18)) transparent}.wcm-dialog-body::-webkit-scrollbar,.wcm-drawer-body::-webkit-scrollbar{width:4px}.wcm-dialog-body::-webkit-scrollbar-track,.wcm-drawer-body::-webkit-scrollbar-track{background:transparent}.wcm-dialog-body::-webkit-scrollbar-thumb,.wcm-drawer-body::-webkit-scrollbar-thumb{background:var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:4px}.wcm-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--wcm-drawer-max-width, none);min-width:var(--wcm-drawer-min-width, 0);max-height:85dvh;margin:0 auto;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-top-left-radius:16px;border-top-right-radius:16px;outline:none;font-family:inherit;box-sizing:border-box}.wcm-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:16px 0 0 16px}.wcm-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:0 16px 16px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--ds-border-medium, rgba(0, 0, 0, .18));margin:12px auto 8px;flex-shrink:0}.wcm-drawer-content[data-vaul-drawer-direction=left] .wcm-drawer-handle,.wcm-drawer-content[data-vaul-drawer-direction=right] .wcm-drawer-handle{display:none}.wcm-dialog-body,.wcm-drawer-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.wcm-drawer-body{overscroll-behavior:contain}.wcm-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-header-text{display:flex;flex-direction:column;gap:4px;min-width:0}.wcm-title{font-family:Inter,sans-serif;font-weight:600;font-size:20px;line-height:1.25;letter-spacing:0;color:var(--ds-content-highest, #000000);margin:0}.wcm-subtitle{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));margin:0}.wcm-close-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border:none;background:transparent;color:var(--ds-content-low, #00000066);cursor:pointer;padding:0;transition:opacity .15s ease}.wcm-close-btn:hover{opacity:.6}.wcm-close-btn>svg{width:24px;height:24px}.wcm-divider{display:none}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:24px}.wcm-section-header{display:flex;align-items:center;gap:8px;width:100%}.wcm-section-title{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1;letter-spacing:0;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-recommended-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-low, #fff5ee);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-high, #f0640d);white-space:nowrap}.wcm-social-grid{display:grid;gap:8px;width:100%}.wcm-dialog-body .wcm-social-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wcm-drawer-body .wcm-social-grid{grid-template-columns:1fr}.wcm-social-item{display:flex;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;transition:none;font-family:inherit;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-social-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-social-item:hover{background:#eff3f8!important}.wcm-social-item[data-provider=apple] .wcm-social-icon{color:#000}[data-theme=dark] .wcm-social-item[data-provider=apple] .wcm-social-icon{color:#fff}.wcm-dialog-body .wcm-social-item{flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px}.wcm-drawer-body .wcm-social-item{flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;padding:16px}.wcm-social-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.wcm-social-icon>svg{width:32px;height:32px}.wcm-social-name{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:12px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-separator-text{font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-wallet-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:20px 16px;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;text-align:left;transition:none;font-family:inherit}.wcm-wallet-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-wallet-item:hover{background:#eff3f8!important}.wcm-wallet-item-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg,.wcm-wallet-icon>img{width:28px;height:28px;border-radius:0;object-fit:cover}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px;min-width:0}.wcm-wallet-name{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-system-purple-low, #f5f3ff);border:.5px solid var(--ds-system-purple-default, #7e54f4);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-purple-high, #7346f3);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:#ff8438;border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:#fff;white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-terms{font-family:Inter,sans-serif;font-weight:400;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;margin:0}.wcm-terms-link{color:var(--ds-content-high, rgba(0, 0, 0, .85));text-decoration:underline;text-underline-position:from-font}.wcm-terms-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));text-decoration:underline}.wcm-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
20
+ `);import{jsx as Gr,jsxs as Ns}from"react/jsx-runtime";var _m=24;function Qm(e){return e instanceof HTMLElement&&e.matches("input, textarea, select")}function ev(e,t,r){let n=r?.offsetTop??t.top,o=r?r.offsetTop+r.height:t.bottom,i=Math.max(t.top,n)+_m,a=Math.min(t.bottom,o)-_m;return e.top<i?e.top-i:e.bottom>a?e.bottom-a:0}function tv(){let e=It.useRef(0),[t,r]=It.useState({keyboardHeight:0,keyboardOverlap:0,viewportHeight:0});return It.useEffect(()=>{let n=window.visualViewport;if(!n)return;let o=()=>{let i=Math.max(window.innerHeight,document.documentElement.clientHeight);e.current=Math.max(e.current,i,n.height+n.offsetTop);let a=Math.max(0,e.current-n.height-n.offsetTop),s=Math.max(0,e.current-i),l=Math.max(0,a-s),d=n.height;r(c=>c.keyboardHeight===a&&c.keyboardOverlap===l&&c.viewportHeight===d?c:{keyboardHeight:a,keyboardOverlap:l,viewportHeight:d})};return o(),n.addEventListener("resize",o),n.addEventListener("scroll",o),()=>{n.removeEventListener("resize",o),n.removeEventListener("scroll",o)}},[]),t}function rv(e){let t=`(max-width: ${e}px)`,[r,n]=It.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(t).matches);return It.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia(t);n(o.matches);let i=a=>n(a.matches);return o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[t]),r}function An({theme:e="dark",mobileBreakpoint:t=768,drawerDirection:r="bottom",dialogWidth:n,drawerMaxWidth:o,drawerMinWidth:i,style:a,open:s,onOpenChange:l,children:d}){let c=rv(t),[b,f]=It.useState(!1),m=s!==void 0,y=m?s:b,g=It.useCallback(h=>{m||f(h),l?.(h)},[m,l]);Ln(y,It.useCallback(()=>g(!1),[g]));let u=It.useMemo(()=>{let h={};return n&&(h["--rd-dialog-width"]=n),o&&(h["--rd-drawer-max-width"]=o),i&&(h["--rd-drawer-min-width"]=i),{...h,...a}},[n,o,i,a]),p=It.useMemo(()=>({open:y,setOpen:g,isMobile:c,theme:e,drawerDirection:r,portalStyle:u}),[y,g,c,e,r,u]),w=Gr("div",{"data-theme":e,style:u,children:d});return c?Gr(ps.Provider,{value:p,children:Gr(Zo.Root,{direction:r,open:y,onOpenChange:g,noBodyStyles:!0,children:w},"drawer")}):Gr(ps.Provider,{value:p,children:Gr(kr.Root,{open:y,onOpenChange:g,children:w})})}function Xo({asChild:e,children:t,dataAttributes:r}){let{isMobile:n}=an(),o=n?Zo.Trigger:kr.Trigger;return Gr(o,{asChild:e,...r,children:t})}function Mn({className:e,ariaTitle:t,children:r}){let{open:n,isMobile:o,theme:i,drawerDirection:a,portalStyle:s}=an(),{keyboardHeight:l,keyboardOverlap:d,viewportHeight:c}=tv(),b=To(),f=It.useRef(null),m=It.useRef(null);It.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),It.useEffect(()=>{m.current&&clearTimeout(m.current);let p=document.activeElement;!n&&Qm(p)&&f.current?.contains(p)&&p.blur(),f.current?.querySelectorAll("[data-rd-scroll-area]").forEach(w=>{w.scrollTo?.({top:0,behavior:"auto"})})},[n]);let y=o&&a==="bottom"&&l>0,g=y?{bottom:d,maxHeight:`min(85dvh, calc(${c}px - env(safe-area-inset-top, 0px)))`}:void 0,u=It.useCallback(p=>{if(!o||a!=="bottom"||!Qm(p.target))return;let w=p.target,h=w.closest("[data-rd-scroll-area]");h&&(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{let x=ev(w.getBoundingClientRect(),h.getBoundingClientRect(),window.visualViewport);Math.abs(x)>=1&&h.scrollBy?.({top:x,behavior:"auto"}),m.current=null},280))},[a,o]);return o?Ns(Zo.Portal,{children:[Gr(Zo.Overlay,{className:"rd-overlay"}),Ns(Zo.Content,{ref:f,className:Re("rd-drawer-content",e),"data-theme":i,"data-rd-shell":"drawer","data-rd-in-app":b?"true":"false","data-rd-keyboard-adjusted":y?"true":"false",style:{...s,...g},onFocusCapture:u,children:[Gr(Zo.Title,{className:"rd-sr-only",children:t}),Gr("div",{className:"rd-drawer-handle"}),r]})]}):Ns(kr.Portal,{children:[Gr(kr.Overlay,{className:"rd-overlay"}),Ns(kr.Content,{className:Re("rd-dialog-content",e),"data-theme":i,"data-rd-shell":"dialog",style:s,children:[Gr(kr.Title,{className:"rd-sr-only",children:t}),Gr(kr.Description,{className:"rd-sr-only",children:t}),r]})]})}import{Fragment as iv,jsx as Oe,jsxs as Ir}from"react/jsx-runtime";function nv({id:e,activeView:t,recoverableCount:r,onChange:n}){let o=["deposit","history","recover"];return Oe("div",{className:"rd-deposit-tabs",role:"tablist","aria-label":"Deposit navigation","data-tab-count":o.length,"data-active-index":o.indexOf(t),children:o.map(i=>{let a=i==="deposit"?"Deposit":i==="history"?"History":"Recover";return Ir("button",{type:"button",id:`${e}-${i}-tab`,className:"rd-deposit-tab",role:"tab","aria-selected":t===i,"aria-controls":`${e}-${i}-panel`,tabIndex:t===i?0:-1,"data-active":t===i?"true":"false","data-track":`${i}_tab`,onClick:()=>n(i),onKeyDown:s=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(s.key))return;s.preventDefault();let l=o.indexOf(i),d=s.key==="Home"?0:s.key==="End"?o.length-1:(l+(s.key==="ArrowRight"?1:-1)+o.length)%o.length,c=o[d];n(c),document.getElementById(`${e}-${c}-tab`)?.focus()},children:[Oe("span",{children:a}),i==="recover"&&r>0&&Oe("span",{className:"rd-recovery-badge","data-testid":"recovery-badge",children:r})]},i)})})}function qm({className:e}){let t=Ci();return Oe(ye,{feature:"relay",children:Oe(Mn,{ariaTitle:"Deposit",className:["rd-deposit-shell",e??t.className].filter(Boolean).join(" "),children:Oe(ov,{})})})}function ov(){let e=Ci(),{theme:t}=an(),r=um(),n=Vm.useId();if(!r)return null;let{activeView:o,setActiveView:i,recoveryOpen:a,resolvedApiBaseUrl:s,wallet:l,catalog:d,catalogLoading:c,catalogError:b,origin:f,setOrigin:m,amount:y,setAmount:g,recipient:u,setRecipient:p,recipientValid:w,balance:h,balanceLoading:x,insufficientBalance:k,depositAddress:R,depositAddressLoading:I,depositAddressError:C,arrivalStatus:S,quote:E,quoteLoading:M,quoteError:B,canDeposit:L,deposit:z,depositState:A,targetOptions:U,selectedTarget:oe,setSelectedTarget:Y,showAmountInput:G,minNotice:H,showRecipientInput:ie,showTargetSelector:te,showOneClick:O,showConnectPrompt:Z,showRecipientHint:_,canRecover:ce,recoverableCount:xe,recoveryTargetsLoading:he,recoveryTargets:fe,recoveryOrders:ge,historyOrdersLoading:we,historyOrdersError:Ye,refreshRecovery:be,trustedFactories:Te,amountHint:it,amountSmallestUnits:We,onMax:_e}=r;return Ir("div",{className:"rd-root rd-wizard","data-theme":t,"data-rd-scroll-area":!0,children:[Oe(nv,{id:n,activeView:o,recoverableCount:xe,onChange:i}),a&&Oe("div",{className:"rd-deposit-tab-panel",id:`${n}-recover-panel`,role:"tabpanel","aria-labelledby":`${n}-recover-tab`,children:ce?Oe(Ss,{client:e.client,apiBaseUrl:s,recipient:u,target:oe?.symbol,wallet:l,trustedFactories:Te,targets:(d?.targets.length??0)>0?fe:void 0,targetsLoading:he,orders:ge,onRecovered:be,onRecoverySuccess:e.onRecoverySuccess,onError:e.onError,showTitle:!1}):Ir("div",{className:"rd-recover-empty",role:"status","data-variant":"unavailable","data-testid":"rd-recovery-unavailable-note",children:[Oe("span",{className:"rd-recover-empty-icon","aria-hidden":"true",children:Ir("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",focusable:"false",children:[Oe("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2.5",stroke:"currentColor",strokeWidth:"1.7"}),Oe("path",{d:"M8 10V7.5a4 4 0 0 1 8 0V10",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),Oe("circle",{cx:"12",cy:"15",r:"1.2",fill:"currentColor"})]})}),Oe("h3",{className:"rd-recover-empty-title",children:"Recovery unavailable"}),Oe("p",{className:"rd-recover-empty-copy",children:"Connect a wallet that supports recovery transactions to continue."})]})}),o==="history"&&Oe("div",{className:"rd-deposit-tab-panel",id:`${n}-history-panel`,role:"tabpanel","aria-labelledby":`${n}-history-tab`,children:w&&u.trim()?Oe(ys,{orders:ge,isLoading:c||we,error:b??Ye,catalog:d,showTitle:!1}):Oe(Ei,{requiresIdentity:!0})}),o==="deposit"&&Ir("div",{className:"rd-deposit-tab-panel",id:`${n}-deposit-panel`,role:"tabpanel","aria-labelledby":`${n}-deposit-tab`,children:[c&&Ir("div",{className:"rd-skeleton-form","data-testid":"rd-source-skeleton","aria-hidden":"true",children:[Oe(gs,{}),Z&&e.onRequestConnect&&Oe("span",{className:"rd-skeleton rd-skeleton-cta"}),Ir("section",{className:"rd-stack",children:[Ir("div",{className:"rd-field",children:[Oe("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"18%"}}),Ir("div",{className:"rd-field-row",children:[Oe("span",{className:"rd-skeleton rd-skeleton-field"}),Oe("span",{className:"rd-skeleton rd-skeleton-field"})]})]}),G&&Ir("div",{className:"rd-field",children:[Oe("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"34%"}}),Oe("span",{className:"rd-skeleton rd-skeleton-field"})]})]}),Ir("div",{className:"rd-field",children:[Oe("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"24%"}}),Oe("span",{className:"rd-skeleton rd-skeleton-field"}),(ie||u.trim().length>0)&&Ir(iv,{children:[Oe("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"58%",marginTop:"0.5rem"}}),Oe("span",{className:"rd-skeleton rd-skeleton-field"}),ie&&Oe("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"82%"}})]})]}),Oe("span",{className:"rd-skeleton rd-skeleton-notice"})]}),c&&Oe("p",{className:"rd-sr-only",role:"status",children:"Loading deposit options..."}),b&&Ir("div",{className:"rd-callout rd-callout-danger",children:["Failed to load configuration: ",b.message]}),_&&Oe("div",{className:"rd-callout rd-callout-muted",children:ie?"Connect a wallet or provide a recipient address to fetch your deposit address.":"Connect a wallet to fetch your deposit address."}),d&&f&&Oe(Tm,{catalog:d,origin:f,onChangeOrigin:m,amount:y,onChangeAmount:g,showAmountInput:G,minNotice:H,amountHint:it,onMax:_e,recipient:u,onChangeRecipient:p,showRecipientInput:ie,recipientValid:w,balance:h,balanceLoading:x,insufficientBalance:k,targetOptions:U,selectedTarget:oe,onChangeTarget:Y,showTargetSelector:te,quote:E,quoteLoading:M,quoteError:B,depositAddress:R,depositAddressLoading:I,depositAddressError:C,arrivalStatus:S,amountSmallestUnits:We,depositState:A,onDeposit:()=>{z()},canDeposit:L&&O,oneClickEnabled:O,locked:Z,onRequestConnect:e.onRequestConnect})]})]})}import{jsx as fd}from"react/jsx-runtime";function Ym({asChild:e,children:t}){return fd(ye,{feature:"relay",children:fd(Xo,{asChild:e??t!=null,children:t??fd("button",{type:"button","data-track":"open",children:"Deposit"})})})}import*as Ne from"react";import{useCallback as Pi,useEffect as Xn,useMemo as md,useRef as gd,useState as ht}from"react";import{useEffect as av,useState as sv}from"react";function Km(e,t){let[r,n]=sv(e);return av(()=>{let o=setTimeout(()=>n(e),t);return()=>clearTimeout(o)},[e,t]),r}var lv=500,Xm=56,Zm={chainId:Xm,token:"0x55d398326f99059fF775485246999027B3197955"},Jm=3e4,dv=5e3;function cv(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?Jm:Math.max(dv,e*1e3)}var pv=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];function hd(e,t){let r=e.trim();if(!r)return null;try{let n=us(r,t);return n>0n?n:null}catch{return null}}function $m(e={}){let t=gd(e);t.current=e;let r=md(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useDepositAddress: either `client` or `apiBaseUrl` must be provided");return Gt({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.wallet,o=n?.walletAddress,i=!!o,a=n?.walletChainId,[s,l]=ht(),[d,c]=ht(!0),[b,f]=ht();Xn(()=>{let X=!1;return c(!0),r.getConfig().then(Ee=>{X||(l(Ee),f(void 0))}).catch(Ee=>{X||f(Ee instanceof Error?Ee:new Error(String(Ee)))}).finally(()=>{X||c(!1)}),()=>{X=!0}},[r]);let m=e.chains,y=md(()=>{if(!s)return[];if(!m||m.length===0)return s.origins;let X=new Set(m);return s.origins.filter(Ee=>X.has(Ee.chainId))},[s,m]),g=md(()=>s?{...s,origins:y}:void 0,[s,y]),[u,p]=ht();Xn(()=>{if(u||y.length===0)return;let X=t.current.defaultToken,Ee=X?y.find(j=>j.chainId===X.chainId&&j.token.address.toLowerCase()===X.address.toLowerCase()):void 0;p(Ee??y[0])},[y,u]);let[w,h]=ht(),x=Pi(()=>{Ge(void 0),st(!1),F(!1),P(!1),Nt(void 0)},[]),k=Pi(X=>{p(X),h(void 0),x()},[x]),R=u?.kind==="svm",[I,C]=ht(""),S=e.amount!==void 0?e.amount:I,E=Pi(X=>{C(X),h(void 0),x()},[x]),M=Km(S,lv),B=u?hd(M,u.token.decimals):null,L=u?hd(S,u.token.decimals):null,[z,A]=ht(""),[U,oe]=ht(!1),Y=e.recipient!==void 0?e.recipient:z,G=Pi(X=>{A(X),oe(!0),h(void 0),x()},[x]);Xn(()=>{e.recipient===void 0&&o&&!U&&A(o)},[o,U,e.recipient]);let H=Y.length===0||dt(Y),ie=Y.length>0&&dt(Y)?Y:void 0,[te,O]=ht(),[Z,_]=ht(!1),[ce,xe]=ht(0),he=n?.getBalance;Xn(()=>{if(!he||!o||!u||R){O(void 0),_(!1);return}let X=!1;_(!0);let Ee=u.token.address.toLowerCase()===Si?void 0:u.token.address;return he({chainId:u.chainId,address:o,token:Ee}).then(j=>{X||O({...j,formatted:Wt(j.value,j.decimals)})}).catch(()=>{X||O(void 0)}).finally(()=>{X||_(!1)}),()=>{X=!0}},[he,o,u,R,ce]);let fe=te?.value??null,ge=!R&&L!==null&&fe!==null&&L>fe,[we,Ye]=ht(),[be,Te]=ht(!1),[it,We]=ht(),_e=u?.chainId,Be=u?.token.address,rt=e.target;Xn(()=>{if(!ie||!_e||!Be){Ye(void 0),We(void 0),Te(!1);return}let X=!1;return Ye(void 0),We(void 0),Te(!0),(rt?r.getDepositAddress({user:ie,originChainId:_e,originCurrency:Be},rt):r.getDepositAddress({user:ie,originChainId:_e,originCurrency:Be})).then(j=>{X||(Ye(j),We(void 0),t.current.onDepositAddress?.(j))}).catch(j=>{if(X)return;Ye(void 0);let ze=j instanceof Error?j:new Error(String(j));We(ze),t.current.onError?.(ze)}).finally(()=>{X||Te(!1)}),()=>{X=!0}},[r,ie,_e,Be,rt]);let Et=[_e??"",(Be??"").toLowerCase(),(ie??"").toLowerCase(),rt??"",S.trim()].join("|"),ft=gd(Et);Xn(()=>{ft.current!==Et&&(ft.current=Et,h(void 0),x())},[Et,x]);let[Ct,Se]=ht(),[wt,yt]=ht(!1),[St,Ke]=ht(),Xe=B?.toString();Xn(()=>{if(!_e||!Be||!Xe){Se(void 0),Ke(void 0),yt(!1);return}let X=!1,Ee,j=!0;async function ze(){j&&yt(!0);let ee=Jm;try{let $e=await r.getQuote({originChainId:_e,originCurrency:Be,amount:Xe});if(X)return;Se($e),Ke(void 0),ee=cv($e.ttl)}catch($e){if(X)return;Se(void 0),Ke($e instanceof Error?$e:new Error(String($e)))}finally{X||yt(!1),j=!1}X||(Ee=setTimeout(ze,ee))}return ze(),()=>{X=!0,Ee&&clearTimeout(Ee)}},[r,_e,Be,Xe]);let[$t,At]=ht(!1),[zt,Mt]=ht(!1),[nt,Ge]=ht(),[at,Nt]=ht(),[Pe,st]=ht(!1),[_t,F]=ht(!1),[ke,P]=ht(!1),ae=n?.waitForReceipt,pe=gd(void 0);Xn(()=>{if(!nt||!u||!ae)return;let X=!1;return st(!0),F(!1),P(!1),ae({chainId:u.chainId,hash:nt}).then(Ee=>{X||(F(!0),P(Ee.status==="reverted"),xe(j=>j+1),Ee.status!=="reverted"&&nt!==pe.current&&(pe.current=nt,t.current.onDeposited?.(nt)))}).catch(Ee=>{X||Nt(Ee instanceof Error?Ee.message:String(Ee))}).finally(()=>{X||st(!1)}),()=>{X=!0}},[nt,ae]);let me=a!==void 0&&u!==void 0&&a!==u.chainId,Je=$t||zt,ar=w??at,Qt="idle";ar?Qt="error":_t?Qt="confirmed":Pe?Qt="confirming":Je&&(Qt=$t?"switching":"pending");let Lt={phase:Qt,isSubmitting:Je,isConfirming:Pe,isConfirmed:_t,needsSwitch:me,txHash:nt,reverted:_t&&ke,error:ar},hr=!!(u&&we&&we.originChainId===u.chainId&&we.originCurrency.toLowerCase()===u.token.address.toLowerCase()),br=!!(n?.sendTransaction&&n?.writeContract&&n?.readContract&&n?.waitForReceipt),Vt=!!(i&&br&&u&&!R&&we&&hr&&L&&L>0n&&!ge&&!Je&&!Pe),sr=Pi(async()=>{if(R||!u||!we||!n?.sendTransaction||!n?.writeContract)return;h(void 0);let X=hd(S,u.token.decimals);if(!X||X<=0n){h("enter an amount to use the one-click deposit");return}let Ee=u.token.address.toLowerCase()===Si,j=we.depositAddress,ze=await Dm(n?.readContract,Xm,{forwarder:we.forwarder,recipient:ie,version:we.version,trusted:t.current.trustedFactories});if(!ze.ok){h(`address verification failed: ${ze.reason}`);return}if(u.chainId===Zm.chainId&&u.token.address.toLowerCase()===Zm.token.toLowerCase()&&!Pm(j,we.forwarder)){h("address verification failed: deposit address does not match the verified forwarder (expected them to be identical on this route; check the backend's direct_same_token setting)");return}try{if(me){if(!n?.switchChain)throw new Error("wallet cannot switch chains");At(!0);try{await n.switchChain(u.chainId)}finally{At(!1)}}x(),Mt(!0);try{let $e=Ee?await n.sendTransaction({chainId:u.chainId,to:j,value:X}):await n.writeContract({chainId:u.chainId,address:u.token.address,abi:pv,functionName:"transfer",args:[j,X]});Ge($e)}finally{Mt(!1)}}catch($e){h($e.message)}},[R,u,we,S,me,n,ie,x]);return{address:o,isConnected:i,catalog:g,catalogLoading:d,catalogError:b,origin:u,setOrigin:k,recipient:Y,setRecipient:G,recipientValid:H,amount:S,setAmount:E,balance:te,balanceLoading:Z,insufficientBalance:ge,isSvmOrigin:R,depositAddress:we?.depositAddress,depositAddressResult:we,depositAddressLoading:be,depositAddressError:it,quote:Ct,quoteLoading:wt,quoteError:St,canDeposit:Vt,deposit:sr,depositState:Lt}}import{useEffect as uv,useRef as fv,useState as Jo}from"react";var mv=3e4,gv=300;function Jn(e){let t=fv(e);t.current=e;let{client:r,enabled:n=!0,live:o=!0}=e,i=e.refetchInterval??e.fallbackPollMs??mv,a=e.recipient&&dt(e.recipient)?e.recipient:void 0,[s,l]=Jo([]),[d,c]=Jo(!1),[b,f]=Jo(),[m,y]=Jo(!1),[g,u]=Jo(),[p,w]=Jo(0);return uv(()=>{if(!a){l([]),f(void 0),c(!1),y(!1),u(void 0),w(0);return}if(!n){l([]),f(void 0),c(!1),y(!1),u(void 0),w(0);return}let h=!1,x=!0,k,R=0,I=0;async function C(){let B=++R;I+=1,x&&c(!0);try{let L=await r.listOrders(a);if(h)return;B===R&&(l(L),f(void 0))}catch(L){if(h)return;let z=L instanceof Error?L:new Error(String(L));B===R&&(f(z),t.current.onError?.(z))}finally{I-=1,!h&&B===R&&(c(!1),y(!0),u(a),w(L=>L+1)),x=!1}}function S(){k&&clearTimeout(k),k=setTimeout(()=>{k=void 0,h||C()},gv)}C();let E;o&&typeof EventSource<"u"&&(E=new EventSource(r.ordersStreamUrl(a)),E.addEventListener("orders-changed",S),E.onopen=()=>{S()});let M=o&&Number.isFinite(i)&&i>0?setInterval(()=>{I===0&&C()},i):void 0;return()=>{h=!0,k&&clearTimeout(k),M&&clearInterval(M),E?.close()}},[r,a,n,o,i]),{orders:s,ordersLoading:d,ordersError:b,ordersInitialized:m,ordersForRecipient:g,ordersRevision:p}}import{useMemo as hv,useState as bv}from"react";function eg(e,t){if(t){let r=e.find(n=>n.symbol===t);if(r)return r}return e.find(r=>r.isDefault)??e[0]}function tg({catalogTargets:e,filter:t,defaultTarget:r}){let n=hv(()=>{if(!t||t.length===0)return e;let l=new Set(t);return e.filter(d=>l.has(d.symbol))},[e,t]),[o,i]=bv(()=>eg(n,r)?.symbol),a=(o!==void 0?n.find(l=>l.symbol===o):void 0)??eg(n,r);function s(l){n.some(d=>d.symbol===l)&&i(l)}return{options:n,selected:a,setSelected:s}}var wv={dev:"https://dev-relay-protocol-api.onechain.nexus",stage:"https://dev-relay-protocol-api.onechain.nexus",production:"https://relay-protocol-api.onechain.nexus"};function $n(e){return e.apiBaseUrl?e.apiBaseUrl:wv[ot(e.environment)]}import{jsx as Rv,jsxs as Cv}from"react/jsx-runtime";var rg=1e3;function yv(e,t,r,n,o){let i=e.requireWalletConnection??e.showRecipientInput===!1,a=r.walletAddress&&dt(r.walletAddress)?r.walletAddress:void 0;return{client:e.client,apiBaseUrl:n,wallet:r,chains:e.chains,recipient:i?a??"":e.recipient,amount:i&&!a?"":e.amount,defaultToken:e.defaultToken,target:t,trustedFactories:o,onDepositAddress:e.onDepositAddress,onDeposited:e.onDeposited,onError:e.onError}}function Ts(e,t){let r=e.trim();if(!r)return 0n;try{let n=us(r,t);return n>0n?n:0n}catch{return 0n}}function xv(e,t,r,n){if(t!==void 0&&e.forwarderVersion!==t)return!1;let o=e.target?.trim();return o?!!(r&&o.toLowerCase()===r.toLowerCase()):n}function ng(e,t,r){return`${e}:${t.toLowerCase()}:${r}`}function vv(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function og({open:e,children:t}){let[r]=Ne.useState(pm);return Cv(td.Provider,{value:r,children:[e&&Rv(kv,{store:r}),t]})}function kv({store:e}){let t=Ci(),{showTargetSelector:r=!0}=t,n=t.requireWalletConnection??t.showRecipientInput===!1,o=!!(t.walletAddress&&dt(t.walletAddress)),[i,a]=Ne.useState("deposit"),s=i==="recover",l=Ne.useCallback(W=>{a(ct=>(typeof W=="function"?W(ct==="recover"):W)?"recover":"deposit")},[]);Ne.useEffect(()=>{Qe("relay","opened")},[]);let[d,c]=Ne.useState(void 0),b=Ne.useMemo(()=>$n({apiBaseUrl:t.apiBaseUrl,environment:t.environment}),[t.apiBaseUrl,t.environment]),f=Ne.useMemo(()=>({walletAddress:t.walletAddress,walletChainId:t.walletChainId,sendTransaction:t.sendTransaction,writeContract:t.writeContract,readContract:t.readContract,switchChain:t.switchChain,waitForReceipt:t.waitForReceipt,getBalance:t.getBalance}),[t.walletAddress,t.walletChainId,t.sendTransaction,t.writeContract,t.readContract,t.switchChain,t.waitForReceipt,t.getBalance]),m=ot(t.environment),y=Ut("apps.json",m,W=>({min:Mr(W?.relay?.minDepositAmount,m),max:Mr(W?.relay?.maxDepositAmount,m),trustedFactories:$i(W,m)})),g=Ne.useMemo(()=>t.trustedFactories??vs(y?.trustedFactories),[t.trustedFactories,y?.trustedFactories]),{isConnected:u,catalog:p,catalogLoading:w,catalogError:h,origin:x,setOrigin:k,amount:R,setAmount:I,recipient:C,setRecipient:S,recipientValid:E,balance:M,balanceLoading:B,insufficientBalance:L,depositAddress:z,depositAddressResult:A,depositAddressLoading:U,depositAddressError:oe,quote:Y,quoteLoading:G,quoteError:H,canDeposit:ie,deposit:te,depositState:O}=$m(yv(t,d,f,b,g)),{options:Z,selected:_,setSelected:ce}=tg({catalogTargets:p?.targets??[],filter:t.targetTokens,defaultTarget:t.defaultTarget});Ne.useEffect(()=>{c(_?.symbol)},[_?.symbol]);let xe=t.amount===void 0&&!t.hideAmount,he=!n&&(t.showRecipientInput??!0)&&t.recipient===void 0,fe=E&&C.trim().length>0&&dt(C),ge=!n&&t.recipient!==void 0&&t.recipient.trim().length>0,we=n?!o||!fe:!u&&!ge&&!fe,Ye=!!p&&!fe&&!we,be=(t.showRecovery??!1)&&o&&!!(f.writeContract&&f.readContract&&f.waitForReceipt),Te=Ne.useMemo(()=>t.client?t.client:Gt({baseUrl:b}),[t.client,b]),[it,We]=Ne.useState({}),[_e,Be]=Ne.useState(!1),[rt,Et]=Ne.useState(0),ft=Ne.useCallback(()=>Et(W=>W+1),[]),Ct=O.isConfirmed,Se=fe&&(!!A||i!=="deposit"),{orders:wt,ordersLoading:yt,ordersError:St,ordersInitialized:Ke,ordersForRecipient:Xe}=Jn({client:Te,recipient:Se?C:void 0,enabled:Se,refetchInterval:rg}),$t=wt,At=_??p?.targets.find(W=>W.isDefault),zt=At?.symbol??p?.destination.symbol,Mt=At?.isDefault??!0,nt=A?.version,Ge=Ne.useMemo(()=>wt.filter(W=>xv(W,nt,zt,Mt)),[wt,nt,zt,Mt]),at=Ne.useRef(void 0),[Nt,Pe]=Ne.useState(),[st,_t]=Ne.useState(),F=`${C.toLowerCase()}:${zt?.toLowerCase()??""}:${nt??""}`;Ne.useEffect(()=>{let W=Xe?.toLowerCase()===C.toLowerCase();if(!Se||!Ke||!W||St){Se||(at.current=void 0,Pe(void 0),_t(void 0));return}let ct=new Set(Ge.map(He=>He.orderId)),er=new Set(Ge.flatMap(He=>(He.deposits??[]).map(dn=>ng(He.orderId,dn.txHash,dn.blockNumber)))),Ae=at.current;if(!Ae||Ae.key!==F){at.current={key:F,orderIds:ct,depositKeys:er,statuses:new Map(Ge.map(He=>[He.orderId,He.status]))},Pe(void 0),_t(void 0);return}let Zr,Ft=0n,dr=!1;for(let He of Ge)for(let dn of He.deposits??[]){let Ro=ng(He.orderId,dn.txHash,dn.blockNumber);if(!Ae.depositKeys.has(Ro)){Zr??(Zr=He);try{Ft+=BigInt(dn.amount),dr=!0}catch{}}}Zr??(Zr=Ge.find(He=>!Ae.orderIds.has(He.orderId))),Zr??(Zr=Ge.find(He=>Ae.statuses.get(He.orderId)!==He.status));for(let He of ct)Ae.orderIds.add(He);for(let He of er)Ae.depositKeys.add(He);for(let He of Ge)Ae.statuses.set(He.orderId,He.status);Zr&&(Pe(Zr.orderId),dr&&_t(Ft))},[F,Ge,Xe,Se,C,St,Ke]),Ne.useEffect(()=>{let W=p?.targets??[];if(!be||!fe||W.length===0){We({}),Be(!1);return}let ct=!1;return Be(!0),Promise.all(W.map(er=>Te.getRecovery({user:C,target:er.symbol}).catch(()=>{}))).then(er=>{if(ct)return;let Ae={};W.forEach((Zr,Ft)=>{let dr=er[Ft];dr&&(Ae[Zr.symbol]=dr)}),We(Ae),Be(!1)}),()=>{ct=!0}},[Te,be,fe,C,p,Ct,rt]);let ke=Ne.useMemo(()=>(p?.targets??[]).map(W=>({symbol:W.symbol,isDefault:W.isDefault,info:it[W.symbol]})).filter(W=>W.info!==void 0),[p,it]),P=Ne.useMemo(()=>ks(Ko(ke)),[ke]),[ae,pe]=Ne.useState(void 0),[me,Je]=Ne.useState(),ar=!!p&&(p?.targets.length??0)>0&&!d;Ne.useEffect(()=>{if(!fe||!x||!A||ar){pe(void 0),Je(void 0);return}let W=!1,ct=!1,er=A.forwarder.toLowerCase();pe(void 0),Je(void 0);async function Ae(){if(!(W||ct)){ct=!0;try{let Ft=await Te.getRecovery({user:C,target:d||void 0});if(W)return;if(Ft?.forwarder&&Ft.forwarder.toLowerCase()!==er){pe(void 0),Je(void 0);return}if(Je(Ft),!Ft||Ft.suggestedAction!=="sweep"){pe(void 0);return}let dr;try{dr=BigInt(Ft.balance)}catch{pe(void 0);return}let He=Number(Ft.decimals);if(dr<=0n||!Number.isInteger(He)||He<0){pe(void 0);return}let dn=Ft.tokens?.find(Ro=>Ro.address?.toLowerCase()===Ft.token?.toLowerCase()&&Ro.symbol)?.symbol;pe({balance:dr,decimals:He,symbol:dn})}catch{}finally{ct=!1}}}Ae();let Zr=setInterval(()=>{Ae()},rg);return()=>{W=!0,clearInterval(Zr)}},[Te,fe,C,d,ar,x,A,Ct]);let Qt=Ne.useCallback(()=>{!x||!M||I(Wt(M.value,x.token.decimals))},[x,M,I]),Lt=Ne.useRef(!1),hr=!!z;Ne.useEffect(()=>{!hr||Lt.current||(Lt.current=!0,Qe("relay","deposit_address_shown"))},[hr]);let br=O.txHash;Ne.useEffect(()=>{br&&Qe("relay","deposit_submitted")},[br]);let Vt=(()=>{let W=Number(y?.min);return Number.isFinite(W)&&W>=0?String(y?.min):"6"})(),sr=(()=>{let W=Number(y?.max);return Number.isFinite(W)&&W>0?String(y?.max):void 0})(),X=(()=>{if(!x)return 0n;let W=Ts(Vt,x.token.decimals),ct=BigInt(x.minAmount);return W>ct?W:ct})(),Ee=x?Wt(X,x.token.decimals):Vt,j=(()=>{if(!x||!ae||X<=0n)return;let W=x.token.decimals,ct=ae.decimals,er=W>=ct?ae.balance*10n**BigInt(W-ct):ae.balance/10n**BigInt(ct-W);if(er>=X)return;let Ae=X-er;return{pending:Wt(ae.balance,ct),pendingSymbol:ae.symbol,remaining:Wt(Ae,W)}})(),ze=p?.origins.find(W=>W.chainId===56&&!!(me?.token&&W.token.address.toLowerCase()===me.token.toLowerCase()))??p?.origins.find(W=>W.chainId===56&&W.token.symbol.toUpperCase()==="USDT"),ee=Number.isInteger(me?.decimals)&&(me?.decimals??-1)>=0?me.decimals:ze?.token.decimals,$e=me?.tokens?.find(W=>W.address?.toLowerCase()===me.token?.toLowerCase()&&W.symbol)?.symbol??ze?.token.symbol,xn=st!==void 0&&ee!==void 0?Wt(st,ee):void 0,eo=(()=>{if(!x||ee===void 0)return;let W=x.token.decimals;if(ee>=W)return X*10n**BigInt(ee-W);let ct=10n**BigInt(W-ee);return(X+ct-1n)/ct})(),qr=Nt?Ge.find(W=>W.orderId===Nt):void 0,Yr=qr??Ge.find(W=>W.status==="BSC_FUNDED"||W.status==="BRIDGE_INITIATED"||W.status==="BRIDGE_PENDING"),Hi=(()=>{if(!Yr||eo===void 0)return!1;try{return BigInt(Yr.amountIn)>=eo}catch{return!1}})(),to=(()=>{if(!me||eo===void 0)return!1;try{return BigInt(me.balance)>0n&&BigInt(me.balance)>=eo}catch{return!1}})(),_i=(()=>{let W={amount:xn,symbol:$e,backendStatus:Yr?.status};return!A||!Se||!Ke?{phase:"connecting",...W}:Xe?.toLowerCase()!==C.toLowerCase()||St?{phase:"unavailable",...W}:qr?.status==="COMPLETED"?{phase:"completed",...W,backendStatus:qr.status}:qr&&vv(qr.status)?{phase:"failed",...W,backendStatus:qr.status}:Yr?.status==="BRIDGE_INITIATED"||Yr?.status==="BRIDGE_PENDING"?{phase:"processing",...W}:Yr?.status==="BSC_FUNDED"&&Hi||to?{phase:"funded",...W}:qr?{phase:"detected",...W,backendStatus:qr.status}:{phase:"waiting",...W}})(),Qi=x&&sr?Ts(sr,x.token.decimals):void 0,ko=x&&R.trim()?Ts(R,x.token.decimals):0n,Vi=!!(x&&ko>0n&&ko<X),lr=!!(x&&Qi!==void 0&&ko>0n&&ko>Qi),qi=(()=>{if(x){if(Vi)return`Amount is below the ${Ee} ${x.token.symbol} minimum.`;if(lr)return`Amount is above the ${sr} ${x.token.symbol} maximum.`}})(),Kr=t.showOneClickDeposit??!1,qt=x&&R.trim()?Ts(R,x.token.decimals).toString():void 0,ro={activeView:i,setActiveView:a,recoveryOpen:s,setRecoveryOpen:l,resolvedApiBaseUrl:b,wallet:f,catalog:p,catalogLoading:w,catalogError:h,origin:x,setOrigin:k,amount:R,setAmount:I,recipient:C,setRecipient:S,recipientValid:E,balance:M,balanceLoading:B,insufficientBalance:L,depositAddress:z,depositAddressLoading:U,depositAddressError:oe,arrivalStatus:_i,quote:Y,quoteLoading:G,quoteError:H,canDeposit:ie,deposit:te,depositState:O,targetOptions:Z,selectedTarget:_,setSelectedTarget:ce,showAmountInput:xe,minNotice:x?{min:Ee,symbol:x.token.symbol,...j}:void 0,showRecipientInput:he,showTargetSelector:r,showOneClick:Kr,showConnectPrompt:we,showRecipientHint:Ye,canRecover:be,recoverableCount:P,recoveryTargetsLoading:_e,recoveryTargets:ke,recoveryOrders:$t,historyOrdersLoading:yt,historyOrdersError:St,refreshRecovery:ft,trustedFactories:g,amountHint:qi,amountSmallestUnits:qt,onMax:xe&&M&&M.value>0n?Qt:void 0};return Ne.useLayoutEffect(()=>{e.publish(ro)}),Ne.useLayoutEffect(()=>()=>e.publish(null),[e]),null}import{jsx as bd}from"react/jsx-runtime";function Sv(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:d,children:c}=e,[b,f]=Is.useState(!1),m=l!==void 0,y=m?l:b,g=Is.useCallback(u=>{m||f(u),d?.(u)},[m,d]);return bd(ed.Provider,{value:e,children:bd(og,{open:y,children:bd(An,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:y,onOpenChange:g,children:c})})})}var Oi=Object.assign(Sv,{Trigger:Ym,Content:qm});import{createContext as Nv,useContext as Tv}from"react";var wd=Nv(null);function yd(){let e=Tv(wd);if(!e)throw new Error("RelayHistory compound components must be used within <RelayHistory>");return e}import*as Er from"react";import{jsx as yo}from"react/jsx-runtime";function ig({className:e}){let t=yd(),{open:r}=an();return Er.useEffect(()=>{r&&Qe("relay","history_opened")},[r]),yo(ye,{feature:"relay",children:yo(Mn,{ariaTitle:"Transfer history",className:e??t.className,children:yo(Iv,{})})})}function Iv(){let e=yd(),{theme:t}=an(),r=Er.useMemo(()=>{if(e.client)return e.client;let u=$n({apiBaseUrl:e.apiBaseUrl,environment:e.environment});return Gt({baseUrl:u})},[e.client,e.apiBaseUrl,e.environment]),n=e.recipient??e.walletAddress,o=!!(n&&dt(n)),[i,a]=Er.useState(),[s,l]=Er.useState(!1),[d,c]=Er.useState(),b=Er.useRef(e.onError);b.current=e.onError,Er.useEffect(()=>{if(!o){a(void 0),l(!1),c(void 0);return}let u=!1;return a(void 0),l(!0),c(void 0),r.getConfig().then(p=>{u||a(p)}).catch(p=>{if(u)return;let w=p instanceof Error?p:new Error(String(p));c(w),b.current?.(w)}).finally(()=>{u||l(!1)}),()=>{u=!0}},[r,o]);let{orders:f,ordersLoading:m,ordersError:y}=Jn({client:r,recipient:o?n:void 0,enabled:!!i,onError:e.onError}),g=Er.useCallback(u=>{if(!e.onOutlink)return;let w=u.target.closest?.('a[target="_blank"]');w?.href&&e.onOutlink(w.href)},[e.onOutlink]);return yo("div",{className:"rd-root rd-wizard","data-theme":t,children:o?yo("div",{onClick:g,children:yo(ys,{orders:f,isLoading:s||m,error:d??y,catalog:i,showTitle:!1})}):yo(Ei,{requiresIdentity:!0})})}import{jsx as xd}from"react/jsx-runtime";function ag({asChild:e,children:t}){return xd(ye,{feature:"relay",children:xd(Xo,{asChild:e??t!=null,children:t??xd("button",{type:"button","data-track":"open",children:"History"})})})}import{jsx as sg}from"react/jsx-runtime";function Ev(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o="min(640px, calc(100vw - 32px))",drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:d,children:c}=e;return sg(wd.Provider,{value:e,children:sg(An,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:d,children:c})})}var lg=Object.assign(Ev,{Trigger:ag,Content:ig});import*as Hr from"react";import*as Ar from"react";var Es=[],Av=3e4;function dg({client:e,recipient:t}){let[r,n]=Ar.useState({targets:Es}),[o,i]=Ar.useState(0),a=Ar.useRef(void 0),s=Ar.useRef(void 0),l=t&&dt(t)?t.toLowerCase():void 0;Ar.useEffect(()=>{if(!l){n({targets:Es});return}let g=!1,u=a.current;if(!u||u.client!==e||u.recipientKey!==l||u.generation!==o){let p=(async()=>{let w,h=[];try{h=(await e.getConfig()).targets}catch(C){w=C instanceof Error?C:new Error(String(C))}let x=h.length===0?[()=>e.getRecovery({user:l})]:h.map(C=>()=>e.getRecovery({user:l,target:C.symbol})),k=await Promise.all(x.map(async C=>{try{return{info:await C()}}catch(S){return{error:S instanceof Error?S:new Error(String(S))}}})),R=h.length===0?k[0]?.info?[{symbol:"",isDefault:!0,info:k[0].info}]:[]:h.flatMap((C,S)=>k[S]?.info?[{symbol:C.symbol,isDefault:C.isDefault,info:k[S].info}]:[]),I=k.find(C=>C.error)?.error;return{targets:R,badgeFailed:!!(w||I&&R.length===0),error:w??I}})().catch(w=>({targets:Es,badgeFailed:!0,error:w instanceof Error?w:new Error(String(w))}));u={client:e,recipientKey:l,generation:o,promise:p},a.current=u,p.finally(()=>{s.current={client:e,recipientKey:l,at:Date.now()},a.current?.promise===p&&(a.current=void 0)})}return u.promise.then(p=>{g||n({recipientKey:l,targets:p.targets,badgeFailed:p.badgeFailed,error:p.error})}),()=>{g=!0}},[e,l,o]);let d=Ar.useCallback(()=>i(g=>g+1),[]),c=Ar.useCallback(()=>{if(!l)return;let g=a.current;if(g?.client===e&&g.recipientKey===l)return;let u=s.current;u?.client===e&&u.recipientKey===l&&Date.now()-u.at<Av||i(p=>p+1)},[e,l]),b=l&&r.recipientKey===l?r.targets:Es,f=l&&r.recipientKey===l?r.error:void 0,m=!!(l&&r.recipientKey!==l),y=!!(l&&r.recipientKey===l&&r.badgeFailed);return Ar.useMemo(()=>({count:y?0:ks(Ko(b)),targets:b,loading:m,error:f,refresh:d,refreshIfStale:c}),[b,m,y,f,d,c])}import{createContext as Mv,useContext as Lv}from"react";var vd=Mv(null);function kd(){let e=Lv(vd);if(!e)throw new Error("RelayRecovery compound components must be used within <RelayRecovery>");return e}function Rd(){return kd().props}function cg(){return kd().recovery}function pg(){return kd().recovery.count}import*as xo from"react";import{jsx as vo,jsxs as Pv}from"react/jsx-runtime";function ug({className:e}){let t=Rd(),{open:r}=an();return xo.useEffect(()=>{r&&Qe("relay","recovery_opened")},[r]),vo(ye,{feature:"relay",children:vo(Mn,{ariaTitle:"Recover stuck funds",className:e??t.className,children:vo(Dv,{})})})}function Dv(){let e=Rd(),{targets:t,loading:r,refresh:n}=cg(),{theme:o}=an(),i=xo.useMemo(()=>$n({apiBaseUrl:e.apiBaseUrl,environment:e.environment}),[e.apiBaseUrl,e.environment]),a=xo.useMemo(()=>e.client?e.client:Gt({baseUrl:i}),[e.client,i]),s=xo.useMemo(()=>({walletAddress:e.walletAddress,walletChainId:e.walletChainId,sendTransaction:e.sendTransaction,writeContract:e.writeContract,readContract:e.readContract,switchChain:e.switchChain,waitForReceipt:e.waitForReceipt,getBalance:e.getBalance}),[e.walletAddress,e.walletChainId,e.sendTransaction,e.writeContract,e.readContract,e.switchChain,e.waitForReceipt,e.getBalance]),l=e.walletAddress&&dt(e.walletAddress)?e.walletAddress:void 0,d=!!(l&&(!e.recipient||dt(e.recipient)&&e.recipient.toLowerCase()===l.toLowerCase())),c=d?l:void 0,b=ot(e.environment),f=Ut("apps.json",b,w=>$i(w,b)),m=xo.useMemo(()=>e.trustedFactories??vs(f),[e.trustedFactories,f]),y=!!(e.writeContract&&e.readContract&&e.waitForReceipt),g=!!c&&y,u=c,{orders:p}=Jn({client:a,recipient:g?u:void 0,enabled:g,live:!1});return Pv("div",{className:"rd-root rd-wizard","data-theme":o,children:[!l&&vo("p",{className:"rd-muted","data-testid":"rd-recovery-connect-note",children:"Connect a wallet to check recoverable funds."}),l&&!d&&vo("p",{className:"rd-muted","data-testid":"rd-recovery-recipient-note",children:"Recovery is only available for the connected wallet."}),d&&!y&&vo("p",{className:"rd-muted","data-testid":"rd-recovery-unsupported-note",children:"This wallet can't sign recovery transactions."}),g&&vo(Ss,{client:e.client,apiBaseUrl:i,recipient:c,wallet:s,trustedFactories:m,targets:t,targetsLoading:r,orders:p,onRecovered:n,onRecoverySuccess:e.onRecoverySuccess,showTitle:!1,onError:e.onError})]})}import{jsx as Cd}from"react/jsx-runtime";function fg({asChild:e,children:t}){let r=pg();return Cd(ye,{feature:"relay",children:Cd(Xo,{asChild:e??t!=null,dataAttributes:{"data-rd-recovery-count":r},children:t??Cd("button",{type:"button","data-track":"open",children:"Recover"})})})}import{jsx as mg}from"react/jsx-runtime";function Ov(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:d,children:c}=e,[b,f]=Hr.useState(!1),m=l!==void 0,y=m?l:b,g=Hr.useCallback(R=>{m||f(R),d?.(R)},[m,d]),u=Hr.useMemo(()=>{if(e.client)return e.client;let R=$n({apiBaseUrl:e.apiBaseUrl,environment:e.environment});return Gt({baseUrl:R})},[e.client,e.apiBaseUrl,e.environment]),p=e.walletAddress&&dt(e.walletAddress)?e.walletAddress:void 0,w=p&&(!e.recipient||dt(e.recipient)&&e.recipient.toLowerCase()===p.toLowerCase())?p:void 0,h=dg({client:u,recipient:w});Hr.useEffect(()=>{y&&h.refreshIfStale()},[y,h.refreshIfStale]);let x=Hr.useRef(void 0);Hr.useEffect(()=>{!y||!h.error||x.current===h.error||(x.current=h.error,e.onError?.(h.error))},[y,h.error,e.onError]);let k=Hr.useMemo(()=>({props:e,recovery:h}),[e,h]);return mg(vd.Provider,{value:k,children:mg(An,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:y,onOpenChange:g,children:c})})}var gg=Object.assign(Ov,{Trigger:fg,Content:ug});import{useCallback as Bv,useEffect as zv,useMemo as Fv,useRef as Uv,useState as As}from"react";function hg(e={}){let t=Uv(e);t.current=e;let r=Fv(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useRelayConfig: either `client` or `apiBaseUrl` must be provided");return Gt({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.enabled??!0,o=e.refetchInterval,[i,a]=As(),[s,l]=As(!1),[d,c]=As(),[b,f]=As(0);zv(()=>{if(!n){a(void 0),l(!1),c(void 0);return}let y=!1,g=!1;a(void 0),l(!0),c(void 0);async function u(){if(!(y||g)){g=!0;try{let w=await r.getConfig();if(y)return;a(w),c(void 0)}catch(w){if(y)return;let h=w instanceof Error?w:new Error(String(w));c(h),t.current.onError?.(h)}finally{g=!1,y||l(!1)}}}u();let p=typeof o=="number"&&Number.isFinite(o)&&o>0?setInterval(()=>{u()},o):void 0;return()=>{y=!0,p&&clearInterval(p)}},[r,n,b,o]);let m=Bv(()=>f(y=>y+1),[]);return{config:i,loading:s,error:d,refresh:m}}import{useQuery as jv}from"@tanstack/react-query";import{useCallback as bg,useEffect as Wv,useMemo as Sd,useRef as wg}from"react";var Gv=1,yg=new WeakMap;function Hv(e){let t=yg.get(e);if(t!==void 0)return t;let r=Gv++;return yg.set(e,r),r}function xg(e={}){let t=wg(e);t.current=e;let r=Sd(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useRelayRecovery: either `client` or `apiBaseUrl` must be provided");return Gt({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.recipient,o=n&&dt(n)?n:void 0,i=e.target,a=e.query,s=Sd(()=>Hv(r),[r]),l=Sd(()=>["relay","recovery",s,o??null,i??null],[s,o,i]),d=jv({retry:!1,...a,queryKey:l,queryFn:async()=>{if(!o)throw new Error("useRelayRecovery: a valid EVM recipient is required");return r.getRecovery({user:o,target:i})},enabled:o?a?.enabled:!1}),c=wg(0);Wv(()=>{let g=d.error,u=d.errorUpdatedAt;!g||u===c.current||(c.current=u,t.current.onError?.(g),g instanceof ln&&g.status===401&&t.current.onUnauthorized?.())},[d.error,d.errorUpdatedAt]);let b=bg(()=>{d.refetch()},[d.refetch]),f=Li({recipient:e.recipient,wallet:e.wallet,trustedFactories:e.trustedFactories,onError:e.onError,onRecoverySuccess:e.onRecoverySuccess,onChanged:b}),m=d.data,y=bg(async(g,u)=>{m&&await f.recover(m,g,u)},[f,m]);return{info:m,loading:d.isLoading,error:d.error??void 0,isFetching:d.isFetching,refresh:b,recover:y,recoveryState:f.stateFor(m?.forwarder)}}import{Fragment as Yv,jsx as _r,jsxs as Qr}from"react/jsx-runtime";var _v={bscBridge:"https://bscscan.com/tx/",crossFinalize:"https://scan.crosstoken.io/tx/",crossExecute:"https://scan.crosstoken.io/tx/"},Qv={bscBridge:"Bridge tx (BSC)",crossFinalize:"Finalize tx (CROSS)",crossExecute:"Execute tx (CROSS)"};function Vv(e){return e==="done"?"\u2713":e==="active"?"\u25CF":""}function vg(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function qv(e){return e==="done"?"rd-stepper-item rd-stepper-item-done":e==="active"?"rd-stepper-item rd-stepper-item-active":"rd-stepper-item rd-stepper-item-pending"}function kg({orderId:e,order:t,error:r}){let n=!t&&!r;return Qr("section",{className:"rd-card",children:[Qr("div",{className:"rd-card-header",children:[_r("h2",{className:"rd-card-title",children:"4. Status"}),t&&_r("span",{className:`rd-status-pill${t.status==="COMPLETED"?" rd-status-pill-success":vg(t.status)?" rd-status-pill-failure":""}`,children:t.status})]}),Qr("p",{className:"rd-card-hint",children:["Order ",e]}),n&&Qr("p",{className:"rd-muted",children:[_r("span",{className:"rd-spinner"})," Loading status..."]}),r&&Qr("div",{className:"rd-callout rd-callout-danger",children:["Couldn't load order status: ",r.message]}),t&&Qr(Yv,{children:[_r("ol",{className:"rd-stepper",children:t.steps.map((o,i)=>Qr("li",{className:qv(o.status),children:[Qr("div",{className:"rd-stepper-rail",children:[_r("span",{className:"rd-stepper-dot",children:Vv(o.status)}),i<t.steps.length-1&&_r("span",{className:"rd-stepper-line"})]}),Qr("div",{className:"rd-stepper-body",children:[_r("div",{className:"rd-stepper-label",children:o.label}),o.key==="bridge"&&t.txs.bscBridge&&_r("div",{className:"rd-stepper-meta",children:_r(Nd,{orderTxs:t.txs,txKey:"bscBridge"})}),o.key==="deliver"&&(t.txs.crossFinalize||t.txs.crossExecute)&&Qr("div",{className:"rd-stepper-meta",children:[t.txs.crossFinalize&&_r(Nd,{orderTxs:t.txs,txKey:"crossFinalize"}),t.txs.crossExecute&&_r(Nd,{orderTxs:t.txs,txKey:"crossExecute"})]})]})]},o.key))}),vg(t.status)&&Qr("div",{className:"rd-callout rd-callout-danger",children:["This order did not complete successfully (status: ",t.status,"). If funds were deposited, refer to the refund address on the order for recovery."]}),t.status==="COMPLETED"&&_r("div",{className:"rd-callout rd-callout-success",children:"crossd delivered. This order is complete."})]})]})}function Nd({orderTxs:e,txKey:t}){let r=e[t];return r?Qr("a",{href:`${_v[t]}${r}`,target:"_blank",rel:"noreferrer",children:[Qv[t],": ",r.slice(0,10),"..."]}):null}function Ms(e){return`${e.chainId}:${e.address.toLowerCase()}`}function Td(e,t){return Ms(e)===Ms(t)}function Ls(e,t){if(t)return e.find(r=>Td(r,t))}function Bi(e,t,r){return t?{fromTokens:(r==="swap"?[t.swap.from]:t.bridge.from).map(o=>Ls(e,o)).filter(o=>!!o),targetToken:Ls(e,t.target)}:{fromTokens:[],targetToken:void 0}}function Ds(e,t){return e.some(r=>r.chainId===t.chainId&&r.address.toLowerCase()===t.address.toLowerCase())}function Rg(e){let t=/^v?(\d+(?:\.\d+)*)(?:-([0-9A-Za-z.-]+))?$/.exec(e.trim());return t?{parts:t[1].split(".").map(r=>Number(r)),prerelease:t[2]??null}:null}function Kv(e,t){let r=Rg(e),n=Rg(t);if(!r||!n)return null;let o=Math.max(r.parts.length,n.parts.length);for(let i=0;i<o;i+=1){let a=(r.parts[i]??0)-(n.parts[i]??0);if(a!==0)return a<0?-1:1}return r.prerelease===n.prerelease?0:r.prerelease===null?1:n.prerelease===null||r.prerelease<n.prerelease?-1:1}function Cg(e,t=oo){if(!e)return!0;let r=Kv(t,e);return r===null?!0:r>=0}var Sg={swap:"swap",bridge:"bridge",transfer:"transferCrypto"};function zi(e,t){return t?.[Sg[e]]??e!=="transfer"}function Fi(e,t){return Cg(t?.[Sg[e]])}function Ps(e,t,r){return zi(e,t)&&Fi(e,r)}var Ng={dev:"https://stg.oneusd.money/",stage:"https://stg.oneusd.money/",production:"https://www.oneusd.money/"};function Tg(e){let t=e.trim().toLowerCase().replace(/\.$/,"");return t==="oneusd.money"||t.endsWith(".oneusd.money")}function Ig(e,t){return e?.items?.find(({id:n,type:o})=>n.toLowerCase()==="oneusd"||o.toLowerCase()==="oneusd")?.url[t]}import*as Os from"react";function Eg(e){let[t,r]=Os.useState(null);return Os.useEffect(()=>{if(!e)return;let n=!0;return Cl().then(o=>{n&&r(o)}).catch(()=>{}),()=>{n=!1}},[e]),t}function Ag(e,t){return t==="bridge"?!0:e==="bridge"||e==="bridge-swap"||e==="swap-bridge"}function Zv(e){if(!e)return"";let[t="0",r=""]=e.replace(/,/g,"").split("."),o=(t.replace(/^0+(?=\d)/,"")||"0").replace(/\B(?=(\d{3})+(?!\d))/g,","),i=r.slice(0,6).replace(/0+$/,"");return i?`${o}.${i}`:o}function Xv(e){return e===56||e===97?"BSC":e===612044||e===612055||e===5555?"ONEchain":`Chain ${e}`}function Mg(e,t){return Ag(e.pathType,t)?"Bridging":"Swapping"}function Lg(e,t){let r=Zv(e.toAmount);if(Ag(e.pathType,t)){let n=`arriving on ${Xv(e.toToken.chainId)}`;return r?`${r} ${n}`:n}return r?`${r} Swapped`:"Transaction completed"}import{jsx as Vr,jsxs as Fg}from"react/jsx-runtime";function Dg(e){return Vr("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:Vr("path",{d:"m7 3-3 3 3 3M4 6h13a3 3 0 0 1 3 3v1M17 21l3-3-3-3m3 3H7a3 3 0 0 1-3-3v-1",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function Pg(e){return Fg("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[Vr("path",{d:"M10 13a4 4 0 0 0 5.66 0l2.83-2.83a4 4 0 0 0-5.66-5.66L11.4 5.94",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),Vr("path",{d:"M14 11a4 4 0 0 0-5.66 0L5.51 13.8a4 4 0 0 0 5.66 5.66l1.42-1.41",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Og(e){return Fg("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[Vr("rect",{x:"4",y:"4",width:"6",height:"6",rx:"1.4",stroke:"currentColor",strokeWidth:"1.7"}),Vr("rect",{x:"14",y:"4",width:"6",height:"6",rx:"1.4",stroke:"currentColor",strokeWidth:"1.7"}),Vr("rect",{x:"4",y:"14",width:"6",height:"6",rx:"1.4",stroke:"currentColor",strokeWidth:"1.7"}),Vr("path",{d:"M14 14h2v2h-2zM18 18h2v2h-2z",fill:"currentColor"})]})}function Bg(e){return Vr("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:Vr("path",{d:"m9 6 6 6-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function zg(e){return Vr("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:Vr("path",{d:"m6 6 12 12M18 6 6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}de(`.gou-fab{--gou-collapse-duration: .24s;--gou-collapse-ease: cubic-bezier(.32, .72, 0, 1);position:fixed;right:var(--gou-right, 2rem);bottom:calc(env(safe-area-inset-bottom,0px) + var(--gou-bottom, 2rem));z-index:var(--gou-z-index, 40);display:inline-flex;width:max-content;align-items:center;gap:8px;padding:4px 20px 4px 4px;border:0;border-radius:9999px;background:#fff;color:#121212;box-shadow:0 4px 20px #00000073;font:inherit;cursor:pointer;transition:gap var(--gou-collapse-duration) var(--gou-collapse-ease),padding var(--gou-collapse-duration) var(--gou-collapse-ease),transform .15s ease,background .15s ease;-webkit-tap-highlight-color:transparent}[data-theme=light] .gou-fab{background:#121212;color:#fff;box-shadow:0 4px 20px #00000040}.gou-fab:active:not(:disabled){transform:scale(.96)}.gou-fab:focus-visible{outline:3px solid #f3742e;outline-offset:3px}.gou-fab[data-icon-only=true]{gap:0;padding:0}.gou-fab:disabled{cursor:default}.gou-fab[data-trigger-mode=button]{position:relative;right:auto;bottom:auto;z-index:auto;vertical-align:middle}[data-gou-mode=button]{display:inline-block}.gou-fab-status{pointer-events:none;cursor:default}.gou-fab-icon-frame{position:relative;display:inline-flex;width:38px;height:38px;flex-shrink:0;border-radius:9999px;transition:width var(--gou-collapse-duration) var(--gou-collapse-ease),height var(--gou-collapse-duration) var(--gou-collapse-ease)}.gou-fab-icon{display:block;width:100%;height:100%;border-radius:inherit;object-fit:contain}.gou-fab[data-icon-only=true] .gou-fab-icon-frame{width:52px;height:52px}.gou-fab-progress-ring{position:absolute;inset:-2px;border:2px solid rgba(243,116,46,.25);border-top-color:#f3742e;border-radius:9999px;animation:gou-spin .9s linear infinite}.gou-fab-label{overflow:hidden;max-width:180px;opacity:1;font-size:14px;font-weight:600;line-height:1.5;white-space:nowrap;transition:max-width var(--gou-collapse-duration) var(--gou-collapse-ease),opacity calc(var(--gou-collapse-duration) * .6) var(--gou-collapse-ease)}.gou-fab[data-icon-only=true] .gou-fab-label{max-width:0;opacity:0}.gou-fab[data-tx-phase] .gou-fab-label{max-width:260px}.gou-fab-trigger-copy{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;line-height:1.25}.gou-fab-apr{color:var(--ds-system-orange-high, #ff7a3d);font-size:11px;font-weight:600;line-height:1.25}.gou-fab[data-tx-phase=success]{animation:gou-result-success 1.2s ease-out}.gou-fab[data-tx-phase=failure]{animation:gou-result-failure 1.2s ease-out}.gou-fab-dots>span{animation:gou-status-dot 1.4s ease-in-out infinite}.gou-fab-dots>span:nth-child(2){animation-delay:.2s}.gou-fab-dots>span:nth-child(3){animation-delay:.4s}.gou-tooltip{position:absolute;right:0;bottom:calc(100% + 8px);pointer-events:none;padding:6px 10px;border-radius:8px;background:#121212;color:#fff;box-shadow:0 8px 24px #0000002e;font-size:12px;font-weight:500;opacity:0;white-space:nowrap;transition:opacity .2s ease}[data-theme=dark] .gou-tooltip{background:#f5f5f5;color:#121212}.gou-fab:hover .gou-tooltip{opacity:1}.gou-shell{--ds-bg-default: #1c1c1d;--ds-bg-dim: #181819;--ds-surface-default: #1c1c1d;--ds-surface-medium: #212224;--ds-surface-high: rgba(255, 255, 255, .08);--ds-border-default: rgba(255, 255, 255, .1);--ds-content-highest: #ffffff;--ds-content-high: rgba(255, 255, 255, .85);--ds-content-medium: rgba(255, 255, 255, .65);--ds-content-low: rgba(255, 255, 255, .4);--ds-accent-primary-default: #f3742e;--ds-accent-primary-high: #f3742e;--ds-accent-primary-low: rgba(243, 116, 46, .1);--ds-accent-primary-on: #ffffff;--gou-bg: #1c1c1d;--gou-card: #212224;--gou-card-hover: rgba(255, 255, 255, .08);--gou-border: rgba(255, 255, 255, .1);--gou-text: #ffffff;--gou-muted: rgba(255, 255, 255, .65);background:var(--gou-bg);color:var(--gou-text)}.gou-shell[data-theme=light]{--ds-bg-default: #ffffff;--ds-bg-dim: #fafbfd;--ds-surface-default: #ffffff;--ds-surface-medium: rgba(0, 0, 0, .01);--ds-surface-high: rgba(0, 0, 0, .03);--ds-border-default: rgba(0, 0, 0, .06);--ds-content-highest: #000000;--ds-content-high: rgba(0, 0, 0, .85);--ds-content-medium: rgba(0, 0, 0, .65);--ds-content-low: rgba(0, 0, 0, .4);--gou-bg: #ffffff;--gou-card: #ffffff;--gou-card-hover: rgba(0, 0, 0, .03);--gou-border: rgba(0, 0, 0, .06);--gou-text: #000000;--gou-muted: rgba(0, 0, 0, .65)}.gou-chooser{overflow:hidden}.gou-chooser-body{position:relative;display:flex;flex-direction:column;gap:24px;padding:24px}.gou-close{position:absolute;top:16px;right:16px;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:transparent;color:var(--gou-muted);cursor:pointer}.gou-close:hover{background:var(--gou-card-hover);color:var(--gou-text)}.gou-close svg{width:20px;height:20px}.gou-intro{display:flex;flex-direction:column;gap:6px;padding:0 32px 0 0;text-align:left}.gou-intro h2{margin:0;color:var(--gou-text);font-size:20px;font-weight:650;line-height:1.6}.gou-intro-link{display:inline-flex;width:fit-content;align-items:center;gap:4px;color:var(--ds-accent-primary-default, #f3742e);font-size:14px;font-weight:600;line-height:1.5;text-decoration:none}.gou-intro-link-icon{flex-shrink:0}.gou-intro-link>span{text-decoration:underline;text-underline-offset:3px}.gou-intro-link:focus-visible{outline:2px solid #f3742e;outline-offset:3px;border-radius:4px}.gou-actions{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.gou-action{display:flex;width:100%;min-width:0;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--gou-border);border-radius:12px;background:var(--gou-card);color:var(--gou-text);font:inherit;text-align:left;cursor:pointer;transition:border-color .15s ease,background .15s ease}.gou-action:hover:not(:disabled){border-color:#f3742e;background:var(--gou-card-hover)}.gou-action:disabled{cursor:not-allowed;opacity:.5}.gou-action:focus-visible{outline:2px solid #f3742e;outline-offset:2px}.gou-action-icon{display:inline-flex;width:32px;height:32px;flex-shrink:0;align-items:center;justify-content:center;border:1px solid var(--gou-border);border-radius:9px;color:var(--gou-text);transition:border-color .15s ease,color .15s ease}.gou-action:hover:not(:disabled) .gou-action-icon{border-color:var(--ds-accent-primary-default, #f3742e);color:var(--ds-accent-primary-default, #f3742e)}.gou-action-icon svg{width:17px;height:17px}.gou-action-copy{display:flex;min-width:0;flex:1;flex-direction:column;gap:2px}.gou-action-title{display:flex;min-width:0;align-items:center;gap:6px;font-size:16px;font-weight:650}.gou-action-description{color:var(--gou-muted);font-size:14px;line-height:1.45}.gou-action-chevron{width:18px;height:18px;flex-shrink:0;color:var(--gou-muted)}.gou-badge{flex-shrink:0;padding:2px 6px;border-radius:5px;background:#f3742e24;color:#f3742e;font-size:10px;font-weight:650}.gou-badge[data-tone=muted]{background:var(--gou-card-hover);color:var(--gou-muted)}.gou-execution{height:auto;max-height:90dvh;overflow:hidden}.gou-execution .bf-root{width:100%;max-height:90dvh}.gou-connect-required,.gou-route-state{display:flex;min-height:360px;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px;text-align:center}.gou-connect-required h3,.gou-route-state h3{margin:0;color:var(--gou-text);font-size:18px}.gou-connect-required p,.gou-route-state p{max-width:320px;margin:0;color:var(--gou-muted);font-size:14px;line-height:1.5}.gou-lock{font-size:28px}.gou-connect-required button{width:100%;max-width:320px;margin-top:10px;padding:12px 16px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #001b18);font:inherit;font-size:16px;font-weight:650;cursor:pointer}.gou-spinner{width:28px;height:28px;border:3px solid var(--gou-border);border-top-color:var(--ds-accent-primary-default, #00ceb2);border-radius:9999px;animation:gou-spin .8s linear infinite}@keyframes gou-spin{to{transform:rotate(360deg)}}@keyframes gou-status-dot{0%,60%,to{opacity:.2}30%{opacity:1}}@keyframes gou-result-success{0%{outline:0 solid rgba(30,202,119,0)}30%{outline:3px solid rgba(30,202,119,.75)}to{outline:0 solid rgba(30,202,119,0)}}@keyframes gou-result-failure{0%{outline:0 solid rgba(255,60,83,0)}30%{outline:3px solid rgba(255,60,83,.75)}to{outline:0 solid rgba(255,60,83,0)}}@media(max-width:767px){.gou-fab{right:var(--gou-right-mobile, 1rem)}.gou-fab-icon-frame{width:32px;height:32px}.gou-fab[data-icon-only=true] .gou-fab-icon-frame{width:40px;height:40px}.gou-chooser-body{padding:24px 16px 28px}.gou-execution{height:auto;max-height:70dvh}.gou-execution .bf-root{max-height:calc(70dvh - 24px)}}@media(prefers-reduced-motion:reduce){.gou-fab,.gou-fab-icon-frame,.gou-fab-label,.gou-tooltip{transition:none}.gou-spinner,.gou-fab-progress-ring{animation-duration:1.6s}.gou-fab[data-tx-phase=success],.gou-fab[data-tx-phase=failure],.gou-fab-dots>span{animation:none}}
21
+ `);import{Fragment as r2,jsx as je,jsxs as Ht}from"react/jsx-runtime";var Jv=[{id:"swap",label:"Swap",eta:"Instant",Icon:Dg},{id:"bridge",label:"Bridge",Icon:Pg},{id:"transfer",label:"Transfer Crypto",eta:"QR deposit",Icon:Og}],$v=4e3;function Ug(e){return e instanceof Error?e.message:typeof e=="string"?e:"Unknown error"}function Bs(e,t){try{e?.(t)}catch{}}function e2({compactTrigger:e,collapseOnScroll:t,scrollThreshold:r}){let[n,o]=qe.useState(!1);return qe.useEffect(()=>{if(t===!1){o(!1);return}let i=r??200,a=i+24,s=Math.max(0,i-24),l=0,d=window.scrollY>i;o(d);let c=()=>{l=0;let f=d?window.scrollY>s:window.scrollY>a;f!==d&&(d=f,o(f))},b=()=>{l||(l=requestAnimationFrame(c))};return window.addEventListener("scroll",b,{passive:!0}),()=>{l&&cancelAnimationFrame(l),window.removeEventListener("scroll",b)}},[t,r]),!!(e||n)}function t2({loading:e}){return Ht("div",{className:"gou-route-state",role:"status",children:[e&&je("span",{className:"gou-spinner","aria-hidden":"true"}),je("h3",{children:e?"Preparing route":"Route unavailable"}),je("p",{children:e?"Loading token and contract configuration.":"The configured ONEUSD route is not available in this environment."})]})}function jg({walletAddress:e,tokens:t,pairs:r,loading:n=!1,bridge:o,relay:i,env:a,targetSymbol:s,relayTargetSymbol:l="ONEUSD",targetIconUrl:d,mode:c="floating",buttonComponent:b,theme:f="dark",mobileBreakpoint:m=768,drawerDirection:y="bottom",dialogWidth:g="480px",drawerMaxWidth:u,drawerMinWidth:p,style:w,className:h,contentClassName:x,hidden:k=!1,compactTrigger:R,collapseOnScroll:I=!0,scrollThreshold:C=200,waitForTransaction:S,transactionResultDurationMs:E=$v,onRequestConnect:M,onEvent:B}){let[L,z]=qe.useState(!1),[A,U]=qe.useState(null),[oe,Y]=qe.useState(!1),[G,H]=qe.useState(null),[ie,te]=qe.useState(!1),O=qe.useRef(0),Z=qe.useRef(!1),_=qe.useRef(null),ce=qe.useRef(!0),xe=e2({compactTrigger:R,collapseOnScroll:I,scrollThreshold:C}),he=qe.useMemo(()=>ot(a),[a]),fe=Ut("apps.json",he,F=>F?.getOneUsd?.modes),ge=Ut("apps.json",he,F=>F?.getOneUsd?.minVersions),Ye=Ut("app-launcher-v2.json",he,F=>Ig(F,he))??Ng[he],be=qe.useMemo(()=>Jv.filter(({id:F})=>zi(F,fe)),[fe]),Te=be.length>0,it=Eg(!k&&Te),We=qe.useMemo(()=>Bi(t,r,"swap"),[r,t]),_e=qe.useMemo(()=>Bi(t,r,"bridge"),[r,t]),Be=We.targetToken??_e.targetToken,rt=s??Be?.symbol??"ONEUSD",Et=d??Be?.iconUrl??rd,ft=c==="floating"&&xe,Ct=c==="button"&&b?b:"button";qe.useEffect(()=>(ce.current=!0,()=>{ce.current=!1,_.current&&clearTimeout(_.current)}),[]),qe.useEffect(()=>{te(!Tg(window.location.hostname))},[]),qe.useEffect(()=>{Te||z(!1)},[Te]);let Se=qe.useCallback(F=>B?.(F),[B]),wt=qe.useCallback(()=>{G||!Te||(Se({name:"fab_click",state:ft?"icon_only":"expanded"}),z(!0))},[Se,Te,G,ft]),yt=qe.useCallback(F=>{G||!Ps(F,fe,ge)||(Se({name:"action_select",action:F}),z(!1),F==="transfer"&&Y(!0),U(F))},[Se,fe,ge,G]),St=qe.useCallback(F=>{Se({name:"connect_click",action:F}),Promise.resolve(M?.()).catch(ke=>{Se({name:"failure",action:F,message:Ug(ke)})})},[Se,M]),Ke=A==="swap"||A==="bridge"?A:null,Xe=Ke==="swap"?We:_e,$t=!!(r&&Xe.targetToken&&Xe.fromTokens.length>0),At=qe.useMemo(()=>{if(!Xe.targetToken)return;let F=Xe.targetToken;return ke=>{let P=o.getToTokens?.(ke,t);return P&&!Ds(P,F)?[]:[F]}},[o.getToTokens,Xe.targetToken,t]),{onSubmitted:zt,onSuccess:Mt,onFailed:nt,...Ge}=o,{onDeposited:at,onError:Nt,...Pe}=i??{},st=qe.useCallback((F,ke,P,ae,pe)=>{!ce.current||O.current!==F||(H({id:F,phase:ke,action:P,label:ae,txHash:pe}),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{!ce.current||O.current!==F||(Z.current=!1,H(null),_.current=null)},Math.max(0,E)))},[E]),_t=qe.useCallback((F,ke)=>{if(Z.current)return;Z.current=!0;let P=++O.current,ae=Mg(F,ke);H({id:P,phase:"pending",action:ke,label:ae,txHash:F.txHash}),z(!1),U(null),Bs(zt,F),Promise.resolve().then(()=>S?.(F)).then(()=>{!ce.current||O.current!==P||(st(P,"success",ke,Lg(F,ke),F.txHash),Se({name:"success",action:ke,txHash:F.txHash}))}).catch(pe=>{if(!ce.current||O.current!==P)return;let me=Ug(pe);st(P,"failure",ke,"Transaction failed",F.txHash),Bs(nt,{message:me,txHash:F.txHash}),Se({name:"failure",action:ke,message:me})})},[Se,nt,zt,st,S]);return je(ye,{feature:"get_one_usd",children:Ht("div",{className:h,"data-theme":f,"data-gou-mode":c,children:[Ht(An,{theme:f,mobileBreakpoint:m,drawerDirection:y,dialogWidth:g,drawerMaxWidth:u,drawerMinWidth:p,open:L,onOpenChange:z,children:[!k&&Te&&(c==="button"||!G)&&Ht(Ct,{type:"button",className:"gou-fab",style:w,"data-trigger-mode":c,"data-icon-only":ft?"true":"false",onClick:wt,disabled:!!G,"aria-label":`Get ${rt}`,"data-track":"fab_click",children:[c==="floating"&&Ht("span",{className:"gou-tooltip",children:["Choose how to get ",rt]}),je("span",{className:"gou-fab-icon-frame",children:je("img",{className:"gou-fab-icon",src:Et,alt:""})}),Ht("span",{className:"gou-fab-label gou-fab-trigger-copy",children:[Ht("span",{children:["Get ",rt]}),it!==null&&je("span",{className:"gou-fab-apr",children:Ma(it)})]})]}),G&&Ht("div",{className:"gou-fab gou-fab-status",style:c==="floating"?w:void 0,"data-floating-status":"true","data-icon-only":"false","data-tx-phase":G.phase,role:"status","aria-live":"polite","aria-label":G.phase==="pending"?`${G.label} transaction in progress`:G.label,children:[Ht("span",{className:"gou-fab-icon-frame",children:[je("img",{className:"gou-fab-icon",src:Et,alt:""}),G.phase==="pending"&&je("span",{className:"gou-fab-progress-ring","aria-hidden":"true"})]}),je("span",{className:"gou-fab-label",children:G.phase==="pending"?Ht(r2,{children:[G.label,Ht("span",{className:"gou-fab-dots","aria-hidden":"true",children:[je("span",{children:"."}),je("span",{children:"."}),je("span",{children:"."})]})]}):G.label})]}),je(Mn,{ariaTitle:`Get ${rt}`,className:`gou-shell gou-chooser ${x??""}`,children:Ht("div",{className:"gou-chooser-body",children:[je("button",{type:"button",className:"gou-close",onClick:()=>z(!1),"aria-label":"Close",children:je(zg,{})}),Ht("header",{className:"gou-intro",children:[Ht("h2",{children:["Get ",rt]}),ie&&Ht("a",{className:"gou-intro-link",href:Ye,target:"_blank",rel:"noopener noreferrer","aria-label":"What is ONEUSD? Opens in a new tab","data-track":"oneusd_learn_more",children:[je(Gp,{size:16,className:"gou-intro-link-icon"}),je("span",{children:"What is ONEUSD?"})]})]}),je("ul",{className:"gou-actions",children:be.map(({id:F,label:ke,eta:P,Icon:ae})=>{let pe=F==="swap"?`Swap the ${We.fromTokens[0]?.symbol??"ONE"} you already hold`:F==="bridge"?`Bridge USDT to ${rt}`:"Deposit from any chain or exchange",me=F==="swap"?r?.swap.feeDelegated:F==="bridge"?r?.bridge.feeDelegated:!1,Je=Fi(F,ge);return je("li",{children:Ht("button",{type:"button",className:"gou-action",onClick:()=>yt(F),disabled:!Je,"data-supported":Je?"true":"false","data-track":"action_select","data-track-id":F,children:[je("span",{className:"gou-action-icon",children:je(ae,{})}),Ht("span",{className:"gou-action-copy",children:[Ht("span",{className:"gou-action-title",children:[je("span",{children:ke}),me&&Je&&je("span",{className:"gou-badge",children:"Fee Delegated"}),!Je&&je("span",{className:"gou-badge","data-tone":"muted",children:"Update required"})]}),je("span",{className:"gou-action-description",children:Je?P?`${pe} \xB7 ${P}`:pe:"Update the app to use this option"})]}),je(Bg,{className:"gou-action-chevron"})]})},F)})})]})})]}),je(An,{theme:f,mobileBreakpoint:m,drawerDirection:y,dialogWidth:g,drawerMaxWidth:u,drawerMinWidth:p,open:!!Ke,onOpenChange:F=>{F||U(null)},children:je(Mn,{ariaTitle:`${Ke==="bridge"?"Bridge":"Swap"} to ${rt}`,className:`gou-shell gou-execution ${x??""}`,children:$t?je(Go,{...Ge,env:a,variant:"embedded",title:Ke==="bridge"?"Bridge":"Swap",feeDelegated:r?.swap.feeDelegated,walletAddress:e??"",isConnected:!!e,onRequestConnect:()=>St(Ke??"swap"),tokens:Xe.fromTokens,initialFromToken:Xe.fromTokens[0],initialToToken:Xe.targetToken,getToTokens:At,onClose:()=>U(null),onBackToWallet:()=>{U(null),z(!0)},onSubmitted:F=>{_t(F,Ke??"swap")},onSuccess:F=>{Bs(Mt,F)},onFailed:F=>{Bs(nt,F),Se({name:"failure",action:Ke??"swap",message:F.message})}},`${Ke}:${Xe.fromTokens.map(F=>`${F.chainId}:${F.address}`).join(",")}`):je(t2,{loading:n||!r})})}),oe&&je(Oi,{...Pe,environment:Pe.environment??a,theme:Pe.theme??f,mobileBreakpoint:Pe.mobileBreakpoint??m,drawerDirection:Pe.drawerDirection??y,dialogWidth:Pe.dialogWidth??g,drawerMaxWidth:Pe.drawerMaxWidth??u,drawerMinWidth:Pe.drawerMinWidth??p,walletAddress:e,open:A==="transfer",onOpenChange:F=>{F||U(null)},requireWalletConnection:!0,showRecovery:Pe.showRecovery??!0,showRecipientInput:!1,hideAmount:!0,targetTokens:[l],defaultTarget:l,onRequestConnect:()=>St("transfer"),onDeposited:F=>{at?.(F),Se({name:"success",action:"transfer",txHash:F})},onError:F=>{Nt?.(F),Se({name:"failure",action:"transfer",message:F.message})},children:je(Oi.Content,{})})]})})}import*as yn from"react";import*as Kg from"@radix-ui/react-dialog";import{Drawer as u2}from"vaul";import{createContext as n2,useContext as o2}from"react";var zs=n2(null);function Ui(){let e=o2(zs);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}import{useState as Wg,useEffect as i2,useCallback as a2}from"react";function Fs(){let[e,t]=Wg([]),[r,n]=Wg(!0);i2(()=>{if(typeof window>"u"){n(!1);return}let i=[],a=l=>{let{info:d}=l.detail;d?.rdns&&!i.some(c=>c.rdns===d.rdns)&&(i.push({rdns:d.rdns,name:d.name,icon:d.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let s=setTimeout(()=>n(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(s)}},[]);let o=a2(i=>e.some(a=>a.rdns===i),[e]);return{wallets:e,isDetected:o,isLoading:r}}import*as Gg from"@radix-ui/react-dialog";import{Drawer as s2}from"vaul";import{jsx as Id}from"react/jsx-runtime";function Hg({asChild:e,children:t}){let{isMobile:r}=Ui(),n=r?s2.Trigger:Gg.Trigger;return Id(ye,{feature:"wallet_connect",children:Id(n,{asChild:e??t!=null,children:t??Id("button",{type:"button","data-track":"open",children:"Connect Wallet"})})})}import{useEffect as l2}from"react";import{WALLET_LABELS as d2}from"@nexus-cross/crossx-design-system";import*as wn from"@radix-ui/react-dialog";import{Drawer as Us}from"vaul";import{Fragment as qg,jsx as Ce,jsxs as ir}from"react/jsx-runtime";function _g(e,t){Qe("connect","wallet_selected",{tags:{item_id:e}}),Lp(e);let r=t?.();r instanceof Promise&&r.then(()=>Qe("connect","connected"),n=>Qe("connect","connected",{status:"failure",reason:Cr(n)}))}function c2({wallet:e,detected:t,onConnect:r}){let n=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}r()},o=e.icon,i=e.featured===!0;return ir("button",{type:"button",className:Re("wcm-wallet-item",i&&"wcm-wallet-item--featured"),"data-track":"wallet_item_click","data-track-id":e.id,onClick:n,children:[ir("div",{className:"wcm-wallet-item-left",children:[Ce("div",{className:"wcm-wallet-icon",children:Ce(o,{})}),ir("div",{className:"wcm-wallet-name-row",children:[Ce("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&Ce("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?Ce("span",{className:"wcm-installed-label",children:"Installed"}):Ce("span",{className:"wcm-install-btn",children:"Install"}))]})}function p2({social:e,onSignIn:t}){let r=e.icon,n=`Sign in with ${e.name}`;return ir("button",{type:"button",className:"wcm-social-item","data-provider":e.id,"data-track":"social_provider_click","data-track-id":e.id,onClick:t,"aria-label":n,children:[Ce("span",{className:"wcm-social-icon",children:Ce(r,{})}),Ce("span",{className:"wcm-social-name",children:n})]})}function Qg(){let{wallets:e,activeWalletIds:t,socialProviders:r,activeSocialIds:n,termsUrl:o,privacyUrl:i,isDetected:a,close:s,isMobile:l}=Ui(),d=t.filter(f=>{let m=Tl(f).visibility;return!m||m==="always"?!0:m==="desktop-only"?!l:m==="mobile-only"?l:!0}),c=n.length>0,b=d.length>0;return ir(qg,{children:[ir("div",{className:"wcm-header",children:[ir("div",{className:"wcm-header-text",children:[Ce("h2",{className:"wcm-title",children:d2.default}),!l&&Ce("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),Ce("button",{type:"button",className:"wcm-close-btn","data-track":"close",onClick:s,"aria-label":"Close",children:Ce(Ep,{})})]}),ir("div",{className:"wcm-body",children:[c&&ir(qg,{children:[!l&&ir("div",{className:"wcm-section-header",children:[Ce("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),Ce("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),Ce("div",{className:"wcm-social-grid",children:n.map(f=>{let m=Ap(f);return Ce(p2,{social:m,onSignIn:()=>{_g(f,r[f]),s()}},f)})}),b&&ir("div",{className:"wcm-separator",children:[Ce("div",{className:"wcm-separator-line"}),Ce("span",{className:"wcm-separator-text",children:"Other Wallets"}),Ce("div",{className:"wcm-separator-line"})]})]}),b&&Ce("div",{className:"wcm-wallet-list",children:d.map(f=>{let m=Tl(f),y=m.rdns?a(m.rdns):!1;return Ce(c2,{wallet:m,detected:y,onConnect:()=>{_g(f,e[f]),s()}},f)})}),ir("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",Ce(Vg,{href:o,track:"terms_link",children:"Terms of Service"})," ","and consent to its"," ",Ce(Vg,{href:i,track:"privacy_link",children:"Privacy Policy"}),"."]})]})]})}function Vg({href:e,track:t,children:r}){return e?Ce("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer","data-track":t,children:r}):Ce("span",{className:"wcm-terms-link",children:r})}function Yg({className:e}){let{isMobile:t,theme:r,portalStyle:n,open:o}=Ui();return l2(()=>{o&&Qe("connect","opened")},[o]),t?Ce(ye,{feature:"wallet_connect",children:ir(Us.Portal,{children:[Ce(Us.Overlay,{className:"wcm-overlay"}),ir(Us.Content,{className:Re("wcm-drawer-content",e),"data-theme":r,style:n,children:[Ce(Us.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),Ce("div",{className:"wcm-drawer-handle"}),Ce("div",{className:"wcm-drawer-body",children:Ce(Qg,{})})]})]})}):Ce(ye,{feature:"wallet_connect",children:ir(wn.Portal,{children:[Ce(wn.Overlay,{className:"wcm-overlay"}),ir(wn.Content,{className:Re("wcm-dialog-content",e),"data-theme":r,style:n,children:[Ce(wn.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),Ce(wn.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),Ce("div",{className:"wcm-dialog-body",children:Ce(Qg,{})})]})]})})}de(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:var(--ds-overlay-dim, rgba(0, 0, 0, .5));-webkit-backdrop-filter:var(--ds-bg-blur-7, blur(3.5px));backdrop-filter:var(--ds-bg-blur-7, blur(3.5px))}.wcm-dialog-content{-webkit-font-smoothing:antialiased;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--wcm-dialog-width, 480px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-radius:24px;box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));outline:none;animation:wcm-dialog-show .2s ease-out;font-family:inherit}.wcm-dialog-content[data-state=closed]{animation:wcm-dialog-hide .15s ease-in}.wcm-dialog-body,.wcm-drawer-body{scrollbar-width:thin;scrollbar-color:var(--ds-border-medium, rgba(0, 0, 0, .18)) transparent}.wcm-dialog-body::-webkit-scrollbar,.wcm-drawer-body::-webkit-scrollbar{width:4px}.wcm-dialog-body::-webkit-scrollbar-track,.wcm-drawer-body::-webkit-scrollbar-track{background:transparent}.wcm-dialog-body::-webkit-scrollbar-thumb,.wcm-drawer-body::-webkit-scrollbar-thumb{background:var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:4px}.wcm-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--wcm-drawer-max-width, none);min-width:var(--wcm-drawer-min-width, 0);max-height:85dvh;margin:0 auto;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-top-left-radius:16px;border-top-right-radius:16px;outline:none;font-family:inherit;box-sizing:border-box}.wcm-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:16px 0 0 16px}.wcm-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:0 16px 16px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--ds-border-medium, rgba(0, 0, 0, .18));margin:12px auto 8px;flex-shrink:0}.wcm-drawer-content[data-vaul-drawer-direction=left] .wcm-drawer-handle,.wcm-drawer-content[data-vaul-drawer-direction=right] .wcm-drawer-handle{display:none}.wcm-dialog-body,.wcm-drawer-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.wcm-drawer-body{overscroll-behavior:contain}.wcm-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-header-text{display:flex;flex-direction:column;gap:4px;min-width:0}.wcm-title{font-family:Inter,sans-serif;font-weight:600;font-size:20px;line-height:1.25;letter-spacing:0;color:var(--ds-content-highest, #000000);margin:0}.wcm-subtitle{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));margin:0}.wcm-close-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border:none;background:transparent;color:var(--ds-content-low, #00000066);cursor:pointer;padding:0;transition:opacity .15s ease}.wcm-close-btn:hover{opacity:.6}.wcm-close-btn>svg{width:24px;height:24px}.wcm-divider{display:none}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:24px}.wcm-section-header{display:flex;align-items:center;gap:8px;width:100%}.wcm-section-title{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1;letter-spacing:0;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-recommended-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-low, #fff5ee);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-high, #f0640d);white-space:nowrap}.wcm-social-grid{display:grid;gap:8px;width:100%}.wcm-dialog-body .wcm-social-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wcm-drawer-body .wcm-social-grid{grid-template-columns:1fr}.wcm-social-item{display:flex;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;transition:none;font-family:inherit;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-social-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-social-item:hover{background:#eff3f8!important}.wcm-social-item[data-provider=apple] .wcm-social-icon{color:#000}[data-theme=dark] .wcm-social-item[data-provider=apple] .wcm-social-icon{color:#fff}.wcm-dialog-body .wcm-social-item{flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px}.wcm-drawer-body .wcm-social-item{flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;padding:16px}.wcm-social-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.wcm-social-icon>svg{width:32px;height:32px}.wcm-social-name{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:12px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-separator-text{font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-wallet-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:20px 16px;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;text-align:left;transition:none;font-family:inherit}.wcm-wallet-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-wallet-item:hover{background:#eff3f8!important}.wcm-wallet-item-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg,.wcm-wallet-icon>img{width:28px;height:28px;border-radius:0;object-fit:cover}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px;min-width:0}.wcm-wallet-name{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-system-purple-low, #f5f3ff);border:.5px solid var(--ds-system-purple-default, #7e54f4);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-purple-high, #7346f3);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:#ff8438;border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:#fff;white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-terms{font-family:Inter,sans-serif;font-weight:400;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;margin:0}.wcm-terms-link{color:var(--ds-content-high, rgba(0, 0, 0, .85));text-decoration:underline;text-underline-position:from-font}.wcm-terms-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));text-decoration:underline}.wcm-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
22
22
  `);de(`@keyframes wcm-overlay-show{0%{opacity:0}to{opacity:1}}@keyframes wcm-overlay-hide{0%{opacity:1}to{opacity:0}}@keyframes wcm-dialog-show{0%{opacity:0;transform:translate(-50%,-48%) scale(.96)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes wcm-dialog-hide{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-48%) scale(.96)}}
23
23
  `);import{jsx as ji}from"react/jsx-runtime";var f2={};function m2({wallets:e,socialProviders:t=f2,termsUrl:r,privacyUrl:n,theme:o="dark",mobileBreakpoint:i=768,drawerDirection:a="bottom",dialogWidth:s,drawerMaxWidth:l,drawerMinWidth:d,style:c,open:b,onOpenChange:f,children:m}){let y=Ao(`(max-width: ${i}px)`),[g,u]=yn.useState(!1),p=b!==void 0,w=p?b:g,h=yn.useCallback(M=>{p||u(M),f?.(M)},[p,f]),x=yn.useCallback(()=>h(!1),[h]);Ln(w,x);let{isDetected:k}=Fs(),R=yn.useMemo(()=>Object.keys(e),[e]),I=yn.useMemo(()=>Object.keys(t),[t]),C=yn.useMemo(()=>{let M={};return s&&(M["--wcm-dialog-width"]=s),l&&(M["--wcm-drawer-max-width"]=l),d&&(M["--wcm-drawer-min-width"]=d),{...M,...c}},[s,l,d,c]),S=yn.useMemo(()=>({theme:o,isMobile:y,open:w,setOpen:h,close:x,wallets:e,activeWalletIds:R,socialProviders:t,activeSocialIds:I,termsUrl:r??ma,privacyUrl:n??ga,isDetected:k,portalStyle:C}),[o,y,w,h,x,e,R,t,I,r,n,k,C]),E=ji("div",{"data-theme":o,style:C,children:m});return y?ji(zs.Provider,{value:S,children:ji(u2.Root,{direction:a,open:w,onOpenChange:h,noBodyStyles:!0,children:E},"drawer")}):ji(zs.Provider,{value:S,children:ji(Kg.Root,{open:w,onOpenChange:h,children:E})})}var Zg=Object.assign(m2,{Trigger:Hg,Content:Yg});import{WALLET_LABELS as x2}from"@nexus-cross/crossx-design-system";import*as Jg from"react";de(`.cb-button{--cb-bg: var(--ds-accent-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));--cb-bg-hover: var(--cb-bg);--cb-color: #ffffff;--cb-border: none;--cb-radius: 8px;--cb-height: 36px;--cb-padding: 8px 16px;--cb-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-font-size: 14px;--cb-font-weight: 500;--cb-line-height: 1.5;--cb-letter-spacing: -.01em;--cb-gap: 8px;--cb-transition: opacity .15s;--cb-loading-opacity: .7;--cb-press-scale: .95;--cb-icon-size: 18px;--cb-spinner-size: 18px;--cb-spinner-thumb: currentColor;--cb-spinner-track: color-mix(in srgb, currentColor 20%, transparent)}.cb-pill{--cb-pill-bg: var(--ds-surface-default, #ffffff);--cb-pill-bg-hover: var(--cb-pill-bg);--cb-pill-color: var(--ds-content-high, rgba(0, 0, 0, .85));--cb-pill-border: 1px solid var(--ds-border-default, rgba(0, 0, 0, .07));--cb-pill-border-hover: 1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));--cb-pill-radius: 8px;--cb-pill-height: 36px;--cb-pill-padding: 1px 13px;--cb-pill-press-scale: .95;--cb-pill-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-pill-font-size: 14px;--cb-pill-font-weight: 500;--cb-pill-line-height: 1.5;--cb-pill-gap: 8px;--cb-pill-icon-size: 18px;--cb-pill-icon-placeholder-bg: var(--ds-surface-medium, #f5f7fa);--cb-pill-address-font: Inter, system-ui, -apple-system, sans-serif;--cb-pill-address-font-size: 14px;--cb-pill-address-letter-spacing: -.01em}
24
24
  `);de(`.cb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-height);gap:var(--cb-gap);padding:var(--cb-padding);border-radius:var(--cb-radius);border:var(--cb-border);background:var(--cb-bg);color:var(--cb-color);font-family:var(--cb-font-family);font-size:var(--cb-font-size);font-weight:var(--cb-font-weight);line-height:var(--cb-line-height);letter-spacing:var(--cb-letter-spacing);cursor:pointer;transition:var(--cb-transition)}.cb-button:hover:not(:disabled){background:var(--cb-bg-hover)}.cb-button:active:not(:disabled){transform:scale(var(--cb-press-scale))}.cb-button:disabled,.cb-button[aria-busy=true]{cursor:default;opacity:var(--cb-loading-opacity)}.cb-spinner{display:inline-block;width:var(--cb-spinner-size);height:var(--cb-spinner-size);border:2px solid var(--cb-spinner-track);border-top-color:var(--cb-spinner-thumb);border-radius:50%;animation:cb-spin .6s linear infinite;flex-shrink:0}.cb-button-icon{width:var(--cb-icon-size);height:var(--cb-icon-size);flex-shrink:0}.cb-button-label{white-space:nowrap}.cb-pill{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-pill-height);gap:var(--cb-pill-gap);padding:var(--cb-pill-padding);border-radius:var(--cb-pill-radius);border:var(--cb-pill-border);background:var(--cb-pill-bg);color:var(--cb-pill-color);font-family:var(--cb-pill-font-family);font-size:var(--cb-pill-font-size);font-weight:var(--cb-pill-font-weight);line-height:var(--cb-pill-line-height);cursor:pointer}.cb-pill:hover{background:var(--cb-pill-bg-hover)}.cb-pill:active:not(:disabled){transform:scale(var(--cb-pill-press-scale))}.cb-pill-icon{width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;object-fit:contain;flex-shrink:0;background:transparent}[data-theme=dark] .cb-pill-icon[data-provider=apple]{filter:invert(1)}.cb-pill-icon-placeholder{display:inline-block;width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;background:var(--cb-pill-icon-placeholder-bg);flex-shrink:0}.cb-pill-address{font-family:var(--cb-pill-address-font);font-size:var(--cb-pill-address-font-size);letter-spacing:var(--cb-pill-address-letter-spacing);white-space:nowrap}@media(max-width:767.98px){.cb-button,.cb-pill{width:36px;min-width:36px;padding:0}.cb-button{height:36px}.cb-button-label,.cb-pill-address{display:none}}@keyframes cb-spin{to{transform:rotate(360deg)}}