@nexus-cross/dapp-ui 1.3.3-beta.5 → 1.3.3-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ function Ur(e){try{return import.meta.env?.[e]}catch{return}}function $r(e){if(!
|
|
|
4
4
|
`);z(`.al-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;border-radius:24px;background:var(--al-bg);border:1px solid var(--al-popover-border, var(--al-border));box-shadow:var(--al-popover-shadow, var(--al-shadow));animation:al-fade-in .15s ease-out;max-height:80vh;overflow-x:hidden;overflow-y:auto;padding:20px 4px;box-sizing:border-box}.al-popover-content .al-grid{grid-template-columns:repeat(4,100px);row-gap:16px;column-gap:0;padding:0;justify-content:center;align-items:start}.al-popover-content .al-grid-item{flex-direction:column;justify-content:flex-start;align-items:center;gap:6px;padding:12px 0;width:100px;min-width:0;border-radius:10px}.al-popover-content .al-grid-item-left{flex-direction:column;align-items:center;gap:8px;width:100%;overflow:visible}.al-popover-content .al-grid-item-icon{width:50px;height:50px;border-radius:10.125px;overflow:hidden}.al-popover-content .al-grid-item-icon img{object-fit:cover}.al-popover-content .al-grid-item-label{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:1.1;letter-spacing:0;text-align:center;color:var(--al-text);max-width:100%;white-space:normal;overflow-wrap:anywhere}.al-popover-content .al-grid-item-right,.al-popover-content .al-badge-new{display:none}.al-drawer-overlay{position:fixed;inset:0;z-index:100000;background:var(--al-drawer-overlay)}.al-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;background:var(--al-bg);overflow-x:hidden;overflow-y:hidden;display:flex;flex-direction:column;box-sizing:border-box}.al-drawer-body{flex:1;overflow-y:auto;overscroll-behavior-y:contain;min-height:0}.al-drawer-content .al-grid{display:flex;flex-direction:column;grid-template-columns:none;max-width:100%;overflow:hidden;flex-shrink:0;gap:0;row-gap:0;column-gap:0;padding:8px 16px}.al-drawer-content .al-grid-item{width:100%;max-width:100%;gap:8px;padding:16px 12px;border-radius:8px;overflow:hidden;background:transparent}.al-drawer-content .al-grid-item:hover,.al-drawer-content .al-grid-item[data-active=true]{background:var(--al-bg-hover)}.al-drawer-content .al-grid-item-left{gap:8px;flex:1 1 auto;min-width:0}.al-drawer-content .al-grid-item-icon{width:32px;height:32px;border-radius:6.75px;overflow:hidden}.al-drawer-content .al-grid-item-icon img{width:100%;height:100%;object-fit:cover;border-radius:6.75px}.al-drawer-content .al-grid-item-label{font-size:16px;line-height:1.35;letter-spacing:0;font-weight:400}.al-drawer-content .al-grid-item[data-active=true] .al-grid-item-label{font-weight:500}.al-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0}.al-drawer-title{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--al-text);margin:0}.al-drawer-close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--ds-content-low, #00000066);transition:opacity .15s ease}.al-drawer-close:hover{opacity:.7}.al-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:4px;padding:8px}.al-grid-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 12px;border:none;background:var(--al-bg);border-radius:8px;cursor:pointer;transition:none;color:var(--al-text);text-align:left;font-family:Inter,sans-serif;flex-shrink:0}.al-grid-item:hover,.al-grid-item[data-active=true]{background:#252b39!important}:root[data-ds-theme=light] .al-grid-item:hover,:root[data-ds-theme=light] .al-grid-item[data-active=true]{background:#eff3f8!important}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden}.al-grid-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain}.al-grid-item-label{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:150%;letter-spacing:0;color:var(--al-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.al-badge{display:flex;padding:1px 4px 2px;justify-content:center;align-items:center;gap:2px;border-radius:3px;background:var(--al-badge-bg);color:var(--al-badge-text);font-family:Pretendard,Inter,sans-serif;font-size:10px;font-weight:600;line-height:150%;letter-spacing:0;white-space:nowrap;flex-shrink:0}.al-badge-new{display:flex;width:16px;height:16px;justify-content:center;align-items:center;aspect-ratio:1/1;border-radius:12px;background:var(--ds-system-purple-high, #7346f3);color:var(--al-badge-new-text);font-family:Pretendard,Inter,sans-serif;font-size:9px;font-weight:700;flex-shrink:0}
|
|
5
5
|
`);z("");import{jsx as Ko}from"react/jsx-runtime";function qr({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let a=dn(`(max-width: ${n}px)`),[i,s]=pn.useState(!1),c=pn.useCallback(()=>s(!1),[]),l=Be(e),d=pn.useMemo(()=>({env:l,theme:t,isMobile:a,open:i,domain:o,close:c}),[l,t,a,i,o,c]);return Ko(qo.Provider,{value:d,children:a?Ko(rl.Root,{direction:"right",open:i,onOpenChange:s,noBodyStyles:!0,children:r},"drawer"):Ko(Vr.Root,{open:i,onOpenChange:s,children:r},"popover")})}import*as Zr from"@radix-ui/react-popover";import{Drawer as al}from"vaul";import{jsx as qe,jsxs as il}from"react/jsx-runtime";function Kr({size:e=18}){return il("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[qe("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),qe("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),qe("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),qe("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),qe("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),qe("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),qe("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),qe("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),qe("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Qr(){return qe("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:qe("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Yr(){return qe("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:qe("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as Qn}from"react/jsx-runtime";function Xr({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:a}=Kn(),i=t!=null,s=e??!0,c=n?`al-trigger-btn ${n}`:"al-trigger-btn",l=i?t:Qn("button",{type:"button",className:c,"data-theme":a,style:o,children:Qn(Kr,{size:18})});return r?Qn(al.Trigger,{asChild:s,children:l}):Qn(Zr.Trigger,{asChild:s,children:l})}import*as Jt from"react";import*as Zn from"@radix-ui/react-popover";import{Drawer as fn}from"vaul";import{useQuery as cl}from"@tanstack/react-query";var Jr={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json"};var sl="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",ll="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function ut(e,t){return`${e==="production"?ll:sl}/${t}.png`}function ei(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://dev-x.crosstoken.io/gametoken/CROSS",stage:"https://stg-x.crosstoken.io/gametoken/CROSS",production:"https://x.crosstoken.io/gametoken/CROSS"},iconUrl:ut(t,"dex"),order:1e3,type:"gametoken",badge:null,isNew:!1},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg-x.crosstoken.io/forge",stage:"https://stg-x.crosstoken.io/forge",production:"https://x.crosstoken.io/forge"},iconUrl:ut(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0},{id:"crossd",label:"Bridge (CROSSD)",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:ut(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:ut(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg-x.crosstoken.io/rewards",stage:"https://stg-x.crosstoken.io/rewards",production:"https://x.crosstoken.io/rewards"},iconUrl:ut(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:ut(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1},{id:"play",label:"Play",description:"Discover and play games on CROSS.",url:{dev:"https://stg-play.cross.nexus",stage:"https://stg-play.cross.nexus",production:"https://play.cross.nexus"},iconUrl:ut(t,"play"),order:8500,type:"play",badge:null,isNew:!0},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://www.dev.cross.shop/",stage:"https://www.stage.cross.shop/",production:"https://www.cross.shop/"},iconUrl:ut(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg-x.crosstoken.io/points",stage:"https://stg-x.crosstoken.io/points",production:"https://x.crosstoken.io/points"},iconUrl:ut(t,"point"),order:1e4,type:"points",badge:null,isNew:!1},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg-wave.crosstoken.io/en",stage:"https://stg-wave.crosstoken.io/en",production:"https://wave.crosstoken.io/en"},iconUrl:ut(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.crosstoken.io/612055",stage:"https://stg-explorer.crosstoken.io/612055",production:"https://explorer.crosstoken.io/612055"},iconUrl:ut(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1}]}}function Yn(e){let t=Be(e);return cl({queryKey:["global-menu",t],queryFn:async({signal:n})=>{try{let o=await fetch(Jr[t],{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch global menu: ${o.status}`);return o.json()}catch(o){if(n.aborted)throw o;return ei(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function X(...e){return e.filter(Boolean).join(" ")}import{jsx as Re,jsxs as Nn}from"react/jsx-runtime";function dl(e){return e.id==="cross-staking"||e.type==="cross-staking"}function ni({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:a,domain:i,close:s}=Kn(),{data:c}=Yn(o),l=Jt.useMemo(()=>(c?.items??[]).sort((w,k)=>w.order-k.order),[c]),d=8,u=Jt.useRef(null),h=Jt.useCallback(w=>{u.current={x:w.clientX,y:w.clientY}},[]),m=typeof window<"u"?window.location.pathname:"",v=Jt.useCallback((w,k)=>{if(u.current){let I=w.clientX-u.current.x,C=w.clientY-u.current.y;if(u.current=null,Math.abs(I)>d||Math.abs(C)>d)return}let P=k.url[o]??k.url.production,f=ti(P,i);if(!f)try{let I=new URL(P).pathname;if(m===I||m.startsWith(I+"/")){s();return}}catch{}f?window.open(P,"_blank","noopener,noreferrer"):window.location.href=P,s()},[o,i,s,m]),x=Re("div",{className:"al-grid","data-theme":r,children:l.map(w=>{let k=w.url[o]??w.url.production,P=ti(k,i),f=!1;if(!P)try{let I=new URL(k).pathname;f=m===I||m.startsWith(I+"/")}catch{f=!1}return Nn("button",{type:"button",className:"al-grid-item","data-active":f||void 0,onPointerDown:h,onClick:I=>v(I,w),children:[Nn("div",{className:"al-grid-item-left",children:[Re("div",{className:"al-grid-item-icon",children:Re("img",{src:w.iconUrl,alt:w.label,width:24,height:24,loading:"lazy"})}),Re("span",{className:"al-grid-item-label",children:w.label}),w.isNew&&Re("span",{className:"al-badge-new",children:"N"})]}),Re("div",{className:"al-grid-item-right",children:w.badge&&!dl(w)&&Re("span",{className:"al-badge",children:w.badge})})]},w.id)})});return a?Nn(fn.Portal,{children:[Re(fn.Overlay,{className:"al-drawer-overlay"}),Nn(fn.Content,{className:X("al-drawer-content",n),"data-theme":r,children:[Nn("div",{className:"al-drawer-header",children:[Re(fn.Close,{className:"al-drawer-close",children:Re(Qr,{})}),Re(fn.Title,{className:"al-drawer-title",children:"CROSS Services"}),Re(fn.Close,{className:"al-drawer-close",children:Re(Yr,{})})]}),Re("div",{className:"al-drawer-body",children:x})]})]}):Re(Zn.Portal,{children:Re(Zn.Content,{align:e,sideOffset:t,className:X("al-popover-content",n),"data-theme":r,children:x})})}function ti(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}import*as Oe from"react";import*as gs from"@radix-ui/react-popover";import{Drawer as qd}from"vaul";import{createContext as pl,useContext as fl}from"react";var Qo=pl(null);function Wt(){let e=fl(Qo);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Yo=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(Yo||{}),Xn={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};import*as ji from"react";import{jsx as q,jsxs as In}from"react/jsx-runtime";function oi({size:e=16,className:t}){return In("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[q("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"}),q("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 Tn({size:e=16,className:t}){return q("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:q("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function en({size:e=16,className:t}){return q("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:q("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ct({size:e=24,className:t}){return q("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:q("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function ri({size:e=20,className:t}){return In("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[q("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"}),q("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 Zo({size:e=20,className:t}){return q("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:q("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function tn({size:e=20,className:t}){return q("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:q("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function nn({size:e=20,className:t}){return q("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:q("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function ii({size:e=16,className:t}){return In("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[q("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"}),q("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 ai({size:e=16,className:t}){return In("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[q("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"}),q("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function si({size:e=42,className:t}){return q("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:q("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}function li({size:e=20,className:t}){return q("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:q("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 ci({size:e=20,className:t}){return q("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:q("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 di({size:e=20,className:t}){return q("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:q("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 pi({size:e=20,className:t}){return q("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:q("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 fi({size:e=20,className:t}){return In("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[q("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),q("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 A from"react";import on from"bignumber.js";function ul(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 Dt(e,t){if(!e||e==="0")return"0.00";let n=new on(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,on.ROUND_DOWN)}function Ke(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Xo(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,o=Math.pow(10,n);return`$${(Math.floor(t*o)/o).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function ui(e,t,n){let r=new on(e).shiftedBy(-t).multipliedBy(new on(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(on.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,on.ROUND_DOWN):r.decimalPlaces(4,on.ROUND_DOWN)).toFormat()}`}function mi(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let n=t;if(n.includes("e")||n.includes("E")){let i=Number(n);if(!Number.isFinite(i)||i===0)return{displayValue:"0",isLowerBound:!1};n=ul(i.toFixed(18))}let[o="0",r=""]=n.split(".");if(Number(o)>=1){let i=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${i}`,isLowerBound:!1}}return r.length<4?{displayValue:`${o}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}import{useMemo as ml}from"react";import{useQuery as gl}from"@tanstack/react-query";var nt={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},Ne={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var hl="send:chain-info";function bl(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let n=t[0];if(!n)throw new Error("Chain info payload is empty.");return n}return t}return e}function Jo(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function wl(e,t,n,o){if(o)return t===Ne[e].cross?gi(t,o):n?.explorer_url?Jo(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):xl(e,t,o)}function gi(e,t){return Jo("https://explorer.crosstoken.io",String(e),"tx",t)}function xl(e,t,n){let o=Ne[e];if(t===o.cross)return gi(t,n);if(t===o.bsc)return Jo(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function Jn(e,t,n,o=!0){let r=nt[e],a=gl({queryKey:[hl,e,t],queryFn:async({signal:c})=>{let l=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:c});if(!l.ok)throw new Error(`Failed to fetch chain info: ${l.status}`);let d=await l.json();if("code"in d&&d.code!==void 0&&d.code!==200)throw new Error(`Chain info API error: ${d.code}`);return bl(d)},enabled:o,staleTime:300*1e3}),i=a.data;return{transactionUrl:ml(()=>wl(e,t,i,n),[t,i,e,n]),chainInfo:i,...a}}var hi="0x0000000000000000000000000000000000000001";var vl="0xa9059cbb",yl=/^0x[a-fA-F0-9]{40}$/,kl="nexus-cross:dapp-ui:send:recent:",bi=10;function Sl(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Ln(e){return e.toLowerCase()}function Rt(e){return yl.test(e)}function Ht(e){return Ln(e.address)===hi}function er(e){return`${kl}${e.toLowerCase()}`}function un(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(er(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&Rt(o.address)&&typeof o.updatedAt=="number").slice(0,bi):[]}catch{return[]}}function tr(e,t){if(typeof window>"u")return[];let n=Ln(t),o=[{address:n,updatedAt:Date.now()},...un(e).filter(r=>r.address!==n)].slice(0,bi);try{window.localStorage.setItem(er(e),JSON.stringify(o))}catch{return un(e)}return o}function nr(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(er(e))}catch{}}function rn(e,t){let n=e.trim();if(!n)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(n))return{error:"Enter a valid amount."};let[o="0",r=""]=n.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let a=BigInt(o||"0"),i=r.padEnd(t,"0"),s=i?BigInt(i):0n,c=10n**BigInt(t),l=a*c+s;return l<=0n?{error:"Amount must be greater than 0."}:{value:l}}function or(e,t){let n=BigInt(e||"0"),o=10n**BigInt(t),r=n/o,a=n%o;if(a===0n)return r.toString();let i=Sl(a.toString().padStart(t,"0"));return`${r.toString()}.${i}`}function rr(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${vl}${n}${o}`}function eo(e,t,n=10){if(t<=0)return e.toString();let o=10n**BigInt(t),r=e/o,a=e%o;if(a===0n)return r.toString();let s=a.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return s=s.replace(/0+$/,""),s?`${r.toString()}.${s}`:r.toString()}function ir(e,t){return eo(e,t,6)}function wi(e){return eo(e,9,2)}function xi(e){return e.toLocaleString("en-US")}function to(e){return e===56||e===97}function no(e){return e.gasPrice??e.maxFeePerGas}function vi(e,t=!1){return t?no(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function oo(e,t=!1){if(t){let n=no(e);return n!==void 0?e.gasLimit*n:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function ro(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function yi(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let n=e,o=[];return typeof n.name=="string"&&o.push(n.name),typeof n.shortMessage=="string"&&o.push(n.shortMessage),typeof n.message=="string"&&o.push(n.message),typeof n.details=="string"&&o.push(n.details),n.cause!==void 0&&o.push(yi(n.cause,t+1)),o.join(`
|
|
6
6
|
`).toLowerCase()}function Cl(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 ar(e,t={},n="Failed to send transaction."){let o=yi(e);if(!o)return n;let r=t.nativeSymbol?.trim()||"gas token",a=t.networkName?.trim();if(o.includes("user rejected")||o.includes("userrejected")||o.includes("user denied")||o.includes("user cancelled")||o.includes("user canceled")||o.includes("action_rejected")||o.includes("rejected by user"))return"Transaction was cancelled.";if(o.includes("insufficientfunds")||o.includes("insufficient funds")||o.includes("exceeds the balance of the account")||o.includes("insufficient balance for transfer")){let i=a?` on ${a}`:"";return`Not enough ${r} to cover the gas fee.Please top up your ${r} balance and try again.`}return o.includes("transaction underpriced")||o.includes("replacement transaction underpriced")||o.includes("fee too low")?"Gas fee was too low for the network. Please try again.":o.includes("nonce too low")||o.includes("nonce has already been used")||o.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":o.includes("execution reverted")||o.includes("contractfunctionrevertederror")||o.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":o.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":o.includes("http request failed")||o.includes("failed to fetch")||o.includes("network request failed")||o.includes("timeout")||o.includes("econnreset")||o.includes("rpc error")||o.includes("429")?"Network connection failed. Check your internet and try again.":o.includes("estimategas")||o.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":Cl(e)||n}var Rl=2000000000n,Nl=1000000000n;async function io(e,t,n){let o=new AbortController,r=setTimeout(()=>o.abort(),8e3),a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:n}),signal:o.signal}).finally(()=>clearTimeout(r));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let i=await a.json();if(i.error)throw new Error(`RPC ${t}: ${i.error.message}`);if(i.result===void 0)throw new Error(`RPC ${t}: empty result`);return i.result}function ao(e){return BigInt(e)}function Tl(e){return`0x${e.toString(16)}`}function Il(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Tl(e.value)),e.data&&(t.data=e.data),t}function Ll(e){return e===56||e===97}async function ki(e){try{let t=await io(e,"eth_gasPrice",[]);return{gasPrice:ao(t)}}catch{return{gasPrice:Rl}}}async function El(e,t){let n=Nl;try{let o=await io(e,"eth_maxPriorityFeePerGas",[]);n=ao(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Al(e,t){if(t)return ki(e);let n;try{n=(await io(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?El(e,ao(n)):ki(e)}async function Si(e,t){let n=Ll(t.chainId),o=Il(t),[r,a]=await Promise.all([io(e,"eth_estimateGas",[o]),Al(e,n)]);return{gasLimit:ao(r),gasPrice:a.gasPrice,maxFeePerGas:a.maxFeePerGas,maxPriorityFeePerGas:a.maxPriorityFeePerGas}}function Ci(e){let{estimateGas:t,sendTransaction:n,getTransactionReceipt:o}=e;return{canSend:!!n,canEstimateGas(r){return!!t||!!r},async estimateGas(r,a){if(t)return t(r);if(a)return Si(a,r);throw new Error("Gas estimation is not available.")},async sendTransaction(r){if(!n)throw new Error("Sending is not available for this wallet.");return n(r)},getTransactionReceipt:o}}var Pl=1500,Bl=120;function Ri(e){return!!(e.token||e.recipient||e.amount)}function sr({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},a=e.trim(),i=rn(t,n.quantity.decimals),s;return a?Rt(a)||(r.recipient="Enter a valid EVM recipient address."):r.recipient="Enter a recipient address.","error"in i?r.amount=i.error:(s=i.value,s>o&&(r.amount="Amount exceeds available balance.")),!Ht(n)&&!Rt(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:s,recipient:a&&Rt(a)?a:void 0}}function lr({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return Ht(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:Ln(e.address),data:rr(n,o),value:0n,chainId:e.chainId,from:r}}function Fl(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var Ml=e=>new Promise(t=>setTimeout(t,e));async function Ni({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=Pl,pollMaxAttempts:a=Bl}){let i=await e.sendTransaction(t);o(i);let{getTransactionReceipt:s}=e;if(!s)return"success";for(let c=0;c<a;c+=1){let l=await s({hash:i,chainId:n}).catch(()=>null);if(l)return Fl(l)?"reverted":"success";await Ml(r)}return"timeout"}var Ti=["token","recipient","amount","review"];function Ii(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:a="recipient",token:i,tokens:s=[],onTokenChange:c,sendTransaction:l,getTransactionReceipt:d,estimateGas:u,getTokenPriceUsd:h,onSubmitted:m,onSuccess:v,onFailed:x,onExit:w,onOutlink:k}=e,P=A.useMemo(()=>Ci({sendTransaction:l,getTransactionReceipt:d,estimateGas:u}),[l,d,u]),[f,I]=A.useState(i);A.useEffect(()=>{I(i)},[i.address,i.chainId]);let[C,B]=A.useState(a),[F,Z]=A.useState(""),[O,K]=A.useState(""),[_,J]=A.useState({}),[W,he]=A.useState("idle"),[ne,ae]=A.useState(""),[De,se]=A.useState(""),[H,le]=A.useState(null),[te,G]=A.useState(!1),[He,fe]=A.useState(""),Ee=A.useRef(0),[ue,lt]=A.useState(null),[ye,_t]=A.useState(""),[ze,vt]=A.useState(()=>un(n)),At=A.useMemo(()=>Be(t),[t]),{transactionUrl:ce,chainInfo:be}=Jn(At,f.chainId,ne||void 0,!0),Ze=be?.currency_symbol??"",ke=be?.name??`Chain ID ${f.chainId}`,we=A.useRef({nativeSymbol:Ze||void 0,networkName:ke,tokenSymbol:f.symbol});we.current={nativeSymbol:Ze||void 0,networkName:ke,tokenSymbol:f.symbol};let de=A.useMemo(()=>BigInt(f.quantity.numeric||"0"),[f.quantity.numeric]),yt=A.useMemo(()=>Dt(f.quantity.numeric,f.quantity.decimals),[f.quantity.numeric,f.quantity.decimals]),Ge=h?.(f),ct=A.useMemo(()=>{if(Ge===void 0)return;let S=parseFloat(O.replace(/,/g,""));return Number.isFinite(S)?S*Ge:0},[O,Ge]);A.useEffect(()=>{K(""),J({})},[f.address,f.chainId]),A.useEffect(()=>{Ee.current+=1,le(null),fe(""),G(!1)},[f.address,f.chainId,F,O]),A.useEffect(()=>{vt(un(n))},[n]);let Se=A.useCallback(S=>{Z(S),J(j=>({...j,recipient:void 0}))},[]),kt=A.useCallback(S=>{K(S),J(j=>({...j,amount:void 0}))},[]),St=A.useCallback(()=>{K(yt.replace(/,/g,"")),J(S=>({...S,amount:void 0}))},[yt]),Ae=A.useCallback(S=>{I(S),c?.(S),B("recipient")},[c]),dt=A.useCallback(()=>B("token"),[]),Xe=A.useCallback(()=>{B(S=>{if(S==="result")return"review";if(S===a)return w?.(),S;let j=Ti.indexOf(S);return j<=0?(w?.(),S):Ti[j-1]})},[a,w]),oe=A.useCallback(()=>{let{errors:S}=sr({recipient:F,amount:"1",token:f,balanceRaw:de});if(S.recipient){J(j=>({...j,recipient:S.recipient}));return}J(j=>({...j,recipient:void 0})),B("amount")},[F,f,de]),Je=A.useCallback(S=>{Z(S),J(j=>({...j,recipient:void 0})),B("amount")},[]),Ce=A.useCallback(()=>{let S=sr({recipient:F,amount:O,token:f,balanceRaw:de});J(S.errors),!(Ri(S.errors)||S.rawAmount===void 0||!S.recipient)&&(lt(S.rawAmount),_t(S.recipient),le(null),fe(""),he("idle"),B("review"))},[F,O,f,de]);A.useEffect(()=>{if(C!=="review"||!ye||ue===null||H!==null||te||He||!P.canEstimateGas(be?.rpc))return;let S=++Ee.current;G(!0),fe(""),(async()=>{try{let j=lr({token:f,walletAddress:n,recipient:ye,rawAmount:ue}),ee=await P.estimateGas(j,be?.rpc);if(Ee.current!==S)return;le(ee)}catch(j){if(Ee.current!==S)return;fe(ar(j,we.current,"Failed to estimate gas."))}finally{Ee.current===S&&G(!1)}})()},[C,ye,ue,H,te,He,P,be?.rpc,f,n]);let et=A.useMemo(()=>{if(!Ht(f)||!H||ue===null)return!1;let S=oo(H,to(f.chainId));return S===null?!1:ue+S>de},[f,H,ue,de]),Ue=A.useCallback(async()=>{if(!(!ye||ue===null)&&!et){se(""),ae(""),he("submitting");try{let S="",j=await Ni({repository:P,args:lr({token:f,walletAddress:n,recipient:ye,rawAmount:ue}),chainId:f.chainId,onSubmitted:ee=>{S=ee,ae(ee),he("confirming"),vt(tr(n,ye)),m?.({txHash:ee,chainId:f.chainId,amount:O,tokenSymbol:f.symbol,recipient:ye})}});if(j==="success")he("success"),S&&v?v?.(S):B("result");else if(j==="reverted"){let ee="Transaction reverted on-chain.";he("error"),se(ee),S&&x?x({txHash:S,chainId:f.chainId,message:ee}):B("result")}else{let ee="Transaction receipt was not found. Please check again later.";he("error"),se(ee),S&&x?x({txHash:S,chainId:f.chainId,message:ee}):B("result")}}catch(S){he("error"),se(ar(S,{nativeSymbol:Ze||void 0,networkName:ke,tokenSymbol:f.symbol})),B("result")}}},[P,ye,ue,et,f,O,n,m,v,x,Ze,ke]),[Pt,Bt]=A.useState(!1),pt=A.useRef(void 0);A.useEffect(()=>()=>clearTimeout(pt.current),[]);let Ot=A.useCallback(async()=>{if(ne)try{await navigator.clipboard.writeText(ne),Bt(!0),clearTimeout(pt.current),pt.current=setTimeout(()=>Bt(!1),2e3)}catch{}},[ne]),ft=A.useCallback(()=>{if(!ce||!ne)return;let S=$e=>{typeof window<"u"&&window.open($e,"_blank","noopener,noreferrer")};if(!k){S(ce);return}let j=k(ce,{category:"send",origin:"send-transaction",payload:{chainId:f.chainId,txHash:ne}});if(j&&typeof j.then=="function"){let $e=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;j.then(je=>{if(je===null){$e?.close();return}let zt=je??ce;if($e)try{$e.location.href=zt}catch{$e.close(),S(zt)}else S(zt)});return}let ee=j;ee!==null&&S(ee??ce)},[k,f.chainId,ce,ne]),xe=A.useCallback(()=>{se(""),ae(""),he("idle"),le(null),fe(""),B("review")},[]);return{step:C,status:W,token:f,tokens:s.length>0?s:[f],recipient:F,amount:O,amountUsd:ct,fieldErrors:_,error:De,txHash:ne,gasEstimate:H,gasLoading:te,gasError:He,insufficientGas:et,reviewRawAmount:ue,reviewRecipient:ye,recentAddresses:ze,accounts:r,accountName:o,walletAddress:n,resolvedEnv:At,transactionUrl:ce,networkName:ke,nativeSymbol:Ze,nativeDecimals:be?.currency_decimals??f.quantity.decimals,balanceRaw:de,balanceText:yt,priceUsd:Ge,canSelectToken:(s.length>0?s:[f]).length>1,canSend:P.canSend,getTokenPriceUsd:h,setRecipient:Se,setAmount:kt,setMax:St,selectToken:Ae,goToTokenSelect:dt,selectRecipient:Je,submitRecipient:oe,submitAmount:Ce,confirmSend:Ue,retry:xe,back:Xe,hashCopied:Pt,copyHash:Ot,openTransaction:ft}}import*as mt from"react";import{jsx as En,jsxs as cr}from"react/jsx-runtime";function Li({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:a,token:i,setMax:s}=e,c=mt.useRef(null),l=mt.useCallback(()=>{requestAnimationFrame(()=>{let x=c.current;if(!x)return;let w=x.value.length;x.setSelectionRange(w,w)})},[]);mt.useEffect(()=>{c.current?.focus(),l()},[l]),mt.useEffect(()=>{t===""&&(h(!1),l())},[t,l]);let d=mt.useMemo(()=>{let x=rn(t,i.quantity.decimals);return"value"in x&&x.value>a},[t,i.quantity.decimals,a]),[u,h]=mt.useState(!1),m=!u&&t===""?"0.00":t,v=t.trim()===""||t.trim()==="0";return En("div",{className:"sf-body sf-amount",children:cr("div",{className:"sf-amount-center",children:[En("span",{className:"sf-amount-usd",children:o!==void 0?ro(o):"\xA0"}),En("div",{className:"sf-amount-input-wrap","data-over":d||void 0,"data-empty":v||void 0,onClick:()=>c.current?.focus(),children:En("input",{ref:c,className:"sf-amount-input",value:m,onChange:x=>{let w=x.target.value;if(u)n(w);else if(t===""){if(w.length<4)return;h(!0);let k=w.startsWith("0.00")?w.slice(4):w;n(k)}else h(!0),n(w)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${i.symbol}`,size:1})}),cr("div",{className:"sf-amount-balance",children:[En("span",{children:"Balance:"}),cr("button",{type:"button",className:"sf-amount-max",onClick:s,children:[r," ",i.symbol]})]})]})})}import*as gt from"react";var dr={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},Ei={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function An(e,t){let n=Ne[e];if(t===n.cross)return Ei.cross;if(t===n.bsc)return Ei.bsc}var _l={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Ft(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:a="png"}=n,i=_l[e],s=r?`&bg=${r}`:"";return`${i}/portrait/evm/${t}.${a}?size=${o}${s}`}import{jsx as ot,jsxs as so}from"react/jsx-runtime";function Ai({size:e=20,className:t}){return so("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[ot("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),ot("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Pi({size:e=20,className:t}){return ot("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:ot("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 Bi({size:e=20,className:t}){return so("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[ot("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),ot("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Fi({size:e=16,className:t}){return ot("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:ot("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Mi({size:e=56,className:t}){return so("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[ot("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),ot("path",{d:"M17 28.5 24.2 35.5 39 20.5",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function _i({size:e=56,className:t}){return so("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[ot("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),ot("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import{jsx as pe,jsxs as Nt}from"react/jsx-runtime";function Oi(e,t){return e.name||`Account ${(e.index??t)+1}`}function zi(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Wi(e){return e.toLowerCase()}function Di({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:a,walletAddress:i,resolvedEnv:s,selectRecipient:c}=e,l=gt.useMemo(()=>a.filter(f=>f.address.toLowerCase()!==i.toLowerCase()),[a,i]),d=l.length>0,u=gt.useMemo(()=>new Map(l.map((f,I)=>[Wi(f.address),{account:f,index:I}])),[l]),[h,m]=gt.useState("recent"),v=gt.useRef(null);gt.useEffect(()=>{v.current?.focus()},[]);let x="1A1A2E",w=gt.useCallback(async()=>{try{let f=await navigator.clipboard.readText();f&&n(f.trim())}catch{}},[n]),k=t.trim().length>0,P=Rt(t.trim());return Nt("div",{className:"sf-recipient",children:[Nt("div",{className:"sf-recipient-top",children:[Nt("div",{className:"sf-address-field","data-filled":k||void 0,"data-invalid":o.recipient||void 0,children:[pe("textarea",{ref:v,className:"sf-address-input",value:t,onChange:f=>n(f.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:k?2:1}),k?pe("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear",children:pe(Bi,{size:20})}):pe("button",{type:"button",className:"sf-address-action",onClick:w,"aria-label":"Paste from clipboard",children:pe(Pi,{size:20})})]}),o.recipient&&pe("p",{className:"sf-field-error",role:"alert",children:o.recipient}),Nt("div",{className:"sf-tabs",role:"tablist",children:[pe("button",{type:"button",role:"tab",className:"sf-tab","data-active":h==="recent"||void 0,"aria-selected":h==="recent",onClick:()=>m("recent"),children:"Recent"}),d&&pe("button",{type:"button",role:"tab",className:"sf-tab","data-active":h==="account"||void 0,"aria-selected":h==="account",onClick:()=>m("account"),children:"My Account"})]})]}),pe("div",{className:"sf-address-list",children:h==="account"&&d?l.map((f,I)=>{let C=Oi(f,I),B=Ft(s,f.address,{size:56,bg:x});return Nt("button",{type:"button",className:"sf-address-row",onClick:()=>c(f.address),children:[Nt("span",{className:"sf-address-avatar",children:[B&&pe("img",{src:B,alt:"",width:40,height:40,draggable:!1,onError:F=>{F.currentTarget.style.display="none"}}),pe("span",{className:"sf-address-avatar-fallback",children:zi(C)})]}),Nt("span",{className:"sf-address-meta",children:[pe("span",{className:"sf-address-name",children:C}),pe("span",{className:"sf-address-value",children:Ke(f.address)})]})]},f.address)}):r.length>0?r.map(f=>{let I=u.get(Wi(f.address)),C=I?Oi(I.account,I.index):Ke(f.address),B=Ft(s,f.address,{size:56,bg:x});return Nt("button",{type:"button",className:"sf-address-row",onClick:()=>c(f.address),children:[Nt("span",{className:"sf-address-avatar",children:[B&&pe("img",{src:B,alt:"",width:40,height:40,draggable:!1,onError:F=>{F.currentTarget.style.display="none"}}),pe("span",{className:"sf-address-avatar-fallback",children:zi(C)})]}),Nt("span",{className:"sf-address-meta",children:[pe("span",{className:"sf-address-name",children:C}),pe("span",{className:"sf-address-value",children:Ke(f.address)})]})]},f.address)}):pe("div",{className:"sf-empty",children:"No send history"})}),k&&!P&&!o.recipient&&pe("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as Fe,jsxs as mn}from"react/jsx-runtime";function Gi({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:a,openTransaction:i}=e,s=t==="error",c=t==="success";return s?mn("div",{className:"sf-body sf-result sf-result--error",children:[Fe("span",{className:"sf-result-icon",children:Fe(_i,{size:56})}),mn("div",{className:"sf-result-copy",children:[Fe("h3",{className:"sf-result-title",children:"Transaction Failed"}),Fe("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&Fe(Hi,{txHash:n,hashCopied:a,onCopy:r,onOpen:i})]}):mn("div",{className:"sf-body sf-result",children:[Fe("span",{className:"sf-result-icon","data-pending":!c||void 0,children:c?Fe(Mi,{size:56}):Fe("span",{className:"sf-result-spinner"})}),mn("div",{className:"sf-result-copy",children:[Fe("h3",{className:"sf-result-title",children:c?"Transaction Complete":"Transaction in Progress"}),Fe("p",{className:"sf-result-desc",children:c?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&Fe(Hi,{txHash:n,hashCopied:a,onCopy:r,onOpen:i})]})}function Hi({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return mn("div",{className:"sf-result-hash-card",children:[Fe("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),mn("div",{className:"sf-result-hash-row",children:[Fe("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer",children:Ke(e)}),Fe("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash",children:t?Fe(en,{size:16}):"Copy"})]})]})}import{jsx as re,jsxs as Me}from"react/jsx-runtime";var lo="\u2014";function Ui({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:a,walletAddress:i,networkName:s,nativeSymbol:c,nativeDecimals:l,gasEstimate:d,gasLoading:u,gasError:h,insufficientGas:m,error:v,resolvedEnv:x}=e,w=Ht(t),k=n!==null?eo(n,t.quantity.decimals):"",P=r?.trim()||`Account ${(a[0]?.index??0)+1}`,f=Ft(x,i,{size:56,bg:"1A1A2E"}),I=c||(w?t.symbol:""),C=to(t.chainId),B=d?vi(d,C):null,F=d?oo(d,C):null,Z=W=>W!==null&&I?`${ir(W,l)} ${I}`:lo,O=W=>W!==void 0?`${wi(W)} Gwei`:lo,K=(()=>{if(!w||!d||F===null||n===null)return lo;let W=n+F;return`${ir(W,l)} ${I||t.symbol}`})(),_=W=>u?"\u2026":W,J=[{label:"Est. Tx Fee",value:_(Z(F))},...B==="dynamic"?[{label:"Max Priority Fee",value:_(O(d?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:_(O(d?.maxFeePerGas))}]:B==="legacy"?[{label:"Gas Price",value:_(O(d?no(d):void 0))}]:[],{label:"Gas Limit",value:_(d?xi(d.gasLimit):lo)}];return Me("div",{className:"sf-body sf-review",children:[Me("div",{className:"sf-review-amount",children:[re("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:W=>{W.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Me("span",{className:"sf-review-amount-value",children:[k,re("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),Me("div",{className:"sf-review-parties",children:[Me("div",{className:"sf-review-card sf-review-party",children:[re("span",{className:"sf-review-party-label",children:"From"}),Me("div",{className:"sf-review-party-head",children:[re("span",{className:"sf-review-party-avatar",children:f&&re("img",{src:f,alt:"",width:28,height:28,draggable:!1,onError:W=>{W.currentTarget.style.display="none"}})}),re("span",{className:"sf-review-party-name",children:P})]}),re("span",{className:"sf-review-party-addr",children:i})]}),re("span",{className:"sf-review-arrow","aria-hidden":!0,children:re(Fi,{size:16})}),Me("div",{className:"sf-review-card sf-review-party",children:[re("span",{className:"sf-review-party-label",children:"To"}),re("span",{className:"sf-review-party-addr",children:o})]})]}),Me("section",{className:"sf-review-card",children:[re("h3",{className:"sf-review-section-title",children:"Summary"}),Me("div",{className:"sf-review-row",children:[re("span",{className:"sf-review-row-label",children:"Network"}),re("span",{className:"sf-review-row-value",children:s})]}),J.map(W=>Me("div",{className:"sf-review-row",children:[re("span",{className:"sf-review-row-label",children:W.label}),re("span",{className:"sf-review-row-value",children:W.value})]},W.label))]}),Me("section",{className:"sf-review-card",children:[re("h3",{className:"sf-review-section-title",children:"Total"}),Me("div",{className:"sf-review-row",children:[re("span",{className:"sf-review-row-label",children:"Total Amount"}),Me("span",{className:"sf-review-row-value",children:[k," ",t.symbol]})]}),w&&Me("div",{className:"sf-review-row",children:[re("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),re("span",{className:"sf-review-row-value",children:_(K)})]})]}),m&&!h&&!v&&Me("div",{className:"sf-message sf-message--error",role:"alert",children:["Not enough ",I||t.symbol," to cover the amount plus the network fee. Reduce the amount and try again."]}),(h||v)&&re("div",{className:"sf-message sf-message--error",role:"alert",children:h||v})]})}import*as co from"react";import{jsx as Gt,jsxs as an}from"react/jsx-runtime";function $i({flow:e}){let[t,n]=co.useState(""),o=t.trim().toLowerCase(),r=co.useMemo(()=>o?e.tokens.filter(a=>a.symbol.toLowerCase().includes(o)||a.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return an("div",{className:"sf-body sf-token-select",children:[an("div",{className:"sf-search",children:[Gt(Ai,{size:20}),Gt("input",{className:"sf-search-input",value:t,onChange:a=>n(a.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),an("div",{className:"sf-token-list",children:[r.map(a=>{let i=`${a.chainId}:${a.address.toLowerCase()}`,s=An(e.resolvedEnv,a.chainId),c=e.getTokenPriceUsd?.(a);return an("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(a),children:[an("span",{className:"sf-token-left",children:[an("span",{className:"sf-token-icon-wrap",children:[Gt("img",{className:"sf-token-icon",src:a.icon_url,alt:"",width:40,height:40,loading:"lazy",draggable:!1,onError:l=>{l.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),s&&Gt("img",{className:"sf-token-chain-badge",src:s,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:l=>{l.currentTarget.style.display="none"}})]}),Gt("span",{className:"sf-token-name",children:a.symbol})]}),an("span",{className:"sf-token-right",children:[Gt("span",{className:"sf-token-balance",children:Dt(a.quantity.numeric,a.quantity.decimals)}),c!==void 0&&Gt("span",{className:"sf-token-price",children:ro(c)})]})]},i)}),r.length===0&&Gt("div",{className:"sf-empty",children:"No tokens found"})]})]})}z(`.sf-root{display:flex;flex-direction:column;flex:1;min-height:0;font-family:inherit}.sf-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px;flex-shrink:0;position:relative;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.sf-header .sf-header-btn:last-child{position:absolute;top:24px;right:24px}.sf-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;filter:none;transition:color .15s ease}.sf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));filter:none}.sf-header-title{position:absolute;left:50%;transform:translate(-50%);text-align:center;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);pointer-events:none}.sf-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .sf-body{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-body::-webkit-scrollbar{width:4px;height:4px}.sf-body::-webkit-scrollbar-track,.sf-body::-webkit-scrollbar-corner{background:transparent}.sf-body::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}.sf-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .sf-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .sf-body::-webkit-scrollbar-thumb:hover{background:#0003}.sf-empty{padding:32px 0;text-align:center;font-family:inherit;font-size:14px;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-field-error{margin:8px 24px 0;font-family:inherit;font-size:12px;line-height:1.5;color:var(--ds-system-red-default, #da0b2e)}.sf-message--error{margin:16px 0 0;padding:12px 16px;background:var(--ds-system-red-low, #ffeeee);color:var(--ds-system-red-high, #d20609);font-family:inherit;font-size:13px;line-height:1.5;border-radius:12px;width:100%;box-sizing:border-box}.sf-footer{display:flex;flex-shrink:0;padding:16px 24px 24px}.sf-footer:empty{display:none}.sf-footer-row{display:flex;gap:8px;width:100%}.sf-footer-row .sf-btn,.sf-footer-row .sf-btn--secondary{flex:1 1 0;min-width:0}.sf-footer>.sf-btn{width:100%}.sf-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:1;height:48px;padding:0 24px;border:none;border-radius:12px;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:background-color .15s ease,transform .1s ease}.sf-btn--primary{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff)}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){background:var(--ds-accent-primary-high, #00a0a2)}.sf-btn--primary:active:not(:disabled):not([data-disabled]){transform:scale(.97)}.sf-btn--primary[data-disabled],.sf-btn--primary:disabled{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff);cursor:default;opacity:.5}.sf-btn--secondary{flex:0 0 120px;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-token-select{padding:0;display:flex;flex-direction:column}.sf-token-select .sf-search{margin:16px 24px}.sf-token-select .sf-token-list{width:100%;margin-top:0}.sf-search{display:flex;align-items:center;gap:8px;padding:12px 16px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-low, rgba(0, 0, 0, .4));box-sizing:border-box;transition:border-color .15s ease}.sf-search:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-search:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-search-input{flex:1;min-width:0;border:none;background:transparent;outline:none;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-search-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-token-list{display:flex;flex-direction:column;margin-top:8px}.sf-token-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-token-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-token-left{display:flex;align-items:center;gap:16px;min-width:0}.sf-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.sf-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain}.sf-token-chain-badge{position:absolute;right:-2px;bottom:-2px;width:16px;height:16px;border-radius:50%;object-fit:cover}.sf-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.sf-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.sf-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.sf-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.sf-recipient{display:flex;flex-direction:column;flex:1;min-height:0}.sf-recipient-top{display:flex;flex-direction:column;padding:16px 24px 0}.sf-address-field{display:flex;align-items:center;gap:8px;padding:12px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);transition:border-color .15s ease;box-sizing:border-box}.sf-address-field:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-address-field:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-filled]{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-invalid]{border-color:var(--ds-system-red-default, #da0b2e)}.sf-address-input{flex:1;min-width:0;border:none;background:transparent;outline:none;resize:none;overflow:hidden;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));word-break:break-word;overflow-wrap:anywhere}.sf-address-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-address-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;border-radius:6px;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.sf-address-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-address-field[data-filled] .sf-address-action{border-radius:9999px}.sf-tabs{display:flex;gap:0;margin:16px 0 0}.sf-tab{position:relative;padding:8px 12px;border:none;background:transparent;cursor:pointer;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-tab[data-active]{color:var(--ds-accent-primary-high, #00a0a2)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-accent-primary-high, #00a0a2)}.sf-address-list{display:flex;flex-direction:column;width:100%;margin-top:8px}.sf-address-row{display:flex;align-items:center;gap:16px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-address-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-address-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex-shrink:0;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:600}.sf-address-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.sf-address-avatar-fallback{position:relative;z-index:0}.sf-address-meta{display:flex;flex-direction:column;min-width:0}.sf-address-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sf-address-value{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-drawer-content .sf-header{padding:16px}.wi-drawer-content .sf-header .sf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .sf-token-select{padding:0}.wi-drawer-content .sf-token-select .sf-search{margin:16px}.wi-drawer-content .sf-token-row{padding:12px 16px}.wi-drawer-content .sf-recipient-top{padding:16px 16px 0}.wi-drawer-content .sf-address-row{padding:12px 16px}.wi-drawer-content .sf-footer{padding:12px 16px 24px}.wi-drawer-content .sf-field-error,.wi-drawer-content .sf-message--error{margin:16px 0 0;width:auto}.sf-amount{display:flex;flex-direction:column}.sf-amount-center{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:64px 24px 48px;text-align:center}.sf-amount-usd{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));min-height:21px}.sf-amount-input-wrap{display:flex;justify-content:center;max-width:100%}.sf-amount-input{width:auto;max-width:100%;border:none;background:transparent;outline:none;text-align:center;font-family:inherit;font-size:40px;font-weight:700;line-height:1.25;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);field-sizing:content}.sf-amount-input-wrap[data-empty] .sf-amount-input,.sf-amount-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-input-wrap[data-over] .sf-amount-input{color:var(--ds-system-red-default, #da0b2e)}.sf-amount-balance{display:inline-flex;align-items:center;gap:4px;font-family:inherit;font-size:14px;font-weight:400;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-max{border:none;background:transparent;padding:0;cursor:pointer;font:inherit;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.sf-amount-max:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-drawer-content .sf-amount-center{padding:64px 16px 48px}.sf-review{display:flex;flex-direction:column;gap:16px;padding:24px}.sf-review-amount{display:flex;align-items:center;gap:12px;padding:0;background:transparent}.sf-review-amount-icon{width:40px;height:40px;border-radius:0;object-fit:contain;flex-shrink:0}.sf-review-amount-value{display:inline-flex;flex-direction:column;align-items:flex-start;gap:0;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);word-break:break-all}.sf-review-amount-symbol{font-size:12px;font-weight:400;line-height:1.5;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-parties{position:relative;display:flex;flex-direction:column;gap:0}.sf-review-arrow{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin:-4px auto;border-radius:50%;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-card{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa)}.sf-review-party-label{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-party-head{display:flex;align-items:center;gap:8px}.sf-review-party-avatar{display:inline-flex;width:24px;height:24px;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);flex-shrink:0}.sf-review-party-avatar img{width:100%;height:100%;object-fit:cover}.sf-review-party-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-review-party-addr{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));word-break:break-all}.sf-review-section-title{margin:0 0 4px;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-review-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.sf-review-row-label{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-row-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));text-align:left;word-break:break-all}.wi-drawer-content .sf-review{padding:16px}.sf-result{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;padding:48px 24px;text-align:center}.sf-result-icon{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px}.sf-result-spinner{width:56px;height:56px;border-radius:50%;border:4px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-top-color:var(--ds-accent-primary-default, #00b4b7);animation:sf-spin .8s linear infinite}@keyframes sf-spin{to{transform:rotate(360deg)}}.sf-result-copy{display:flex;flex-direction:column;gap:8px}.sf-result-title{margin:0;font-family:inherit;font-size:18px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-result-desc{margin:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);text-align:left}.sf-result-hash-label{font-family:inherit;font-size:12px;font-weight:500;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sf-result-hash-link{border:none;background:transparent;padding:0;cursor:pointer;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;color:var(--ds-accent-primary-high, #00a0a2)}.sf-result-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:28px;padding:0 10px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));border-radius:8px;background:var(--ds-surface-default, #ffffff);cursor:pointer;font-family:inherit;font-size:12px;font-weight:500;color:var(--ds-content-high, rgba(0, 0, 0, .85))}
|
|
7
|
-
`);import{jsx as ve,jsxs as po}from"react/jsx-runtime";var Ol={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function fo({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...a}){let i=ji.useCallback(k=>{o?.(k),n?.(k)},[n,o]),c=Ii({...a,onSuccess:o||n?i:void 0,onExit:t}),{step:l,status:d}=c,u=Rt(c.recipient.trim()),h=rn(c.amount,c.token.quantity.decimals),m="value"in h&&h.value<=c.balanceRaw,v=d==="submitting"||d==="confirming",x=l!=="result",w=Ol[l]??"";return po("div",{className:X("sf-root",r),"data-step":l,children:[po("header",{className:"sf-header",children:[x?ve("button",{type:"button",className:"sf-header-btn",onClick:c.back,"aria-label":"Back",children:ve(tn,{size:24})}):ve("span",{className:"sf-header-btn","aria-hidden":!0}),ve("span",{className:"sf-header-title",children:w}),ve("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close",children:ve(Ct,{size:24})})]}),l==="token"&&ve($i,{flow:c}),l==="recipient"&&ve(Di,{flow:c}),l==="amount"&&ve(Li,{flow:c}),l==="review"&&ve(Ui,{flow:c}),l==="result"&&ve(Gi,{flow:c}),po("footer",{className:"sf-footer","data-step":l,children:[l==="recipient"&&ve("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.submitRecipient,"data-disabled":!u||void 0,"aria-disabled":!u,children:"Next"}),l==="amount"&&ve("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.submitAmount,"data-disabled":!m||void 0,"aria-disabled":!m,children:"Next"}),l==="review"&&po("div",{className:"sf-footer-row",children:[ve("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:c.back,disabled:v,children:"Cancel"}),ve("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.confirmSend,disabled:v||!c.canSend||c.insufficientGas,children:v?"Sending...":"Send"})]}),l==="result"&&d==="success"&&ve("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(c.txHash||void 0),children:"All done"}),l==="result"&&d==="error"&&ve("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.retry,children:"Try Again"})]})]})}import*as Vi from"@radix-ui/react-popover";import{Drawer as zl}from"vaul";import{jsx as uo,jsxs as Wl}from"react/jsx-runtime";function qi({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:a}=Wt(),i=n!=null,s=e??!0,c=i?n:Wl("button",{type:"button",className:X("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[uo(oi,{size:o?14:16}),uo("span",{className:"wi-trigger-address",children:Ke(a)})]});return o?uo(zl.Trigger,{asChild:s,children:c}):uo(Vi.Trigger,{asChild:s,children:c})}import*as M from"react";import*as No from"@radix-ui/react-popover";import{Drawer as Co}from"vaul";import Mn from"bignumber.js";import{useQueries as Dl}from"@tanstack/react-query";import{useMemo as Hl}from"react";var pr="user-balance";async function Gl(e,t,n,o){let r=new URLSearchParams({networkId:`eip155:${t}`,account:n}),a=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:o});if(!a.ok)throw new Error(`Failed to fetch token balance: ${a.status}`);let i=await a.json();if(i.code!==200)throw new Error(`Token balance API error: ${i.code}`);return i.data}function Ut(e,t,n=!0){let o=nt[e],r=Ne[e],a=[r.cross,r.bsc],i=Dl({queries:a.map(d=>({queryKey:[pr,e,t,d],queryFn:({signal:u})=>Gl(o,d,t,u),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),s=i.some(d=>d.isLoading),c=i.some(d=>d.isError);return{tokens:Hl(()=>{let d=[];for(let u of i)u.data&&d.push(...u.data);return d},[i]),isLoading:s,isError:c}}import{useQuery as Ul,useQueries as $l}from"@tanstack/react-query";import{useMemo as jl}from"react";var Vl="forge-holdings",ql="forge-token-image";async function Kl(e,t,n){let o=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch forge holdings: ${o.status}`);let r=await o.json();if(!r.success)throw new Error("Forge holdings API error");return r.data.items}async function Ql(e,t,n){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:n});if(!o.ok)return{address:t,image_url:""};let r=await o.json();return r.success?{address:t,image_url:r.data.token.image_url}:{address:t,image_url:""}}function Ki(e,t,n=!0){let o=dr[e],{data:r,...a}=Ul({queryKey:[Vl,e,t],queryFn:({signal:i})=>Kl(o,t,i),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:r??[],...a}}function Qi(e,t,n=!0){let o=dr[e],r=$l({queries:t.map(i=>({queryKey:[ql,e,i],queryFn:({signal:s})=>Ql(o,i,s),enabled:n,staleTime:1/0}))});return{imageMap:jl(()=>{let i=new Map;for(let s of r)s.data&&i.set(s.data.address,s.data.image_url);return i},[r])}}import{useQuery as Yl}from"@tanstack/react-query";import{useMemo as Zl}from"react";var fr="token-stats";function ht(e,t){return`${e}:${t.toLowerCase()}`}function $t(e,t=!0){let n=nt[e],{data:o,...r}=Yl({queryKey:[fr,e],queryFn:async({signal:i})=>{let s=await fetch(`${n}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Token stats API error: ${c.code}`);return c},enabled:t,staleTime:3e4});return{statsMap:Zl(()=>{let i=new Map;if(!o?.data)return i;for(let s of o.data){let c=ht(s.chain_id,s.address);i.set(c,s)}return i},[o]),...r}}import{useQuery as Xl}from"@tanstack/react-query";import{useMemo as Jl}from"react";var ec="token-info";function ur(e,t){return`${t.toLowerCase()}_${e}`}function Yi(e,t=!0){let n=nt[e],{data:o,...r}=Xl({queryKey:[ec,e],queryFn:async({signal:i})=>{let s=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Failed to fetch token info: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Token info API error: ${c.code}`);return c},enabled:t,staleTime:1/0});return{categoryMap:Jl(()=>{let i=new Map;if(!o?.data)return i;for(let s of o.data){let c=ur(s.chain_id,s.address);i.set(c,s.category)}return i},[o]),...r}}import{useMemo as tc}from"react";import mr from"bignumber.js";function Zi(e,t,n){let{tokens:o,isLoading:r}=Ut(e,t,n),{statsMap:a}=$t(e,n);return tc(()=>{let i=new mr(0);for(let d of o){let u=a.get(ht(d.chainId,d.address));if(!u)continue;let m=new mr(d.quantity.numeric).shiftedBy(-d.quantity.decimals).multipliedBy(new mr(u.price));m.isNaN()||(i=i.plus(m))}let s=i.toFixed(),{displayValue:c,isLowerBound:l}=mi(s);return{totalUsd:s,displayValue:c,isLowerBound:l,isLoading:r}},[o,a,r])}import{QRCodeSVG as Gd}from"qrcode.react";function Qe(e,t,n,o){if(!o||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let r;try{r=o(t,n)}catch(l){console.error("[dapp-ui] onOutlink threw:",l);return}let a=l=>{typeof window>"u"||window.open(l,"_blank","noopener,noreferrer")};if((l=>!!l&&(typeof l=="object"||typeof l=="function")&&typeof l.then=="function")(r)){let l=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,d=u=>{if(u===null){l?.close();return}let h=u??t;if(l)try{l.location.href=h}catch{l.close(),a(h)}else a(h)};r.then(d,u=>{console.error("[dapp-ui] onOutlink rejected:",u),l?.close()});return}let s=r;if(s===null)return;a(s??t)}import*as ln from"react";import{Drawer as Xc}from"vaul";import{createContext as nc,useContext as oc}from"react";var Pn=nc(null);function rt(){let e=oc(Pn);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}import{Drawer as rc}from"vaul";import{jsx as Xi}from"react/jsx-runtime";function Ji({asChild:e,children:t}){let{walletAddress:n}=rt(),o=t!=null,r=e??!0,a=o?t:Xi("button",{type:"button",children:Ke(n)});return Xi(rc.Trigger,{asChild:r,children:a})}import{Drawer as xo}from"vaul";import*as Ie from"react";import{useQueryClient as Qc}from"@tanstack/react-query";import{jsx as sn,jsxs as na}from"react/jsx-runtime";function ea({size:e=22,className:t}){return sn("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:sn("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function ta({size:e=22,className:t}){return na("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[sn("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),sn("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 Mt({size:e=12,className:t}){return na("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:[sn("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"}),sn("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),sn("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import gn from"bignumber.js";var ic=/^(\d{4}-\d{2}-\d{2})/;function oa(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:r,cumulative:a}of e.map(i=>({key:ic.exec(i.reference_date)?.[1],cumulative:i.cumulative_earned})).filter(i=>!!i.key&&i.cumulative!=null).sort((i,s)=>i.key<s.key?-1:i.key>s.key?1:0))t.set(r,a),n=r;if(n===void 0)return;let o=new Date().toISOString().slice(0,10);return t.get(o)??t.get(n)}function ra(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function hn(e,t){let n=new gn(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,gn.ROUND_DOWN):n.toFormat(4,gn.ROUND_DOWN)}function gr(e){return hn(e,0)}function bn(e,t,n){let o=new gn(n||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let r=new gn(e||"0").shiftedBy(-t).times(o);return r.isFinite()?`$${r.toFormat(2,gn.ROUND_DOWN)}`:null}import{useQuery as ac}from"@tanstack/react-query";import{useMemo as da}from"react";var mo={dev:"https://stg-cross-game-reward-api.crosstoken.io/api",stage:"https://stg-cross-game-reward-api.crosstoken.io/api",production:"https://cross-game-reward-api.crosstoken.io/api"},ia={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},go={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},aa={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},wn={dev:"https://stg-posa-api.crosstoken.io/api/v1",stage:"https://stg-posa-api.crosstoken.io/api/v1",production:"https://posa-api.crosstoken.io/api/v1"},Bn={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},sa={dev:`${Bn.dev}/portfolio`,stage:`${Bn.stage}/portfolio`,production:`${Bn.production}/portfolio`},la={dev:"https://stg-game-swap-api.cross.nexus/v1",stage:"https://stg-game-swap-api.cross.nexus/v1",production:"https://game-swap-api.cross.nexus/v1"},ca={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},jt={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"};var sc="wp:reward-pools";function ho(e,t=!0){let n=mo[e],{data:o,...r}=ac({queryKey:[sc,e],queryFn:async({signal:s})=>{let c=await fetch(`${n}/v1/pools`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch pools: ${c.status}`);let l=await c.json();if(l.code!==200)throw new Error(`Pools API error: ${l.code}`);return l},enabled:t,staleTime:0}),a=da(()=>o?.data.pools.filter(s=>s.pool_type==="CrossPool")??[],[o]),i=da(()=>o?.data.pools.filter(s=>s.pool_type==="GamePool")??[],[o]);return{crossPools:a,gamePools:i,allPools:o?.data.pools??[],...r}}import{useQuery as lc}from"@tanstack/react-query";import{useMemo as cc}from"react";var dc="wp:user-deposits";function pa(e,t,n=!0){let o=mo[e],r=n&&!!t,{data:a,...i}=lc({queryKey:[dc,e,t],queryFn:async({signal:c})=>{let l=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:c});if(!l.ok)throw new Error(`Deposits fetch failed: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Deposits API error: ${d.code}`);return d},enabled:r,staleTime:0});return{depositMap:cc(()=>{let c=new Map;if(!a?.data.user_deposits)return c;for(let l of a.data.user_deposits)c.set(l.pool_address.toLowerCase(),l);return c},[a]),deposits:a?.data.user_deposits??[],...i}}import{useQuery as pc}from"@tanstack/react-query";import{useMemo as fc}from"react";var uc="wp:token-info";function fa(e,t=!0){let n=nt[e],o=Ne[e].cross,{data:r,...a}=pc({queryKey:[uc,e],queryFn:async({signal:l})=>{let d=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:l});if(!d.ok)throw new Error(`Failed to fetch token info: ${d.status}`);let u=await d.json();if(u.code!==200)throw new Error(`Token info API error: ${u.code}`);return u},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:s}=fc(()=>{let l=new Map,d=new Map;if(!r?.data)return{byChainAddr:l,byChainSym:d};for(let u of r.data){let h=u.address.toLowerCase();l.set(`${u.chain_id}:${h}`,u),l.set(h,u);let m=u.symbol.replace(/^t/,"").toUpperCase(),v=`${u.chain_id}:${m}`;d.has(v)||d.set(v,u),d.has(m)||d.set(m,u)}return{byChainAddr:l,byChainSym:d}},[r]);return{getTokenImage:(l,d)=>{let u=l.toLowerCase(),h=i.get(`${o}:${u}`);if(h?.image)return h.image;let m=i.get(u);if(m?.image)return m.image;if(d){let v=d.replace(/^t/,"").toUpperCase(),x=s.get(`${o}:${v}`);if(x?.image)return x.image;let w=s.get(v);if(w?.image)return w.image}return""},...a}}import{jsx as bo,jsxs as ua}from"react/jsx-runtime";function Vt({title:e,icon:t,iconFit:n="cover",isEmpty:o,children:r}){return ua("div",{className:"wp-svc-card",children:[ua("div",{className:"wp-svc-card-head",children:[bo("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:n}}),bo("span",{className:"wp-svc-card-title",children:e})]}),o?bo("div",{className:"wp-svc-empty",children:"No assets yet"}):bo("div",{className:"wp-svc-items",children:r})]})}import hr from"bignumber.js";import{jsx as Te,jsxs as _e}from"react/jsx-runtime";var mc="CROSS Rewards";function gc(e){return new hr(e||"0").isGreaterThan(0)}function ma(){let{env:e,walletAddress:t,onOutlink:n}=rt(),o=!!t,{allPools:r}=ho(e,o),{depositMap:a}=pa(e,t,o),{getTokenImage:i}=fa(e,o),s=(d,u)=>`${ia[e]}/rewards/${d.pool_address}?action=${u}`,c=`${jt[e]}/reward.png`,l=r.filter(d=>{let u=a.get(d.pool_address.toLowerCase()),h=u?.deposited_amount??"0",m=u?.claimable_reward??"0";return!(new hr(h).isZero()&&new hr(m).isZero())});return Te(Vt,{title:mc,icon:c,isEmpty:l.length===0,children:l.map(d=>{let u=a.get(d.pool_address.toLowerCase()),h=u?.deposited_amount??"0",m=u?.claimable_reward??"0",v=s(d,"withdraw"),x=s(d,"claim"),w=i(d.deposit_token.address,d.deposit_token.symbol),k=d.reward_tokens[0],P=k?i(k.address,k.symbol):"",f=d.reward_tokens.map(K=>K.symbol),I=f.length>0?`${d.deposit_token.symbol}-${f.join("/")}`:d.deposit_token.symbol,C=k?hn(m,k.decimals):"0",B=k?.symbol??"Reward",F=bn(h,d.deposit_token.decimals,d.deposit_token.price),Z=k?bn(m,k.decimals,k.price):null,O=!!u&&gc(m);return _e("article",{className:"wp-item","data-side":"reward",children:[_e("div",{className:"wp-item-body",children:[_e("div",{className:"wp-item-line",children:[Te("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),_e("div",{className:"wp-svc-token",children:[_e("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&Te("img",{className:"wp-svc-token-icon",src:w,alt:""}),P&&Te("img",{className:"wp-svc-token-icon",src:P,alt:""})]}),Te("span",{children:I})]})]}),_e("div",{className:"wp-item-line",children:[Te("span",{className:"wp-item-label",children:"Deposited"}),_e("div",{className:"wp-svc-token",children:[w&&Te("img",{className:"wp-svc-token-icon",src:w,alt:""}),_e("div",{className:"wp-svc-amount",children:[Te("span",{className:"wp-svc-amount-main",children:hn(h,d.deposit_token.decimals)}),F&&Te("span",{className:"wp-item-usd",children:F})]})]})]}),_e("div",{className:"wp-item-line",children:[_e("span",{className:"wp-item-label",children:["Claimable (",B,")"]}),_e("div",{className:"wp-svc-token",children:[P&&Te("img",{className:"wp-svc-token-icon",src:P,alt:""}),_e("div",{className:"wp-svc-amount",children:[Te("span",{className:"wp-svc-amount-main",children:C}),Z&&Te("span",{className:"wp-item-usd",children:Z})]})]})]})]}),_e("div",{className:"wp-item-tags",children:[_e("a",{className:"wp-tag wp-tag--muted",href:v,target:"_blank",rel:"noopener noreferrer",onClick:K=>Qe(K,v,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:u}},n),children:[Te("span",{className:"wp-tag-label",children:"Withdraw"}),Te(Mt,{size:12,className:"wp-tag-icon"})]}),_e("a",{className:"wp-tag wp-tag--mint","data-disabled":!O||void 0,"aria-disabled":!O||void 0,href:O?x:void 0,target:O?"_blank":void 0,rel:O?"noopener noreferrer":void 0,onClick:K=>{if(!O){K.preventDefault();return}Qe(K,x,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:u}},n)},children:[Te("span",{className:"wp-tag-label",children:"Claim"}),Te(Mt,{size:12,className:"wp-tag-icon"})]})]})]},d.pool_address)})})}import*as br from"react";import{useQuery as hc}from"@tanstack/react-query";var bc="wp:stake-info";function ga(e,t,n=!0){let o=wn[e],r=n&&!!t,{data:a,...i}=hc({queryKey:[bc,e,t],queryFn:async({signal:c})=>{let l=await fetch(`${o}/stake/${t}`,{cache:"no-store",signal:c});if(!l.ok)throw new Error(`Stake info fetch failed: ${l.status}`);let d=await l.json();if(d.code!==0&&d.code!==200)throw new Error(`Stake info API error: ${d.code}`);return d},enabled:r,staleTime:0});return{stakeInfo:a?.data,...i}}import{useQuery as wc}from"@tanstack/react-query";var xc="wp:stake-rewards",vc=31;function ha(e,t,n=!0){let o=wn[e],r=n&&!!t,{data:a,...i}=wc({queryKey:[xc,e,t],queryFn:async({signal:s})=>{let c=await fetch(`${o}/rewards/${t}?limit=${vc}`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Stake rewards fetch failed: ${c.status}`);let l=await c.json();if(l.code!==0&&l.code!==200)throw new Error(`Stake rewards API error: ${l.code}`);return l.data?.data??[]},enabled:r,staleTime:0});return{latestReward:a?.[0]??null,aprAccrued:oa(a),...i}}import{useQuery as yc}from"@tanstack/react-query";var kc="wp:network-stats";function ba(e,t=!0){let n=wn[e],{data:o,...r}=yc({queryKey:[kc,e],queryFn:async({signal:i})=>{let s=await fetch(`${n}/network/stats`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Network stats fetch failed: ${s.status}`);let c=await s.json();if(c.code!==0&&c.code!==200)throw new Error(`Network stats API error: ${c.code}`);return c},enabled:t,staleTime:0});return{networkStats:o?.data,...r}}import{useQuery as Sc}from"@tanstack/react-query";var Cc="wp:staking-onchain";function wa(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...a}=Sc({queryKey:[Cc,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:o,staleTime:0});return{onchain:r,...a}}import{useMemo as xa}from"react";import Rc from"bignumber.js";function va(e){return e?.trim().toUpperCase()==="CROSS"}function ya(e){return new Rc(e||"0").isGreaterThan(0)}function wo(e,t,n=!0){let{allPools:o}=ho(e,n),r=xa(()=>{for(let l of o)for(let d of[l.deposit_token,...l.reward_tokens])if(va(d?.symbol)&&ya(d.price))return d.price},[o]),a=n&&r===void 0,{tokens:i}=Ut(e,t,a),{statsMap:s}=$t(e,a),c=Ne[e].cross;return xa(()=>{if(r)return r;let l=i.find(d=>d.chainId===c&&va(d.symbol));if(l){let d=s.get(ht(l.chainId,l.address));if(d&&ya(d.price))return d.price}return"0"},[r,i,s,c])}import qt from"bignumber.js";import{Fragment as Tc,jsx as Ye,jsxs as bt}from"react/jsx-runtime";var Nc="CROSS Staking";function ka(e){if(!e)return"\u2014";let t=new qt(e);return t.isFinite()?`${t.toFormat(2,qt.ROUND_DOWN)}%`:"\u2014"}function Sa(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=rt(),r=!!t,{stakeInfo:a}=ga(e,t,r),{latestReward:i,aprAccrued:s}=ha(e,t,r),{networkStats:c}=ba(e,r),{onchain:l}=wa(t,o,r),d=wo(e,t,r),u=`${jt[e]}/cross-staking.png`,h=sa[e],m=a?.total_stake??"0",v=br.useMemo(()=>l?new qt(l.earnedWei.toString()).shiftedBy(-18).toString(10):i?.cumulative_earned??a?.rewards_earned??"0",[l,i,a]),x=br.useMemo(()=>l?new qt(l.stakedWei.toString()).shiftedBy(-18):new qt(m),[l,m]),w=s!==void 0?new qt(s):void 0,k=a?.days_since_first_stake,P=w!==void 0&&w.isFinite()&&x.isGreaterThan(0)&&k!==null&&k!==void 0?w.div(x).times(365).div(Math.max(1,k)).times(100):void 0,f=!(new qt(m).isZero()&&new qt(v).isZero()),I=Bn[e],C=bn(m,0,d),B=bn(v,0,d);return Ye(Vt,{title:Nc,icon:u,iconFit:"contain",isEmpty:!1,children:bt("article",{className:"wp-item","data-side":"stake",children:[Ye("div",{className:"wp-item-body",children:f?bt(Tc,{children:[bt("div",{className:"wp-item-line",children:[Ye("span",{className:"wp-item-label",children:"Staked"}),bt("div",{className:"wp-svc-amount",children:[bt("span",{className:"wp-svc-amount-main",children:[gr(m)," CROSS"]}),C&&Ye("span",{className:"wp-item-usd",children:C})]})]}),bt("div",{className:"wp-item-line",children:[Ye("span",{className:"wp-item-label",children:"Rewards Earned"}),bt("div",{className:"wp-svc-amount",children:[bt("span",{className:"wp-svc-amount-main",children:[gr(v)," CROSS"]}),B&&Ye("span",{className:"wp-item-usd",children:B})]})]}),bt("div",{className:"wp-item-line",children:[Ye("span",{className:"wp-item-label",children:"My APR"}),Ye("span",{children:ka(P?.toString(10))})]})]}):bt("div",{className:"wp-item-line",children:[Ye("span",{className:"wp-item-label",children:"Delegation APR"}),Ye("span",{children:ka(c?.apr)})]})}),Ye("div",{className:"wp-item-tags",children:bt("a",{className:"wp-tag wp-tag--mint",href:f?h:I,target:"_blank",rel:"noopener noreferrer",onClick:F=>Qe(F,f?h:I,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a,networkStats:c}},n),children:[Ye("span",{className:"wp-tag-label",children:f?"Manage":"Stake Now"}),Ye(Mt,{size:12,className:"wp-tag-icon"})]})})]})})}import*as wr from"react";import{useQuery as Ic}from"@tanstack/react-query";var Lc="wp:game-swap-pools";function Ca(e,t,n=!0){let o=la[e],r=n&&!!t,{data:a,...i}=Ic({queryKey:[Lc,e,t],queryFn:async({signal:s})=>{let c=await fetch(`${o}/addresses/${t}/portfolio`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Game-swap portfolio fetch failed: ${c.status}`);return(await c.json()).pools??[]},enabled:r,staleTime:0});return{pools:a??[],...i}}import{useQuery as Ec}from"@tanstack/react-query";var Ac="wp:game-swap-lp-balances";function Ra(e,t,n,o){let r=[...n].map(c=>c.toLowerCase()).sort(),a=!!o&&!!t&&r.length>0,{data:i,...s}=Ec({queryKey:[Ac,e,t,r],queryFn:async()=>{if(!o)return{};let c=await o(r),l={};for(let[d,u]of Object.entries(c))l[d.toLowerCase()]=u;return l},enabled:a,staleTime:0});return{balances:i??{},...s}}import Tt from"bignumber.js";import{jsx as it,jsxs as wt}from"react/jsx-runtime";var Pc="Game Swap LP",Ta=18,Bc=new Tt("0.0001");function Na(e){return e?.trim().toUpperCase()==="CROSS"}function Fc(e){return e&&e>0?e:Ta}function Mc(e){let t=Na(e.token_a?.symbol)&&!Na(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=Fc(t?e.token_a?.decimals:e.token_b?.decimals),r=new Tt(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new Tt(0):r.times(2)}function _c(e,t){let n=e.token_a?.symbol?.trim()||"TOKEN",o=e.token_b?.symbol?.trim()||"CROSS",r=t?.decimals??Ta,a,i;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let s=new Tt(t.balance.toString()),c=new Tt(t.totalSupply.toString()),l=s.div(c);a=l.times(100);let d=l.times(Mc(e));if(d.isGreaterThan(0)){let u=new Tt(e.cross_usd||"0");i=u.isGreaterThan(0)?`$${d.times(u).toFormat(2,Tt.ROUND_DOWN)}`:`${d.toFormat(4,Tt.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:n,tokenBSymbol:o,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:r,sharePercent:a,valueText:i}}function Ia(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=rt(),r=!!t,{pools:a}=Ca(e,t,r),i=wr.useMemo(()=>a.map(h=>h.pair_address).filter(Boolean),[a]),{balances:s}=Ra(e,t,i,o),c=`${jt[e]}/dex.png`,l=!!o,d=wr.useMemo(()=>{let h=a.map(m=>_c(m,s[m.pair_address?.toLowerCase()]));return l?h.filter(m=>m.lpAmountRaw?new Tt(m.lpAmountRaw).shiftedBy(-m.lpDecimals).isGreaterThanOrEqualTo(Bc):!1):h},[a,s,l]),u=h=>{let m=h.token_a?.address??h.pair_address;return`${ca[e]}/tokens/${m}?trade=deposit`};return it(Vt,{title:Pc,icon:c,iconFit:"contain",isEmpty:d.length===0,children:d.map(h=>{let{pool:m}=h,v=u(m),x=`${h.tokenASymbol} / ${h.tokenBSymbol}`,w=m.token_a?.logo_url,k=m.token_b?.logo_url;return wt("article",{className:"wp-item","data-side":"game-swap",children:[wt("div",{className:"wp-item-body",children:[wt("div",{className:"wp-item-line",children:[it("span",{className:"wp-item-label",children:"Pool"}),wt("div",{className:"wp-svc-token",children:[wt("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&it("img",{className:"wp-svc-token-icon",src:w,alt:""}),k&&it("img",{className:"wp-svc-token-icon",src:k,alt:""})]}),it("span",{children:x})]})]}),h.lpAmountRaw!==void 0&&wt("div",{className:"wp-item-line",children:[it("span",{className:"wp-item-label",children:"My LP"}),wt("span",{children:[hn(h.lpAmountRaw,h.lpDecimals)," LP"]})]}),h.sharePercent!==void 0&&wt("div",{className:"wp-item-line",children:[it("span",{className:"wp-item-label",children:"Pool Share"}),wt("span",{children:[h.sharePercent.toFormat(2,Tt.ROUND_DOWN),"%"]})]}),h.valueText!==void 0&&wt("div",{className:"wp-item-line",children:[it("span",{className:"wp-item-label",children:"Value"}),it("span",{children:h.valueText})]})]}),it("div",{className:"wp-item-tags",children:wt("a",{className:"wp-tag wp-tag--mint",href:v,target:"_blank",rel:"noopener noreferrer",onClick:P=>Qe(P,v,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:m}},n),children:[it("span",{className:"wp-tag-label",children:"Manage"}),it(Mt,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}import Qt from"bignumber.js";import{useMemo as Uc}from"react";import{useQuery as Oc}from"@tanstack/react-query";var zc="wp:forge-pools";function La(e,t,n=!0){let o=go[e],r=n&&!!t,{data:a,...i}=Oc({queryKey:[zc,e,t],queryFn:async()=>{let c=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!c.ok)throw new Error(`forge pools fetch failed: ${c.status}`);return(await c.json()).data?.items??[]},enabled:r,staleTime:0}),s=a??[];return{pools:s,isEmpty:s.length===0,...i}}import{useQueries as Wc}from"@tanstack/react-query";import{useMemo as Dc}from"react";var Hc="wp:forge-token-detail";async function Gc(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Ea(e,t,n=!0){let o=go[e],r=Wc({queries:t.map(s=>({queryKey:[Hc,e,s],queryFn:()=>Gc(o,s),enabled:n&&!!s,staleTime:3e4}))}),a=Dc(()=>{let s=new Map;for(let c=0;c<r.length;c++){let l=r[c]?.data,d=t[c];l&&d&&s.set(d.toLowerCase(),l)}return s},[r,t]),i=r.some(s=>s.isLoading);return{detailMap:a,isLoading:i}}import{jsx as We,jsxs as Kt}from"react/jsx-runtime";var $c="Forge",Aa=18,jc="https://contents.crosstoken.io/wallet/token/images/FT.png";function Vc(e){if(!e||e==="0")return"0";let t=new Qt(e).shiftedBy(-Aa);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Qt.ROUND_DOWN):t.toFormat(4,Qt.ROUND_DOWN)}function qc(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 Kc(e,t,n){let o=new Qt(n||"0");if(!o.isGreaterThan(0))return null;let r=new Qt(e.total_supply||"0"),a=new Qt(e.lp_balance||"0"),i=new Qt(t?.reserve_b||"0").shiftedBy(-Aa);if(!r.isGreaterThan(0)||!a.isGreaterThan(0)||!i.isGreaterThan(0))return null;let s=i.times(2),l=a.div(r).times(s).times(o);return l.isFinite()?`$${l.toFormat(2,Qt.ROUND_DOWN)}`:null}function Pa(){let{env:e,walletAddress:t,onOutlink:n}=rt(),o=!!t,{pools:r,isEmpty:a}=La(e,t,o),i=Uc(()=>r.map(u=>u.token.address),[r]),{detailMap:s}=Ea(e,i,o&&i.length>0),c=wo(e,t,o),l=u=>`${aa[e]}/forge/token/${u.token.address}`,d=`${jt[e]}/forge.png`;return We(Vt,{title:$c,icon:d,iconFit:"contain",isEmpty:a,children:r.map(u=>{let h=s.get(u.token.address.toLowerCase()),m=h?.image_url||h?.image||u.token.image||jc,v=h?.symbol||u.token.symbol,x=l(u),w=Kc(u,h,c);return Kt("a",{className:"wp-item","data-side":"lp",href:x,target:"_blank",rel:"noopener noreferrer",onClick:k=>Qe(k,x,{category:"portfolio",origin:"portfolio-forge",payload:{pool:u,tokenDetail:h}},n),children:[Kt("div",{className:"wp-item-body",children:[Kt("div",{className:"wp-item-line",children:[We("span",{className:"wp-item-label",children:"Asset"}),Kt("div",{className:"wp-svc-token",children:[We("img",{className:"wp-svc-token-icon",src:m,alt:""}),We("span",{children:v}),h?.name&&We("span",{className:"wp-token-subtle",children:h.name})]})]}),Kt("div",{className:"wp-item-line",children:[We("span",{className:"wp-item-label",children:"LP Balance"}),We("div",{className:"wp-svc-token",children:Kt("div",{className:"wp-svc-amount",children:[We("span",{className:"wp-svc-amount-main",children:Vc(u.lp_balance)}),w&&We("span",{className:"wp-item-usd",children:w})]})})]}),Kt("div",{className:"wp-item-line",children:[We("span",{className:"wp-item-label",children:"Ownership"}),We("span",{className:"wp-line-value",children:qc(u.pool_ownership)})]})]}),We("div",{className:"wp-item-tags",children:Kt("span",{className:"wp-tag wp-tag--muted",children:[We("span",{className:"wp-tag-label",children:"Withdraw"}),We(Mt,{size:12,className:"wp-tag-icon"})]})})]},u.pair_address)})})}z(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--ds-bg-default, #202530);--wp-header-bg: var(--ds-surface-default, #252b39);--wp-card: var(--ds-surface-medium, #252b39);--wp-control: #292f40;--wp-border: var(--ds-border-default, #292f40);--wp-panel-border: var(--ds-border-medium, rgba(255, 255, 255, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .28);--wp-text: var(--ds-content-highest, #ffffff);--wp-text-60: var(--ds-content-high, rgba(255, 255, 255, .85));--wp-text-40: var(--ds-content-medium, rgba(255, 255, 255, .65));--wp-text-30: var(--ds-content-low, rgba(255, 255, 255, .4));--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, rgba(0, 160, 162, .14));--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #9b8cef;--wp-claim-primary-text: #202530;--wp-claim-secondary-bg: var(--wp-control);--wp-claim-success: #00d4aa;--wp-claim-success-soft: rgba(0, 212, 170, .18);--wp-claim-error: #ff3aa3;--wp-claim-error-soft: rgba(255, 58, 163, .16)}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: var(--ds-bg-dim, #f5f7fa);--wp-header-bg: var(--ds-surface-default, #ffffff);--wp-card: var(--ds-surface-default, #ffffff);--wp-control: var(--ds-surface-medium, #f5f7fa);--wp-border: var(--ds-border-default, rgba(0, 0, 0, .07));--wp-panel-border: var(--ds-border-medium, rgba(0, 0, 0, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .15);--wp-text: var(--ds-content-highest, #000000);--wp-text-60: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-text-40: var(--ds-content-medium, rgba(0, 0, 0, .65));--wp-text-30: var(--ds-content-low, rgba(0, 0, 0, .4));--wp-chrome-text: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-card-shadow: none;--wp-tooltip-bg: #192023;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, #e7f9f8);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #7346f3;--wp-claim-primary-text: #ffffff;--wp-claim-secondary-bg: #ffffff;--wp-claim-success: #019d92;--wp-claim-success-soft: rgba(1, 157, 146, .15);--wp-claim-error: #e70077;--wp-claim-error-soft: rgba(231, 0, 119, .12)}.wp-fullscreen{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:73px;padding:24px;position:relative;border-bottom:1px solid var(--wp-border);background:var(--wp-header-bg);color:var(--wp-chrome-text);flex-shrink:0;box-sizing:border-box}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wp-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wp-header-edge{display:flex;align-items:center;width:24px;min-width:24px}.wp-header-edge--right{justify-content:flex-end}.wp-header-edge--right .wp-header-btn{position:absolute;top:24px;right:24px}.wp-header-spacer{display:block;width:24px;height:24px}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: hsl(221.3 24.6% 25.5%)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;text-align:center;color:var(--ds-content-highest, #000000);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-account-meta{display:flex;flex-direction:column;justify-content:center;min-width:0;gap:2px}.wp-header-wallet-name{min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:1.4;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-btn{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;padding:0;border:0;background:transparent;cursor:pointer;font:inherit}.wp-header-address{min-width:0;font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-copy{display:inline-flex;align-items:center;flex-shrink:0;color:var(--wp-text-40);transition:color .15s ease}.wp-header-address-btn:hover .wp-header-address-copy{color:var(--wp-text-60)}.wp-header-address-copy[data-copied=true]{color:var(--wp-mint)}.wp-top{flex-shrink:0;padding:0 16px 16px;display:flex;flex-direction:column;gap:16px}.wp-identity{display:flex;flex-direction:column;gap:8px}.wp-address{display:inline-flex;align-items:center;gap:8px}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40)}.wp-total{font-size:28px;font-weight:600;line-height:1.3;color:var(--wp-text);margin:0}.wp-asset{display:flex;flex-direction:column;gap:8px}.wp-asset-head{display:flex;align-items:center;gap:4px}.wp-asset-head-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-asset-head-icon{display:inline-flex;color:var(--wp-text-40)}.wp-bar{display:flex;height:20px;border-radius:4px;overflow:hidden}.wp-bar-seg{display:flex;align-items:center;justify-content:center;min-width:8px}.wp-bar-seg-pct{font-size:10px;font-weight:400;line-height:1.3;color:#fff;white-space:nowrap}.wp-legend{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}.wp-legend-item{display:flex;align-items:center;gap:4px}.wp-legend-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.wp-legend-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-tabs{flex-shrink:0;padding:8px 16px}.wp-tabs-inner{display:flex;align-items:center;padding:0 2px}.wp-tabs-list{display:flex;gap:20px;flex:1}.wp-tab{display:flex;flex-direction:column;align-items:center;justify-content:space-between;height:44px;padding-top:12px;background:transparent;border:none;cursor:pointer}.wp-tab-text{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text-30);white-space:nowrap}.wp-tab[data-active=true] .wp-tab-text{color:var(--wp-mint)}.wp-tab-bar{width:20px;height:4px;border-radius:2px;background:var(--wp-mint);opacity:0}.wp-tab[data-active=true] .wp-tab-bar{opacity:1}.wp-tabs-filter-wrap{position:relative;display:flex;align-items:center;width:44px;height:44px;flex-shrink:0}.wp-tabs-filter-grad{position:absolute;inset:0;background:linear-gradient(to left,var(--wp-bg) 74%,transparent);pointer-events:none}.wp-tabs-filter{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text-40)}.wp-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--wp-border) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:var(--wp-border);border-radius:4px}.wp-body-inner{padding:16px 16px 32px;display:flex;flex-direction:column;gap:32px}.wp-summary-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-summary-head{position:relative;display:flex;align-items:center;justify-content:flex-start;gap:4px}.wp-summary-label{font-size:14px;font-weight:400;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address{display:inline-flex;align-items:center;gap:8px;min-width:0}.wp-address-avatar{width:16px;height:16px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 68% 34%,#ff78d1 0 18%,transparent 19%),radial-gradient(circle at 34% 66%,#00d4aa 0 20%,transparent 21%),linear-gradient(135deg,#7346f3,#0488fc)}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40);flex-shrink:0}.wp-summary-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;background:#019d921a;color:var(--wp-mint);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;white-space:nowrap}.wp-summary-estimate{position:relative;display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.wp-estimate-info{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--wp-text-40);cursor:help}.wp-estimate-tooltip{position:absolute;top:calc(100% + 8px);left:0;right:auto;z-index:3;display:flex;flex-direction:column;gap:8px;width:min(280px,calc(100vw - 48px));padding:12px;border-radius:8px;background:var(--wp-tooltip-bg);box-shadow:0 12px 32px #0000003d;color:var(--wp-tooltip-text);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-estimate-tooltip-title{display:block;font-size:12px;font-weight:600;line-height:1.3}.wp-estimate-tooltip-group{display:flex;flex-direction:column;gap:4px}.wp-estimate-tooltip-item{display:block;color:#ffffffc7}.wp-estimate-tooltip-item:before{content:"- "}.wp-estimate-info:hover .wp-estimate-tooltip,.wp-estimate-info:focus .wp-estimate-tooltip,.wp-estimate-info:focus-visible .wp-estimate-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-total{font-family:var( --wp-total-font-family, Sora, Inter, system-ui, -apple-system, sans-serif );font-size:36px;font-weight:600;line-height:1.25;letter-spacing:0;color:var(--wp-text);margin:0}.wp-svc-card{display:flex;flex-direction:column;gap:12px;width:100%}.wp-svc-card-head{display:flex;align-items:center;gap:6px}.wp-svc-card-icon{width:24px;height:24px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-item{position:relative;display:flex;flex-direction:column;gap:20px;width:100%;padding:12px;border-radius:12px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box;color:inherit;text-decoration:none;cursor:pointer;outline:none;transition:opacity .15s ease}.wp-item+.wp-item{padding-top:12px;border-top:0}.wp-item:hover{opacity:.88}.wp-item-body{display:flex;flex-direction:column;gap:12px;min-width:0}.wp-order-head{display:flex;align-items:center;width:100%}.wp-item-line{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:21px;min-width:0}.wp-item-label{flex-shrink:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-30);white-space:nowrap}.wp-line-value,.wp-order-side{min-width:0;overflow:hidden;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-order-side--buy{color:var(--wp-mint)}.wp-order-side--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;min-height:21px}.wp-svc-token>span{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:16px;height:16px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-token-stack{display:inline-flex;align-items:center;justify-content:flex-end;width:29px;min-width:29px;overflow:visible}.wp-token-stack .wp-svc-token-icon+.wp-svc-token-icon{margin-left:-3.5px}.wp-token-subtle,.wp-item-usd{color:var(--wp-text-30)!important}.wp-svc-amount{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:1px;min-width:0}.wp-svc-amount-main{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.wp-svc-amount .wp-item-usd{font-size:12px;font-weight:500;line-height:1.35}.wp-order-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-order-token .wp-svc-token-icon{width:32px;height:32px}.wp-order-token-meta{display:flex;min-width:0;flex-direction:column;justify-content:center}.wp-order-token-symbol{overflow:hidden;color:var(--wp-text-60);font-size:14px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-order-token-pair{overflow:hidden;color:var(--wp-text-30);font-size:12px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-item-tags{display:flex;align-items:stretch;gap:8px;width:100%}.wp-tag{appearance:none;display:inline-flex;flex:1 1 0;align-items:center;justify-content:center;gap:0;min-width:0;min-height:33px;padding:6px 10px;border-radius:6px;border:0;background:var(--wp-control);font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);text-align:center;text-decoration:none;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}a.wp-tag,button.wp-tag{cursor:pointer}.wp-tag:hover{background:var(--wp-control);transform:none}.wp-tag:focus-visible{outline:2px solid var(--wp-mint);outline-offset:2px}.wp-tag[aria-disabled=true],.wp-tag[data-disabled]{cursor:default;opacity:.48;pointer-events:none}.wp-tag-label{display:inline-flex;align-items:center}.wp-tag-icon{display:none}.wp-tag:hover .wp-tag-icon{transform:none}.wp-tag--mint{color:var(--wp-mint);background:var(--wp-accent-soft)}.wp-tag--mint:hover{background:var(--wp-accent-soft)}.wp-tag--muted{color:var(--wp-text-40)}.wp-svc-empty{display:flex;align-items:center;justify-content:center;min-height:74px;padding:20px 16px;background:var(--wp-card);border-radius:12px;box-shadow:var(--wp-card-shadow, none);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-30);box-sizing:border-box}.wp-claim-overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:flex-end;justify-content:center;background:#00000094;box-sizing:border-box}.wp-claim-sheet{display:flex;flex-direction:column;width:100%;max-width:375px;max-height:calc(100% - 24px);overflow:hidden;border-radius:24px 24px 0 0;background:var(--wp-bg);color:var(--wp-text);box-shadow:0 -18px 48px #00000042;animation:wp-claim-slide-up .22s ease-out}@keyframes wp-claim-slide-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.wp-claim-grabber{display:flex;align-items:flex-start;justify-content:center;height:38px;min-height:38px;padding-top:12px;box-sizing:border-box}.wp-claim-grabber span{display:block;width:52px;height:5px;border-radius:999px;background:var(--wp-control)}.wp-claim-content{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;padding:20px;box-sizing:border-box}.wp-claim-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;flex-shrink:0}.wp-claim-icon--success{background:var(--wp-claim-success-soft);color:var(--wp-claim-success)}.wp-claim-icon--pending{background:#9b8cef29;color:var(--wp-claim-primary)}.wp-claim-icon--error{background:var(--wp-claim-error-soft);color:var(--wp-claim-error);font-size:30px;font-weight:600;line-height:1}.wp-claim-icon--token{background:#00d4aa29}.wp-claim-icon--token img{width:48px;height:48px;border-radius:50%;object-fit:cover}.wp-claim-icon--token span{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;background:var(--wp-mint);color:#101820;font-size:18px;font-weight:600}.wp-claim-spinner{width:36px;height:36px;border-radius:50%;border:3px solid rgba(155,140,239,.28);border-top-color:var(--wp-claim-primary);animation:wp-claim-spin .8s linear infinite}@keyframes wp-claim-spin{to{transform:rotate(360deg)}}.wp-claim-copy{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;text-align:center}.wp-claim-title{margin:0;font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text)}.wp-claim-desc{max-width:335px;margin:0;font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-40)}.wp-claim-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.wp-claim-error-message{margin:0;color:var(--wp-claim-error);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0}.wp-claim-reward-card{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:60px;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-reward-token{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-claim-reward-token img{width:28px;height:28px;object-fit:cover}.wp-claim-reward-token span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-claim-reward-symbol{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wp-text);font-size:18px;font-weight:600;line-height:1.3;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-reward-amount{flex-shrink:0;color:var(--wp-text);font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-account-row{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-height:40px}.wp-claim-account-row>span{flex-shrink:0;color:var(--wp-text-40);font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account{display:flex;align-items:center;gap:8px;min-width:0}.wp-claim-account strong{overflow:hidden;color:var(--wp-text);font-size:15px;font-weight:600;line-height:1.6;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-account-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 30% 28%,#d87aff 0 12%,transparent 13%),radial-gradient(circle at 68% 28%,#f0a1ff 0 12%,transparent 13%),radial-gradient(circle at 32% 70%,#b561e7 0 13%,transparent 14%),radial-gradient(circle at 70% 70%,#d4a2ff 0 13%,transparent 14%),radial-gradient(circle at 50% 50%,#8c4fc4 0 18%,transparent 19%),#4a315f;box-shadow:inset 0 0 0 3.37px var(--wp-control)}.wp-claim-divider{display:block;width:100%;height:1px;background:var(--wp-border)}.wp-claim-detail-list{display:flex;flex-direction:column;gap:8px;width:100%}.wp-claim-detail-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:20px}.wp-claim-detail-row>span{min-width:0;color:var(--wp-text-40);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-detail-row--sub>span:before{content:"";display:inline-block;width:3px;height:3px;margin:0 8px 3px;background:currentColor}.wp-claim-detail-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list{display:flex;flex-direction:column;gap:8px;width:100%;padding-bottom:8px}.wp-claim-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-list-item>span{flex-shrink:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--wp-text-40);white-space:nowrap}.wp-claim-list-item strong{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;overflow:hidden;color:var(--wp-text);font-size:14px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list-item img{width:16px;height:16px;border-radius:50%;flex-shrink:0}.wp-claim-hash{appearance:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);cursor:pointer;font:inherit}.wp-claim-hash svg{flex-shrink:0;color:var(--wp-text-60)}.wp-claim-gas-card{display:flex;flex-direction:column;gap:4px;width:100%;padding:14px 16px;border-radius:8px;border:1px solid var(--wp-border);background:var(--wp-card);box-sizing:border-box}.wp-claim-gas-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:28px}.wp-claim-gas-row>span{min-width:0;font-size:12px;font-weight:400;line-height:1.3;color:var(--wp-text-40)}.wp-claim-gas-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:12px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-gas-row--primary{min-height:32px}.wp-claim-gas-row--primary>span,.wp-claim-gas-row--primary strong{font-size:14px;color:var(--wp-text)}.wp-claim-fee-label{position:relative;display:inline-flex;align-items:center;text-decoration:underline dotted;text-underline-offset:3px;cursor:help;overflow:visible!important}.wp-claim-fee-tooltip{position:absolute;left:0;bottom:calc(100% + 8px);z-index:2;width:min(260px,calc(100vw - 64px));padding:10px 12px;border-radius:8px;background:var(--wp-tooltip-bg);color:var(--wp-tooltip-text);box-shadow:0 12px 32px #0000003d;font-size:11px;font-weight:400;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-claim-fee-label:hover .wp-claim-fee-tooltip,.wp-claim-fee-label:focus .wp-claim-fee-tooltip,.wp-claim-fee-label:focus-visible .wp-claim-fee-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-claim-actions{display:flex;align-items:center;gap:8px;width:100%}.wp-claim-primary,.wp-claim-secondary{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;height:52px;padding:0 24px;border:none;border-radius:40px;font-family:inherit;font-size:15px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap;cursor:pointer}.wp-claim-primary{background:var(--wp-claim-primary);color:var(--wp-claim-primary-text)}.wp-claim-primary:disabled{cursor:default;opacity:.72}.wp-claim-secondary{background:var(--wp-claim-secondary-bg, var(--wp-control));color:var(--wp-claim-primary)}.wp-claim-actions[data-count="2"] .wp-claim-primary{flex:1 1 0}.wp-claim-actions[data-count="2"] .wp-claim-secondary{flex:0 0 120px}.wp-claim-button-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(32,37,48,.28);border-top-color:var(--wp-claim-primary-text);animation:wp-claim-spin .8s linear infinite}.wp-claim-home-indicator{display:flex;align-items:flex-end;justify-content:center;height:34px;min-height:34px;padding-bottom:8px;box-sizing:border-box}.wp-claim-home-indicator span{display:block;width:134px;height:5px;border-radius:16px;background:var(--wp-text-40)}@media(max-width:359px){.wp-header{gap:12px;padding:0 12px}.wp-total{font-size:24px}.wp-body-inner{padding:0 12px 128px;gap:20px}.wp-svc-items,.wp-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.wi-drawer-content .wp-header,.wi-portfolio-body .wp-header{padding:16px}.wi-drawer-content .wp-header-edge--right .wp-header-btn,.wi-portfolio-body .wp-header-edge--right .wp-header-btn{top:16px;right:16px}
|
|
7
|
+
`);import{jsx as ve,jsxs as po}from"react/jsx-runtime";var Ol={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function fo({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...a}){let i=ji.useCallback(k=>{o?.(k),n?.(k)},[n,o]),c=Ii({...a,onSuccess:o||n?i:void 0,onExit:t}),{step:l,status:d}=c,u=Rt(c.recipient.trim()),h=rn(c.amount,c.token.quantity.decimals),m="value"in h&&h.value<=c.balanceRaw,v=d==="submitting"||d==="confirming",x=l!=="result",w=Ol[l]??"";return po("div",{className:X("sf-root",r),"data-step":l,children:[po("header",{className:"sf-header",children:[x?ve("button",{type:"button",className:"sf-header-btn",onClick:c.back,"aria-label":"Back",children:ve(tn,{size:24})}):ve("span",{className:"sf-header-btn","aria-hidden":!0}),ve("span",{className:"sf-header-title",children:w}),ve("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close",children:ve(Ct,{size:24})})]}),l==="token"&&ve($i,{flow:c}),l==="recipient"&&ve(Di,{flow:c}),l==="amount"&&ve(Li,{flow:c}),l==="review"&&ve(Ui,{flow:c}),l==="result"&&ve(Gi,{flow:c}),po("footer",{className:"sf-footer","data-step":l,children:[l==="recipient"&&ve("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.submitRecipient,"data-disabled":!u||void 0,"aria-disabled":!u,children:"Next"}),l==="amount"&&ve("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.submitAmount,"data-disabled":!m||void 0,"aria-disabled":!m,children:"Next"}),l==="review"&&po("div",{className:"sf-footer-row",children:[ve("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:c.back,disabled:v,children:"Cancel"}),ve("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.confirmSend,disabled:v||!c.canSend||c.insufficientGas,children:v?"Sending...":"Send"})]}),l==="result"&&d==="success"&&ve("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(c.txHash||void 0),children:"All done"}),l==="result"&&d==="error"&&ve("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.retry,children:"Try Again"})]})]})}import*as Vi from"@radix-ui/react-popover";import{Drawer as zl}from"vaul";import{jsx as uo,jsxs as Wl}from"react/jsx-runtime";function qi({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:a}=Wt(),i=n!=null,s=e??!0,c=i?n:Wl("button",{type:"button",className:X("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[uo(oi,{size:o?14:16}),uo("span",{className:"wi-trigger-address",children:Ke(a)})]});return o?uo(zl.Trigger,{asChild:s,children:c}):uo(Vi.Trigger,{asChild:s,children:c})}import*as M from"react";import*as No from"@radix-ui/react-popover";import{Drawer as Co}from"vaul";import Mn from"bignumber.js";import{useQueries as Dl}from"@tanstack/react-query";import{useMemo as Hl}from"react";var pr="user-balance";async function Gl(e,t,n,o){let r=new URLSearchParams({networkId:`eip155:${t}`,account:n}),a=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:o});if(!a.ok)throw new Error(`Failed to fetch token balance: ${a.status}`);let i=await a.json();if(i.code!==200)throw new Error(`Token balance API error: ${i.code}`);return i.data}function Ut(e,t,n=!0){let o=nt[e],r=Ne[e],a=[r.cross,r.bsc],i=Dl({queries:a.map(d=>({queryKey:[pr,e,t,d],queryFn:({signal:u})=>Gl(o,d,t,u),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),s=i.some(d=>d.isLoading),c=i.some(d=>d.isError);return{tokens:Hl(()=>{let d=[];for(let u of i)u.data&&d.push(...u.data);return d},[i]),isLoading:s,isError:c}}import{useQuery as Ul,useQueries as $l}from"@tanstack/react-query";import{useMemo as jl}from"react";var Vl="forge-holdings",ql="forge-token-image";async function Kl(e,t,n){let o=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch forge holdings: ${o.status}`);let r=await o.json();if(!r.success)throw new Error("Forge holdings API error");return r.data.items}async function Ql(e,t,n){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:n});if(!o.ok)return{address:t,image_url:""};let r=await o.json();return r.success?{address:t,image_url:r.data.token.image_url}:{address:t,image_url:""}}function Ki(e,t,n=!0){let o=dr[e],{data:r,...a}=Ul({queryKey:[Vl,e,t],queryFn:({signal:i})=>Kl(o,t,i),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:r??[],...a}}function Qi(e,t,n=!0){let o=dr[e],r=$l({queries:t.map(i=>({queryKey:[ql,e,i],queryFn:({signal:s})=>Ql(o,i,s),enabled:n,staleTime:1/0}))});return{imageMap:jl(()=>{let i=new Map;for(let s of r)s.data&&i.set(s.data.address,s.data.image_url);return i},[r])}}import{useQuery as Yl}from"@tanstack/react-query";import{useMemo as Zl}from"react";var fr="token-stats";function ht(e,t){return`${e}:${t.toLowerCase()}`}function $t(e,t=!0){let n=nt[e],{data:o,...r}=Yl({queryKey:[fr,e],queryFn:async({signal:i})=>{let s=await fetch(`${n}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Token stats API error: ${c.code}`);return c},enabled:t,staleTime:3e4});return{statsMap:Zl(()=>{let i=new Map;if(!o?.data)return i;for(let s of o.data){let c=ht(s.chain_id,s.address);i.set(c,s)}return i},[o]),...r}}import{useQuery as Xl}from"@tanstack/react-query";import{useMemo as Jl}from"react";var ec="token-info";function ur(e,t){return`${t.toLowerCase()}_${e}`}function Yi(e,t=!0){let n=nt[e],{data:o,...r}=Xl({queryKey:[ec,e],queryFn:async({signal:i})=>{let s=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Failed to fetch token info: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Token info API error: ${c.code}`);return c},enabled:t,staleTime:1/0});return{categoryMap:Jl(()=>{let i=new Map;if(!o?.data)return i;for(let s of o.data){let c=ur(s.chain_id,s.address);i.set(c,s.category)}return i},[o]),...r}}import{useMemo as tc}from"react";import mr from"bignumber.js";function Zi(e,t,n){let{tokens:o,isLoading:r}=Ut(e,t,n),{statsMap:a}=$t(e,n);return tc(()=>{let i=new mr(0);for(let d of o){let u=a.get(ht(d.chainId,d.address));if(!u)continue;let m=new mr(d.quantity.numeric).shiftedBy(-d.quantity.decimals).multipliedBy(new mr(u.price));m.isNaN()||(i=i.plus(m))}let s=i.toFixed(),{displayValue:c,isLowerBound:l}=mi(s);return{totalUsd:s,displayValue:c,isLowerBound:l,isLoading:r}},[o,a,r])}import{QRCodeSVG as Gd}from"qrcode.react";function Qe(e,t,n,o){if(!o||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let r;try{r=o(t,n)}catch(l){console.error("[dapp-ui] onOutlink threw:",l);return}let a=l=>{typeof window>"u"||window.open(l,"_blank","noopener,noreferrer")};if((l=>!!l&&(typeof l=="object"||typeof l=="function")&&typeof l.then=="function")(r)){let l=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,d=u=>{if(u===null){l?.close();return}let h=u??t;if(l)try{l.location.href=h}catch{l.close(),a(h)}else a(h)};r.then(d,u=>{console.error("[dapp-ui] onOutlink rejected:",u),l?.close()});return}let s=r;if(s===null)return;a(s??t)}import*as ln from"react";import{Drawer as Xc}from"vaul";import{createContext as nc,useContext as oc}from"react";var Pn=nc(null);function rt(){let e=oc(Pn);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}import{Drawer as rc}from"vaul";import{jsx as Xi}from"react/jsx-runtime";function Ji({asChild:e,children:t}){let{walletAddress:n}=rt(),o=t!=null,r=e??!0,a=o?t:Xi("button",{type:"button",children:Ke(n)});return Xi(rc.Trigger,{asChild:r,children:a})}import{Drawer as xo}from"vaul";import*as Ie from"react";import{useQueryClient as Qc}from"@tanstack/react-query";import{jsx as sn,jsxs as na}from"react/jsx-runtime";function ea({size:e=22,className:t}){return sn("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:sn("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function ta({size:e=22,className:t}){return na("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[sn("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),sn("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 Mt({size:e=12,className:t}){return na("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:[sn("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"}),sn("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),sn("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import gn from"bignumber.js";var ic=/^(\d{4}-\d{2}-\d{2})/;function oa(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:r,cumulative:a}of e.map(i=>({key:ic.exec(i.reference_date)?.[1],cumulative:i.cumulative_earned})).filter(i=>!!i.key&&i.cumulative!=null).sort((i,s)=>i.key<s.key?-1:i.key>s.key?1:0))t.set(r,a),n=r;if(n===void 0)return;let o=new Date().toISOString().slice(0,10);return t.get(o)??t.get(n)}function ra(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function hn(e,t){let n=new gn(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,gn.ROUND_DOWN):n.toFormat(4,gn.ROUND_DOWN)}function gr(e){return hn(e,0)}function bn(e,t,n){let o=new gn(n||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let r=new gn(e||"0").shiftedBy(-t).times(o);return r.isFinite()?`$${r.toFormat(2,gn.ROUND_DOWN)}`:null}import{useQuery as ac}from"@tanstack/react-query";import{useMemo as da}from"react";var mo={dev:"https://stg-cross-game-reward-api.crosstoken.io/api",stage:"https://stg-cross-game-reward-api.crosstoken.io/api",production:"https://cross-game-reward-api.crosstoken.io/api"},ia={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},go={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},aa={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},wn={dev:"https://stg-posa-api.crosstoken.io/api/v1",stage:"https://stg-posa-api.crosstoken.io/api/v1",production:"https://posa-api.crosstoken.io/api/v1"},Bn={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},sa={dev:`${Bn.dev}/portfolio`,stage:`${Bn.stage}/portfolio`,production:`${Bn.production}/portfolio`},la={dev:"https://stg-game-swap-api.cross.nexus/v1",stage:"https://stg-game-swap-api.cross.nexus/v1",production:"https://game-swap-api.cross.nexus/v1"},ca={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},jt={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"};var sc="wp:reward-pools";function ho(e,t=!0){let n=mo[e],{data:o,...r}=ac({queryKey:[sc,e],queryFn:async({signal:s})=>{let c=await fetch(`${n}/v1/pools`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch pools: ${c.status}`);let l=await c.json();if(l.code!==200)throw new Error(`Pools API error: ${l.code}`);return l},enabled:t,staleTime:0}),a=da(()=>o?.data.pools.filter(s=>s.pool_type==="CrossPool")??[],[o]),i=da(()=>o?.data.pools.filter(s=>s.pool_type==="GamePool")??[],[o]);return{crossPools:a,gamePools:i,allPools:o?.data.pools??[],...r}}import{useQuery as lc}from"@tanstack/react-query";import{useMemo as cc}from"react";var dc="wp:user-deposits";function pa(e,t,n=!0){let o=mo[e],r=n&&!!t,{data:a,...i}=lc({queryKey:[dc,e,t],queryFn:async({signal:c})=>{let l=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:c});if(!l.ok)throw new Error(`Deposits fetch failed: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Deposits API error: ${d.code}`);return d},enabled:r,staleTime:0});return{depositMap:cc(()=>{let c=new Map;if(!a?.data.user_deposits)return c;for(let l of a.data.user_deposits)c.set(l.pool_address.toLowerCase(),l);return c},[a]),deposits:a?.data.user_deposits??[],...i}}import{useQuery as pc}from"@tanstack/react-query";import{useMemo as fc}from"react";var uc="wp:token-info";function fa(e,t=!0){let n=nt[e],o=Ne[e].cross,{data:r,...a}=pc({queryKey:[uc,e],queryFn:async({signal:l})=>{let d=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:l});if(!d.ok)throw new Error(`Failed to fetch token info: ${d.status}`);let u=await d.json();if(u.code!==200)throw new Error(`Token info API error: ${u.code}`);return u},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:s}=fc(()=>{let l=new Map,d=new Map;if(!r?.data)return{byChainAddr:l,byChainSym:d};for(let u of r.data){let h=u.address.toLowerCase();l.set(`${u.chain_id}:${h}`,u),l.set(h,u);let m=u.symbol.replace(/^t/,"").toUpperCase(),v=`${u.chain_id}:${m}`;d.has(v)||d.set(v,u),d.has(m)||d.set(m,u)}return{byChainAddr:l,byChainSym:d}},[r]);return{getTokenImage:(l,d)=>{let u=l.toLowerCase(),h=i.get(`${o}:${u}`);if(h?.image)return h.image;let m=i.get(u);if(m?.image)return m.image;if(d){let v=d.replace(/^t/,"").toUpperCase(),x=s.get(`${o}:${v}`);if(x?.image)return x.image;let w=s.get(v);if(w?.image)return w.image}return""},...a}}import{jsx as bo,jsxs as ua}from"react/jsx-runtime";function Vt({title:e,icon:t,iconFit:n="cover",isEmpty:o,children:r}){return ua("div",{className:"wp-svc-card",children:[ua("div",{className:"wp-svc-card-head",children:[bo("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:n}}),bo("span",{className:"wp-svc-card-title",children:e})]}),o?bo("div",{className:"wp-svc-empty",children:"No assets yet"}):bo("div",{className:"wp-svc-items",children:r})]})}import hr from"bignumber.js";import{jsx as Te,jsxs as _e}from"react/jsx-runtime";var mc="CROSS Rewards";function gc(e){return new hr(e||"0").isGreaterThan(0)}function ma(){let{env:e,walletAddress:t,onOutlink:n}=rt(),o=!!t,{allPools:r}=ho(e,o),{depositMap:a}=pa(e,t,o),{getTokenImage:i}=fa(e,o),s=(d,u)=>`${ia[e]}/rewards/${d.pool_address}?action=${u}`,c=`${jt[e]}/reward.png`,l=r.filter(d=>{let u=a.get(d.pool_address.toLowerCase()),h=u?.deposited_amount??"0",m=u?.claimable_reward??"0";return!(new hr(h).isZero()&&new hr(m).isZero())});return Te(Vt,{title:mc,icon:c,isEmpty:l.length===0,children:l.map(d=>{let u=a.get(d.pool_address.toLowerCase()),h=u?.deposited_amount??"0",m=u?.claimable_reward??"0",v=s(d,"withdraw"),x=s(d,"claim"),w=i(d.deposit_token.address,d.deposit_token.symbol),k=d.reward_tokens[0],P=k?i(k.address,k.symbol):"",f=d.reward_tokens.map(K=>K.symbol),I=f.length>0?`${d.deposit_token.symbol}-${f.join("/")}`:d.deposit_token.symbol,C=k?hn(m,k.decimals):"0",B=k?.symbol??"Reward",F=bn(h,d.deposit_token.decimals,d.deposit_token.price),Z=k?bn(m,k.decimals,k.price):null,O=!!u&&gc(m);return _e("article",{className:"wp-item","data-side":"reward",children:[_e("div",{className:"wp-item-body",children:[_e("div",{className:"wp-item-line",children:[Te("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),_e("div",{className:"wp-svc-token",children:[_e("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&Te("img",{className:"wp-svc-token-icon",src:w,alt:""}),P&&Te("img",{className:"wp-svc-token-icon",src:P,alt:""})]}),Te("span",{children:I})]})]}),_e("div",{className:"wp-item-line",children:[Te("span",{className:"wp-item-label",children:"Deposited"}),_e("div",{className:"wp-svc-token",children:[w&&Te("img",{className:"wp-svc-token-icon",src:w,alt:""}),_e("div",{className:"wp-svc-amount",children:[Te("span",{className:"wp-svc-amount-main",children:hn(h,d.deposit_token.decimals)}),F&&Te("span",{className:"wp-item-usd",children:F})]})]})]}),_e("div",{className:"wp-item-line",children:[_e("span",{className:"wp-item-label",children:["Claimable (",B,")"]}),_e("div",{className:"wp-svc-token",children:[P&&Te("img",{className:"wp-svc-token-icon",src:P,alt:""}),_e("div",{className:"wp-svc-amount",children:[Te("span",{className:"wp-svc-amount-main",children:C}),Z&&Te("span",{className:"wp-item-usd",children:Z})]})]})]})]}),_e("div",{className:"wp-item-tags",children:[_e("a",{className:"wp-tag wp-tag--muted",href:v,target:"_blank",rel:"noopener noreferrer",onClick:K=>Qe(K,v,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:u}},n),children:[Te("span",{className:"wp-tag-label",children:"Withdraw"}),Te(Mt,{size:12,className:"wp-tag-icon"})]}),_e("a",{className:"wp-tag wp-tag--mint","data-disabled":!O||void 0,"aria-disabled":!O||void 0,href:O?x:void 0,target:O?"_blank":void 0,rel:O?"noopener noreferrer":void 0,onClick:K=>{if(!O){K.preventDefault();return}Qe(K,x,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:u}},n)},children:[Te("span",{className:"wp-tag-label",children:"Claim"}),Te(Mt,{size:12,className:"wp-tag-icon"})]})]})]},d.pool_address)})})}import*as br from"react";import{useQuery as hc}from"@tanstack/react-query";var bc="wp:stake-info";function ga(e,t,n=!0){let o=wn[e],r=n&&!!t,{data:a,...i}=hc({queryKey:[bc,e,t],queryFn:async({signal:c})=>{let l=await fetch(`${o}/stake/${t}`,{cache:"no-store",signal:c});if(!l.ok)throw new Error(`Stake info fetch failed: ${l.status}`);let d=await l.json();if(d.code!==0&&d.code!==200)throw new Error(`Stake info API error: ${d.code}`);return d},enabled:r,staleTime:0});return{stakeInfo:a?.data,...i}}import{useQuery as wc}from"@tanstack/react-query";var xc="wp:stake-rewards",vc=31;function ha(e,t,n=!0){let o=wn[e],r=n&&!!t,{data:a,...i}=wc({queryKey:[xc,e,t],queryFn:async({signal:s})=>{let c=await fetch(`${o}/rewards/${t}?limit=${vc}`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Stake rewards fetch failed: ${c.status}`);let l=await c.json();if(l.code!==0&&l.code!==200)throw new Error(`Stake rewards API error: ${l.code}`);return l.data?.data??[]},enabled:r,staleTime:0});return{latestReward:a?.[0]??null,aprAccrued:oa(a),...i}}import{useQuery as yc}from"@tanstack/react-query";var kc="wp:network-stats";function ba(e,t=!0){let n=wn[e],{data:o,...r}=yc({queryKey:[kc,e],queryFn:async({signal:i})=>{let s=await fetch(`${n}/network/stats`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Network stats fetch failed: ${s.status}`);let c=await s.json();if(c.code!==0&&c.code!==200)throw new Error(`Network stats API error: ${c.code}`);return c},enabled:t,staleTime:0});return{networkStats:o?.data,...r}}import{useQuery as Sc}from"@tanstack/react-query";var Cc="wp:staking-onchain";function wa(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...a}=Sc({queryKey:[Cc,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:o,staleTime:0});return{onchain:r,...a}}import{useMemo as xa}from"react";import Rc from"bignumber.js";function va(e){return e?.trim().toUpperCase()==="CROSS"}function ya(e){return new Rc(e||"0").isGreaterThan(0)}function wo(e,t,n=!0){let{allPools:o}=ho(e,n),r=xa(()=>{for(let l of o)for(let d of[l.deposit_token,...l.reward_tokens])if(va(d?.symbol)&&ya(d.price))return d.price},[o]),a=n&&r===void 0,{tokens:i}=Ut(e,t,a),{statsMap:s}=$t(e,a),c=Ne[e].cross;return xa(()=>{if(r)return r;let l=i.find(d=>d.chainId===c&&va(d.symbol));if(l){let d=s.get(ht(l.chainId,l.address));if(d&&ya(d.price))return d.price}return"0"},[r,i,s,c])}import qt from"bignumber.js";import{Fragment as Tc,jsx as Ye,jsxs as bt}from"react/jsx-runtime";var Nc="CROSS Staking";function ka(e){if(!e)return"\u2014";let t=new qt(e);return t.isFinite()?`${t.toFormat(2,qt.ROUND_DOWN)}%`:"\u2014"}function Sa(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=rt(),r=!!t,{stakeInfo:a}=ga(e,t,r),{latestReward:i,aprAccrued:s}=ha(e,t,r),{networkStats:c}=ba(e,r),{onchain:l}=wa(t,o,r),d=wo(e,t,r),u=`${jt[e]}/cross-staking.png`,h=sa[e],m=a?.total_stake??"0",v=br.useMemo(()=>l?new qt(l.earnedWei.toString()).shiftedBy(-18).toString(10):i?.cumulative_earned??a?.rewards_earned??"0",[l,i,a]),x=br.useMemo(()=>l?new qt(l.stakedWei.toString()).shiftedBy(-18):new qt(m),[l,m]),w=s!==void 0?new qt(s):void 0,k=a?.days_since_first_stake,P=w!==void 0&&w.isFinite()&&x.isGreaterThan(0)&&k!==null&&k!==void 0?w.div(x).times(365).div(Math.max(1,k)).times(100):void 0,f=!(new qt(m).isZero()&&new qt(v).isZero()),I=Bn[e],C=bn(m,0,d),B=bn(v,0,d);return Ye(Vt,{title:Nc,icon:u,iconFit:"contain",isEmpty:!1,children:bt("article",{className:"wp-item","data-side":"stake",children:[Ye("div",{className:"wp-item-body",children:f?bt(Tc,{children:[bt("div",{className:"wp-item-line",children:[Ye("span",{className:"wp-item-label",children:"Staked"}),bt("div",{className:"wp-svc-amount",children:[bt("span",{className:"wp-svc-amount-main",children:[gr(m)," CROSS"]}),C&&Ye("span",{className:"wp-item-usd",children:C})]})]}),bt("div",{className:"wp-item-line",children:[Ye("span",{className:"wp-item-label",children:"Rewards Earned"}),bt("div",{className:"wp-svc-amount",children:[bt("span",{className:"wp-svc-amount-main",children:[gr(v)," CROSS"]}),B&&Ye("span",{className:"wp-item-usd",children:B})]})]}),bt("div",{className:"wp-item-line",children:[Ye("span",{className:"wp-item-label",children:"My APR"}),Ye("span",{children:ka(P?.toString(10))})]})]}):bt("div",{className:"wp-item-line",children:[Ye("span",{className:"wp-item-label",children:"Delegation APR"}),Ye("span",{children:ka(c?.apr)})]})}),Ye("div",{className:"wp-item-tags",children:bt("a",{className:"wp-tag wp-tag--mint",href:f?h:I,target:"_blank",rel:"noopener noreferrer",onClick:F=>Qe(F,f?h:I,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a,networkStats:c}},n),children:[Ye("span",{className:"wp-tag-label",children:f?"Manage":"Stake Now"}),Ye(Mt,{size:12,className:"wp-tag-icon"})]})})]})})}import*as wr from"react";import{useQuery as Ic}from"@tanstack/react-query";var Lc="wp:game-swap-pools";function Ca(e,t,n=!0){let o=la[e],r=n&&!!t,{data:a,...i}=Ic({queryKey:[Lc,e,t],queryFn:async({signal:s})=>{let c=await fetch(`${o}/addresses/${t}/portfolio`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Game-swap portfolio fetch failed: ${c.status}`);return(await c.json()).pools??[]},enabled:r,staleTime:0});return{pools:a??[],...i}}import{useQuery as Ec}from"@tanstack/react-query";var Ac="wp:game-swap-lp-balances";function Ra(e,t,n,o){let r=[...n].map(c=>c.toLowerCase()).sort(),a=!!o&&!!t&&r.length>0,{data:i,...s}=Ec({queryKey:[Ac,e,t,r],queryFn:async()=>{if(!o)return{};let c=await o(r),l={};for(let[d,u]of Object.entries(c))l[d.toLowerCase()]=u;return l},enabled:a,staleTime:0});return{balances:i??{},...s}}import Tt from"bignumber.js";import{jsx as it,jsxs as wt}from"react/jsx-runtime";var Pc="Game Swap LP",Ta=18,Bc=new Tt("0.0001");function Na(e){return e?.trim().toUpperCase()==="CROSS"}function Fc(e){return e&&e>0?e:Ta}function Mc(e){let t=Na(e.token_a?.symbol)&&!Na(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=Fc(t?e.token_a?.decimals:e.token_b?.decimals),r=new Tt(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new Tt(0):r.times(2)}function _c(e,t){let n=e.token_a?.symbol?.trim()||"TOKEN",o=e.token_b?.symbol?.trim()||"CROSS",r=t?.decimals??Ta,a,i;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let s=new Tt(t.balance.toString()),c=new Tt(t.totalSupply.toString()),l=s.div(c);a=l.times(100);let d=l.times(Mc(e));if(d.isGreaterThan(0)){let u=new Tt(e.cross_usd||"0");i=u.isGreaterThan(0)?`$${d.times(u).toFormat(2,Tt.ROUND_DOWN)}`:`${d.toFormat(4,Tt.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:n,tokenBSymbol:o,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:r,sharePercent:a,valueText:i}}function Ia(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=rt(),r=!!t,{pools:a}=Ca(e,t,r),i=wr.useMemo(()=>a.map(h=>h.pair_address).filter(Boolean),[a]),{balances:s}=Ra(e,t,i,o),c=`${jt[e]}/dex.png`,l=!!o,d=wr.useMemo(()=>{let h=a.map(m=>_c(m,s[m.pair_address?.toLowerCase()]));return l?h.filter(m=>m.lpAmountRaw?new Tt(m.lpAmountRaw).shiftedBy(-m.lpDecimals).isGreaterThanOrEqualTo(Bc):!1):h},[a,s,l]),u=h=>{let m=h.token_a?.address??h.pair_address;return`${ca[e]}/tokens/${m}?trade=deposit`};return it(Vt,{title:Pc,icon:c,iconFit:"contain",isEmpty:d.length===0,children:d.map(h=>{let{pool:m}=h,v=u(m),x=`${h.tokenASymbol} / ${h.tokenBSymbol}`,w=m.token_a?.logo_url,k=m.token_b?.logo_url;return wt("article",{className:"wp-item","data-side":"game-swap",children:[wt("div",{className:"wp-item-body",children:[wt("div",{className:"wp-item-line",children:[it("span",{className:"wp-item-label",children:"Pool"}),wt("div",{className:"wp-svc-token",children:[wt("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&it("img",{className:"wp-svc-token-icon",src:w,alt:""}),k&&it("img",{className:"wp-svc-token-icon",src:k,alt:""})]}),it("span",{children:x})]})]}),h.lpAmountRaw!==void 0&&wt("div",{className:"wp-item-line",children:[it("span",{className:"wp-item-label",children:"My LP"}),wt("span",{children:[hn(h.lpAmountRaw,h.lpDecimals)," LP"]})]}),h.sharePercent!==void 0&&wt("div",{className:"wp-item-line",children:[it("span",{className:"wp-item-label",children:"Pool Share"}),wt("span",{children:[h.sharePercent.toFormat(2,Tt.ROUND_DOWN),"%"]})]}),h.valueText!==void 0&&wt("div",{className:"wp-item-line",children:[it("span",{className:"wp-item-label",children:"Value"}),it("span",{children:h.valueText})]})]}),it("div",{className:"wp-item-tags",children:wt("a",{className:"wp-tag wp-tag--mint",href:v,target:"_blank",rel:"noopener noreferrer",onClick:P=>Qe(P,v,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:m}},n),children:[it("span",{className:"wp-tag-label",children:"Manage"}),it(Mt,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}import Qt from"bignumber.js";import{useMemo as Uc}from"react";import{useQuery as Oc}from"@tanstack/react-query";var zc="wp:forge-pools";function La(e,t,n=!0){let o=go[e],r=n&&!!t,{data:a,...i}=Oc({queryKey:[zc,e,t],queryFn:async()=>{let c=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!c.ok)throw new Error(`forge pools fetch failed: ${c.status}`);return(await c.json()).data?.items??[]},enabled:r,staleTime:0}),s=a??[];return{pools:s,isEmpty:s.length===0,...i}}import{useQueries as Wc}from"@tanstack/react-query";import{useMemo as Dc}from"react";var Hc="wp:forge-token-detail";async function Gc(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Ea(e,t,n=!0){let o=go[e],r=Wc({queries:t.map(s=>({queryKey:[Hc,e,s],queryFn:()=>Gc(o,s),enabled:n&&!!s,staleTime:3e4}))}),a=Dc(()=>{let s=new Map;for(let c=0;c<r.length;c++){let l=r[c]?.data,d=t[c];l&&d&&s.set(d.toLowerCase(),l)}return s},[r,t]),i=r.some(s=>s.isLoading);return{detailMap:a,isLoading:i}}import{jsx as We,jsxs as Kt}from"react/jsx-runtime";var $c="Forge",Aa=18,jc="https://contents.crosstoken.io/wallet/token/images/FT.png";function Vc(e){if(!e||e==="0")return"0";let t=new Qt(e).shiftedBy(-Aa);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Qt.ROUND_DOWN):t.toFormat(4,Qt.ROUND_DOWN)}function qc(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 Kc(e,t,n){let o=new Qt(n||"0");if(!o.isGreaterThan(0))return null;let r=new Qt(e.total_supply||"0"),a=new Qt(e.lp_balance||"0"),i=new Qt(t?.reserve_b||"0").shiftedBy(-Aa);if(!r.isGreaterThan(0)||!a.isGreaterThan(0)||!i.isGreaterThan(0))return null;let s=i.times(2),l=a.div(r).times(s).times(o);return l.isFinite()?`$${l.toFormat(2,Qt.ROUND_DOWN)}`:null}function Pa(){let{env:e,walletAddress:t,onOutlink:n}=rt(),o=!!t,{pools:r,isEmpty:a}=La(e,t,o),i=Uc(()=>r.map(u=>u.token.address),[r]),{detailMap:s}=Ea(e,i,o&&i.length>0),c=wo(e,t,o),l=u=>`${aa[e]}/forge/token/${u.token.address}`,d=`${jt[e]}/forge.png`;return We(Vt,{title:$c,icon:d,iconFit:"contain",isEmpty:a,children:r.map(u=>{let h=s.get(u.token.address.toLowerCase()),m=h?.image_url||h?.image||u.token.image||jc,v=h?.symbol||u.token.symbol,x=l(u),w=Kc(u,h,c);return Kt("a",{className:"wp-item","data-side":"lp",href:x,target:"_blank",rel:"noopener noreferrer",onClick:k=>Qe(k,x,{category:"portfolio",origin:"portfolio-forge",payload:{pool:u,tokenDetail:h}},n),children:[Kt("div",{className:"wp-item-body",children:[Kt("div",{className:"wp-item-line",children:[We("span",{className:"wp-item-label",children:"Asset"}),Kt("div",{className:"wp-svc-token",children:[We("img",{className:"wp-svc-token-icon",src:m,alt:""}),We("span",{children:v}),h?.name&&We("span",{className:"wp-token-subtle",children:h.name})]})]}),Kt("div",{className:"wp-item-line",children:[We("span",{className:"wp-item-label",children:"LP Balance"}),We("div",{className:"wp-svc-token",children:Kt("div",{className:"wp-svc-amount",children:[We("span",{className:"wp-svc-amount-main",children:Vc(u.lp_balance)}),w&&We("span",{className:"wp-item-usd",children:w})]})})]}),Kt("div",{className:"wp-item-line",children:[We("span",{className:"wp-item-label",children:"Ownership"}),We("span",{className:"wp-line-value",children:qc(u.pool_ownership)})]})]}),We("div",{className:"wp-item-tags",children:Kt("span",{className:"wp-tag wp-tag--muted",children:[We("span",{className:"wp-tag-label",children:"Withdraw"}),We(Mt,{size:12,className:"wp-tag-icon"})]})})]},u.pair_address)})})}z(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--ds-bg-default, #202530);--wp-header-bg: var(--ds-surface-default, #252b39);--wp-card: var(--ds-surface-medium, #252b39);--wp-control: #292f40;--wp-border: var(--ds-border-default, #292f40);--wp-panel-border: var(--ds-border-medium, rgba(255, 255, 255, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .28);--wp-text: var(--ds-content-highest, #ffffff);--wp-text-60: var(--ds-content-high, rgba(255, 255, 255, .85));--wp-text-40: var(--ds-content-medium, rgba(255, 255, 255, .65));--wp-text-30: var(--ds-content-low, rgba(255, 255, 255, .4));--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, rgba(0, 160, 162, .14));--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #9b8cef;--wp-claim-primary-text: #202530;--wp-claim-secondary-bg: var(--wp-control);--wp-claim-success: #00d4aa;--wp-claim-success-soft: rgba(0, 212, 170, .18);--wp-claim-error: #ff3aa3;--wp-claim-error-soft: rgba(255, 58, 163, .16)}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: var(--ds-bg-dim, #f5f7fa);--wp-header-bg: var(--ds-surface-default, #ffffff);--wp-card: var(--ds-surface-default, #ffffff);--wp-control: var(--ds-surface-medium, #f5f7fa);--wp-border: var(--ds-border-default, rgba(0, 0, 0, .07));--wp-panel-border: var(--ds-border-medium, rgba(0, 0, 0, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .15);--wp-text: var(--ds-content-highest, #000000);--wp-text-60: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-text-40: var(--ds-content-medium, rgba(0, 0, 0, .65));--wp-text-30: var(--ds-content-low, rgba(0, 0, 0, .4));--wp-chrome-text: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-card-shadow: none;--wp-tooltip-bg: #192023;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, #e7f9f8);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #7346f3;--wp-claim-primary-text: #ffffff;--wp-claim-secondary-bg: #ffffff;--wp-claim-success: #019d92;--wp-claim-success-soft: rgba(1, 157, 146, .15);--wp-claim-error: #e70077;--wp-claim-error-soft: rgba(231, 0, 119, .12)}.wp-fullscreen{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:73px;padding:24px;position:relative;border-bottom:1px solid var(--wp-border);background:var(--wp-header-bg);color:var(--wp-chrome-text);flex-shrink:0;box-sizing:border-box}.wp-fullscreen .wp-header{height:60px;min-height:60px;padding:11px 20px;border-bottom:none}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wp-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wp-header-edge{display:flex;align-items:center;width:24px;min-width:24px}.wp-header-edge--right{justify-content:flex-end}.wp-header-edge--right .wp-header-btn{position:absolute;top:24px;right:24px}.wp-header-spacer{display:block;width:24px;height:24px}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: hsl(221.3 24.6% 25.5%)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;text-align:center;color:var(--ds-content-highest, #000000);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-account-meta{display:flex;flex-direction:column;justify-content:center;min-width:0;gap:2px}.wp-header-wallet-name{min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:1.4;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-btn{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;padding:0;border:0;background:transparent;cursor:pointer;font:inherit}.wp-header-address{min-width:0;font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-copy{display:inline-flex;align-items:center;flex-shrink:0;color:var(--wp-text-40);transition:color .15s ease}.wp-header-address-btn:hover .wp-header-address-copy{color:var(--wp-text-60)}.wp-header-address-copy[data-copied=true]{color:var(--wp-mint)}.wp-top{flex-shrink:0;padding:0 16px 16px;display:flex;flex-direction:column;gap:16px}.wp-identity{display:flex;flex-direction:column;gap:8px}.wp-address{display:inline-flex;align-items:center;gap:8px}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40)}.wp-total{font-size:28px;font-weight:600;line-height:1.3;color:var(--wp-text);margin:0}.wp-asset{display:flex;flex-direction:column;gap:8px}.wp-asset-head{display:flex;align-items:center;gap:4px}.wp-asset-head-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-asset-head-icon{display:inline-flex;color:var(--wp-text-40)}.wp-bar{display:flex;height:20px;border-radius:4px;overflow:hidden}.wp-bar-seg{display:flex;align-items:center;justify-content:center;min-width:8px}.wp-bar-seg-pct{font-size:10px;font-weight:400;line-height:1.3;color:#fff;white-space:nowrap}.wp-legend{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}.wp-legend-item{display:flex;align-items:center;gap:4px}.wp-legend-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.wp-legend-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-tabs{flex-shrink:0;padding:8px 16px}.wp-tabs-inner{display:flex;align-items:center;padding:0 2px}.wp-tabs-list{display:flex;gap:20px;flex:1}.wp-tab{display:flex;flex-direction:column;align-items:center;justify-content:space-between;height:44px;padding-top:12px;background:transparent;border:none;cursor:pointer}.wp-tab-text{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text-30);white-space:nowrap}.wp-tab[data-active=true] .wp-tab-text{color:var(--wp-mint)}.wp-tab-bar{width:20px;height:4px;border-radius:2px;background:var(--wp-mint);opacity:0}.wp-tab[data-active=true] .wp-tab-bar{opacity:1}.wp-tabs-filter-wrap{position:relative;display:flex;align-items:center;width:44px;height:44px;flex-shrink:0}.wp-tabs-filter-grad{position:absolute;inset:0;background:linear-gradient(to left,var(--wp-bg) 74%,transparent);pointer-events:none}.wp-tabs-filter{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text-40)}.wp-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--wp-border) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:var(--wp-border);border-radius:4px}.wp-body-inner{padding:16px 16px 32px;display:flex;flex-direction:column;gap:32px}.wp-summary-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-summary-head{position:relative;display:flex;align-items:center;justify-content:flex-start;gap:4px}.wp-summary-label{font-size:14px;font-weight:400;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address{display:inline-flex;align-items:center;gap:8px;min-width:0}.wp-address-avatar{width:16px;height:16px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 68% 34%,#ff78d1 0 18%,transparent 19%),radial-gradient(circle at 34% 66%,#00d4aa 0 20%,transparent 21%),linear-gradient(135deg,#7346f3,#0488fc)}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40);flex-shrink:0}.wp-summary-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;background:#019d921a;color:var(--wp-mint);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;white-space:nowrap}.wp-summary-estimate{position:relative;display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.wp-estimate-info{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--wp-text-40);cursor:help}.wp-estimate-tooltip{position:absolute;top:calc(100% + 8px);left:0;right:auto;z-index:3;display:flex;flex-direction:column;gap:8px;width:min(280px,calc(100vw - 48px));padding:12px;border-radius:8px;background:var(--wp-tooltip-bg);box-shadow:0 12px 32px #0000003d;color:var(--wp-tooltip-text);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-estimate-tooltip-title{display:block;font-size:12px;font-weight:600;line-height:1.3}.wp-estimate-tooltip-group{display:flex;flex-direction:column;gap:4px}.wp-estimate-tooltip-item{display:block;color:#ffffffc7}.wp-estimate-tooltip-item:before{content:"- "}.wp-estimate-info:hover .wp-estimate-tooltip,.wp-estimate-info:focus .wp-estimate-tooltip,.wp-estimate-info:focus-visible .wp-estimate-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-total{font-family:var( --wp-total-font-family, Sora, Inter, system-ui, -apple-system, sans-serif );font-size:36px;font-weight:600;line-height:1.25;letter-spacing:0;color:var(--wp-text);margin:0}.wp-svc-card{display:flex;flex-direction:column;gap:12px;width:100%}.wp-svc-card-head{display:flex;align-items:center;gap:6px}.wp-svc-card-icon{width:24px;height:24px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-item{position:relative;display:flex;flex-direction:column;gap:20px;width:100%;padding:12px;border-radius:12px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box;color:inherit;text-decoration:none;cursor:pointer;outline:none;transition:opacity .15s ease}.wp-item+.wp-item{padding-top:12px;border-top:0}.wp-item:hover{opacity:.88}.wp-item-body{display:flex;flex-direction:column;gap:12px;min-width:0}.wp-order-head{display:flex;align-items:center;width:100%}.wp-item-line{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:21px;min-width:0}.wp-item-label{flex-shrink:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-30);white-space:nowrap}.wp-line-value,.wp-order-side{min-width:0;overflow:hidden;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-order-side--buy{color:var(--wp-mint)}.wp-order-side--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;min-height:21px}.wp-svc-token>span{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:16px;height:16px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-token-stack{display:inline-flex;align-items:center;justify-content:flex-end;width:29px;min-width:29px;overflow:visible}.wp-token-stack .wp-svc-token-icon+.wp-svc-token-icon{margin-left:-3.5px}.wp-token-subtle,.wp-item-usd{color:var(--wp-text-30)!important}.wp-svc-amount{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:1px;min-width:0}.wp-svc-amount-main{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.wp-svc-amount .wp-item-usd{font-size:12px;font-weight:500;line-height:1.35}.wp-order-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-order-token .wp-svc-token-icon{width:32px;height:32px}.wp-order-token-meta{display:flex;min-width:0;flex-direction:column;justify-content:center}.wp-order-token-symbol{overflow:hidden;color:var(--wp-text-60);font-size:14px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-order-token-pair{overflow:hidden;color:var(--wp-text-30);font-size:12px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-item-tags{display:flex;align-items:stretch;gap:8px;width:100%}.wp-tag{appearance:none;display:inline-flex;flex:1 1 0;align-items:center;justify-content:center;gap:0;min-width:0;min-height:33px;padding:6px 10px;border-radius:6px;border:0;background:var(--wp-control);font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);text-align:center;text-decoration:none;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}a.wp-tag,button.wp-tag{cursor:pointer}.wp-tag:hover{background:var(--wp-control);transform:none}.wp-tag:focus-visible{outline:2px solid var(--wp-mint);outline-offset:2px}.wp-tag[aria-disabled=true],.wp-tag[data-disabled]{cursor:default;opacity:.48;pointer-events:none}.wp-tag-label{display:inline-flex;align-items:center}.wp-tag-icon{display:none}.wp-tag:hover .wp-tag-icon{transform:none}.wp-tag--mint{color:var(--wp-mint);background:var(--wp-accent-soft)}.wp-tag--mint:hover{background:var(--wp-accent-soft)}.wp-tag--muted{color:var(--wp-text-40)}.wp-svc-empty{display:flex;align-items:center;justify-content:center;min-height:74px;padding:20px 16px;background:var(--wp-card);border-radius:12px;box-shadow:var(--wp-card-shadow, none);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-30);box-sizing:border-box}.wp-claim-overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:flex-end;justify-content:center;background:#00000094;box-sizing:border-box}.wp-claim-sheet{display:flex;flex-direction:column;width:100%;max-width:375px;max-height:calc(100% - 24px);overflow:hidden;border-radius:24px 24px 0 0;background:var(--wp-bg);color:var(--wp-text);box-shadow:0 -18px 48px #00000042;animation:wp-claim-slide-up .22s ease-out}@keyframes wp-claim-slide-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.wp-claim-grabber{display:flex;align-items:flex-start;justify-content:center;height:38px;min-height:38px;padding-top:12px;box-sizing:border-box}.wp-claim-grabber span{display:block;width:52px;height:5px;border-radius:999px;background:var(--wp-control)}.wp-claim-content{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;padding:20px;box-sizing:border-box}.wp-claim-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;flex-shrink:0}.wp-claim-icon--success{background:var(--wp-claim-success-soft);color:var(--wp-claim-success)}.wp-claim-icon--pending{background:#9b8cef29;color:var(--wp-claim-primary)}.wp-claim-icon--error{background:var(--wp-claim-error-soft);color:var(--wp-claim-error);font-size:30px;font-weight:600;line-height:1}.wp-claim-icon--token{background:#00d4aa29}.wp-claim-icon--token img{width:48px;height:48px;border-radius:50%;object-fit:cover}.wp-claim-icon--token span{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;background:var(--wp-mint);color:#101820;font-size:18px;font-weight:600}.wp-claim-spinner{width:36px;height:36px;border-radius:50%;border:3px solid rgba(155,140,239,.28);border-top-color:var(--wp-claim-primary);animation:wp-claim-spin .8s linear infinite}@keyframes wp-claim-spin{to{transform:rotate(360deg)}}.wp-claim-copy{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;text-align:center}.wp-claim-title{margin:0;font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text)}.wp-claim-desc{max-width:335px;margin:0;font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-40)}.wp-claim-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.wp-claim-error-message{margin:0;color:var(--wp-claim-error);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0}.wp-claim-reward-card{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:60px;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-reward-token{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-claim-reward-token img{width:28px;height:28px;object-fit:cover}.wp-claim-reward-token span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-claim-reward-symbol{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wp-text);font-size:18px;font-weight:600;line-height:1.3;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-reward-amount{flex-shrink:0;color:var(--wp-text);font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-account-row{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-height:40px}.wp-claim-account-row>span{flex-shrink:0;color:var(--wp-text-40);font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account{display:flex;align-items:center;gap:8px;min-width:0}.wp-claim-account strong{overflow:hidden;color:var(--wp-text);font-size:15px;font-weight:600;line-height:1.6;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-account-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 30% 28%,#d87aff 0 12%,transparent 13%),radial-gradient(circle at 68% 28%,#f0a1ff 0 12%,transparent 13%),radial-gradient(circle at 32% 70%,#b561e7 0 13%,transparent 14%),radial-gradient(circle at 70% 70%,#d4a2ff 0 13%,transparent 14%),radial-gradient(circle at 50% 50%,#8c4fc4 0 18%,transparent 19%),#4a315f;box-shadow:inset 0 0 0 3.37px var(--wp-control)}.wp-claim-divider{display:block;width:100%;height:1px;background:var(--wp-border)}.wp-claim-detail-list{display:flex;flex-direction:column;gap:8px;width:100%}.wp-claim-detail-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:20px}.wp-claim-detail-row>span{min-width:0;color:var(--wp-text-40);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-detail-row--sub>span:before{content:"";display:inline-block;width:3px;height:3px;margin:0 8px 3px;background:currentColor}.wp-claim-detail-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list{display:flex;flex-direction:column;gap:8px;width:100%;padding-bottom:8px}.wp-claim-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-list-item>span{flex-shrink:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--wp-text-40);white-space:nowrap}.wp-claim-list-item strong{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;overflow:hidden;color:var(--wp-text);font-size:14px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list-item img{width:16px;height:16px;border-radius:50%;flex-shrink:0}.wp-claim-hash{appearance:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);cursor:pointer;font:inherit}.wp-claim-hash svg{flex-shrink:0;color:var(--wp-text-60)}.wp-claim-gas-card{display:flex;flex-direction:column;gap:4px;width:100%;padding:14px 16px;border-radius:8px;border:1px solid var(--wp-border);background:var(--wp-card);box-sizing:border-box}.wp-claim-gas-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:28px}.wp-claim-gas-row>span{min-width:0;font-size:12px;font-weight:400;line-height:1.3;color:var(--wp-text-40)}.wp-claim-gas-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:12px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-gas-row--primary{min-height:32px}.wp-claim-gas-row--primary>span,.wp-claim-gas-row--primary strong{font-size:14px;color:var(--wp-text)}.wp-claim-fee-label{position:relative;display:inline-flex;align-items:center;text-decoration:underline dotted;text-underline-offset:3px;cursor:help;overflow:visible!important}.wp-claim-fee-tooltip{position:absolute;left:0;bottom:calc(100% + 8px);z-index:2;width:min(260px,calc(100vw - 64px));padding:10px 12px;border-radius:8px;background:var(--wp-tooltip-bg);color:var(--wp-tooltip-text);box-shadow:0 12px 32px #0000003d;font-size:11px;font-weight:400;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-claim-fee-label:hover .wp-claim-fee-tooltip,.wp-claim-fee-label:focus .wp-claim-fee-tooltip,.wp-claim-fee-label:focus-visible .wp-claim-fee-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-claim-actions{display:flex;align-items:center;gap:8px;width:100%}.wp-claim-primary,.wp-claim-secondary{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;height:52px;padding:0 24px;border:none;border-radius:40px;font-family:inherit;font-size:15px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap;cursor:pointer}.wp-claim-primary{background:var(--wp-claim-primary);color:var(--wp-claim-primary-text)}.wp-claim-primary:disabled{cursor:default;opacity:.72}.wp-claim-secondary{background:var(--wp-claim-secondary-bg, var(--wp-control));color:var(--wp-claim-primary)}.wp-claim-actions[data-count="2"] .wp-claim-primary{flex:1 1 0}.wp-claim-actions[data-count="2"] .wp-claim-secondary{flex:0 0 120px}.wp-claim-button-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(32,37,48,.28);border-top-color:var(--wp-claim-primary-text);animation:wp-claim-spin .8s linear infinite}.wp-claim-home-indicator{display:flex;align-items:flex-end;justify-content:center;height:34px;min-height:34px;padding-bottom:8px;box-sizing:border-box}.wp-claim-home-indicator span{display:block;width:134px;height:5px;border-radius:16px;background:var(--wp-text-40)}@media(max-width:359px){.wp-header{gap:12px;padding:0 12px}.wp-total{font-size:24px}.wp-body-inner{padding:0 12px 128px;gap:20px}.wp-svc-items,.wp-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.wi-drawer-content .wp-header,.wi-portfolio-body .wp-header{padding:16px}.wi-drawer-content .wp-header-edge--right .wp-header-btn,.wi-portfolio-body .wp-header-edge--right .wp-header-btn{top:16px;right:16px}
|
|
8
8
|
`);import{Fragment as Zc,jsx as ge,jsxs as xn}from"react/jsx-runtime";var xr=5,Yc="wp:";function vn({env:e,theme:t="light",walletAddress:n,walletName:o,onBack:r,showHeader:a=!0,variant:i="embed",className:s,onOutlink:c,lpBalanceReader:l,stakingRewardsReader:d}){let u=Be(e),h=!!n,m=Qc(),[,v]=Ie.useState(xr),[x,w]=Ie.useState(!1),[k,P]=Ie.useState(!1),f=Ie.useRef(void 0),I=Ie.useCallback(()=>{m.invalidateQueries({predicate:_=>typeof _.queryKey[0]=="string"&&_.queryKey[0].startsWith(Yc)})},[m]),C=Ie.useCallback(()=>{I(),w(!0),setTimeout(()=>w(!1),600),v(xr)},[I]);Ie.useEffect(()=>{if(!h)return;let _=setInterval(()=>{v(J=>J<=1?(C(),xr):J-1)},1e3);return()=>clearInterval(_)},[h,C]);let B=Ie.useCallback(()=>{r?.()},[r]),F=h?Ft(u,n,{size:64}):void 0,Z=Ie.useCallback(async()=>{if(!(k||!n))try{await navigator.clipboard.writeText(n),P(!0),clearTimeout(f.current),f.current=setTimeout(()=>P(!1),2e3)}catch{}},[n,k]);Ie.useEffect(()=>()=>clearTimeout(f.current),[]);let O=Ie.useMemo(()=>({env:u,theme:t,open:!0,walletAddress:n,close:B,onOutlink:c,lpBalanceReader:l,stakingRewardsReader:d}),[u,t,n,B,c,l,d]),K=xn(Zc,{children:[a&&xn("div",{className:"wp-header",children:[xn("div",{className:"wp-header-account",children:[r&&ge("button",{type:"button",className:"wp-header-btn","aria-label":"Back",onClick:r,children:ge(ea,{})}),ge("span",{className:"wp-header-avatar","aria-hidden":!0,children:F&&ge("img",{src:F,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(o||n)&&xn("div",{className:"wp-header-account-meta",children:[o&&ge("span",{className:"wp-header-wallet-name",title:o,children:o}),n&&xn("button",{type:"button",className:"wp-header-address-btn",onClick:Z,"aria-label":"Copy wallet address",children:[ge("span",{className:"wp-header-address",children:ra(n)}),ge("span",{className:"wp-header-address-copy","data-copied":k,children:k?ge(en,{size:14}):ge(Tn,{size:14})})]})]})]}),ge("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio",onClick:C,children:ge(ta,{className:x?"wp-spin-once":void 0})})]}),ge("div",{className:"wp-body",children:xn("div",{className:"wp-body-inner",children:[ge(ma,{}),ge(Sa,{}),ge(Ia,{}),ge(Pa,{})]})})]});return ge(Pn.Provider,{value:O,children:i==="none"?K:ge("div",{className:X(i==="fullscreen"?"wp-fullscreen":"wp-embed",s),"data-theme":t,children:K})})}import{jsx as vr,jsxs as Ba}from"react/jsx-runtime";function Fa({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:a,lpBalanceReader:i,stakingRewardsReader:s}=rt();return Ba(xo.Portal,{children:[vr(xo.Overlay,{className:"wp-overlay"}),Ba(xo.Content,{className:X("wp-fullscreen",e),"data-theme":n,children:[vr(xo.Title,{className:"wp-sr-only",children:"Portfolio"}),vr(vn,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:a,lpBalanceReader:i,stakingRewardsReader:s})]})]})}import{jsx as Ma}from"react/jsx-runtime";function Jc({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:a,lpBalanceReader:i,stakingRewardsReader:s,children:c}){let l=Be(e),d=o!==void 0,[u,h]=ln.useState(!1),m=d?o:u,v=ln.useCallback(k=>{d||h(k),r?.(k)},[d,r]),x=ln.useCallback(()=>v(!1),[v]),w=ln.useMemo(()=>({env:l,theme:t,open:m,walletAddress:n,close:x,onOutlink:a,lpBalanceReader:i,stakingRewardsReader:s}),[l,t,m,n,x,a,i,s]);return Ma(Pn.Provider,{value:w,children:Ma(Xc.Root,{direction:"bottom",open:m,onOpenChange:v,noBodyStyles:!0,children:c})})}var _a=Object.assign(Jc,{Trigger:Ji,Content:Fa});import*as R from"react";import{createPortal as yn}from"react-dom";import It from"bignumber.js";import{jsx as at,jsxs as ed}from"react/jsx-runtime";function Oa({size:e=20,className:t}){return ed("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[at("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),at("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function za({size:e=16,className:t}){return at("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:at("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 Wa({size:e=16,className:t}){return at("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:at("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 Da({size:e=20,className:t}){return at("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:at("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ha({size:e=16,className:t}){return at("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:at("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ga({size:e=12,className:t}){return at("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:at("path",{d:"M3.5 2 1.5 4l2 2M1.5 4h9M8.5 10l2-2-2-2M10.5 8h-9",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})})}import*as T from"react";import ja from"bignumber.js";function Ua(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function $a(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,ja.ROUND_DOWN).toFixed()}function td(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 nd(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new ja(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:Ua(t)&&Ua(n)?e.lastChangedBy==="to"?{fromAmount:$a(r.multipliedBy(n).dividedBy(t))}:{toAmount:$a(r.multipliedBy(t).dividedBy(n))}:td(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function Va({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):nd(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}var qa=15,od=18;function rd(e){let t=e.replace(/[^\d.]/g,""),n=t.indexOf(".");n!==-1&&(t=t.slice(0,n+1)+t.slice(n+1).replace(/\./g,""));let o=t.indexOf(".");if(o===-1)return t.slice(0,qa);let r=t.slice(0,o).slice(0,qa),a=t.slice(o+1).slice(0,od);return`${r}.${a}`}function id(e){let t=Number(e??"0");if(!Number.isFinite(t)||t<.1)return"1";let n=o=>Math.floor(o*100)/100;if(t<3){let o=n(t*3);return String(o<1?1:o)}return"10"}function Ka(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("CROSS")?t.slice(1):t}function ad(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let n=new Set([Ka(e.symbol),Ka(t.symbol)]);return n.has("CROSS")&&n.has("CROSSD")}function xt(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function vo(e){return e[0]}function yr(e,t,n,o){if(n&&!xt(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??vo(e);let a=e.findIndex(s=>xt(s,t)),i=a>=0?e[a+1]:void 0;return i&&!xt(i,t)?i:e.find(s=>!xt(s,t))??t}function Qa({fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:a}){return{fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:a}}function kr(e){let t=e instanceof Error?e.message:typeof e=="string"?e:"",n=e&&typeof e=="object"&&"code"in e?String(e.code):"",o=t.toLowerCase();return n==="4001"||o.includes("user rejected")||o.includes("user denied")||o.includes("rejected the request")||o.includes("request rejected")}function Ya(e,t){return kr(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
|
|
9
9
|
`)[0]?.trim()||t}function Za(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:a,approveBridge:i,history:s=[],initialSlippage:c="1",termsUrl:l,getQuote:d,submitBridge:u,onSubmitted:h,onSuccess:m,onFailed:v,onExit:x}=e,w=T.useMemo(()=>Va({getQuote:d,submitBridge:u}),[d,u]),[k,P]=T.useState("form"),[f,I]=T.useState(n??vo(t)),[C,B]=T.useState(()=>yr(t,n??vo(t),o,r)),[F,Z]=T.useState(""),[O,K]=T.useState(""),[_,J]=T.useState("from"),[W,he]=T.useState(c),[ne,ae]=T.useState(null),De=T.useMemo(()=>ad(f,C),[f,C]),se=T.useMemo(()=>De?"1":W==="auto"?id(ne?.priceImpact):W,[De,W,ne?.priceImpact]),[H,le]=T.useState(""),[te,G]=T.useState("idle"),[He,fe]=T.useState(""),[Ee,ue]=T.useState(null),[lt,ye]=T.useState([]),[_t,ze]=T.useState(!1),[vt,At]=T.useState(!1),[ce,be]=T.useState(null),[Ze,ke]=T.useState(!1),[we,de]=T.useState(null),[yt,Ge]=T.useState(null),[ct,Se]=T.useState(!1),[kt,St]=T.useState(!1),Ae=T.useRef(0),dt=T.useRef(null),Xe=T.useCallback(()=>{dt.current&&(clearTimeout(dt.current),dt.current=null)},[]),oe=T.useCallback(L=>{Xe(),Ge(L)},[Xe]);T.useEffect(()=>Xe,[Xe]),T.useEffect(()=>{let L=t.find(ie=>xt(ie,f))??vo(t),Q=L?r?.(L,t):void 0,U=Q?.find(ie=>xt(ie,C))??(Q?void 0:t.find(ie=>xt(ie,C)))??yr(t,L,void 0,r);I(L),B(U)},[r,t,f,C]);let Je=T.useCallback((L,Q)=>{let U=rd(L);Q==="from"?Z(U):K(U),J(Q),le("")},[]),Ce=T.useCallback(()=>{Ae.current+=1,Z(""),K(""),J("from"),ae(null),le(""),fe(""),G("idle"),be(null),ke(!1),de(null),Se(!1),oe(null)},[oe]),et=T.useCallback(L=>{xt(L,f)||(I(L),B(yr(t,L,void 0,r)),Ce())},[f,r,Ce,t]),Ue=T.useCallback(L=>{xt(L,C)||xt(L,f)||(B(L),Ce())},[f,Ce,C]),Pt=T.useMemo(()=>f?r?.(f,t)??t.filter(L=>!xt(L,f)):[],[f,r,t]),Bt=T.useCallback(()=>{f?.balance&&Je(f.balance,"from")},[f?.balance,Je]),pt=T.useCallback(()=>{!f||!C||(I(C),B(f),Ce())},[f,Ce,C]),Ot=T.useCallback(()=>{Ae.current+=1,Z(""),K(""),J("from"),ae(null),le(""),fe("")},[]);T.useEffect(()=>{if(!f||!C)return;if(!F&&!O){ae(null),le(""),G("idle");return}let L=++Ae.current,Q=Qa({fromToken:f,toToken:C,fromAmount:F,toAmount:O,lastChangedBy:_,slippage:W});G(w.canQuote?"quoting":"idle"),(async()=>{try{let U=await w.getQuote(Q);if(Ae.current!==L)return;U.fromAmount!==void 0&&_==="to"&&Z(U.fromAmount),U.toAmount!==void 0&&_==="from"&&K(U.toAmount),ae(U.summary??null),le(U.error??"")}catch(U){if(Ae.current!==L)return;le(U instanceof Error?U.message:"Failed to quote bridge.")}finally{Ae.current===L&&G("idle")}})()},[F,f,_,w,W,O,C]);let ft=T.useCallback(()=>!f||!C?null:Qa({fromToken:f,toToken:C,fromAmount:F,toAmount:O,lastChangedBy:_,slippage:se}),[se,F,f,_,O,C]),xe=T.useCallback(async(L,Q)=>{fe(""),Se(!1),ke(!1),G("submitting");try{if(!Q?.skipApprovalCheck&&a){let ie=await a(L);if(ie){be(ie),de(L),G("idle");return}}be(null),de(null),oe("processing");let U=await w.submitBridge(L);ue(U),G("success"),ye(ie=>[{id:U.txHash,timestamp:new Date().toISOString(),txHash:U.txHash,fromToken:U.fromToken,toToken:U.toToken,fromAmount:U.fromAmount,toAmount:U.toAmount,summary:ne??void 0,status:"pending"},...ie.filter(Gn=>Gn.txHash!==U.txHash)]),Ot(),St(!0),oe(null),Se(!0),h?.(U),m?.(U)}catch(U){if(oe(null),kr(U)){G("idle");return}let ie=Ya(U,"Failed to submit bridge.");fe(ie),G("error"),v?.({message:ie})}},[a,v,h,m,w,Ot,oe,ne]),S=T.useCallback(async()=>{if(H)return;let L=ft();if(L){if(!vt){de(L),ze(!0);return}await xe(L)}},[ft,H,xe,vt]),j=T.useCallback(async()=>{let L=we??ft();L&&(At(!0),ze(!1),await xe(L))},[ft,we,xe]),ee=T.useCallback(()=>{ze(!1),de(null)},[]),$e=T.useCallback(async()=>{if(!(te==="submitting"||!ce||!we||!i)){fe(""),G("submitting");try{await i(we,ce),be(null),G("idle"),ke(!0)}catch(L){if(kr(L)){G("idle");return}let Q=Ya(L,"Failed to approve token.");fe(Q),G("error"),v?.({message:Q})}}},[ce,i,v,we,xe,te]),je=T.useCallback(()=>{te!=="submitting"&&(be(null),ke(!1),de(null),G("idle"))},[te]),zt=T.useCallback(async()=>{te==="submitting"||!we||(ke(!1),await xe(we,{skipApprovalCheck:!0}))},[we,xe,te]),_o=T.useCallback(()=>{Se(!1)},[]),Cn=T.useCallback(L=>{P(L),L==="history"&&St(!1)},[]),tt=T.useCallback(()=>{if(k==="history"){Cn("form");return}x?.()},[x,Cn,k]),Hn=T.useMemo(()=>[...s,...lt.filter(L=>!s.some(Q=>Q.txHash===L.txHash))],[s,lt]);return{step:k,setStep:Cn,status:te,error:He,quoteError:H,fromToken:f,toToken:C,tokens:t,availableToTokens:Pt,fromAmount:F,toAmount:O,lastChangedBy:_,slippage:W,effectiveSlippage:se,slippageLocked:De,setSlippage:he,summary:ne,history:Hn,submitted:Ee,canSubmit:w.canSubmit,termsOpen:_t,approvalInfo:ce,approvalSuccessOpen:Ze,approveBridge:i,pendingSubmitInput:we,submitToast:yt,successDialogOpen:ct,dismissSuccessDialog:_o,hasNewHistory:kt,termsUrl:l,setFromToken:I,setToToken:B,selectFromToken:et,selectToToken:Ue,setAmount:Je,setMax:Bt,swapTokens:pt,submit:S,confirmTerms:j,cancelTerms:ee,confirmApproval:$e,cancelApproval:je,continueAfterApproval:zt,back:tt}}z(`.bf-root{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .07));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));--bf-toast-bg: #1e232e;--bf-toast-color: rgba(255, 255, 255, .85);position:relative;display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden;background:var(--bf-bg);color:var(--ds-content-highest, #ffffff);font-family:inherit}[data-theme=dark].wi-popover-content .bf-root,[data-theme=dark].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].wi-popover-content .bf-root,[data-theme=light].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}.bf-root[data-view=history]{background:var(--ds-bg-dim, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid var(--bf-border);background:var(--ds-bg-default, var(--bf-bg));box-sizing:border-box}.bf-root[data-view=history] .bf-header{padding:24px;border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff)}.bf-header-btn{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.bf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header .bf-header-btn:last-child{position:absolute;top:24px;right:24px}.bf-header-title{position:absolute;left:50%;transform:translate(-50%);font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--bf-text-high);white-space:nowrap}.bf-root[data-view=history] .bf-header-title{color:var(--ds-content-highest, #000000)}.bf-body,.bf-history-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.bf-body{padding:24px}.bf-history-body{display:flex;flex-direction:column;gap:12px;padding:24px;background:var(--ds-bg-dim, #f5f7fa)}.bf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.bf-chip{display:inline-flex;align-items:center;gap:4px;min-height:33px;padding:6px 8px;border:0;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-chip:hover:not(:disabled){color:var(--bf-text-high);background:var(--bf-surface-hover)}.bf-chip:disabled{cursor:default}.bf-chip-history{position:relative}.bf-chip-dot{position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-swap-card{position:relative;display:flex;flex-direction:column;gap:12px;margin-bottom:12px}.bf-field-error{margin-top:-4px;color:var(--ds-system-red-default, #ff2b5f);font-size:13px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-amount-panel{display:flex;min-height:110px;flex-direction:column;gap:8px;padding:16px;border:1px solid transparent;border-radius:12px;background:var(--bf-surface);box-sizing:border-box;transition:border-color .2s ease}.bf-amount-panel:hover{border-color:var(--bf-border)}.bf-amount-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--bf-text-high);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-balance{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;color:var(--bf-text-low);font-size:12px;white-space:nowrap}.bf-amount-main{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-amount-input-wrap{display:flex;min-width:0;flex:1;flex-direction:column;gap:4px}.bf-amount-input{width:100%;min-width:0;padding:0;border:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;outline:none}.bf-amount-input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-amount-usd{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis}.bf-token-pill{display:inline-flex;flex-shrink:0;align-items:center;gap:6px;min-height:33px;padding:6px 8px 6px 6px;border:1px solid var(--bf-border);border-radius:9999px;background:var(--bf-bg);color:var(--bf-text-high);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-token-pill:hover:not(:disabled):not([data-locked=true]){background:var(--bf-surface-hover)}.bf-token-pill:disabled{cursor:default;opacity:.6}.bf-token-pill[data-locked=true]{cursor:default}.bf-token-icon{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font-size:11px;font-weight:700}.bf-token-icon[data-has-image=true]{background:transparent}.bf-token-icon img{width:100%;height:100%;border-radius:0;object-fit:cover}.bf-token-fallback{line-height:1}.bf-token-picker-overlay{--bf-bg: #1e232e;--bf-surface: rgba(255, 255, 255, .05);--bf-surface-hover: rgba(255, 255, 255, .08);--bf-border: rgba(255, 255, 255, .07);--bf-text-high: rgba(255, 255, 255, .85);--bf-text-medium: rgba(255, 255, 255, .65);--bf-text-low: rgba(255, 255, 255, .4);position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-token-picker-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-surface: rgba(18, 18, 18, .05);--bf-surface-hover: rgba(18, 18, 18, .08);--bf-border: rgba(18, 18, 18, .07);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-token-picker{display:flex;width:min(480px,calc(100vw - 48px));height:min(466px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);min-height:0;flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #0006;box-sizing:border-box}.bf-token-picker-handle{display:none}.bf-token-picker-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--bf-border);box-sizing:border-box}.bf-token-picker-head h3{margin:0;color:var(--bf-text-high);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-token-picker-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--bf-text-medium);cursor:pointer}.bf-token-picker-close:hover{color:var(--bf-text-high)}.bf-token-search{display:flex;min-height:48px;flex-shrink:0;align-items:center;gap:8px;margin:16px 24px;padding:12px 16px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, rgba(18, 18, 18, .05));color:var(--bf-text-low);box-sizing:border-box}.bf-token-search:focus-within{border-color:var(--ds-accent-primary-default, #00ceb2)}.bf-token-search input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-search input::placeholder{color:var(--bf-text-low)}.bf-token-list{display:flex;min-height:0;flex:1;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;padding:0 24px 24px;scrollbar-width:thin;box-sizing:border-box}.bf-token-row{position:relative;display:flex;width:100%;min-height:69px;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid transparent;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.bf-token-row:hover:not([data-selected=true]){background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row-left{display:inline-flex;min-width:0;align-items:center;gap:16px}.bf-token-meta{display:flex;min-width:0;flex-direction:column}.bf-token-symbol{overflow:hidden;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-name{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-row-right{display:flex;min-width:86px;max-width:42%;flex-shrink:0;flex-direction:column;align-items:flex-end}.bf-token-balance,.bf-token-price{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-token-balance{color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-token-price{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-row[data-selected=true] .bf-token-symbol{color:var(--bf-text-high)}.bf-token-row[data-selected=true] .bf-token-balance{color:var(--bf-text-high);font-size:16px}.bf-token-row[data-selected=true] .bf-token-price{color:var(--bf-text-low);font-size:14px}.bf-token-empty{padding:32px 16px;color:var(--bf-text-low);font-size:14px;font-weight:500;line-height:1.5;text-align:center}.bf-slippage-overlay{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-slippage-dialog{display:flex;width:min(480px,calc(100vw - 48px));height:auto;min-height:min(316px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);flex-direction:column;overflow:hidden;border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:24px;background:var(--ds-surface-default, #ffffff);color:var(--ds-content-highest, #000000);box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));box-sizing:border-box}.bf-slippage-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-slippage-head h3{margin:0;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-slippage-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-slippage-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-slippage-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:24px;padding:24px;box-sizing:border-box}.bf-slippage-desc{margin:0;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-controls{display:flex;flex-direction:column;gap:12px;width:100%}.bf-slippage-presets{display:flex;gap:8px;width:100%}.bf-slippage-preset{appearance:none;display:inline-flex;flex:1 1 0;min-width:0;min-height:48px;align-items:center;justify-content:center;padding:12px 8px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-preset:hover,.bf-slippage-preset[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-accent-primary-low, #e7f9f8)}.bf-slippage-custom{display:flex;min-height:48px;align-items:center;gap:8px;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));box-sizing:border-box}.bf-slippage-custom:focus-within,.bf-slippage-custom[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7)}.bf-slippage-custom input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--ds-content-high, rgba(0, 0, 0, .85));font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-custom input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-slippage-custom span:not(.bf-sr-only){flex-shrink:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-apply{appearance:none;margin-top:auto;width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on-primary, #ffffff);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-apply:hover{filter:brightness(.96)}.bf-slippage-apply:disabled{cursor:not-allowed;opacity:.5;filter:none}.bf-slippage-message{margin:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-message[data-variant=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-slippage-message[data-variant=error]{color:var(--ds-system-red-default, #da0b2e)}.bf-action-modal-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#040912b8;pointer-events:auto;box-sizing:border-box}.bf-action-modal-overlay[data-theme=light]{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .08));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .65));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .4))}.bf-action-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;align-items:center;gap:24px;padding:48px 24px 24px;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:#fff;box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-action-modal h3{width:100%;margin:0;color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;text-align:center;letter-spacing:0}.bf-action-modal-desc{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-terms-check-row{display:grid;width:100%;min-height:56px;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px 16px;border:none;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font-size:16px;font-weight:700;line-height:1.4;box-sizing:border-box;cursor:pointer;touch-action:manipulation;user-select:none}.bf-terms-check-button{appearance:none;display:grid;min-width:0;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-check-button:focus-visible .bf-terms-checkbox{outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-terms-checkbox{position:relative;display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;border:1px solid rgba(124,143,180,.72);border-radius:5px;background:transparent;box-sizing:border-box}.bf-terms-checkbox[data-checked=true]{border-color:var(--ds-accent-primary-default, #00ceb2);background:var(--ds-accent-primary-default, #00ceb2)}.bf-terms-checkbox[data-checked=true]:after{width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg) translate(1px,-1px)}.bf-terms-check-row a{position:relative;z-index:1;color:var(--ds-accent-primary-default, #00ceb2);font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}.bf-terms-privacy{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-action-primary,.bf-action-secondary{display:inline-flex;width:100%;min-height:56px;align-items:center;justify-content:center;padding:14px 16px;border:0;border-radius:12px;font:inherit;font-size:18px;font-weight:700;line-height:1.4;letter-spacing:0;cursor:pointer}.bf-action-primary{background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000)}.bf-action-primary:disabled{cursor:not-allowed;opacity:.35}.bf-action-primary[aria-busy=true]{gap:8px;opacity:1}.bf-action-button-spinner{width:18px;height:18px;border:2px solid rgba(0,0,0,.22);border-top-color:currentColor;border-right-color:currentColor;border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-action-secondary{background:var(--bf-surface);color:var(--bf-text-low)}.bf-action-secondary:disabled{cursor:not-allowed;opacity:.5}.bf-approve-address-box{display:flex;width:100%;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-approve-address-box>span{color:var(--bf-text-low);font-size:14px;font-weight:700;line-height:1.4}.bf-approve-address-box>div{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-approve-address-box strong{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:15px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.bf-copy-button{flex-shrink:0;min-width:48px;min-height:32px;padding:6px 10px;border:1px solid rgba(0,206,178,.65);border-radius:8px;background:transparent;color:var(--ds-accent-primary-default, #00ceb2);font:inherit;font-size:12px;font-weight:700;line-height:1.2;cursor:pointer}.bf-copy-button:disabled{cursor:not-allowed;opacity:.45}.bf-action-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:12px}.bf-approval-success-modal{gap:28px}.bf-success-mark{position:relative;display:inline-flex;width:96px;height:96px;flex-shrink:0;align-items:center;justify-content:center;border:12px solid rgba(0,206,178,.12);border-radius:999px;background:#00ceb2a8;box-shadow:0 0 0 10px #00ceb20f;box-sizing:border-box}.bf-success-mark:after{width:34px;height:18px;border:solid #ffffff;border-width:0 0 6px 6px;content:"";transform:rotate(-45deg) translate(2px,-3px)}.bf-status-toast{position:absolute;right:16px;bottom:14px;left:16px;z-index:5;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--bf-toast-bg, #1e232e);color:var(--bf-toast-color, rgba(255, 255, 255, .85));box-shadow:0 8px 24px #0000003d;box-sizing:border-box}.bf-status-toast-icon{display:inline-flex;width:28px;height:28px;flex-shrink:0;align-items:center;justify-content:center;border-radius:999px}.bf-status-spinner{width:20px;height:20px;border:3px solid rgba(255,255,255,.18);border-top-color:var(--ds-accent-primary-default, #00ceb2);border-right-color:var(--ds-accent-primary-default, #00ceb2);border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-status-check{position:relative;width:20px;height:20px;border-radius:999px;background:var(--ds-accent-primary-default, #00ceb2)}.bf-status-check:after{position:absolute;top:6px;left:5px;width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg)}.bf-status-toast-copy{display:flex;min-width:0;flex:1;flex-direction:column}.bf-status-toast-copy strong,.bf-status-toast-copy span{overflow:hidden;text-overflow:ellipsis}.bf-status-toast-copy strong{color:#fff;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-status-toast-copy span{color:var(--bf-toast-color, rgba(255, 255, 255, .85));font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em}.bf-status-toast[data-variant=success] .bf-status-toast-copy span{color:var(--ds-accent-primary-on-inverted, #00e8c9)}.bf-status-toast[data-variant=error]{border:1px solid rgba(255,43,95,.28);background:var(--bf-toast-bg, #1e232e)}.bf-status-toast[data-variant=error] .bf-status-toast-copy strong{color:#fff}.bf-status-error-mark{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:999px;background:var(--ds-system-red-default, #ff2b5f);color:#fff;font-size:14px;font-weight:700;line-height:1}.bf-status-toast[data-variant=error] .bf-status-toast-copy span{color:#ffffffe0}.bf-success-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#000000b8;pointer-events:auto;box-sizing:border-box}.bf-success-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-border: rgba(18, 18, 18, .08);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-success-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-success-head{display:flex;min-height:73px;align-items:center;justify-content:space-between;gap:16px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));box-sizing:border-box}.bf-success-head h3{min-width:0;margin:0;overflow:hidden;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.bf-success-close{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-success-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-success-body{display:flex;flex-direction:column;align-items:center;gap:24px;padding:40px 24px 24px;box-sizing:border-box}.bf-success-copy{display:flex;width:100%;flex-direction:column;align-items:center;gap:4px;color:var(--bf-text-medium);text-align:center}.bf-success-copy strong{color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;letter-spacing:0}.bf-success-copy span{color:var(--bf-text-medium);font-size:15px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-success-route{display:flex;align-items:center;justify-content:center;gap:12px}.bf-success-route .bf-token-icon{width:48px!important;height:48px!important;background:transparent;font-size:18px}.bf-success-route-arrow{color:var(--bf-text-low);font-size:24px;font-weight:500;line-height:1}.bf-success-ok{display:inline-flex;width:100%;min-height:48px;align-items:center;justify-content:center;padding:12px;border:0;border-radius:12px;background:#00b4b7e0;color:#fff;font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}@media(max-width:767px){.bf-success-body{padding:40px 24px 24px}.bf-success-copy strong{font-size:22px}.bf-success-copy span{font-size:14px}.bf-success-mark{width:88px;height:88px}.bf-success-route .bf-token-icon{width:44px!important;height:44px!important}}@keyframes bf-loading-spin{to{transform:rotate(360deg)}}.bf-swap-toggle{position:absolute;top:100px;left:50%;z-index:1;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);box-shadow:0 1px 5px #0000001f;cursor:pointer}.bf-swap-card[data-has-from-error=true] .bf-swap-toggle{top:132px}.bf-details{display:flex;flex-direction:column;gap:24px}.bf-exchange-rate{display:flex;width:100%;align-items:center;justify-content:center;gap:4px;padding:0 0 24px;border:0;background:transparent;color:var(--bf-text-low);font:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-exchange-rate:hover{color:var(--bf-text-medium)}.bf-detail-section,.bf-history-card{display:flex;flex-direction:column;gap:12px;padding:0;border-radius:12px;background:transparent;box-sizing:border-box}.bf-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-root[data-view=history] .bf-liquidity,.bf-root[data-view=history] .bf-detail-section,.bf-root[data-view=history] .bf-history-card{background:var(--ds-surface-default, #ffffff)}.bf-detail-section h3{margin:0;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-tx-fee-section{gap:12px}.bf-tx-fee-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-collapse-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin:0;padding:0;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.bf-detail-section[data-open=true] .bf-collapse-head{padding-bottom:12px;border-bottom:1px solid var(--bf-border)}.bf-collapse-chevron{flex-shrink:0;color:var(--bf-text-low);transition:transform .2s ease}.bf-detail-section[data-open=true] .bf-collapse-chevron{transform:rotate(180deg)}.bf-collapse-body{display:flex;flex-direction:column;gap:14px}.bf-root[data-view=history] .bf-detail-section[data-open=true] .bf-collapse-head{border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07))}.bf-root[data-view=history] .bf-collapse-chevron{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-tx-fee-total{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--bf-text-medium);font-size:14px;font-weight:600;line-height:1.4;text-align:right}.bf-tx-fee-total>span[data-delegated=true]{text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:currentColor}.bf-fee-delegated{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:2px 8px;border-radius:6px;background:#379cff2e;color:#4eb3ff;font-size:10px;font-weight:500;line-height:1.3;white-space:nowrap}.bf-tx-fee-token{width:16px;height:16px;flex-shrink:0;border-radius:999px;object-fit:cover}.bf-info-card{gap:14px}.bf-info-section{display:flex;flex-direction:column;gap:10px}.bf-info-section+.bf-info-section{padding-top:2px}.bf-info-section h4{margin:0;color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5}.bf-root[data-view=history] .bf-detail-section h3,.bf-root[data-view=history] .bf-info-section h4{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-info-rows{display:flex;flex-direction:column;gap:8px}.bf-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-liquidity-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-info-label{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--bf-text-low)}.bf-tree-marker{width:10px;flex-shrink:0;color:var(--bf-text-low)}.bf-info-value{min-width:0;color:var(--bf-text-medium);text-align:right}.bf-info-route,.bf-info-value-token{display:inline-flex;align-items:center;gap:4px}.bf-info-route .bf-token-icon,.bf-info-value-token .bf-token-icon{flex-shrink:0}.bf-info-route-arrow{color:var(--bf-text-medium)}.bf-root[data-view=history] .bf-info-route-arrow{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-root[data-view=history] .bf-info-label,.bf-root[data-view=history] .bf-liquidity-head,.bf-root[data-view=history] .bf-tree-marker{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-root[data-view=history] .bf-info-value{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-root[data-view=history] .bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-root[data-view=history] .bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-liquidity-status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.4;white-space:nowrap}.bf-liquidity-status:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}.bf-liquidity-status[data-status=normal],.bf-liquidity-status:not([data-status]){background:#00ceb21f;color:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=normal]:before,.bf-liquidity-status:not([data-status]):before{background:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=low]{background:#e56f001f;color:#e56f00}.bf-liquidity-status[data-status=low]:before{background:#e56f00}.bf-liquidity-status[data-status=rebalancing]{background:#da0b2e1a;color:#da0b2e}.bf-liquidity-status[data-status=rebalancing]:before{background:#da0b2e}.bf-liquidity-track{height:8px;overflow:hidden;border-radius:999px;background:var(--bf-surface-hover)}.bf-liquidity-track span{display:block;height:100%;border-radius:inherit;background:var(--ds-accent-primary-default, #00ceb2)}.bf-error{padding:12px;border-radius:12px;background:#da0b2e1f;color:var(--ds-system-red-default, #da0b2e);font-size:13px;line-height:1.4}.bf-footer{display:flex;flex-shrink:0;flex-direction:column;align-items:center;gap:10px;padding:12px 24px 24px;background:var(--ds-bg-default, var(--bf-bg))}.bf-next{width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-next:disabled{cursor:default;opacity:.6}.bf-powered{display:inline-flex;align-items:center;gap:3px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-decoration:none}.bf-powered:focus-visible{border-radius:4px;outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-powered-brand{text-decoration:underline;text-underline-offset:2px}.bf-history-tabs{display:flex;align-items:center;gap:4px;width:100%}.bf-history-tab{position:relative;display:inline-flex;min-height:37px;align-items:center;justify-content:center;padding:8px 12px;border:0;background:transparent;color:var(--ds-content-lowest, rgba(0, 0, 0, .25));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;cursor:pointer}.bf-history-tab[data-active=true]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-history-tab[data-active=true]:after{position:absolute;right:8px;bottom:0;left:8px;height:3px;border-radius:999px;background:var(--ds-accent-primary-high, #00a0a2);content:""}.bf-history-tab-dot{position:absolute;top:8px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-history-list{display:flex;flex-direction:column;gap:12px}.bf-history-item{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-history-item-head,.bf-history-meta,.bf-history-route,.bf-history-route-token{display:inline-flex;align-items:center}.bf-history-item-head{justify-content:space-between;gap:12px;width:100%}.bf-history-status{display:inline-flex;min-height:24px;align-items:center;justify-content:center;padding:3px 8px;border-radius:4px;background:var(--ds-system-orange-low, #fcf5e9);color:var(--ds-system-orange-high, #e56f00);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;white-space:nowrap}.bf-history-status[data-status=completed]{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.bf-history-status[data-status=failed]{background:var(--ds-system-red-low, rgba(218, 11, 46, .12));color:var(--ds-system-red-default, #da0b2e)}.bf-history-time{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-align:right;white-space:nowrap}.bf-history-item-body{display:flex;flex-direction:column;gap:4px}.bf-history-amount{color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-meta{justify-content:space-between;gap:12px;min-width:0}.bf-history-usd{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route{justify-content:flex-end;gap:4px;min-width:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-route-token{gap:4px;min-width:0}.bf-history-route-token span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route-arrow{flex-shrink:0;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-empty{padding:32px 16px;text-align:center;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:14px}.bf-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:767px){.bf-token-picker-overlay{align-items:flex-end;padding:0}.bf-token-picker{width:100%;max-height:82dvh;min-height:min(520px,82dvh);border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}.bf-token-picker-handle{display:block;width:40px;height:4px;flex-shrink:0;align-self:center;margin:10px 0 0;border-radius:999px;background:#ffffff38}.bf-token-picker-head{min-height:55px;padding:12px 56px 16px 24px;border-bottom:0}.bf-token-picker-close{top:13px}.bf-token-search{margin:0 16px 12px}.bf-token-list{padding:0 16px 16px}.bf-slippage-overlay{align-items:flex-end;padding:0}.bf-slippage-dialog{width:100%;height:auto;min-height:316px;max-height:82dvh;border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}}.wi-drawer-content .bf-header{padding:16px}.wi-drawer-content .bf-header .bf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .bf-body,.wi-drawer-content .bf-history-body{padding:16px}
|
|
10
10
|
`);import{Fragment as Cr,jsx as p,jsxs as y}from"react/jsx-runtime";var os=R.createContext(void 0);function kn(){return R.useContext(os)}function sd(e){let[t,n]=R.useState(void 0);return R.useEffect(()=>{let o=e.current;if(!o)return;let r=()=>{let i=o.closest("[data-theme]");n(i?.getAttribute("data-theme")??void 0)};r();let a=new MutationObserver(r);return a.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>a.disconnect()},[e]),t}var Xa=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],ld={dev:"https://dev.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://crossdefi.io"},cd=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function dd(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function Ja(e){let t=e.replace(/[^\d.]/g,""),[n="",...o]=t.split("."),r=o.join("");return o.length===0?n:`${n}.${r.slice(0,2)}`}function pd(e){return`${e.chainId}:${e.address.toLowerCase()}`}function rs(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function es(e,t){let n=Number(e||"0"),o=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(n)?n*o:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function fd(e,t=6){if(!e)return e;let[n,o=""]=e.split(".");if(!o)return n;let r=o.slice(0,t).replace(/0+$/,"");return r?`${n}.${r}`:n}function ud(e,t){if(!t)return!1;let n=new It(e||"0"),o=new It(t.balance||"0");return!n.isFinite()||!o.isFinite()?!1:n.isGreaterThan(o)}function md(e){if(e.priceUsd===void 0)return null;let t=new It(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function gd(e){if(e.priceUsd===void 0)return null;let t=new It(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function is(e){if(!e.isFinite()||e.isNaN())return"0";let n=e.decimalPlaces(6,It.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),a=new It(o||"0").toFormat(0);return r?`${a}.${r}`:a}function hd(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function bd(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=o=>o.toString().padStart(2,"0");return[`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`,`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`].join(" ")}function wd(e){let t=new It(e||"0");return!t.isFinite()||t.isNaN()?e||"0":is(t)}function xd(e,t){if(t?.priceUsd===void 0)return null;let n=new It(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function ko(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function vd(e,t){return t==="all"?!0:ko(e)===t}function yd(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function ts(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function as(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function ss(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":as(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function ls(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function yo(e){return!e||e==="0"||Number(e)===0}function kd(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 Sd(e){let t=e.fromToken,n=e.toToken,o=ss(t,n),r=e.fromAmount||"0",a=e.toAmount||"0",i=o!==void 0&&!ls(o),s=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:i?[{label:"Route",value:t&&n?`${ts(t.chainId)} \u2192 ${ts(n.chainId)}`:"-"},{label:"Validator Fee",value:yo(r)?"0":"Free",tone:yo(r)?"default":"accent"},{label:"Network Fee",value:yo(r)?"0":"Free",tone:yo(r)?"default":"accent"}]:void 0,swapInfo:s?[t&&n?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:n.symbol,iconUrl:n.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:r,valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Swap Fee",value:"0",valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Out Amount",value:a,valueToken:n?{symbol:n.symbol,iconUrl:n.iconUrl}:void 0}]:void 0,txFee:[{label:"Priority Fee Per Gas",value:"0 Gwei"},{label:"Max Fee Per Gas",value:"0 Gwei"},{label:"Gas Limit",value:"0"}],txFeeInfo:{estTxFee:"0",isDelegateFee:!1}}}function Fn({token:e,size:t=20}){let n=e?.iconUrl;return p("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?p("img",{src:n,alt:"",width:t,height:t,draggable:!1}):p("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function ns({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:a,locked:i=!1}){return y("section",{className:"bf-amount-panel",children:[y("div",{className:"bf-amount-head",children:[p("span",{children:e}),y("span",{className:"bf-balance",children:[rs(t?.balance??"0")," ",t?.symbol??""]})]}),y("div",{className:"bf-amount-main",children:[y("label",{className:"bf-amount-input-wrap",children:[y("span",{className:"bf-sr-only",children:[e," amount"]}),p("input",{type:"text",inputMode:"decimal",value:n,onChange:s=>r(s.target.value),placeholder:"0",className:"bf-amount-input"}),p("span",{className:"bf-amount-usd",children:o})]}),y("button",{type:"button",className:"bf-token-pill",onClick:i?void 0:a,disabled:!i&&!a,"data-locked":i?"true":void 0,"aria-label":`Select ${e.toLowerCase()} token`,children:[p(Fn,{token:t}),p("span",{children:t?.symbol??"Select"}),!i&&p(nn,{size:16})]})]})]})}function Cd({flow:e,side:t,onClose:n}){let o=R.useId(),[r,a]=R.useState(""),[i,s]=R.useState(null),c=t==="from"?e.fromToken:e.toToken;R.useEffect(()=>{s(document.body)},[]),R.useEffect(()=>{let m=v=>{v.key==="Escape"&&n()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[n]);let l=R.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),d=R.useMemo(()=>{let m=r.trim().toLowerCase();return m?l.filter(v=>v.symbol.toLowerCase().includes(m)||v.name.toLowerCase().includes(m)):l},[r,l]),u=R.useCallback(m=>{t==="from"?e.selectFromToken(m):e.selectToToken(m),n()},[e,n,t]);if(!i)return null;let h=kn();return yn(p("div",{className:"bf-token-picker-overlay","data-theme":h,role:"presentation",onMouseDown:m=>{m.target===m.currentTarget&&n()},children:y("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[p("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),y("header",{className:"bf-token-picker-head",children:[p("h3",{id:o,children:"Select a token"}),p("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:p(Ct,{size:24})})]}),y("label",{className:"bf-token-search",children:[p(Oa,{size:20}),p("span",{className:"bf-sr-only",children:"Search tokens"}),p("input",{value:r,onChange:m=>a(m.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),y("div",{className:"bf-token-list",children:[d.map(m=>{let v=as(m,c),x=v?gd(m):md(m);return y("button",{type:"button",className:"bf-token-row","data-selected":v?"true":"false",onClick:()=>u(m),children:[y("span",{className:"bf-token-row-left",children:[p(Fn,{token:m,size:40}),y("span",{className:"bf-token-meta",children:[p("span",{className:"bf-token-symbol",children:m.symbol}),!v&&p("span",{className:"bf-token-name",children:m.name})]})]}),y("span",{className:"bf-token-row-right",children:[y("span",{className:"bf-token-balance",children:[rs(m.balance),v?null:` ${m.symbol}`]}),x&&p("span",{className:"bf-token-price",children:x})]})]},pd(m))}),d.length===0&&p("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),i)}function Rd({flow:e,onClose:t}){let n=R.useId(),[o,r]=R.useState(null),a=Xa.find(x=>x.value===e.slippage),[i,s]=R.useState(e.slippage&&!a?e.slippage:""),c=i.trim()!==""&&i.trim()!==".",l=c?Number(i):NaN,d=Number.isFinite(l)&&l>50,u=Number.isFinite(l)&&l>5&&!d,h=x=>{e.setSlippage(x),t()},m=()=>{!c||d||(e.setSlippage(Ja(i)),t())};if(R.useEffect(()=>{r(document.body)},[]),R.useEffect(()=>{let x=w=>{w.key==="Escape"&&t()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[t]),!o)return null;let v=kn();return yn(p("div",{className:"bf-slippage-overlay","data-theme":v,role:"presentation",onMouseDown:x=>{x.target===x.currentTarget&&t()},children:y("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[y("header",{className:"bf-slippage-head",children:[p("h3",{id:n,children:"Slippage Settings"}),p("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:p(Ct,{size:24})})]}),y("div",{className:"bf-slippage-body",children:[p("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."}),y("div",{className:"bf-slippage-controls",children:[p("div",{className:"bf-slippage-presets",children:Xa.map(x=>p("button",{type:"button",className:"bf-slippage-preset","data-selected":!c&&e.slippage===x.value?"true":"false",onClick:()=>h(x.value),children:x.label},x.value))}),y("label",{className:"bf-slippage-custom","data-selected":c?"true":"false",children:[p("span",{className:"bf-sr-only",children:"Custom slippage percent"}),p("input",{value:i,onChange:x=>{s(Ja(x.target.value))},onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),m())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),p("span",{"aria-hidden":"true",children:"%"})]})]}),d?p("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):u?p("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,c&&p("button",{type:"button",className:"bf-slippage-apply",onClick:m,disabled:d,children:"Apply"})]})]})}),o)}function Nd({flow:e}){let t=R.useId(),[n,o]=R.useState(!1),[r,a]=R.useState(null),i=kn();return R.useEffect(()=>{a(document.body)},[]),R.useEffect(()=>{let s=c=>{c.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),!r||!e.termsOpen?null:yn(p("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",onPointerDown:s=>{s.target===s.currentTarget&&e.cancelTerms()},children:y("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[p("h3",{id:t,children:"Agree to Terms of Service"}),p("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),y("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[y("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,onClick:()=>o(s=>!s),children:[p("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"}),p("span",{children:"Agree to Terms of Use"})]}),e.termsUrl&&p("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]}),p("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),p("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,children:"Confirm"})]})}),r)}function Td({value:e,disabled:t=!1}){let[n,o]=R.useState(!1);return p("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{o(!0),window.setTimeout(()=>o(!1),1200)})},children:n?"OK":"Copy"})}function Id({flow:e,approval:t}){let n=R.useId(),[o,r]=R.useState(null),a=kn();if(R.useEffect(()=>{r(document.body)},[]),R.useEffect(()=>{let c=l=>{e.status!=="submitting"&&l.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e]),!o)return null;let i=e.status==="submitting"||!e.approveBridge,s=e.status==="submitting";return yn(p("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",children:y("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[y("h3",{id:n,children:["Approve ",t.token.symbol]}),p(Fn,{token:t.token,size:72}),y("div",{className:"bf-approve-address-box",children:[p("span",{children:"Token Address"}),y("div",{children:[p("strong",{children:t.tokenAddress}),p(Td,{value:t.tokenAddress,disabled:s})]})]}),y("div",{className:"bf-action-buttons",children:[p("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),y("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:i,"aria-busy":s,children:[s&&p("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),p("span",{children:s?"Approving...":"Approve"})]})]})]})}),o)}function Ld({flow:e}){let t=R.useId(),[n,o]=R.useState(null),r=kn();return R.useEffect(()=>{o(document.body)},[]),R.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=i=>{i.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.approvalSuccessOpen?null:yn(p("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:y("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[p("h3",{id:t,children:"Approval Success"}),p("span",{className:"bf-success-mark","aria-hidden":"true"}),y("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",p("br",{}),"Please continue to the next step."]}),y("div",{className:"bf-action-buttons",children:[p("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,children:"Cancel"}),p("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,children:"Continue"})]})]})}),n)}function Ed({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,a]=R.useState(!1),i=R.useMemo(()=>{let l=new It(e||"0"),d=new It(t||"0");return!l.isFinite()||!d.isFinite()||l.lte(0)||d.lte(0)?null:r?l.dividedBy(d):d.dividedBy(l)},[e,r,t]);if(!i||!n||!o||n.symbol===o.symbol)return null;let s=r?o.symbol:n.symbol,c=r?n.symbol:o.symbol;return y("button",{type:"button",className:"bf-exchange-rate",onClick:()=>a(l=>!l),children:[y("span",{children:["1 ",s]}),p(Ga,{size:12}),y("span",{children:[is(i)," ",c]})]})}function Ad({flow:e}){return e.submitToast?y("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[p("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:p("span",{className:"bf-status-spinner"})}),y("span",{className:"bf-status-toast-copy",children:[p("strong",{children:"Transaction Processing"}),p("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function Pd({message:e}){let[t,n]=R.useState(!1);return R.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:y("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[p("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:p("span",{className:"bf-status-error-mark",children:"!"})}),y("span",{className:"bf-status-toast-copy",children:[p("strong",{children:"Error"}),p("span",{children:e})]})]})}function Bd(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 Fd({flow:e}){let t=R.useId(),[n,o]=R.useState(null),r=e.submitted,a=kn();return R.useEffect(()=>{o(document.body)},[]),R.useEffect(()=>{if(!e.successDialogOpen)return;let i=s=>{s.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e]),!n||!e.successDialogOpen||!r?null:yn(p("div",{className:"bf-success-overlay","data-theme":a,role:"presentation",children:p("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:y("div",{className:"bf-success-body",children:[p("span",{className:"bf-success-mark","aria-hidden":"true"}),y("div",{className:"bf-success-copy",children:[p("strong",{id:t,children:Bd(r.pathType)}),p("span",{children:"Please check the results in the history."})]}),p("div",{className:"bf-success-route","aria-hidden":"true",children:(r.routeTokens&&r.routeTokens.length>0?r.routeTokens:[{symbol:r.fromToken.symbol,iconUrl:r.fromToken.iconUrl},{symbol:r.toToken.symbol,iconUrl:r.toToken.iconUrl}]).map((i,s)=>y(R.Fragment,{children:[s>0&&p("span",{className:"bf-success-route-arrow",children:"\u2192"}),p(Sr,{token:i,size:43})]},`${i.symbol}-${s}`))}),p("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,children:"OK"})]})})}),n)}function Sr({token:e,size:t=16}){let n=!!e.iconUrl;return p("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?p("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):p("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function Md({row:e}){return e.routeTokens&&e.routeTokens.length>0?p("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>y(R.Fragment,{children:[n>0&&p("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),p(Sr,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?y("span",{className:"bf-info-value-token",children:[p(Sr,{token:e.valueToken}),p("span",{children:e.value})]}):p(Cr,{children:e.value})}function cs({rows:e}){return!e||e.length===0?null:p("div",{className:"bf-info-rows",children:e.map((t,n)=>y("div",{className:"bf-info-row",children:[y("span",{className:"bf-info-label",children:[p("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),p("span",{children:t.label})]}),p("span",{className:"bf-info-value","data-tone":t.tone??"default",children:p(Md,{row:t})})]},`${t.label}-${t.value}`))})}function _d(e,t,n){return e.pathType==="bridge"?"Bridge Info":ls(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function Od({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=t&&n,r=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return p(Cr,{children:r.map(a=>{let i=a==="swap"?e.swapInfo:e.bridgeInfo;return i?.length?y("div",{className:"bf-info-section",children:[o&&p("h4",{children:a==="swap"?"Swap Info":"Bridge Info"}),p(cs,{rows:i})]},a):null})})}function zd({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=_d(e,t,n),[a,i]=R.useState(!0),[s,c]=R.useState(!0);return y("div",{className:"bf-details",children:[e.liquidity&&y("section",{className:"bf-liquidity",children:[y("div",{className:"bf-liquidity-head",children:[p("span",{children:e.liquidity.label??"Available Liquidity"}),p("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),p("div",{className:"bf-liquidity-track",children:p("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||n)&&y("section",{className:"bf-detail-section bf-info-card","data-open":a?"true":"false",children:[y("button",{type:"button",className:"bf-collapse-head","aria-expanded":a,onClick:()=>i(l=>!l),children:[p("h3",{children:r}),p(nn,{size:16,className:"bf-collapse-chevron"})]}),a&&p("div",{className:"bf-collapse-body",children:p(Od,{summary:e})})]}),o&&y("section",{className:"bf-detail-section bf-tx-fee-section","data-open":s?"true":"false",children:[y("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":s,onClick:()=>c(l=>!l),children:[p("h3",{children:"Est. Tx Fee"}),y("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&p("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&p("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),p("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:fd(e.txFeeInfo?.estTxFee??"0")}),p(nn,{size:16,className:"bf-collapse-chevron"})]})]}),s&&p("div",{className:"bf-collapse-body",children:p(cs,{rows:e.txFee})})]})]})}function Wd({item:e}){let t=ko(e),n=xd(e.fromAmount,e.fromToken);return y("article",{className:"bf-history-item",children:[y("div",{className:"bf-history-item-head",children:[p("span",{className:"bf-history-status","data-status":t,children:yd(t)}),p("time",{className:"bf-history-time",dateTime:e.timestamp,children:bd(e.timestamp)})]}),y("div",{className:"bf-history-item-body",children:[y("strong",{className:"bf-history-amount",children:[wd(e.fromAmount)," ",e.fromToken.symbol]}),y("div",{className:"bf-history-meta",children:[p("span",{className:"bf-history-usd",children:n??hd(e.txHash)}),y("span",{className:"bf-history-route",children:[y("span",{className:"bf-history-route-token",children:[p(Fn,{token:e.fromToken,size:16}),p("span",{children:e.fromToken.symbol})]}),p(Ha,{size:16,className:"bf-history-route-arrow"}),y("span",{className:"bf-history-route-token",children:[p(Fn,{token:e.toToken,size:16}),p("span",{children:e.toToken.symbol})]})]})]})]})]})}function Dd({flow:e}){let[t,n]=R.useState("all"),o=e.history.some(i=>ko(i)==="pending"),r=e.history.filter(i=>vd(i,t)),a=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return y("main",{className:"bf-history-body",children:[p("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:cd.map(i=>y("button",{type:"button",className:"bf-history-tab","data-active":t===i.value?"true":"false",onClick:()=>n(i.value),children:[p("span",{children:i.label}),i.value==="pending"&&o&&p("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},i.value))}),r.length>0?p("div",{className:"bf-history-list",children:r.map(i=>p(Wd,{item:i},i.id||i.txHash))}):p("div",{className:"bf-empty",children:a})]})}function Hd({flow:e,env:t}){let[n,o]=R.useState(null),[r,a]=R.useState(!1),[i,s]=R.useState(0),l=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??Sd(e):null,d=ld[t],u=kd(e.quoteError),h=ud(e.fromAmount,e.fromToken),m=h?"Insufficient balance":u.from,v=e.quoteError&&!u.from&&!u.to?e.quoteError:"",x=e.error||v,w=e.history.some(f=>ko(f)==="pending"),P=(l?.pathType??ss(e.fromToken,e.toToken))!=="bridge";return y(Cr,{children:[y("main",{className:"bf-body",children:[y("div",{className:"bf-toolbar",children:[y("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),children:[p(za,{}),p("span",{children:"History"}),(w||e.hasNewHistory)&&p("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),P&&y("button",{type:"button",className:"bf-chip",onClick:()=>a(!0),disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":r,children:[p(Wa,{}),p("span",{children:e.slippageLocked?"Auto 1%":dd(e.slippage,e.effectiveSlippage)})]})]}),y("div",{className:"bf-swap-card","data-has-from-error":m?"true":"false",children:[p(ns,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:es(e.fromAmount,e.fromToken),onAmountChange:f=>e.setAmount(f,"from"),onTokenClick:()=>o("from")}),m&&p("div",{className:"bf-field-error",children:m}),p("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),s(f=>f+360)},style:{transform:`translateX(-50%) rotate(${i}deg)`,transition:"transform 0.2s ease"},children:p(Da,{size:22})}),p(ns,{label:"To",token:e.toToken,amount:e.toAmount,usd:es(e.toAmount,e.toToken),onAmountChange:f=>e.setAmount(f,"to"),onTokenClick:()=>o("to"),locked:e.availableToTokens.length<=1}),u.to&&p("div",{className:"bf-field-error",children:u.to})]}),p(Ed,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),l&&p(zd,{summary:l})]}),y("footer",{className:"bf-footer",children:[p("button",{type:"button",className:"bf-next",onClick:e.submit,disabled:e.status==="submitting"||!!e.quoteError||h,children:e.status==="submitting"?"Processing...":"Next"}),y("a",{className:"bf-powered",href:d,target:"_blank",rel:"noreferrer",children:["Powered by ",p("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&p(Cd,{flow:e,side:n,onClose:()=>o(null)}),r&&p(Rd,{flow:e,onClose:()=>a(!1)}),p(Nd,{flow:e}),e.approvalInfo&&p(Id,{flow:e,approval:e.approvalInfo}),p(Ld,{flow:e}),p(Ad,{flow:e}),p(Pd,{message:e.submitToast?"":x}),p(Fd,{flow:e})]})}function So({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let a=R.useMemo(()=>Be(n),[n]),i=Za({...r,onExit:t}),s=R.useRef(null),c=sd(s),l=i.step==="history"?"History":"Swap & Bridge";return p(os.Provider,{value:c,children:y("div",{ref:s,className:X("bf-root",o),"data-view":i.step,"data-status":i.status,children:[y("header",{className:"bf-header",children:[p("button",{type:"button",className:"bf-header-btn",onClick:i.back,"aria-label":"Back",children:p(tn,{size:24})}),p("span",{className:"bf-header-title",children:l}),p("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:p(Ct,{size:24})})]}),i.step==="history"?p(Dd,{flow:i}):p(Hd,{flow:i,env:a})]})})}import{Fragment as Ro,jsx as g,jsxs as N}from"react/jsx-runtime";var Ud="On-ramp is not available in your region.";function Rr(e,t,n){let o=Ne[e],r=n.toUpperCase();if(t===o.cross&&r.includes("CROSSD"))return 0;if(t===o.cross&&r==="CROSS")return 1;if(t===o.bsc&&r==="CROSS")return 2}function $d(e){return parseInt(e.split(":")[1],10)}function jd(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Vd(e){let t=e.toLowerCase().replace(/^0x/,""),n=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),o=parseInt(n.slice(0,4),16)%360,r=(o+60+parseInt(n.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${o} 85% 65%), hsl(${r} 80% 55%))`}function ds({align:e="end",sideOffset:t=12,className:n,children:o}){let{env:r,theme:a,isMobile:i,open:s,drawerDirection:c,modal:l,showBalance:d,showForgeToken:u,showGameToken:h,showQR:m,showBridge:v,qrLogoSrc:x,walletAddress:w,accountName:k,sendAccounts:P,profileImageUrl:f,preferredTokens:I,close:C,onSelectWallet:B,onCopyAddress:F,onBuy:Z,onDisconnect:O,disconnectLabel:K,termsUrl:_,termsLabel:J,privacyUrl:W,privacyLabel:he,portalStyle:ne,navContent:ae,navPosition:De,footerContent:se,view:H,setView:le,selectedSendToken:te,setSelectedSendToken:G,showPortfolio:He,portfolioTitle:fe,showTotalAssets:Ee,totalAssetsLabel:ue,sendTransaction:lt,getTransactionReceipt:ye,estimateGas:_t,onOutlink:ze,lpBalanceReader:vt,stakingRewardsReader:At,bridgeTokens:ce,bridgeHistory:be,getBridgeQuote:Ze,getBridgeToTokens:ke,getBridgeApproval:we,approveBridge:de,submitBridge:yt,onReceive:Ge,onBridge:ct,onSend:Se,onBuyDisabledMessage:kt}=Wt(),[St,Ae]=M.useState(null),dt=M.useRef(void 0),Xe=M.useCallback(b=>{Ae(b),clearTimeout(dt.current),dt.current=setTimeout(()=>Ae(null),4e3)},[]);M.useEffect(()=>()=>clearTimeout(dt.current),[]);let oe=!!kt,Je=M.useCallback(()=>{if(oe){Xe(kt);return}let b=Z?.();b&&typeof b.then=="function"&&b.catch(()=>{Xe(kt??Ud)})},[oe,kt,Z,Xe]),{tokens:Ce,isLoading:et}=Ut(r,w,s&&d),{statsMap:Ue}=$t(r,d),{categoryMap:Pt}=Yi(r,d),Bt=d&&Ee,{displayValue:pt,isLowerBound:Ot,isLoading:ft}=Zi(r,w,s&&Bt),[xe,S]=M.useState(!1),j=M.useRef(null),[ee,$e]=M.useState(0),{holdings:je,isLoading:zt}=Ki(r,w,s&&d&&u),_o=M.useMemo(()=>je.map(b=>b.token),[je]),{imageMap:Cn}=Qi(r,_o,u&&je.length>0),tt=M.useMemo(()=>{let b=[],E=[],V=[],Pe=new Map((I??[]).map((Y,me)=>[`${$d(Y.chainId)}:${Y.address.toLowerCase()}`,me]));for(let Y of Ce){let me=Rr(r,Y.chainId,Y.symbol)!==void 0,Zt=`${Y.chainId}:${Y.address.toLowerCase()}`,Xt=Pe.get(Zt),$o=new Mn(Y.quantity.numeric).shiftedBy(-Y.quantity.decimals);if(me)b.push(Y);else if(Xt!==void 0)E.push(Y);else if($o.isGreaterThan(0)){if(!h&&Pt.get(ur(Y.chainId,Y.address))==="game")continue;V.push(Y)}}return b.sort((Y,me)=>{let Zt=Rr(r,Y.chainId,Y.symbol)??99,Xt=Rr(r,me.chainId,me.symbol)??99;return Zt-Xt}),E.sort((Y,me)=>{let Zt=Pe.get(`${Y.chainId}:${Y.address.toLowerCase()}`)??99,Xt=Pe.get(`${me.chainId}:${me.address.toLowerCase()}`)??99;return Zt-Xt}),V.sort((Y,me)=>{let Zt=Ue.get(ht(Y.chainId,Y.address)),Xt=Ue.get(ht(me.chainId,me.address)),$o=new Mn(Y.quantity.numeric).shiftedBy(-Y.quantity.decimals).multipliedBy(Zt?.price??0);return new Mn(me.quantity.numeric).shiftedBy(-me.quantity.decimals).multipliedBy(Xt?.price??0).minus($o).toNumber()}),[...b,...E,...V]},[Ce,r,Ue,h,Pt,I]),Hn=M.useMemo(()=>{if(!u)return[];let b=new Set(Ce.map(E=>E.address.toLowerCase()));return[...je].filter(E=>!b.has(E.token.toLowerCase())).sort((E,V)=>{let Pe=new Mn(E.value);return new Mn(V.value).minus(Pe).toNumber()})},[je,u,Ce]),L=M.useRef(!1),[Q,U]=M.useState(null),ie=M.useRef(void 0),Gn=Q?.chainId??te?.chainId??tt[0]?.chainId??0,{transactionUrl:Oo}=Jn(r,Gn,Q?.txHash,!!(Q?.txHash&&Gn)),Ve=M.useCallback(b=>{L.current=!0,le(b)},[le]),[zs,zo]=M.useState("recipient"),Un=M.useCallback(()=>{G(null),zo("recipient"),Ve("wallet")},[G,Ve]),Wo=M.useCallback((b,E="recipient")=>{zo(E),G(b),Ve("send")},[G,Ve]),Ws=M.useCallback(()=>{if(ct){ct();return}Ve("bridge")},[ct,Ve]),Ds=M.useCallback(b=>{clearTimeout(ie.current),G(null),Ve("wallet"),U({status:"pending",txHash:b.txHash,chainId:b.chainId,description:`${b.amount} ${b.tokenSymbol} to ${Ke(b.recipient)}`})},[G,Ve]),Hs=M.useCallback(b=>{let E=te?.chainId;G(null),Ve("wallet"),!(!b||!E)&&(U(V=>({status:"success",txHash:b,chainId:E,description:V?.txHash===b?V.description:"Tap to see your transaction"})),clearTimeout(ie.current),ie.current=setTimeout(()=>U(null),5e3))},[te?.chainId,G,Ve]),Gs=M.useCallback(b=>{let E=b.txHash;E&&(U({status:"error",txHash:E,chainId:b.chainId,description:b.message}),clearTimeout(ie.current),ie.current=setTimeout(()=>U(null),5e3))},[]),Do=M.useMemo(()=>{if(Ge)return Ge;if(m)return()=>Ve("qr")},[Ge,m,Ve]),Ar=M.useMemo(()=>{if(Se)return Se;if(tt.length===0)return;let b=tt[0];return()=>Wo(b,"token")},[Se,tt,Wo]);M.useEffect(()=>{s||(L.current=!1,zo("recipient"))},[s]);let Pr=M.useRef(null);M.useEffect(()=>{let b=Pr.current;if(!b||!i)return;let E=V=>{V.pointerType==="touch"&&V.stopPropagation()};return b.addEventListener("pointerdown",E),()=>b.removeEventListener("pointerdown",E)},[i]);let[cn,Br]=M.useState(!1),Ho=M.useRef(void 0),[Rn,$n]=M.useState(!1);M.useEffect(()=>{if(!Rn)return;let b=()=>$n(!1),E=Pe=>{Pe.key==="Escape"&&$n(!1)},V=setTimeout(()=>{document.addEventListener("mousedown",b,!0),document.addEventListener("keydown",E,!0)},0);return()=>{clearTimeout(V),document.removeEventListener("mousedown",b,!0),document.removeEventListener("keydown",E,!0)}},[Rn]),M.useEffect(()=>()=>clearTimeout(Ho.current),[]),M.useEffect(()=>()=>clearTimeout(ie.current),[]),M.useEffect(()=>{let b=j.current;if(!b||se===null){$e(0);return}let E=()=>{$e(b.offsetHeight)};if(E(),typeof ResizeObserver>"u")return;let V=new ResizeObserver(E);return V.observe(b),()=>V.disconnect()},[se]);let Fr=M.useCallback(async()=>{if(!cn)try{await navigator.clipboard.writeText(w),Br(!0),clearTimeout(Ho.current),Ho.current=setTimeout(()=>Br(!1),2e3),F?.(w,!0)}catch{F?.(w,!1)}},[w,F,cn]),jn=M.useCallback(b=>{b.currentTarget.setAttribute("data-loaded","true")},[]),Mr=M.useMemo(()=>({background:Vd(w)}),[w]),Vn=M.useMemo(()=>f||Ft(r,w,{size:120,bg:a==="dark"?"1A1A2E":"F3F6F8"}),[f,r,w,a]),Go=M.useMemo(()=>jd(pt),[pt]),_r=_||W?N("div",{className:"wi-legal-links",children:[_&&g("a",{className:"wi-legal-link",href:_,target:"_blank",rel:"noopener noreferrer",onClick:b=>Qe(b,_,{category:"terms",origin:"terms"},ze),children:J}),_&&W&&g("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),W&&g("a",{className:"wi-legal-link",href:W,target:"_blank",rel:"noopener noreferrer",onClick:b=>Qe(b,W,{category:"privacy",origin:"privacy"},ze),children:he})]}):null,Or=O?N("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{O(),C()},children:[g(ri,{size:16}),g("span",{className:"wi-disconnect-label",children:K})]}):null,Us=d&&!ae?N("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[N("button",{type:"button",className:X("wi-action-card",oe&&"wi-action-card--dimmed"),onClick:Je,disabled:!Z&&!oe,"aria-disabled":oe||void 0,"aria-label":"Buy",children:[g(di,{size:20}),g("span",{children:"Buy"})]}),v?N("button",{type:"button",className:"wi-action-card",onClick:Ws,"aria-label":"Bridge",children:[g(pi,{size:20}),g("span",{children:"Bridge"})]}):N("button",{type:"button",className:"wi-action-card",onClick:Do,disabled:!Do,"aria-label":"Receive",children:[g(Zo,{size:20}),g("span",{children:"Receive"})]}),N("button",{type:"button",className:"wi-action-card",onClick:Ar,disabled:!Ar,"aria-label":"Send",children:[g(li,{size:20}),g("span",{children:"Send"})]}),N("button",{type:"button",className:"wi-action-card",onClick:()=>Ve("portfolio"),disabled:!He,"aria-label":"View portfolio",children:[g(ci,{size:20}),g("span",{children:"Portfolio"})]})]}):null,$s=N("div",{className:X("wi-view-inner",L.current&&"wi-view-wallet"),children:[Bt&&N("div",{className:"wi-total-section",children:[N("div",{className:"wi-total-head",children:[g("span",{className:"wi-total-label",children:ue}),g("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:b=>{b.stopPropagation(),S(E=>!E)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),S(E=>!E))},"aria-label":xe?"Show balance":"Hide balance",children:xe?g(ai,{}):g(ii,{})})]}),g("div",{className:"wi-total-body",children:ft?g("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):g("div",{className:"wi-total-value","data-hidden":xe||void 0,children:xe?g("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):N(Ro,{children:[Ot&&g("span",{className:"wi-total-lte",children:"\u2264"}),g("span",{className:"wi-total-currency",children:"$"}),g("span",{className:"wi-total-amount",children:Go.main}),Go.decimal&&g("span",{className:"wi-total-decimal",children:Go.decimal})]})})})]}),De==="top"&&(ae?g("div",{className:"wi-nav-fixed",children:ae}):Us),d&&g("div",{ref:Pr,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:N("div",{className:"wi-token-list",children:[et&&Array.from({length:5},(b,E)=>N("div",{className:"wi-skeleton-item",children:[N("div",{className:"wi-skeleton-left",children:[g("div",{className:"wi-skeleton-block wi-skeleton-icon"}),N("div",{className:"wi-skeleton-lines",children:[g("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),g("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),N("div",{className:"wi-skeleton-right",children:[g("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),g("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},E)),!et&&tt.length===0&&!u&&g("div",{className:"wi-empty",children:"No Tokens Found"}),tt.map(b=>{let E=Ue.get(ht(b.chainId,b.address)),V=E?parseFloat(E.percent_change_24h):null,Pe=V!==null&&V>=0,Y=An(r,b.chainId);return N("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>Wo(b),"aria-label":`Send ${b.symbol}`,children:[N("div",{className:"wi-token-left",children:[N("div",{className:"wi-token-icon-wrap",children:[g("img",{src:b.icon_url,alt:b.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:jn,onError:me=>{me.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Y&&g("img",{src:Y,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:me=>{me.currentTarget.style.display="none"}})]}),N("div",{className:"wi-token-info",children:[g("span",{className:"wi-token-name",children:b.symbol}),E&&N("div",{className:"wi-token-price-row",children:[g("span",{className:"wi-token-price",children:Xo(E.price)}),g("span",{className:"wi-token-change","data-positive":Pe,"data-zero":V===0||void 0,children:V!==null&&(V===0?"0%":`${Pe?"+":"-"}${(Pe?Math.floor:Math.ceil)(Math.abs(V)*100)/100}%`)})]})]})]}),N("div",{className:"wi-token-right",children:[g("span",{className:"wi-token-balance",children:Dt(b.quantity.numeric,b.quantity.decimals)}),E&&g("span",{className:"wi-token-value",children:ui(b.quantity.numeric,b.quantity.decimals,E.price)})]})]},`${b.address}-${b.chainId}`)}),u&&zt&&Array.from({length:3},(b,E)=>N("div",{className:"wi-skeleton-item",children:[N("div",{className:"wi-skeleton-left",children:[g("div",{className:"wi-skeleton-block wi-skeleton-icon"}),N("div",{className:"wi-skeleton-lines",children:[g("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),g("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),N("div",{className:"wi-skeleton-right",children:[g("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),g("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${E}`)),u&&!zt&&!et&&tt.length===0&&Hn.length===0&&g("div",{className:"wi-empty",children:"No Tokens Found"}),u&&Hn.map(b=>{let E=Cn.get(b.token)||"",V=An(r,Ne[r].cross);return N("div",{className:"wi-token-item",children:[N("div",{className:"wi-token-left",children:[N("div",{className:"wi-token-icon-wrap",children:[g("img",{src:E||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:b.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:jn,onError:Pe=>{Pe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),V&&g("img",{src:V,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Pe=>{Pe.currentTarget.style.display="none"}})]}),N("div",{className:"wi-token-info",children:[g("span",{className:"wi-token-name",children:b.token_name}),g("div",{className:"wi-token-price-row",children:N("span",{className:"wi-token-price",children:[Dt(b.current_price,18)," CROSS"]})})]})]}),N("div",{className:"wi-token-right",children:[g("span",{className:"wi-token-balance",children:Dt(b.balance,18)}),g("span",{className:"wi-token-value",children:Xo(b.current_value_usd)})]})]},`forge-${b.token}`)})]})}),De==="bottom"&&ae&&g("div",{className:"wi-nav-fixed",children:ae}),Or&&g("div",{className:"wi-wallet-disconnect-row",children:Or})]},"wallet"),js=He?g("div",{className:X("wi-view-inner wi-portfolio-body",L.current&&"wi-view-portfolio"),children:g(vn,{env:r,theme:a,walletAddress:w,showHeader:!1,onOutlink:ze,lpBalanceReader:vt,stakingRewardsReader:At})},"portfolio"):null,Vs=te?g("div",{className:X("wi-view-inner wi-send-body",L.current&&"wi-view-send"),children:g(fo,{env:r,theme:a,walletAddress:w,accountName:k,accounts:P,initialStep:zs,token:te,tokens:tt,onTokenChange:G,sendTransaction:lt,getTransactionReceipt:ye,estimateGas:_t,getTokenPriceUsd:b=>{let E=Ue.get(ht(b.chainId,b.address));if(!E?.price)return;let V=parseFloat(E.price);return Number.isFinite(V)?V:void 0},onClose:C,onBackToWallet:Un,onSubmitted:Ds,onSuccess:Hs,onFailed:Gs,onOutlink:ze})},"send"):null,qs=M.useMemo(()=>ce||tt.map(b=>{let E=Ue.get(ht(b.chainId,b.address)),V=E?.price?parseFloat(E.price):void 0;return{name:b.name,symbol:b.symbol,chainId:b.chainId,address:b.address,decimals:b.quantity.decimals,balance:or(b.quantity.numeric,b.quantity.decimals),iconUrl:b.icon_url,priceUsd:Number.isFinite(V)?V:void 0}}),[ce,Ue,tt]),Ks=g("div",{className:X("wi-view-inner wi-bridge-body",L.current&&"wi-view-send"),children:g(So,{env:r,walletAddress:w,tokens:qs,history:be,termsUrl:_,getQuote:Ze,getToTokens:ke,getApproval:we,approveBridge:de,submitBridge:yt,onClose:C,onBackToWallet:Un})},"bridge"),Uo=!!B&&k?.trim().toLowerCase()!=="my wallet",zr=N(Ro,{children:[N("span",{className:"wi-receive-avatar",children:[g("span",{className:"wi-avatar-fallback",style:Mr}),Vn&&g("img",{src:Vn,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:jn,onError:b=>{b.currentTarget.style.display="none"}})]}),g("span",{className:"wi-receive-account-name",children:k??"Account 1"}),Uo&&g("span",{className:"wi-receive-chevron","data-open":Rn,"aria-hidden":"true",children:g(nn,{size:16})})]}),Qs=N("div",{className:X("wi-view-inner wi-qr-body",L.current&&"wi-view-qr"),children:[N("div",{className:"wi-receive-section",children:[Uo?g("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{$n(!0),B?.()},"aria-label":"Switch account",children:zr}):g("div",{className:"wi-receive-account",children:zr}),N("div",{className:"wi-qr-block",children:[N("div",{className:"wi-qr-box",children:[g(Gd,{value:w,size:180,level:"H",marginSize:2,...x&&{imageSettings:{src:x,height:33,width:33,excavate:!0}}}),!x&&g("div",{className:"wi-qr-logo",children:g(si,{size:33})})]}),g("p",{className:"wi-qr-address",children:w})]}),N("button",{type:"button",className:"wi-qr-copy-btn",onClick:Fr,children:[g("span",{className:"wi-qr-copy-icon",children:cn?g(en,{size:16}):g(Tn,{size:16})}),g("span",{className:"wi-qr-copy-text",children:cn?"Copied!":"Copy address"})]})]}),_r&&g("div",{className:"wi-receive-footer",children:_r})]},"qr"),Ys=H==="qr"||H==="portfolio"||H==="send"||H==="bridge",Wr=se!==null?g("div",{className:"wi-builtin-footer",children:se}):null,Dr=N("div",{className:"wi-account-text",children:[Uo?N("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{$n(!0),B?.()},"aria-label":"Switch account","aria-expanded":Rn,children:[g("span",{className:"wi-account-name",children:k??"Account 1"}),g("span",{className:"wi-account-switch","data-open":Rn,"aria-hidden":"true",children:g(nn,{size:20})})]}):g("div",{className:"wi-account-row",children:g("span",{className:"wi-account-name",children:k??"Account 1"})}),N("button",{type:"button",className:"wi-address-row-btn",onClick:Fr,"aria-label":"Copy address",children:[g("span",{className:"wi-account-address",children:Ke(w)}),g("span",{className:"wi-account-copy","data-copied":cn,children:cn?g(en,{size:12}):g(Tn,{size:12})})]})]}),Hr=N(Ro,{children:[o,H==="qr"?g("div",{className:"wi-sticky-header",children:N("div",{className:"wi-header wi-header--receive",children:[g("button",{type:"button",className:"wi-header-back",onClick:Un,"aria-label":"Back",children:g(tn,{size:24})}),g("span",{className:"wi-receive-title",children:"Receive"}),g("button",{type:"button",className:"wi-header-action",onClick:C,"aria-label":"Close",children:g(Ct,{size:24})})]})}):H==="send"||H==="bridge"?null:Ys?N("div",{className:"wi-sticky-header",children:[N("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[g("button",{type:"button",className:"wi-header-back",onClick:Un,"aria-label":"Back",children:g(tn,{size:24})}),g("div",{className:"wi-account-block wi-account-block--sub-account",children:Dr}),g("button",{type:"button",className:"wi-header-action",onClick:C,"aria-label":"Close",children:g(Ct,{size:24})})]}),g("hr",{className:"wi-divider"})]}):N("div",{className:"wi-sticky-header",children:[N("div",{className:"wi-header wi-header--wallet",children:[N("div",{className:"wi-account-block",children:[N("div",{className:"wi-avatar",children:[g("div",{className:"wi-avatar-fallback",style:Mr}),Vn&&g("img",{src:Vn,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:jn,onError:b=>{b.currentTarget.style.display="none"}})]}),Dr]}),N("div",{className:"wi-header-actions",children:[m&&v&&g("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:Do,"aria-label":"Show QR code",children:g(Zo,{size:20})}),g("button",{type:"button",className:"wi-header-action",onClick:C,"aria-label":"Close",children:g(Ct,{size:24})})]})]}),g("hr",{className:"wi-divider"})]}),N("div",{className:"wi-view-container",children:[H==="wallet"&&$s,H==="qr"&&Qs,H==="portfolio"&&js,H==="send"&&Vs,H==="bridge"&&Ks]}),H==="wallet"&&St&&g("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:St}),H==="wallet"&&Q&&N("a",{className:"wi-send-toast",href:Oo??"#",target:"_blank",rel:"noopener noreferrer",onClick:b=>{if(!Oo){b.preventDefault();return}Qe(b,Oo,{category:"send",origin:"send-transaction",payload:{chainId:Q.chainId,txHash:Q.txHash}},ze)},children:[g("span",{className:"wi-send-toast-icon","data-status":Q.status,"aria-hidden":!0,children:Q.status==="pending"?g("span",{className:"wi-send-toast-spinner"}):Q.status==="error"?g("span",{className:"wi-send-toast-error-dot"}):g(fi,{size:20})}),N("span",{className:"wi-send-toast-copy",children:[g("span",{className:"wi-send-toast-title",children:Q.status==="pending"?"Sending...":Q.status==="error"?"Send failed":"Send complete"}),g("span",{className:"wi-send-toast-desc",children:Q.status==="pending"||Q.status==="error"?Q.description:"Tap to see your transaction"})]})]}),Wr&&H!=="portfolio"&&H!=="send"&&g("div",{className:"wi-sticky-footer",children:g("div",{className:"wi-footer",ref:j,children:Wr})})]}),Gr={...ne,...ee>0?{"--wi-footer-height":`${ee}px`}:null};return i?N(Co.Portal,{children:[l&&g(Co.Overlay,{className:"wi-drawer-overlay"}),N(Co.Content,{className:X("wi-drawer-content",n),"data-theme":a,"data-vaul-no-drag":c==="left"||c==="right"?!0:void 0,style:Gr,"data-direction":c,"data-no-balance":!d||void 0,"data-has-footer":ee>0||void 0,"data-view":H,children:[g(Co.Title,{className:"wi-sr-only",children:"My Wallet"}),Hr]})]}):N(Ro,{children:[l&&s&&g("div",{className:"wi-drawer-overlay",onClick:C}),g(No.Portal,{children:g(No.Content,{align:e,sideOffset:t,className:X("wi-popover-content",n),"data-theme":a,style:Gr,"data-no-balance":!d||void 0,"data-has-footer":ee>0||void 0,"data-view":H,children:Hr})})]})}import*as ps from"react";function fs({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=Wt();return ps.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}import*as us from"react";function ms({children:e}){let{setFooterContent:t}=Wt();return us.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}z(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #121212);--wi-surface-default: var(--ds-surface-medium, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(255, 255, 255, .1));--wi-border-default: var(--ds-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--ds-border-medium, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--ds-content-highest, #ffffff);--wi-texticon-secondary: var(--ds-content-medium, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(255, 255, 255, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #ffffff);--wi-surface-default: var(--ds-surface-medium, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(18, 18, 18, .1));--wi-border-default: var(--ds-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--ds-border-medium, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--ds-content-highest, #121212);--wi-texticon-secondary: var(--ds-content-medium, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(18, 18, 18, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
|