1import{j as e}from"./remotion-D54tqFOj.js";import{x as n}from"./vendor-charts-CXpta1tX.js";import{h2 as _,gD as P,pv as F,fT as G,b5 as D,lF as z,fb as L,cn as E,eg as q,ap as H}from"./index-O9bDP4Mv.js";import{N as U,F as B}from"./Footer-CQdBFsaF.js";import{u as V}from"./use-in-view-DJ7mt6O-.js";import{T as W}from"./text-reveal-CxVi-_AW.js";import{L as K,A as J,g as Q}from"./syraSocialLinks-CkPoX2I3.js";import{m as N}from"./proxy-6b4383aj.js";import{G as X}from"./gift-Cyj0PSA2.js";import{C as Y}from"./chevron-left-DmlwgvXY.js";import{A as Z}from"./arrow-up-down-C7K25itG.js";import{a as O,A as ee}from"./arrow-up-etN5VpUe.js";import"./logo-JPwhP0qJ.js";import"./file-text-SQSPgTT2.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const A=_("Medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]),I=1.1,te=Array.from({length:10},(c,o)=>o);function $({value:c,pad:o,duration:x=.9,stagger:m=.04,startOnView:i=!0,prefix:u,suffix:a,blur:l=!1,className:b,digitClassName:C,locale:p,format:v}){const h=n.useRef(null),S=V(h,{once:!0,amount:.6}),[w,j]=n.useState(!i);n.useEffect(()=>{i&&S&&j(!0)},[i,S]);const d=n.useMemo(()=>{const t=Math.round(c),s=v?v(t):p?t.toLocaleString():t.toString();return o?s.padStart(o,"0"):s},[c,o,v,p]),g=n.useMemo(()=>{const t=d.split("");return t.map((s,r)=>({char:s,id:`g-${t.length-1-r}`}))},[d]),M=`${u??""}${d}${a??""}`,[k,R]=n.useState(!1);return n.useEffect(()=>{if(!w||k)return;const t=(x+g.length*m)*1e3,s=window.setTimeout(()=>R(!0),t);return()=>window.clearTimeout(s)},[w,k,x,m,g.length]),e.jsxs("span",{ref:h,className:P("inline-flex items-center tabular-nums",b),children:[e.jsx("span",{className:"sr-only",children:M}),e.jsxs("span",{"aria-hidden":"true",className:"inline-flex items-center",children:[u?e.jsx("span",{children:u}):null,g.map(({char:t,id:s},r)=>{if(!/\d/.test(t))return e.jsx("span",{className:"inline-block",children:t},s);const y=Number(t);return e.jsx(se,{digit:w?y:0,delay:k?0:r*m,duration:x,blur:l,className:C},s)}),a?e.jsx("span",{children:a}):null]})]})}function se({digit:c,delay:o,duration:x,blur:m,className:i}){const u=F(),a=n.useRef(null);return n.useEffect(()=>{if(u||!m||!a.current||!Number.isFinite(c))return;const l=a.current,b=G(l,{filter:["blur(10px)","blur(0px)"]},{duration:Math.min(x*.75,.32),delay:o,ease:D});return()=>{b.stop(),l.style.filter="blur(0px)"}},[m,o,c,x,u]),e.jsx("span",{className:P("relative inline-block overflow-hidden",i),style:{height:`${I}em`,width:"1ch"},children:e.jsx(z.span,{ref:a,initial:{y:0},animate:{y:`-${c*I}em`},transition:u?{duration:0}:{duration:x,delay:o,ease:D},className:"absolute inset-x-0 top-0 flex flex-col items-center will-change-[transform,filter]",children:te.map(l=>e.jsx("span",{className:"flex h-[1.1em] items-center justify-center leading-none",children:l},l))})})}function ye(){const[c,o]=n.useState([]),[x,m]=n.useState(!0),[i,u]=n.useState(""),[a,l]=n.useState(1),[b,C]=n.useState("7d"),[p,v]=n.useState({key:"rank",direction:"asc"}),h=10;n.useEffect(()=>{(async()=>{m(!0);try{const f=(await(await fetch(`${J}/leaderboard?period=${b}`,{headers:Q()})).json()).sort((y,T)=>T.volume-y.volume).map((y,T)=>({...y,rank:T+1}));o(f)}catch{}finally{m(!1)}})()},[b]);const S="-",w=t=>{v(s=>({key:t,direction:s.key===t&&s.direction==="asc"?"desc":"asc"}))},j=n.useMemo(()=>{let t=c.filter(s=>{var r,f;return(f=(r=s==null?void 0:s.wallet)==null?void 0:r.toLowerCase())==null?void 0:f.includes(i==null?void 0:i.toLowerCase())});return t.sort((s,r)=>{const f=s[p.key],y=r[p.key];return p.direction==="asc"?f>y?1:-1:f<y?1:-1}),t},[c,i,p]),d=Math.ceil(j.length/h),g=j.slice((a-1)*h,a*h),M=({columnKey:t})=>p.key!==t?e.jsx(Z,{className:"w-4 h-4 opacity-30"}):p.direction==="asc"?e.jsx(O,{className:"w-4 h-4 text-primary"}):e.jsx(ee,{className:"w-4 h-4 text-primary"}),k=t=>t===1?e.jsx(L,{className:"w-5 h-5 gold-text"}):t===2?e.jsx(A,{className:"w-5 h-5 text-muted-foreground"}):t===3?e.jsx(A,{className:"w-5 h-5 text-warning"}):e.jsxs("span",{className:"text-muted-foreground",children:["#",t]}),R=t=>t===1?"50%":t===2?"30%":t===3?"20%":"-";return e.jsxs("div",{className:"min-h-screen bg-background overflow-x-hidden",children:[e.jsx(U,{}),e.jsx("div",{className:"fixed inset-0 opacity-50 grid-pattern pointer-events-none"}),e.jsx("div",{className:"fixed top-0 left-1/4 w-[600px] h-[600px] bg-primary/10 rounded-full blur-[120px] pointer-events-none"}),e.jsx("div",{className:"fixed bottom-0 right-1/4 w-[500px] h-[500px] bg-neon-purple/10 rounded-full blur-[100px] pointer-events-none"}),e.jsx("main",{className:"relative z-10 pt-28 pb-16",children:e.jsxs("div",{className:"px-4 mx-auto max-w-7xl sm:px-6 lg:px-8",children:[e.jsxs(N.div,{initial:{opacity:0,y:20}
6,animate:{opacity:1,y:0},className:"mb-8 text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 mb-6 glass-card",children:[e.jsx(L,{className:"w-4 h-4 gold-text"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Agents on the Syra rail · x402 volume"})]}),e.jsx("h1",{className:"mb-4 text-4xl font-bold sm:text-5xl",children:e.jsx(W,{as:"span",className:"neon-text block",text:"Agent leaderboard"})}),e.jsx("p",{className:"text-lg text-muted-foreground",children:"Auditable rankings by x402 spend and tool usage, proof that agents run on Syra infrastructure."})]}),e.jsxs(N.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.05},className:"flex flex-wrap items-center justify-center gap-4 mb-8",children:[e.jsx(E,{to:"/",className:"px-6 py-3 text-sm font-medium transition-all rounded-xl btn-secondary",children:"â Back to Home"}),e.jsx(E,{to:"/playground",className:"px-6 py-3 text-sm font-medium transition-all rounded-xl btn-secondary",children:"Build on the rail"}),e.jsx(E,{to:K,className:"px-6 py-3 text-sm font-medium btn-primary",children:"Reference agent â"})]}),e.jsx(N.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"p-6 mb-8 glass-card",children:e.jsxs("div",{className:"flex flex-col items-center justify-between gap-6 md:flex-row",children:[e.jsxs("div",{className:"text-center md:text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(X,{className:"w-5 h-5 text-primary"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Weekly Reward Pool"})]}),e.jsx("div",{className:"text-3xl font-bold text-foreground",children:S})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"px-4 py-3 text-center glass-card rounded-xl",children:[e.jsx(L,{className:"w-6 h-6 mx-auto mb-1 gold-text"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"1st Place"}),e.jsx("div",{className:"font-bold text-primary",children:"50%"})]}),e.jsxs("div",{className:"px-4 py-3 text-center glass-card rounded-xl",children:[e.jsx(A,{className:"w-6 h-6 mx-auto mb-1 text-muted-foreground"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"2nd Place"}),e.jsx("div",{className:"font-bold text-primary",children:"30%"})]}),e.jsxs("div",{className:"px-4 py-3 text-center glass-card rounded-xl",children:[e.jsx(A,{className:"w-6 h-6 mx-auto mb-1 text-warning"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"3rd Place"}),e.jsx("div",{className:"font-bold text-primary",children:"20%"})]})]})]})}),e.jsxs(N.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"flex flex-col gap-4 mb-6 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(q,{className:"absolute w-5 h-5 transform -translate-y-1/2 left-3 top-1/2 text-muted-foreground"}),e.jsx("input",{type:"text",placeholder:"Search by wallet address...",value:i,onChange:t=>{u(t.target.value),l(1)},className:"w-full py-3 pl-10 pr-4 transition-colors border rounded-xl bg-background/80 border-border focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary"})]}),e.jsx("div",{className:"flex gap-2",children:["7d","14d","30d","all"].map(t=>e.jsx("button",{onClick:()=>C(t),className:`px-4 py-2 text-sm font-medium rounded-xl transition-all ${b===t?"btn-primary":"btn-secondary"}`,children:t==="all"?"All Time":t.toUpperCase()},t))})]}),e.jsxs(N.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"overflow-hidden glass-card",children:[e.jsx("div",{className:"relative z-10 overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsx("tr",{className:"border-b border-border/50",children:[{key:"rank",label:"Rank"},{key:"wallet",label:"Wallet"},{key:"volume",label:"Volume"},{key:"toolsCalls",label:"Tools Calls"},{key:"totalReward",label:"Total Reward"}].map(t=>e.jsx("th",{className:"px-6 py-4 text-xs font-medium text-left cursor-pointer text-muted-foreground hover:text-foreground",onClick:()=>w(t.key),children:e.jsxs("div",{className:"flex items-center gap-2",children:[t.label,e.jsx(M,{columnKey:t.key})]})},t.key))})}),e.jsx("tbody",{children:x?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-6 py-16 text-center text-muted-foreground",children:"Loading leaderboardâ¦"})}):g.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-6 py-16 text-center text-muted-foreground",children:"No entries found."})}):g.map((t,s)=>e.jsxs(N.tr,{initial:{opacity:0,x:-20}
6,animate:{opacity:1,x:0},transition:{delay:s*.05},className:"transition-colors border-b border-border/30 hover:bg-primary/5",children:[e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:"flex items-center gap-2",children:k(t.rank)})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"font-mono text-sm text-foreground",children:t.wallet})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm font-medium text-foreground",children:e.jsx($,{value:t.volume,prefix:"$",locale:!0})})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-foreground",children:e.jsx($,{value:t.toolsCalls,locale:!0})})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-primary",children:e.jsx($,{value:t.totalReward,prefix:"$",locale:!0})}),t.rank<=3&&e.jsx("span",{className:"px-2 py-1 text-xs rounded-full bg-primary/20 text-primary",children:R(t.rank)})]})})]},t.wallet))})]})}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 px-6 py-4 border-t border-border",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",(a-1)*h+1," to"," ",Math.min(a*h,j.length)," ","of ",j.length," entries"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>l(t=>Math.max(1,t-1)),disabled:a===1,className:"p-2 transition-colors rounded-xl border border-border bg-background/80 hover:bg-primary/10 disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(Y,{className:"w-5 h-5"})}),Array.from({length:Math.min(5,d)},(t,s)=>{let r;return d<=5||a<=3?r=s+1:a>=d-2?r=d-4+s:r=a-2+s,e.jsx("button",{onClick:()=>l(r),className:`min-w-[2.5rem] px-4 py-2 text-sm font-medium rounded-xl transition-all ${a===r?"btn-primary":"btn-secondary"}`,children:r},r)}),e.jsx("button",{onClick:()=>l(t=>Math.min(d,t+1)),disabled:a===d,className:"p-2 transition-colors rounded-xl border border-border bg-background/80 hover:bg-primary/10 disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(H,{className:"w-5 h-5"})})]})]})]})]})}),e.jsx(B,{})]})}export{ye as default};
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.