nielsr HF Staff commited on
Commit
2cdfd54
·
verified ·
1 Parent(s): 0dcc5bc

Sync paperswithcode.co frontend

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +3 -0
  2. assets/AiDeadlinesView-DK2uvcz2.js +3 -0
  3. assets/BenchmarkDetailView-7rgsFTuP.js +2 -0
  4. assets/BenchmarkDetailView-DEjvvzqE.js +0 -2
  5. assets/ClosedSourceEvalBadge-drWiTHYQ.js +1 -0
  6. assets/ConferenceDetailView-CDP-HF34.js +1 -0
  7. assets/ConferenceTaskView-B_-EGfGK.js +1 -0
  8. assets/ConferencesIndexView-D5iEQ6eX.js +1 -0
  9. assets/{CronDashboard-DHvNZD3_.js → CronDashboard-Cn-U_X_P.js} +2 -2
  10. assets/FeedView-DkQJBDx2.js +0 -1
  11. assets/FeedView-DwVPIvQN.js +1 -0
  12. assets/LatexTitle-ZrlO0rs7.js +1 -0
  13. assets/{MarkdownText-p29EEUf7.js → MarkdownText-trAzkiVz.js} +0 -0
  14. assets/MethodDetailView-Bqs-DuBu.js +0 -1
  15. assets/MethodDetailView-oq0vHvu5.js +1 -0
  16. assets/MethodsIndexView-CUF6j1AK.js +0 -1
  17. assets/MethodsIndexView-CrTfP50j.js +1 -0
  18. assets/{NotFound-C1sONCOd.js → NotFound-3lyVNVYr.js} +1 -1
  19. assets/OrganizationDetailView-CApb_ZqB.js +1 -0
  20. assets/OrganizationTaskView-YBSKDYqe.js +1 -0
  21. assets/OrganizationsIndexView-mPCmASS0.js +1 -0
  22. assets/PaperDetailView-BBf2E08f.js +0 -0
  23. assets/PaperDetailView-D3EhNQS9.js +47 -0
  24. assets/PapersListView-B62Ept_9.js +0 -1
  25. assets/PapersListView-b_LgTzEk.js +1 -0
  26. assets/SavedPapersView-BVm6geTt.js +0 -1
  27. assets/SavedPapersView-CJCobMQf.js +1 -0
  28. assets/SearchOverlay-BUaZzPoI.js +0 -1
  29. assets/SearchOverlay-D_x7sv0Q.js +1 -0
  30. assets/SettingsView-DDUVofcg.js +1 -0
  31. assets/SubmissionsDashboard-CBSTFtkY.js +11 -0
  32. assets/SubmissionsDashboard-CGUCxt6x.js +0 -11
  33. assets/SubmitView-BXVcNQUx.js +0 -1
  34. assets/SubmitView-DBn6RIiN.js +1 -0
  35. assets/TagBrowseView-BbO1OnLU.js +0 -1
  36. assets/TagBrowseView-Da16Rn5_.js +1 -0
  37. assets/TagsIndexView-BCN4pS2z.js +0 -1
  38. assets/TagsIndexView-BrKZEoUv.js +1 -0
  39. assets/adminAuth-PI_XkM8E.js +0 -1
  40. assets/alert-Ayuop_ag.js +1 -0
  41. assets/alert-MNWNJkBv.js +0 -1
  42. assets/api-DLAvdHPg.js +0 -1
  43. assets/{badge-CcpUgrz3.js → badge-CCpokg9G.js} +1 -1
  44. assets/components-CMH89RDy.js +0 -1
  45. assets/components-D244J_Aj.js +1 -0
  46. assets/dialog-DzRXUQ09.js +5 -0
  47. assets/index-B1pEvcfa.css +0 -0
  48. assets/index-BsV_WMf3.js +1 -0
  49. assets/index-C6O8_a1-.js +0 -0
  50. assets/index-D3-tYEe-.js +0 -0
.gitattributes CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ images/conferences/cvpr-2026.png filter=lfs diff=lfs merge=lfs -text
37
+ images/methods/vggt.png filter=lfs diff=lfs merge=lfs -text
38
+ images/tasks/image-super-resolution.png filter=lfs diff=lfs merge=lfs -text
assets/AiDeadlinesView-DK2uvcz2.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import{r as x,j as t,a as E}from"./index-D3-tYEe-.js";import{u as A}from"./useQuery-C6S8Ozku.js";import{S as B}from"./switch-9KW_DGK2.js";import{S as U}from"./skeleton-D0cyB03X.js";import{A as W,a as O}from"./alert-Ayuop_ag.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-DzRXUQ09.js";import"./index-BsV_WMf3.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),H=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(H).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),z=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},I=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>I(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=I(e);return a.length?a[a.length-1]:null},Q=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},X=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=z(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(`
2
+ `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),Z=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`;window.open(s,"_blank","noopener,noreferrer")},ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
3
+ `),g=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(g),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},te=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?I(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),g=e?z(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,p=s?new Date(s.deadline_at).getTime():null;return t.jsx(V,{open:a,onOpenChange:n,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(Y,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[g&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:g})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),p!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(p,r)},children:J(p,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,m)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,u=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(u?null:y,r)},children:X(y,r)})]},`${d.type??"deadline"}-${m}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},M=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ne=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),g=s?new Date(s.deadline_at).getTime():null,c=_(i?g:null,a),p=z(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:g!=null?Q(g,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[p&&t.jsx("span",{children:p}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(m=>{const y=n.has(m);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(m)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(m)},m)})})]})},ce=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,g]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),p=A({queryKey:["conference-deadlines"],queryFn:()=>E.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(u=>{const h=new Set(u);return h.has(l)?h.delete(l):h.add(l),h})},m=x.useMemo(()=>{var u;const l=new Map;return(u=p.data)==null||u.results.forEach(h=>{D(h).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((h,j)=>j[1]-h[1]).map(([h])=>h)},[p.data]),y=x.useMemo(()=>{var j;const u=(((j=p.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),h=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,w)=>{const v=h(f),N=h(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[p.data,e,n,o,c]);return p.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(O,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(M,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(M,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),m.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[m.map(l=>{const u=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:p.isLoading?"…":`${y.length} conferences`})}),p.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,u)=>t.jsx(U,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ne,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:g},l.id))}),t.jsx(te,{conf:s,open:s!==null,onOpenChange:l=>{l||g(null)}})]})};export{ce as default};
assets/BenchmarkDetailView-7rgsFTuP.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import{Z as st,u as at,a0 as it,r as _,j as s,L as Z,a6 as q,m as ct,$ as lt,a as ee}from"./index-D3-tYEe-.js";import{u as te}from"./useQuery-C6S8Ozku.js";import{S as he}from"./skeleton-D0cyB03X.js";import{A as ot,a as ut}from"./alert-Ayuop_ag.js";import{L as ce}from"./LatexTitle-ZrlO0rs7.js";import{I as dt}from"./components-D244J_Aj.js";import{C as mt}from"./ClosedSourceEvalBadge-drWiTHYQ.js";import"./katex.min-BSBacQyE.js";import"./transform-nNAikYlJ.js";function ht(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),t&&(n.href=t),i.href=e,i.href}const ft=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function P(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let O=null;function Ge(e={}){return O||(e.includeStyleProperties?(O=e.includeStyleProperties,O):(O=P(window.getComputedStyle(document.documentElement)),O))}function le(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function pt(e){const t=le(e,"border-left-width"),r=le(e,"border-right-width");return e.clientWidth+t+r}function gt(e){const t=le(e,"border-top-width"),r=le(e,"border-bottom-width");return e.clientHeight+t+r}function Qe(e,t={}){const r=t.width||pt(e),n=t.height||gt(e);return{width:r,height:n}}function yt(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const F=16384;function xt(e){(e.width>F||e.height>F)&&(e.width>F&&e.height>F?e.width>e.height?(e.height*=F/e.width,e.width=F):(e.width*=F/e.height,e.height=F):e.width>F?(e.height*=F/e.width,e.width=F):(e.width*=F/e.height,e.height=F))}function bt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const n=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),i=n.length,a=new Uint8Array(i);for(let c=0;c<i;c+=1)a[c]=n.charCodeAt(c);r(new Blob([a],{type:t.type?t.type:"image/png"}))})}function oe(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function wt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function vt(e,t,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),wt(i)}const M=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||M(r,t)};function jt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function St(e,t){return Ge(t).map(r=>{const n=e.getPropertyValue(r),i=e.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function kt(e,t,r,n){const i=`.${e}:${t}`,a=r.cssText?jt(r):St(r,n);return document.createTextNode(`${i}{${a}}`)}function Ie(e,t,r,n){const i=window.getComputedStyle(e,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const c=ft();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(kt(c,r,i,n)),t.appendChild(l)}function _t(e,t,r){Ie(e,t,":before",r),Ie(e,t,":after",r)}const Pe="application/font-woff",De="image/jpeg",Ct={woff:Pe,woff2:Pe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:De,jpeg:De,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Et(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function be(e){const t=Et(e).toLowerCase();return Ct[t]||""}function Rt(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function $t(e,t){return`data:${t};base64,${e}`}async function Xe(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((a,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{a(r({res:n,result:l.result}))}catch(d){c(d)}},l.readAsDataURL(i)})}const fe={};function Tt(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function we(e,t,r){const n=Tt(e,t,r.includeQueryParams);if(fe[n]!=null)return fe[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Xe(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Rt(l)));i=$t(a,t)}catch(a){i=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;a&&(c=typeof a=="string"?a:a.message),c&&console.warn(c)}return fe[n]=i,i}async function Mt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):oe(t)}async function Ft(e,t){if(e.currentSrc){const a=document.createElement("canvas"),c=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,c==null||c.drawImage(e,0,0,a.width,a.height);const l=a.toDataURL();return oe(l)}const r=e.poster,n=be(r),i=await we(r,n,t);return oe(i)}async function Lt(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await ue(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Nt(e,t){return M(e,HTMLCanvasElement)?Mt(e):M(e,HTMLVideoElement)?Ft(e,t):M(e,HTMLIFrameElement)?Lt(e,t):e.cloneNode(Je(e))}const At=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Je=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function It(e,t,r){var n,i;if(Je(t))return t;let a=[];return At(e)&&e.assignedNodes?a=P(e.assignedNodes()):M(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?a=P(e.contentDocument.body.childNodes):a=P(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||M(e,HTMLVideoElement)||await a.reduce((c,l)=>c.then(()=>ue(l,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function Pt(e,t,r){const n=t.style;if(!n)return;const i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):Ge(r).forEach(a=>{let c=i.getPropertyValue(a);a==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),M(e,HTMLIFrameElement)&&a==="display"&&c==="inline"&&(c="block"),a==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),n.setProperty(a,c,i.getPropertyPriority(a))})}function Dt(e,t){M(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),M(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Bt(e,t){if(M(e,HTMLSelectElement)){const r=t,n=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Ht(e,t,r){return M(t,Element)&&(Pt(e,t,r),_t(e,t,r),Dt(e,t),Bt(e,t)),t}async function Vt(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let a=0;a<r.length;a++){const l=r[a].getAttribute("xlink:href");if(l){const d=e.querySelector(l),y=document.querySelector(l);!d&&y&&!n[l]&&(n[l]=await ue(y,t,!0))}}const i=Object.values(n);if(i.length){const a="http://www.w3.org/1999/xhtml",c=document.createElementNS(a,"svg");c.setAttribute("xmlns",a),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const l=document.createElementNS(a,"defs");c.appendChild(l);for(let d=0;d<i.length;d++)l.appendChild(i[d]);e.appendChild(c)}return e}async function ue(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>Nt(n,t)).then(n=>It(e,n,t)).then(n=>Ht(e,n,t)).then(n=>Vt(n,t))}const Ye=/url\((['"]?)([^'"]+?)\1\)/g,Ut=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Ot=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Wt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function qt(e){const t=[];return e.replace(Ye,(r,n,i)=>(t.push(i),r)),t.filter(r=>!xe(r))}async function zt(e,t,r,n,i){try{const a=r?ht(t,r):t,c=be(t);let l;return i||(l=await we(a,c,n)),e.replace(Wt(t),`$1${l}$3`)}catch{}return e}function Kt(e,{preferredFontFormat:t}){return t?e.replace(Ot,r=>{for(;;){const[n,,i]=Ut.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function Ze(e){return e.search(Ye)!==-1}async function et(e,t,r){if(!Ze(e))return e;const n=Kt(e,r);return qt(n).reduce((a,c)=>a.then(l=>zt(l,c,t,r)),Promise.resolve(n))}async function W(e,t,r){var n;const i=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(i){const a=await et(i,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function Gt(e,t){await W("background",e,t)||await W("background-image",e,t),await W("mask",e,t)||await W("-webkit-mask",e,t)||await W("mask-image",e,t)||await W("-webkit-mask-image",e,t)}async function Qt(e,t){const r=M(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(M(e,SVGImageElement)&&!xe(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,i=await we(n,be(n),t);await new Promise((a,c)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...d)=>{try{a(t.onImageErrorHandler(...d))}catch(y){c(y)}}:c;const l=e;l.decode&&(l.decode=a),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function Xt(e,t){const n=P(e.childNodes).map(i=>tt(i,t));await Promise.all(n).then(()=>e)}async function tt(e,t){M(e,Element)&&(await Gt(e,t),await Qt(e,t),await Xt(e,t))}function Jt(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),e}const Be={};async function He(e){let t=Be[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Be[e]=t,t}async function Ve(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(n,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),Xe(l,t.fetchRequestInit,({result:d})=>(r=r.replace(c,`url(${d})`),[c,d]))});return Promise.all(a).then(()=>r)}function Ue(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=i.exec(n);if(d===null)break;t.push(d[0])}n=n.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let d=a.exec(n);if(d===null){if(d=l.exec(n),d===null)break;a.lastIndex=l.lastIndex}else l.lastIndex=a.lastIndex;t.push(d[0])}return t}async function Yt(e,t){const r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{P(i.cssRules||[]).forEach((a,c)=>{if(a.type===CSSRule.IMPORT_RULE){let l=c+1;const d=a.href,y=He(d).then(m=>Ve(m,t)).then(m=>Ue(m).forEach(p=>{try{i.insertRule(p,p.startsWith("@import")?l+=1:i.cssRules.length)}catch(j){console.error("Error inserting rule from remote css",{rule:p,error:j})}})).catch(m=>{console.error("Error loading remote css",m.toString())});n.push(y)}})}catch(a){const c=e.find(l=>l.href==null)||document.styleSheets[0];i.href!=null&&n.push(He(i.href).then(l=>Ve(l,t)).then(l=>Ue(l).forEach(d=>{c.insertRule(d,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(e.forEach(i=>{if("cssRules"in i)try{P(i.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),r))}function Zt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ze(t.style.getPropertyValue("src")))}async function er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=P(e.ownerDocument.styleSheets),n=await Yt(r,t);return Zt(n)}function rt(e){return e.trim().replace(/["']/g,"")}function tr(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{t.add(rt(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function rr(e,t){const r=await er(e,t),n=tr(e);return(await Promise.all(r.filter(a=>n.has(rt(a.style.fontFamily))).map(a=>{const c=a.parentStyleSheet?a.parentStyleSheet.href:null;return et(a.cssText,c,t)}))).join(`
2
+ `)}async function nr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await rr(e,t);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function sr(e,t={}){const{width:r,height:n}=Qe(e,t),i=await ue(e,t,!0);return await nr(i,t),await tt(i,t),Jt(i,t),await vt(i,r,n)}async function ar(e,t={}){const{width:r,height:n}=Qe(e,t),i=await sr(e,t),a=await oe(i),c=document.createElement("canvas"),l=c.getContext("2d"),d=t.pixelRatio||yt(),y=t.canvasWidth||r,m=t.canvasHeight||n;return c.width=y*d,c.height=m*d,t.skipAutoScale||xt(c),c.style.width=`${y}`,c.style.height=`${m}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(a,0,0,c.width,c.height),c}async function ir(e,t={}){const r=await ar(e,t);return await bt(r)}const Oe="#ffffff";function cr(e){if(typeof window>"u")return Oe;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Oe:t}async function lr(e){var r,n;if(typeof window>"u"||!((n=(r=window.navigator)==null?void 0:r.clipboard)!=null&&n.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await ir(e,{pixelRatio:2,cacheBust:!0,backgroundColor:cr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const pe=5;function or(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const n=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(n==null?void 0:n[1])??null}function ie(e,t){return e?s.jsx(ce,{title:e}):t||"—"}function We(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ye(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function ur(e,t){if(e===t){const{year:d,month:y}=ye(e);return[{timestamp:new Date(d,y,1).getTime(),key:`${d}-${y}`,label:`${ge[y]} ${d}`}]}const r=ye(e),n=ye(t);if(r.year===n.year){const d=n.month-r.month+1;let y=1;const m=12;d>m&&(y=Math.ceil(d/m));const p=[];for(let j=r.month;j<=n.month;j+=y)p.push({timestamp:new Date(r.year,j,1).getTime(),key:`${r.year}-${j}`,label:d<=3?`${ge[j]} ${r.year}`:ge[j]});return p}const i=n.year-r.year+1;let a=1;const c=12;i>c&&(a=Math.ceil(i/c));const l=[];for(let d=r.year;d<=n.year;d+=a)l.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return l}const dr=({points:e,metric:t})=>{const r=lt(),[n,i]=_.useState(null),a=880,c=320,l=60,d=30,y=24,m=50,p=e.map(o=>o.value),j=Math.min(...p),ne=Math.max(...p)-j||1,L=a-l-d,D=c-y-m,z=e.map(o=>We(o.date)),T=Math.min(...z),K=Math.max(...z),V=K-T||1,C=o=>T===K?l+L/2:l+(o-T)/V*L,U=e.map((o,h)=>{const E=C(We(o.date)),R=(o.value-j)/ne,b=y+D*(1-R);return{x:E,y:b,data:o,idx:h}}),x=U.filter(o=>o.data.isSota);let G="";if(x.length>=2){G=`M${x[0].x},${x[0].y}`;for(let o=1;o<x.length;o++){const h=x[o-1],E=x[o],R=(h.x+E.x)/2;G+=` C${R},${h.y} ${R},${E.y} ${E.x},${E.y}`}}const B=ur(T,K),Q=5,X=o=>i(h=>h===o?null:h),se=o=>{o&&r(`/paper/${o}`)},J=(o,h)=>{const R=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${q(o.data.value)} on ${o.data.dateLabel}`,b=!!o.data.paperRouteId;return s.jsxs("g",{children:[h,s.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:b?"pointer":"default",outline:"none"},tabIndex:0,role:b?"link":"img","aria-label":R,onMouseEnter:()=>i(o.idx),onMouseLeave:()=>X(o.idx),onFocus:()=>i(o.idx),onBlur:()=>X(o.idx),onClick:()=>se(o.data.paperRouteId),onKeyDown:w=>{b&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),se(o.data.paperRouteId))},children:s.jsx("title",{children:R})})]},o.idx)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${a} ${c}`,style:{display:"block"},children:[s.jsx("text",{x:l-38,y:y+D/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${y+D/2})`,children:t}),Array.from({length:Q}).map((o,h)=>{const E=h/(Q-1),R=y+D*(1-E),b=j+ne*E;return s.jsxs("g",{children:[s.jsx("line",{x1:l,y1:R,x2:a-d,y2:R,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:l-10,y:R+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:q(b)})]},h)}),B.map(o=>{const h=C(o.timestamp);return s.jsx("text",{x:h,y:c-m+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),U.filter(o=>!o.data.isSota).map(o=>{const h=n===o.idx;return J(o,s.jsx("circle",{cx:o.x,cy:o.y,r:h?4:2.5,fill:"var(--ink-faint)",opacity:h?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),G&&s.jsx("path",{d:G,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),x.map(o=>{const h=n===o.idx;return J(o,s.jsx("circle",{cx:o.x,cy:o.y,r:h?6:4.5,fill:h?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),n!==null&&U[n]&&(()=>{const o=U[n],h=o.data.modelName||o.data.paperTitle||"Unknown model",E=h.length>40?h.slice(0,39)+"…":h,R=`${q(o.data.value)} · ${o.data.dateLabel}`,w=Math.max(140,Math.min(320,Math.max(E.length,R.length)*6.6+24)),N=46;let $=o.x-w/2;$<l&&($=l),$+w>a-d&&($=a-d-w);const Y=o.y-N-14>=y?o.y-N-12:o.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:$,y:Y,width:w,height:N,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),s.jsx("text",{x:$+12,y:Y+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:E}),s.jsx("text",{x:$+12,y:Y+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:R})]})})()]})};function re(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function mr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function hr(e){const t=new Map;for(const r of e){const n=mr(r),i=t.get(n);if(!i){t.set(n,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}i.metrics={...i.metrics,...r.metrics||{}},i.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(i.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function qe(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ze(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function fr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const n=e.map(m=>{var I;const p=re((I=m.metrics)==null?void 0:I[t]),j=m.paper_published_date||"";return{eval:m,value:p,date:j}}).filter(m=>m.value!==null&&!!m.date).sort((m,p)=>m.date.localeCompare(p.date)),i=[];let a=null;for(const m of n){const p=a==null?!0:r==="↓"?m.value<a:m.value>a;p&&(a=m.value),i.push({value:m.value,date:m.date,dateLabel:m.date.slice(0,7),modelName:m.eval.model_name||"",paperTitle:m.eval.paper_title||"",paperRouteId:m.eval.paper_arxiv_id||m.eval.paper_id||null,isSota:p})}const l=e.map(m=>{var p;return{eval:m,value:re((p=m.metrics)==null?void 0:p[t])}}).filter(m=>m.value!==null).sort((m,p)=>r==="↓"?m.value-p.value:p.value-m.value)[0],d=(l==null?void 0:l.value)??0,y=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:i,sota:d,sotaModel:y}}const Ke=({targetRef:e,label:t})=>{const{toast:r}=ct(),[n,i]=_.useState("idle"),a=_.useRef(null);_.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]);const c=_.useCallback(async()=>{const d=e.current;if(d){i("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(y=>window.requestAnimationFrame(()=>y()));try{await lr(d),i("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>i("idle"),1500)}catch(y){i("idle"),r({title:"Copy failed",description:y instanceof Error&&y.message?y.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),l=n==="copied"?"Copied":n==="copying"?"Copying…":"Copy image";return s.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:n==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[s.jsx(dt,{name:"copy",size:11}),l]})},kr=()=>{var ve,je,Se,ke,_e,Ce,Ee,Re,$e,Te;const{datasetSlug:e}=st(),[t]=at(),r=t.get("task")||void 0,n=t.get("eval")||void 0,{preferences:i}=it(),[a,c]=_.useState(void 0),l=_.useRef(null),d=_.useRef(!1),y=_.useRef(null),m=_.useRef(null),p=te({queryKey:["dataset",e,"with-paper"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0}),enabled:!!e,staleTime:10*60*1e3}),j=te({queryKey:["dataset-evals",(ve=p.data)==null?void 0:ve.id],queryFn:()=>ee.getEvaluationsByDataset(p.data.id),enabled:!!((je=p.data)!=null&&je.id),staleTime:5*60*1e3}),I=te({queryKey:["dataset-tasks",(Se=p.data)==null?void 0:Se.id],queryFn:()=>ee.getDatasetTasks(p.data.id),enabled:!!((ke=p.data)!=null&&ke.id),staleTime:10*60*1e3}),ne=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=_.useMemo(()=>{const u=I.data||[];if(u.length===0)return null;if(r){const f=u.find(S=>S.slug===r);if(f)return f.id}if(u.length===1)return u[0].id;const g=j.data||[];if(g.length>0){const f=new Map;for(const v of g)f.set(v.task_id,(f.get(v.task_id)||0)+1);let S=null,k=-1;for(const v of u){const A=f.get(v.id)||0;A>k&&(k=A,S=v.id)}if(S)return S}return u[0].id},[I.data,j.data,r]),D=te({queryKey:["leaderboard-metrics",(_e=p.data)==null?void 0:_e.id,L],queryFn:()=>ee.getLeaderboardMetrics(p.data.id,L),enabled:!!((Ce=p.data)!=null&&Ce.id)&&!!L,staleTime:10*60*1e3}),z=_.useMemo(()=>{let u=j.data||[];return i.hide_closed_source_evals&&(u=u.filter(g=>g.is_open!==!1)),L?u.filter(g=>g.task_id===L):u},[j.data,L,i.hide_closed_source_evals]),T=_.useMemo(()=>hr(z),[z]),K=_.useMemo(()=>{const u=new Set;return T.forEach(g=>{g.best_metric&&u.add(g.best_metric),Object.keys(g.metrics||{}).forEach(f=>u.add(f))}),Array.from(u)},[T]),V=_.useMemo(()=>(D.data||[]).map(u=>u.metric_name),[D.data]),C=V.length?V:K,U=_.useMemo(()=>{var S;if(T.length===0)return C[0]||"";const u=new Map;for(const k of T)for(const v of Object.keys(k.metrics||{}))V.length&&!C.includes(v)||u.set(v,(u.get(v)||0)+1);let g=null,f=0;for(const[k,v]of u)v>f&&(f=v,g=k);return g||C[0]||((S=T[0])==null?void 0:S.best_metric)||""},[T,C,V]),x=a||U,B=(((Re=(Ee=ne.data)==null?void 0:Ee.directions)==null?void 0:Re[x])||"higher_is_better")==="lower_is_better"?"↓":"↑",Q=_.useMemo(()=>{if(C.length===0)return x?[x]:[];if(C.length<=pe)return C;const u=[],g=x&&C.includes(x),f=g?pe-1:pe;let S=0;for(const k of C)k!==x&&(S>=f||(u.push(k),S++));if(g){const k=C.findIndex(A=>A===x),v=C.slice(0,k).filter(A=>u.includes(A)).length;u.splice(v,0,x)}return u},[C,x]),{points:X,sota:se,sotaModel:J}=_.useMemo(()=>fr(T,x,B),[T,x,B]);_.useEffect(()=>{if(d.current||!n||!j.data||j.data.length===0)return;const u=l.current;u&&(d.current=!0,u.scrollIntoView({behavior:"smooth",block:"start"}))},[n,j.data]);const o=_.useMemo(()=>{const u=I.data||[];return L?u.find(g=>g.id===L)||u[0]||null:u[0]||null},[I.data,L]);if(p.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(he,{className:"h-12 w-1/2 mb-6"}),s.jsx(he,{className:"h-64 w-full"})]});if(p.error||!p.data)return s.jsx("div",{className:"page",children:s.jsx(ot,{variant:"destructive",children:s.jsx(ut,{children:"Benchmark not found."})})});const h=p.data,E=T.slice().sort((u,g)=>{var k,v;const f=re((k=u.metrics)==null?void 0:k[x]),S=re((v=g.metrics)==null?void 0:v[x]);return f!==null&&S!==null?B==="↓"?f-S:S-f:f!==null?-1:S!==null?1:ze(u,x)-ze(g,x)}),R=!!h.supports_harness,b=n&&E.find(u=>qe(u,n))||null,w=h.introducing_paper??void 0,N=(w==null?void 0:w.arxiv_id)||(w==null?void 0:w.id)||or(h.paper_url),$=(w==null?void 0:w.title)||h.introducing_paper_title||null,H=(($e=w==null?void 0:w.published)==null?void 0:$e.slice(0,4))||h.introduced_year||null,Y=!!N||!!h.paper_url||!!$,nt=w!=null&&w.arxiv_id||(Te=h.paper_url)!=null&&Te.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${N}`:`Paper ${N}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(Z,{to:"/tasks",children:"Tasks"}),o&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(Z,{to:`/tasks/${o.slug||o.id}`,children:o.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:h.name})]}),s.jsx("h1",{className:"bm-title",children:h.name}),s.jsxs("div",{className:"bm-subtitle",style:{display:"flex",alignItems:"center",gap:16,flexWrap:"wrap"},children:[s.jsxs("span",{children:[x&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:x}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),J?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:q(se)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:J})]}):s.jsxs("span",{children:[E.length," evaluations"]})]}),h.hf_url&&s.jsxs("a",{className:"bm-action-btn",href:h.hf_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),h.description&&s.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:h.description}),Y&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),N?s.jsxs(Z,{to:`/paper/${N}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:$?s.jsx(ce,{title:$}):nt}),H&&s.jsx("span",{className:"method-source-meta",children:H})]}):h.paper_url?s.jsxs("a",{href:h.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:$?s.jsx(ce,{title:$}):h.paper_url}),H&&s.jsx("span",{className:"method-source-meta",children:H})]}):s.jsxs("div",{className:"method-source-link is-static",children:[s.jsx("span",{className:"method-source-title",children:$?s.jsx(ce,{title:$}):null}),H&&s.jsx("span",{className:"method-source-meta",children:H})]})]}),X.filter(u=>u.isSota).length>=2&&s.jsxs("div",{className:"bm-card",ref:y,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:h.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),s.jsxs("div",{className:"bm-card-actions",children:[C.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:x,onChange:u=>c(u.target.value),children:C.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(Ke,{targetRef:y,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(dr,{points:X,metric:x})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),b&&(()=>{var k,v;const u=b.paper_arxiv_id||b.paper_id,g=b.paper_title||(b.paper_arxiv_id?`arXiv:${b.paper_arxiv_id}`:null),f=b.best_metric&&((k=b.metrics)==null?void 0:k[b.best_metric])!==void 0?b.best_metric:x,S=(v=b.metrics)==null?void 0:v[f];return s.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[s.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),s.jsxs("div",{className:"bm-highlight-text",children:[s.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),s.jsxs("span",{className:"bm-highlight-paper",children:[b.model_name||g||"—",b.harness?` · ${b.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&f?s.jsxs(s.Fragment,{children:[f,": ",q(S),g?" · ":""]}):null,u?s.jsx(Z,{to:`/paper/${u}`,children:ie(b.paper_title,g)}):ie(b.paper_title,g)]})]})]})})(),s.jsxs("div",{className:"bm-card",ref:m,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:h.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),s.jsxs("div",{className:"bm-card-actions",children:[C.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:x,onChange:u=>c(u.target.value),children:C.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(Ke,{targetRef:m,label:"leaderboard"})]})]}),j.isLoading?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((u,g)=>s.jsx(he,{className:"h-10 w-full mb-2"},g))}):E.length===0?s.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):s.jsxs("table",{className:"bm-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"col-rank",children:"Rank"}),s.jsx("th",{className:"col-model",children:"Model"}),R&&s.jsx("th",{className:"col-harness",children:"Harness"}),Q.map(u=>{const g=u===x;return s.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?B==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>c(u),"aria-pressed":g,title:`Sort by ${u}`,children:[u,g?` ${B}`:""]})},u)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let u=null,g=0;return E.map((f,S)=>{var Fe,Le;const k=re((Fe=f.metrics)==null?void 0:Fe[x]);let v=null;k!==null&&((u===null||k!==u)&&(g=S+1,u=k),v=g);const A=f.paper_arxiv_id||f.paper_id,Me=f.paper_title||(f.paper_arxiv_id?`arXiv:${f.paper_arxiv_id}`:null),de=qe(f,n);return s.jsxs("tr",{ref:de?l:void 0,className:de?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:v??"—"}),s.jsxs("td",{className:"col-model",children:[de&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),f.model_name||"—",f.is_open===!1&&s.jsx(mt,{})]}),R&&s.jsx("td",{className:"col-harness",children:f.harness||"—"}),Q.map(me=>{var Ae;const Ne=me===x,ae=(Ae=f.metrics)==null?void 0:Ae[me];return s.jsx("td",{className:`col-value${Ne?" is-active":""}${Ne&&v===1?" is-best":""}`,children:ae!=null&&ae!==""?q(ae):"—"},me)}),s.jsx("td",{className:"col-paper",children:A?s.jsx(Z,{to:`/paper/${A}`,children:ie(f.paper_title,Me)}):ie(f.paper_title,Me)}),s.jsx("td",{className:"col-year",children:((Le=f.paper_published_date)==null?void 0:Le.slice(0,4))||"—"})]},f.id)})})()})]})]})]})})};export{kr as default};
assets/BenchmarkDetailView-DEjvvzqE.js DELETED
@@ -1,2 +0,0 @@
1
- import{E as rt,u as nt,r as k,j as s,L as J,N as q,q as st,G as at}from"./index-C6O8_a1-.js";import{u as Y}from"./useQuery-Cvv958Kx.js";import{a as Z}from"./api-DLAvdHPg.js";import{S as ue}from"./skeleton-D8Wtx_Nu.js";import{A as it,a as ct}from"./alert-MNWNJkBv.js";import{L as de}from"./LatexTitle-CcMIi9G1.js";import{I as ot}from"./components-CMH89RDy.js";import"./adminAuth-PI_XkM8E.js";import"./transform-D_Izdf89.js";function lt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),t&&(n.href=t),i.href=e,i.href}const ut=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function B(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let O=null;function Ge(e={}){return O||(e.includeStyleProperties?(O=e.includeStyleProperties,O):(O=B(window.getComputedStyle(document.documentElement)),O))}function ae(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function dt(e){const t=ae(e,"border-left-width"),r=ae(e,"border-right-width");return e.clientWidth+t+r}function mt(e){const t=ae(e,"border-top-width"),r=ae(e,"border-bottom-width");return e.clientHeight+t+r}function Ke(e,t={}){const r=t.width||dt(e),n=t.height||mt(e);return{width:r,height:n}}function ht(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const M=16384;function ft(e){(e.width>M||e.height>M)&&(e.width>M&&e.height>M?e.width>e.height?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M):e.width>M?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M))}function pt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const n=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),i=n.length,a=new Uint8Array(i);for(let c=0;c<i;c+=1)a[c]=n.charCodeAt(c);r(new Blob([a],{type:t.type?t.type:"image/png"}))})}function ie(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function gt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function yt(e,t,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),gt(i)}const T=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||T(r,t)};function xt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function bt(e,t){return Ge(t).map(r=>{const n=e.getPropertyValue(r),i=e.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function wt(e,t,r,n){const i=`.${e}:${t}`,a=r.cssText?xt(r):bt(r,n);return document.createTextNode(`${i}{${a}}`)}function Ae(e,t,r,n){const i=window.getComputedStyle(e,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const c=ut();try{t.className=`${t.className} ${c}`}catch{return}const o=document.createElement("style");o.appendChild(wt(c,r,i,n)),t.appendChild(o)}function vt(e,t,r){Ae(e,t,":before",r),Ae(e,t,":after",r)}const Ie="application/font-woff",Pe="image/jpeg",jt={woff:Ie,woff2:Ie,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Pe,jpeg:Pe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function St(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=St(e).toLowerCase();return jt[t]||""}function kt(e){return e.split(/,/)[1]}function ge(e){return e.search(/^(data:)/)!==-1}function Ct(e,t){return`data:${t};base64,${e}`}async function Qe(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((a,c)=>{const o=new FileReader;o.onerror=c,o.onloadend=()=>{try{a(r({res:n,result:o.result}))}catch(d){c(d)}},o.readAsDataURL(i)})}const me={};function Et(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function xe(e,t,r){const n=Et(e,t,r.includeQueryParams);if(me[n]!=null)return me[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Qe(e,r.fetchRequestInit,({res:c,result:o})=>(t||(t=c.headers.get("Content-Type")||""),kt(o)));i=Ct(a,t)}catch(a){i=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;a&&(c=typeof a=="string"?a:a.message),c&&console.warn(c)}return me[n]=i,i}async function _t(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ie(t)}async function Rt(e,t){if(e.currentSrc){const a=document.createElement("canvas"),c=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,c==null||c.drawImage(e,0,0,a.width,a.height);const o=a.toDataURL();return ie(o)}const r=e.poster,n=ye(r),i=await xe(r,n,t);return ie(i)}async function $t(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await ce(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Tt(e,t){return T(e,HTMLCanvasElement)?_t(e):T(e,HTMLVideoElement)?Rt(e,t):T(e,HTMLIFrameElement)?$t(e,t):e.cloneNode(Xe(e))}const Mt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Xe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Ft(e,t,r){var n,i;if(Xe(t))return t;let a=[];return Mt(e)&&e.assignedNodes?a=B(e.assignedNodes()):T(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?a=B(e.contentDocument.body.childNodes):a=B(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||T(e,HTMLVideoElement)||await a.reduce((c,o)=>c.then(()=>ce(o,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function Nt(e,t,r){const n=t.style;if(!n)return;const i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):Ge(r).forEach(a=>{let c=i.getPropertyValue(a);a==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),T(e,HTMLIFrameElement)&&a==="display"&&c==="inline"&&(c="block"),a==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),n.setProperty(a,c,i.getPropertyPriority(a))})}function Lt(e,t){T(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),T(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function At(e,t){if(T(e,HTMLSelectElement)){const r=t,n=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function It(e,t,r){return T(t,Element)&&(Nt(e,t,r),vt(e,t,r),Lt(e,t),At(e,t)),t}async function Pt(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let a=0;a<r.length;a++){const o=r[a].getAttribute("xlink:href");if(o){const d=e.querySelector(o),p=document.querySelector(o);!d&&p&&!n[o]&&(n[o]=await ce(p,t,!0))}}const i=Object.values(n);if(i.length){const a="http://www.w3.org/1999/xhtml",c=document.createElementNS(a,"svg");c.setAttribute("xmlns",a),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const o=document.createElementNS(a,"defs");c.appendChild(o);for(let d=0;d<i.length;d++)o.appendChild(i[d]);e.appendChild(c)}return e}async function ce(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>Tt(n,t)).then(n=>Ft(e,n,t)).then(n=>It(e,n,t)).then(n=>Pt(n,t))}const Je=/url\((['"]?)([^'"]+?)\1\)/g,Dt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Bt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Ht(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Vt(e){const t=[];return e.replace(Je,(r,n,i)=>(t.push(i),r)),t.filter(r=>!ge(r))}async function Ut(e,t,r,n,i){try{const a=r?lt(t,r):t,c=ye(t);let o;return i||(o=await xe(a,c,n)),e.replace(Ht(t),`$1${o}$3`)}catch{}return e}function Ot(e,{preferredFontFormat:t}){return t?e.replace(Bt,r=>{for(;;){const[n,,i]=Dt.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function Ye(e){return e.search(Je)!==-1}async function Ze(e,t,r){if(!Ye(e))return e;const n=Ot(e,r);return Vt(n).reduce((a,c)=>a.then(o=>Ut(o,c,t,r)),Promise.resolve(n))}async function W(e,t,r){var n;const i=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(i){const a=await Ze(i,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function Wt(e,t){await W("background",e,t)||await W("background-image",e,t),await W("mask",e,t)||await W("-webkit-mask",e,t)||await W("mask-image",e,t)||await W("-webkit-mask-image",e,t)}async function qt(e,t){const r=T(e,HTMLImageElement);if(!(r&&!ge(e.src))&&!(T(e,SVGImageElement)&&!ge(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,i=await xe(n,ye(n),t);await new Promise((a,c)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...d)=>{try{a(t.onImageErrorHandler(...d))}catch(p){c(p)}}:c;const o=e;o.decode&&(o.decode=a),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function zt(e,t){const n=B(e.childNodes).map(i=>et(i,t));await Promise.all(n).then(()=>e)}async function et(e,t){T(e,Element)&&(await Wt(e,t),await qt(e,t),await zt(e,t))}function Gt(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),e}const De={};async function Be(e){let t=De[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},De[e]=t,t}async function He(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let o=c.replace(n,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Qe(o,t.fetchRequestInit,({result:d})=>(r=r.replace(c,`url(${d})`),[c,d]))});return Promise.all(a).then(()=>r)}function Ve(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=i.exec(n);if(d===null)break;t.push(d[0])}n=n.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(c,"gi");for(;;){let d=a.exec(n);if(d===null){if(d=o.exec(n),d===null)break;a.lastIndex=o.lastIndex}else o.lastIndex=a.lastIndex;t.push(d[0])}return t}async function Kt(e,t){const r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{B(i.cssRules||[]).forEach((a,c)=>{if(a.type===CSSRule.IMPORT_RULE){let o=c+1;const d=a.href,p=Be(d).then(m=>He(m,t)).then(m=>Ve(m).forEach(g=>{try{i.insertRule(g,g.startsWith("@import")?o+=1:i.cssRules.length)}catch(C){console.error("Error inserting rule from remote css",{rule:g,error:C})}})).catch(m=>{console.error("Error loading remote css",m.toString())});n.push(p)}})}catch(a){const c=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&n.push(Be(i.href).then(o=>He(o,t)).then(o=>Ve(o).forEach(d=>{c.insertRule(d,c.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(e.forEach(i=>{if("cssRules"in i)try{B(i.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),r))}function Qt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ye(t.style.getPropertyValue("src")))}async function Xt(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=B(e.ownerDocument.styleSheets),n=await Kt(r,t);return Qt(n)}function tt(e){return e.trim().replace(/["']/g,"")}function Jt(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{t.add(tt(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function Yt(e,t){const r=await Xt(e,t),n=Jt(e);return(await Promise.all(r.filter(a=>n.has(tt(a.style.fontFamily))).map(a=>{const c=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ze(a.cssText,c,t)}))).join(`
2
- `)}async function Zt(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Yt(e,t);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function er(e,t={}){const{width:r,height:n}=Ke(e,t),i=await ce(e,t,!0);return await Zt(i,t),await et(i,t),Gt(i,t),await yt(i,r,n)}async function tr(e,t={}){const{width:r,height:n}=Ke(e,t),i=await er(e,t),a=await ie(i),c=document.createElement("canvas"),o=c.getContext("2d"),d=t.pixelRatio||ht(),p=t.canvasWidth||r,m=t.canvasHeight||n;return c.width=p*d,c.height=m*d,t.skipAutoScale||ft(c),c.style.width=`${p}`,c.style.height=`${m}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,c.width,c.height)),o.drawImage(a,0,0,c.width,c.height),c}async function rr(e,t={}){const r=await tr(e,t);return await pt(r)}const Ue="#ffffff";function nr(e){if(typeof window>"u")return Ue;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Ue:t}async function sr(e){var r,n;if(typeof window>"u"||!((n=(r=window.navigator)==null?void 0:r.clipboard)!=null&&n.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await rr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:nr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const he=5;function ar(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const n=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(n==null?void 0:n[1])??null}function Oe(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const fe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function ir(e,t){if(e===t){const{year:d,month:p}=pe(e);return[{timestamp:new Date(d,p,1).getTime(),key:`${d}-${p}`,label:`${fe[p]} ${d}`}]}const r=pe(e),n=pe(t);if(r.year===n.year){const d=n.month-r.month+1;let p=1;const m=12;d>m&&(p=Math.ceil(d/m));const g=[];for(let C=r.month;C<=n.month;C+=p)g.push({timestamp:new Date(r.year,C,1).getTime(),key:`${r.year}-${C}`,label:d<=3?`${fe[C]} ${r.year}`:fe[C]});return g}const i=n.year-r.year+1;let a=1;const c=12;i>c&&(a=Math.ceil(i/c));const o=[];for(let d=r.year;d<=n.year;d+=a)o.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return o}const cr=({points:e,metric:t})=>{const r=at(),[n,i]=k.useState(null),a=880,c=320,o=60,d=30,p=24,m=50,g=e.map(l=>l.value),C=Math.min(...g),F=Math.max(...g)-C||1,G=a-o-d,H=c-p-m,N=e.map(l=>Oe(l.date)),U=Math.min(...N),P=Math.max(...N),E=P-U||1,te=l=>U===P?o+G/2:o+(l-U)/E*G,y=e.map((l,x)=>{const _=te(Oe(l.date)),b=(l.value-C)/F,w=p+H*(1-b);return{x:_,y:w,data:l,idx:x}}),D=y.filter(l=>l.data.isSota);let A="";if(D.length>=2){A=`M${D[0].x},${D[0].y}`;for(let l=1;l<D.length;l++){const x=D[l-1],_=D[l],b=(x.x+_.x)/2;A+=` C${b},${x.y} ${b},${_.y} ${_.x},${_.y}`}}const re=ir(U,P),K=5,ne=l=>i(x=>x===l?null:x),Q=l=>{l&&r(`/paper/${l}`)},V=(l,x)=>{const b=`${l.data.modelName||l.data.paperTitle||"Unknown model"}: ${q(l.data.value)} on ${l.data.dateLabel}`,w=!!l.data.paperRouteId;return s.jsxs("g",{children:[x,s.jsx("circle",{cx:l.x,cy:l.y,r:"10",fill:"transparent",style:{cursor:w?"pointer":"default",outline:"none"},tabIndex:0,role:w?"link":"img","aria-label":b,onMouseEnter:()=>i(l.idx),onMouseLeave:()=>ne(l.idx),onFocus:()=>i(l.idx),onBlur:()=>ne(l.idx),onClick:()=>Q(l.data.paperRouteId),onKeyDown:R=>{w&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),Q(l.data.paperRouteId))},children:s.jsx("title",{children:b})})]},l.idx)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${a} ${c}`,style:{display:"block"},children:[s.jsx("text",{x:o-38,y:p+H/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${p+H/2})`,children:t}),Array.from({length:K}).map((l,x)=>{const _=x/(K-1),b=p+H*(1-_),w=C+F*_;return s.jsxs("g",{children:[s.jsx("line",{x1:o,y1:b,x2:a-d,y2:b,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:o-10,y:b+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:q(w)})]},x)}),re.map(l=>{const x=te(l.timestamp);return s.jsx("text",{x,y:c-m+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:l.label},l.key)}),y.filter(l=>!l.data.isSota).map(l=>{const x=n===l.idx;return V(l,s.jsx("circle",{cx:l.x,cy:l.y,r:x?4:2.5,fill:"var(--ink-faint)",opacity:x?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),A&&s.jsx("path",{d:A,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),D.map(l=>{const x=n===l.idx;return V(l,s.jsx("circle",{cx:l.x,cy:l.y,r:x?6:4.5,fill:x?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),n!==null&&y[n]&&(()=>{const l=y[n],x=l.data.modelName||l.data.paperTitle||"Unknown model",_=x.length>40?x.slice(0,39)+"…":x,b=`${q(l.data.value)} · ${l.data.dateLabel}`,R=Math.max(140,Math.min(320,Math.max(_.length,b.length)*6.6+24)),L=46;let $=l.x-R/2;$<o&&($=o),$+R>a-d&&($=a-d-R);const X=l.y-L-14>=p?l.y-L-12:l.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:$,y:X,width:R,height:L,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),s.jsx("text",{x:$+12,y:X+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:_}),s.jsx("text",{x:$+12,y:X+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:b})]})})()]})};function ee(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function or(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function lr(e){const t=new Map;for(const r of e){const n=or(r),i=t.get(n);if(!i){t.set(n,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}i.metrics={...i.metrics,...r.metrics||{}},i.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(i.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function We(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function qe(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function ur(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const n=e.map(m=>{var z;const g=ee((z=m.metrics)==null?void 0:z[t]),C=m.paper_published_date||"";return{eval:m,value:g,date:C}}).filter(m=>m.value!==null&&!!m.date).sort((m,g)=>m.date.localeCompare(g.date)),i=[];let a=null;for(const m of n){const g=a==null?!0:r==="↓"?m.value<a:m.value>a;g&&(a=m.value),i.push({value:m.value,date:m.date,dateLabel:m.date.slice(0,7),modelName:m.eval.model_name||"",paperTitle:m.eval.paper_title||"",paperRouteId:m.eval.paper_arxiv_id||m.eval.paper_id||null,isSota:g})}const o=e.map(m=>{var g;return{eval:m,value:ee((g=m.metrics)==null?void 0:g[t])}}).filter(m=>m.value!==null).sort((m,g)=>r==="↓"?m.value-g.value:g.value-m.value)[0],d=(o==null?void 0:o.value)??0,p=(o==null?void 0:o.eval.model_name)||(o==null?void 0:o.eval.paper_title)||"";return{points:i,sota:d,sotaModel:p}}const ze=({targetRef:e,label:t})=>{const{toast:r}=st(),[n,i]=k.useState("idle"),a=k.useRef(null);k.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]);const c=k.useCallback(async()=>{const d=e.current;if(d){i("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await sr(d),i("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>i("idle"),1500)}catch(p){i("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),o=n==="copied"?"Copied":n==="copying"?"Copying…":"Copy image";return s.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:n==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[s.jsx(ot,{name:"copy",size:11}),o]})},wr=()=>{var we,ve,je,Se,ke,Ce,Ee,_e,Re,$e;const{datasetSlug:e}=rt(),[t]=nt(),r=t.get("task")||void 0,n=t.get("eval")||void 0,[i,a]=k.useState(void 0),c=k.useRef(null),o=k.useRef(!1),d=k.useRef(null),p=k.useRef(null),m=Y({queryKey:["dataset",e,"with-paper"],queryFn:()=>Z.getDatasetBySlug(e,{include_paper:!0}),enabled:!!e,staleTime:10*60*1e3}),g=Y({queryKey:["dataset-evals",(we=m.data)==null?void 0:we.id],queryFn:()=>Z.getEvaluationsByDataset(m.data.id),enabled:!!((ve=m.data)!=null&&ve.id),staleTime:5*60*1e3}),C=Y({queryKey:["dataset-tasks",(je=m.data)==null?void 0:je.id],queryFn:()=>Z.getDatasetTasks(m.data.id),enabled:!!((Se=m.data)!=null&&Se.id),staleTime:10*60*1e3}),z=Y({queryKey:["metric-directions"],queryFn:()=>Z.getMetricDirections(),staleTime:60*60*1e3}),F=k.useMemo(()=>{const u=C.data||[];if(u.length===0)return null;if(r){const f=u.find(j=>j.slug===r);if(f)return f.id}if(u.length===1)return u[0].id;const h=g.data||[];if(h.length>0){const f=new Map;for(const v of h)f.set(v.task_id,(f.get(v.task_id)||0)+1);let j=null,S=-1;for(const v of u){const I=f.get(v.id)||0;I>S&&(S=I,j=v.id)}if(j)return j}return u[0].id},[C.data,g.data,r]),G=Y({queryKey:["leaderboard-metrics",(ke=m.data)==null?void 0:ke.id,F],queryFn:()=>Z.getLeaderboardMetrics(m.data.id,F),enabled:!!((Ce=m.data)!=null&&Ce.id)&&!!F,staleTime:10*60*1e3}),H=k.useMemo(()=>{const u=g.data||[];return F?u.filter(h=>h.task_id===F):u},[g.data,F]),N=k.useMemo(()=>lr(H),[H]),U=k.useMemo(()=>{const u=new Set;return N.forEach(h=>{h.best_metric&&u.add(h.best_metric),Object.keys(h.metrics||{}).forEach(f=>u.add(f))}),Array.from(u)},[N]),P=k.useMemo(()=>(G.data||[]).map(u=>u.metric_name),[G.data]),E=P.length?P:U,te=k.useMemo(()=>{var j;if(N.length===0)return E[0]||"";const u=new Map;for(const S of N)for(const v of Object.keys(S.metrics||{}))P.length&&!E.includes(v)||u.set(v,(u.get(v)||0)+1);let h=null,f=0;for(const[S,v]of u)v>f&&(f=v,h=S);return h||E[0]||((j=N[0])==null?void 0:j.best_metric)||""},[N,E,P]),y=i||te,A=(((_e=(Ee=z.data)==null?void 0:Ee.directions)==null?void 0:_e[y])||"higher_is_better")==="lower_is_better"?"↓":"↑",re=k.useMemo(()=>{if(E.length===0)return y?[y]:[];if(E.length<=he)return E;const u=[],h=y&&E.includes(y),f=h?he-1:he;let j=0;for(const S of E)S!==y&&(j>=f||(u.push(S),j++));if(h){const S=E.findIndex(I=>I===y),v=E.slice(0,S).filter(I=>u.includes(I)).length;u.splice(v,0,y)}return u},[E,y]),{points:K,sota:ne,sotaModel:Q}=k.useMemo(()=>ur(N,y,A),[N,y,A]);k.useEffect(()=>{if(o.current||!n||!g.data||g.data.length===0)return;const u=c.current;u&&(o.current=!0,u.scrollIntoView({behavior:"smooth",block:"start"}))},[n,g.data]);const V=k.useMemo(()=>{const u=C.data||[];return F?u.find(h=>h.id===F)||u[0]||null:u[0]||null},[C.data,F]);if(m.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(ue,{className:"h-12 w-1/2 mb-6"}),s.jsx(ue,{className:"h-64 w-full"})]});if(m.error||!m.data)return s.jsx("div",{className:"page",children:s.jsx(it,{variant:"destructive",children:s.jsx(ct,{children:"Benchmark not found."})})});const l=m.data,x=N.slice().sort((u,h)=>{var S,v;const f=ee((S=u.metrics)==null?void 0:S[y]),j=ee((v=h.metrics)==null?void 0:v[y]);return f!==null&&j!==null?A==="↓"?f-j:j-f:f!==null?-1:j!==null?1:qe(u,y)-qe(h,y)}),_=!!l.supports_harness,b=n&&x.find(u=>We(u,n))||null,w=l.introducing_paper??void 0,R=(w==null?void 0:w.arxiv_id)||(w==null?void 0:w.id)||ar(l.paper_url),L=(w==null?void 0:w.title)||l.introducing_paper_title||null,$=((Re=w==null?void 0:w.published)==null?void 0:Re.slice(0,4))||l.introduced_year||null,be=!!R||!!l.paper_url||!!L,X=w!=null&&w.arxiv_id||($e=l.paper_url)!=null&&$e.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${R}`:`Paper ${R}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(J,{to:"/tasks",children:"Tasks"}),V&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(J,{to:`/tasks/${V.slug||V.id}`,children:V.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:l.name})]}),s.jsx("h1",{className:"bm-title",children:l.name}),s.jsxs("div",{className:"bm-subtitle",style:{display:"flex",alignItems:"center",gap:16,flexWrap:"wrap"},children:[s.jsxs("span",{children:[y&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:y}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),Q?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:q(ne)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:Q})]}):s.jsxs("span",{children:[x.length," evaluations"]})]}),l.hf_url&&s.jsxs("a",{className:"bm-action-btn",href:l.hf_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),l.description&&s.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:l.description}),be&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),R?s.jsxs(J,{to:`/paper/${R}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:L?s.jsx(de,{title:L}):X}),$&&s.jsx("span",{className:"method-source-meta",children:$})]}):l.paper_url?s.jsxs("a",{href:l.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:L?s.jsx(de,{title:L}):l.paper_url}),$&&s.jsx("span",{className:"method-source-meta",children:$})]}):s.jsxs("div",{className:"method-source-link is-static",children:[s.jsx("span",{className:"method-source-title",children:L?s.jsx(de,{title:L}):null}),$&&s.jsx("span",{className:"method-source-meta",children:$})]})]}),K.filter(u=>u.isSota).length>=2&&s.jsxs("div",{className:"bm-card",ref:d,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:l.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),s.jsxs("div",{className:"bm-card-actions",children:[E.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:y,onChange:u=>a(u.target.value),children:E.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(ze,{targetRef:d,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(cr,{points:K,metric:y})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),b&&(()=>{var S,v;const u=b.paper_arxiv_id||b.paper_id,h=b.paper_title||(b.paper_arxiv_id?`arXiv:${b.paper_arxiv_id}`:null),f=b.best_metric&&((S=b.metrics)==null?void 0:S[b.best_metric])!==void 0?b.best_metric:y,j=(v=b.metrics)==null?void 0:v[f];return s.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[s.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),s.jsxs("div",{className:"bm-highlight-text",children:[s.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),s.jsxs("span",{className:"bm-highlight-paper",children:[b.model_name||h||"—",b.harness?` · ${b.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[j!==void 0&&f?s.jsxs(s.Fragment,{children:[f,": ",q(j),h?" · ":""]}):null,h&&u?s.jsx(J,{to:`/paper/${u}`,children:h}):h||null]})]})]})})(),s.jsxs("div",{className:"bm-card",ref:p,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:l.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),s.jsxs("div",{className:"bm-card-actions",children:[E.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:y,onChange:u=>a(u.target.value),children:E.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(ze,{targetRef:p,label:"leaderboard"})]})]}),g.isLoading?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((u,h)=>s.jsx(ue,{className:"h-10 w-full mb-2"},h))}):x.length===0?s.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):s.jsxs("table",{className:"bm-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"col-rank",children:"Rank"}),s.jsx("th",{className:"col-model",children:"Model"}),_&&s.jsx("th",{className:"col-harness",children:"Harness"}),re.map(u=>{const h=u===y;return s.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?A==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>a(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${A}`:""]})},u)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let u=null,h=0;return x.map((f,j)=>{var Me,Fe;const S=ee((Me=f.metrics)==null?void 0:Me[y]);let v=null;S!==null&&((u===null||S!==u)&&(h=j+1,u=S),v=h);const I=f.paper_arxiv_id||f.paper_id,Te=f.paper_title||(f.paper_arxiv_id?`arXiv:${f.paper_arxiv_id}`:null),oe=We(f,n);return s.jsxs("tr",{ref:oe?c:void 0,className:oe?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:v??"—"}),s.jsxs("td",{className:"col-model",children:[oe&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),f.model_name||"—"]}),_&&s.jsx("td",{className:"col-harness",children:f.harness||"—"}),re.map(le=>{var Le;const Ne=le===y,se=(Le=f.metrics)==null?void 0:Le[le];return s.jsx("td",{className:`col-value${Ne?" is-active":""}${Ne&&v===1?" is-best":""}`,children:se!=null&&se!==""?q(se):"—"},le)}),s.jsx("td",{className:"col-paper",children:I?s.jsx(J,{to:`/paper/${I}`,children:Te||"—"}):Te||"—"}),s.jsx("td",{className:"col-year",children:((Fe=f.paper_published_date)==null?void 0:Fe.slice(0,4))||"—"})]},f.id)})})()})]})]})]})})};export{wr as default};
 
 
 
assets/ClosedSourceEvalBadge-drWiTHYQ.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as a,d as F,j as n,R as I,A as U,b as B,f as d,z as H,P as y,B as $,i as z,e as W,H as G,I as K,J,k as V,L as Y}from"./index-D3-tYEe-.js";var E,R="HoverCard",[N]=z(R,[H]),w=H(),[q,S]=N(R),O=e=>{const{__scopeHoverCard:t,children:r,open:i,defaultOpen:s,onOpenChange:c,openDelay:f=700,closeDelay:v=300}=e,l=w(t),C=a.useRef(0),u=a.useRef(0),h=a.useRef(!1),p=a.useRef(!1),[m,o]=F({prop:i,defaultProp:s??!1,onChange:c,caller:R}),x=a.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>o(!0),f)},[f,o]),g=a.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>o(!1),v))},[v,o]),M=a.useCallback(()=>o(!1),[o]);return a.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),n.jsx(q,{scope:t,open:m,onOpenChange:o,onOpen:x,onClose:g,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:n.jsx(I,{...l,children:r})})};O.displayName=R;var _="HoverCardTrigger",j=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,...i}=e,s=S(_,r),c=w(r);return n.jsx(U,{asChild:!0,...c,children:n.jsx(B.a,{"data-state":s.open?"open":"closed",...i,ref:t,onPointerEnter:d(e.onPointerEnter,b(s.onOpen)),onPointerLeave:d(e.onPointerLeave,b(s.onClose)),onFocus:d(e.onFocus,s.onOpen),onBlur:d(e.onBlur,s.onClose),onTouchStart:d(e.onTouchStart,f=>f.preventDefault())})})});j.displayName=_;var T="HoverCardPortal",[Q,X]=N(T,{forceMount:void 0}),D=e=>{const{__scopeHoverCard:t,forceMount:r,children:i,container:s}=e,c=S(T,t);return n.jsx(Q,{scope:t,forceMount:r,children:n.jsx(y,{present:r||c.open,children:n.jsx($,{asChild:!0,container:s,children:i})})})};D.displayName=T;var P="HoverCardContent",A=a.forwardRef((e,t)=>{const r=X(P,e.__scopeHoverCard),{forceMount:i=r.forceMount,...s}=e,c=S(P,e.__scopeHoverCard);return n.jsx(y,{present:i||c.open,children:n.jsx(Z,{"data-state":c.open?"open":"closed",...s,onPointerEnter:d(e.onPointerEnter,b(c.onOpen)),onPointerLeave:d(e.onPointerLeave,b(c.onClose)),ref:t})})});A.displayName=P;var Z=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:f,...v}=e,l=S(P,r),C=w(r),u=a.useRef(null),h=W(t,u),[p,m]=a.useState(!1);return a.useEffect(()=>{if(p){const o=document.body;return E=o.style.userSelect||o.style.webkitUserSelect,o.style.userSelect="none",o.style.webkitUserSelect="none",()=>{o.style.userSelect=E,o.style.webkitUserSelect=E}}},[p]),a.useEffect(()=>{if(u.current){const o=()=>{m(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var g;((g=document.getSelection())==null?void 0:g.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",o),()=>{document.removeEventListener("pointerup",o),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),a.useEffect(()=>{u.current&&te(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),n.jsx(G,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d(c,o=>{o.preventDefault()}),onDismiss:l.onDismiss,children:n.jsx(K,{...C,...v,onPointerDown:d(v.onPointerDown,o=>{o.currentTarget.contains(o.target)&&m(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),ee="HoverCardArrow",oe=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,...i}=e,s=w(r);return n.jsx(J,{...s,...i,ref:t})});oe.displayName=ee;function b(e){return t=>t.pointerType==="touch"?void 0:e()}function te(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)t.push(r.currentNode);return t}var re=O,ne=j,ae=D,L=A;const se=re,ie=ne,k=a.forwardRef(({className:e,align:t="center",sideOffset:r=4,...i},s)=>n.jsx(ae,{children:n.jsx(L,{ref:s,align:t,sideOffset:r,className:V("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}));k.displayName=L.displayName;const le=()=>n.jsxs(se,{openDelay:120,closeDelay:120,children:[n.jsx(ie,{asChild:!0,children:n.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),n.jsxs(k,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",n.jsx(Y,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});export{le as C};
assets/ConferenceDetailView-CDP-HF34.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{Z as L,r as D,j as e,L as p,a as C}from"./index-D3-tYEe-.js";import{u as T}from"./useQuery-C6S8Ozku.js";import{M as F}from"./MarkdownText-trAzkiVz.js";import{f as B,h as A,d as E}from"./transform-nNAikYlJ.js";import{S as f}from"./skeleton-D0cyB03X.js";import{A as P,a as z}from"./alert-Ayuop_ag.js";import"./katex.min-BSBacQyE.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},H=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{H as default};
assets/ConferenceTaskView-B_-EGfGK.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{Z as V,u as H,r as h,j as e,L as P,V as K,a as L}from"./index-D3-tYEe-.js";import{u as E}from"./useQuery-C6S8Ozku.js";import{P as $}from"./components-D244J_Aj.js";import{M as u}from"./MarkdownText-trAzkiVz.js";import{a as D,d as U}from"./transform-nNAikYlJ.js";import{d as W}from"./usePapers-C3rZB7Pt.js";import{u as Z}from"./useIntersectionObserver-SHZ4yqtO.js";import{S as G}from"./skeleton-D0cyB03X.js";import{A as J,a as X}from"./alert-Ayuop_ag.js";import"./LatexTitle-ZrlO0rs7.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DEoip3HO.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ge=()=>{var w,F,R,T,A,B;const{confSlug:a,taskSlug:r}=V(),[v,M]=H(),y=ee(v.get("order_by")),q=n=>{const s=new URLSearchParams(v);s.set("order_by",n),M(s)},b=r==="all",x=r==="oral",f=r==="spotlight",d=r==="outstanding",c=r==="best-paper-finalists",S=d||c,l=b||x||f||d||c,z=l?void 0:r,I=x?"oral":f?"spotlight":d?"outstanding":c?"best_paper_finalist":void 0,p=E({queryKey:["conference",a],queryFn:()=>L.getConference(a),enabled:!!a,staleTime:10*60*1e3}),g=E({queryKey:["task",r],queryFn:()=>L.getTask(r),enabled:!!r&&!l,staleTime:10*60*1e3}),i=W({conferenceSlug:a||"",taskSlug:z,presentation:I,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,enabled:!!a}),{targetRef:Q,isIntersecting:_}=Z({rootMargin:"200px"});h.useEffect(()=>{_&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[_,i.hasNextPage,i.isFetchingNextPage]),h.useEffect(()=>{window.scrollTo(0,0)},[a,r]);const j=h.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),N=h.useMemo(()=>j.map(D),[j]),m=b?"All papers":x?"Oral papers":f?"Spotlight papers":d?"Outstanding papers":c?"Best paper finalists":U(((w=g.data)==null?void 0:w.name)||r||"",((F=g.data)==null?void 0:F.slug)||r),k=((T=(R=i.data)==null?void 0:R.pages[0])==null?void 0:T.count)??((A=p.data)==null?void 0:A.paper_count)??0,t=g.data;return p.error||g.error||i.error?e.jsx("div",{className:"page",children:e.jsx(J,{variant:"destructive",children:e.jsx(X,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(P,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(P,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(P,{to:`/conferences/${a}`,children:((B=p.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:m})]}),e.jsxs("div",{className:!l&&(t!=null&&t.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:l?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:m}),d&&e.jsx(u,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),c&&a==="cvpr-2026"&&e.jsx(u,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!l&&(t==null?void 0:t.description)&&e.jsx(u,{className:"task-explainer",text:t.description}),p.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:k.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:p.data.name})]})]}),!l&&(t==null?void 0:t.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:t.image_url,alt:`${m} schematic`,onError:n=>{var s,o;(o=(s=n.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",m,t.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(u,{className:"task-image-credit",text:t.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:S?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",k.toLocaleString(),"]"]})]})]}),!S&&e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:Y.map(([n,s])=>e.jsx("button",{className:`sort-btn ${y===n?"active":""}`,onClick:()=>q(n),children:s},n))}),e.jsxs("div",{className:"results-count",children:[N.length," loaded in ",e.jsx("span",{children:m})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((n,s)=>e.jsx(G,{className:"h-40 w-full"},s))}):N.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((n,s)=>{var O;const o=(O=j[s])==null?void 0:O.conference_award,C=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!c?"Best Paper Finalist":null;return e.jsxs(K.Fragment,{children:[C&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:C}),e.jsx($,{paper:n,rank:s+1})]},n.id)})}),e.jsx("div",{ref:Q,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ge as default};
assets/ConferencesIndexView-D5iEQ6eX.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as m,j as e,L as u,a as p}from"./index-D3-tYEe-.js";import{u as h}from"./useQuery-C6S8Ozku.js";import{S as d}from"./skeleton-D0cyB03X.js";import{A as g,a as f}from"./alert-Ayuop_ag.js";const x=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=n?new Date(`${n}T00:00:00`):null,a=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${a(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${a(t)} – ${a(s)}, ${i}`:`${a(t)}, ${i}`},j=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},v=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},y={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},S=()=>{const r=h({queryKey:["conferences"],queryFn:()=>p.getConferences(),staleTime:6e5}),n=m.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(a=>{const i=j(a);(t[i]||(t[i]=[])).push(a)}),Object.values(t).forEach(a=>a.sort(v)),Object.keys(t).map(Number).sort((a,i)=>i-a).map(a=>({year:a,conferences:t[a]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(f,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(d,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((a,i)=>e.jsx(d,{className:"h-32"},i))})]},s))}):n==null?void 0:n.map(({year:t,conferences:s})=>{const a=s.reduce((l,o)=>l+(o.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:y,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",a.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:s.map(l=>{const o=x(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(u,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)})})]},t)})]})};export{S as default};
assets/{CronDashboard-DHvNZD3_.js → CronDashboard-Cn-U_X_P.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as p,r as l,j as e,h as w,x as Y,B as Z}from"./index-C6O8_a1-.js";import{u as G}from"./useQuery-Cvv958Kx.js";import{B as N,D as ee}from"./badge-CcpUgrz3.js";import{B as b,I as se}from"./input-BMdkOI2Z.js";import{s as te,g as ae}from"./adminAuth-PI_XkM8E.js";import{R as L,C as B,a as U}from"./refresh-cw-CcA4286O.js";import{L as M}from"./loader-circle-DK8Ui2RE.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
@@ -38,4 +38,4 @@ import{c as p,r as l,j as e,h as w,x as Y,B as Z}from"./index-C6O8_a1-.js";impor
38
  *
39
  * This source code is licensed under the ISC license.
40
  * See the LICENSE file in the root directory of this source tree.
41
- */const oe=p("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),o=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));o.displayName="Card";const j=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex flex-col space-y-1.5 p-6",s),...a}));j.displayName="CardHeader";const y=l.forwardRef(({className:s,...a},n)=>e.jsx("h3",{ref:n,className:w("text-2xl font-semibold leading-none tracking-tight",s),...a}));y.displayName="CardTitle";const P=l.forwardRef(({className:s,...a},n)=>e.jsx("p",{ref:n,className:w("text-sm text-muted-foreground",s),...a}));P.displayName="CardDescription";const d=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("p-6 pt-0",s),...a}));d.displayName="CardContent";const de=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex items-center p-6 pt-0",s),...a}));de.displayName="CardFooter";const me=async s=>{const a=s?{"X-Admin-Token":s}:{},n=await fetch(Z("/api/v1/cron/status"),{headers:a,credentials:"include"});if(n.status===401)throw new Error("Unauthorized. Sign in with Hugging Face or paste a valid admin token.");if(!n.ok)throw new Error("Failed to fetch cron status");return n.json()},q=()=>ae(),xe=({status:s,isRunning:a})=>{if(a)return e.jsx(M,{className:"h-5 w-5 text-blue-500 animate-spin"});switch(s){case"success":return e.jsx(U,{className:"h-5 w-5 text-green-500"});case"success_no_work":return e.jsx(U,{className:"h-5 w-5 text-yellow-500"});case"failed":return e.jsx(B,{className:"h-5 w-5 text-red-500"});case"running":return e.jsx(M,{className:"h-5 w-5 text-blue-500 animate-spin"});default:return e.jsx(le,{className:"h-5 w-5 text-gray-400"})}},he=({status:s,isRunning:a})=>{if(a)return e.jsx(N,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300",children:"Running"});switch(s){case"success":return e.jsx(N,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300",children:"Success"});case"success_no_work":return e.jsx(N,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-300",children:"Success (No Work)"});case"failed":return e.jsx(N,{variant:"outline",className:"bg-red-50 text-red-700 border-red-300",children:"Failed"});default:return e.jsx(N,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-300",children:"Unknown"})}},ue=s=>s.replace(/_/g," ").split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),I=s=>{if(!s)return"Never";try{const a=new Date(s),m=new Date().getTime()-a.getTime(),i=Math.floor(m/6e4),g=Math.floor(m/36e5),h=Math.floor(m/864e5);return i<1?"Just now":i<60?`${i}m ago`:g<24?`${g}h ago`:h<7?`${h}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},fe=s=>{if(!s)return"Not scheduled";try{const a=new Date(s),n=new Date,m=a.getTime()-n.getTime(),i=Math.floor(m/6e4),g=Math.floor(m/36e5),h=Math.floor(m/864e5);return m<0?"Overdue":i<1?"Just now":i<60?`in ${i}m`:g<24?`in ${g}h`:h<7?`in ${h}d`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},ge=s=>s?s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`:"N/A",pe={hourly:"bg-blue-100 text-blue-800 border-blue-200",daily:"bg-purple-100 text-purple-800 border-purple-200",weekly:"bg-orange-100 text-orange-800 border-orange-200",monthly:"bg-pink-100 text-pink-800 border-pink-200"},Ce=()=>{const[s,a]=l.useState(!0),[n,m]=l.useState(new Set),[i,g]=l.useState(()=>q()),[h,A]=l.useState(()=>q()),[_,D]=l.useState(!1),{user:u}=Y(),S=!!(u!=null&&u.is_admin);l.useEffect(()=>{te(i)},[i]),l.useEffect(()=>{if(!_)return;const r=window.setTimeout(()=>D(!1),2e3);return()=>window.clearTimeout(r)},[_]);const W=()=>{g(h.trim()),D(!0)},H=()=>{A(""),g("")},f=S||i.trim().length>0,{data:c,isLoading:X,isFetching:$,error:T,refetch:K}=G({queryKey:["cronStatus",S?`hf:${u==null?void 0:u.username}`:i],queryFn:()=>me(i.trim()),enabled:f,refetchInterval:f&&s?3e4:!1,retry:!1}),v=T instanceof Error?T.message:void 0,E=r=>{m(t=>{const x=new Set(t);return x.has(r)?x.delete(r):x.add(r),x})},k=(c==null?void 0:c.jobs.reduce((r,t)=>(r[t.category]||(r[t.category]=[]),r[t.category].push(t),r),{}))||{},O=Object.keys(k).sort((r,t)=>{const x=["hourly","daily","weekly","monthly"];return x.indexOf(r)-x.indexOf(t)}),Q=r=>r>=80?"text-green-600":r>=60?"text-yellow-600":"text-red-600";return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold text-gray-900 flex items-center gap-3",children:[e.jsx(R,{className:"h-8 w-8 text-blue-600"}),"CRON Job Dashboard"]}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Monitor and manage automated tasks"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>a(!s),disabled:!f,className:`${s?"border-blue-500 text-blue-600":""} ${f?"":"opacity-60 cursor-not-allowed"}`,children:[e.jsx(L,{className:`h-4 w-4 mr-2 ${s&&f?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>K(),disabled:!f||$,children:[e.jsx(L,{className:`h-4 w-4 mr-2 ${$?"animate-spin":""}`}),"Refresh"]})]})]})}),S?e.jsx(o,{className:"mb-6",children:e.jsx(d,{className:"pt-6",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",u==null?void 0:u.username]}),". Your admin permissions are derived from the ",e.jsx("code",{className:"font-mono",children:"PWC_ADMIN_HF_USERNAMES"})," ","allowlist; CRON metrics will refresh automatically."]})})}):e.jsx(o,{className:"mb-6",children:e.jsxs(d,{className:"pt-6 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-800",children:"Admin token"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Sign in with Hugging Face from the header for the easiest path. Otherwise, paste your admin token here. The token is stored locally in this browser and sent with requests as the ",e.jsx("code",{className:"font-mono",children:"X-Admin-Token"})," header."]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 w-full md:w-auto",children:[e.jsx(se,{type:"password",placeholder:"Enter admin token",value:h,onChange:r=>A(r.target.value),className:"sm:w-64"}),e.jsx(b,{size:"sm",onClick:W,disabled:!h.trim(),children:"Apply token"}),i&&e.jsx(b,{variant:"ghost",size:"sm",onClick:H,children:"Clear"})]})]}),_&&e.jsx("p",{className:"text-xs text-green-600",children:"Token saved. Future requests will automatically include it."}),e.jsx("p",{className:`text-xs ${f?"text-gray-500":"text-blue-700"}`,children:f?"Token stored locally in this browser. Clear it when you are finished on shared devices.":"Enter your admin token above (or sign in with Hugging Face) to enable CRON job monitoring."})]})}),X&&f&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(M,{className:"h-8 w-8 animate-spin text-blue-500"}),e.jsx("span",{className:"ml-3 text-gray-600",children:"Loading CRON jobs status..."})]}),T&&e.jsx(o,{className:"border-red-200 bg-red-50",children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col gap-3 text-red-800",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"h-5 w-5"}),e.jsx("p",{children:v??"Failed to load CRON jobs status. Please try again."})]}),(v==null?void 0:v.toLowerCase().includes("unauthorized"))&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:H,children:"Clear saved token"}),e.jsx("span",{className:"text-sm text-red-700",children:"Re-enter your admin token to continue."})]})]})})}),c&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 mb-8",children:[e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Total Jobs"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold",children:c.summary.total_jobs})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Successful"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:c.summary.success})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Failed"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-red-600",children:c.summary.failed})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Running"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:c.summary.running})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Health Score"})}),e.jsx(d,{children:e.jsxs("div",{className:`text-2xl font-bold ${Q(c.summary.health_score)}`,children:[c.summary.health_score.toFixed(0),"%"]})})]})]}),e.jsxs("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-2",children:[e.jsx(J,{className:"h-4 w-4"}),"Last updated: ",I(c.timestamp)]}),e.jsx("div",{className:"space-y-6",children:O.map(r=>e.jsxs(o,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(N,{className:pe[r],children:r}),e.jsxs("span",{className:"text-gray-700",children:[r," Jobs"]})]}),e.jsxs(P,{children:[k[r].length," job",k[r].length!==1?"s":""]})]})}),e.jsx(d,{children:e.jsx("div",{className:"space-y-4",children:k[r].map(t=>{const x=n.has(t.job_name),z=t.work_metrics&&Object.keys(t.work_metrics).length>0;return e.jsxs("div",{className:"border rounded-lg overflow-hidden transition-all",children:[e.jsx("div",{className:"p-4 hover:bg-gray-50 transition-colors cursor-pointer",onClick:()=>E(t.job_name),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx(xe,{status:t.status,isRunning:t.is_running}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:ue(t.job_name)}),z&&e.jsx("button",{className:"text-gray-400 hover:text-gray-600 transition-colors",onClick:C=>{C.stopPropagation(),E(t.job_name)},children:x?e.jsx(ie,{className:"h-4 w-4"}):e.jsx(ne,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(J,{className:"h-4 w-4"}),e.jsxs("span",{children:["Last: ",I(t.last_run)]})]}),t.duration!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsxs("span",{children:["Duration: ",ge(t.duration)]})]}),t.schedule&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"h-4 w-4"}),e.jsx("span",{className:"font-mono text-xs",children:t.schedule})]}),t.next_run&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsxs("span",{children:["Next: ",fe(t.next_run)]})]})]}),t.work_summary&&e.jsxs("div",{className:"mt-2 text-sm text-gray-600 bg-gray-100 rounded px-2 py-1 flex items-center gap-1",children:[e.jsx(ce,{className:"h-3 w-3"}),e.jsx("span",{children:t.work_summary})]}),t.error&&e.jsxs("div",{className:"mt-2 text-sm text-red-600 bg-red-50 rounded px-2 py-1",children:[e.jsx("span",{className:"font-semibold",children:"Error: "}),t.error]})]})]}),e.jsx(he,{status:t.status,isRunning:t.is_running})]})}),x&&z&&e.jsxs("div",{className:"border-t bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(ee,{className:"h-4 w-4 text-gray-600"}),e.jsx("h4",{className:"font-semibold text-gray-700",children:"Work Metrics"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Object.entries(t.work_metrics).map(([C,F])=>e.jsxs("div",{className:"bg-white rounded border border-gray-200 p-3",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-1",children:C.replace(/_/g," ").replace(/\b\w/g,V=>V.toUpperCase())}),e.jsx("div",{className:"text-lg font-semibold text-gray-900",children:typeof F=="number"?F.toLocaleString():F})]},C))})]})]},t.job_name)})})})]},r))}),O.length===0&&e.jsx(o,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center text-gray-500 py-12",children:[e.jsx(R,{className:"h-12 w-12 mx-auto mb-4 text-gray-400"}),e.jsx("p",{children:"No CRON jobs found"})]})})})]})]})})};export{Ce as default};
 
1
+ import{c as p,r as l,j as e,k as w,U as V,ag as Z,ah as G,Y as ee}from"./index-D3-tYEe-.js";import{u as se}from"./useQuery-C6S8Ozku.js";import{B as N,D as te}from"./badge-CCpokg9G.js";import{B as b,I as ae}from"./input-C7eEyU6x.js";import{R as z,C as B,a as L}from"./refresh-cw-gCrkdl6j.js";import{L as M}from"./loader-circle-BKVFOFo9.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
38
  *
39
  * This source code is licensed under the ISC license.
40
  * See the LICENSE file in the root directory of this source tree.
41
+ */const oe=p("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),o=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));o.displayName="Card";const j=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex flex-col space-y-1.5 p-6",s),...a}));j.displayName="CardHeader";const y=l.forwardRef(({className:s,...a},n)=>e.jsx("h3",{ref:n,className:w("text-2xl font-semibold leading-none tracking-tight",s),...a}));y.displayName="CardTitle";const P=l.forwardRef(({className:s,...a},n)=>e.jsx("p",{ref:n,className:w("text-sm text-muted-foreground",s),...a}));P.displayName="CardDescription";const d=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("p-6 pt-0",s),...a}));d.displayName="CardContent";const de=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex items-center p-6 pt-0",s),...a}));de.displayName="CardFooter";const me=async s=>{const a=s?{"X-Admin-Token":s}:{},n=await fetch(ee("/api/v1/cron/status"),{headers:a,credentials:"include"});if(n.status===401)throw new Error("Unauthorized. Sign in with Hugging Face or paste a valid admin token.");if(!n.ok)throw new Error("Failed to fetch cron status");return n.json()},q=()=>G(),xe=({status:s,isRunning:a})=>{if(a)return e.jsx(M,{className:"h-5 w-5 text-blue-500 animate-spin"});switch(s){case"success":return e.jsx(L,{className:"h-5 w-5 text-green-500"});case"success_no_work":return e.jsx(L,{className:"h-5 w-5 text-yellow-500"});case"failed":return e.jsx(B,{className:"h-5 w-5 text-red-500"});case"running":return e.jsx(M,{className:"h-5 w-5 text-blue-500 animate-spin"});default:return e.jsx(le,{className:"h-5 w-5 text-gray-400"})}},he=({status:s,isRunning:a})=>{if(a)return e.jsx(N,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300",children:"Running"});switch(s){case"success":return e.jsx(N,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300",children:"Success"});case"success_no_work":return e.jsx(N,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-300",children:"Success (No Work)"});case"failed":return e.jsx(N,{variant:"outline",className:"bg-red-50 text-red-700 border-red-300",children:"Failed"});default:return e.jsx(N,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-300",children:"Unknown"})}},ue=s=>s.replace(/_/g," ").split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),I=s=>{if(!s)return"Never";try{const a=new Date(s),m=new Date().getTime()-a.getTime(),i=Math.floor(m/6e4),f=Math.floor(m/36e5),h=Math.floor(m/864e5);return i<1?"Just now":i<60?`${i}m ago`:f<24?`${f}h ago`:h<7?`${h}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},ge=s=>{if(!s)return"Not scheduled";try{const a=new Date(s),n=new Date,m=a.getTime()-n.getTime(),i=Math.floor(m/6e4),f=Math.floor(m/36e5),h=Math.floor(m/864e5);return m<0?"Overdue":i<1?"Just now":i<60?`in ${i}m`:f<24?`in ${f}h`:h<7?`in ${h}d`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},fe=s=>s?s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`:"N/A",pe={hourly:"bg-blue-100 text-blue-800 border-blue-200",daily:"bg-purple-100 text-purple-800 border-purple-200",weekly:"bg-orange-100 text-orange-800 border-orange-200",monthly:"bg-pink-100 text-pink-800 border-pink-200"},ke=()=>{const[s,a]=l.useState(!0),[n,m]=l.useState(new Set),[i,f]=l.useState(()=>q()),[h,A]=l.useState(()=>q()),[_,D]=l.useState(!1),{user:u}=V(),S=!!(u!=null&&u.is_admin);l.useEffect(()=>{Z(i)},[i]),l.useEffect(()=>{if(!_)return;const r=window.setTimeout(()=>D(!1),2e3);return()=>window.clearTimeout(r)},[_]);const W=()=>{f(h.trim()),D(!0)},H=()=>{A(""),f("")},g=S||i.trim().length>0,{data:c,isLoading:X,isFetching:$,error:T,refetch:Y}=se({queryKey:["cronStatus",S?`hf:${u==null?void 0:u.username}`:i],queryFn:()=>me(i.trim()),enabled:g,refetchInterval:g&&s?3e4:!1,retry:!1}),v=T instanceof Error?T.message:void 0,E=r=>{m(t=>{const x=new Set(t);return x.has(r)?x.delete(r):x.add(r),x})},k=(c==null?void 0:c.jobs.reduce((r,t)=>(r[t.category]||(r[t.category]=[]),r[t.category].push(t),r),{}))||{},O=Object.keys(k).sort((r,t)=>{const x=["hourly","daily","weekly","monthly"];return x.indexOf(r)-x.indexOf(t)}),K=r=>r>=80?"text-green-600":r>=60?"text-yellow-600":"text-red-600";return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold text-gray-900 flex items-center gap-3",children:[e.jsx(R,{className:"h-8 w-8 text-blue-600"}),"CRON Job Dashboard"]}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Monitor and manage automated tasks"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>a(!s),disabled:!g,className:`${s?"border-blue-500 text-blue-600":""} ${g?"":"opacity-60 cursor-not-allowed"}`,children:[e.jsx(z,{className:`h-4 w-4 mr-2 ${s&&g?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>Y(),disabled:!g||$,children:[e.jsx(z,{className:`h-4 w-4 mr-2 ${$?"animate-spin":""}`}),"Refresh"]})]})]})}),S?e.jsx(o,{className:"mb-6",children:e.jsx(d,{className:"pt-6",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",u==null?void 0:u.username]}),". Your admin permissions are derived from the ",e.jsx("code",{className:"font-mono",children:"PWC_ADMIN_HF_USERNAMES"})," ","allowlist; CRON metrics will refresh automatically."]})})}):e.jsx(o,{className:"mb-6",children:e.jsxs(d,{className:"pt-6 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-800",children:"Admin token"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Sign in with Hugging Face from the header for the easiest path. Otherwise, paste your admin token here. The token is stored locally in this browser and sent with requests as the ",e.jsx("code",{className:"font-mono",children:"X-Admin-Token"})," header."]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 w-full md:w-auto",children:[e.jsx(ae,{type:"password",placeholder:"Enter admin token",value:h,onChange:r=>A(r.target.value),className:"sm:w-64"}),e.jsx(b,{size:"sm",onClick:W,disabled:!h.trim(),children:"Apply token"}),i&&e.jsx(b,{variant:"ghost",size:"sm",onClick:H,children:"Clear"})]})]}),_&&e.jsx("p",{className:"text-xs text-green-600",children:"Token saved. Future requests will automatically include it."}),e.jsx("p",{className:`text-xs ${g?"text-gray-500":"text-blue-700"}`,children:g?"Token stored locally in this browser. Clear it when you are finished on shared devices.":"Enter your admin token above (or sign in with Hugging Face) to enable CRON job monitoring."})]})}),X&&g&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(M,{className:"h-8 w-8 animate-spin text-blue-500"}),e.jsx("span",{className:"ml-3 text-gray-600",children:"Loading CRON jobs status..."})]}),T&&e.jsx(o,{className:"border-red-200 bg-red-50",children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col gap-3 text-red-800",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"h-5 w-5"}),e.jsx("p",{children:v??"Failed to load CRON jobs status. Please try again."})]}),(v==null?void 0:v.toLowerCase().includes("unauthorized"))&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:H,children:"Clear saved token"}),e.jsx("span",{className:"text-sm text-red-700",children:"Re-enter your admin token to continue."})]})]})})}),c&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 mb-8",children:[e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Total Jobs"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold",children:c.summary.total_jobs})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Successful"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:c.summary.success})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Failed"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-red-600",children:c.summary.failed})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Running"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:c.summary.running})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Health Score"})}),e.jsx(d,{children:e.jsxs("div",{className:`text-2xl font-bold ${K(c.summary.health_score)}`,children:[c.summary.health_score.toFixed(0),"%"]})})]})]}),e.jsxs("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-2",children:[e.jsx(J,{className:"h-4 w-4"}),"Last updated: ",I(c.timestamp)]}),e.jsx("div",{className:"space-y-6",children:O.map(r=>e.jsxs(o,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(N,{className:pe[r],children:r}),e.jsxs("span",{className:"text-gray-700",children:[r," Jobs"]})]}),e.jsxs(P,{children:[k[r].length," job",k[r].length!==1?"s":""]})]})}),e.jsx(d,{children:e.jsx("div",{className:"space-y-4",children:k[r].map(t=>{const x=n.has(t.job_name),U=t.work_metrics&&Object.keys(t.work_metrics).length>0;return e.jsxs("div",{className:"border rounded-lg overflow-hidden transition-all",children:[e.jsx("div",{className:"p-4 hover:bg-gray-50 transition-colors cursor-pointer",onClick:()=>E(t.job_name),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx(xe,{status:t.status,isRunning:t.is_running}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:ue(t.job_name)}),U&&e.jsx("button",{className:"text-gray-400 hover:text-gray-600 transition-colors",onClick:C=>{C.stopPropagation(),E(t.job_name)},children:x?e.jsx(ie,{className:"h-4 w-4"}):e.jsx(ne,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(J,{className:"h-4 w-4"}),e.jsxs("span",{children:["Last: ",I(t.last_run)]})]}),t.duration!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsxs("span",{children:["Duration: ",fe(t.duration)]})]}),t.schedule&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"h-4 w-4"}),e.jsx("span",{className:"font-mono text-xs",children:t.schedule})]}),t.next_run&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsxs("span",{children:["Next: ",ge(t.next_run)]})]})]}),t.work_summary&&e.jsxs("div",{className:"mt-2 text-sm text-gray-600 bg-gray-100 rounded px-2 py-1 flex items-center gap-1",children:[e.jsx(ce,{className:"h-3 w-3"}),e.jsx("span",{children:t.work_summary})]}),t.error&&e.jsxs("div",{className:"mt-2 text-sm text-red-600 bg-red-50 rounded px-2 py-1",children:[e.jsx("span",{className:"font-semibold",children:"Error: "}),t.error]})]})]}),e.jsx(he,{status:t.status,isRunning:t.is_running})]})}),x&&U&&e.jsxs("div",{className:"border-t bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(te,{className:"h-4 w-4 text-gray-600"}),e.jsx("h4",{className:"font-semibold text-gray-700",children:"Work Metrics"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Object.entries(t.work_metrics).map(([C,F])=>e.jsxs("div",{className:"bg-white rounded border border-gray-200 p-3",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-1",children:C.replace(/_/g," ").replace(/\b\w/g,Q=>Q.toUpperCase())}),e.jsx("div",{className:"text-lg font-semibold text-gray-900",children:typeof F=="number"?F.toLocaleString():F})]},C))})]})]},t.job_name)})})})]},r))}),O.length===0&&e.jsx(o,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center text-gray-500 py-12",children:[e.jsx(R,{className:"h-12 w-12 mx-auto mb-4 text-gray-400"}),e.jsx("p",{children:"No CRON jobs found"})]})})})]})]})})};export{ke as default};
assets/FeedView-DkQJBDx2.js DELETED
@@ -1 +0,0 @@
1
- import{u as S,r as y,j as e,L as m}from"./index-C6O8_a1-.js";import{P as I}from"./components-CMH89RDy.js";import{a as T}from"./api-DLAvdHPg.js";import{t as L,a as E,d as _}from"./transform-D_Izdf89.js";import{u as R,a as D}from"./usePapers-CwnyeI7c.js";import{u as M}from"./useIntersectionObserver-CkOYzKe_.js";import{P as C}from"./usePeriodFilter-BrbWqy5G.js";import{S as n}from"./skeleton-D8Wtx_Nu.js";import{A as W,a as q}from"./alert-MNWNJkBv.js";import{u as b}from"./useQuery-Cvv958Kx.js";import"./LatexTitle-CcMIi9G1.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-Dd12EyZd.js";const $=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],B={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},z={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},K={today:1,week:7,month:30,all_time:365},U=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",X=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",ne=()=>{var x,u,j,f,N;const[i,p]=S(),r=U(i.get("order_by")),o=X(i.get("time")),v=z[o],P=s=>{const a=new URLSearchParams(i);a.set("order_by",s),p(a)},w=s=>{const a=new URLSearchParams(i);a.set("time",B[s]),p(a)},h=b({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=b({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8}),staleTime:10*60*1e3}),t=R({page_size:30,order_by:r,order_dir:"desc",time:o,include_resources:!0,enabled:r!=="trending"}),d=D({limit:30,max_age_days:K[o],enabled:r==="trending"}),c=y.useMemo(()=>{var a;return r==="trending"?(d.data||[]).map(L):(((a=t.data)==null?void 0:a.pages.flatMap(O=>O.results))||[]).map(E)},[r,t.data,d.data]),{targetRef:k,isIntersecting:g}=M({rootMargin:"400px"});y.useEffect(()=>{r!=="trending"&&g&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[r,g,t.hasNextPage,t.isFetchingNextPage]);const F=r==="trending"?d.isLoading:t.isLoading,A=r==="trending"?d.error:t.error;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]}),e.jsx("div",{style:{display:"flex",gap:16,alignItems:"center",flexWrap:"wrap"},children:e.jsx("div",{className:"period-switch",children:C.map(s=>e.jsx("button",{className:`period-btn ${v===s?"active":""}`,onClick:()=>w(s),children:s},s))})})]}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),h.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),(x=h.data)==null?void 0:x.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(m,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),l.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),((j=(u=l.data)==null?void 0:u.results)==null?void 0:j.length)===0&&!l.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(N=(f=l.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:$.map(([s,a])=>e.jsx("button",{className:`sort-btn ${r===s?"active":""}`,onClick:()=>P(s),children:a},s))}),e.jsxs("div",{className:"results-count",children:[c.length," papers"]})]}),A&&e.jsx(W,{variant:"destructive",className:"mb-4",children:e.jsx(q,{children:"Failed to load papers. Please try again."})}),F?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(n,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(n,{className:"h-6 w-3/4"}),e.jsx(n,{className:"h-4 w-1/2"}),e.jsx(n,{className:"h-12 w-full"})]})]},a))}):c.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:c.map((s,a)=>e.jsx(I,{paper:s,rank:a+1},s.id))}),r!=="trending"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:k,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{ne as default};
 
 
assets/FeedView-DwVPIvQN.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as S,r as y,j as e,L as m,a as T}from"./index-D3-tYEe-.js";import{P as I}from"./components-D244J_Aj.js";import{t as L,a as E,d as _}from"./transform-nNAikYlJ.js";import{u as R,a as D}from"./usePapers-C3rZB7Pt.js";import{u as M}from"./useIntersectionObserver-SHZ4yqtO.js";import{P as C}from"./usePeriodFilter-BzXQM3-U.js";import{S as n}from"./skeleton-D0cyB03X.js";import{A as W,a as q}from"./alert-Ayuop_ag.js";import{u as b}from"./useQuery-C6S8Ozku.js";import"./LatexTitle-ZrlO0rs7.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DEoip3HO.js";const $=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],B={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},z={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},K={today:1,week:7,month:30,all_time:365},U=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",X=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",te=()=>{var x,u,j,f,N;const[i,h]=S(),r=U(i.get("order_by")),o=X(i.get("time")),v=z[o],P=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},w=s=>{const a=new URLSearchParams(i);a.set("time",B[s]),h(a)},p=b({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=b({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8}),staleTime:10*60*1e3}),t=R({page_size:30,order_by:r,order_dir:"desc",time:o,include_resources:!0,enabled:r!=="trending"}),d=D({limit:30,max_age_days:K[o],enabled:r==="trending"}),c=y.useMemo(()=>{var a;return r==="trending"?(d.data||[]).map(L):(((a=t.data)==null?void 0:a.pages.flatMap(O=>O.results))||[]).map(E)},[r,t.data,d.data]),{targetRef:k,isIntersecting:g}=M({rootMargin:"400px"});y.useEffect(()=>{r!=="trending"&&g&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[r,g,t.hasNextPage,t.isFetchingNextPage]);const F=r==="trending"?d.isLoading:t.isLoading,A=r==="trending"?d.error:t.error;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]}),e.jsx("div",{style:{display:"flex",gap:16,alignItems:"center",flexWrap:"wrap"},children:e.jsx("div",{className:"period-switch",children:C.map(s=>e.jsx("button",{className:`period-btn ${v===s?"active":""}`,onClick:()=>w(s),children:s},s))})})]}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),p.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),(x=p.data)==null?void 0:x.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(m,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),l.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),((j=(u=l.data)==null?void 0:u.results)==null?void 0:j.length)===0&&!l.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(N=(f=l.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:$.map(([s,a])=>e.jsx("button",{className:`sort-btn ${r===s?"active":""}`,onClick:()=>P(s),children:a},s))}),e.jsxs("div",{className:"results-count",children:[c.length," papers"]})]}),A&&e.jsx(W,{variant:"destructive",className:"mb-4",children:e.jsx(q,{children:"Failed to load papers. Please try again."})}),F?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(n,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(n,{className:"h-6 w-3/4"}),e.jsx(n,{className:"h-4 w-1/2"}),e.jsx(n,{className:"h-12 w-full"})]})]},a))}):c.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:c.map((s,a)=>e.jsx(I,{paper:s,rank:a+1},s.id))}),r!=="trending"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:k,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{te as default};
assets/LatexTitle-ZrlO0rs7.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as o,r as g}from"./index-D3-tYEe-.js";import{k as T}from"./katex.min-BSBacQyE.js";const j=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),C={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},M={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},_={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},b={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":C,"`":M,"^":_,'"':b,"~":{n:"ñ",N:"Ñ"}},E={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(e,s){var n;return((n=O[e])==null?void 0:n[s])??null}function N(e){const s=[];let n=0,i="";const l=()=>{i&&(s.push({type:"text",content:i}),i="")};for(;n<e.length;){if(e[n]==="$"&&e[n+1]==="$"){l();const t=e.indexOf("$$",n+2);if(t===-1){i+=e.slice(n);break}s.push({type:"display",content:e.slice(n+2,t)}),n=t+2;continue}if(e[n]==="$"){l();const t=e.indexOf("$",n+1);if(t===-1){i+=e.slice(n);break}s.push({type:"inline",content:e.slice(n+1,t)}),n=t+1;continue}i+=e[n],n+=1}return l(),s}function d(e,s){if(e[s]!=="{")return null;let n=0;for(let i=s;i<e.length;i+=1)if(e[i]==="{")n+=1;else if(e[i]==="}"&&(n-=1,n===0))return{content:e.slice(s+1,i),end:i+1};return null}function $(e,s){let n=s+1;if(n>=e.length)return{name:"",end:n};if(!/[a-zA-Z]/.test(e[n]))return{name:e[n],end:n+1};const i=n;for(;n<e.length&&/[a-zA-Z]/.test(e[n]);)n+=1;return{name:e.slice(i,n),end:n}}function w(e,s){const n=e[s];if(n!=="^"&&n!=="_"||s+1>=e.length)return null;if(e[s+1]==="{"){const i=d(e,s+1);return i?{end:i.end}:null}return/[A-Za-z0-9+\-=.]/.test(e[s+1])?{end:s+2}:null}function y(e,s){let n=s;if(e[n]==="\\"){const{name:t,end:a}=$(e,n);if(!t)return null;if(n=a,e[n]==="{"){const f=d(e,n);f&&(n=f.end)}}else if(/[A-Za-z0-9]/.test(e[n])){let t=n+1;for(;t<e.length&&/[A-Za-z0-9]/.test(e[t]);)t+=1;if(e[t]!=="^"&&e[t]!=="_")return null;n=t}else return null;const i=s;let l=0;for(;n<e.length;){const t=w(e,n);if(!t)break;l+=1,n=t.end}return l===0?null:{latex:e.slice(i,n),end:n}}function p(e,s){const n=[];let i=0,l=0;const t=()=>`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;i<e.length;){if(e[i]==="\\"){const{name:c,end:L}=$(e,i);if(i=L,E[c]){n.push(E[c]);continue}if(c.length===1&&i<e.length&&/[A-Za-z]/.test(e[i])){const r=S(c,e[i]);if(r){n.push(r),i+=1;continue}}if(c==="c"){const r=d(e,i);if((r==null?void 0:r.content.length)===1){const h={c:"ç",C:"Ç"}[r.content];if(h){n.push(h),i=r.end;continue}}}if(c==="textbf"||c==="mathbf"){const r=d(e,i);if(r){i=r.end,n.push(a("strong",p(r.content,t())));continue}}if(c==="emph"||c==="textit"||c==="textsl"||c==="texttt"){const r=d(e,i);if(r){i=r.end,n.push(a("em",p(r.content,t())));continue}}if(c==="color"||c==="textcolor"){const r=d(e,i);if(r){i=r.end;const h=d(e,i);h&&(i=h.end,n.push(...p(h.content,t())));continue}}if(j.has(c)){n.push(" ");continue}if(c==="~"){n.push(" ");continue}const m=d(e,i);if(m){i=m.end,n.push(...p(m.content,t()));continue}n.push(`\\${c}`);continue}if(e[i]==="~"){n.push(" "),i+=1;continue}const f=y(e,i);if(f){n.push(o.jsx(A,{latex:f.latex,display:!1},t())),i=f.end;continue}let u=i;for(;u<e.length&&e[u]!=="\\"&&e[u]!=="~"&&!y(e,u);)u+=1;u>i&&n.push(e.slice(i,u)),i=u}return n}function A({latex:e,display:s}){const n=g.useMemo(()=>{try{return T.renderToString(e.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[e,s]);return n?o.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:n}}):o.jsx(o.Fragment,{children:s?`$$${e}$$`:`$${e}$`})}function k(e){const s=N(e),n=[];return s.forEach((i,l)=>{const t=`latex-${l}`;if(i.type==="text"){const a=p(i.content,t);a.length===1?n.push(a[0]):a.length>1&&n.push(o.jsx(g.Fragment,{children:a},t));return}if(i.type==="display"){n.push(o.jsx(A,{latex:i.content,display:!0},t));return}n.push(o.jsx(A,{latex:i.content,display:!1},t))}),n.length===1?n[0]:o.jsx(o.Fragment,{children:n})}const U=({text:e,className:s=""})=>{const n=g.useMemo(()=>k(e),[e]);return o.jsx("span",{className:s,children:n})},X=({title:e,className:s=""})=>o.jsx(U,{text:e,className:s});export{X as L,U as a};
assets/{MarkdownText-p29EEUf7.js → MarkdownText-trAzkiVz.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/MethodDetailView-Bqs-DuBu.js DELETED
@@ -1 +0,0 @@
1
- import{j as e,E as _,r as p,L,O as D}from"./index-C6O8_a1-.js";import{u as F}from"./useQuery-Cvv958Kx.js";import{u as B}from"./useInfiniteQuery-Dd12EyZd.js";import{M as C,P}from"./components-CMH89RDy.js";import{M as b}from"./MarkdownText-p29EEUf7.js";import{a as y}from"./api-DLAvdHPg.js";import{a as T}from"./transform-D_Izdf89.js";import{u as I}from"./useIntersectionObserver-CkOYzKe_.js";import{S as j}from"./skeleton-D8Wtx_Nu.js";import{A as O,a as R}from"./alert-MNWNJkBv.js";import"./LatexTitle-CcMIi9G1.js";import"./adminAuth-PI_XkM8E.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},l=({x:i,y:r,w:n,h:s,fill:c,stroke:d,label:m,fontSize:h=10,multiline:f})=>e.jsxs("g",{children:[e.jsx("rect",{x:i,y:r,width:n,height:s,rx:"3",ry:"3",fill:c,stroke:d,strokeWidth:"1"}),f?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:i+n/2,y:r+s/2-2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[0]}),e.jsx("text",{x:i+n/2,y:r+s/2+h-1,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[1]})]}):e.jsx("text",{x:i+n/2,y:r+s/2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:m})]}),W=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"14",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Output Probabilities"}),e.jsx("path",{d:"M180 22 L180 32",stroke:t.ink,strokeWidth:"1.2"}),e.jsx(l,{x:150,y:32,w:60,h:20,fill:t.green,stroke:t.greenS,label:"Softmax"}),e.jsx("path",{d:"M180 52 L180 62",stroke:t.ink,strokeWidth:"1.2"}),e.jsx(l,{x:150,y:62,w:60,h:20,fill:t.purple,stroke:t.purpleS,label:"Linear"}),e.jsx("path",{d:"M180 82 L180 92",stroke:t.ink,strokeWidth:"1.2"}),e.jsx("rect",{x:"50",y:"170",width:"120",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeWidth:"1",strokeDasharray:"3 2"}),e.jsx("text",{x:"20",y:"232",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,children:"N×"}),e.jsx(l,{x:70,y:180,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:70,y:200,w:80,h:28,fill:t.blue,stroke:t.blueS,multiline:["Feed","Forward"]}),e.jsx(l,{x:70,y:236,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:70,y:256,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Multi-Head","Attention"]}),e.jsx("rect",{x:"190",y:"92",width:"120",height:"200",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeWidth:"1",strokeDasharray:"3 2"}),e.jsx("text",{x:"320",y:"195",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,children:"N×"}),e.jsx(l,{x:210,y:102,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:122,w:80,h:28,fill:t.blue,stroke:t.blueS,multiline:["Feed","Forward"]}),e.jsx(l,{x:210,y:158,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:178,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Multi-Head","Attention"]}),e.jsx(l,{x:210,y:216,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:236,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Masked MH","Attention"]}),e.jsx("path",{d:"M150 220 L195 192",stroke:t.ink,strokeWidth:"1.2",fill:"none"}),e.jsx("path",{d:"M150 220 L195 200",stroke:t.ink,strokeWidth:"1.2",fill:"none"}),e.jsx(l,{x:70,y:340,w:80,h:26,fill:t.pink,stroke:t.pinkS,multiline:["Input","Embedding"]}),e.jsx(l,{x:210,y:340,w:80,h:26,fill:t.pink,stroke:t.pinkS,multiline:["Output","Embedding"]}),e.jsx("text",{x:"110",y:"395",fontSize:"11",fontFamily:"var(--serif)",fill:t.ink,textAnchor:"middle",children:"Inputs"}),e.jsx("text",{x:"250",y:"395",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Outputs (shifted right)"})]}),N=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(l,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(l,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(l,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(l,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(l,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(l,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(l,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(l,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),$=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const r=30+i*75,n=60-i*8,s=240-i*30;return e.jsx("g",{children:e.jsx("rect",{x:r,y:(420-s)/2,width:n,height:s,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][i],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][i],strokeWidth:"1"})},i)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),A=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const n=60+i*80,s=100-i*12,c=50-i*6;return e.jsx("rect",{x:50,y:n,width:s,height:c,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${i}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(i=>{const n=60+i*80,s=100-i*12,c=50-i*6;return e.jsx("rect",{x:210,y:n,width:s,height:c,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${i}`)}),[0,1,2,3].map(i=>{const r=60+i*80+(50-i*6)/2,n=50+(100-i*12);return e.jsx("path",{d:`M${n} ${r} L210 ${r}`,stroke:t.faint,strokeDasharray:"4 3"},`s${i}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),z=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(i=>[0,1,2].map(r=>e.jsx("rect",{x:20+r*40,y:40+i*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][i*3+r],stroke:t.faint},`${i}-${r}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(l,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(l,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(l,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(l,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),E=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(i=>{const r=25+i*56,n=(5-i)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:r,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-n*.1} 0.04 250)`,stroke:t.faint}),n<.4&&e.jsx("circle",{cx:r+25,cy:115,r:12-n*16,fill:t.orange,opacity:1-n*1.5})]},i)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),H=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Three-stage post-training pipeline"}),e.jsx(l,{x:40,y:45,w:280,h:36,fill:t.green,stroke:t.greenS,label:"Supervised fine-tuning on demonstrations",fontSize:11}),e.jsx(l,{x:40,y:105,w:120,h:36,fill:t.blue,stroke:t.blueS,label:"Pairwise preferences",fontSize:10}),e.jsx(l,{x:200,y:105,w:120,h:36,fill:t.yellow,stroke:t.yellowS,label:"Reward model rθ",fontSize:11}),e.jsx(l,{x:40,y:165,w:100,h:40,fill:t.pink,stroke:t.pinkS,label:"Policy πφ (LLM)",fontSize:11}),e.jsx(l,{x:180,y:165,w:70,h:40,fill:t.orange,stroke:t.orangeS,label:"Sample y",fontSize:10}),e.jsx(l,{x:250,y:220,w:70,h:40,fill:t.yellow,stroke:t.yellowS,label:"rθ(y)",fontSize:11})]}),K=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],Q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),K.map(([i,r],n)=>{const s=92+n*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:s,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:i}),r?e.jsx("text",{x:"138",y:s,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},i)})]}),V={transformer:W,attention:N,"self-attention":N,cnn:$,"u-net":A,unet:A,vit:z,"vision-transformer":z,diffusion:E,ddpm:E,gan:G,vae:q,rlhf:H,"agent-skills":Q},U=({method:i})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:i.name||"method"}),e.jsx(l,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(l,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:i.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(l,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),Y=({method:i})=>{const r=(i.slug||"").toLowerCase(),n=V[r];return n?e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(n,{})}):i.image_url?e.jsx("div",{className:"method-figure-svg method-figure-svg--image",children:e.jsx("img",{className:"method-figure-img",src:i.image_url,alt:`${i.name} schematic`})}):e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(U,{method:i})})},J=[["trending","trending"],["new","newest"],["cited","most cited"]],M={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},xe=()=>{var k,S,w,v;const{methodSlug:i}=_(),[r,n]=p.useState("trending"),s=F({queryKey:["method",i],queryFn:()=>y.getMethod(i),enabled:!!i,staleTime:10*60*1e3}),c=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",d=B({queryKey:["method-papers-infinite",i,c],queryFn:({pageParam:a=1})=>y.getMethodPapers(i,{page:a,page_size:20,order_by:c,order_dir:"desc",include_resources:!0}),getNextPageParam:a=>a.next_page,initialPageParam:1,enabled:!!i,staleTime:5*60*1e3,placeholderData:D}),m=F({queryKey:["related-methods",(k=s.data)==null?void 0:k.slug,(S=s.data)==null?void 0:S.area_id,(w=s.data)==null?void 0:w.id],queryFn:async()=>{const a=M[s.data.slug];return a?Promise.all(a.map(g=>y.getMethod(g))):(await y.getMethods({area_id:s.data.area_id,exclude_id:s.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!s.data&&(!!M[s.data.slug]||!!s.data.area_id),staleTime:10*60*1e3}),h=p.useMemo(()=>{var x;return(((x=d.data)==null?void 0:x.pages.flatMap(g=>g.results))||[]).map(T)},[d.data]),{targetRef:f,isIntersecting:u}=I({rootMargin:"200px"});if(p.useEffect(()=>{u&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[u,d.hasNextPage,d.isFetchingNextPage]),s.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(j,{className:"h-12 w-1/2 mb-4"}),e.jsx(j,{className:"h-64 w-full"})]});if(s.error||!s.data)return e.jsx("div",{className:"page",children:e.jsx(O,{variant:"destructive",children:e.jsx(R,{children:"Method not found."})})});const o=s.data;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(L,{to:"/methods",children:"Methods"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:o.name})]}),e.jsxs("div",{className:"tag-hero method-hero-grid",children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title",style:{fontFamily:"var(--mono)",fontSize:48,letterSpacing:"-0.01em"},children:o.name}),o.full_name&&o.full_name!==o.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:o.full_name}),o.description&&e.jsx(b,{className:"method-description",text:o.description}),o.source_url&&o.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:o.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:o.source_title}),o.introduced_year&&e.jsx("span",{className:"method-source-meta",children:o.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers using"}),e.jsx("span",{className:"value",children:(o.paper_count??0).toLocaleString()})]}),o.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:o.introduced_year})]})]})]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(Y,{method:o}),e.jsxs("figcaption",{children:["Figure · schematic of ",o.name,o.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(b,{className:"method-image-credit",text:o.image_credit})]})]})]})]}),(((v=m.data)==null?void 0:v.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(a=>e.jsx(C,{method:{slug:a.slug,name:a.name}},a.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:J.map(([a,x])=>e.jsx("button",{className:`sort-btn ${r===a?"active":""}`,onClick:()=>n(a),children:x},a))}),e.jsxs("div",{className:"results-count",children:[h.length," papers using ",o.name]})]}),d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,x)=>e.jsx(j,{className:"h-40 w-full"},x))}):h.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:h.map((a,x)=>e.jsx(P,{paper:a,rank:x+1},a.id))}),e.jsx("div",{ref:f,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{xe as default};
 
 
assets/MethodDetailView-oq0vHvu5.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as e,Z as E,r as y,L as M,a as g,a9 as D}from"./index-D3-tYEe-.js";import{u as F}from"./useQuery-C6S8Ozku.js";import{u as B}from"./useInfiniteQuery-DEoip3HO.js";import{M as L,P as C}from"./components-D244J_Aj.js";import{M as b}from"./MarkdownText-trAzkiVz.js";import{a as P}from"./transform-nNAikYlJ.js";import{u as T}from"./useIntersectionObserver-SHZ4yqtO.js";import{S as u}from"./skeleton-D0cyB03X.js";import{A as I,a as R}from"./alert-Ayuop_ag.js";import"./LatexTitle-ZrlO0rs7.js";import"./katex.min-BSBacQyE.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},o=({x:i,y:s,w:r,h:l,fill:x,stroke:d,label:m,fontSize:h=10,multiline:f})=>e.jsxs("g",{children:[e.jsx("rect",{x:i,y:s,width:r,height:l,rx:"3",ry:"3",fill:x,stroke:d,strokeWidth:"1"}),f?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:i+r/2,y:s+l/2-2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[0]}),e.jsx("text",{x:i+r/2,y:s+l/2+h-1,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[1]})]}):e.jsx("text",{x:i+r/2,y:s+l/2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:m})]}),N=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(o,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(o,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(o,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(o,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(o,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(o,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(o,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(o,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),$=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const s=30+i*75,r=60-i*8,l=240-i*30;return e.jsx("g",{children:e.jsx("rect",{x:s,y:(420-l)/2,width:r,height:l,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][i],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][i],strokeWidth:"1"})},i)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),A=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const r=60+i*80,l=100-i*12,x=50-i*6;return e.jsx("rect",{x:50,y:r,width:l,height:x,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${i}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(i=>{const r=60+i*80,l=100-i*12,x=50-i*6;return e.jsx("rect",{x:210,y:r,width:l,height:x,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${i}`)}),[0,1,2,3].map(i=>{const s=60+i*80+(50-i*6)/2,r=50+(100-i*12);return e.jsx("path",{d:`M${r} ${s} L210 ${s}`,stroke:t.faint,strokeDasharray:"4 3"},`s${i}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(i=>[0,1,2].map(s=>e.jsx("rect",{x:20+s*40,y:40+i*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][i*3+s],stroke:t.faint},`${i}-${s}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(o,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(o,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(o,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(o,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),_=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(i=>{const s=25+i*56,r=(5-i)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:s,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-r*.1} 0.04 250)`,stroke:t.faint}),r<.4&&e.jsx("circle",{cx:s+25,cy:115,r:12-r*16,fill:t.orange,opacity:1-r*1.5})]},i)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),K=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],Q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),K.map(([i,s],r)=>{const l=92+r*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:i}),s?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:s}):null]},i)})]}),V={attention:N,"self-attention":N,cnn:$,"u-net":A,unet:A,vit:O,diffusion:_,ddpm:_,gan:G,vae:q,"agent-skills":Q},W=({method:i})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:i.name||"method"}),e.jsx(o,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(o,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:i.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(o,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),U=({method:i})=>{const s=(i.slug||"").toLowerCase(),r=V[s];if(r)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(r,{})});if(i.image_url){const l=s==="transformer"||s==="gpt-4"||s==="gpt-4o"?" method-figure-svg--compact":s==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:i.image_url,alt:`${i.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(W,{method:i})})},H=[["trending","trending"],["new","newest"],["cited","most cited"]],z={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},ae=()=>{var k,S,v,w;const{methodSlug:i}=E(),[s,r]=y.useState("trending"),l=F({queryKey:["method",i],queryFn:()=>g.getMethod(i),enabled:!!i,staleTime:10*60*1e3}),x=s==="trending"?"trending":s==="cited"?"citation_count":"date_published",d=B({queryKey:["method-papers-infinite",i,x],queryFn:({pageParam:a=1})=>g.getMethodPapers(i,{page:a,page_size:20,order_by:x,order_dir:"desc",include_resources:!0}),getNextPageParam:a=>a.next_page,initialPageParam:1,enabled:!!i,staleTime:5*60*1e3,placeholderData:D}),m=F({queryKey:["related-methods",(k=l.data)==null?void 0:k.slug,(S=l.data)==null?void 0:S.area_id,(v=l.data)==null?void 0:v.id],queryFn:async()=>{const a=z[l.data.slug];return a?Promise.all(a.map(p=>g.getMethod(p))):(await g.getMethods({area_id:l.data.area_id,exclude_id:l.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!l.data&&(!!z[l.data.slug]||!!l.data.area_id),staleTime:10*60*1e3}),h=y.useMemo(()=>{var c;return(((c=d.data)==null?void 0:c.pages.flatMap(p=>p.results))||[]).map(P)},[d.data]),{targetRef:f,isIntersecting:j}=T({rootMargin:"200px"});if(y.useEffect(()=>{j&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[j,d.hasNextPage,d.isFetchingNextPage]),l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(u,{className:"h-12 w-1/2 mb-4"}),e.jsx(u,{className:"h-64 w-full"})]});if(l.error||!l.data)return e.jsx("div",{className:"page",children:e.jsx(I,{variant:"destructive",children:e.jsx(R,{children:"Method not found."})})});const n=l.data;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(M,{to:"/methods",children:"Methods"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:n.name})]}),e.jsxs("div",{className:"tag-hero method-hero-grid",children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:n.name}),n.full_name&&n.full_name!==n.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:n.full_name}),n.description&&e.jsx(b,{className:"method-description",text:n.description}),n.source_url&&n.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:n.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:n.source_title}),n.introduced_year&&e.jsx("span",{className:"method-source-meta",children:n.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers using"}),e.jsx("span",{className:"value",children:(n.paper_count??0).toLocaleString()})]}),n.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:n.introduced_year})]})]})]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(U,{method:n}),n.image_credit&&e.jsx("figcaption",{children:e.jsx(b,{className:"method-image-credit",text:n.image_credit})})]})]}),(((w=m.data)==null?void 0:w.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(a=>e.jsx(L,{method:{slug:a.slug,name:a.name}},a.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:H.map(([a,c])=>e.jsx("button",{className:`sort-btn ${s===a?"active":""}`,onClick:()=>r(a),children:c},a))}),e.jsxs("div",{className:"results-count",children:[h.length," papers using ",n.name]})]}),d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,c)=>e.jsx(u,{className:"h-40 w-full"},c))}):h.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:h.map((a,c)=>e.jsx(C,{paper:a,rank:c+1},a.id))}),e.jsx("div",{ref:f,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ae as default};
assets/MethodsIndexView-CUF6j1AK.js DELETED
@@ -1 +0,0 @@
1
- import{r as u,j as e,L as x}from"./index-C6O8_a1-.js";import{u as c}from"./useQuery-Cvv958Kx.js";import{a as m}from"./api-DLAvdHPg.js";import{S as h}from"./skeleton-D8Wtx_Nu.js";import{A as g,a as j}from"./alert-MNWNJkBv.js";import"./adminAuth-PI_XkM8E.js";const w=()=>{var o,d;const i=c({queryKey:["areas-all"],queryFn:()=>m.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=c({queryKey:["methods-all"],queryFn:async()=>(await m.getMethods({page:1,page_size:500,ordering:"-paper_count"})).results,staleTime:10*60*1e3}),l=u.useMemo(()=>{if(!n.data||!i.data)return null;const a={};return n.data.forEach(r=>{const t=r.area_id??"_unassigned";(a[t]||(a[t]=[])).push(r)}),Object.values(a).forEach(r=>r.sort((t,s)=>(s.paper_count||0)-(t.paper_count||0))),a},[n.data,i.data]);return i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(j,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research, with the papers that use them."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((a,r)=>e.jsxs("div",{children:[e.jsx(h,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((t,s)=>e.jsx(h,{className:"h-20"},s))})]},r))}):(d=(o=i.data)==null?void 0:o.results)==null?void 0:d.map(a=>{const r=(l==null?void 0:l[a.id])||[];if(r.length===0)return null;const t=r.reduce((s,p)=>s+(p.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:a.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," methods · ",t.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(s=>e.jsxs(x,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsx("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:s.name}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id))})]},a.id)})]})};export{w as default};
 
 
assets/MethodsIndexView-CrTfP50j.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as u,j as e,L as x,a as c}from"./index-D3-tYEe-.js";import{u as h}from"./useQuery-C6S8Ozku.js";import{S as m}from"./skeleton-D0cyB03X.js";import{A as g,a as j}from"./alert-Ayuop_ag.js";const N=()=>{var o,d;const i=h({queryKey:["areas-all"],queryFn:()=>c.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=h({queryKey:["methods-all"],queryFn:async()=>(await c.getMethods({page:1,page_size:500,ordering:"-paper_count"})).results,staleTime:10*60*1e3}),l=u.useMemo(()=>{if(!n.data||!i.data)return null;const a={};return n.data.forEach(r=>{const t=r.area_id??"_unassigned";(a[t]||(a[t]=[])).push(r)}),Object.values(a).forEach(r=>r.sort((t,s)=>(s.paper_count||0)-(t.paper_count||0))),a},[n.data,i.data]);return i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(j,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research, with the papers that use them."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((a,r)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((t,s)=>e.jsx(m,{className:"h-20"},s))})]},r))}):(d=(o=i.data)==null?void 0:o.results)==null?void 0:d.map(a=>{const r=(l==null?void 0:l[a.id])||[];if(r.length===0)return null;const t=r.reduce((s,p)=>s+(p.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:a.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," methods · ",t.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(s=>e.jsxs(x,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsx("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:s.name}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id))})]},a.id)})]})};export{N as default};
assets/{NotFound-C1sONCOd.js → NotFound-3lyVNVYr.js} RENAMED
@@ -1 +1 @@
1
- import{a7 as o,r as a,j as t,L as s}from"./index-C6O8_a1-.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
 
1
+ import{aB as o,r as a,j as t,L as s}from"./index-D3-tYEe-.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
assets/OrganizationDetailView-CApb_ZqB.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{Z as j,r as y,j as e,L as x,a as v}from"./index-D3-tYEe-.js";import{u as b}from"./useQuery-C6S8Ozku.js";import{M as k}from"./MarkdownText-trAzkiVz.js";import{f as N,h as S,d as _}from"./transform-nNAikYlJ.js";import{S as p}from"./skeleton-D0cyB03X.js";import{A as w,a as F}from"./alert-Ayuop_ag.js";import A from"./NotFound-3lyVNVYr.js";import"./katex.min-BSBacQyE.js";const B=n=>(n==null?void 0:n.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",$=()=>{var g,f;const{orgSlug:n}=j(),i=b({queryKey:["organization-areas-with-tasks",n],queryFn:()=>v.getOrganizationAreasWithTasks(n),enabled:!!n,staleTime:10*60*1e3}),m=y.useMemo(()=>{if(!i.data)return[];const t={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>t[B(o)]??999;return[...i.data.results].sort((o,a)=>{const l=r(o.name),d=r(a.name);return l!==d?l-d:o.name.localeCompare(a.name)})},[i.data]),s=(g=i.data)==null?void 0:g.organization,c=((f=i.data)==null?void 0:f.total_paper_count)??0,h=m.reduce((t,r)=>t+r.tasks.length,0);if(i.error)return i.error.status===404?e.jsx(A,{}):e.jsx("div",{className:"page",children:e.jsx(w,{variant:"destructive",children:e.jsx(F,{children:"Failed to load organization. Please try again."})})});const u=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title",style:{display:"flex",alignItems:"center",gap:12},children:[(s==null?void 0:s.logo_url)&&e.jsx("img",{src:s.logo_url,alt:"",style:{height:"0.9em",width:"auto",borderRadius:4,objectFit:"contain"},onError:t=>{t.currentTarget.style.display="none"}}),u??e.jsx(p,{className:"h-10 w-64 inline-block"})]}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsxs("span",{children:[c.toLocaleString()," papers"]}),(s==null?void 0:s.website_url)&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.website_url.replace(/^https?:\/\//,"").replace(/\/$/,"")}),(s==null?void 0:s.github_url)&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.github_url.replace(/^https?:\/\//,"").replace(/\/$/,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(k,{className:"method-description",text:s.description})]}),!i.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All papers attributed to this organization."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:e.jsxs(x,{to:`/${n}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]})})]}),i.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((t,r)=>e.jsxs("div",{children:[e.jsx(p,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,a)=>e.jsx(p,{className:"h-24"},a))})]},r))}):m.map(t=>{const r=t.tasks;if(r.length===0)return null;const o=r.reduce((a,l)=>a+(l.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:t.name}),t.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:t.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(a=>{const l=a.slug||"",d=N(S(l));return e.jsxs(x,{to:`/${n}/${l}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:d.dot}}),_(a.name,l)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)})})]},t.id)}),h>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[h," tasks across ",m.filter(t=>t.tasks.length>0).length," areas."]})]})};export{$ as default};
assets/OrganizationTaskView-YBSKDYqe.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{Z as w,u as R,r as m,j as e,L as p,a as b}from"./index-D3-tYEe-.js";import{u as k}from"./useQuery-C6S8Ozku.js";import{P as B}from"./components-D244J_Aj.js";import{a as E,d as L}from"./transform-nNAikYlJ.js";import{e as q}from"./usePapers-C3rZB7Pt.js";import{u as C}from"./useIntersectionObserver-SHZ4yqtO.js";import{S as I}from"./skeleton-D0cyB03X.js";import{A as Q,a as K}from"./alert-Ayuop_ag.js";import M from"./NotFound-3lyVNVYr.js";import"./LatexTitle-ZrlO0rs7.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DEoip3HO.js";const $=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],D=s=>s==="trending"||s==="date_published"||s==="citation_count"?s:"trending",re=()=>{var j,f,N,y,P,v,S;const{orgSlug:s,taskSlug:n}=w(),[g,_]=R(),h=D(g.get("order_by")),z=t=>{const r=new URLSearchParams(g);r.set("order_by",t),_(r)},o=n==="all",O=o?void 0:n,i=k({queryKey:["organization",s],queryFn:()=>b.getOrganization(s),enabled:!!s,staleTime:10*60*1e3}),c=k({queryKey:["task",n],queryFn:()=>b.getTask(n),enabled:!!n&&!o,staleTime:10*60*1e3}),a=q({organizationSlug:s||"",taskSlug:O,page_size:12,order_by:h,order_dir:"desc",include_resources:!0,enabled:!!s}),{targetRef:T,isIntersecting:u}=C({rootMargin:"200px"});m.useEffect(()=>{u&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[u,a.hasNextPage,a.isFetchingNextPage]),m.useEffect(()=>{window.scrollTo(0,0)},[s,n]);const l=m.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(F=>F.results.map(E))},[a.data]),d=o?"All papers":L(((j=c.data)==null?void 0:j.name)||n||"",((f=c.data)==null?void 0:f.slug)||n),x=((y=(N=a.data)==null?void 0:N.pages[0])==null?void 0:y.count)??((P=i.data)==null?void 0:P.paper_count)??0,A=((v=i.data)==null?void 0:v.name)??s;return i.error||c.error||a.error?((S=i.error)==null?void 0:S.status)===404?e.jsx(M,{}):e.jsx("div",{className:"page",children:e.jsx(Q,{variant:"destructive",children:e.jsx(K,{children:"Failed to load organization papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(p,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(p,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx(p,{to:`/${s}`,children:A}),e.jsx("span",{children:" / "}),e.jsx("span",{children:d})]}),e.jsxs("div",{style:{marginTop:16,marginBottom:28},children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:o?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:d}),i.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:x.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:i.data.name})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:"Organization papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",x.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:$.map(([t,r])=>e.jsx("button",{className:`sort-btn ${h===t?"active":""}`,onClick:()=>z(t),children:r},t))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded in ",e.jsx("span",{children:d})]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,r)=>e.jsx(I,{className:"h-40 w-full"},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((t,r)=>e.jsx(B,{paper:t,rank:r+1},t.id))}),e.jsx("div",{ref:T,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{re as default};
assets/OrganizationsIndexView-mPCmASS0.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as e,L as l,a as o}from"./index-D3-tYEe-.js";import{u as d}from"./useQuery-C6S8Ozku.js";import{S as c}from"./skeleton-D0cyB03X.js";import{A as m,a as h}from"./alert-Ayuop_ag.js";const g={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},f=()=>{var n;const t=d({queryKey:["organizations"],queryFn:()=>o.getOrganizations(),staleTime:6e5});if(t.error)return e.jsx("div",{className:"page",children:e.jsx(m,{variant:"destructive",children:e.jsx(h,{children:"Failed to load organizations. Please try again."})})});const i=((n=t.data)==null?void 0:n.results)??[],r=i.reduce((a,s)=>a+(s.paper_count??0),0);return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research papers grouped by the labs and companies behind them."})]})}),t.isLoading?e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((a,s)=>e.jsx(c,{className:"h-24"},s))}):e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:g,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Organizations"})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.length," ",i.length===1?"organization":"organizations"," ·"," ",r.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:i.map(a=>e.jsxs(l,{to:`/${a.slug}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",style:{display:"flex",alignItems:"center",gap:10},children:[a.logo_url&&e.jsx("img",{src:a.logo_url,alt:"",width:24,height:24,style:{borderRadius:4,objectFit:"contain",flexShrink:0},onError:s=>{s.currentTarget.style.display="none"}}),a.name]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id))})]})]})};export{f as default};
assets/PaperDetailView-BBf2E08f.js DELETED
The diff for this file is too large to render. See raw diff
 
assets/PaperDetailView-D3EhNQS9.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as Ee,g as pa,r as i,j as e,P as yt,b as Y,d as ms,e as tt,f as ke,h as ha,i as ps,C as le,k as re,l as ue,m as me,X as hs,s as Se,n as fa,o as fs,p as xa,q as ga,t as va,v as ja,w as ba,x as $e,R as ya,y as Ne,A as xs,z as gs,B as _a,D as wa,E as ka,F as Na,G as Ca,H as Ea,I as Sa,J as Pa,K as ts,M as Ra,N as Aa,O as Ia,Q as Fa,S as Ta,T as $a,U as st,V as _t,a as et,W as vs,Y as js,Z as La,_ as Da,$ as Ma,a0 as Ua,L as _e,a1 as qa,a2 as Ha,a3 as Ba,a4 as Oa,a5 as Ka,a6 as za,a7 as Qa}from"./index-D3-tYEe-.js";import{u as oe}from"./useQuery-C6S8Ozku.js";import{I as ee,a as Va,T as Ga,M as Wa}from"./components-D244J_Aj.js";import{C as Xa}from"./ClosedSourceEvalBadge-drWiTHYQ.js";import{L as Xe,a as Ja}from"./LatexTitle-ZrlO0rs7.js";import{e as Ya}from"./transform-nNAikYlJ.js";import{f as Za,D as er}from"./latexPlainText-ChVkH0gY.js";import{b as tr}from"./usePapers-C3rZB7Pt.js";import{S as He}from"./skeleton-D0cyB03X.js";import{A as sr,a as ar}from"./alert-Ayuop_ag.js";import{I as ie,B as V}from"./input-C7eEyU6x.js";import{u as rr}from"./index-BsV_WMf3.js";import{D as pe,a as he,b as fe,c as xe,d as ge,e as Pe,R as nr,P as ir,O as or,C as lr}from"./dialog-DzRXUQ09.js";import{u as ve}from"./useMutation-DDsKa144.js";import{L as ne}from"./loader-circle-BKVFOFo9.js";import{B as bs,D as cr}from"./badge-CCpokg9G.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DEoip3HO.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 dr=Ee("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
7
+ * @license lucide-react v0.462.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const ss=Ee("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
12
+ * @license lucide-react v0.462.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const as=Ee("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
17
+ * @license lucide-react v0.462.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const at=Ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
22
+ * @license lucide-react v0.462.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Be=Ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
27
+ * @license lucide-react v0.462.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const ys=Ee("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
32
+ * @license lucide-react v0.462.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const rt=Ee("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function ur(t,a=!0){return oe({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return pa(t)},enabled:a&&!!t,staleTime:0,refetchOnMount:"always"})}const dt=async(t,a)=>{try{const r=await fetch(`https://huggingface.co/api/arxiv/${a}/repos`);if(!r.ok)return console.warn(`Failed to fetch repos for arXiv:${a}, status: ${r.status}`),{count:0,isLimited:!1};const n=((await r.json())[t]||[]).length;return console.log(`${t} count for arXiv:${a}: ${n}`),n<100?{count:n,isLimited:!1}:{count:n,isLimited:!0}}catch(r){return console.warn(`Failed to fetch ${t} count for arXiv:${a}:`,r),{count:0,isLimited:!1}}},mr=async t=>{const[a,r,u]=await Promise.all([dt("models",t),dt("datasets",t),dt("spaces",t)]);return{models:a.count,datasets:r.count,spaces:u.count,isLimited:a.isLimited||r.isLimited||u.isLimited}},pr=t=>oe({queryKey:["huggingface-repos",t],queryFn:()=>mr(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function hr(){const[t,a]=i.useState(!1),[r,u]=i.useState(!1),[n,l]=i.useState(!1),[o,p]=i.useState(!1),[s,f]=i.useState(!1),[_,v]=i.useState(!1),[E,k]=i.useState(!1);return{isEditingTasks:t,openTasksDialog:()=>a(!0),closeTasksDialog:()=>a(!1),setIsEditingTasks:a,isEditingMethods:r,openMethodsDialog:()=>u(!0),closeMethodsDialog:()=>u(!1),setIsEditingMethods:u,isEditingRepositories:n,openRepositoriesDialog:()=>l(!0),closeRepositoriesDialog:()=>l(!1),setIsEditingRepositories:l,isEditingProjectPages:o,openProjectPagesDialog:()=>p(!0),closeProjectPagesDialog:()=>p(!1),setIsEditingProjectPages:p,isEditingEvaluations:s,openEvaluationsDialog:()=>f(!0),closeEvaluationsDialog:()=>f(!1),setIsEditingEvaluations:f,isEditingSourceUrl:_,openSourceUrlDialog:()=>v(!0),closeSourceUrlDialog:()=>v(!1),setIsEditingSourceUrl:v,isEditingHfArtifacts:E,openHfArtifactsDialog:()=>k(!0),closeHfArtifactsDialog:()=>k(!1),setIsEditingHfArtifacts:k}}var nt="Checkbox",[fr]=ps(nt),[xr,wt]=fr(nt);function gr(t){const{__scopeCheckbox:a,checked:r,children:u,defaultChecked:n,disabled:l,form:o,name:p,onCheckedChange:s,required:f,value:_="on",internal_do_not_use_render:v}=t,[E,k]=ms({prop:r,defaultProp:n??!1,onChange:s,caller:nt}),[N,q]=i.useState(null),[M,A]=i.useState(null),F=i.useRef(!1),U=N?!!o||!!N.closest("form"):!0,P={checked:E,disabled:l,setChecked:k,control:N,setControl:q,name:p,form:o,value:_,hasConsumerStoppedPropagationRef:F,required:f,defaultChecked:ce(n)?!1:n,isFormControl:U,bubbleInput:M,setBubbleInput:A};return e.jsx(xr,{scope:a,...P,children:vr(v)?v(P):u})}var _s="CheckboxTrigger",ws=i.forwardRef(({__scopeCheckbox:t,onKeyDown:a,onClick:r,...u},n)=>{const{control:l,value:o,disabled:p,checked:s,required:f,setControl:_,setChecked:v,hasConsumerStoppedPropagationRef:E,isFormControl:k,bubbleInput:N}=wt(_s,t),q=tt(n,_),M=i.useRef(s);return i.useEffect(()=>{const A=l==null?void 0:l.form;if(A){const F=()=>v(M.current);return A.addEventListener("reset",F),()=>A.removeEventListener("reset",F)}},[l,v]),e.jsx(Y.button,{type:"button",role:"checkbox","aria-checked":ce(s)?"mixed":s,"aria-required":f,"data-state":Ss(s),"data-disabled":p?"":void 0,disabled:p,value:o,...u,ref:q,onKeyDown:ke(a,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:ke(r,A=>{v(F=>ce(F)?!0:!F),N&&k&&(E.current=A.isPropagationStopped(),E.current||A.stopPropagation())})})});ws.displayName=_s;var kt=i.forwardRef((t,a)=>{const{__scopeCheckbox:r,name:u,checked:n,defaultChecked:l,required:o,disabled:p,value:s,onCheckedChange:f,form:_,...v}=t;return e.jsx(gr,{__scopeCheckbox:r,checked:n,defaultChecked:l,disabled:p,required:o,onCheckedChange:f,name:u,form:_,value:s,internal_do_not_use_render:({isFormControl:E})=>e.jsxs(e.Fragment,{children:[e.jsx(ws,{...v,ref:a,__scopeCheckbox:r}),E&&e.jsx(Es,{__scopeCheckbox:r})]})})});kt.displayName=nt;var ks="CheckboxIndicator",Ns=i.forwardRef((t,a)=>{const{__scopeCheckbox:r,forceMount:u,...n}=t,l=wt(ks,r);return e.jsx(yt,{present:u||ce(l.checked)||l.checked===!0,children:e.jsx(Y.span,{"data-state":Ss(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:a,style:{pointerEvents:"none",...t.style}})})});Ns.displayName=ks;var Cs="CheckboxBubbleInput",Es=i.forwardRef(({__scopeCheckbox:t,...a},r)=>{const{control:u,hasConsumerStoppedPropagationRef:n,checked:l,defaultChecked:o,required:p,disabled:s,name:f,value:_,form:v,bubbleInput:E,setBubbleInput:k}=wt(Cs,t),N=tt(r,k),q=rr(l),M=ha(u);i.useEffect(()=>{const F=E;if(!F)return;const U=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(U,"checked").set,c=!n.current;if(q!==l&&j){const x=new Event("click",{bubbles:c});F.indeterminate=ce(l),j.call(F,ce(l)?!1:l),F.dispatchEvent(x)}},[E,q,l,n]);const A=i.useRef(ce(l)?!1:l);return e.jsx(Y.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??A.current,required:p,disabled:s,name:f,value:_,form:v,...a,tabIndex:-1,ref:N,style:{...a.style,...M,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Es.displayName=Cs;function vr(t){return typeof t=="function"}function ce(t){return t==="indeterminate"}function Ss(t){return ce(t)?"indeterminate":t?"checked":"unchecked"}const Nt=i.forwardRef(({className:t,style:a,...r},u)=>e.jsx(kt,{ref:u,className:re("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...a},...r,children:e.jsx(Ns,{className:re("flex items-center justify-center text-current"),children:e.jsx(le,{className:"h-4 w-4"})})}));Nt.displayName=kt.displayName;function jr(t,a,r){if(!t)return t;const u=n=>n.paper_id!==a||n.paper_title===r?n:{...n,paper_title:r};if(Array.isArray(t)){const n=t.map(u);return n.some((o,p)=>o!==t[p])?n:t}if(Array.isArray(t.results)){const n=t.results.map(u);return n.some((o,p)=>o!==t.results[p])?{...t,results:n}:t}return t}function De(t,a,r){new Set([...r,a.id,a.arxiv_id].filter(o=>!!o)).forEach(o=>{t.setQueryData(["paper",o],a),t.setQueryData(["paper-arxiv",o],a)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const n=String(a.id),l=o=>jr(o,n,a.title);t.setQueriesData({queryKey:["evaluations"]},l),t.setQueriesData({queryKey:["dataset-evals"]},l),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}function Re({isAuthor:t=!1}){return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:t?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}const br=250,yr=100;function _r({open:t,onOpenChange:a,paperId:r,arxivId:u,initialTaskIds:n,initialTasks:l,onSuccess:o,submitMode:p="direct",isAuthor:s=!1}){const[f,_]=i.useState(n),[v,E]=i.useState(""),[k,N]=i.useState(""),[q,M]=i.useState(new Map),A=ue(),{toast:F}=me(),U=i.useRef(!1);i.useEffect(()=>{if(!t){U.current=!1;return}if(U.current)return;U.current=!0,_(n),E(""),N("");const b=new Map;(l||[]).forEach(S=>{const R=parseInt(S.id);Number.isNaN(R)||b.set(R,S)}),M(b)},[t,n,l]),i.useEffect(()=>{const b=window.setTimeout(()=>{N(v.trim())},br);return()=>window.clearTimeout(b)},[v]);const{data:P,isFetching:j}=oe({queryKey:["tasks-search",k],queryFn:()=>fs({page_size:yr,visible_only:!0,...k?{q:k}:{}}),enabled:t});i.useEffect(()=>{var b;(b=P==null?void 0:P.results)!=null&&b.length&&M(S=>{const R=new Map(S);return P.results.forEach(L=>{const m=parseInt(L.id);Number.isNaN(m)||R.set(m,L)}),R})},[P]);const c=i.useMemo(()=>{const b=(P==null?void 0:P.results)||[],S=new Set,R=[];return f.forEach(L=>{if(S.has(L))return;const m=q.get(L);m&&(R.push(m),S.add(L))}),b.forEach(L=>{const m=parseInt(L.id);Number.isNaN(m)||S.has(m)||(R.push(L),S.add(m))}),R},[P,f,q]),x=ve({mutationFn:async({paperId:b,taskIds:S})=>p==="pending"?(await Se({paper_id:parseInt(b),edit_type:"tasks",proposed_payload:{task_ids:S}}),null):fa(b,S),onMutate:async({taskIds:b})=>{if(p==="pending")return{snapshots:[]};const S=b.map(m=>q.get(m)).filter(m=>!!m).map(m=>({id:m.id,name:m.name,slug:m.slug})).sort((m,w)=>m.name.localeCompare(w.name)),R=Array.from(new Set([r,u].filter(m=>!!m)));await Promise.all(R.flatMap(m=>[A.cancelQueries({queryKey:["paper",m]}),A.cancelQueries({queryKey:["paper-arxiv",m]})]));const L=[];return R.forEach(m=>{["paper","paper-arxiv"].forEach(w=>{const C=[w,m],g=A.getQueryData(C);L.push({key:C,data:g}),g&&A.setQueryData(C,{...g,tasks:S})})}),F({title:"Tasks updated",description:`Saved ${b.length} task${b.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1),{snapshots:L}},onSuccess:b=>{if(p==="pending"){F({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),o==null||o(),a(!1);return}b&&De(A,b,[r,u])},onError:(b,S,R)=>{var w,C;(w=R==null?void 0:R.snapshots)==null||w.forEach(({key:g,data:y})=>{A.setQueryData(g,y)});const L=b;let m=L.message||(p==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(L.response)try{const g=JSON.parse(L.response);typeof(g==null?void 0:g.detail)=="string"?m=g.detail:Array.isArray(g==null?void 0:g.detail)&&((C=g.detail[0])!=null&&C.msg)&&(m=g.detail[0].msg)}catch{m=L.response}F({title:p==="pending"?"Could not submit edit":"Could not save tasks",description:m,variant:"destructive"})}}),D=()=>{x.mutate({paperId:r,taskIds:f})},H=i.useMemo(()=>{if(f.length!==n.length)return!0;const b=new Set(n);return f.some(S=>!b.has(S))},[f,n]),B=(b,S)=>{_(R=>S?R.includes(b)?R:[...R,b]:R.filter(L=>L!==b))},te=()=>E("");return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Paper Tasks"}),e.jsx(ge,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),p==="pending"&&e.jsx(Re,{isAuthor:s}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Be,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ie,{type:"text",placeholder:"Search tasks...",value:v,onChange:b=>E(b.target.value),className:"pl-9 pr-9"}),v&&e.jsx("button",{type:"button",onClick:te,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(hs,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:c.length>0?e.jsx("div",{className:"space-y-2",children:c.map(b=>{const S=parseInt(b.id),R=f.includes(S);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Nt,{id:`task-${b.id}`,checked:R,onCheckedChange:L=>B(S,L===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${b.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[b.name,b.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[b.description.substring(0,100),b.description.length>100?"...":""]})]})]},b.id)})}):j?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Be,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:k?`No tasks found matching "${k}"`:"No tasks available"})]})}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:D,disabled:x.isPending||!H,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),p==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),p==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const wr=250,kr=100;function Nr({open:t,onOpenChange:a,paperId:r,arxivId:u,initialMethodIds:n,initialMethods:l,onSuccess:o,submitMode:p="direct",isAuthor:s=!1}){const[f,_]=i.useState(n),[v,E]=i.useState(""),[k,N]=i.useState(""),[q,M]=i.useState(new Map),A=ue(),{toast:F}=me(),U=i.useRef(!1);i.useEffect(()=>{if(!t){U.current=!1;return}if(U.current)return;U.current=!0,_(n),E(""),N("");const b=new Map;(l||[]).forEach(S=>{const R=parseInt(S.id);Number.isNaN(R)||b.set(R,S)}),M(b)},[t,n,l]),i.useEffect(()=>{const b=window.setTimeout(()=>{N(v.trim())},wr);return()=>window.clearTimeout(b)},[v]);const{data:P,isFetching:j}=oe({queryKey:["methods-search",k],queryFn:()=>ga({page_size:kr,...k?{q:k}:{}}),enabled:t});i.useEffect(()=>{var b;(b=P==null?void 0:P.results)!=null&&b.length&&M(S=>{const R=new Map(S);return P.results.forEach(L=>{const m=parseInt(L.id);Number.isNaN(m)||R.set(m,L)}),R})},[P]);const c=i.useMemo(()=>{const b=(P==null?void 0:P.results)||[],S=new Set,R=[];return f.forEach(L=>{if(S.has(L))return;const m=q.get(L);m&&(R.push(m),S.add(L))}),b.forEach(L=>{const m=parseInt(L.id);Number.isNaN(m)||S.has(m)||(R.push(L),S.add(m))}),R},[P,f,q]),x=ve({mutationFn:async({paperId:b,methodIds:S})=>p==="pending"?(await Se({paper_id:parseInt(b),edit_type:"methods",proposed_payload:{method_ids:S}}),null):xa(b,S),onSuccess:b=>{if(p==="pending"){F({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),o==null||o(),a(!1);return}b&&De(A,b,[r,u]),F({title:"Methods updated",description:`Saved ${f.length} method${f.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1)},onError:b=>{var L;const S=b;let R=S.message||(p==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(S.response)try{const m=JSON.parse(S.response);typeof(m==null?void 0:m.detail)=="string"?R=m.detail:Array.isArray(m==null?void 0:m.detail)&&((L=m.detail[0])!=null&&L.msg)&&(R=m.detail[0].msg)}catch{R=S.response}F({title:p==="pending"?"Could not submit edit":"Could not save methods",description:R,variant:"destructive"})}}),D=()=>{x.mutate({paperId:r,methodIds:f})},H=i.useMemo(()=>{if(f.length!==n.length)return!0;const b=new Set(n);return f.some(S=>!b.has(S))},[f,n]),B=(b,S)=>{_(R=>S?R.includes(b)?R:[...R,b]:R.filter(L=>L!==b))},te=()=>E("");return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Paper Methods"}),e.jsx(ge,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),p==="pending"&&e.jsx(Re,{isAuthor:s}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Be,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ie,{type:"text",placeholder:"Search methods...",value:v,onChange:b=>E(b.target.value),className:"pl-9 pr-9"}),v&&e.jsx("button",{type:"button",onClick:te,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(hs,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:c.length>0?e.jsx("div",{className:"space-y-2",children:c.map(b=>{const S=parseInt(b.id),R=f.includes(S);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Nt,{id:`method-${b.id}`,checked:R,onCheckedChange:L=>B(S,L===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${b.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[b.name,b.full_name&&b.full_name!==b.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:b.full_name}),b.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[b.description.substring(0,100),b.description.length>100?"...":""]})]})]},b.id)})}):j?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Be,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:k?`No methods found matching "${k}"`:"No methods available"})]})}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:D,disabled:x.isPending||!H,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),p==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),p==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Cr({open:t,onOpenChange:a,paperId:r,arxivId:u,initialRepositories:n,onSuccess:l,submitMode:o="direct",isAuthor:p=!1}){const[s,f]=i.useState(n),[_,v]=i.useState(""),E=ue(),{toast:k}=me(),N=i.useRef(!1);i.useEffect(()=>{if(!t){N.current=!1;return}N.current||(N.current=!0,f(n),v(""))},[t,n]);const q=ve({mutationFn:async({paperId:c,repositories:x})=>o==="pending"?(await Se({paper_id:parseInt(c),edit_type:"repositories",proposed_payload:{repositories:x}}),null):va(c,x),onSuccess:c=>{if(o==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),l==null||l(),a(!1),v("");return}c&&De(E,c,[r,u]),l==null||l(),a(!1),v("")},onError:c=>{var H;const x=c;let D=x.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(x.response)try{const B=JSON.parse(x.response);typeof(B==null?void 0:B.detail)=="string"?D=B.detail:Array.isArray(B==null?void 0:B.detail)&&((H=B.detail[0])!=null&&H.msg)&&(D=B.detail[0].msg)}catch{D=x.response}k({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:D,variant:"destructive"})}}),M=()=>{const c=_.trim();return c?s.some(x=>x.url===c)?(alert("This repository URL is already added"),null):[...s,{url:c,is_official:!1}]:s},A=()=>{const c=M();c!==null&&c.length!==s.length&&(f(c),v(""))},F=c=>{f(s.filter(x=>x.url!==c))},U=c=>{f(s.map(x=>x.url===c?{...x,is_official:!x.is_official}:x))},P=()=>{const c=M();c!==null&&q.mutate({paperId:r,repositories:c})},j=i.useMemo(()=>{const c=_.trim(),x=c?[...s,{url:c,is_official:!1}]:s;if(x.length!==n.length)return!0;const D=new Map(n.map(H=>[H.url.trim(),!!H.is_official]));return x.some(H=>{const B=D.get(H.url.trim());return B===void 0||B!==!!H.is_official})},[s,_,n]);return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Paper Repositories"}),e.jsx(ge,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(Re,{isAuthor:p}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(ie,{type:"url",placeholder:"https://github.com/owner/repo",value:_,onChange:c=>v(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),A())},className:"flex-1"}),e.jsxs(V,{onClick:A,size:"sm",disabled:!_.trim(),children:[e.jsx(at,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:s.length>0?e.jsx("div",{className:"space-y-2",children:s.map((c,x)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(ss,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:c.url}),c.is_official&&e.jsx(bs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(V,{variant:c.is_official?"default":"outline",size:"sm",onClick:()=>U(c.url),className:"h-8 px-2 text-xs",title:c.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ys,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>F(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(rt,{className:"w-4 h-4"})})]})]},x))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ss,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:P,disabled:q.isPending||!j,children:q.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Er({open:t,onOpenChange:a,paperId:r,arxivId:u,initialProjectPages:n,onSuccess:l,submitMode:o="direct",isAuthor:p=!1}){const[s,f]=i.useState(n),[_,v]=i.useState(""),E=ue(),{toast:k}=me(),N=i.useRef(!1);i.useEffect(()=>{if(!t){N.current=!1;return}N.current||(N.current=!0,f(n),v(""))},[t,n]);const q=ve({mutationFn:async({paperId:c,projectPages:x})=>o==="pending"?(await Se({paper_id:parseInt(c),edit_type:"project_pages",proposed_payload:{project_pages:x}}),null):ja(c,x),onSuccess:c=>{if(o==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),l==null||l(),a(!1),v("");return}c&&De(E,c,[r,u]),l==null||l(),a(!1),v("")},onError:c=>{var H;const x=c;let D=x.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(x.response)try{const B=JSON.parse(x.response);typeof(B==null?void 0:B.detail)=="string"?D=B.detail:Array.isArray(B==null?void 0:B.detail)&&((H=B.detail[0])!=null&&H.msg)&&(D=B.detail[0].msg)}catch{D=x.response}k({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:D,variant:"destructive"})}}),M=()=>{const c=_.trim();return c?s.some(x=>x.url===c)?(alert("This project page URL is already added"),null):[...s,{url:c,is_official:!1}]:s},A=()=>{const c=M();c!==null&&c.length!==s.length&&(f(c),v(""))},F=c=>{f(s.filter(x=>x.url!==c))},U=c=>{f(s.map(x=>x.url===c?{...x,is_official:!x.is_official}:x))},P=()=>{const c=M();c!==null&&q.mutate({paperId:r,projectPages:c})},j=i.useMemo(()=>{const c=_.trim(),x=c?[...s,{url:c,is_official:!1}]:s;if(x.length!==n.length)return!0;const D=new Map(n.map(H=>[H.url.trim(),!!H.is_official]));return x.some(H=>{const B=D.get(H.url.trim());return B===void 0||B!==!!H.is_official})},[s,_,n]);return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Paper Project Pages"}),e.jsx(ge,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(Re,{isAuthor:p}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(ie,{type:"url",placeholder:"https://example.com/project",value:_,onChange:c=>v(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),A())},className:"flex-1"}),e.jsxs(V,{onClick:A,size:"sm",disabled:!_.trim(),children:[e.jsx(at,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:s.length>0?e.jsx("div",{className:"space-y-2",children:s.map((c,x)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(as,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:c.url}),c.is_official&&e.jsx(bs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(V,{variant:c.is_official?"default":"outline",size:"sm",onClick:()=>U(c.url),className:"h-8 px-2 text-xs",title:c.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ys,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>F(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(rt,{className:"w-4 h-4"})})]})]},x))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(as,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:P,disabled:q.isPending||!j,children:q.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Sr({open:t,onOpenChange:a,paperId:r,arxivId:u,initialUrl:n,onSuccess:l,submitMode:o="direct",isAuthor:p=!1}){const[s,f]=i.useState(n),_=ue(),{toast:v}=me(),E=i.useRef(!1);i.useEffect(()=>{if(!t){E.current=!1;return}E.current||(E.current=!0,f(n))},[t,n]);const k=ve({mutationFn:async({paperId:F,sourceUrl:U})=>o==="pending"?(await Se({paper_id:parseInt(F),edit_type:"source_url",proposed_payload:{source_url:U}}),null):ba(F,U),onSuccess:F=>{if(o==="pending"){v({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),l==null||l(),a(!1);return}F&&De(_,F,[r,u]),l==null||l(),a(!1)},onError:F=>{var j;const U=F;let P=U.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(U.response)try{const c=JSON.parse(U.response);typeof(c==null?void 0:c.detail)=="string"?P=c.detail:Array.isArray(c==null?void 0:c.detail)&&((j=c.detail[0])!=null&&j.msg)&&(P=c.detail[0].msg)}catch{P=U.response}v({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:P,variant:"destructive"})}}),N=s.trim(),q=/^https?:\/\//i.test(N),M=N!==(n||"").trim(),A=()=>{q&&k.mutate({paperId:r,sourceUrl:N})};return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Source URL"}),e.jsxs(ge,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(Re,{isAuthor:p}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(ie,{type:"url",placeholder:"https://example.com/paper",value:s,onChange:F=>f(F.target.value),onKeyPress:F=>{F.key==="Enter"&&q&&M&&(F.preventDefault(),A())}}),!q&&N.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:A,disabled:k.isPending||!q||!M,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Pr(t){const a=Rr(t),r=i.forwardRef((u,n)=>{const{children:l,...o}=u,p=i.Children.toArray(l),s=p.find(Ir);if(s){const f=s.props.children,_=p.map(v=>v===s?i.Children.count(f)>1?i.Children.only(null):i.isValidElement(f)?f.props.children:null:v);return e.jsx(a,{...o,ref:n,children:i.isValidElement(f)?i.cloneElement(f,void 0,_):null})}return e.jsx(a,{...o,ref:n,children:l})});return r.displayName=`${t}.Slot`,r}function Rr(t){const a=i.forwardRef((r,u)=>{const{children:n,...l}=r;if(i.isValidElement(n)){const o=Tr(n),p=Fr(l,n.props);return n.type!==i.Fragment&&(p.ref=u?$e(u,o):o),i.cloneElement(n,p)}return i.Children.count(n)>1?i.Children.only(null):null});return a.displayName=`${t}.SlotClone`,a}var Ar=Symbol("radix.slottable");function Ir(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Ar}function Fr(t,a){const r={...a};for(const u in a){const n=t[u],l=a[u];/^on[A-Z]/.test(u)?n&&l?r[u]=(...p)=>{const s=l(...p);return n(...p),s}:n&&(r[u]=n):u==="style"?r[u]={...n,...l}:u==="className"&&(r[u]=[n,l].filter(Boolean).join(" "))}return{...t,...r}}function Tr(t){var u,n;let a=(u=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:u.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?t.ref:(a=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var it="Popover",[Ps]=ps(it,[gs]),Oe=gs(),[$r,je]=Ps(it),Rs=t=>{const{__scopePopover:a,children:r,open:u,defaultOpen:n,onOpenChange:l,modal:o=!1}=t,p=Oe(a),s=i.useRef(null),[f,_]=i.useState(!1),[v,E]=ms({prop:u,defaultProp:n??!1,onChange:l,caller:it});return e.jsx(ya,{...p,children:e.jsx($r,{scope:a,contentId:Ne(),triggerRef:s,open:v,onOpenChange:E,onOpenToggle:i.useCallback(()=>E(k=>!k),[E]),hasCustomAnchor:f,onCustomAnchorAdd:i.useCallback(()=>_(!0),[]),onCustomAnchorRemove:i.useCallback(()=>_(!1),[]),modal:o,children:r})})};Rs.displayName=it;var As="PopoverAnchor",Lr=i.forwardRef((t,a)=>{const{__scopePopover:r,...u}=t,n=je(As,r),l=Oe(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(o(),()=>p()),[o,p]),e.jsx(xs,{...l,...u,ref:a})});Lr.displayName=As;var Is="PopoverTrigger",Fs=i.forwardRef((t,a)=>{const{__scopePopover:r,...u}=t,n=je(Is,r),l=Oe(r),o=tt(a,n.triggerRef),p=e.jsx(Y.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Ms(n.open),...u,ref:o,onClick:ke(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:e.jsx(xs,{asChild:!0,...l,children:p})});Fs.displayName=Is;var Ct="PopoverPortal",[Dr,Mr]=Ps(Ct,{forceMount:void 0}),Ts=t=>{const{__scopePopover:a,forceMount:r,children:u,container:n}=t,l=je(Ct,a);return e.jsx(Dr,{scope:a,forceMount:r,children:e.jsx(yt,{present:r||l.open,children:e.jsx(_a,{asChild:!0,container:n,children:u})})})};Ts.displayName=Ct;var Le="PopoverContent",$s=i.forwardRef((t,a)=>{const r=Mr(Le,t.__scopePopover),{forceMount:u=r.forceMount,...n}=t,l=je(Le,t.__scopePopover);return e.jsx(yt,{present:u||l.open,children:l.modal?e.jsx(qr,{...n,ref:a}):e.jsx(Hr,{...n,ref:a})})});$s.displayName=Le;var Ur=Pr("PopoverContent.RemoveScroll"),qr=i.forwardRef((t,a)=>{const r=je(Le,t.__scopePopover),u=i.useRef(null),n=tt(a,u),l=i.useRef(!1);return i.useEffect(()=>{const o=u.current;if(o)return wa(o)},[]),e.jsx(ka,{as:Ur,allowPinchZoom:!0,children:e.jsx(Ls,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(t.onCloseAutoFocus,o=>{var p;o.preventDefault(),l.current||(p=r.triggerRef.current)==null||p.focus()}),onPointerDownOutside:ke(t.onPointerDownOutside,o=>{const p=o.detail.originalEvent,s=p.button===0&&p.ctrlKey===!0,f=p.button===2||s;l.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:ke(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Hr=i.forwardRef((t,a)=>{const r=je(Le,t.__scopePopover),u=i.useRef(!1),n=i.useRef(!1);return e.jsx(Ls,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var o,p;(o=t.onCloseAutoFocus)==null||o.call(t,l),l.defaultPrevented||(u.current||(p=r.triggerRef.current)==null||p.focus(),l.preventDefault()),u.current=!1,n.current=!1},onInteractOutside:l=>{var s,f;(s=t.onInteractOutside)==null||s.call(t,l),l.defaultPrevented||(u.current=!0,l.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const o=l.target;((f=r.triggerRef.current)==null?void 0:f.contains(o))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&n.current&&l.preventDefault()}})}),Ls=i.forwardRef((t,a)=>{const{__scopePopover:r,trapFocus:u,onOpenAutoFocus:n,onCloseAutoFocus:l,disableOutsidePointerEvents:o,onEscapeKeyDown:p,onPointerDownOutside:s,onFocusOutside:f,onInteractOutside:_,...v}=t,E=je(Le,r),k=Oe(r);return Na(),e.jsx(Ca,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:n,onUnmountAutoFocus:l,children:e.jsx(Ea,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:_,onEscapeKeyDown:p,onPointerDownOutside:s,onFocusOutside:f,onDismiss:()=>E.onOpenChange(!1),children:e.jsx(Sa,{"data-state":Ms(E.open),role:"dialog",id:E.contentId,...k,...v,ref:a,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ds="PopoverClose",Br=i.forwardRef((t,a)=>{const{__scopePopover:r,...u}=t,n=je(Ds,r);return e.jsx(Y.button,{type:"button",...u,ref:a,onClick:ke(t.onClick,()=>n.onOpenChange(!1))})});Br.displayName=Ds;var Or="PopoverArrow",Kr=i.forwardRef((t,a)=>{const{__scopePopover:r,...u}=t,n=Oe(r);return e.jsx(Pa,{...n,...u,ref:a})});Kr.displayName=Or;function Ms(t){return t?"open":"closed"}var zr=Rs,Qr=Fs,Vr=Ts,Us=$s;const Gr=zr,Wr=Qr,qs=i.forwardRef(({className:t,align:a="center",sideOffset:r=4,...u},n)=>e.jsx(Vr,{children:e.jsx(Us,{ref:n,align:a,sideOffset:r,className:re("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...u})}));qs.displayName=Us.displayName;var rs=1,Xr=.9,Jr=.8,Yr=.17,ut=.1,mt=.999,Zr=.9999,en=.99,tn=/[\\\/_+.#"@\[\(\{&]/,sn=/[\\\/_+.#"@\[\(\{&]/g,an=/[\s-]/,Hs=/[\s-]/g;function jt(t,a,r,u,n,l,o){if(l===a.length)return n===t.length?rs:en;var p=`${n},${l}`;if(o[p]!==void 0)return o[p];for(var s=u.charAt(l),f=r.indexOf(s,n),_=0,v,E,k,N;f>=0;)v=jt(t,a,r,u,f+1,l+1,o),v>_&&(f===n?v*=rs:tn.test(t.charAt(f-1))?(v*=Jr,k=t.slice(n,f-1).match(sn),k&&n>0&&(v*=Math.pow(mt,k.length))):an.test(t.charAt(f-1))?(v*=Xr,N=t.slice(n,f-1).match(Hs),N&&n>0&&(v*=Math.pow(mt,N.length))):(v*=Yr,n>0&&(v*=Math.pow(mt,f-n))),t.charAt(f)!==a.charAt(l)&&(v*=Zr)),(v<ut&&r.charAt(f-1)===u.charAt(l+1)||u.charAt(l+1)===u.charAt(l)&&r.charAt(f-1)!==u.charAt(l))&&(E=jt(t,a,r,u,f+1,l+2,o),E*ut>v&&(v=E*ut)),v>_&&(_=v),f=r.indexOf(s,f+1);return o[p]=_,_}function ns(t){return t.toLowerCase().replace(Hs," ")}function rn(t,a,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,jt(t,a,ns(t),ns(a),0,0,{})}var qe='[cmdk-group=""]',pt='[cmdk-group-items=""]',nn='[cmdk-group-heading=""]',Bs='[cmdk-item=""]',is=`${Bs}:not([aria-disabled="true"])`,bt="cmdk-item-select",Ie="data-value",on=(t,a,r)=>rn(t,a,r),Os=i.createContext(void 0),Ke=()=>i.useContext(Os),Ks=i.createContext(void 0),Et=()=>i.useContext(Ks),zs=i.createContext(void 0),Qs=i.forwardRef((t,a)=>{let r=Fe(()=>{var h,$;return{search:"",value:($=(h=t.value)!=null?h:t.defaultValue)!=null?$:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=Fe(()=>new Set),n=Fe(()=>new Map),l=Fe(()=>new Map),o=Fe(()=>new Set),p=Vs(t),{label:s,children:f,value:_,onValueChange:v,filter:E,shouldFilter:k,loop:N,disablePointerSelection:q=!1,vimBindings:M=!0,...A}=t,F=Ne(),U=Ne(),P=Ne(),j=i.useRef(null),c=vn();Ce(()=>{if(_!==void 0){let h=_.trim();r.current.value=h,x.emit()}},[_]),Ce(()=>{c(6,S)},[]);let x=i.useMemo(()=>({subscribe:h=>(o.current.add(h),()=>o.current.delete(h)),snapshot:()=>r.current,setState:(h,$,O)=>{var I,K,Q,X;if(!Object.is(r.current[h],$)){if(r.current[h]=$,h==="search")b(),B(),c(1,te);else if(h==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let W=document.getElementById(P);W?W.focus():(I=document.getElementById(F))==null||I.focus()}if(c(7,()=>{var W;r.current.selectedItemId=(W=R())==null?void 0:W.id,x.emit()}),O||c(5,S),((K=p.current)==null?void 0:K.value)!==void 0){let W=$??"";(X=(Q=p.current).onValueChange)==null||X.call(Q,W);return}}x.emit()}},emit:()=>{o.current.forEach(h=>h())}}),[]),D=i.useMemo(()=>({value:(h,$,O)=>{var I;$!==((I=l.current.get(h))==null?void 0:I.value)&&(l.current.set(h,{value:$,keywords:O}),r.current.filtered.items.set(h,H($,O)),c(2,()=>{B(),x.emit()}))},item:(h,$)=>(u.current.add(h),$&&(n.current.has($)?n.current.get($).add(h):n.current.set($,new Set([h]))),c(3,()=>{b(),B(),r.current.value||te(),x.emit()}),()=>{l.current.delete(h),u.current.delete(h),r.current.filtered.items.delete(h);let O=R();c(4,()=>{b(),(O==null?void 0:O.getAttribute("id"))===h&&te(),x.emit()})}),group:h=>(n.current.has(h)||n.current.set(h,new Set),()=>{l.current.delete(h),n.current.delete(h)}),filter:()=>p.current.shouldFilter,label:s||t["aria-label"],getDisablePointerSelection:()=>p.current.disablePointerSelection,listId:F,inputId:P,labelId:U,listInnerRef:j}),[]);function H(h,$){var O,I;let K=(I=(O=p.current)==null?void 0:O.filter)!=null?I:on;return h?K(h,r.current.search,$):0}function B(){if(!r.current.search||p.current.shouldFilter===!1)return;let h=r.current.filtered.items,$=[];r.current.filtered.groups.forEach(I=>{let K=n.current.get(I),Q=0;K.forEach(X=>{let W=h.get(X);Q=Math.max(W,Q)}),$.push([I,Q])});let O=j.current;L().sort((I,K)=>{var Q,X;let W=I.getAttribute("id"),Z=K.getAttribute("id");return((Q=h.get(Z))!=null?Q:0)-((X=h.get(W))!=null?X:0)}).forEach(I=>{let K=I.closest(pt);K?K.appendChild(I.parentElement===K?I:I.closest(`${pt} > *`)):O.appendChild(I.parentElement===O?I:I.closest(`${pt} > *`))}),$.sort((I,K)=>K[1]-I[1]).forEach(I=>{var K;let Q=(K=j.current)==null?void 0:K.querySelector(`${qe}[${Ie}="${encodeURIComponent(I[0])}"]`);Q==null||Q.parentElement.appendChild(Q)})}function te(){let h=L().find(O=>O.getAttribute("aria-disabled")!=="true"),$=h==null?void 0:h.getAttribute(Ie);x.setState("value",$||void 0)}function b(){var h,$,O,I;if(!r.current.search||p.current.shouldFilter===!1){r.current.filtered.count=u.current.size;return}r.current.filtered.groups=new Set;let K=0;for(let Q of u.current){let X=($=(h=l.current.get(Q))==null?void 0:h.value)!=null?$:"",W=(I=(O=l.current.get(Q))==null?void 0:O.keywords)!=null?I:[],Z=H(X,W);r.current.filtered.items.set(Q,Z),Z>0&&K++}for(let[Q,X]of n.current)for(let W of X)if(r.current.filtered.items.get(W)>0){r.current.filtered.groups.add(Q);break}r.current.filtered.count=K}function S(){var h,$,O;let I=R();I&&(((h=I.parentElement)==null?void 0:h.firstChild)===I&&((O=($=I.closest(qe))==null?void 0:$.querySelector(nn))==null||O.scrollIntoView({block:"nearest"})),I.scrollIntoView({block:"nearest"}))}function R(){var h;return(h=j.current)==null?void 0:h.querySelector(`${Bs}[aria-selected="true"]`)}function L(){var h;return Array.from(((h=j.current)==null?void 0:h.querySelectorAll(is))||[])}function m(h){let $=L()[h];$&&x.setState("value",$.getAttribute(Ie))}function w(h){var $;let O=R(),I=L(),K=I.findIndex(X=>X===O),Q=I[K+h];($=p.current)!=null&&$.loop&&(Q=K+h<0?I[I.length-1]:K+h===I.length?I[0]:I[K+h]),Q&&x.setState("value",Q.getAttribute(Ie))}function C(h){let $=R(),O=$==null?void 0:$.closest(qe),I;for(;O&&!I;)O=h>0?xn(O,qe):gn(O,qe),I=O==null?void 0:O.querySelector(is);I?x.setState("value",I.getAttribute(Ie)):w(h)}let g=()=>m(L().length-1),y=h=>{h.preventDefault(),h.metaKey?g():h.altKey?C(1):w(1)},z=h=>{h.preventDefault(),h.metaKey?m(0):h.altKey?C(-1):w(-1)};return i.createElement(Y.div,{ref:a,tabIndex:-1,...A,"cmdk-root":"",onKeyDown:h=>{var $;($=A.onKeyDown)==null||$.call(A,h);let O=h.nativeEvent.isComposing||h.keyCode===229;if(!(h.defaultPrevented||O))switch(h.key){case"n":case"j":{M&&h.ctrlKey&&y(h);break}case"ArrowDown":{y(h);break}case"p":case"k":{M&&h.ctrlKey&&z(h);break}case"ArrowUp":{z(h);break}case"Home":{h.preventDefault(),m(0);break}case"End":{h.preventDefault(),g();break}case"Enter":{h.preventDefault();let I=R();if(I){let K=new Event(bt);I.dispatchEvent(K)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:bn},s),ot(t,h=>i.createElement(Ks.Provider,{value:x},i.createElement(Os.Provider,{value:D},h))))}),ln=i.forwardRef((t,a)=>{var r,u;let n=Ne(),l=i.useRef(null),o=i.useContext(zs),p=Ke(),s=Vs(t),f=(u=(r=s.current)==null?void 0:r.forceMount)!=null?u:o==null?void 0:o.forceMount;Ce(()=>{if(!f)return p.item(n,o==null?void 0:o.id)},[f]);let _=Gs(n,l,[t.value,t.children,l],t.keywords),v=Et(),E=de(c=>c.value&&c.value===_.current),k=de(c=>f||p.filter()===!1?!0:c.search?c.filtered.items.get(n)>0:!0);i.useEffect(()=>{let c=l.current;if(!(!c||t.disabled))return c.addEventListener(bt,N),()=>c.removeEventListener(bt,N)},[k,t.onSelect,t.disabled]);function N(){var c,x;q(),(x=(c=s.current).onSelect)==null||x.call(c,_.current)}function q(){v.setState("value",_.current,!0)}if(!k)return null;let{disabled:M,value:A,onSelect:F,forceMount:U,keywords:P,...j}=t;return i.createElement(Y.div,{ref:$e(l,a),...j,id:n,"cmdk-item":"",role:"option","aria-disabled":!!M,"aria-selected":!!E,"data-disabled":!!M,"data-selected":!!E,onPointerMove:M||p.getDisablePointerSelection()?void 0:q,onClick:M?void 0:N},t.children)}),cn=i.forwardRef((t,a)=>{let{heading:r,children:u,forceMount:n,...l}=t,o=Ne(),p=i.useRef(null),s=i.useRef(null),f=Ne(),_=Ke(),v=de(k=>n||_.filter()===!1?!0:k.search?k.filtered.groups.has(o):!0);Ce(()=>_.group(o),[]),Gs(o,p,[t.value,t.heading,s]);let E=i.useMemo(()=>({id:o,forceMount:n}),[n]);return i.createElement(Y.div,{ref:$e(p,a),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&i.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:f},r),ot(t,k=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?f:void 0},i.createElement(zs.Provider,{value:E},k))))}),dn=i.forwardRef((t,a)=>{let{alwaysRender:r,...u}=t,n=i.useRef(null),l=de(o=>!o.search);return!r&&!l?null:i.createElement(Y.div,{ref:$e(n,a),...u,"cmdk-separator":"",role:"separator"})}),un=i.forwardRef((t,a)=>{let{onValueChange:r,...u}=t,n=t.value!=null,l=Et(),o=de(f=>f.search),p=de(f=>f.selectedItemId),s=Ke();return i.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),i.createElement(Y.input,{ref:a,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":p,id:s.inputId,type:"text",value:n?t.value:o,onChange:f=>{n||l.setState("search",f.target.value),r==null||r(f.target.value)}})}),mn=i.forwardRef((t,a)=>{let{children:r,label:u="Suggestions",...n}=t,l=i.useRef(null),o=i.useRef(null),p=de(f=>f.selectedItemId),s=Ke();return i.useEffect(()=>{if(o.current&&l.current){let f=o.current,_=l.current,v,E=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let k=f.offsetHeight;_.style.setProperty("--cmdk-list-height",k.toFixed(1)+"px")})});return E.observe(f),()=>{cancelAnimationFrame(v),E.unobserve(f)}}},[]),i.createElement(Y.div,{ref:$e(l,a),...n,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":p,"aria-label":u,id:s.listId},ot(t,f=>i.createElement("div",{ref:$e(o,s.listInnerRef),"cmdk-list-sizer":""},f)))}),pn=i.forwardRef((t,a)=>{let{open:r,onOpenChange:u,overlayClassName:n,contentClassName:l,container:o,...p}=t;return i.createElement(nr,{open:r,onOpenChange:u},i.createElement(ir,{container:o},i.createElement(or,{"cmdk-overlay":"",className:n}),i.createElement(lr,{"aria-label":t.label,"cmdk-dialog":"",className:l},i.createElement(Qs,{ref:a,...p}))))}),hn=i.forwardRef((t,a)=>de(r=>r.filtered.count===0)?i.createElement(Y.div,{ref:a,...t,"cmdk-empty":"",role:"presentation"}):null),fn=i.forwardRef((t,a)=>{let{progress:r,children:u,label:n="Loading...",...l}=t;return i.createElement(Y.div,{ref:a,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},ot(t,o=>i.createElement("div",{"aria-hidden":!0},o)))}),J=Object.assign(Qs,{List:mn,Item:ln,Input:un,Group:cn,Separator:dn,Dialog:pn,Empty:hn,Loading:fn});function xn(t,a){let r=t.nextElementSibling;for(;r;){if(r.matches(a))return r;r=r.nextElementSibling}}function gn(t,a){let r=t.previousElementSibling;for(;r;){if(r.matches(a))return r;r=r.previousElementSibling}}function Vs(t){let a=i.useRef(t);return Ce(()=>{a.current=t}),a}var Ce=typeof window>"u"?i.useEffect:i.useLayoutEffect;function Fe(t){let a=i.useRef();return a.current===void 0&&(a.current=t()),a}function de(t){let a=Et(),r=()=>t(a.snapshot());return i.useSyncExternalStore(a.subscribe,r,r)}function Gs(t,a,r,u=[]){let n=i.useRef(),l=Ke();return Ce(()=>{var o;let p=(()=>{var f;for(let _ of r){if(typeof _=="string")return _.trim();if(typeof _=="object"&&"current"in _)return _.current?(f=_.current.textContent)==null?void 0:f.trim():n.current}})(),s=u.map(f=>f.trim());l.value(t,p,s),(o=a.current)==null||o.setAttribute(Ie,p),n.current=p}),n}var vn=()=>{let[t,a]=i.useState(),r=Fe(()=>new Map);return Ce(()=>{r.current.forEach(u=>u()),r.current=new Map},[t]),(u,n)=>{r.current.set(u,n),a({})}};function jn(t){let a=t.type;return typeof a=="function"?a(t.props):"render"in a?a.render(t.props):t}function ot({asChild:t,children:a},r){return t&&i.isValidElement(a)?i.cloneElement(jn(a),{ref:a.ref},r(a.props.children)):r(a)}var bn={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ws=i.forwardRef(({className:t,...a},r)=>e.jsx(J,{ref:r,className:re("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...a}));Ws.displayName=J.displayName;const Xs=i.forwardRef(({className:t,...a},r)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Be,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(J.Input,{ref:r,className:re("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...a})]}));Xs.displayName=J.Input.displayName;const Js=i.forwardRef(({className:t,...a},r)=>e.jsx(J.List,{ref:r,className:re("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...a}));Js.displayName=J.List.displayName;const Ys=i.forwardRef((t,a)=>e.jsx(J.Empty,{ref:a,className:"py-6 text-center text-sm",...t}));Ys.displayName=J.Empty.displayName;const Zs=i.forwardRef(({className:t,...a},r)=>e.jsx(J.Group,{ref:r,className:re("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...a}));Zs.displayName=J.Group.displayName;const yn=i.forwardRef(({className:t,...a},r)=>e.jsx(J.Separator,{ref:r,className:re("-mx-1 h-px bg-border",t),...a}));yn.displayName=J.Separator.displayName;const ea=i.forwardRef(({className:t,...a},r)=>e.jsx(J.Item,{ref:r,className:re("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...a}));ea.displayName=J.Item.displayName;const _n=250;function os({value:t,onChange:a,placeholder:r="Select...",searchPlaceholder:u="Search...",emptyMessage:n="No results found.",disabled:l=!1,selectedOption:o,queryKey:p,queryFn:s,enabled:f=!0,className:_}){const[v,E]=i.useState(!1),[k,N]=i.useState(""),[q,M]=i.useState("");i.useEffect(()=>{const j=window.setTimeout(()=>{M(k.trim())},_n);return()=>window.clearTimeout(j)},[k]),i.useEffect(()=>{v||(N(""),M(""))},[v]);const{data:A=[],isFetching:F}=oe({queryKey:[...p,q],queryFn:()=>s(q),enabled:f&&v}),U=i.useMemo(()=>!t||A.some(j=>j.value===t)?A:(o==null?void 0:o.value)===t?[o,...A]:A,[A,o,t]),P=i.useMemo(()=>{if(!t)return r;const j=U.find(c=>c.value===t)??((o==null?void 0:o.value)===t?o:null);return(j==null?void 0:j.label)??r},[U,r,o,t]);return e.jsxs(Gr,{open:v,onOpenChange:E,modal:!0,children:[e.jsx(Wr,{asChild:!0,children:e.jsxs(V,{type:"button",variant:"outline",role:"combobox","aria-expanded":v,disabled:l,className:re("h-8 w-full justify-between px-2 text-sm font-normal",!t&&"text-muted-foreground",_),children:[e.jsx("span",{className:"truncate",children:P}),e.jsx(dr,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(qs,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:j=>j.stopPropagation(),children:e.jsxs(Ws,{shouldFilter:!1,className:"h-full",children:[e.jsx(Xs,{placeholder:u,value:k,onValueChange:N}),e.jsx(Js,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:F?e.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[e.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):U.length===0?e.jsx(Ys,{children:n}):e.jsx(Zs,{children:U.map(j=>e.jsxs(ea,{value:j.value,onSelect:()=>{a(j.value),E(!1)},children:[e.jsx(le,{className:re("mr-2 h-4 w-4",t===j.value?"opacity-100":"opacity-0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate",children:j.label}),j.description?e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:j.description}):null]})]},j.value))})})]})})]})}const ht=100;function wn(t){return t.map(a=>{const r=a.best_metric||Object.keys(a.metrics)[0],u=a.metrics[r];return{id:a.id,task_id:a.task_id,dataset_id:a.dataset_id,model_name:a.model_name||"",harness:a.harness||"",metric_name:r||"",metric_value:String(u||""),best_rank:a.best_rank?String(a.best_rank):"",num_parameters:a.num_parameters!=null?String(a.num_parameters):"",is_open:a.is_open!==!1,operation:"unchanged"}})}function kn(t){const a=new Map;return t.forEach(r=>{r.task_id&&r.task_name&&a.set(r.task_id,{id:r.task_id,name:r.task_name,slug:r.task_slug,level:0})}),a}function Nn(t){const a=new Map;return t.forEach(r=>{r.dataset_id&&r.dataset_name&&a.set(r.dataset_id,{id:r.dataset_id,name:r.dataset_name,slug:r.dataset_slug})}),a}function ls(t,a){return`${t}:${a}`}function Je(t){const a=t.trim();if(a==="")return null;const r=Number(a);return!Number.isFinite(r)||r<0?null:Math.trunc(r)}function Cn({open:t,onOpenChange:a,paperId:r,arxivId:u,initialEvaluations:n,onSuccess:l,submitMode:o="direct",isAuthor:p=!1}){const[s,f]=i.useState([]),[_,v]=i.useState(new Map),[E,k]=i.useState(new Map),N=ue(),{toast:q}=me(),M=i.useRef(!1),A=i.useRef(!1);i.useEffect(()=>{if(!t){M.current=!1,A.current=!1;return}M.current||A.current||n.length!==0&&(M.current=!0,f(wn(n)),v(kn(n)),k(Nn(n)))},[t,n]);const F=i.useMemo(()=>Array.from(new Set(s.map(m=>m.task_id).filter(m=>m&&m!==""))),[s]),U=i.useMemo(()=>{const m=new Set;return s.forEach(w=>{w.task_id&&w.dataset_id&&m.add(ls(w.task_id,w.dataset_id))}),Array.from(m)},[s]),P=oe({queryKey:["datasets-by-tasks-for-eval-edit",F,t],queryFn:async()=>{const m={};return await Promise.all(F.map(async w=>{try{const C=await ts({task_id:parseInt(w),page_size:ht});m[w]=C.results}catch(C){console.error(`Error fetching datasets for task ${w}:`,C),m[w]=[]}})),m},enabled:t&&F.length>0});i.useEffect(()=>{P.data&&k(m=>{const w=new Map(m);return Object.values(P.data).forEach(C=>{C.forEach(g=>{w.set(g.id,g)})}),w})},[P.data]);const j=oe({queryKey:["leaderboard-metrics-for-eval-edit",U,t],queryFn:async()=>{const m={};return await Promise.all(U.map(async w=>{const[C,g]=w.split(":");try{m[w]=await Fa(g,C)}catch(y){console.error(`Error fetching metrics for leaderboard ${w}:`,y),m[w]=[]}})),m},enabled:t&&U.length>0}),c=async m=>{const w=await fs({page_size:ht,visible_only:!0,...m?{q:m}:{}});return v(C=>{const g=new Map(C);return w.results.forEach(y=>g.set(y.id,y)),g}),w.results.map(C=>{var g;return{value:C.id,label:C.name,description:(g=C.description)==null?void 0:g.slice(0,100)}})},x=m=>async w=>{const C=await ts({task_id:parseInt(m),page_size:ht,...w?{q:w}:{}});return k(g=>{const y=new Map(g);return C.results.forEach(z=>y.set(z.id,z)),y}),C.results.map(g=>({value:g.id,label:g.name,description:g.full_name}))},D=(m,w)=>{if(!m||!w)return!1;const C=E.get(w);return!!(C!=null&&C.supports_harness)},H=(m,w,C)=>{var z;if(!m||!w)return[];const y=(((z=j.data)==null?void 0:z[ls(m,w)])||[]).map(h=>({value:h.metric_name,label:h.metric_name,description:h.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return C&&!y.some(h=>h.value===C)&&y.unshift({value:C,label:`${C} (legacy)`,description:void 0}),y},B=ve({mutationFn:async({paperId:m,evaluations:w})=>{if(o==="pending"){const g=[];for(const y of w){if(y.operation==="delete"&&y.id){g.push({op:"delete",evaluation_id:parseInt(y.id)});continue}const z=D(y.task_id,y.dataset_id);if(y.operation==="create"){const h=Je(y.num_parameters),$={task_id:parseInt(y.task_id),dataset_id:parseInt(y.dataset_id),metrics:{[y.metric_name]:y.metric_value},best_metric:y.metric_name};y.model_name&&($.model_name=y.model_name),z&&y.harness&&($.harness=y.harness),y.best_rank&&($.best_rank=parseInt(y.best_rank)),h!=null&&($.num_parameters=h),$.is_open=y.is_open,g.push({op:"create",data:$})}else if(y.operation==="update"&&y.id){const h={task_id:parseInt(y.task_id),dataset_id:parseInt(y.dataset_id),model_name:y.model_name||void 0,harness:z&&y.harness||null,metrics:{[y.metric_name]:y.metric_value},best_metric:y.metric_name,best_rank:y.best_rank?parseInt(y.best_rank):void 0,num_parameters:Je(y.num_parameters),is_open:y.is_open};g.push({op:"update",evaluation_id:parseInt(y.id),data:h})}}return g.length===0?{submitted:!1}:(await Se({paper_id:parseInt(m),edit_type:"evaluations",proposed_payload:{operations:g}}),{submitted:!0})}let C=!1;for(const g of w)if(g.operation==="delete"&&g.id){C=!0;try{await Ra(g.id)}catch(y){if((typeof y=="object"&&y!==null&&"status"in y?y.status:void 0)!==404)throw y;console.log(`Evaluation ${g.id} already deleted or not found`)}}else if(g.operation==="create"){C=!0;const y=D(g.task_id,g.dataset_id),z=Je(g.num_parameters);await Aa({paper_id:parseInt(m),task_id:parseInt(g.task_id),dataset_id:parseInt(g.dataset_id),model_name:g.model_name||void 0,harness:y&&g.harness||void 0,metrics:{[g.metric_name]:g.metric_value},best_metric:g.metric_name,best_rank:g.best_rank?parseInt(g.best_rank):void 0,num_parameters:z??void 0,is_open:g.is_open})}else if(g.operation==="update"&&g.id){C=!0;const y=D(g.task_id,g.dataset_id);await Ia(g.id,{task_id:parseInt(g.task_id),dataset_id:parseInt(g.dataset_id),model_name:g.model_name||void 0,harness:y&&g.harness||null,metrics:{[g.metric_name]:g.metric_value},best_metric:g.metric_name,best_rank:g.best_rank?parseInt(g.best_rank):void 0,num_parameters:Je(g.num_parameters),is_open:g.is_open})}return{submitted:C}},onSuccess:m=>{if(o==="pending"){m!=null&&m.submitted?q({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):q({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),l==null||l(),a(!1);return}N.invalidateQueries({queryKey:["paper-arxiv",u]}),N.invalidateQueries({queryKey:["evaluations","paper",r]}),l==null||l(),a(!1)},onError:m=>{var g;const w=m;let C=w.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(w.response)try{const y=JSON.parse(w.response);typeof(y==null?void 0:y.detail)=="string"?C=y.detail:Array.isArray(y==null?void 0:y.detail)&&((g=y.detail[0])!=null&&g.msg)&&(C=y.detail[0].msg)}catch{C=w.response}q({title:o==="pending"?"Could not submit edit":"Could not save evaluations",description:C,variant:"destructive"})}}),te=()=>{A.current=!0,f([...s,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",is_open:!0,operation:"create"}])},b=m=>{A.current=!0,s[m].id?f(s.map((C,g)=>g===m?{...C,operation:"delete"}:C)):f(s.filter((C,g)=>g!==m))},S=(m,w,C)=>{A.current=!0,f(s.map((g,y)=>{if(y!==m)return g;const z={...g,[w]:C};return w==="task_id"&&(z.dataset_id="",z.metric_name="",z.harness=""),w==="dataset_id"&&(z.metric_name="",C&&!D(z.task_id,C)&&(z.harness="")),g.operation==="unchanged"&&(z.operation="update"),z}))},R=(m,w)=>{A.current=!0,f(s.map((C,g)=>{if(g!==m)return C;const y={...C,is_open:w};return C.operation==="unchanged"&&(y.operation="update"),y}))},L=()=>{const m=s.filter(w=>w.operation!=="delete"||w.id);B.mutate({paperId:r,evaluations:m})};return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Evaluation Results"}),e.jsx(ge,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),o==="pending"&&e.jsx(Re,{isAuthor:p}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[s.filter(m=>m.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Model"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:s.map((m,w)=>{if(m.operation==="delete")return null;const C=_.get(m.task_id),g=E.get(m.dataset_id),y=H(m.task_id,m.dataset_id,m.metric_name),z=!!(m.task_id&&m.dataset_id)&&j.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(os,{value:m.task_id,onChange:h=>S(w,"task_id",h),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:C?{value:C.id,label:C.name}:null,queryKey:["eval-edit-task-search"],queryFn:c,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(os,{value:m.dataset_id,onChange:h=>S(w,"dataset_id",h),placeholder:m.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:m.task_id?"No datasets found for this task.":"Select a task first.",disabled:!m.task_id,selectedOption:g?{value:g.id,label:g.name}:null,queryKey:["eval-edit-dataset-search",m.task_id],queryFn:x(m.task_id),enabled:t&&!!m.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ie,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:m.model_name,onChange:h=>S(w,"model_name",h.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:D(m.task_id,m.dataset_id)?e.jsx(ie,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:m.harness,onChange:h=>S(w,"harness",h.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!m.task_id||!m.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):z?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(ne,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):y.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:m.metric_name,onChange:h=>S(w,"metric_name",h.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),y.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ie,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:m.metric_value,onChange:h=>S(w,"metric_value",h.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ie,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:m.num_parameters,onChange:h=>S(w,"num_parameters",h.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:m.is_open,onChange:h=>R(w,h.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>b(w),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(rt,{className:"w-4 h-4"})})})]},w)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(cr,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(V,{variant:"outline",size:"sm",onClick:te,className:"flex items-center space-x-2",children:[e.jsx(at,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:L,disabled:B.isPending,children:B.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const ft=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function cs(t){return t.map(a=>a.trim()).filter(Boolean)}function xt(t,a){const r=cs(t).sort(),u=cs(a).sort();return r.length!==u.length?!1:r.every((n,l)=>n===u[l])}function En(t,a){return xt(t.hf_models,a.hf_models)&&xt(t.hf_datasets,a.hf_datasets)&&xt(t.hf_spaces,a.hf_spaces)}function Sn({open:t,onOpenChange:a,paperId:r,arxivId:u,initialArtifacts:n,onSuccess:l,submitMode:o="direct",isAuthor:p=!1}){const[s,f]=i.useState(n),[_,v]=i.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),E=ue(),{toast:k}=me(),N=i.useRef(!1);i.useEffect(()=>{if(!t){N.current=!1;return}N.current||(N.current=!0,f(n),v({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,n]);const q=ve({mutationFn:async({paperId:j,artifacts:c})=>o==="pending"?(await Se({paper_id:parseInt(j),edit_type:"hf_artifacts",proposed_payload:c}),null):Ta(j,c),onSuccess:j=>{if(o==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),l==null||l(),a(!1),v({hf_models:"",hf_datasets:"",hf_spaces:""});return}j&&De(E,j,[r,u]),l==null||l(),a(!1),v({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:j=>{var D;const c=j;let x=c.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");if(c.response)try{const H=JSON.parse(c.response);typeof(H==null?void 0:H.detail)=="string"?x=H.detail:Array.isArray(H==null?void 0:H.detail)&&((D=H.detail[0])!=null&&D.msg)&&(x=H.detail[0].msg)}catch{x=c.response}k({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:x,variant:"destructive"})}}),M=()=>{const j={hf_models:[...s.hf_models],hf_datasets:[...s.hf_datasets],hf_spaces:[...s.hf_spaces]};for(const{key:c}of ft){const x=_[c].trim();if(x){if(j[c].some(D=>D.trim()===x))return alert(`This ${c.replace("hf_","")} URL is already added`),null;j[c]=[...j[c],x]}}return j},A=j=>{const c=_[j].trim();if(c){if(s[j].some(x=>x.trim()===c)){alert(`This ${j.replace("hf_","")} URL is already added`);return}f(x=>({...x,[j]:[...x[j],c]})),v(x=>({...x,[j]:""}))}},F=(j,c)=>{f(x=>({...x,[j]:x[j].filter(D=>D!==c)}))},U=()=>{const j=M();j!==null&&q.mutate({paperId:r,artifacts:j})},P=i.useMemo(()=>{const j={hf_models:[...s.hf_models],hf_datasets:[...s.hf_datasets],hf_spaces:[...s.hf_spaces]};for(const{key:c}of ft){const x=_[c].trim();if(x){if(j[c].some(D=>D.trim()===x))return!1;j[c]=[...j[c],x]}}return!En(j,n)},[s,_,n]);return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Hugging Face Artifacts"}),e.jsx(ge,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(Re,{isAuthor:p}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:ft.map(({key:j,label:c,placeholder:x})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:c}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(ie,{type:"url",placeholder:x,value:_[j],onChange:D=>v(H=>({...H,[j]:D.target.value})),onKeyPress:D=>{D.key==="Enter"&&(D.preventDefault(),A(j))},className:"flex-1"}),e.jsxs(V,{onClick:()=>A(j),size:"sm",disabled:!_[j].trim(),children:[e.jsx(at,{className:"w-4 h-4 mr-1"}),"Add"]})]}),s[j].length>0?e.jsx("div",{className:"space-y-2",children:s[j].map(D=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:D}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>F(j,D),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${c.toLowerCase()} URL`,children:e.jsx(rt,{className:"w-4 h-4"})})]},D))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",c.toLowerCase()," linked yet."]})]},j))}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:U,disabled:q.isPending||!P,children:q.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Pn({open:t,onOpenChange:a,sectionLabel:r,returnTo:u}){return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-md",children:[e.jsxs(fe,{children:[e.jsxs(xe,{children:["Sign in to edit ",r]}),e.jsx(ge,{children:"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx($a,{returnTo:u})})]})})}const Te=["my-bookmark-ids"];function Rn(){var u,n;const{user:t}=st(),a=oe({queryKey:Te,queryFn:()=>et.getMyBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),r=_t.useMemo(()=>{var l;return new Set(((l=a.data)==null?void 0:l.paper_ids)??[])},[(u=a.data)==null?void 0:u.paper_ids]);return{ids:((n=a.data)==null?void 0:n.paper_ids)??[],idSet:r,isLoading:a.isLoading,isError:a.isError}}function An(){const{user:t}=st(),a=ue(),r=ve({mutationFn:async({paperId:n,isBookmarked:l})=>{l?await et.removeBookmark(n):await et.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:l})=>{await a.cancelQueries({queryKey:Te});const o=a.getQueryData(Te),p=typeof n=="string"?Number(n):n,s=(o==null?void 0:o.paper_ids)??[],f=l?s.filter(_=>_!==p):[p,...s.filter(_=>_!==p)];return a.setQueryData(Te,{paper_ids:f}),{previous:o}},onError:(n,l,o)=>{o!=null&&o.previous&&a.setQueryData(Te,o.previous)},onSettled:()=>{a.invalidateQueries({queryKey:Te}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:_t.useCallback((n,l)=>{if(!t){if(vs())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=js(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}r.mutate({paperId:n,isBookmarked:l})},[r,t]),isPending:r.isPending}}const In=({paperId:t})=>{const{user:a}=st(),{idSet:r}=Rn(),{toggle:u,isPending:n}=An();if(vs())return null;const l=Number(t),o=!!a&&r.has(l),p=()=>{Number.isFinite(l)&&u(l,o)},s=a&&o?"Saved":"Save",f=a?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:p,disabled:n,"aria-pressed":o,"aria-label":f,title:f,children:[e.jsx(ee,{name:"bookmark",size:12}),s]})};function Ye({children:t,showEdit:a=!1,onEdit:r,editAriaLabel:u}){return a?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:r,"aria-label":u,children:"edit"})]}):t}const Fn={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","source-url":"source URL","hf-artifacts":"Hugging Face artifacts"},Ze=360,gt=3;function ds(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function us(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function we(t,a){try{const r=new URL(t),n=r.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):r.hostname.replace(/^www\./,"")}catch{return a}}const ei=()=>{var qt,Ht,Bt,Ot,Kt,zt,Qt,Vt,Gt,Wt,Xt,Jt;const{arxivId:t}=La(),a=t?Da(t):"",r=Ma(),{toast:u}=me(),{user:n}=st(),l=(n==null?void 0:n.is_admin)??!1,o=!!n,p=!0,{data:s,isLoading:f,error:_,refetch:v}=tr(a||"",!!a),[E,k]=i.useState(!1);i.useEffect(()=>{if(!t||t===a)return;const d=window.location.search+window.location.hash;r(`/paper/${a}${d}`,{replace:!0})},[a,r,t]),i.useEffect(()=>{if(s!=null&&s.title)return document.title=Za(s.title),()=>{document.title=er}},[s==null?void 0:s.title]),i.useEffect(()=>{if(k(!1),!(s!=null&&s.id))return;const d=window.setTimeout(()=>k(!0),0);return()=>window.clearTimeout(d)},[s==null?void 0:s.id]);const{data:N,isLoading:q}=pr(E?s==null?void 0:s.arxiv_id:void 0),{data:M,isLoading:A}=ur(s==null?void 0:s.id,E&&!!(s!=null&&s.id)),{preferences:F}=Ua(),U=i.useMemo(()=>!M||!F.hide_closed_source_evals?M:M.filter(d=>d.is_open!==!1),[M,F.hide_closed_source_evals]),P=i.useMemo(()=>({models:(s==null?void 0:s.hf_models)??[],datasets:(s==null?void 0:s.hf_datasets)??[],spaces:(s==null?void 0:s.hf_spaces)??[]}),[s==null?void 0:s.hf_models,s==null?void 0:s.hf_datasets,s==null?void 0:s.hf_spaces]),j=i.useMemo(()=>{if(!U)return[];const d=new Map;for(const T of U){const G=T.task_id,ae=d.get(G);ae?ae.rows.push(T):d.set(G,{taskId:G,taskName:T.task_name||"—",taskSlug:T.task_slug,rows:[T]})}return Array.from(d.values())},[U]),c=oe({queryKey:["paper-versions",s==null?void 0:s.arxiv_id],queryFn:async()=>{const d=s.arxiv_id.replace(/v\d+$/,""),T=await fetch(js(`/api/v1/papers/arxiv/${d}/versions`));return T.ok?await T.json():[]},enabled:E&&!!(s!=null&&s.arxiv_id),staleTime:10*60*1e3}),x=oe({queryKey:["related-papers",(Ht=(qt=s==null?void 0:s.tasks)==null?void 0:qt[0])==null?void 0:Ht.id],queryFn:()=>et.getTaskPapers(s.tasks[0].id,{page:1,page_size:5,order_by:"citation_count",order_dir:"desc",include_resources:!1}),enabled:E&&!!((Ot=(Bt=s==null?void 0:s.tasks)==null?void 0:Bt[0])!=null&&Ot.id),staleTime:10*60*1e3,select:d=>d.results.filter(T=>T.id!==(s==null?void 0:s.id)).slice(0,4)}),[D,H]=i.useState(!1),[B,te]=i.useState(!1),[b,S]=i.useState(!1),{isEditingTasks:R,setIsEditingTasks:L,isEditingMethods:m,setIsEditingMethods:w,isEditingRepositories:C,setIsEditingRepositories:g,isEditingProjectPages:y,setIsEditingProjectPages:z,isEditingEvaluations:h,setIsEditingEvaluations:$,isEditingSourceUrl:O,setIsEditingSourceUrl:I,isEditingHfArtifacts:K,setIsEditingHfArtifacts:Q}=hr(),[X,W]=i.useState(null),Z=i.useMemo(()=>{if(!n||!(s!=null&&s.author_links))return!1;const d=n.username.toLowerCase();return s.author_links.some(T=>!!T.hf_username&&T.hf_username.toLowerCase()===d)},[n,s==null?void 0:s.author_links]),be=l?"direct":"pending",se=d=>{if(!o){W(d);return}switch(d){case"tasks":L(!0);return;case"methods":w(!0);return;case"results":$(!0);return;case"repositories":g(!0);return;case"project-pages":z(!0);return;case"source-url":I(!0);return;case"hf-artifacts":Q(!0);return}},[St,lt]=i.useState("idle"),[Pt,Rt]=i.useState(null),[At,It]=i.useState(null),ta=async()=>{if(a){lt("indexing"),Rt(null),It(null);try{await Qa(a),u({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>v(),1200),lt("idle")}catch(d){const T=d;let G=T.message||"Failed to index paper";if(T.response)try{G=JSON.parse(T.response).detail||G}catch{G=T.response}Rt(G),(T.status===429||T.status===503)&&It("Try again later after arXiv has lifted the temporary limit."),lt("idle")}}},{citationDisplay:sa,citationCopy:Ft}=i.useMemo(()=>{if(!s)return{citationDisplay:"",citationCopy:""};const d=`${s.title.slice(0,60)}${s.title.length>60?"…":""}`,T=`${s.authors[0]||""}${s.authors.length>1?" et al.":""}`,G=s.authors.join(" and "),ae=(s.published||"").slice(0,4)||"—",Yt=(Zt,es)=>s.arxiv_id?`@article{${s.arxiv_id.replace(".","")},
37
+ title={{${Zt}}},
38
+ author=${es},
39
+ year={{${ae}}},
40
+ eprint={{${s.arxiv_id}}},
41
+ archivePrefix={{arXiv}}
42
+ }`:`@misc{paper${s.id},
43
+ title={{${Zt}}},
44
+ author=${es},
45
+ year={{${ae}}},
46
+ url={{${s.source_url||s.url_abs||""}}}
47
+ }`;return{citationDisplay:Yt(d,`{{${T}}}`),citationCopy:Yt(s.title,`{${G}}`)}},[s]),[aa,Tt]=i.useState(!1),ra=async()=>{if(Ft)try{await navigator.clipboard.writeText(Ft),Tt(!0),u({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Tt(!1),1500)}catch{u({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}};if(f)return e.jsxs("div",{className:"page",children:[e.jsx(He,{className:"h-12 w-3/4 mb-4"}),e.jsx(He,{className:"h-6 w-1/3 mb-8"}),e.jsx(He,{className:"h-64 w-full"})]});if(_||!s)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(_e,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",a]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",a]})," in the database. You can index it from arXiv right now."]}),Pt&&e.jsx(sr,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(ar,{children:[e.jsx("div",{children:Pt}),At&&e.jsx("div",{className:"mt-2",children:At})]})}),e.jsxs("div",{className:"action-row",children:[l&&e.jsxs("button",{className:"action-btn",onClick:ta,disabled:St==="indexing",children:[e.jsx(ee,{name:"sparkle",size:12}),St==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(V,{variant:"outline",onClick:()=>r("/papers"),children:"Browse Papers"})]})]});const $t=c.data||[],Me=Ya(s.repositories),ye=[...s.repositories??[]].sort((d,T)=>{const G=d.is_official?1:0,ae=T.is_official?1:0;return G!==ae?ae-G:(T.num_stars||0)-(d.num_stars||0)}),na=b?ye:ye.slice(0,gt),ia=s.arxiv_id?{isLoading:q,paperHref:`https://huggingface.co/papers/${s.arxiv_id.replace(/v\d+$/,"")}`,rows:[{label:"Models",href:`https://huggingface.co/models?other=arxiv:${s.arxiv_id}`,count:N==null?void 0:N.models,isLimited:N==null?void 0:N.isLimited,links:P.models.map(d=>({href:d,label:we(d,"Model")}))},{label:"Datasets",href:`https://huggingface.co/datasets?other=arxiv:${s.arxiv_id}`,count:N==null?void 0:N.datasets,isLimited:N==null?void 0:N.isLimited,links:P.datasets.map(d=>({href:d,label:we(d,"Dataset")}))},{label:"Spaces",href:`https://huggingface.co/spaces?arxivIds=${s.arxiv_id.replace(/v\d+$/,"")}`,count:N==null?void 0:N.spaces,isLimited:N==null?void 0:N.isLimited,links:P.spaces.map(d=>({href:d,label:we(d,"Space")}))}],footer:`Cite arxiv.org/abs/${s.arxiv_id} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:vt(P.models),count:P.models.length,links:P.models.map(d=>({href:d,label:we(d,"Model")}))},{label:"Datasets",href:vt(P.datasets),count:P.datasets.length,links:P.datasets.map(d=>({href:d,label:we(d,"Dataset")}))},{label:"Spaces",href:vt(P.spaces),count:P.spaces.length,links:P.spaces.map(d=>({href:d,label:we(d,"Space")}))}],footer:null},Lt=s.tldr||null,Dt=s.num_pages||null,Ae=s.abstract||"",oa=Ae.length>Ze?Ae.slice(0,Ze)+"…":Ae,la=D||Ae.length<=Ze?Ae:oa,ze=(s.methods||[]).filter(d=>d.source_paper_id===s.id),Qe=s.introduced_benchmarks||[],ca=ze.length>0||Qe.length>0,Mt=s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource",da=s.source==="external"?"Source page":"arXiv page",Ue=((Kt=s.project_pages)==null?void 0:Kt.filter(d=>d.url))??[],ua=(()=>{const d=[];return ze.length>0&&d.push(ze.length===1?"this method":"these methods"),Qe.length>0&&d.push(Qe.length===1?"this benchmark":"these benchmarks"),d.length===0?"":d.length===1?d[0]:d.join(" and ")})(),Ve=s.predecessor_papers||[],Ge=s.successor_papers||[],ma=Ve.length>0||Ge.length>0,We=12,ct=s.authors.map((d,T)=>{var G,ae;return{name:d,hf_username:((ae=(G=s.author_links)==null?void 0:G[T])==null?void 0:ae.hf_username)??null}}),Ut=B||ct.length<=We?ct:ct.slice(0,We);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(_e,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:Mt})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsx("h1",{className:"detail-title",children:e.jsx(Xe,{title:s.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:Mt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",ds(s.published)]}),Dt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Dt," pages"]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.citation_count.toLocaleString()," citations"]})]}),(s.proceeding||s.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),s.conference_slug?e.jsx("a",{href:`/conferences/${s.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(s.proceeding||s.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:s.proceeding.replace(/\s+\d{1,2}$/,"")})]}),$t.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:s.version,onChange:d=>{const T=d.target.value;s.arxiv_id&&r(`/paper/${s.arxiv_id.replace(/v\d+$/,"")}${T?`?version=${T}`:""}`)},children:$t.map(d=>e.jsxs("option",{value:d.version,children:[d.version," — ",ds(d.published)]},d.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Ut.map((d,T)=>e.jsxs(_t.Fragment,{children:[d.hf_username?e.jsx("a",{href:`https://huggingface.co/${d.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${d.hf_username} on Hugging Face`,children:d.name}):e.jsx("a",{children:d.name}),T<Ut.length-1?", ":""]},T)),s.authors.length>We&&e.jsx("button",{className:"show-more-authors",onClick:()=>te(d=>!d),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:B?"show fewer":`+${s.authors.length-We} more`})]}),e.jsxs("div",{className:"action-row",children:[s.url_pdf&&e.jsxs("a",{className:"action-btn",href:s.url_pdf,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ee,{name:"pdf",size:12})," View PDF"]}),s.url_abs&&e.jsx(Ye,{showEdit:s.source==="external"&&p,onEdit:()=>se("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:s.source==="external"&&p?"action-btn-segment action-btn-main":"action-btn",href:s.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ee,{name:"external",size:12})," ",da]})}),Me.githubUrl&&e.jsx(Ye,{showEdit:p,onEdit:()=>se("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Me.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ee,{name:"github",size:12})," Code",Me.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",us(Me.github)," ★"]})]})}),Me.githubUrl?null:e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>se("repositories"),title:"Add GitHub repository",children:[e.jsx(ee,{name:"github",size:12})," Add code"]}),Ue.length===1?e.jsx(Ye,{showEdit:p,onEdit:()=>se("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Ue[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ee,{name:"globe",size:12})," Project page"]})}):null,Ue.length>1?e.jsx(Ye,{showEdit:p,onEdit:()=>se("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(qa,{children:[e.jsx(Ha,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(ee,{name:"globe",size:12})," Project page"]})}),e.jsx(Ba,{align:"start",className:"project-page-menu",children:Ue.map((d,T)=>e.jsx(Oa,{asChild:!0,children:e.jsx("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",children:we(d.url,`Project page ${T+1}`)})},d.url))})]})}):null,Ue.length===0&&o?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>se("project-pages"),title:"Add project page",children:[e.jsx(ee,{name:"globe",size:12})," Add project page"]}):null,s.conference_url_abs&&e.jsxs("a",{className:"action-btn",href:s.conference_url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ee,{name:"external",size:12})," Conference"]}),(s.organizations||[]).map(d=>e.jsxs(_e,{to:`/${d.slug}`,className:"action-btn",title:d.name,"aria-label":d.name,children:[d.logo_url&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:16,width:16,borderRadius:3,overflow:"hidden"},children:e.jsx("img",{src:d.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:T=>{T.currentTarget.style.display="none"}})}),d.name]},d.id)),e.jsx(In,{paperId:s.id})]})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Va,{paperId:s.arxiv_id||s.id,title:s.title,thumbnailUrl:Ka(s.thumbnail_url),priority:!0})})]}),ca&&e.jsxs("div",{className:"introduced-banner",children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[ze.map(d=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/methods/${d.slug||d.id}`),children:[d.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${d.id}`)),Qe.map(d=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/benchmark/${d.slug||d.id}`),children:[d.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${d.id}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",ua,"."]})]}),ma&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Ge.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ge.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Ge.map(d=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>r(`/paper/${d.route_identifier}`),children:[e.jsx(Xe,{title:d.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${d.id}`))})]}),Ve.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ve.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Ve.map(d=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>r(`/paper/${d.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Xe,{title:d.title})]},`predecessor-${d.id}`))})]})]}),Lt&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"TL;DR · AI-generated"})}),e.jsx("div",{className:"tldr-box",children:Lt})]}),e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"Abstract"})}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Ja,{text:la})}),Ae.length>Ze&&e.jsx("div",{className:"read-full",onClick:()=>H(d=>!d),children:D?"− collapse abstract":"+ read full abstract"}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Tasks"}),e.jsxs("span",{className:"accent",children:[((zt=s.tasks)==null?void 0:zt.length)||0," tagged",e.jsx("button",{type:"button",onClick:()=>se("tasks"),className:"edit-link",children:"edit"})]})]}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(s.tasks||[]).map(d=>e.jsx(Ga,{slug:d.slug||"",label:d.name},d.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Methods"}),e.jsxs("span",{className:"accent",children:[((Qt=s.methods)==null?void 0:Qt.length)||0," used",e.jsx("button",{type:"button",onClick:()=>se("methods"),className:"edit-link",children:"edit"})]})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(s.methods||[]).map(d=>e.jsx(Wa,{method:d},d.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Results"}),e.jsxs("span",{className:"accent",children:[(U==null?void 0:U.length)||0," benchmarks",e.jsx("button",{type:"button",onClick:()=>se("results"),className:"edit-link",children:"edit"})]})]}),A?e.jsx(He,{className:"h-32 w-full"}):j.length>0?j.map(d=>e.jsxs("div",{children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:d.taskSlug?e.jsx(_e,{to:`/tasks/${d.taskSlug}`,children:d.taskName}):d.taskName}),e.jsxs("span",{className:"accent",children:[d.rows.length," ",d.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:d.rows.map(T=>{var G;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:T.dataset_slug?e.jsx(_e,{to:`/benchmark/${T.dataset_slug}`,children:T.dataset_name||"—"}):T.dataset_name||"—"}),e.jsxs("td",{className:"model",title:T.model_name||void 0,children:[T.model_name||"—",T.is_open===!1&&e.jsx(Xa,{})]}),e.jsx("td",{className:"metric",children:T.best_metric}),e.jsx("td",{className:"value",children:za((G=T.metrics)==null?void 0:G[T.best_metric||""])}),e.jsx("td",{className:"compare",children:T.dataset_slug&&e.jsx(_e,{to:`/benchmark/${T.dataset_slug}?eval=${encodeURIComponent(T.id)}`,children:"Compare →"})})]},T.id)})})]})]},d.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[ye.length," repo",ye.length===1?"":"s",e.jsx("button",{type:"button",onClick:()=>se("repositories"),className:"edit-link",children:"edit"})]})]}),na.map(d=>e.jsxs("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(ee,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[d.owner,"/",d.name]}),d.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",us(d.num_stars)]})]},d.id)),ye.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),ye.length>gt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>S(d=>!d),children:b?"− show top 3":`+ show ${ye.length-gt} more repos`})]}),e.jsx(Tn,{viewer:ia,canEdit:p,onEdit:()=>se("hf-artifacts")}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:ra,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(ee,{name:"copy",size:11}),aa?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:sa})]}),(((Vt=x.data)==null?void 0:Vt.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),x.data.map(d=>e.jsxs(_e,{to:`/paper/${d.arxiv_id||d.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Xe,{title:d.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:d.arxiv_id?`arXiv:${d.arxiv_id}`:"External resource"}),d.citation_count!=null&&e.jsxs("span",{children:[d.citation_count.toLocaleString()," cites"]})]})]},d.id))]})]})]}),e.jsx(_r,{open:R,onOpenChange:L,paperId:s.id,arxivId:a,initialTaskIds:((Gt=s.tasks)==null?void 0:Gt.map(d=>parseInt(d.id)))||[],initialTasks:s.tasks||[],submitMode:be,isAuthor:Z}),e.jsx(Nr,{open:m,onOpenChange:w,paperId:s.id,arxivId:a,initialMethodIds:((Wt=s.methods)==null?void 0:Wt.map(d=>parseInt(d.id)))||[],initialMethods:s.methods||[],submitMode:be,isAuthor:Z}),e.jsx(Cr,{open:C,onOpenChange:g,paperId:s.id,arxivId:a,initialRepositories:((Xt=s.repositories)==null?void 0:Xt.map(d=>({url:d.url,is_official:d.is_official||!1})))||[],submitMode:be,isAuthor:Z}),e.jsx(Er,{open:y,onOpenChange:z,paperId:s.id,arxivId:a,initialProjectPages:((Jt=s.project_pages)==null?void 0:Jt.map(d=>({url:d.url,is_official:d.is_official||!1})))||[],submitMode:be,isAuthor:Z}),e.jsx(Cn,{open:h,onOpenChange:$,paperId:s.id,arxivId:a,initialEvaluations:M||[],submitMode:be,isAuthor:Z}),e.jsx(Sr,{open:O,onOpenChange:I,paperId:s.id,arxivId:a,initialUrl:s.source_url??s.url_abs??"",submitMode:be,isAuthor:Z}),e.jsx(Sn,{open:K,onOpenChange:Q,paperId:s.id,arxivId:a,initialArtifacts:{hf_models:s.hf_models??[],hf_datasets:s.hf_datasets??[],hf_spaces:s.hf_spaces??[]},submitMode:be,isAuthor:Z}),e.jsx(Pn,{open:X!==null,onOpenChange:d=>{d||W(null)},sectionLabel:X?Fn[X]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})},Tn=({viewer:t,canEdit:a=!1,onEdit:r})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[t.paperHref?e.jsx("a",{href:t.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),a&&r&&e.jsx("button",{type:"button",onClick:r,className:"edit-link",children:"edit"})]}),t.isLoading?e.jsx(He,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[t.rows.map(u=>e.jsx($n,{...u},u.label)),t.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:t.footer})]})]}),$n=({label:t,href:a,count:r,isLimited:u,links:n})=>{const l=((n==null?void 0:n.length)??0)>0,o=e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:t}),e.jsx("span",{style:{fontWeight:600,color:r?"var(--ink)":"var(--ink-faint)"},children:r!=null?`${r}${u?"+":""}`:"—"})]});return l?e.jsxs("div",{className:"hf-artifact-row",children:[o,e.jsx("div",{className:"hf-artifact-links",children:n.map(p=>e.jsx("a",{href:p.href,target:"_blank",rel:"noopener noreferrer",children:p.label},p.href))})]}):e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-row",children:o})};function vt(t){return t[0]??"https://huggingface.co"}export{ei as default};
assets/PapersListView-B62Ept_9.js DELETED
@@ -1 +0,0 @@
1
- import{u as I,r as i,j as e,L as F}from"./index-C6O8_a1-.js";import{I as L,P as T}from"./components-CMH89RDy.js";import{a as C}from"./api-DLAvdHPg.js";import{a as R,d as k}from"./transform-D_Izdf89.js";import{u as D}from"./usePapers-CwnyeI7c.js";import{u as E}from"./useDebounce-BhnwRhGk.js";import{u as O,P as B}from"./usePeriodFilter-BrbWqy5G.js";import{u as $}from"./useIntersectionObserver-CkOYzKe_.js";import{S as c}from"./skeleton-D8Wtx_Nu.js";import{A as z,a as M}from"./alert-MNWNJkBv.js";import{u as q}from"./useQuery-Cvv958Kx.js";import"./LatexTitle-CcMIi9G1.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-Dd12EyZd.js";const K=[["trending","trending"],["new","newest"],["cited","most cited"]],ie=()=>{var x,g,j,f,N;const[d,v]=I(),o=d.get("search")||"",[p,b]=i.useState(o),t=E(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),v(s,{replace:!0})},[t]);const[n,P]=i.useState("new"),{period:y,setPeriod:S,publishedAfter:w}=O("All Time"),a=D({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:w,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>C.getTasks({ordering:"-paper_count",page_size:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(A=>A.results))||[]).map(R)},[a.data]),{targetRef:_,isIntersecting:h}=$({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:B.map(s=>e.jsx("button",{className:`period-btn ${y===s?"active":""}`,onClick:()=>S(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(L,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>b(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(N=(f=m.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(F,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:K.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>P(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx(z,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(T,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:_,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{ie as default};
 
 
assets/PapersListView-b_LgTzEk.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as I,r as i,j as e,L as F,a as L}from"./index-D3-tYEe-.js";import{I as T,P as C}from"./components-D244J_Aj.js";import{a as R,d as k}from"./transform-nNAikYlJ.js";import{u as D}from"./usePapers-C3rZB7Pt.js";import{u as E}from"./useDebounce-CkuFydiu.js";import{u as O,P as B}from"./usePeriodFilter-BzXQM3-U.js";import{u as $}from"./useIntersectionObserver-SHZ4yqtO.js";import{S as c}from"./skeleton-D0cyB03X.js";import{A as z,a as M}from"./alert-Ayuop_ag.js";import{u as q}from"./useQuery-C6S8Ozku.js";import"./LatexTitle-ZrlO0rs7.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DEoip3HO.js";const K=[["trending","trending"],["new","newest"],["cited","most cited"]],te=()=>{var x,g,j,f,N;const[d,v]=I(),o=d.get("search")||"",[p,b]=i.useState(o),t=E(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),v(s,{replace:!0})},[t]);const[n,P]=i.useState("new"),{period:y,setPeriod:S,publishedAfter:w}=O("All Time"),a=D({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:w,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>L.getTasks({ordering:"-paper_count",page_size:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(A=>A.results))||[]).map(R)},[a.data]),{targetRef:_,isIntersecting:h}=$({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:B.map(s=>e.jsx("button",{className:`period-btn ${y===s?"active":""}`,onClick:()=>S(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(T,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>b(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(N=(f=m.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(F,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:K.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>P(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx(z,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(C,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:_,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{te as default};
assets/SavedPapersView-BVm6geTt.js DELETED
@@ -1 +0,0 @@
1
- import{x as o,j as s,H as m,L as p}from"./index-C6O8_a1-.js";import{u as h}from"./useQuery-Cvv958Kx.js";import{T as x,P as u}from"./components-CMH89RDy.js";import{S as r}from"./skeleton-D8Wtx_Nu.js";import{A as j,a as v}from"./alert-MNWNJkBv.js";import{a as N}from"./api-DLAvdHPg.js";import{a as g}from"./transform-D_Izdf89.js";import"./LatexTitle-CcMIi9G1.js";import"./adminAuth-PI_XkM8E.js";const C=()=>{var l;const{user:d,isLoading:c}=o(),a=h({queryKey:["my-bookmarks"],queryFn:()=>N.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(j,{variant:"destructive",className:"mb-4",children:s.jsx(v,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(x,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(u,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{C as default};
 
 
assets/SavedPapersView-CJCobMQf.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{U as o,j as s,T as m,L as p,a as h}from"./index-D3-tYEe-.js";import{u as x}from"./useQuery-C6S8Ozku.js";import{T as u,P as j}from"./components-D244J_Aj.js";import{S as r}from"./skeleton-D0cyB03X.js";import{A as v,a as N}from"./alert-Ayuop_ag.js";import{a as g}from"./transform-nNAikYlJ.js";import"./LatexTitle-ZrlO0rs7.js";import"./katex.min-BSBacQyE.js";const L=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{L as default};
assets/SearchOverlay-BUaZzPoI.js DELETED
@@ -1 +0,0 @@
1
- import{r as f,G as w,y as E,j as s}from"./index-C6O8_a1-.js";import{u as d}from"./useQuery-Cvv958Kx.js";import{L as Q}from"./LatexTitle-CcMIi9G1.js";import{a as u}from"./api-DLAvdHPg.js";import{u as C}from"./useDebounce-BhnwRhGk.js";import{f as L,h as R,d as K}from"./transform-D_Izdf89.js";import"./adminAuth-PI_XkM8E.js";const X=({open:t,onClose:n})=>{var y,N,k;const p=f.useRef(null),b=w(),[m,F]=E.useState(""),a=C(m,200);f.useEffect(()=>{var r;if(!t)return;(r=p.current)==null||r.focus();const e=T=>{T.key==="Escape"&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,n]);const g=d({queryKey:["search-papers",a],queryFn:()=>u.searchPapers(a,6),enabled:t&&a.length>=2,staleTime:6e4}),x=d({queryKey:["search-tasks",a],queryFn:()=>u.getTasks({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),j=d({queryKey:["search-methods",a],queryFn:()=>u.getMethods({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),v=d({queryKey:["search-benchmarks",a],queryFn:()=>u.getDatasets({q:a,page_size:6,ordering:"-paper_count"}),enabled:t&&a.length>=2,staleTime:6e4});if(!t)return null;const c=((y=x.data)==null?void 0:y.results)||[],l=((N=j.data)==null?void 0:N.results)||[],i=((k=v.data)==null?void 0:k.results)||[],h=g.data||[],_=g.isFetching||x.isFetching||j.isFetching||v.isFetching,q=c.length||h.length||l.length||i.length,o=e=>{n(),b(e)};return s.jsx("div",{className:"search-overlay",onClick:n,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:p,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:m,onChange:e=>F(e.target.value)}),s.jsxs("div",{className:"search-results",children:[!a&&s.jsx("div",{className:"search-empty",children:"Try “diffusion”, “object detection”, or an arXiv id."}),a&&!_&&!q&&s.jsxs("div",{className:"search-empty",children:['No matches for "',m,'"']}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",c.length]}),c.map(e=>{const r=L(R(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:K(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),l.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",l.length]}),l.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),i.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",i.length]}),i.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),h.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · ",h.length]}),h.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>o(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(Q,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)})]})]})]})})};export{X as default};
 
 
assets/SearchOverlay-D_x7sv0Q.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as f,$ as w,V as E,j as s,a as d}from"./index-D3-tYEe-.js";import{u}from"./useQuery-C6S8Ozku.js";import{L as Q}from"./LatexTitle-ZrlO0rs7.js";import{u as C}from"./useDebounce-CkuFydiu.js";import{f as L,h as R,d as $}from"./transform-nNAikYlJ.js";import"./katex.min-BSBacQyE.js";const D=({open:t,onClose:r})=>{var y,N,k;const p=f.useRef(null),b=w(),[m,F]=E.useState(""),a=C(m,200);f.useEffect(()=>{var n;if(!t)return;(n=p.current)==null||n.focus();const e=T=>{T.key==="Escape"&&r()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,r]);const g=u({queryKey:["search-papers",a],queryFn:()=>d.searchPapers(a,6),enabled:t&&a.length>=2,staleTime:6e4}),x=u({queryKey:["search-tasks",a],queryFn:()=>d.getTasks({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),j=u({queryKey:["search-methods",a],queryFn:()=>d.getMethods({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),v=u({queryKey:["search-benchmarks",a],queryFn:()=>d.getDatasets({q:a,page_size:6,ordering:"-paper_count"}),enabled:t&&a.length>=2,staleTime:6e4});if(!t)return null;const c=((y=x.data)==null?void 0:y.results)||[],l=((N=j.data)==null?void 0:N.results)||[],i=((k=v.data)==null?void 0:k.results)||[],h=g.data||[],_=g.isFetching||x.isFetching||j.isFetching||v.isFetching,q=c.length||h.length||l.length||i.length,o=e=>{r(),b(e)};return s.jsx("div",{className:"search-overlay",onClick:r,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:p,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:m,onChange:e=>F(e.target.value)}),s.jsxs("div",{className:"search-results",children:[!a&&s.jsx("div",{className:"search-empty",children:"Try “diffusion”, “object detection”, or an arXiv id."}),a&&!_&&!q&&s.jsxs("div",{className:"search-empty",children:['No matches for "',m,'"']}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",c.length]}),c.map(e=>{const n=L(R(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:n.dot}}),s.jsx("span",{className:"name",children:$(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),l.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",l.length]}),l.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),i.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",i.length]}),i.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),h.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · ",h.length]}),h.map(e=>{var n;return s.jsxs("div",{className:"search-result",onClick:()=>o(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(Q,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((n=e.authors)==null?void 0:n[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)})]})]})]})})};export{D as default};
assets/SettingsView-DDUVofcg.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{U as r,a0 as o,V as c,j as e,T as l}from"./index-D3-tYEe-.js";import{S as d}from"./switch-9KW_DGK2.js";import{f as h,D as m}from"./latexPlainText-ChVkH0gY.js";import"./index-BsV_WMf3.js";const j=()=>{const{user:s}=r(),{preferences:t,setHideClosedSourceEvals:a,canPersist:i}=o();return c.useEffect(()=>(document.title=h("Settings"),()=>{document.title=m}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(d,{id:"hide-closed-source-evals",checked:t.hide_closed_source_evals,onCheckedChange:n=>{a(!!n)}})]}),!i&&!s&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(l,{returnTo:"/settings"})})]})]})]})};export{j as default};
assets/SubmissionsDashboard-CBSTFtkY.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as G,j as e,aj as W,ak as ee,V as x,k as v,al as se,U as ie,m as X,am as te,l as ne,an as ae,ao as re,ap as oe,aq as le,ar as ce,as as U}from"./index-D3-tYEe-.js";import{u as F}from"./useQueries-7Jjoe24_.js";import{u as K}from"./useQuery-C6S8Ozku.js";import{u as B}from"./useMutation-DDsKa144.js";import{R as de,C as ue,a as me}from"./refresh-cw-gCrkdl6j.js";import{L as A}from"./loader-circle-BKVFOFo9.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 fe=G("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
7
+ * @license lucide-react v0.462.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const pe=G("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),y=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},H=s=>Array.isArray(s)?s.map(i=>{const n=y(i),o=Number(n.id);return Number.isFinite(o)?{id:o,name:typeof n.name=="string"?n.name:`#${o}`,slug:typeof n.slug=="string"?n.slug:void 0}:null}).filter(i=>!!i):[],J=s=>Array.isArray(s)?s.map(Number).filter(i=>Number.isFinite(i)):[],C=s=>Array.isArray(s)?s.map(i=>{const n=y(i);return typeof n.url!="string"?null:{url:n.url,is_official:!!n.is_official}}).filter(i=>!!i):[],he=s=>Array.isArray(s)?s.map(i=>y(i)):[],je=s=>Array.isArray(s)?s.map(i=>y(i)):[],xe=s=>s.replace(/_/g," ");function be({currentPayload:s,proposedPayload:i}){const[n,o]=x.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>o(a=>!a),children:n?"Hide raw JSON":"Show raw JSON"}),n&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(P,{title:"Current payload",value:s??{}}),e.jsx(P,{title:"Proposed payload",value:i})]})]})}function P({title:s,value:i}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(i,null,2)})]})}function V({currentItems:s,proposedIds:i,queryPrefix:n,fetchEntity:o}){const a=x.useMemo(()=>Array.from(new Set([...s.map(r=>r.id),...i])).sort((r,l)=>r-l),[s,i]),c=F({queries:a.map(r=>({queryKey:[n,String(r)],queryFn:()=>o(String(r)),staleTime:5*60*1e3}))}),u=x.useMemo(()=>{const r=new Map;return s.forEach(l=>r.set(l.id,l.name)),c.forEach(l=>{const h=l.data;if(!h)return;const f=Number(h.id);Number.isFinite(f)&&r.set(f,h.name)}),r},[s,c]),p=new Set(s.map(r=>r.id)),m=new Set(i),g=a.filter(r=>p.has(r)&&!m.has(r)),b=a.filter(r=>!p.has(r)&&m.has(r)),t=(r,l)=>{const h=l==="current"&&g.includes(r),f=l==="proposed"&&b.includes(r);return e.jsx("span",{className:v("submission-diff-pill",h&&"removed",f&&"added"),children:u.get(r)??`#${r}`},r)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Currently tagged",children:s.length>0?s.map(r=>t(r.id,"current")):e.jsx(S,{children:"No current tags"})}),e.jsx(R,{title:"Will be tagged",children:i.length>0?i.map(r=>t(r,"proposed")):e.jsx(S,{children:"No proposed tags"})})]})}function T({label:s,currentItems:i,proposedItems:n}){const o=new Map(i.map(u=>[u.url,u])),a=new Map(n.map(u=>[u.url,u])),c=Array.from(new Set([...o.keys(),...a.keys()])).sort();return c.length===0?e.jsxs(S,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:c.map(u=>{var r;const p=o.get(u),m=a.get(u),g=!p&&m,b=p&&!m,t=p&&m&&p.is_official!==m.is_official;return e.jsx("div",{className:v("submission-url-row",g&&"added",b&&"removed",t&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:v("submission-url-link",b&&"removed"),children:u}),g&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),b&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),t&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(p.is_official)," ","->"," ",String(m.is_official)]}),((r=m??p)==null?void 0:r.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},u)})})}function ge({currentPayload:s,proposedPayload:i}){const n=he(y(s).evaluations),o=je(i.operations),a=x.useMemo(()=>{const t=new Set;return n.forEach(r=>{r.task_id&&t.add(Number(r.task_id))}),o.forEach(r=>{const l=r.data;l!=null&&l.task_id&&t.add(Number(l.task_id))}),Array.from(t).filter(r=>Number.isFinite(r))},[n,o]),c=x.useMemo(()=>{const t=new Set;return n.forEach(r=>{r.dataset_id&&t.add(Number(r.dataset_id))}),o.forEach(r=>{const l=r.data;l!=null&&l.dataset_id&&t.add(Number(l.dataset_id))}),Array.from(t).filter(r=>Number.isFinite(r))},[n,o]),u=F({queries:a.map(t=>({queryKey:["task",String(t)],queryFn:()=>W(String(t)),staleTime:5*60*1e3}))}),p=F({queries:c.map(t=>({queryKey:["dataset",String(t)],queryFn:()=>se(String(t)),staleTime:5*60*1e3}))}),m=x.useMemo(()=>{const t=new Map;return u.forEach(r=>{const l=r.data;if(!l)return;const h=Number(l.id);Number.isFinite(h)&&t.set(h,l.name)}),t},[u]),g=x.useMemo(()=>{const t=new Map;return p.forEach(r=>{const l=r.data;if(!l)return;const h=Number(l.id);Number.isFinite(h)&&t.set(h,l.name)}),t},[p]),b=new Map(n.filter(t=>t.id!=null).map(t=>[Number(t.id),t]));return o.length===0?e.jsx(S,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:o.map((t,r)=>{const l=t.evaluation_id?b.get(t.evaluation_id):void 0,f=(t.op==="update"?{...l,...t.data}:t.data??l)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:v("submission-pill status",t.op==="create"&&"approved",t.op==="update"&&"changed",t.op==="delete"&&"rejected"),children:t.op??"unknown"}),t.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",t.evaluation_id]})]}),t.op&&["create","update","delete"].includes(t.op)?e.jsx(Ne,{evaluation:f,taskNames:m,datasetNames:g}):e.jsx(P,{title:"Unsupported operation",value:t})]},`${t.op}-${t.evaluation_id??r}`)})})}function Ne({evaluation:s,taskNames:i,datasetNames:n}){const o=s.task_id?Number(s.task_id):void 0,a=s.dataset_id?Number(s.dataset_id):void 0,c=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(k,{label:"Task",value:o?i.get(o)??`#${o}`:null}),e.jsx(k,{label:"Dataset",value:a?n.get(a)??`#${a}`:null}),e.jsx(k,{label:"Model",value:s.model_name||null}),e.jsx(k,{label:"Harness",value:s.harness||null}),e.jsx(k,{label:"Best rank",value:s.best_rank??null}),e.jsx(k,{label:"Parameters",value:s.num_parameters??null}),e.jsx(k,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(c).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(c).map(([u,p])=>e.jsxs("span",{className:"submission-metric-pill",children:[u,": ",String(p)]},u))}):e.jsx(S,{children:"No metrics"})]})]})}function k({label:s,value:i}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:i??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ve({currentPayload:s,proposedPayload:i}){const n=y(s).source_url,o=i.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Current source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(S,{children:"No current URL"})}),e.jsx(R,{title:"Proposed source URL",children:typeof o=="string"&&o?e.jsx("a",{className:"submission-url-link",href:o,target:"_blank",rel:"noopener noreferrer",children:o}):e.jsx(S,{children:"No proposed URL"})})]})}function R({title:s,children:i}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:i})]})}function S({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ye({currentPayload:s,proposedPayload:i}){const n=y(s),o=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:o.map(({key:a,label:c})=>{const u=Array.isArray(n[a])?n[a].filter(m=>typeof m=="string"):[],p=Array.isArray(i[a])?i[a].filter(m=>typeof m=="string"):[];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:c}),e.jsx(T,{label:c.toLowerCase(),currentItems:u.map(m=>({url:m,is_official:!1})),proposedItems:p.map(m=>({url:m,is_official:!1}))})]},a)})})}function _e({editType:s,currentPayload:i,proposedPayload:n}){const o=y(i);let a;return s==="tasks"?a=e.jsx(V,{currentItems:H(o.tasks),proposedIds:J(n.task_ids),queryPrefix:"task",fetchEntity:W}):s==="methods"?a=e.jsx(V,{currentItems:H(o.methods),proposedIds:J(n.method_ids),queryPrefix:"method",fetchEntity:ee}):s==="repositories"?a=e.jsx(T,{label:"repositories",currentItems:C(o.repositories),proposedItems:C(n.repositories)}):s==="project_pages"?a=e.jsx(T,{label:"project pages",currentItems:C(o.project_pages),proposedItems:C(n.project_pages)}):s==="evaluations"?a=e.jsx(ge,{currentPayload:i,proposedPayload:n}):s==="source_url"?a=e.jsx(ve,{currentPayload:i,proposedPayload:n}):s==="hf_artifacts"?a=e.jsx(ye,{currentPayload:i,proposedPayload:n}):a=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",xe(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[a,e.jsx(be,{currentPayload:i,proposedPayload:n})]})}const I=25,ke=["pending","approved","rejected","all"],Se=["all","tasks","methods","evaluations","repositories","project_pages","source_url"],D=["pending","approved","rejected"];function we(s){return s.slice(0,2).toUpperCase()}function M(s){return s.replace(/_/g," ")}function Y(s){if(!s)return"unknown time";const i=new Date(s);if(Number.isNaN(i.getTime()))return s;const n=Date.now()-i.getTime(),o=Math.floor(n/6e4),a=Math.floor(n/36e5),c=Math.floor(n/864e5);return o<1?"just now":o<60?`${o}m ago`:a<24?`${a}h ago`:c<14?`${c}d ago`:i.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function L(s,i){var o;const n=s;if(n.response)try{const a=JSON.parse(n.response);if(typeof(a==null?void 0:a.detail)=="string")return a.detail;if(Array.isArray(a==null?void 0:a.detail)&&((o=a.detail[0])!=null&&o.msg))return a.detail[0].msg}catch{return n.response}return n.message||i}function Ae(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function Ee(s,i){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(i)}function Ce(s){return[...s].sort((i,n)=>new Date(n.created_at).getTime()-new Date(i.created_at).getTime())}async function Me(s,i,n){const o=i==="all"?void 0:i;if(s!=="all")return U({status:s,edit_type:o,limit:n,offset:0});const a=await Promise.all(D.map(c=>U({status:c,edit_type:o,limit:n,offset:0})));return{count:a.reduce((c,u)=>c+u.count,0),results:Ce(a.flatMap(c=>c.results)).slice(0,n)}}function Fe(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(pe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function Re(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(A,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function qe({submission:s,paper:i}){const[n,o]=x.useState(s.admin_note??""),a=ne(),{toast:c}=X(),u=Ee(i,s.paper_id),p=(i==null?void 0:i.title)||`Paper #${s.paper_id}`,m=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,g=s.status==="pending";x.useEffect(()=>{o(s.admin_note??"")},[s.admin_note,s.id]);const b=x.useCallback(j=>{a.invalidateQueries({queryKey:["pendingPaperEdits"]}),a.invalidateQueries({queryKey:["pendingPaperEdit",j.id]}),a.invalidateQueries({queryKey:["paper",String(j.paper_id)]}),a.invalidateQueries({queryKey:["paper-summary",String(j.paper_id)]}),i!=null&&i.arxiv_id&&a.invalidateQueries({queryKey:["paper-arxiv",i.arxiv_id]}),j.edit_type==="evaluations"&&a.invalidateQueries({queryKey:["evaluations","paper",String(j.paper_id)]})},[i==null?void 0:i.arxiv_id,a]),t=B({mutationFn:()=>le(s.id,{admin_note:n.trim()||void 0}),onSuccess:j=>{b(j),c({title:"Submission approved",description:`Applied ${M(s.edit_type)} changes for ${p}.`})},onError:j=>{c({title:"Could not approve submission",description:L(j,"Approval failed. Please try again."),variant:"destructive"})}}),r=B({mutationFn:()=>ce(s.id,{admin_note:n.trim()||void 0}),onSuccess:j=>{b(j),c({title:"Submission rejected",description:`Rejected ${M(s.edit_type)} changes for ${p}.`})},onError:j=>{c({title:"Could not reject submission",description:L(j,"Rejection failed. Please try again."),variant:"destructive"})}}),l=t.isPending,h=r.isPending,f=l||h;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[e.jsx("a",{href:`/paper/${encodeURIComponent(u)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsxs("span",{children:["Paper #",s.paper_id]}),e.jsx("span",{children:Y(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:M(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:v("submission-pill status",Ae(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(ae,{className:"h-6 w-6",children:[e.jsx(re,{src:m,alt:s.hf_username}),e.jsx(oe,{className:"text-[10px]",children:we(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(_e,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:g?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:n,onChange:j=>o(j.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:f}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>r.mutate(),disabled:f,className:"submission-action-btn reject",children:[h?e.jsx(A,{className:"spin",size:14}):e.jsx(ue,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>t.mutate(),disabled:f,className:"submission-action-btn approve",children:[l?e.jsx(A,{className:"spin",size:14}):e.jsx(me,{size:14}),"Approve"]})]})]}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${Y(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]})]})})]})}function $e(){var Q,O,z;const{user:s,isLoading:i}=ie(),{toast:n}=X(),[o,a]=x.useState("pending"),[c,u]=x.useState("all"),[p,m]=x.useState(I),g=!!(s!=null&&s.is_admin);x.useEffect(()=>{m(I)},[o,c]);const b=K({queryKey:["pendingPaperEdits","counts",c],queryFn:async()=>{const d=c==="all"?void 0:c,_=await Promise.all(D.map(N=>U({status:N,edit_type:d,limit:1,offset:0})));return Object.fromEntries(_.map((N,E)=>[D[E],N.count]))},enabled:g,staleTime:30*1e3}),t=K({queryKey:["pendingPaperEdits",{status:o,editType:c,visibleLimit:p}],queryFn:()=>Me(o,c,p),enabled:g,retry:!1}),r=x.useMemo(()=>{var d;return Array.from(new Set((((d=t.data)==null?void 0:d.results)??[]).map(_=>_.paper_id))).sort((_,N)=>_-N)},[(Q=t.data)==null?void 0:Q.results]),l=F({queries:r.map(d=>({queryKey:["paper-summary",String(d)],queryFn:()=>te(String(d),!1),enabled:g,staleTime:5*60*1e3}))}),h=x.useMemo(()=>{const d=new Map;return l.forEach(_=>{const N=_.data;if(!N)return;const E=Number(N.id);Number.isFinite(E)&&d.set(E,N)}),d},[l]);if(x.useEffect(()=>{t.error&&n({title:"Could not load submissions",description:L(t.error,"Failed to load pending paper edits."),variant:"destructive"})},[t.error,n]),i)return e.jsx(Re,{});if(!g)return e.jsx(Fe,{});const f=b.data,j=f?f.pending+f.approved+f.rejected:void 0,$={pending:f==null?void 0:f.pending,approved:f==null?void 0:f.approved,rejected:f==null?void 0:f.rejected,all:j},w=((O=t.data)==null?void 0:O.results)??[],q=((z=t.data)==null?void 0:z.count)??0,Z=w.length<q;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{b.refetch(),t.refetch()},disabled:t.isFetching||b.isFetching,children:[e.jsx(de,{className:v((t.isFetching||b.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:ke.map(d=>e.jsxs("button",{type:"button",className:v("period-btn",o===d&&"active"),onClick:()=>a(d),children:[d,$[d]!=null&&e.jsx("span",{className:"submission-count",children:$[d]})]},d))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:Se.map(d=>e.jsx("button",{type:"button",className:v("sort-btn",c===d&&"active"),onClick:()=>u(d),children:M(d)},d))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:t.isFetching?"refreshing":`${q} submissions`})})})}),t.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(A,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):w.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(fe,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:w.map(d=>e.jsx(qe,{submission:d,paper:h.get(d.paper_id)},d.id))}),w.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",w.length," of ",q," submissions"]}),Z&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(d=>d+I),disabled:t.isFetching,children:[t.isFetching&&e.jsx(A,{className:"spin",size:14}),"Load more"]})]})]})]})}export{$e as default};
assets/SubmissionsDashboard-CGUCxt6x.js DELETED
@@ -1,11 +0,0 @@
1
- import{c as Z,j as e,y as x,h as v,x as ee,q as G,p as se,Y as ie,Z as te,_ as ne}from"./index-C6O8_a1-.js";import{u as F}from"./useQueries-BhLiWt7J.js";import{u as O}from"./useQuery-Cvv958Kx.js";import{u as B}from"./useMutation-DLRmDXLC.js";import{q as W,r as re,t as ae,v as oe,w as le,x as ce,y as P}from"./api-DLAvdHPg.js";import{R as de,C as ue,a as me}from"./refresh-cw-CcA4286O.js";import{L as A}from"./loader-circle-DK8Ui2RE.js";import"./adminAuth-PI_XkM8E.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 fe=Z("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
7
- * @license lucide-react v0.462.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const pe=Z("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),y=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},H=s=>Array.isArray(s)?s.map(i=>{const n=y(i),o=Number(n.id);return Number.isFinite(o)?{id:o,name:typeof n.name=="string"?n.name:`#${o}`,slug:typeof n.slug=="string"?n.slug:void 0}:null}).filter(i=>!!i):[],J=s=>Array.isArray(s)?s.map(Number).filter(i=>Number.isFinite(i)):[],C=s=>Array.isArray(s)?s.map(i=>{const n=y(i);return typeof n.url!="string"?null:{url:n.url,is_official:!!n.is_official}}).filter(i=>!!i):[],he=s=>Array.isArray(s)?s.map(i=>y(i)):[],je=s=>Array.isArray(s)?s.map(i=>y(i)):[],xe=s=>s.replace(/_/g," ");function ge({currentPayload:s,proposedPayload:i}){const[n,o]=x.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>o(r=>!r),children:n?"Hide raw JSON":"Show raw JSON"}),n&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(T,{title:"Current payload",value:s??{}}),e.jsx(T,{title:"Proposed payload",value:i})]})]})}function T({title:s,value:i}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(i,null,2)})]})}function V({currentItems:s,proposedIds:i,queryPrefix:n,fetchEntity:o}){const r=x.useMemo(()=>Array.from(new Set([...s.map(a=>a.id),...i])).sort((a,l)=>a-l),[s,i]),c=F({queries:r.map(a=>({queryKey:[n,String(a)],queryFn:()=>o(String(a)),staleTime:5*60*1e3}))}),u=x.useMemo(()=>{const a=new Map;return s.forEach(l=>a.set(l.id,l.name)),c.forEach(l=>{const h=l.data;if(!h)return;const f=Number(h.id);Number.isFinite(f)&&a.set(f,h.name)}),a},[s,c]),p=new Set(s.map(a=>a.id)),m=new Set(i),b=r.filter(a=>p.has(a)&&!m.has(a)),g=r.filter(a=>!p.has(a)&&m.has(a)),t=(a,l)=>{const h=l==="current"&&b.includes(a),f=l==="proposed"&&g.includes(a);return e.jsx("span",{className:v("submission-diff-pill",h&&"removed",f&&"added"),children:u.get(a)??`#${a}`},a)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Currently tagged",children:s.length>0?s.map(a=>t(a.id,"current")):e.jsx(k,{children:"No current tags"})}),e.jsx(R,{title:"Will be tagged",children:i.length>0?i.map(a=>t(a,"proposed")):e.jsx(k,{children:"No proposed tags"})})]})}function U({label:s,currentItems:i,proposedItems:n}){const o=new Map(i.map(u=>[u.url,u])),r=new Map(n.map(u=>[u.url,u])),c=Array.from(new Set([...o.keys(),...r.keys()])).sort();return c.length===0?e.jsxs(k,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:c.map(u=>{var a;const p=o.get(u),m=r.get(u),b=!p&&m,g=p&&!m,t=p&&m&&p.is_official!==m.is_official;return e.jsx("div",{className:v("submission-url-row",b&&"added",g&&"removed",t&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:v("submission-url-link",g&&"removed"),children:u}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),g&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),t&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(p.is_official)," ","->"," ",String(m.is_official)]}),((a=m??p)==null?void 0:a.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},u)})})}function be({currentPayload:s,proposedPayload:i}){const n=he(y(s).evaluations),o=je(i.operations),r=x.useMemo(()=>{const t=new Set;return n.forEach(a=>{a.task_id&&t.add(Number(a.task_id))}),o.forEach(a=>{const l=a.data;l!=null&&l.task_id&&t.add(Number(l.task_id))}),Array.from(t).filter(a=>Number.isFinite(a))},[n,o]),c=x.useMemo(()=>{const t=new Set;return n.forEach(a=>{a.dataset_id&&t.add(Number(a.dataset_id))}),o.forEach(a=>{const l=a.data;l!=null&&l.dataset_id&&t.add(Number(l.dataset_id))}),Array.from(t).filter(a=>Number.isFinite(a))},[n,o]),u=F({queries:r.map(t=>({queryKey:["task",String(t)],queryFn:()=>W(String(t)),staleTime:5*60*1e3}))}),p=F({queries:c.map(t=>({queryKey:["dataset",String(t)],queryFn:()=>ae(String(t)),staleTime:5*60*1e3}))}),m=x.useMemo(()=>{const t=new Map;return u.forEach(a=>{const l=a.data;if(!l)return;const h=Number(l.id);Number.isFinite(h)&&t.set(h,l.name)}),t},[u]),b=x.useMemo(()=>{const t=new Map;return p.forEach(a=>{const l=a.data;if(!l)return;const h=Number(l.id);Number.isFinite(h)&&t.set(h,l.name)}),t},[p]),g=new Map(n.filter(t=>t.id!=null).map(t=>[Number(t.id),t]));return o.length===0?e.jsx(k,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:o.map((t,a)=>{const l=t.evaluation_id?g.get(t.evaluation_id):void 0,f=(t.op==="update"?{...l,...t.data}:t.data??l)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:v("submission-pill status",t.op==="create"&&"approved",t.op==="update"&&"changed",t.op==="delete"&&"rejected"),children:t.op??"unknown"}),t.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",t.evaluation_id]})]}),t.op&&["create","update","delete"].includes(t.op)?e.jsx(Ne,{evaluation:f,taskNames:m,datasetNames:b}):e.jsx(T,{title:"Unsupported operation",value:t})]},`${t.op}-${t.evaluation_id??a}`)})})}function Ne({evaluation:s,taskNames:i,datasetNames:n}){const o=s.task_id?Number(s.task_id):void 0,r=s.dataset_id?Number(s.dataset_id):void 0,c=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(S,{label:"Task",value:o?i.get(o)??`#${o}`:null}),e.jsx(S,{label:"Dataset",value:r?n.get(r)??`#${r}`:null}),e.jsx(S,{label:"Model",value:s.model_name||null}),e.jsx(S,{label:"Harness",value:s.harness||null}),e.jsx(S,{label:"Best rank",value:s.best_rank??null}),e.jsx(S,{label:"Parameters",value:s.num_parameters??null}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(c).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(c).map(([u,p])=>e.jsxs("span",{className:"submission-metric-pill",children:[u,": ",String(p)]},u))}):e.jsx(k,{children:"No metrics"})]})]})}function S({label:s,value:i}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:i??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ve({currentPayload:s,proposedPayload:i}){const n=y(s).source_url,o=i.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Current source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(k,{children:"No current URL"})}),e.jsx(R,{title:"Proposed source URL",children:typeof o=="string"&&o?e.jsx("a",{className:"submission-url-link",href:o,target:"_blank",rel:"noopener noreferrer",children:o}):e.jsx(k,{children:"No proposed URL"})})]})}function R({title:s,children:i}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:i})]})}function k({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ye({currentPayload:s,proposedPayload:i}){const n=y(s),o=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:o.map(({key:r,label:c})=>{const u=Array.isArray(n[r])?n[r].filter(m=>typeof m=="string"):[],p=Array.isArray(i[r])?i[r].filter(m=>typeof m=="string"):[];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:c}),e.jsx(U,{label:c.toLowerCase(),currentItems:u.map(m=>({url:m,is_official:!1})),proposedItems:p.map(m=>({url:m,is_official:!1}))})]},r)})})}function _e({editType:s,currentPayload:i,proposedPayload:n}){const o=y(i);let r;return s==="tasks"?r=e.jsx(V,{currentItems:H(o.tasks),proposedIds:J(n.task_ids),queryPrefix:"task",fetchEntity:W}):s==="methods"?r=e.jsx(V,{currentItems:H(o.methods),proposedIds:J(n.method_ids),queryPrefix:"method",fetchEntity:re}):s==="repositories"?r=e.jsx(U,{label:"repositories",currentItems:C(o.repositories),proposedItems:C(n.repositories)}):s==="project_pages"?r=e.jsx(U,{label:"project pages",currentItems:C(o.project_pages),proposedItems:C(n.project_pages)}):s==="evaluations"?r=e.jsx(be,{currentPayload:i,proposedPayload:n}):s==="source_url"?r=e.jsx(ve,{currentPayload:i,proposedPayload:n}):s==="hf_artifacts"?r=e.jsx(ye,{currentPayload:i,proposedPayload:n}):r=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",xe(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[r,e.jsx(ge,{currentPayload:i,proposedPayload:n})]})}const I=25,ke=["pending","approved","rejected","all"],Se=["all","tasks","methods","evaluations","repositories","project_pages","source_url"],D=["pending","approved","rejected"];function we(s){return s.slice(0,2).toUpperCase()}function M(s){return s.replace(/_/g," ")}function Y(s){if(!s)return"unknown time";const i=new Date(s);if(Number.isNaN(i.getTime()))return s;const n=Date.now()-i.getTime(),o=Math.floor(n/6e4),r=Math.floor(n/36e5),c=Math.floor(n/864e5);return o<1?"just now":o<60?`${o}m ago`:r<24?`${r}h ago`:c<14?`${c}d ago`:i.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function L(s,i){var o;const n=s;if(n.response)try{const r=JSON.parse(n.response);if(typeof(r==null?void 0:r.detail)=="string")return r.detail;if(Array.isArray(r==null?void 0:r.detail)&&((o=r.detail[0])!=null&&o.msg))return r.detail[0].msg}catch{return n.response}return n.message||i}function Ae(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function Ee(s,i){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(i)}function Ce(s){return[...s].sort((i,n)=>new Date(n.created_at).getTime()-new Date(i.created_at).getTime())}async function Me(s,i,n){const o=i==="all"?void 0:i;if(s!=="all")return P({status:s,edit_type:o,limit:n,offset:0});const r=await Promise.all(D.map(c=>P({status:c,edit_type:o,limit:n,offset:0})));return{count:r.reduce((c,u)=>c+u.count,0),results:Ce(r.flatMap(c=>c.results)).slice(0,n)}}function Fe(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(pe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function Re(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(A,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function qe({submission:s,paper:i}){const[n,o]=x.useState(s.admin_note??""),r=se(),{toast:c}=G(),u=Ee(i,s.paper_id),p=(i==null?void 0:i.title)||`Paper #${s.paper_id}`,m=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,b=s.status==="pending";x.useEffect(()=>{o(s.admin_note??"")},[s.admin_note,s.id]);const g=x.useCallback(j=>{r.invalidateQueries({queryKey:["pendingPaperEdits"]}),r.invalidateQueries({queryKey:["pendingPaperEdit",j.id]}),r.invalidateQueries({queryKey:["paper",String(j.paper_id)]}),r.invalidateQueries({queryKey:["paper-summary",String(j.paper_id)]}),i!=null&&i.arxiv_id&&r.invalidateQueries({queryKey:["paper-arxiv",i.arxiv_id]}),j.edit_type==="evaluations"&&r.invalidateQueries({queryKey:["evaluations","paper",String(j.paper_id)]})},[i==null?void 0:i.arxiv_id,r]),t=B({mutationFn:()=>le(s.id,{admin_note:n.trim()||void 0}),onSuccess:j=>{g(j),c({title:"Submission approved",description:`Applied ${M(s.edit_type)} changes for ${p}.`})},onError:j=>{c({title:"Could not approve submission",description:L(j,"Approval failed. Please try again."),variant:"destructive"})}}),a=B({mutationFn:()=>ce(s.id,{admin_note:n.trim()||void 0}),onSuccess:j=>{g(j),c({title:"Submission rejected",description:`Rejected ${M(s.edit_type)} changes for ${p}.`})},onError:j=>{c({title:"Could not reject submission",description:L(j,"Rejection failed. Please try again."),variant:"destructive"})}}),l=t.isPending,h=a.isPending,f=l||h;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[e.jsx("a",{href:`/paper/${encodeURIComponent(u)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsxs("span",{children:["Paper #",s.paper_id]}),e.jsx("span",{children:Y(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:M(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:v("submission-pill status",Ae(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(ie,{className:"h-6 w-6",children:[e.jsx(te,{src:m,alt:s.hf_username}),e.jsx(ne,{className:"text-[10px]",children:we(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(_e,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:b?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:n,onChange:j=>o(j.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:f}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>a.mutate(),disabled:f,className:"submission-action-btn reject",children:[h?e.jsx(A,{className:"spin",size:14}):e.jsx(ue,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>t.mutate(),disabled:f,className:"submission-action-btn approve",children:[l?e.jsx(A,{className:"spin",size:14}):e.jsx(me,{size:14}),"Approve"]})]})]}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${Y(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]})]})})]})}function ze(){var Q,z,K;const{user:s,isLoading:i}=ee(),{toast:n}=G(),[o,r]=x.useState("pending"),[c,u]=x.useState("all"),[p,m]=x.useState(I),b=!!(s!=null&&s.is_admin);x.useEffect(()=>{m(I)},[o,c]);const g=O({queryKey:["pendingPaperEdits","counts",c],queryFn:async()=>{const d=c==="all"?void 0:c,_=await Promise.all(D.map(N=>P({status:N,edit_type:d,limit:1,offset:0})));return Object.fromEntries(_.map((N,E)=>[D[E],N.count]))},enabled:b,staleTime:30*1e3}),t=O({queryKey:["pendingPaperEdits",{status:o,editType:c,visibleLimit:p}],queryFn:()=>Me(o,c,p),enabled:b,retry:!1}),a=x.useMemo(()=>{var d;return Array.from(new Set((((d=t.data)==null?void 0:d.results)??[]).map(_=>_.paper_id))).sort((_,N)=>_-N)},[(Q=t.data)==null?void 0:Q.results]),l=F({queries:a.map(d=>({queryKey:["paper-summary",String(d)],queryFn:()=>oe(String(d),!1),enabled:b,staleTime:5*60*1e3}))}),h=x.useMemo(()=>{const d=new Map;return l.forEach(_=>{const N=_.data;if(!N)return;const E=Number(N.id);Number.isFinite(E)&&d.set(E,N)}),d},[l]);if(x.useEffect(()=>{t.error&&n({title:"Could not load submissions",description:L(t.error,"Failed to load pending paper edits."),variant:"destructive"})},[t.error,n]),i)return e.jsx(Re,{});if(!b)return e.jsx(Fe,{});const f=g.data,j=f?f.pending+f.approved+f.rejected:void 0,$={pending:f==null?void 0:f.pending,approved:f==null?void 0:f.approved,rejected:f==null?void 0:f.rejected,all:j},w=((z=t.data)==null?void 0:z.results)??[],q=((K=t.data)==null?void 0:K.count)??0,X=w.length<q;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{g.refetch(),t.refetch()},disabled:t.isFetching||g.isFetching,children:[e.jsx(de,{className:v((t.isFetching||g.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:ke.map(d=>e.jsxs("button",{type:"button",className:v("period-btn",o===d&&"active"),onClick:()=>r(d),children:[d,$[d]!=null&&e.jsx("span",{className:"submission-count",children:$[d]})]},d))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:Se.map(d=>e.jsx("button",{type:"button",className:v("sort-btn",c===d&&"active"),onClick:()=>u(d),children:M(d)},d))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:t.isFetching?"refreshing":`${q} submissions`})})})}),t.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(A,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):w.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(fe,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:w.map(d=>e.jsx(qe,{submission:d,paper:h.get(d.paper_id)},d.id))}),w.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",w.length," of ",q," submissions"]}),X&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(d=>d+I),disabled:t.isFetching,children:[t.isFetching&&e.jsx(A,{className:"spin",size:14}),"Load more"]})]})]})]})}export{ze as default};
 
 
 
 
 
 
 
 
 
 
 
 
assets/SubmitView-BXVcNQUx.js DELETED
@@ -1 +0,0 @@
1
- import{r as P,j as e,h as T,G as w,p as D,q as _,y as n}from"./index-C6O8_a1-.js";import{u as C}from"./useMutation-DLRmDXLC.js";import{A as E,a as z}from"./alert-MNWNJkBv.js";import{I as m,B as v}from"./input-BMdkOI2Z.js";import{p as F}from"./api-DLAvdHPg.js";import"./adminAuth-PI_XkM8E.js";const j=P.forwardRef(({className:r,...t},i)=>e.jsx("textarea",{className:T("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:i,...t}));j.displayName="Textarea";const X=/^\d{4}\.\d{4,5}(v\d+)?$/i,L=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,q=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const t=r.trim();return t?X.test(t)||L.test(t)||q.test(t)?"arxiv":/^https?:\/\//i.test(t)?"external":"arxiv":"empty"}function N(r,t){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=t.title.trim();l&&(s.title=l);const u=t.abstract.trim();u&&(s.abstract=u);const o=t.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return o.length>0&&(s.authors=o),t.datePublished&&(s.date_published=t.datePublished),s}function U(r){const t=r;if(!t)return"Submission failed";if(t.response)try{const i=JSON.parse(t.response);if(typeof i.detail=="string")return i.detail}catch{return t.response}return t.message||"Submission failed"}const K=()=>{const r=w(),t=D(),{toast:i}=_(),[d,s]=n.useState(""),[l,u]=n.useState(""),[o,h]=n.useState(""),[f,I]=n.useState(""),[g,A]=n.useState(""),[b,x]=n.useState(null),p=S(d),y=p==="external",c=C({mutationFn:a=>F(a),onSuccess:a=>{t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"}),i({title:a.created?"Paper submitted":"Paper already indexed",description:a.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${a.route_identifier}`)},onError:a=>{x(U(a))}}),R=a=>{if(a.preventDefault(),x(null),p==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const k=N(d,{title:l,abstract:o,authors:f,datePublished:g});c.mutate(k)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:R,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(m,{id:"submit-input",value:d,onChange:a=>s(a.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:p==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":p==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),y&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(m,{id:"submit-title",value:l,onChange:a=>u(a.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(j,{id:"submit-abstract",value:o,onChange:a=>h(a.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(m,{id:"submit-authors",value:f,onChange:a=>I(a.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(m,{id:"submit-date",type:"date",value:g,onChange:a=>A(a.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(E,{variant:"destructive",children:e.jsx(z,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(v,{type:"submit",disabled:c.isPending,children:c.isPending?y?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(v,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{K as default};
 
 
assets/SubmitView-DBn6RIiN.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as P,j as e,k as T,$ as w,l as D,m as _,V as n,ae as C}from"./index-D3-tYEe-.js";import{u as E}from"./useMutation-DDsKa144.js";import{A as z,a as F}from"./alert-Ayuop_ag.js";import{I as m,B as v}from"./input-C7eEyU6x.js";const j=P.forwardRef(({className:r,...t},i)=>e.jsx("textarea",{className:T("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:i,...t}));j.displayName="Textarea";const X=/^\d{4}\.\d{4,5}(v\d+)?$/i,L=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,q=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const t=r.trim();return t?X.test(t)||L.test(t)||q.test(t)?"arxiv":/^https?:\/\//i.test(t)?"external":"arxiv":"empty"}function N(r,t){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=t.title.trim();l&&(s.title=l);const u=t.abstract.trim();u&&(s.abstract=u);const o=t.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return o.length>0&&(s.authors=o),t.datePublished&&(s.date_published=t.datePublished),s}function U(r){const t=r;if(!t)return"Submission failed";if(t.response)try{const i=JSON.parse(t.response);if(typeof i.detail=="string")return i.detail}catch{return t.response}return t.message||"Submission failed"}const $=()=>{const r=w(),t=D(),{toast:i}=_(),[d,s]=n.useState(""),[l,u]=n.useState(""),[o,h]=n.useState(""),[g,I]=n.useState(""),[f,k]=n.useState(""),[b,x]=n.useState(null),p=S(d),y=p==="external",c=E({mutationFn:a=>C(a),onSuccess:a=>{t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"}),i({title:a.created?"Paper submitted":"Paper already indexed",description:a.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${a.route_identifier}`)},onError:a=>{x(U(a))}}),A=a=>{if(a.preventDefault(),x(null),p==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const R=N(d,{title:l,abstract:o,authors:g,datePublished:f});c.mutate(R)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:A,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(m,{id:"submit-input",value:d,onChange:a=>s(a.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:p==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":p==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),y&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(m,{id:"submit-title",value:l,onChange:a=>u(a.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(j,{id:"submit-abstract",value:o,onChange:a=>h(a.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(m,{id:"submit-authors",value:g,onChange:a=>I(a.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(m,{id:"submit-date",type:"date",value:f,onChange:a=>k(a.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(z,{variant:"destructive",children:e.jsx(F,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(v,{type:"submit",disabled:c.isPending,children:c.isPending?y?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(v,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{$ as default};
assets/TagBrowseView-BbO1OnLU.js DELETED
@@ -1 +0,0 @@
1
- import{E as ds,G as os,u as ms,r as h,j as s,L as x,y as hs}from"./index-C6O8_a1-.js";import{u as us}from"./useQueries-BhLiWt7J.js";import{u as g}from"./useQuery-Cvv958Kx.js";import{P as ps,M as xs}from"./components-CMH89RDy.js";import{M as J}from"./MarkdownText-p29EEUf7.js";import{a as u}from"./api-DLAvdHPg.js";import{a as gs,d as f}from"./transform-D_Izdf89.js";import{c as js}from"./usePapers-CwnyeI7c.js";import{u as Ns}from"./useIntersectionObserver-CkOYzKe_.js";import{S as _}from"./skeleton-D8Wtx_Nu.js";import{A as ks,a as bs}from"./alert-MNWNJkBv.js";import"./LatexTitle-CcMIi9G1.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-Dd12EyZd.js";const vs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ys=d=>d==="trending"||d==="date_published"||d==="citation_count"?d:"trending",C=3,w=2,fs=d=>[...d].sort((j,N)=>{const k=j.slug==="classic-language-modeling",b=N.slug==="classic-language-modeling";return k!==b?k?1:-1:0}),$s=()=>{var D,R,$,A,I,K,O,Q,z,U,H,V,G;const{taskSlug:d}=ds(),j=os(),[N,k]=ms(),b=ys(N.get("order_by")),X=e=>{const a=new URLSearchParams(N);a.set("order_by",e),k(a)},[F,Y]=h.useState(!1),[Z,ss]=h.useState(()=>new Set),n=g({queryKey:["task",d],queryFn:()=>u.getTask(d),enabled:!!d,staleTime:10*60*1e3}),es=g({queryKey:["task-parents",(D=n.data)==null?void 0:D.id],queryFn:()=>u.getTaskParents(n.data.id),enabled:!!((R=n.data)!=null&&R.id),staleTime:10*60*1e3}),as=g({queryKey:["task-sisters",($=n.data)==null?void 0:$.area_id,(A=n.data)==null?void 0:A.id],queryFn:()=>u.getTasks({area_id:Number(n.data.area_id),page_size:50,visible_only:!0}),enabled:!!((I=n.data)!=null&&I.area_id),staleTime:10*60*1e3}),B=g({queryKey:["task-children",(K=n.data)==null?void 0:K.id],queryFn:()=>u.getTaskChildren(n.data.id,{page_size:50,visible_only:!0}),enabled:!!((O=n.data)!=null&&O.id),staleTime:10*60*1e3}),v=h.useMemo(()=>{var e;return fs(((e=B.data)==null?void 0:e.results)||[])},[B.data]),ts=g({queryKey:["task-datasets",(Q=n.data)==null?void 0:Q.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(n.data.id),page_size:100,ordering:"-paper_count",min_eval_count:w}),enabled:!!((z=n.data)!=null&&z.id),staleTime:10*60*1e3}),S=us({queries:v.map(e=>({queryKey:["task-datasets",e.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(e.id),page_size:20,ordering:"-paper_count",min_eval_count:w}),staleTime:10*60*1e3}))}),c=js({taskId:((U=n.data)==null?void 0:U.id)||"",page_size:12,order_by:b,order_dir:"desc",include_resources:!0,enabled:!!((H=n.data)!=null&&H.id)}),E=h.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(t=>t.results))||[]).map(gs)},[c.data]),T=h.useMemo(()=>{var a;const e={};return(a=c.data)==null||a.pages.forEach(t=>t.results.forEach(r=>(r.methods||[]).forEach(l=>{const p=l.slug||l.id;e[p]||(e[p]={id:l.id,name:l.name,slug:l.slug||"",count:0}),e[p].count++}))),Object.values(e).sort((t,r)=>r.count-t.count).slice(0,8)},[c.data]),{targetRef:ns,isIntersecting:M}=Ns({rootMargin:"200px"});if(h.useEffect(()=>{M&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[M,c.hasNextPage,c.isFetchingNextPage]),n.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(_,{className:"h-12 w-1/2 mb-4"}),s.jsx(_,{className:"h-6 w-1/3 mb-8"}),s.jsx(_,{className:"h-64 w-full"})]});if(n.error||!n.data)return s.jsx("div",{className:"page",children:s.jsx(ks,{variant:"destructive",children:s.jsx(bs,{children:"Task not found."})})});const i=n.data,y=f(i.name,i.slug),q=(((V=as.data)==null?void 0:V.results)||[]).filter(e=>e.id!==i.id),o=((G=ts.data)==null?void 0:G.results)||[],rs=v.some((e,a)=>{var r,l;return(((l=(r=S[a])==null?void 0:r.data)==null?void 0:l.results)||[]).length>0}),L=o.length>0,is=(()=>{const e=new Set;return o.forEach(a=>e.add(a.id)),S.forEach(a=>{var t;return(((t=a.data)==null?void 0:t.results)||[]).forEach(r=>e.add(r.id))}),e.size})(),cs=e=>{ss(a=>{const t=new Set(a);return t.has(e)?t.delete(e):t.add(e),t})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(x,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(x,{to:"/tasks",children:"Tasks"}),[...es.data||[]].reverse().map(e=>s.jsxs(hs.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(x,{to:`/tasks/${e.slug||e.id}`,children:f(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:i.name.toUpperCase()})]}),s.jsxs("div",{className:i.image_url?"task-hero-grid":void 0,children:[s.jsxs("div",{children:[s.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),s.jsx("h1",{className:"domain-mega-title",children:y}),i.description&&s.jsx(J,{className:"task-explainer",text:i.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(i.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:is}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[T.length,"+"]}),"METHODS USED"]})]})]}),i.image_url&&s.jsxs("figure",{className:"task-figure-card",children:[s.jsx("div",{className:"task-figure-img-wrap",children:s.jsx("img",{className:"task-figure-img",src:i.image_url,alt:`${y} schematic`,onError:e=>{var a,t;(t=(a=e.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),s.jsxs("figcaption",{children:["Figure · ",y,i.image_credit&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),s.jsx(J,{className:"task-image-credit",text:i.image_credit})]})]})]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[L&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",children:[s.jsx("div",{className:"task-section-eyebrow",children:"Leaderboards · click any"}),s.jsxs("div",{className:"task-section-title",children:["Benchmarks ",s.jsxs("span",{className:"meta",children:["[",o.length,"]"]})]})]}),(F?o:o.slice(0,5)).map((e,a)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(`/benchmark/${e.slug||e.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(a+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:e.name}),s.jsx("div",{className:"bench-row-sub",children:e.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:e.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},e.id)),o.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Y(e=>!e),children:F?"− show top 5":`+ show ${o.length-5} more benchmarks`})]}),rs&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:L?{marginTop:36}:void 0,children:[s.jsx("div",{className:"task-section-eyebrow",children:"Benchmarks by capability"}),s.jsxs("div",{className:"task-section-title",children:["Subtasks ",s.jsxs("span",{className:"meta",children:["[",v.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:v.map((e,a)=>{var W;const t=S[a],r=((W=t==null?void 0:t.data)==null?void 0:W.results)||[];if(r.length===0)return null;const l=Z.has(e.id),p=l?r:r.slice(0,C),P=r.length-C;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(x,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:f(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",r.length," benchmark",r.length===1?"":"s","]"]})]}),p.map((m,ls)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(`/benchmark/${m.slug||m.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(ls+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:m.name}),s.jsx("div",{className:"bench-row-sub",children:m.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:m.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},m.id)),P>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>cs(e.id),children:l?`− show top ${C}`:`+ show ${P} more benchmark${P===1?"":"s"}`})]},e.id)})})]}),s.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[s.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),s.jsxs("div",{className:"task-section-title",children:["Papers ",s.jsxs("span",{className:"meta",children:["[",(i.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:vs.map(([e,a])=>s.jsx("button",{className:`sort-btn ${b===e?"active":""}`,onClick:()=>X(e),children:a},e))}),s.jsxs("div",{className:"results-count",children:[E.length," loaded in ",s.jsx("span",{children:y})]})]}),c.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,a)=>s.jsx(_,{className:"h-40 w-full"},a))}):E.length===0?s.jsx("div",{className:"no-results",children:"No papers in this task yet."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"paper-list",children:E.map((e,a)=>s.jsx(ps,{paper:e,rank:a+1},e.id))}),s.jsx("div",{ref:ns,style:{height:1}}),c.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),s.jsxs("aside",{className:"task-side",children:[q.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"01/"}),s.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),q.slice(0,8).map(e=>s.jsxs(x,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:f(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),T.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"02/"}),s.jsx("div",{className:"side-block-label",children:"Common Methods"}),T.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(xs,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["·",e.count]})]},e.id))]})]})]})]})};export{$s as default};
 
 
assets/TagBrowseView-Da16Rn5_.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{Z as os,$ as ms,u as hs,r as h,a as u,j as s,L as g,V as us}from"./index-D3-tYEe-.js";import{u as ps}from"./useQueries-7Jjoe24_.js";import{u as x}from"./useQuery-C6S8Ozku.js";import{P as gs,M as xs}from"./components-D244J_Aj.js";import{M as J}from"./MarkdownText-trAzkiVz.js";import{a as js,d as y}from"./transform-nNAikYlJ.js";import{c as Ns}from"./usePapers-C3rZB7Pt.js";import{u as ks}from"./useIntersectionObserver-SHZ4yqtO.js";import{S as _}from"./skeleton-D0cyB03X.js";import{A as bs,a as vs}from"./alert-Ayuop_ag.js";import"./LatexTitle-ZrlO0rs7.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DEoip3HO.js";const fs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ys=c=>c==="trending"||c==="date_published"||c==="citation_count"?c:"trending",C=3,w=2,_s=c=>[...c].sort((j,N)=>{const k=j.slug==="classic-language-modeling",b=N.slug==="classic-language-modeling";return k!==b?k?1:-1:0}),Ds=()=>{var R,D,A,I,K,O,Q,z,U,V,H,W,Z;const{taskSlug:c}=os(),j=ms(),[N,k]=hs(),b=ys(N.get("order_by")),X=e=>{const a=new URLSearchParams(N);a.set("order_by",e),k(a)},[F,Y]=h.useState(!1),[ss,es]=h.useState(()=>new Set),B=(e,a)=>{const t=e||"";return a?`/benchmark/${t}?task=${encodeURIComponent(a)}`:`/benchmark/${t}`},n=x({queryKey:["task",c],queryFn:()=>u.getTask(c),enabled:!!c,staleTime:10*60*1e3}),as=x({queryKey:["task-parents",(R=n.data)==null?void 0:R.id],queryFn:()=>u.getTaskParents(n.data.id),enabled:!!((D=n.data)!=null&&D.id),staleTime:10*60*1e3}),ts=x({queryKey:["task-sisters",(A=n.data)==null?void 0:A.area_id,(I=n.data)==null?void 0:I.id],queryFn:()=>u.getTasks({area_id:Number(n.data.area_id),page_size:50,visible_only:!0}),enabled:!!((K=n.data)!=null&&K.area_id),staleTime:10*60*1e3}),M=x({queryKey:["task-children",(O=n.data)==null?void 0:O.id],queryFn:()=>u.getTaskChildren(n.data.id,{page_size:50,visible_only:!0}),enabled:!!((Q=n.data)!=null&&Q.id),staleTime:10*60*1e3}),v=h.useMemo(()=>{var e;return _s(((e=M.data)==null?void 0:e.results)||[])},[M.data]),ns=x({queryKey:["task-datasets",(z=n.data)==null?void 0:z.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(n.data.id),page_size:100,ordering:"-paper_count",min_eval_count:w}),enabled:!!((U=n.data)!=null&&U.id),staleTime:10*60*1e3}),S=ps({queries:v.map(e=>({queryKey:["task-datasets",e.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(e.id),page_size:20,ordering:"-paper_count",min_eval_count:w}),staleTime:10*60*1e3}))}),l=Ns({taskId:((V=n.data)==null?void 0:V.id)||"",page_size:12,order_by:b,order_dir:"desc",include_resources:!0,enabled:!!((H=n.data)!=null&&H.id)}),E=h.useMemo(()=>{var a;return(((a=l.data)==null?void 0:a.pages.flatMap(t=>t.results))||[]).map(js)},[l.data]),T=h.useMemo(()=>{var a;const e={};return(a=l.data)==null||a.pages.forEach(t=>t.results.forEach(r=>(r.methods||[]).forEach(d=>{const p=d.slug||d.id;e[p]||(e[p]={id:d.id,name:d.name,slug:d.slug||"",count:0}),e[p].count++}))),Object.values(e).sort((t,r)=>r.count-t.count).slice(0,8)},[l.data]),{targetRef:rs,isIntersecting:$}=ks({rootMargin:"200px"});if(h.useEffect(()=>{$&&l.hasNextPage&&!l.isFetchingNextPage&&l.fetchNextPage()},[$,l.hasNextPage,l.isFetchingNextPage]),n.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(_,{className:"h-12 w-1/2 mb-4"}),s.jsx(_,{className:"h-6 w-1/3 mb-8"}),s.jsx(_,{className:"h-64 w-full"})]});if(n.error||!n.data)return s.jsx("div",{className:"page",children:s.jsx(bs,{variant:"destructive",children:s.jsx(vs,{children:"Task not found."})})});const i=n.data,f=y(i.name,i.slug),q=(((W=ts.data)==null?void 0:W.results)||[]).filter(e=>e.id!==i.id),o=((Z=ns.data)==null?void 0:Z.results)||[],is=v.some((e,a)=>{var r,d;return(((d=(r=S[a])==null?void 0:r.data)==null?void 0:d.results)||[]).length>0}),L=o.length>0,cs=(()=>{const e=new Set;return o.forEach(a=>e.add(a.id)),S.forEach(a=>{var t;return(((t=a.data)==null?void 0:t.results)||[]).forEach(r=>e.add(r.id))}),e.size})(),ls=e=>{es(a=>{const t=new Set(a);return t.has(e)?t.delete(e):t.add(e),t})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(g,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(g,{to:"/tasks",children:"Tasks"}),[...as.data||[]].reverse().map(e=>s.jsxs(us.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(g,{to:`/tasks/${e.slug||e.id}`,children:y(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:i.name.toUpperCase()})]}),s.jsxs("div",{className:i.image_url?"task-hero-grid":void 0,children:[s.jsxs("div",{children:[s.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),s.jsx("h1",{className:"domain-mega-title",children:f}),i.description&&s.jsx(J,{className:"task-explainer",text:i.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(i.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:cs}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[T.length,"+"]}),"METHODS USED"]})]})]}),i.image_url&&s.jsxs("figure",{className:`task-figure-card${i.slug==="omni-models"?" task-figure-card--compact":""}`,children:[s.jsx("div",{className:"task-figure-img-wrap",children:s.jsx("img",{className:"task-figure-img",src:i.image_url,alt:`${f} schematic`,onError:e=>{var a,t;(t=(a=e.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),s.jsxs("figcaption",{children:["Figure · ",f,i.image_credit&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),s.jsx(J,{className:"task-image-credit",text:i.image_credit})]})]})]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[L&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",children:[s.jsx("div",{className:"task-section-eyebrow",children:"Leaderboards · click any"}),s.jsxs("div",{className:"task-section-title",children:["Benchmarks ",s.jsxs("span",{className:"meta",children:["[",o.length,"]"]})]})]}),(F?o:o.slice(0,5)).map((e,a)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(B(e.slug||e.id,c)),children:[s.jsx("div",{className:"bench-row-num",children:String(a+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:e.name}),s.jsx("div",{className:"bench-row-sub",children:e.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:e.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},e.id)),o.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Y(e=>!e),children:F?"− show top 5":`+ show ${o.length-5} more benchmarks`})]}),is&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:L?{marginTop:36}:void 0,children:[s.jsx("div",{className:"task-section-eyebrow",children:"Benchmarks by capability"}),s.jsxs("div",{className:"task-section-title",children:["Subtasks ",s.jsxs("span",{className:"meta",children:["[",v.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:v.map((e,a)=>{var G;const t=S[a],r=((G=t==null?void 0:t.data)==null?void 0:G.results)||[];if(r.length===0)return null;const d=ss.has(e.id),p=d?r:r.slice(0,C),P=r.length-C;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(g,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:y(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",r.length," benchmark",r.length===1?"":"s","]"]})]}),p.map((m,ds)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(B(m.slug||m.id,e.slug||e.id)),children:[s.jsx("div",{className:"bench-row-num",children:String(ds+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:m.name}),s.jsx("div",{className:"bench-row-sub",children:m.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:m.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},m.id)),P>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ls(e.id),children:d?`− show top ${C}`:`+ show ${P} more benchmark${P===1?"":"s"}`})]},e.id)})})]}),s.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[s.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),s.jsxs("div",{className:"task-section-title",children:["Papers ",s.jsxs("span",{className:"meta",children:["[",(i.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:fs.map(([e,a])=>s.jsx("button",{className:`sort-btn ${b===e?"active":""}`,onClick:()=>X(e),children:a},e))}),s.jsxs("div",{className:"results-count",children:[E.length," loaded in ",s.jsx("span",{children:f})]})]}),l.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,a)=>s.jsx(_,{className:"h-40 w-full"},a))}):E.length===0?s.jsx("div",{className:"no-results",children:"No papers in this task yet."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"paper-list",children:E.map((e,a)=>s.jsx(gs,{paper:e,rank:a+1},e.id))}),s.jsx("div",{ref:rs,style:{height:1}}),l.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),s.jsxs("aside",{className:"task-side",children:[q.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"01/"}),s.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),q.slice(0,8).map(e=>s.jsxs(g,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:y(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),T.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"02/"}),s.jsx("div",{className:"side-block-label",children:"Common Methods"}),T.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(xs,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["·",e.count]})]},e.id))]})]})]})]})};export{Ds as default};
assets/TagsIndexView-BCN4pS2z.js DELETED
@@ -1 +0,0 @@
1
- import{r as d,j as e,L as h}from"./index-C6O8_a1-.js";import{u as p}from"./useQuery-Cvv958Kx.js";import{a as g}from"./api-DLAvdHPg.js";import{f as x,h as f,d as u}from"./transform-D_Izdf89.js";import{S as m}from"./skeleton-D8Wtx_Nu.js";import{A as j,a as y}from"./alert-MNWNJkBv.js";import"./adminAuth-PI_XkM8E.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",_=()=>{const r=p({queryKey:["areas-with-tasks"],queryFn:()=>g.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>s[v(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,a)=>s+a.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>e.jsx(m,{className:"h-24"},t))})]},a))}):o.map(s=>{const a=s.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:a.map(t=>{const i=t.slug||"",l=x(f(i));return e.jsxs(h,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)})})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{_ as default};
 
 
assets/TagsIndexView-BrKZEoUv.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as d,j as e,L as h,a as p}from"./index-D3-tYEe-.js";import{u as g}from"./useQuery-C6S8Ozku.js";import{f as x,h as f,d as u}from"./transform-nNAikYlJ.js";import{S as m}from"./skeleton-D0cyB03X.js";import{A as j,a as y}from"./alert-Ayuop_ag.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",b=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>p.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>s[v(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,a)=>s+a.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>e.jsx(m,{className:"h-24"},t))})]},a))}):o.map(s=>{const a=s.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:a.map(t=>{const i=t.slug||"",l=x(f(i));return e.jsxs(h,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)})})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{b as default};
assets/adminAuth-PI_XkM8E.js DELETED
@@ -1 +0,0 @@
1
- const n="cronAdminToken";function t(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(n))==null?void 0:e.trim())??""}function i(e){if(typeof window>"u")return;const o=e.trim();o?window.localStorage.setItem(n,o):window.localStorage.removeItem(n)}export{t as g,i as s};
 
 
assets/alert-Ayuop_ag.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as a,j as s,k as l,af as i}from"./index-D3-tYEe-.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a};
assets/alert-MNWNJkBv.js DELETED
@@ -1 +0,0 @@
1
- import{r as a,j as s,h as l,V as i}from"./index-C6O8_a1-.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a};
 
 
assets/api-DLAvdHPg.js DELETED
@@ -1 +0,0 @@
1
- var S=Object.defineProperty;var P=(g,e,t)=>e in g?S(g,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[e]=t;var l=(g,e,t)=>P(g,typeof e!="symbol"?e+"":e,t);import{g as b}from"./adminAuth-PI_XkM8E.js";import{B as _,a9 as k}from"./index-C6O8_a1-.js";const $=`${k()}/api/v1`,f=!1;class q{constructor(e=$){l(this,"baseUrl");this.baseUrl=e}async request(e,t){const i=`${this.baseUrl}${e}`;try{const{headers:o,...d}=t??{},u=b(),y=(d.method??"GET").toUpperCase()==="GET"?"default":"no-store",c=await fetch(i,{...d,cache:d.cache??y,credentials:d.credentials??"include",headers:{"Content-Type":"application/json",...u?{"X-Admin-Token":u}:{},...o}});if(!c.ok){const h=await c.text();console.error("[API] Error response:",h),c.status===401&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"));const r=new Error(`API request failed: ${c.status} ${c.statusText}`);throw r.status=c.status,r.statusText=c.statusText,r.response=h,r}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${i} failed:`,o),o}}async getPapers(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.search&&t.append("search",e.search),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir),e!=null&&e.time&&t.append("time",e.time),e!=null&&e.published_after&&t.append("published_after",e.published_after),e!=null&&e.published_before&&t.append("published_before",e.published_before),e!=null&&e.conference&&t.append("conference",e.conference),(e==null?void 0:e.latest_only)!==void 0&&t.append("latest_only",e.latest_only.toString()),(e==null?void 0:e.include_resources)!==void 0&&t.append("include_resources",e.include_resources.toString());const i=`/papers/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async searchPapers(e,t=10){const i=new URLSearchParams;return i.append("q",e),i.append("limit",t.toString()),this.request(`/papers/search?${i.toString()}`)}async getPaper(e,t=!0){const i=`/papers/${e}${t?"?include_resources=true":""}`;return this.request(i)}async getPaperByArxivId(e,t=!0){const i=`/papers/arxiv/${e}${t?"?include_resources=true":""}`;return this.request(i)}async indexPaperFromArxiv(e){const t=`/papers/index/${e}`;return this.request(t,{method:"POST"})}async submitPaper(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}async updatePaperTasks(e,t){const i=new URLSearchParams;t.forEach(d=>i.append("task_ids",d.toString()));const o=`/papers/${e}/tasks?${i.toString()}`;return this.request(o,{method:"PUT"})}async updatePaperMethods(e,t){const i=new URLSearchParams;t.forEach(d=>i.append("method_ids",d.toString()));const o=`/papers/${e}/methods?${i.toString()}`;return this.request(o,{method:"PUT"})}async updatePaperRepositories(e,t){const i=`/papers/${e}/repositories`;return this.request(i,{method:"PUT",body:JSON.stringify({repositories:t})})}async updatePaperProjectPages(e,t){const i=`/papers/${e}/project-pages`;return this.request(i,{method:"PUT",body:JSON.stringify({project_pages:t})})}async updatePaperSourceUrl(e,t){const i=`/papers/${e}/source-url`;return this.request(i,{method:"PUT",body:JSON.stringify({source_url:t})})}async updatePaperHfArtifacts(e,t){const i=`/papers/${e}/hf-artifacts`;return this.request(i,{method:"PUT",body:JSON.stringify(t)})}async getTrendingPapers(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.max_age_days&&t.append("max_age_days",e.max_age_days.toString()),(e==null?void 0:e.min_velocity)!==void 0&&t.append("min_velocity",e.min_velocity.toString());const i=`/papers/trending${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getRepositoriesForPaper(e){return this.request(`/papers/${e}/repositories`)}async getRepositories(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.owner&&t.append("owner",e.owner),e!=null&&e.official_only&&t.append("official_only",e.official_only.toString()),e!=null&&e.min_stars&&t.append("min_stars",e.min_stars.toString()),e!=null&&e.source&&t.append("source",e.source),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir);const i=`/repositories/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getProjectPagesForPaper(e){return this.request(`/papers/${e}/project-pages`)}async getProjectPages(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.official_only&&t.append("official_only",e.official_only.toString()),e!=null&&e.source&&t.append("source",e.source),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir);const i=`/project-pages/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getAuthors(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.offset&&t.append("offset",e.offset.toString()),e!=null&&e.search&&t.append("search",e.search),e!=null&&e.sort_by&&t.append("sort_by",e.sort_by),e!=null&&e.sort_order&&t.append("sort_order",e.sort_order);const i=`/authors${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getAuthor(e){return this.request(`/authors/${e}`)}async getAreas(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/areas/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getArea(e){return this.request(`/areas/${e}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getAreaTasks(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString());const o=`/areas/${e}/tasks${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTasks(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.area_id&&t.append("area_id",e.area_id.toString()),e!=null&&e.parent_id&&t.append("parent_id",e.parent_id.toString()),(e==null?void 0:e.level)!==void 0&&t.append("level",e.level.toString()),e!=null&&e.visible_only&&t.append("visible_only","true"),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/tasks/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getTask(e){return this.request(`/tasks/${e}`)}async getTopTasks(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString());const i=t.toString(),o=i?`/tasks/top?${i}`:"/tasks/top";return this.request(o)}async getTrendingTasks(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.recent_days&&t.append("recent_days",e.recent_days.toString()),e!=null&&e.baseline_days&&t.append("baseline_days",e.baseline_days.toString()),(e==null?void 0:e.level)!==void 0&&t.append("level",e.level.toString()),(e==null?void 0:e.min_recent_papers)!==void 0&&t.append("min_recent_papers",e.min_recent_papers.toString()),(e==null?void 0:e.min_baseline_papers)!==void 0&&t.append("min_baseline_papers",e.min_baseline_papers.toString()),(e==null?void 0:e.min_share_lift)!==void 0&&t.append("min_share_lift",e.min_share_lift.toString());const i=t.toString(),o=i?`/tasks/trending?${i}`:"/tasks/trending";return this.request(o)}async getTaskChildren(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),t!=null&&t.visible_only&&i.append("visible_only","true");const o=`/tasks/${e}/children${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTaskParents(e){return this.request(`/tasks/${e}/parents`)}async getTaskPapers(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),t!=null&&t.order_by&&i.append("order_by",t.order_by),t!=null&&t.order_dir&&i.append("order_dir",t.order_dir),(t==null?void 0:t.latest_only)!==void 0&&i.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&i.append("include_resources",t.include_resources.toString());const o=i.toString(),d=o?`/tasks/${e}/papers?${o}`:`/tasks/${e}/papers`;return this.request(d)}async getMethods(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.full_name&&t.append("full_name",e.full_name),e!=null&&e.introduced_year&&t.append("introduced_year",e.introduced_year.toString()),(e==null?void 0:e.area_id)!==void 0&&t.append("area_id",e.area_id.toString()),(e==null?void 0:e.exclude_id)!==void 0&&t.append("exclude_id",e.exclude_id.toString()),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/methods/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}async getMethodPapers(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),t!=null&&t.order_by&&i.append("order_by",t.order_by),t!=null&&t.order_dir&&i.append("order_dir",t.order_dir),(t==null?void 0:t.latest_only)!==void 0&&i.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&i.append("include_resources",t.include_resources.toString());const o=i.toString(),d=o?`/methods/${encodeURIComponent(e)}/papers?${o}`:`/methods/${encodeURIComponent(e)}/papers`;return this.request(d)}async getDatasets(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.full_name&&t.append("full_name",e.full_name),e!=null&&e.task&&t.append("task",e.task),e!=null&&e.task_id&&t.append("task",e.task_id.toString()),e!=null&&e.include_descendants&&t.append("include_descendants","true"),(e==null?void 0:e.min_eval_count)!==void 0&&t.append("min_eval_count",e.min_eval_count.toString()),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/datasets/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getDataset(e){return this.request(`/datasets/${e}`)}async getDatasetBySlug(e,t){const i=t!=null&&t.include_paper?"?include_paper=true":"";return this.request(`/datasets/${e}${i}`)}async getDatasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async getLeaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}async getEvaluations(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.paper_id&&t.append("paper_id",e.paper_id.toString()),e!=null&&e.task_id&&t.append("task_id",e.task_id.toString()),e!=null&&e.include_descendants&&t.append("include_descendants","true"),e!=null&&e.dataset_id&&t.append("dataset_id",e.dataset_id.toString()),e!=null&&e.best_metric&&t.append("best_metric",e.best_metric),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/evaluations/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getEvaluation(e){return this.request(`/evaluations/${e}`)}async getEvaluationsByPaper(e){const i=parseInt(e),o=await this.getEvaluations({paper_id:i,page_size:100,ordering:"-benchmark_popularity"}),d=[...o.results];let u=o.next_page;for(;u;){const s=await this.getEvaluations({paper_id:i,page:u,page_size:100,ordering:"-benchmark_popularity"});d.push(...s.results),u=s.next_page}return d}async getEvaluationsByDataset(e,t){return(await this.getEvaluations({dataset_id:parseInt(e),best_metric:t,page_size:100,ordering:"best_rank"})).results}async createEvaluation(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}async updateEvaluation(e,t){const i=`/evaluations/${e}`;return this.request(i,{method:"PUT",body:JSON.stringify(t)})}async deleteEvaluation(e){const t=`/evaluations/${e}`;return this.request(t,{method:"DELETE"})}async generateThumbnail(e){const t=_(`/api/thumbnails/generate/${e}`),i=await fetch(t,{method:"POST"});if(!i.ok)throw new Error(`Thumbnail generation failed: ${i.status}`);return await i.json()}async getThumbnailStatus(e){const t=_(`/api/thumbnails/status/${e}`),i=await fetch(t);if(!i.ok)throw new Error(`Thumbnail status check failed: ${i.status}`);return await i.json()}async healthCheck(){const e=_("/health"),t=await fetch(e);if(!t.ok)throw new Error(`Health check failed: ${t.status}`);return await t.json()}async getMetrics(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.direction&&t.append("direction",e.direction),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/metrics/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getMetric(e){return this.request(`/metrics/${e}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(e){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)})}async listPendingPaperEdits(e){const t=new URLSearchParams;e!=null&&e.status&&t.append("status",e.status),e!=null&&e.edit_type&&t.append("edit_type",e.edit_type),e!=null&&e.paper_id&&t.append("paper_id",e.paper_id.toString()),e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.offset&&t.append("offset",e.offset.toString());const i=`/admin/paper-edits${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getPendingPaperEdit(e){return this.request(`/admin/paper-edits/${e}`)}async approvePendingPaperEdit(e,t){return this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t??{})})}async rejectPendingPaperEdit(e,t){return this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t??{})})}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"POST"})}async removeBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const n=new q;n.getPapers.bind(n);const z=n.getPaper.bind(n);n.getPaperByArxivId.bind(n);const U=n.indexPaperFromArxiv.bind(n),R=n.submitPaper.bind(n),A=n.updatePaperTasks.bind(n),L=n.updatePaperMethods.bind(n),x=n.updatePaperRepositories.bind(n),M=n.updatePaperProjectPages.bind(n),j=n.updatePaperSourceUrl.bind(n),O=n.updatePaperHfArtifacts.bind(n);n.getTrendingPapers.bind(n);n.getRepositoriesForPaper.bind(n);n.getRepositories.bind(n);n.getProjectPagesForPaper.bind(n);n.getProjectPages.bind(n);n.getAuthors.bind(n);n.getAuthor.bind(n);n.getAreas.bind(n);n.getArea.bind(n);n.getAreasWithTasks.bind(n);n.getAreaTasks.bind(n);const B=n.getTasks.bind(n),D=n.getTask.bind(n);n.getTopTasks.bind(n);n.getTrendingTasks.bind(n);n.getTaskChildren.bind(n);n.getTaskParents.bind(n);n.getTaskPapers.bind(n);const C=n.getMethods.bind(n),I=n.getMethod.bind(n);n.getMethodPapers.bind(n);const J=n.getDatasets.bind(n),N=n.getDataset.bind(n);n.getDatasetBySlug.bind(n);n.getDatasetTasks.bind(n);const F=n.getLeaderboardMetrics.bind(n);n.getEvaluations.bind(n);n.getEvaluation.bind(n);const H=n.getEvaluationsByPaper.bind(n);n.getEvaluationsByDataset.bind(n);const G=n.createEvaluation.bind(n),W=n.updateEvaluation.bind(n),Q=n.deleteEvaluation.bind(n);n.generateThumbnail.bind(n);n.getThumbnailStatus.bind(n);n.getMetrics.bind(n);n.getMetric.bind(n);n.getMetricDirections.bind(n);n.healthCheck.bind(n);n.getMyBookmarkIds.bind(n);n.getMyBookmarks.bind(n);n.addBookmark.bind(n);const X=n.submitPendingPaperEdit.bind(n),K=n.listPendingPaperEdits.bind(n);n.getPendingPaperEdit.bind(n);const V=n.approvePendingPaperEdit.bind(n),Y=n.rejectPendingPaperEdit.bind(n);n.removeBookmark.bind(n);export{n as a,B as b,L as c,C as d,x as e,M as f,H as g,j as h,J as i,Q as j,G as k,W as l,F as m,O as n,U as o,R as p,D as q,I as r,X as s,N as t,A as u,z as v,V as w,Y as x,K as y};
 
 
assets/{badge-CcpUgrz3.js → badge-CCpokg9G.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as a,j as n,h as s,V as o}from"./index-C6O8_a1-.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as a,j as n,k as s,af as o}from"./index-D3-tYEe-.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/components-CMH89RDy.js DELETED
@@ -1 +0,0 @@
1
- import{p as z,y as v,j as t,L as C,G as w}from"./index-C6O8_a1-.js";import{L as S}from"./LatexTitle-CcMIi9G1.js";import{h as P,d as H,g as E,f as R}from"./transform-D_Izdf89.js";import{a as T}from"./api-DLAvdHPg.js";const A=({slug:e,label:s,onClick:r})=>{const o=w(),d=P(e),n=R(d),u=x=>{if(x.stopPropagation(),r){r(e);return}o(`/tasks/${e}`)};return t.jsxs("span",{className:"tag-chip",style:{background:n.bg,color:n.text},onClick:u,children:[t.jsx("span",{className:"dot",style:{background:n.dot}}),H(s||E(e),e)]})},Q=({method:e,onClick:s})=>{const r=w(),o=e.slug||e.id||"";if(!o)return null;const d=n=>{if(n.stopPropagation(),s){s(o);return}r(`/methods/${o}`)};return t.jsx("span",{className:"method-chip",onClick:d,children:e.name})},I=({name:e,size:s=14})=>{const r={search:t.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:t.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:t.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:t.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:t.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:t.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:t.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:t.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:t.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:t.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:t.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:t.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:t.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:t.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:t.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:t.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:t.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return t.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[e]})},B=e=>{let s=2166136261;for(let r=0;r<e.length;r++)s=Math.imul(s^e.charCodeAt(r),16777619);return()=>(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},V=({paperId:e})=>{const s=B(e),r=160,o=220,d=[.85+s()*.1,.55+s()*.25],n=.45+s()*.3,u=[],x=9+Math.floor(s()*3);for(let c=0;c<x;c++)u.push(.55+s()*.4);const h=s()>.3,g=Math.floor(s()*3),k=[],M=6+Math.floor(s()*3);for(let c=0;c<M;c++)k.push(.5+s()*.45);const b="#9A9588",m="#3A352D",i=5,j=(r-i*2-2)/2,N=i,a=i+j+2;let f=i+2;const $=f;f+=6;const W=f+1;f+=5;const F=f;f+=3;const l=f+1;return t.jsx("div",{style:{width:r,height:o,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:t.jsxs("svg",{width:r,height:o,viewBox:`0 0 ${r} ${o}`,style:{display:"block"},children:[d.map((c,p)=>t.jsx("rect",{x:i+(r-i*2)*(1-c)/2,y:$+p*2.4,width:(r-i*2)*c,height:1.4,fill:m,rx:.3},`t${p}`)),t.jsx("rect",{x:i+(r-i*2)*(1-n)/2,y:W,width:(r-i*2)*n,height:.9,fill:b,opacity:.7,rx:.2}),t.jsx("rect",{x:i,y:F,width:6,height:1,fill:m,opacity:.6}),u.map((c,p)=>{const y=l+p*2.1;return y>o-i-1?null:t.jsx("rect",{x:N,y,width:j*c,height:.8,fill:b,opacity:.55,rx:.2},`l${p}`)}),h&&t.jsxs("g",{children:[t.jsx("rect",{x:a,y:l,width:j,height:14,fill:"#F0EBE0",stroke:b,strokeWidth:.3,opacity:.9}),g===0&&t.jsx("g",{stroke:m,strokeWidth:.4,fill:"none",opacity:.6,children:t.jsx("polyline",{points:`${a+2},${l+11} ${a+6},${l+8} ${a+10},${l+9} ${a+14},${l+5} ${a+18},${l+6} ${a+22},${l+3}`})}),g===1&&t.jsxs("g",{opacity:.55,children:[t.jsx("circle",{cx:a+j/2,cy:l+7,r:3.5,fill:m}),t.jsx("rect",{x:a+2,y:l+11,width:j-4,height:1.5,fill:b})]}),g===2&&t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:a+3,y:l+5,width:j-6,height:1,fill:m}),t.jsx("rect",{x:a+6,y:l+8,width:j-12,height:.8,fill:m})]})]}),k.map((c,p)=>{const y=l+(h?16:0)+p*2.1;return y>o-i-1?null:t.jsx("rect",{x:a,y,width:j*c,height:.8,fill:b,opacity:.55,rx:.2},`r${p}`)})]})})},q=({paperId:e,title:s,thumbnailUrl:r,priority:o=!1})=>{const[d,n]=v.useState(!1),[u,x]=v.useState(o),h=v.useRef(null);return v.useEffect(()=>{n(!1)},[r]),v.useEffect(()=>{if(o||u)return;const g=h.current;if(!g)return;const k=new IntersectionObserver(([M])=>{M.isIntersecting&&(x(!0),k.disconnect())},{rootMargin:"250px"});return k.observe(g),()=>k.disconnect()},[o,u]),r&&!d?t.jsx("div",{ref:h,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:u&&t.jsx("img",{src:r,alt:`Thumbnail for ${s}`,loading:o?"eager":"lazy",decoding:"async",fetchPriority:o?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>n(!0)})}):t.jsx(V,{paperId:e})},K=({paper:e,rank:s,onClickTag:r})=>{const o=z(),d=`/paper/${e.id}`,n=v.useCallback(()=>{o.prefetchQuery({queryKey:["paper-arxiv",e.id],queryFn:()=>T.getPaperByArxivId(e.id,!0),staleTime:10*60*1e3})},[e.id,o]),u=e.authors.slice(0,3).join(", "),x=e.authors.length;return t.jsxs("article",{className:"paper-card",children:[s!=null&&t.jsx(C,{to:d,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:t.jsx(q,{paperId:e.id,title:e.title,thumbnailUrl:e.thumbnailUrl,priority:s<=3})}),t.jsxs("div",{className:"paper-body",children:[t.jsxs("div",{className:"paper-body-main",children:[t.jsx("h3",{className:"paper-title",children:t.jsx(C,{to:d,onFocus:n,onMouseEnter:n,children:t.jsx(S,{title:e.title})})}),t.jsxs("div",{className:"paper-authors",children:[u,x>3&&t.jsxs("span",{children:[", ","+",x-3," authors"]}),e.date&&t.jsxs(t.Fragment,{children:[x>0?" · ":"",t.jsx("span",{children:e.date})]}),e.citations>0&&t.jsxs(t.Fragment,{children:[x>0||e.date?" · ":"",t.jsxs("span",{children:[e.citations.toLocaleString()," citations"]})]})]}),e.abstract&&t.jsx("p",{className:"paper-abstract",children:e.abstract}),e.tags.length>0&&t.jsx("div",{className:"paper-tags",children:e.tags.map(h=>t.jsx(A,{slug:h,onClick:r},h))})]}),e.github!=null&&(()=>{const h=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx(I,{name:"github",size:12}),t.jsx("span",{className:"gh-stars",children:L(e.github)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars"})]}),e.velocity24h!=null&&e.velocity24h>0&&t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx("span",{className:"gh-rate-arrow",children:"↑"}),t.jsx("span",{className:"gh-rate",children:D(e.velocity24h)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars / hr"})]})]});return e.githubUrl?t.jsx("a",{className:"paper-github-stats is-link",href:e.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open GitHub repository (${L(e.github)} stars)`,onClick:g=>g.stopPropagation(),children:h}):t.jsx("aside",{className:"paper-github-stats",children:h})})()]})]})};function L(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function D(e){return e.toFixed(1)}export{I,Q as M,K as P,A as T};
 
 
assets/components-D244J_Aj.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{l as S,V as k,a as z,j as t,L as C,$ as w}from"./index-D3-tYEe-.js";import{L as P,a as H}from"./LatexTitle-ZrlO0rs7.js";import{h as T,d as A,g as E,f as R}from"./transform-nNAikYlJ.js";const I=({slug:e,label:s,onClick:r})=>{const o=w(),g=T(e),n=R(g),u=x=>{if(x.stopPropagation(),r){r(e);return}o(`/tasks/${e}`)};return t.jsxs("span",{className:"tag-chip",style:{background:n.bg,color:n.text},onClick:u,children:[t.jsx("span",{className:"dot",style:{background:n.dot}}),A(s||E(e),e)]})},K=({method:e,onClick:s})=>{const r=w(),o=e.slug||e.id||"";if(!o)return null;const g=n=>{if(n.stopPropagation(),s){s(o);return}r(`/methods/${o}`)};return t.jsx("span",{className:"method-chip",onClick:g,children:e.name})},V=({name:e,size:s=14})=>{const r={search:t.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:t.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:t.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:t.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:t.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:t.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:t.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:t.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:t.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:t.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:t.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:t.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:t.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:t.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:t.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:t.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:t.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return t.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[e]})},B=e=>{let s=2166136261;for(let r=0;r<e.length;r++)s=Math.imul(s^e.charCodeAt(r),16777619);return()=>(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},q=({paperId:e})=>{const s=B(e),r=160,o=220,g=[.85+s()*.1,.55+s()*.25],n=.45+s()*.3,u=[],x=9+Math.floor(s()*3);for(let d=0;d<x;d++)u.push(.55+s()*.4);const a=s()>.3,m=Math.floor(s()*3),y=[],b=6+Math.floor(s()*3);for(let d=0;d<b;d++)y.push(.5+s()*.45);const c="#9A9588",j="#3A352D",i=5,f=(r-i*2-2)/2,$=i,h=i+f+2;let v=i+2;const N=v;v+=6;const W=v+1;v+=5;const F=v;v+=3;const l=v+1;return t.jsx("div",{style:{width:r,height:o,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:t.jsxs("svg",{width:r,height:o,viewBox:`0 0 ${r} ${o}`,style:{display:"block"},children:[g.map((d,p)=>t.jsx("rect",{x:i+(r-i*2)*(1-d)/2,y:N+p*2.4,width:(r-i*2)*d,height:1.4,fill:j,rx:.3},`t${p}`)),t.jsx("rect",{x:i+(r-i*2)*(1-n)/2,y:W,width:(r-i*2)*n,height:.9,fill:c,opacity:.7,rx:.2}),t.jsx("rect",{x:i,y:F,width:6,height:1,fill:j,opacity:.6}),u.map((d,p)=>{const M=l+p*2.1;return M>o-i-1?null:t.jsx("rect",{x:$,y:M,width:f*d,height:.8,fill:c,opacity:.55,rx:.2},`l${p}`)}),a&&t.jsxs("g",{children:[t.jsx("rect",{x:h,y:l,width:f,height:14,fill:"#F0EBE0",stroke:c,strokeWidth:.3,opacity:.9}),m===0&&t.jsx("g",{stroke:j,strokeWidth:.4,fill:"none",opacity:.6,children:t.jsx("polyline",{points:`${h+2},${l+11} ${h+6},${l+8} ${h+10},${l+9} ${h+14},${l+5} ${h+18},${l+6} ${h+22},${l+3}`})}),m===1&&t.jsxs("g",{opacity:.55,children:[t.jsx("circle",{cx:h+f/2,cy:l+7,r:3.5,fill:j}),t.jsx("rect",{x:h+2,y:l+11,width:f-4,height:1.5,fill:c})]}),m===2&&t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:h+3,y:l+5,width:f-6,height:1,fill:j}),t.jsx("rect",{x:h+6,y:l+8,width:f-12,height:.8,fill:j})]})]}),y.map((d,p)=>{const M=l+(a?16:0)+p*2.1;return M>o-i-1?null:t.jsx("rect",{x:h,y:M,width:f*d,height:.8,fill:c,opacity:.55,rx:.2},`r${p}`)})]})})},D=({paperId:e,title:s,thumbnailUrl:r,priority:o=!1})=>{const[g,n]=k.useState(!1),[u,x]=k.useState(0),[a,m]=k.useState(o),y=k.useRef(null);k.useEffect(()=>{n(!1),x(0)},[r]);const b=k.useMemo(()=>{if(!r)return null;if(u===0)return r;const c=r.includes("?")?"&":"?";return`${r}${c}retry=${u}`},[r,u]);return k.useEffect(()=>{if(o||a)return;const c=y.current;if(!c)return;const j=new IntersectionObserver(([i])=>{i.isIntersecting&&(m(!0),j.disconnect())},{rootMargin:"250px"});return j.observe(c),()=>j.disconnect()},[o,a]),r&&!g?t.jsx("div",{ref:y,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:a&&b&&t.jsx("img",{src:b,alt:`Thumbnail for ${s}`,loading:o?"eager":"lazy",decoding:"async",fetchPriority:o?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(u<1){x(c=>c+1);return}n(!0)}},b)}):t.jsx(q,{paperId:e})},_=({paper:e,rank:s,onClickTag:r})=>{const o=S(),g=`/paper/${e.id}`,n=k.useCallback(()=>{o.prefetchQuery({queryKey:["paper-arxiv",e.id],queryFn:()=>z.getPaperByArxivId(e.id,!0),staleTime:10*60*1e3})},[e.id,o]),u=e.authors.slice(0,3).join(", "),x=e.authors.length;return t.jsxs("article",{className:"paper-card",children:[s!=null&&t.jsx(C,{to:g,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:t.jsx(D,{paperId:e.id,title:e.title,thumbnailUrl:e.thumbnailUrl,priority:s<=3})}),t.jsxs("div",{className:"paper-body",children:[t.jsxs("div",{className:"paper-body-main",children:[t.jsx("h3",{className:"paper-title",children:t.jsx(C,{to:g,onFocus:n,onMouseEnter:n,children:t.jsx(P,{title:e.title})})}),t.jsxs("div",{className:"paper-authors",children:[u,x>3&&t.jsxs("span",{children:[", ","+",x-3," authors"]}),e.date&&t.jsxs(t.Fragment,{children:[x>0?" · ":"",t.jsx("span",{children:e.date})]}),e.citations>0&&t.jsxs(t.Fragment,{children:[x>0||e.date?" · ":"",t.jsxs("span",{children:[e.citations.toLocaleString()," citations"]})]})]}),e.abstract&&t.jsx("p",{className:"paper-abstract",children:t.jsx(H,{text:e.abstract})}),e.tags.length>0&&t.jsx("div",{className:"paper-tags",children:e.tags.map(a=>t.jsx(I,{slug:a,onClick:r},a))})]}),e.github!=null&&(()=>{const a=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx(V,{name:"github",size:12}),t.jsx("span",{className:"gh-stars",children:L(e.github)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars"})]}),e.velocity24h!=null&&e.velocity24h>0&&t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx("span",{className:"gh-rate-arrow",children:"↑"}),t.jsx("span",{className:"gh-rate",children:Y(e.velocity24h)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars / hr"})]})]});return e.githubUrl?t.jsx("a",{className:"paper-github-stats is-link",href:e.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open GitHub repository (${L(e.github)} stars)`,onClick:m=>m.stopPropagation(),children:a}):t.jsx("aside",{className:"paper-github-stats",children:a})})()]})]})};function L(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Y(e){return e.toFixed(1)}export{V as I,K as M,_ as P,I as T,D as a};
assets/dialog-DzRXUQ09.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ import{r as s,j as i,x as q,d as K,y as R,P as N,B as U,b as D,f as x,i as X,e as h,D as Y,E as J,F as Q,G as ee,H as te,a8 as oe,X as ne,k as p}from"./index-D3-tYEe-.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?q(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=X(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=K({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};P.displayName=C;var O="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(O,o),r=h(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=O;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),w=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:n}=e,r=f(E,t);return i.jsx(fe,{scope:t,forceMount:o,children:s.Children.map(a,l=>i.jsx(N,{present:o||r.open,children:i.jsx(U,{asChild:!0,container:n,children:l})}))})};w.displayName=E;var y="DialogOverlay",A=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(N,{present:a||r.open,children:i.jsx(pe,{...n,ref:t})}):null});A.displayName=y;var ge=ae("DialogOverlay.RemoveScroll"),pe=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(y,o);return i.jsx(J,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(N,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=h(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return Y(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=h(t,d);return Q(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",F=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});F.displayName=_;var M="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(M,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=M;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2
+
3
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
+
5
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},ve="DialogDescriptionWarning",ye=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ve).contentName}}.`;return s.useEffect(()=>{var r;const n=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Ce=P,Re=w,V=A,H=T,B=F,z=W,Ne=k;const we=Ce,he=Re,Z=s.forwardRef(({className:e,...t},o)=>i.jsx(V,{ref:o,className:p("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Z.displayName=V.displayName;const Ee=s.forwardRef(({className:e,children:t,...o},a)=>i.jsxs(he,{children:[i.jsx(Z,{}),i.jsxs(H,{ref:a,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,i.jsxs(Ne,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(ne,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ee.displayName=H.displayName;const _e=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_e.displayName="DialogHeader";const je=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});je.displayName="DialogFooter";const be=s.forwardRef(({className:e,...t},o)=>i.jsx(B,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));be.displayName=B.displayName;const Pe=s.forwardRef(({className:e,...t},o)=>i.jsx(z,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));Pe.displayName=z.displayName;export{H as C,we as D,V as O,Re as P,Ce as R,Ee as a,_e as b,be as c,Pe as d,je as e};
assets/index-B1pEvcfa.css DELETED
The diff for this file is too large to render. See raw diff
 
assets/index-BsV_WMf3.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as u}from"./index-D3-tYEe-.js";function o(r){const e=u.useRef({value:r,previous:r});return u.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u};
assets/index-C6O8_a1-.js DELETED
The diff for this file is too large to render. See raw diff
 
assets/index-D3-tYEe-.js ADDED
The diff for this file is too large to render. See raw diff