PageSourceSearch

https://duels.trade/assets/CGv9Uk0V0ZaFKUrj.js

js duels.trade collected 2026-10-09 22:53:10 UTC 6,015 bytes, 7 lines download raw bytes

1import{d6 as _,d8 as y,d7 as h,da as t,fi as w,f4 as j,dv as N}from"./JPxLSbkry-VDCYml.js";const E=_("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);function p(e,o=0){const i=Number(e);return Number.isFinite(i)?i:o}function P(e,o){const i=String(e.asset||"").trim().toUpperCase(),n=p(e.entryPrice),a=Math.abs(p(e.size)),l=p(o[i],n),d=String(e.side).toLowerCase()==="short"?(n-l)*a:(l-n)*a;return{...e,currentPrice:l,unrealizedPnl:d.toFixed(2)}}function M(e,o){const i=Array.isArray(e.positions)?e.positions.map(u=>P(u,o)):[],n=p(e.balance),a=i.reduce((u,g)=>u+p(g.marginUsed),0),l=i.reduce((u,g)=>u+p(g.unrealizedPnl),0),d=n+a+l,c=p(e.initialValue??e.initialBalance,1e3),b=d-c;return{...e,balance:n,availableMargin:n,equity:d,currentPnL:b,currentPnl:b,percentGain:c>0?b/c*100:0,unrealizedPnl:l,positions:i}}function k(e,o){const i=e.map(n=>M(n,o));return i.sort((n,a)=>!!n.isEliminated!=!!a.isEliminated?n.isEliminated?1:-1:a.percentGain-n.percentGain),i.map((n,a)=>({...n,rank:a+1}))}function F({tabs:e,activeTab:o,onTabChange:i,onTabIntent:n,centerAction:a}){const l=y(),d=h.useRef(null);if(h.useLayoutEffect(()=>{if(typeof window>"u")return;const r=document.documentElement;if(!l){r.style.setProperty("--mobile-bottom-nav-height","0px");return}const s=()=>{const v=d.current?.getBoundingClientRect().height??0;r.style.setProperty("--mobile-bottom-nav-height",`${Math.ceil(v)}px`)};s();const m=new ResizeObserver(s);return d.current&&m.observe(d.current),window.addEventListener("resize",s,{passive:!0}),window.addEventListener("orientationchange",s),()=>{m.disconnect(),window.removeEventListener("resize",s),window.removeEventListener("orientationchange",s),r.style.setProperty("--mobile-bottom-nav-height","0px")}},[l]),!l)return null;const c=!!a,b=c?Math.ceil(e.length/2):e.length,u=e.slice(0,b),g=e.slice(b),f=r=>`
2        group relative flex flex-1 min-w-[44px] flex-col items-center justify-end gap-0.5
3        transition-colors duration-150 touch-manipulation no-underline outline-none
4        focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-hyperliquid/70
5        ${c?"min-h-[82px] pb-3 pt-5":"min-h-[62px] pb-2 pt-1.5"}
6        ${r?"text-hyperliquid":"text-muted-foreground hover:text-foreground/80"}
7      `,x=r=>{const s=o===r.value,m=f(s);return t.jsxs("button",{type:"button","data-native-haptic":"none","aria-current":s?"page":void 0,onPointerDown:()=>n?.(r.value),onFocus:()=>n?.(r.value),onClick:()=>{o!==r.value&&N(),i(r.value)},className:m,children:[t.jsxs("span",{className:"relative flex h-8 w-12 shrink-0 items-center justify-center",children:[s&&t.jsx("span",{"aria-hidden":"true",className:"absolute inset-0 rounded-xl border border-hyperliquid/15 bg-hyperliquid/[0.09] shadow-[0_0_20px_rgba(0,229,204,0.08)]"}),t.jsx("span",{className:`relative flex items-center justify-center transition-transform duration-150 [&>img]:block [&>img]:h-6 [&>img]:w-6 [&>img]:object-contain [&>svg]:h-6 [&>svg]:w-6 ${s?"scale-105":"scale-95"}`,children:r.icon})]}),t.jsx("span",{className:`relative text-[10px] leading-4 ${s?"font-bold":"font-medium"}`,children:r.label}),s&&t.jsx("span",{"aria-hidden":"true",className:"absolute bottom-1 h-0.5 w-4 rounded-full bg-hyperliquid shadow-[0_0_8px_rgba(0,229,204,0.75)]"})]},r.value)};return t.jsxs("nav",{ref:d,"data-mobile-bottom-nav":!0,className:`duels-mobile-bottom-nav duels-mobile-nav-surface fixed bottom-0 left-0 right-0 z-[80] flex justify-around border-t backdrop-blur-2xl safe-area-bottom ${c?"items-end overflow-visible":"items-center"}`,"aria-label":"Main navigation",children:[u.map(x),a&&t.jsxs("div",{className:"relative flex min-h-[82px] flex-1 items-start justify-center pb-2 pt-[9px]",children:[t.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-[9px] h-[68px] w-[92px] rounded-b-[34px] rounded-t-[18px] bg-[radial-gradient(ellipse_at_center,rgba(0,229,204,0.16)_0%,rgba(0,229,204,0.07)_42%,transparent_72%)]"}),t.jsx("span",{"aria-hidden":"true",className:"duels-mobile-nav-center-well pointer-events-none absolute top-[16px] h-[66px] w-[66px] rounded-full border"}),t.jsxs("button",{type:"button","data-native-haptic":"none","aria-label":a.ariaLabel,disabled:a.disabled,onClick:()=>{w(j.Medium),a.onClick()},className:"duels-mobile-nav-center-button group relative z-10 h-[64px] w-[64px] overflow-hidden rounded-full border border-cyan-100/80 transition duration-200 touch-manipulation hover:border-cyan-50/90 active:scale-[0.94] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cyan-100 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[t.jsx("span",{className:"absolute inset-0 bg-[radial-gradient(circle_at_34%_20%,rgba(236,254,255,0.82),transparent_18%),radial-gradient(circle_at_50%_56%,rgba(0,229,204,0.62),transparent_42%),linear-gradient(145deg,rgba(18,92,107,1)_0%,rgba(0,229,204,0.34)_42%,rgba(4,18,31,1)_100%)]"}),t.jsx("span",{className:"absolute inset-[7px] rounded-full border border-white/25 bg-[radial-gradient(circle_at_50%_28%,rgba(255,255,255,0.16),transparent_34%)] shadow-[inset_0_2px_12px_rgba(255,255,255,0.14),inset_0_-16px_28px_rgba(0,0,0,0.34)]"}),t.jsx("span",{className:"absolute left-1/2 top-[10px] h-1.5 w-7 -translate-x-1/2 roun
7ded-full bg-white/55 blur-[1px]"}),t.jsx("span",{className:"absolute inset-[11px] rounded-full border border-cyan-100/16 bg-[radial-gradient(circle_at_34%_24%,rgba(236,254,255,0.3),rgba(236,254,255,0)_24%),radial-gradient(circle_at_50%_54%,rgba(0,238,213,0.96)_0%,rgba(0,171,160,0.98)_58%,rgba(4,71,82,1)_100%),linear-gradient(180deg,#0ed8c7_0%,#008f8a_62%,#053b4d_100%)] shadow-[inset_0_1px_10px_rgba(255,255,255,0.12),inset_0_-10px_18px_rgba(0,0,0,0.24),0_0_12px_rgba(0,229,204,0.24)]"}),t.jsx("span",{className:"absolute inset-0 rounded-full ring-1 ring-inset ring-cyan-100/42 transition group-hover:ring-cyan-50/75"})]})]}),g.map(x)]})}export{E as F,F as M,k as a,M as p};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.