nielsr HF Staff commited on
Commit
cca57f9
·
verified ·
1 Parent(s): e941fe5

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. assets/{AiDeadlinesView-LniV_dKO.js → AiDeadlinesView-Ck4DcdVE.js} +1 -1
  2. assets/{AuthorDetailView-De9sKETG.js → AuthorDetailView-BRG7SwDx.js} +1 -1
  3. assets/{BenchmarkDetailView-BSa9e3w8.js → BenchmarkDetailView-CE6Br0pz.js} +1 -1
  4. assets/{BenchmarkTrendSparkline-BCbEDZUr.js → BenchmarkTrendSparkline-D0ycyTpl.js} +1 -1
  5. assets/ChatMessage-DAiy1xqv.js +0 -6
  6. assets/ChatMessage-EkiSiSMU.js +6 -0
  7. assets/ChatView-BRD2gg8Z.js +16 -0
  8. assets/ChatView-BiviZbfg.js +0 -16
  9. assets/{ConferenceDetailView-CY-7Wl7R.js → ConferenceDetailView-BxusY5Py.js} +1 -1
  10. assets/{ConferenceTaskView--e571ntQ.js → ConferenceTaskView-BYv2s9Ee.js} +1 -1
  11. assets/{ConferencesIndexView-DE7AvizF.js → ConferencesIndexView-DA5w1mt9.js} +1 -1
  12. assets/{ContributionsPage-DoaZMKUY.js → ContributionsPage-72YaHqKV.js} +1 -1
  13. assets/CronDashboard-CKulhmWw.js +0 -61
  14. assets/CronDashboard-VjNs2ei7.js +61 -0
  15. assets/{ExternalSourceEvalBadge-BYtEDxNm.js → ExternalSourceEvalBadge-BLagMwlj.js} +1 -1
  16. assets/{FeedView-Dv1LDUAN.js → FeedView-51f2avBG.js} +1 -1
  17. assets/{FrameworksIndexView-DaHgLjlV.js → FrameworksIndexView-BUEoxJ4T.js} +1 -1
  18. assets/{LatexTitle-qoY4vrTZ.js → LatexTitle-DYInY1bH.js} +1 -1
  19. assets/{MarkdownText-VH1HEGnz.js → MarkdownText-CNYqDApy.js} +1 -1
  20. assets/{MethodDetailView-M4qvY74O.js → MethodDetailView-Bxf6BpfX.js} +1 -1
  21. assets/{MethodsIndexView-CKAKF4Rt.js → MethodsIndexView-CwdUmTTD.js} +1 -1
  22. assets/{NotFound-CN-zdP49.js → NotFound-DXRzD9Sh.js} +1 -1
  23. assets/OrganizationDetailView-CVziNQLK.js +0 -1
  24. assets/OrganizationDetailView-CqgESAO-.js +1 -0
  25. assets/{OrganizationPaperFeed-BAdi7G6c.js → OrganizationPaperFeed-BoBZY1EK.js} +1 -1
  26. assets/OrganizationTaskView-DRLz5DdM.js +0 -1
  27. assets/OrganizationTaskView-viUTzDP9.js +1 -0
  28. assets/{OrganizationsIndexView-BFEZ8aLZ.js → OrganizationsIndexView-CI_hQP0M.js} +1 -1
  29. assets/{PaperDetailView-DAPjYsXV.js → PaperDetailView-BFBITCKf.js} +1 -1
  30. assets/{PaperFeedFilters-D2TbUu0j.js → PaperFeedFilters-tral1E4E.js} +1 -1
  31. assets/{PaperPreviewLink-DTmodbgi.js → PaperPreviewLink-D-wxSmXC.js} +1 -1
  32. assets/{PapersListView-CiElqeZj.js → PapersListView-DIDxh3hu.js} +1 -1
  33. assets/{SavedPapersView-Oa-A9M7k.js → SavedPapersView-CaGL_b5-.js} +1 -1
  34. assets/{SearchOverlay-zJH1AgbF.js → SearchOverlay-D_bPcYUC.js} +1 -1
  35. assets/{SettingsView-2Aab7oZR.js → SettingsView-D4puMwAm.js} +1 -1
  36. assets/{SharedChatView-DvAcanFw.js → SharedChatView-CSRRgem6.js} +1 -1
  37. assets/{SignInToEditDialog-DW_1sVXp.js → SignInToEditDialog-B6iSscgi.js} +1 -1
  38. assets/{SubmissionsDashboard-D7fHw9fZ.js → SubmissionsDashboard-yAoBG5cW.js} +1 -1
  39. assets/{SubmitView-CRMmJZk-.js → SubmitView-JHOOxet2.js} +1 -1
  40. assets/{TagBrowseView-BItfp6De.js → TagBrowseView-DUDEIoQX.js} +1 -1
  41. assets/{TagsIndexView-CFL5RaeB.js → TagsIndexView-orfEvAmh.js} +1 -1
  42. assets/{TaxonomySuggestionTile-T8WIATj3.js → TaxonomySuggestionTile-BFLpa7xW.js} +1 -1
  43. assets/{TrendsView-Ch21Eqgg.js → TrendsView-DveKdKyx.js} +1 -1
  44. assets/{alert-_EYQlDHA.js → alert-DqWQWZ1R.js} +1 -1
  45. assets/{button-D8mDpZUh.js → button-BwpTjeyz.js} +1 -1
  46. assets/{chatSessions-Dz4Iu-O1.js → chatSessions-RaHJTN_0.js} +1 -1
  47. assets/{chevron-down-BeEEYUNO.js → chevron-down-CbBr2xUl.js} +1 -1
  48. assets/{codexAddEvals-NAKdH-Ge.js → codexAddEvals-9YtNb4JX.js} +1 -1
  49. assets/{components-BbXgE2lV.js → components-DCcxy0XP.js} +1 -1
  50. assets/{dialog-BAxsIFdN.js → dialog-D77-YHgu.js} +1 -1
assets/{AiDeadlinesView-LniV_dKO.js → AiDeadlinesView-Ck4DcdVE.js} RENAMED
@@ -1,3 +1,3 @@
1
- import{r as x,j as t,b as E}from"./index-Bo5_2OqZ.js";import{u as A}from"./useQuery-Bh9FZQpL.js";import{S as B}from"./switch-DGcXQvGy.js";import{S as U}from"./skeleton-CB-heJjl.js";import{A as W,a as O}from"./alert-_EYQlDHA.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-BAxsIFdN.js";import"./useBaseQuery-B8T7kRNC.js";import"./index-DWt5uuhX.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)})})]})},me=()=>{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{me as default};
 
1
+ import{r as x,j as t,b as E}from"./index-DREEM5p7.js";import{u as A}from"./useQuery-pzEX4kGt.js";import{S as B}from"./switch-BerK6OR6.js";import{S as U}from"./skeleton-C9cmIM7L.js";import{A as W,a as O}from"./alert-DqWQWZ1R.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-D77-YHgu.js";import"./useBaseQuery-BnoYgsiR.js";import"./index-DRUOZk2M.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)})})]})},me=()=>{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{me as default};
assets/{AuthorDetailView-De9sKETG.js → AuthorDetailView-BRG7SwDx.js} RENAMED
@@ -1 +1 @@
1
- import{e as m,j as e,L as g,b as h}from"./index-Bo5_2OqZ.js";import{u as d}from"./useQuery-Bh9FZQpL.js";import{S as c}from"./skeleton-CB-heJjl.js";import x from"./NotFound-CN-zdP49.js";import"./useBaseQuery-B8T7kRNC.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default};
 
1
+ import{e as m,j as e,L as g,b as h}from"./index-DREEM5p7.js";import{u as d}from"./useQuery-pzEX4kGt.js";import{S as c}from"./skeleton-C9cmIM7L.js";import x from"./NotFound-DXRzD9Sh.js";import"./useBaseQuery-BnoYgsiR.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default};
assets/{BenchmarkDetailView-BSa9e3w8.js → BenchmarkDetailView-CE6Br0pz.js} RENAMED
@@ -1,2 +1,2 @@
1
- import{u as vt,r as w,j as n,a0 as ne,g as jt,e as _t,a as kt,V as St,L as me,b as ee}from"./index-Bo5_2OqZ.js";import{u as te}from"./useQuery-Bh9FZQpL.js";import{S as xe}from"./skeleton-CB-heJjl.js";import{S as Je}from"./switch-DGcXQvGy.js";import{A as Ct,a as Et}from"./alert-_EYQlDHA.js";import{L as ye}from"./LatexTitle-qoY4vrTZ.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-BYtEDxNm.js";import{B as Tt}from"./BenchmarkTrendSparkline-BCbEDZUr.js";import{I as $t}from"./components-BbXgE2lV.js";import"./useBaseQuery-B8T7kRNC.js";import"./index-DWt5uuhX.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DrtqDSb0.js";import"./transform-2Gnjg1jt.js";function Mt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ft(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Lt=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>Ze(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o<N.length;o++){const m=N[o-1],k=N[o],v=(m.x+k.x)/2;O+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const H=5.4,fe=8,J=9,A=o=>{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return M<l?(M=l,C=l+v,V="start"):C>i-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;o<N.length-1;o++){const m=A(N[o]);m&&(m.left<_e+fe||b&&m.right>b.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Ft(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;B<l&&(B=l),B+C>i-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,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))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function It(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(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Pt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let re=null;function dt(e={}){return re||(e.includeStyleProperties?(re=e.includeStyleProperties,re):(re=q(window.getComputedStyle(document.documentElement)),re))}function we(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function At(e){const t=we(e,"border-left-width"),r=we(e,"border-right-width");return e.clientWidth+t+r}function Dt(e){const t=we(e,"border-top-width"),r=we(e,"border-bottom-width");return e.clientHeight+t+r}function ut(e,t={}){const r=t.width||At(e),s=t.height||Dt(e);return{width:r,height:s}}function Bt(){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 D=16384;function Ht(e){(e.width>D||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Vt(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 s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c<a;c+=1)i[c]=s.charCodeAt(c);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ve(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Ot(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ut(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Ot(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Wt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function zt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Wt(r):qt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Pt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(zt(c,r,a,s)),t.appendChild(l)}function Gt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Kt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=Qt(e).toLowerCase();return Kt[t]||""}function Xt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Yt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function Jt(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=Jt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Xt(l)));a=Yt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function Zt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function er(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function tr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function rr(e,t){return P(e,HTMLCanvasElement)?Zt(e):P(e,HTMLVideoElement)?er(e,t):P(e,HTMLIFrameElement)?tr(e,t):e.cloneNode(ht(e))}const sr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function nr(e,t,r){var s,a;if(ht(t))return t;let i=[];return sr(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function ar(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function ir(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function lr(e,t,r){return P(t,Element)&&(ar(e,t,r),Gt(e,t,r),ir(e,t),cr(e,t)),t}async function or(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const l=r[i].getAttribute("xlink:href");if(l){const u=e.querySelector(l),p=document.querySelector(l);!u&&p&&!s[l]&&(s[l]=await je(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",c=document.createElementNS(i,"svg");c.setAttribute("xmlns",i),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const l=document.createElementNS(i,"defs");c.appendChild(l);for(let u=0;u<a.length;u++)l.appendChild(a[u]);e.appendChild(c)}return e}async function je(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>rr(s,t)).then(s=>nr(e,s,t)).then(s=>lr(e,s,t)).then(s=>or(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,dr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ur=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function hr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function fr(e,t,r,s,a){try{const i=r?It(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(mr(t),`$1${l}$3`)}catch{}return e}function pr(e,{preferredFontFormat:t}){return t?e.replace(ur,r=>{for(;;){const[s,,a]=dr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=pr(e,r);return hr(s).reduce((i,c)=>i.then(l=>fr(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function xr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function br(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await gr(e,t),await xr(e,t),await br(e,t))}function yr(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 s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@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 u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function wr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function vr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function jr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await wr(r,t);return vr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function _r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function kr(e,t){const r=await jr(e,t),s=_r(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(`
2
  `)}async function Sr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Cr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Sr(a,t),await xt(a,t),yr(a,t),await Ut(a,r,s)}async function Er(e,t={}){const{width:r,height:s}=ut(e,t),a=await Cr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Bt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ht(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Nr(e,t={}){const r=await Er(e,t);return await Vt(r)}const Te="#ffffff";function Rr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Tr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Rr():t}async function $r(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.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 Nr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Tr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await $r(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx($t,{name:"copy",size:11}),l]})};function he(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 Fr(e){const t=new Map;for(const r of e){const s=Mr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Lr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.value<i:f.value>i;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Ir=5;function Pr(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 s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const Yr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Mt(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Fr(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Ir),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Lr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Pr(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx(Tt,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Lt,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Nt,{}),(h.external??h.is_external)&&n.jsx(Rt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Yr as default};
 
1
+ import{u as vt,r as w,j as n,a0 as ne,g as jt,e as _t,a as kt,V as St,L as me,b as ee}from"./index-DREEM5p7.js";import{u as te}from"./useQuery-pzEX4kGt.js";import{S as xe}from"./skeleton-C9cmIM7L.js";import{S as Je}from"./switch-BerK6OR6.js";import{A as Ct,a as Et}from"./alert-DqWQWZ1R.js";import{L as ye}from"./LatexTitle-DYInY1bH.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-BLagMwlj.js";import{B as Tt}from"./BenchmarkTrendSparkline-D0ycyTpl.js";import{I as $t}from"./components-DCcxy0XP.js";import"./useBaseQuery-BnoYgsiR.js";import"./index-DRUOZk2M.js";import"./katex.min-BSBacQyE.js";import"./hover-card-ZrDlt9Lf.js";import"./transform-DA_akiPE.js";function Mt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ft(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Lt=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>Ze(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o<N.length;o++){const m=N[o-1],k=N[o],v=(m.x+k.x)/2;O+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const H=5.4,fe=8,J=9,A=o=>{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return M<l?(M=l,C=l+v,V="start"):C>i-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;o<N.length-1;o++){const m=A(N[o]);m&&(m.left<_e+fe||b&&m.right>b.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Ft(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;B<l&&(B=l),B+C>i-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,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))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function It(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(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Pt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let re=null;function dt(e={}){return re||(e.includeStyleProperties?(re=e.includeStyleProperties,re):(re=q(window.getComputedStyle(document.documentElement)),re))}function we(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function At(e){const t=we(e,"border-left-width"),r=we(e,"border-right-width");return e.clientWidth+t+r}function Dt(e){const t=we(e,"border-top-width"),r=we(e,"border-bottom-width");return e.clientHeight+t+r}function ut(e,t={}){const r=t.width||At(e),s=t.height||Dt(e);return{width:r,height:s}}function Bt(){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 D=16384;function Ht(e){(e.width>D||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Vt(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 s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c<a;c+=1)i[c]=s.charCodeAt(c);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ve(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Ot(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ut(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Ot(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Wt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function zt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Wt(r):qt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Pt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(zt(c,r,a,s)),t.appendChild(l)}function Gt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Kt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=Qt(e).toLowerCase();return Kt[t]||""}function Xt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Yt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function Jt(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=Jt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Xt(l)));a=Yt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function Zt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function er(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function tr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function rr(e,t){return P(e,HTMLCanvasElement)?Zt(e):P(e,HTMLVideoElement)?er(e,t):P(e,HTMLIFrameElement)?tr(e,t):e.cloneNode(ht(e))}const sr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function nr(e,t,r){var s,a;if(ht(t))return t;let i=[];return sr(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function ar(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function ir(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function lr(e,t,r){return P(t,Element)&&(ar(e,t,r),Gt(e,t,r),ir(e,t),cr(e,t)),t}async function or(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const l=r[i].getAttribute("xlink:href");if(l){const u=e.querySelector(l),p=document.querySelector(l);!u&&p&&!s[l]&&(s[l]=await je(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",c=document.createElementNS(i,"svg");c.setAttribute("xmlns",i),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const l=document.createElementNS(i,"defs");c.appendChild(l);for(let u=0;u<a.length;u++)l.appendChild(a[u]);e.appendChild(c)}return e}async function je(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>rr(s,t)).then(s=>nr(e,s,t)).then(s=>lr(e,s,t)).then(s=>or(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,dr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ur=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function hr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function fr(e,t,r,s,a){try{const i=r?It(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(mr(t),`$1${l}$3`)}catch{}return e}function pr(e,{preferredFontFormat:t}){return t?e.replace(ur,r=>{for(;;){const[s,,a]=dr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=pr(e,r);return hr(s).reduce((i,c)=>i.then(l=>fr(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function xr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function br(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await gr(e,t),await xr(e,t),await br(e,t))}function yr(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 s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@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 u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function wr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function vr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function jr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await wr(r,t);return vr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function _r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function kr(e,t){const r=await jr(e,t),s=_r(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(`
2
  `)}async function Sr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Cr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Sr(a,t),await xt(a,t),yr(a,t),await Ut(a,r,s)}async function Er(e,t={}){const{width:r,height:s}=ut(e,t),a=await Cr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Bt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ht(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Nr(e,t={}){const r=await Er(e,t);return await Vt(r)}const Te="#ffffff";function Rr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Tr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Rr():t}async function $r(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.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 Nr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Tr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await $r(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx($t,{name:"copy",size:11}),l]})};function he(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 Fr(e){const t=new Map;for(const r of e){const s=Mr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Lr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.value<i:f.value>i;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Ir=5;function Pr(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 s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const Yr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Mt(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Fr(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Ir),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Lr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Pr(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx(Tt,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Lt,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Nt,{}),(h.external??h.is_external)&&n.jsx(Rt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Yr as default};
assets/{BenchmarkTrendSparkline-BCbEDZUr.js → BenchmarkTrendSparkline-D0ycyTpl.js} RENAMED
@@ -1 +1 @@
1
- import{r as C,j as t}from"./index-Bo5_2OqZ.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B};
 
1
+ import{r as C,j as t}from"./index-DREEM5p7.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B};
assets/ChatMessage-DAiy1xqv.js DELETED
@@ -1,6 +0,0 @@
1
- import{c as E,r as j,j as t,R as g}from"./index-Bo5_2OqZ.js";import{M as R,S as _,A as S,o as P,s as b,v as $}from"./chatSessions-Dz4Iu-O1.js";import"./katex.min-BSBacQyE.js";import{H as T,a as F,b as H}from"./hover-card-DrtqDSb0.js";import{r as I,a as M,P as U}from"./PaperPreviewLink-DTmodbgi.js";import{M as O,r as L,d as B}from"./index-C-0CcYmz.js";/**
2
- * @license lucide-react v0.462.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const A=E("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),ue=({onSend:e,busy:s,placeholder:a,autoFocus:n,draft:r,onDraftChange:o,onStop:c,models:l=[],selectedModel:d,onModelChange:h})=>{const[u,p]=j.useState(""),f=j.useRef(null);j.useEffect(()=>{const i=f.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,200)}px`)},[u]),j.useEffect(()=>{var i;n&&((i=f.current)==null||i.focus())},[n]),j.useEffect(()=>{r!==void 0&&p(r)},[r]);const x=()=>{const i=u.trim();!i||s||(p(""),o==null||o(""),e(i))};return t.jsxs("div",{className:"chat-composer",children:[t.jsx("textarea",{ref:f,rows:1,value:u,placeholder:a||"Ask anything about research…",onChange:i=>{p(i.target.value),o==null||o(i.target.value)},onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),x())}}),t.jsxs("div",{className:"chat-composer-row",children:[t.jsxs("div",{className:"chat-composer-tools",children:[l.length>0&&d&&h&&t.jsx(R,{models:l,selectedModel:d,onModelChange:h,disabled:s}),t.jsx("span",{className:"chat-composer-hint",children:"Enter to send · Shift+Enter for newline"})]}),t.jsx("button",{type:"button",className:`chat-send${s||u.trim()?" chat-send-on":""}`,onClick:s?c:x,disabled:s?!c:!u.trim(),"aria-label":s?"Stop generating":"Send message",children:s?c?t.jsx("span",{"aria-hidden":"true",children:"■"}):t.jsx(_,{light:!0}):t.jsx(S,{})})]})]})},v=new Map,q=e=>{if(!e)return Promise.resolve();const s=v.get(e);if(s)return s;const a=new Promise(n=>{const r=new Image;r.onload=()=>{n()},r.onerror=()=>{v.delete(e),n()},r.src=e});return v.set(e,a),a},V=new Set(["huggingface.co","www.huggingface.co"]),z=new Set(["api","blog","chat","collections","docs","enterprise","join","login","models","new","organizations","papers","posts","pricing","search","settings","spaces","tasks"]);function K(e){let s;try{s=new URL(e)}catch{return null}if(s.protocol!=="https:"||!V.has(s.hostname))return null;const a=s.pathname.split("/").filter(Boolean),n=a[0]==="datasets"?"dataset":"model",r=n==="dataset"?a.slice(1):a;if(r.length!==2||n==="model"&&z.has(r[0])||r.some(h=>!h||h==="."||h===".."))return null;const o=r.join("/"),c=r.map(encodeURIComponent).join("/"),l=n==="dataset"?`datasets/${c}`:c,d=n==="dataset"?"datasets":"models";return{type:n,repoId:o,url:`https://huggingface.co/${l}`,thumbnailUrl:`https://cdn-thumbnails.huggingface.co/social-thumbnails/${d}/${c}.png`}}const D=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,W=({repo:e})=>{const[s,a]=g.useState(!1);return t.jsxs("div",{className:"hf-preview-card",children:[s?t.jsx("div",{className:"hf-preview-fallback","aria-hidden":"true",children:"🤗"}):t.jsx("img",{className:"hf-preview-image","data-testid":"hf-preview-image",src:e.thumbnailUrl,alt:"",loading:"eager",decoding:"async",onError:()=>a(!0)}),t.jsxs("div",{className:"hf-preview-meta",children:[t.jsxs("span",{className:"hf-preview-kind",children:["Hugging Face ",e.type]}),t.jsx("strong",{children:e.repoId}),t.jsx("span",{children:"huggingface.co"})]})]})},X=({repo:e,children:s})=>{const[a,n]=g.useState(!1),r=g.useRef(null),o=g.useCallback(()=>{q(e.thumbnailUrl)},[e.thumbnailUrl]);return g.useEffect(()=>{const c=r.current;if(!c||typeof IntersectionObserver>"u")return;const l=new IntersectionObserver(([d])=>{d.isIntersecting&&(o(),l.disconnect())},{rootMargin:"200px"});return l.observe(c),()=>l.disconnect()},[o]),t.jsxs(T,{open:a,onOpenChange:c=>{(!c||!D())&&n(c)},openDelay:150,closeDelay:100,children:[t.jsx(F,{asChild:!0,children:t.jsx("a",{ref:r,className:"chat-paper-link chat-hf-link",href:e.url,target:"_blank",rel:"noopener noreferrer",onPointerEnter:o,onFocus:o,children:s})}),t.jsx(H,{className:"hf-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:t.jsx(W,{repo:e})})]})};function Y(e,s,a){if(s)return{routeId:e,title:s.title,arxivId:s.metadata.arxiv_id,source:s.metadata.source,sourceUrl:s.metadata.source_url,thumbnailUrl:s.metadata.thumbnail_url,authors:s.metadata.authors.map(n=>n.name),published:s.metadata.published,conference:s.metadata.conference,citationCount:s.metadata.citation_count,tasks:s.metadata.tasks};if(a)return{routeId:e,title:a.title,arxivId:a.arxiv_id??null,source:a.arxiv_id?"arxiv":"external",sourceUrl:a.source_url,thumbnailUrl:a.thumbnail_url??null,authors:a.authors??[],published:a.published??null,conference:a.conference??null,citationCount:a.citation_count??null,tasks:[]}}const k=({routeId:e,paper:s,citation:a,className:n="chat-paper-link",children:r})=>t.jsx(U,{routeId:e,initialData:Y(e,s,a),className:n,target:"_blank",children:r});function G(e){const s=e.lastIndexOf("[");if(s===-1)return e;const a=e.slice(s);return/^\[[^\]]*(\]\(?[^)\s]*)?$/.test(a)?e.slice(0,s):e}const J=e=>e.startsWith("paper:")?e:B(e),w=({text:e,streaming:s,papers:a,citations:n})=>{const r=s?G(e):e;return t.jsx(O,{remarkPlugins:[L,M],rehypePlugins:[I],urlTransform:J,components:{a:({href:o,children:c})=>{if(o!=null&&o.startsWith("paper:")){const d=o.slice(6);return!a[d]&&!(n!=null&&n[d])?t.jsx("span",{className:"chat-invalid-citation",children:c}):t.jsx(k,{routeId:d,paper:a[d],citation:n==null?void 0:n[d],children:c})}const l=o?K(o):null;return l?t.jsx(X,{repo:l,children:c}):t.jsx("span",{children:c})}},children:r})};function Q(e){if(!e.authors.length)return"";const s=e.authors.slice(0,3).map(a=>a.name).join(", ");return e.authors.length>3?`${s}, et al.`:s}function Z(e){var a;if(e.conference)return e.conference;const s=(a=e.published)==null?void 0:a.slice(0,4);if(e.arxiv_id)return s?`arXiv ${s}`:"arXiv";if(e.source_url)try{return new URL(e.source_url).hostname.replace(/^www\./,"")}catch{}return s??"external"}function ee(e,s=240){const a=e.content.trim();return a.length<=s?a:`${a.slice(0,s).trimEnd()}…`}const C=()=>t.jsx("span",{className:"chat-caret"}),te=e=>{var a;if(!e.streaming)return!1;const s=(a=e.blocks)==null?void 0:a.at(-1);return s?s.kind==="reasoning"?!s.active:s.kind==="tool"?s.status!=="running":!1:!0},se=e=>{var x,i;if(e.button!==0||e.detail!==2)return;e.preventDefault();const s=e.currentTarget,a=s.ownerDocument,n=(x=a.caretPositionFromPoint)==null?void 0:x.call(a,e.clientX,e.clientY),r=n?null:(i=a.caretRangeFromPoint)==null?void 0:i.call(a,e.clientX,e.clientY),o=(n==null?void 0:n.offsetNode)??(r==null?void 0:r.startContainer),c=(n==null?void 0:n.offset)??(r==null?void 0:r.startOffset);if(!(o instanceof Text)||c===void 0||!s.contains(o))return;const l=o.data,d=/[\p{L}\p{M}\p{N}_'-]/u;let h=Math.min(c,l.length),u=h;for(;h>0&&d.test(l[h-1]);)h-=1;for(;u<l.length&&d.test(l[u]);)u+=1;if(h===u)return;const p=a.getSelection();if(!p)return;const f=a.createRange();f.setStart(o,h),f.setEnd(o,u),p.removeAllRanges(),p.addRange(f)},ae=({block:e,papers:s,citations:a,onToggle:n})=>e.active?t.jsxs("div",{className:"chat-reason-live",children:[t.jsxs("div",{className:"chat-reason-live-head",children:[t.jsx(_,{})," ",t.jsx("span",{children:"Thinking…"})]}),t.jsxs("div",{className:"chat-reason-live-body chat-answer chat-reason-markdown",children:[t.jsx(w,{text:e.text,streaming:!0,papers:s,citations:a}),t.jsx(C,{})]})]}):t.jsxs("div",{className:"chat-reason-done",children:[t.jsxs("button",{type:"button",className:"chat-reason-done-head",onClick:n,"aria-expanded":e.open,children:[t.jsx(P,{}),t.jsx("span",{children:"Thought for a few seconds"}),t.jsx(b,{open:e.open})]}),e.open&&t.jsx("div",{className:"chat-reason-done-body chat-answer chat-reason-markdown",children:t.jsx(w,{text:e.text,papers:s,citations:a})})]}),ne=({block:e,papers:s,onToggle:a})=>{var u,p,f,x;const n=e.status==="running",r=e.schema_version===2||!!e.content,o=e.status==="error"||e.status==="denied",c=typeof e.args.query=="string"?e.args.query:"",l=typeof e.args.command=="string"?e.args.command:typeof e.args.file_path=="string"?e.args.file_path:c,d=((u=e.content)==null?void 0:u.map(i=>i.text).join(""))??"",h=n?"running…":r?`${e.status} · ${e.took_ms??0} ms`:`${e.hits} results · ${e.took_ms} ms`;return t.jsxs("div",{className:`chat-tool${n?" chat-tool-running":""}${o?" chat-tool-failed":""}`,children:[t.jsxs("button",{type:"button",className:"chat-tool-head",onClick:a,disabled:n,"aria-expanded":n?void 0:e.open,children:[t.jsxs("span",{className:"chat-tool-head-left",children:[n?t.jsx(_,{}):t.jsx($,{}),t.jsx("code",{className:"chat-tool-name",children:e.name}),t.jsx("span",{className:"chat-tool-query",children:r?l:`("${c}")`})]}),t.jsxs("span",{className:"chat-tool-head-right",children:[t.jsx("span",{className:"chat-tool-status",children:h}),!n&&t.jsx(b,{open:e.open})]})]}),!n&&e.open&&t.jsxs("div",{className:"chat-tool-body",children:[t.jsxs("div",{className:"chat-tool-args",children:[t.jsx("span",{className:"chat-tool-label",children:"arguments"}),t.jsx("pre",{children:JSON.stringify(e.args,null,2)})]}),r?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"chat-tool-output-head",children:[t.jsx("span",{className:"chat-tool-label",children:"result"}),t.jsx("button",{type:"button",className:"chat-tool-copy",onClick:()=>void navigator.clipboard.writeText(d),children:"Copy"})]}),t.jsx("pre",{className:"chat-tool-output",children:t.jsx("code",{children:d})}),((p=e.metadata)==null?void 0:p.output_truncated)&&t.jsx("div",{className:"chat-tool-truncated",children:"Output was truncated."})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"chat-tool-label chat-tool-results-label",children:["returned ",((f=e.results)==null?void 0:f.length)??0," papers"]}),t.jsx("ol",{className:"chat-tool-results",children:(x=e.results)==null?void 0:x.map(i=>t.jsxs("li",{className:"chat-hit",children:[t.jsx("div",{className:"chat-hit-top",children:t.jsx(k,{routeId:i.route_id,paper:s[i.route_id],className:"chat-hit-title",children:i.title})}),t.jsx("div",{className:"chat-hit-meta",children:[Q(i.metadata),Z(i.metadata)].filter(Boolean).join(" · ")}),t.jsxs("div",{className:"chat-hit-snippet",children:[ee(i),i.content_truncated&&t.jsx("span",{className:"chat-hit-truncated",children:" (truncated)"})]})]},i.route_id))})]})]})]})},re=({block:e,papers:s,citations:a,streaming:n})=>t.jsxs("div",{className:"chat-answer",children:[t.jsx(w,{text:e.text,streaming:n,papers:s,citations:a}),n&&!!e.text.trim()&&t.jsx(C,{})]}),me=({id:e,text:s,editingAllowed:a=!1,editing:n=!1,editNotice:r,onEdit:o,onCancel:c,onResend:l})=>{const[d,h]=g.useState(s),[u,p]=g.useState(!1),f=g.useRef(null),x=g.useCallback(()=>{const m=f.current;if(!m)return;m.style.height="auto";const y=Math.max(120,window.innerHeight*.4);m.style.height=`${Math.min(m.scrollHeight,y)}px`,m.style.overflowY=m.scrollHeight>y?"auto":"hidden"},[]);g.useLayoutEffect(()=>{if(!n)return;h(s),p(!1);const m=f.current;m&&(m.focus(),m.setSelectionRange(s.length,s.length),x())},[n,x,s]),g.useLayoutEffect(x,[x,d]);const i=!!d.trim()&&d.length<=8e3,N=()=>{!i||u||(p(!0),l!=null&&l(d)||p(!1))};return n?t.jsx("div",{className:"chat-msg chat-msg-user chat-msg-user-editing","data-message-id":e,children:t.jsxs("div",{className:"chat-inline-editor",children:[t.jsx("textarea",{ref:f,className:"chat-inline-editor-textarea","aria-label":"Edit message",value:d,maxLength:8e3,onChange:m=>h(m.target.value),onKeyDown:m=>{m.key==="Escape"?(m.preventDefault(),c==null||c()):m.key==="Enter"&&!m.shiftKey&&!m.nativeEvent.isComposing&&(m.preventDefault(),N())}}),r&&t.jsx("div",{className:"chat-inline-editor-notice",children:r}),t.jsxs("div",{className:"chat-inline-editor-actions",children:[t.jsx("button",{type:"button",onClick:c,children:"Cancel"}),t.jsx("button",{type:"button",className:"chat-inline-editor-send",disabled:!i||u,onClick:N,children:"Send"})]})]})}):t.jsx("div",{className:"chat-msg chat-msg-user","data-message-id":e,children:t.jsxs("div",{className:"chat-user-message-wrap",children:[t.jsx("div",{className:"chat-bubble",children:t.jsx("span",{className:"chat-bubble-text",onMouseDown:se,children:s})}),a&&t.jsx("div",{className:"chat-user-actions",children:t.jsx("button",{type:"button",className:"chat-user-edit","aria-label":"Edit message",title:"Edit",onClick:o,children:t.jsx(A,{"aria-hidden":"true"})})})]})})},pe=({msg:e,papers:s,onToggleBlock:a,onArchiveOldChats:n,archivePending:r=!1})=>{var o,c;return t.jsx("div",{className:"chat-msg chat-msg-assistant",children:t.jsxs("div",{className:"chat-msg-blocks",children:[(o=e.blocks)==null?void 0:o.map((l,d)=>{var f;const h=`${e.id}-${d}`,u="citations"in l&&l.citations!==void 0?l.citations:e.citations??[],p=Object.fromEntries(u.map(x=>[x.route_id,x]));return l.kind==="reasoning"?t.jsx(ae,{block:l,papers:s,citations:p,onToggle:()=>a(e.id,d)},h):l.kind==="tool"?t.jsx(ne,{block:l,papers:s,onToggle:()=>a(e.id,d)},h):t.jsx(re,{block:l,papers:s,citations:p,streaming:!!(e.streaming&&d===(((f=e.blocks)==null?void 0:f.length)??0)-1)},h)}),te(e)&&t.jsx("div",{className:"chat-waiting",role:"status","aria-live":"polite",children:t.jsx("span",{className:"chat-thinking",children:(((c=e.blocks)==null?void 0:c.length)??0)===0?e.status??"Thinking…":"Thinking…"})}),e.error&&t.jsxs("div",{className:"chat-error",children:[t.jsx("span",{children:e.errorCode==="chat_session_quota_exceeded"?e.error:`The assistant hit an error: ${e.error}`}),["hf_inference_billing_required","hf_inference_billing_exhausted","hf_inference_credential_expired"].includes(e.errorCode??"")&&t.jsx("a",{href:"/settings",children:e.errorCode==="hf_inference_billing_required"?"Authorize HF in Settings":e.errorCode==="hf_inference_credential_expired"?"Reconnect Hugging Face":"Review billing settings"}),e.errorCode==="openrouter_monthly_budget_exhausted"&&t.jsxs(t.Fragment,{children:[t.jsx("a",{href:"/settings#openrouter-byok",children:"Use your own OpenRouter key"}),t.jsx("span",{children:"Or select a Hugging Face-backed model and explicitly retry."})]}),e.errorCode==="openrouter_unavailable"&&t.jsxs(t.Fragment,{children:[t.jsx("a",{href:"/settings#openrouter-byok",children:"Bring your own key in Settings"}),t.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback",target:"_blank",rel:"noreferrer",children:"File an issue"})]}),["openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(e.errorCode??"")&&t.jsx("a",{href:"/settings#openrouter-byok",children:"Review OpenRouter settings"}),e.errorCode==="chat_session_quota_exceeded"&&n&&t.jsx("button",{type:"button",disabled:r,onClick:n,children:r?"Archiving…":"Archive chats older than 30 days"})]}),!e.streaming&&e.finishReason&&e.finishReason!=="success"&&t.jsx("div",{className:"chat-finish-note",children:["tool_limit","max_turns"].includes(e.finishReason)?"The assistant stopped at the execution limit.":`The assistant stopped early (${e.finishReason.replace(/_/g," ")}).`})]})})};export{pe as A,ue as C,me as U};
 
 
 
 
 
 
 
assets/ChatMessage-EkiSiSMU.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c as E,r as v,j as t,R as g}from"./index-DREEM5p7.js";import{M as R,S as N,A as S,o as P,s as b,v as T}from"./chatSessions-RaHJTN_0.js";import"./katex.min-BSBacQyE.js";import{H as $,a as F,b as H}from"./hover-card-ZrDlt9Lf.js";import{r as I,a as M,P as U}from"./PaperPreviewLink-D-wxSmXC.js";import{M as O,r as L,d as B}from"./index-Dm_H11O9.js";/**
2
+ * @license lucide-react v0.462.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const A=E("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),ue=({onSend:e,busy:s,placeholder:a,autoFocus:n,draft:r,onDraftChange:o,onStop:c,models:l=[],selectedModel:d,onModelChange:h,disabled:f=!1,describedBy:x})=>{const[m,p]=v.useState(""),u=v.useRef(null);v.useEffect(()=>{const i=u.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,200)}px`)},[m]),v.useEffect(()=>{var i;n&&((i=u.current)==null||i.focus())},[n]),v.useEffect(()=>{r!==void 0&&p(r)},[r]);const j=()=>{const i=m.trim();!i||s||f||(p(""),o==null||o(""),e(i))};return t.jsxs("div",{className:"chat-composer",children:[t.jsx("textarea",{ref:u,rows:1,value:m,placeholder:a||"Ask anything about research…",onChange:i=>{p(i.target.value),o==null||o(i.target.value)},onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),j())},"aria-describedby":x}),t.jsxs("div",{className:"chat-composer-row",children:[t.jsxs("div",{className:"chat-composer-tools",children:[l.length>0&&d&&h&&t.jsx(R,{models:l,selectedModel:d,onModelChange:h,disabled:s}),t.jsx("span",{className:"chat-composer-hint",children:"Enter to send · Shift+Enter for newline"})]}),t.jsx("button",{type:"button",className:`chat-send${s||m.trim()?" chat-send-on":""}`,onClick:s?c:j,disabled:f||(s?!c:!m.trim()),"aria-label":s?"Stop generating":"Send message",children:s?c?t.jsx("span",{"aria-hidden":"true",children:"■"}):t.jsx(N,{light:!0}):t.jsx(S,{})})]})]})},w=new Map,q=e=>{if(!e)return Promise.resolve();const s=w.get(e);if(s)return s;const a=new Promise(n=>{const r=new Image;r.onload=()=>{n()},r.onerror=()=>{w.delete(e),n()},r.src=e});return w.set(e,a),a},V=new Set(["huggingface.co","www.huggingface.co"]),z=new Set(["api","blog","chat","collections","docs","enterprise","join","login","models","new","organizations","papers","posts","pricing","search","settings","spaces","tasks"]);function K(e){let s;try{s=new URL(e)}catch{return null}if(s.protocol!=="https:"||!V.has(s.hostname))return null;const a=s.pathname.split("/").filter(Boolean),n=a[0]==="datasets"?"dataset":"model",r=n==="dataset"?a.slice(1):a;if(r.length!==2||n==="model"&&z.has(r[0])||r.some(h=>!h||h==="."||h===".."))return null;const o=r.join("/"),c=r.map(encodeURIComponent).join("/"),l=n==="dataset"?`datasets/${c}`:c,d=n==="dataset"?"datasets":"models";return{type:n,repoId:o,url:`https://huggingface.co/${l}`,thumbnailUrl:`https://cdn-thumbnails.huggingface.co/social-thumbnails/${d}/${c}.png`}}const D=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,W=({repo:e})=>{const[s,a]=g.useState(!1);return t.jsxs("div",{className:"hf-preview-card",children:[s?t.jsx("div",{className:"hf-preview-fallback","aria-hidden":"true",children:"🤗"}):t.jsx("img",{className:"hf-preview-image","data-testid":"hf-preview-image",src:e.thumbnailUrl,alt:"",loading:"eager",decoding:"async",onError:()=>a(!0)}),t.jsxs("div",{className:"hf-preview-meta",children:[t.jsxs("span",{className:"hf-preview-kind",children:["Hugging Face ",e.type]}),t.jsx("strong",{children:e.repoId}),t.jsx("span",{children:"huggingface.co"})]})]})},X=({repo:e,children:s})=>{const[a,n]=g.useState(!1),r=g.useRef(null),o=g.useCallback(()=>{q(e.thumbnailUrl)},[e.thumbnailUrl]);return g.useEffect(()=>{const c=r.current;if(!c||typeof IntersectionObserver>"u")return;const l=new IntersectionObserver(([d])=>{d.isIntersecting&&(o(),l.disconnect())},{rootMargin:"200px"});return l.observe(c),()=>l.disconnect()},[o]),t.jsxs($,{open:a,onOpenChange:c=>{(!c||!D())&&n(c)},openDelay:150,closeDelay:100,children:[t.jsx(F,{asChild:!0,children:t.jsx("a",{ref:r,className:"chat-paper-link chat-hf-link",href:e.url,target:"_blank",rel:"noopener noreferrer",onPointerEnter:o,onFocus:o,children:s})}),t.jsx(H,{className:"hf-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:t.jsx(W,{repo:e})})]})};function Y(e,s,a){if(s)return{routeId:e,title:s.title,arxivId:s.metadata.arxiv_id,source:s.metadata.source,sourceUrl:s.metadata.source_url,thumbnailUrl:s.metadata.thumbnail_url,authors:s.metadata.authors.map(n=>n.name),published:s.metadata.published,conference:s.metadata.conference,citationCount:s.metadata.citation_count,tasks:s.metadata.tasks};if(a)return{routeId:e,title:a.title,arxivId:a.arxiv_id??null,source:a.arxiv_id?"arxiv":"external",sourceUrl:a.source_url,thumbnailUrl:a.thumbnail_url??null,authors:a.authors??[],published:a.published??null,conference:a.conference??null,citationCount:a.citation_count??null,tasks:[]}}const k=({routeId:e,paper:s,citation:a,className:n="chat-paper-link",children:r})=>t.jsx(U,{routeId:e,initialData:Y(e,s,a),className:n,target:"_blank",children:r});function G(e){const s=e.lastIndexOf("[");if(s===-1)return e;const a=e.slice(s);return/^\[[^\]]*(\]\(?[^)\s]*)?$/.test(a)?e.slice(0,s):e}const J=e=>e.startsWith("paper:")?e:B(e),_=({text:e,streaming:s,papers:a,citations:n})=>{const r=s?G(e):e;return t.jsx(O,{remarkPlugins:[L,M],rehypePlugins:[I],urlTransform:J,components:{a:({href:o,children:c})=>{if(o!=null&&o.startsWith("paper:")){const d=o.slice(6);return!a[d]&&!(n!=null&&n[d])?t.jsx("span",{className:"chat-invalid-citation",children:c}):t.jsx(k,{routeId:d,paper:a[d],citation:n==null?void 0:n[d],children:c})}const l=o?K(o):null;return l?t.jsx(X,{repo:l,children:c}):t.jsx("span",{children:c})}},children:r})};function Q(e){if(!e.authors.length)return"";const s=e.authors.slice(0,3).map(a=>a.name).join(", ");return e.authors.length>3?`${s}, et al.`:s}function Z(e){var a;if(e.conference)return e.conference;const s=(a=e.published)==null?void 0:a.slice(0,4);if(e.arxiv_id)return s?`arXiv ${s}`:"arXiv";if(e.source_url)try{return new URL(e.source_url).hostname.replace(/^www\./,"")}catch{}return s??"external"}function ee(e,s=240){const a=e.content.trim();return a.length<=s?a:`${a.slice(0,s).trimEnd()}…`}const C=()=>t.jsx("span",{className:"chat-caret"}),te=e=>{var a;if(!e.streaming)return!1;const s=(a=e.blocks)==null?void 0:a.at(-1);return s?s.kind==="reasoning"?!s.active:s.kind==="tool"?s.status!=="running":!1:!0},se=e=>{var p,u;if(e.button!==0||e.detail!==2)return;e.preventDefault();const s=e.currentTarget,a=s.ownerDocument,n=(p=a.caretPositionFromPoint)==null?void 0:p.call(a,e.clientX,e.clientY),r=n?null:(u=a.caretRangeFromPoint)==null?void 0:u.call(a,e.clientX,e.clientY),o=(n==null?void 0:n.offsetNode)??(r==null?void 0:r.startContainer),c=(n==null?void 0:n.offset)??(r==null?void 0:r.startOffset);if(!(o instanceof Text)||c===void 0||!s.contains(o))return;const l=o.data,d=/[\p{L}\p{M}\p{N}_'-]/u;let h=Math.min(c,l.length),f=h;for(;h>0&&d.test(l[h-1]);)h-=1;for(;f<l.length&&d.test(l[f]);)f+=1;if(h===f)return;const x=a.getSelection();if(!x)return;const m=a.createRange();m.setStart(o,h),m.setEnd(o,f),x.removeAllRanges(),x.addRange(m)},ae=({block:e,papers:s,citations:a,onToggle:n})=>e.active?t.jsxs("div",{className:"chat-reason-live",children:[t.jsxs("div",{className:"chat-reason-live-head",children:[t.jsx(N,{})," ",t.jsx("span",{children:"Thinking…"})]}),t.jsxs("div",{className:"chat-reason-live-body chat-answer chat-reason-markdown",children:[t.jsx(_,{text:e.text,streaming:!0,papers:s,citations:a}),t.jsx(C,{})]})]}):t.jsxs("div",{className:"chat-reason-done",children:[t.jsxs("button",{type:"button",className:"chat-reason-done-head",onClick:n,"aria-expanded":e.open,children:[t.jsx(P,{}),t.jsx("span",{children:"Thought for a few seconds"}),t.jsx(b,{open:e.open})]}),e.open&&t.jsx("div",{className:"chat-reason-done-body chat-answer chat-reason-markdown",children:t.jsx(_,{text:e.text,papers:s,citations:a})})]}),ne=({block:e,papers:s,onToggle:a})=>{var f,x,m,p;const n=e.status==="running",r=e.schema_version===2||!!e.content,o=e.status==="error"||e.status==="denied",c=typeof e.args.query=="string"?e.args.query:"",l=typeof e.args.command=="string"?e.args.command:typeof e.args.file_path=="string"?e.args.file_path:c,d=((f=e.content)==null?void 0:f.map(u=>u.text).join(""))??"",h=n?"running…":r?`${e.status} · ${e.took_ms??0} ms`:`${e.hits} results · ${e.took_ms} ms`;return t.jsxs("div",{className:`chat-tool${n?" chat-tool-running":""}${o?" chat-tool-failed":""}`,children:[t.jsxs("button",{type:"button",className:"chat-tool-head",onClick:a,disabled:n,"aria-expanded":n?void 0:e.open,children:[t.jsxs("span",{className:"chat-tool-head-left",children:[n?t.jsx(N,{}):t.jsx(T,{}),t.jsx("code",{className:"chat-tool-name",children:e.name}),t.jsx("span",{className:"chat-tool-query",children:r?l:`("${c}")`})]}),t.jsxs("span",{className:"chat-tool-head-right",children:[t.jsx("span",{className:"chat-tool-status",children:h}),!n&&t.jsx(b,{open:e.open})]})]}),!n&&e.open&&t.jsxs("div",{className:"chat-tool-body",children:[t.jsxs("div",{className:"chat-tool-args",children:[t.jsx("span",{className:"chat-tool-label",children:"arguments"}),t.jsx("pre",{children:JSON.stringify(e.args,null,2)})]}),r?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"chat-tool-output-head",children:[t.jsx("span",{className:"chat-tool-label",children:"result"}),t.jsx("button",{type:"button",className:"chat-tool-copy",onClick:()=>void navigator.clipboard.writeText(d),children:"Copy"})]}),t.jsx("pre",{className:"chat-tool-output",children:t.jsx("code",{children:d})}),((x=e.metadata)==null?void 0:x.output_truncated)&&t.jsx("div",{className:"chat-tool-truncated",children:"Output was truncated."})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"chat-tool-label chat-tool-results-label",children:["returned ",((m=e.results)==null?void 0:m.length)??0," papers"]}),t.jsx("ol",{className:"chat-tool-results",children:(p=e.results)==null?void 0:p.map(u=>t.jsxs("li",{className:"chat-hit",children:[t.jsx("div",{className:"chat-hit-top",children:t.jsx(k,{routeId:u.route_id,paper:s[u.route_id],className:"chat-hit-title",children:u.title})}),t.jsx("div",{className:"chat-hit-meta",children:[Q(u.metadata),Z(u.metadata)].filter(Boolean).join(" · ")}),t.jsxs("div",{className:"chat-hit-snippet",children:[ee(u),u.content_truncated&&t.jsx("span",{className:"chat-hit-truncated",children:" (truncated)"})]})]},u.route_id))})]})]})]})},re=({block:e,papers:s,citations:a,streaming:n})=>t.jsxs("div",{className:"chat-answer",children:[t.jsx(_,{text:e.text,streaming:n,papers:s,citations:a}),n&&!!e.text.trim()&&t.jsx(C,{})]}),me=({id:e,text:s,editingAllowed:a=!1,editing:n=!1,editNotice:r,onEdit:o,onCancel:c,onResend:l})=>{const[d,h]=g.useState(s),[f,x]=g.useState(!1),m=g.useRef(null),p=g.useCallback(()=>{const i=m.current;if(!i)return;i.style.height="auto";const y=Math.max(120,window.innerHeight*.4);i.style.height=`${Math.min(i.scrollHeight,y)}px`,i.style.overflowY=i.scrollHeight>y?"auto":"hidden"},[]);g.useLayoutEffect(()=>{if(!n)return;h(s),x(!1);const i=m.current;i&&(i.focus(),i.setSelectionRange(s.length,s.length),p())},[n,p,s]),g.useLayoutEffect(p,[p,d]);const u=!!d.trim()&&d.length<=8e3,j=()=>{!u||f||(x(!0),l!=null&&l(d)||x(!1))};return n?t.jsx("div",{className:"chat-msg chat-msg-user chat-msg-user-editing","data-message-id":e,children:t.jsxs("div",{className:"chat-inline-editor",children:[t.jsx("textarea",{ref:m,className:"chat-inline-editor-textarea","aria-label":"Edit message",value:d,maxLength:8e3,onChange:i=>h(i.target.value),onKeyDown:i=>{i.key==="Escape"?(i.preventDefault(),c==null||c()):i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&(i.preventDefault(),j())}}),r&&t.jsx("div",{className:"chat-inline-editor-notice",children:r}),t.jsxs("div",{className:"chat-inline-editor-actions",children:[t.jsx("button",{type:"button",onClick:c,children:"Cancel"}),t.jsx("button",{type:"button",className:"chat-inline-editor-send",disabled:!u||f,onClick:j,children:"Send"})]})]})}):t.jsx("div",{className:"chat-msg chat-msg-user","data-message-id":e,children:t.jsxs("div",{className:"chat-user-message-wrap",children:[t.jsx("div",{className:"chat-bubble",children:t.jsx("span",{className:"chat-bubble-text",onMouseDown:se,children:s})}),a&&t.jsx("div",{className:"chat-user-actions",children:t.jsx("button",{type:"button",className:"chat-user-edit","aria-label":"Edit message",title:"Edit",onClick:o,children:t.jsx(A,{"aria-hidden":"true"})})})]})})},pe=({msg:e,papers:s,onToggleBlock:a,onArchiveOldChats:n,archivePending:r=!1})=>{var o,c;return t.jsx("div",{className:"chat-msg chat-msg-assistant",children:t.jsxs("div",{className:"chat-msg-blocks",children:[(o=e.blocks)==null?void 0:o.map((l,d)=>{var m;const h=`${e.id}-${d}`,f="citations"in l&&l.citations!==void 0?l.citations:e.citations??[],x=Object.fromEntries(f.map(p=>[p.route_id,p]));return l.kind==="reasoning"?t.jsx(ae,{block:l,papers:s,citations:x,onToggle:()=>a(e.id,d)},h):l.kind==="tool"?t.jsx(ne,{block:l,papers:s,onToggle:()=>a(e.id,d)},h):t.jsx(re,{block:l,papers:s,citations:x,streaming:!!(e.streaming&&d===(((m=e.blocks)==null?void 0:m.length)??0)-1)},h)}),te(e)&&t.jsx("div",{className:"chat-waiting",role:"status","aria-live":"polite",children:t.jsx("span",{className:"chat-thinking",children:(((c=e.blocks)==null?void 0:c.length)??0)===0?e.status??"Thinking…":"Thinking…"})}),e.error&&t.jsxs("div",{className:"chat-error",children:[t.jsx("span",{children:e.errorCode==="chat_disabled_interrupted"?"Chat was disabled while this response was running. The partial response is saved. Please try again later.":e.errorCode==="chat_session_quota_exceeded"?e.error:`The assistant hit an error: ${e.error}`}),["hf_inference_billing_required","hf_inference_billing_exhausted","hf_inference_credential_expired"].includes(e.errorCode??"")&&t.jsx("a",{href:"/settings",children:e.errorCode==="hf_inference_billing_required"?"Authorize HF in Settings":e.errorCode==="hf_inference_credential_expired"?"Reconnect Hugging Face":"Review billing settings"}),e.errorCode==="openrouter_monthly_budget_exhausted"&&t.jsxs(t.Fragment,{children:[t.jsx("a",{href:"/settings#openrouter-byok",children:"Use your own OpenRouter key"}),t.jsx("span",{children:"Or select a Hugging Face-backed model and explicitly retry."})]}),e.errorCode==="openrouter_unavailable"&&t.jsxs(t.Fragment,{children:[t.jsx("a",{href:"/settings#openrouter-byok",children:"Bring your own key in Settings"}),t.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback",target:"_blank",rel:"noreferrer",children:"File an issue"})]}),["openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(e.errorCode??"")&&t.jsx("a",{href:"/settings#openrouter-byok",children:"Review OpenRouter settings"}),e.errorCode==="chat_session_quota_exceeded"&&n&&t.jsx("button",{type:"button",disabled:r,onClick:n,children:r?"Archiving…":"Archive chats older than 30 days"})]}),!e.streaming&&e.finishReason&&e.finishReason!=="success"&&t.jsx("div",{className:"chat-finish-note",children:["tool_limit","max_turns"].includes(e.finishReason)?"The assistant stopped at the execution limit.":`The assistant stopped early (${e.finishReason.replace(/_/g," ")}).`})]})})};export{pe as A,ue as C,me as U};
assets/ChatView-BRD2gg8Z.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as St,d as Me,r as i,j as t,e as Ct,u as Et,a as Ot,f as Tt,g as jt,h as Nt,k as Lt,l as It,X as Dt,b as At}from"./index-DREEM5p7.js";import{u as Pt}from"./useQuery-pzEX4kGt.js";import{C as et,U as Yt,A as Mt}from"./ChatMessage-EkiSiSMU.js";import{c as Ft,g as Ye,t as mt,r as Ut,F as qt,D as Bt,l as Ht,C as tt,a as rt,b as nt,d as Wt,e as Kt,P as Vt,f as st,h as Gt,T as $t,S as at,u as it,i as Qt,j as zt,k as Jt}from"./chatSessions-RaHJTN_0.js";import{S as Xt}from"./chatPrompts-CDY3UGU1.js";import{u as Zt,O as er,a as tr,b as rr,r as nr}from"./openrouter-0x0PaeCZ.js";import"./useBaseQuery-BnoYgsiR.js";import"./katex.min-BSBacQyE.js";import"./hover-card-ZrDlt9Lf.js";import"./PaperPreviewLink-D-wxSmXC.js";import"./index-Dm_H11O9.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 sr=St("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),F=(l,h)=>new Promise(u=>{const k=setTimeout(f,l);function f(){h==null||h.removeEventListener("abort",f),clearTimeout(k),u()}h==null||h.addEventListener("abort",f)}),ee=l=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...l}),te={name:"Object Detection",slug:"object-detection"},ne={name:"Real-Time Object Detection",slug:"real-time-object-detection"},ar={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:ee({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[te,ne],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:ee({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[te,ne],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:ee({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[te,ne],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:ee({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[te,ne],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:ee({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[te,ne],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:ee({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[te,ne],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:ee({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},te],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:ee({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[te,ne],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},gt=l=>l.map(h=>ar[h]),ot=gt(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),ct=gt(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),lt="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",dt="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",ut=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve.
7
+
8
+ **At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency.
9
+
10
+ **At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost.
11
+
12
+ **My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,ir=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*or(l,h){const u=()=>(h==null?void 0:h.aborted)===!0,k=l.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await F(350,h),!u()){yield{type:"reasoning_start"};for(let f=0;f<lt.length;f+=6){if(await F(14,h),u())return;yield{type:"reasoning_delta",text:lt.slice(f,f+6)}}if(await F(400,h),!u()&&(yield{type:"reasoning_end"},await F(300,h),!u()&&(yield{type:"tool_call",id:"call_1",name:"search_papers",args:{query:k,top_k:8}},await F(1100,h),!u()&&(yield{type:"tool_result",id:"call_1",hits:ot.length,took_ms:214,results:ot},await F(350,h),!u())))){yield{type:"reasoning_start"};for(let f=0;f<dt.length;f+=6){if(await F(14,h),u())return;yield{type:"reasoning_delta",text:dt.slice(f,f+6)}}if(await F(350,h),!u()&&(yield{type:"reasoning_end"},await F(300,h),!u()&&(yield{type:"tool_call",id:"call_2",name:"search_papers",args:{query:"RT-DETR vs YOLOv12 COCO mAP latency FPS T4 TensorRT comparison",top_k:5}},await F(900,h),!u()&&(yield{type:"tool_result",id:"call_2",hits:ct.length,took_ms:176,results:ct},await F(400,h),!u())))){for(let f=0;f<ut.length;f+=4){if(await F(11,h),u())return;yield{type:"answer_delta",text:ut.slice(f,f+4)}}yield{type:"done",followups:ir,finish_reason:"success"}}}}}const _e=()=>{const h=String("0").trim().toLowerCase();return h==="1"||h==="true"||h==="yes"};class ve extends Error{constructor(h,u,k,f){super(h),this.code=u,this.status=k,this.retryAfterSeconds=f,this.name="ChatStreamError"}}function cr(l,h){if(_e())try{fetch(Me(`/api/v1/chat/latency/${encodeURIComponent(l)}`),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",keepalive:!0,body:JSON.stringify(h)}).catch(()=>{})}catch{}}function lr(l,h={}){return _e()?dr(l,h.signal):or(l.message,h.signal)}async function*dr(l,h){const u=await fetch(Me("/api/v1/chat/stream"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"include",body:JSON.stringify(l),signal:h});if(!u.ok||!u.body){const R=await u.json().catch(()=>null),w=R==null?void 0:R.detail,x=u.status===403&&!w,v=Number(u.headers.get("Retry-After")),S=Number.isFinite(v)&&v>=0?Math.min(300,Math.ceil(v)):void 0;throw new ve(x?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(w==null?void 0:w.message)||w||`Chat stream failed (${u.status})`,(w==null?void 0:w.code)||(x?"staging_access_required":void 0),u.status,S)}const k=u.body.getReader(),f=new TextDecoder;let O="";try{for(;;){const{done:R,value:w}=await k.read();if(R)break;O+=f.decode(w,{stream:!0});let x;for(;(x=O.indexOf(`
13
+
14
+ `))!==-1;){const v=O.slice(0,x);O=O.slice(x+2);const S=v.split(`
15
+ `).filter(T=>T.startsWith("data:")).map(T=>T.slice(5).trimStart()).join(`
16
+ `);!S||S==="[DONE]"||(yield JSON.parse(S))}}}finally{k.releaseLock()}}const yt="Preparing research workspace…",ur=750;function we(l){if(l.status!==yt)return l;const{status:h,...u}=l;return u}function Pe(l,h){for(let u=l.length-1;u>=0;u-=1)if(h(l[u]))return u;return-1}function hr(l){const[h,u]=i.useState([]),[k,f]=i.useState(!1),[O,R]=i.useState(""),w=i.useRef(!1),x=i.useRef(null),v=i.useRef(null),S=i.useRef("cleared"),T=i.useRef(null),I=i.useRef(null),[ue,$]=i.useState(null),[he,P]=i.useState(null),C=i.useRef([]),_=i.useRef(l),Re=i.useRef(""),se=i.useRef(""),xe=i.useRef(0),N=i.useRef(0),U=i.useRef(l.sessionId),ke=i.useRef(l.sessionId);ke.current!==l.sessionId&&(ke.current=l.sessionId,U.current!==l.sessionId&&(N.current+=1,T.current=null)),_.current=l,C.current=h,i.useEffect(()=>()=>{var r;v.current!==null&&window.clearTimeout(v.current),(r=x.current)==null||r.abort(),I.current=null},[]),i.useEffect(()=>{w.current||(U.current=l.sessionId)},[l.sessionId]);const H=i.useMemo(()=>{const r={};for(const c of h)for(const a of c.blocks??[])if(a.kind==="tool")for(const d of a.results??[])r[d.route_id]=d;return r},[h]),W=()=>`m${++xe.current}_${Date.now().toString(36)}`,E=r=>u(c=>{if(!c.length)return c;const a=c.slice();return a[a.length-1]=r(a[a.length-1]),a}),Se=r=>E(c=>{const a=we(c);return{...a,blocks:[...a.blocks??[],r]}}),fe=(r,c)=>E(a=>{const d=we(a);return{...d,blocks:(d.blocks??[]).map((p,m,g)=>r(p,m,g)?c(p):p)}}),Oe=r=>(c,a,d)=>c.kind===r&&Pe(d,p=>p.kind===r)===a,q=r=>{if(x.current!==r||(v.current!==null&&(window.clearTimeout(v.current),v.current=null),S.current==="cleared"))return;const c=S.current==="shown";S.current="cleared",c&&E(we)},G=(r,c)=>{r.requestId&&cr(r.requestId,c)},Y=(r,c)=>{const a=T.current;!a||a.controller!==r||(a.requestId=c,a.streamStartReported||(a.streamStartReported=!0,G(a,{submission_to_stream_start_ms:Math.max(0,performance.now()-a.submittedAt)})),a.firstVisibleAt!==void 0&&!a.firstVisibleReported&&(a.firstVisibleReported=!0,G(a,{submission_to_first_visible_delta_ms:Math.max(0,a.firstVisibleAt-a.submittedAt)})))},Q=(r,c)=>{const a=T.current;!a||a.controller!==r||a.terminalReported||(a.terminalReported=!0,G(a,{terminal_classification:c}))};i.useLayoutEffect(()=>{const r=T.current;if(!r||r.firstVisibleAt!==void 0)return;const c=h.at(-1);(c==null?void 0:c.role)!=="assistant"||!(c.blocks??[]).some(d=>d.kind==="tool"||d.kind==="reasoning"&&!!d.text.trim()||d.kind==="answer"&&!!d.text.trim())||(r.firstVisibleAt=performance.now(),r.requestId&&!r.firstVisibleReported&&(r.firstVisibleReported=!0,G(r,{submission_to_first_visible_delta_ms:Math.max(0,r.firstVisibleAt-r.submittedAt)})))},[h]);const ae=r=>{switch(r.type){case"stream_start":r.session_id&&(U.current=r.session_id,_.current.onSessionId(r.session_id));break;case"sandbox_start":case"sandbox_ready":case"workspace_ready":break;case"session_title_start":se.current="";break;case"session_title_delta":se.current+=r.text,_.current.onTitle(se.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":se.current=r.title,_.current.onTitle(r.title);break;case"reasoning_start":E(c=>{const a=we(c);return{...a,blocks:[...(a.blocks??[]).map(d=>d.kind==="reasoning"&&d.active?{...d,active:!1,open:!1}:d),{kind:"reasoning",text:"",active:!0,open:!0}]}});break;case"reasoning_delta":fe(Oe("reasoning"),c=>c.kind==="reasoning"?{...c,text:c.text+r.text}:c);break;case"reasoning_end":E(c=>{const a=c.blocks??[],d=Pe(a,g=>g.kind==="reasoning"&&g.active);if(d<0)return c;const p=a[d];if(p.kind!=="reasoning")return c;const m=a[d-1];return(m==null?void 0:m.kind)==="reasoning"&&m.text===p.text?{...c,blocks:a.filter((g,y)=>y!==d)}:{...c,blocks:a.map((g,y)=>y===d?{...p,active:!1,open:!1}:g)}});break;case"tool_call":Se({kind:"tool",id:r.id,name:r.name,args:r.args,status:"running",open:!1});break;case"tool_result":fe(c=>c.kind==="tool"&&c.id===r.id,c=>c.kind==="tool"?r.status?{...c,schema_version:2,status:r.status,took_ms:r.took_ms,content:r.content,metadata:r.metadata,open:r.status!=="success"}:{...c,status:"done",hits:r.hits,took_ms:r.took_ms,results:r.results}:c);break;case"answer_delta":E(c=>{const a=we(c),d=a.blocks??[],p=d.at(-1);return(p==null?void 0:p.kind)==="answer"&&!p.done?{...a,blocks:[...d.slice(0,-1),{...p,text:p.text+r.text}]}:{...a,blocks:[...d,{kind:"answer",text:r.text,done:!1}]}});break;case"done":E(c=>({...c,streaming:!1,followups:r.followups,finishReason:r.finish_reason,citations:r.citations,blocks:(c.blocks??[]).map(a=>a.kind==="answer"?{...a,done:!0}:a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break;case"error":E(c=>({...c,streaming:!1,error:r.message,errorCode:r.code,blocks:(c.blocks??[]).map(a=>a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break}},re=async(r,c)=>{const a=await Ye(r),d=mt(a);return N.current!==c?null:(u(d),C.current=d,d)},ie=(r,c,a,d,p)=>{const m=++N.current;w.current=!0;const g=new AbortController;return x.current=g,Re.current=r,U.current=c.session_id,R(""),u(a),f(!0),T.current={controller:g,submittedAt:performance.now(),streamStartReported:!1,firstVisibleReported:!1,terminalReported:!1},v.current!==null&&window.clearTimeout(v.current),S.current="armed",v.current=window.setTimeout(()=>{v.current=null,!(S.current!=="armed"||x.current!==g||g.signal.aborted||N.current!==m)&&(S.current="shown",E(y=>{var A;return y.role==="assistant"&&y.streaming&&(((A=y.blocks)==null?void 0:A.length)??0)===0&&!y.error?{...y,status:yt}:y}))},ur),(async()=>{var le,X,K;let y=!1,A=!1,M=!1,J=!1,D=!1,B=!1;try{for await(const o of lr(c,{signal:g.signal})){o.type==="stream_start"&&(y=!0,A=o.provider_execution!==!1,Y(g,o.request_id)),(o.type==="workspace_ready"||o.type==="reasoning_start"||o.type==="reasoning_delta"||o.type==="tool_call"||o.type==="answer_delta"||o.type==="done"||o.type==="error")&&q(g),(o.type==="done"||o.type==="error")&&(J=!0,D=o.type==="error",Q(g,o.type==="error"?"error":"complete"),o.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(o.code??"")&&(M=!0,_.current.onInterrupted(r)));const L=N.current===m;!g.signal.aborted&&(L||o.type==="stream_start"||o.type==="session_title_start"||o.type==="session_title_delta"||o.type==="session_title_done")&&ae(o)}}catch(o){if(D=!0,!g.signal.aborted){if(q(g),o instanceof ve&&o.code==="chat_temporarily_disabled")B=!0,P({question:r}),N.current===m&&(u(d),C.current=d,R(""));else if(o instanceof ve&&o.code==="chat_capacity"){B=!0;const L=o.retryAfterSeconds??5,Z={question:r,request:c,optimistic:a,original:d,edit:p,retryAfterSeconds:L,retryAt:Date.now()+L*1e3};I.current=Z,$({question:r,retryAt:Z.retryAt,retryAfterSeconds:L}),N.current===m&&(u(d),C.current=d,R(""))}else Q(g,"network_error"),o instanceof ve&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(o.code??"")&&(M=!0,_.current.onInterrupted(r));!B&&N.current===m&&ae({type:"error",message:o instanceof Error?o.message:"The assistant stream failed.",code:o instanceof ve?o.code:void 0})}}finally{if(x.current===g){if(q(g),!J&&!g.signal.aborted&&Q(g,"network_error"),w.current=!1,f(!1),B)_.current.onSettled(c.session_id);else if(!g.signal.aborted){(y&&A||M)&&((X=(le=_.current).onProviderTerminal)==null||X.call(le));const o=U.current;if(p&&!y)N.current===m&&(u(p.snapshot),C.current=p.snapshot,R("Couldn’t resend this message. Your original conversation was restored."));else if(o){N.current===m&&p&&!p.first&&(D||!J)&&(u(p.snapshot),C.current=p.snapshot);try{const L=await re(o,m);L&&p&&!p.first&&L.some(Z=>Z.id===p.targetId)&&R("Couldn’t resend this message. Your original conversation was restored.")}catch{N.current===m&&E(L=>L.streaming?{...L,streaming:!1}:L)}}else N.current===m&&E(L=>L.streaming?{...L,streaming:!1}:L);_.current.onSettled(o)}((K=T.current)==null?void 0:K.controller)===g&&(T.current=null)}}})(),!0},pe=i.useCallback(r=>{const c=r.trim();if(!c||c.length>8e3||w.current||I.current)return!1;const a=C.current,d=[...a].reverse().find(M=>M.role==="user"),p=d!=null&&d.status&&d.status!=="complete"&&d.revision?{replace_message_id:d.id,prior_revision:d.revision}:null,m={id:W(),role:"user",text:c},g={id:W(),role:"assistant",streaming:!0,blocks:[]},y=p&&d?Pe(a,M=>M.id===d.id):-1,A=y<0?[...a,m,g]:[...a.slice(0,y),m,g];return ie(c,{message:c,session_id:_.current.sessionId,client_message_id:crypto.randomUUID(),...!_.current.sessionId&&_.current.initialModel?{initial_model:_.current.initialModel}:{},...p??{}},A,a)},[]),Te=i.useCallback((r,c)=>{const a=c.trim();if(!a||a.length>8e3||w.current||I.current)return!1;const d=C.current.slice(),p=d.findIndex(D=>D.id===r&&D.role==="user");if(p<0)return!1;const m=d[p],g=d.findIndex(D=>D.role==="user"),y=p===g;if(!y&&(!_.current.sessionId||!m.revision))return!1;const A={id:m.id,role:"user",text:a,revision:y?void 0:m.revision+1,status:"generating"},M={id:W(),role:"assistant",streaming:!0,blocks:[]},J=y?[A,M]:[...d.slice(0,p),A,M];return ie(a,{message:a,session_id:y?null:_.current.sessionId,client_message_id:crypto.randomUUID(),...y&&_.current.initialModel?{initial_model:_.current.initialModel}:{},...y?{}:{replace_message_id:m.id,prior_revision:m.revision}},J,d,{targetId:m.id,snapshot:d,first:y})},[]),oe=i.useCallback(()=>{I.current=null,$(null)},[]),je=i.useCallback(()=>{const r=I.current;return!r||Date.now()<r.retryAt||w.current?!1:(I.current=null,$(null),ie(r.question,r.request,r.optimistic,r.original,r.edit))},[]),ce=i.useCallback(()=>{var d;if(!x.current)return;const r=x.current;q(r),Q(r,"stopped"),r.abort(),x.current=null,((d=T.current)==null?void 0:d.controller)===r&&(T.current=null),w.current=!1,f(!1),u(p=>{const m=p.at(-1);if((m==null?void 0:m.role)!=="assistant")return p;const g=(m.blocks??[]).flatMap(y=>y.kind==="tool"&&y.status==="running"?[]:y.kind==="reasoning"&&y.active?[]:y.kind==="answer"?[{...y,done:!0}]:[y]);return[...p.slice(0,-1),{...m,blocks:g,streaming:!1,finishReason:"stopped"}]}),_.current.onInterrupted(Re.current);const c=U.current;c&&Ft(c).catch(()=>{});const a=++N.current;window.setTimeout(()=>{c&&N.current===a?re(c,a).catch(()=>{}).finally(()=>_.current.onSettled(c)):c||_.current.onSettled(null)},450)},[]),Ce=i.useCallback((r,c)=>u(a=>a.map(d=>{var p;return d.id!==r?d:{...d,blocks:(p=d.blocks)==null?void 0:p.map((m,g)=>g===c&&(m.kind==="reasoning"||m.kind==="tool")?{...m,open:!m.open}:m)}})),[]),me=i.useCallback(()=>{var r;N.current+=1,v.current!==null&&(window.clearTimeout(v.current),v.current=null),S.current="cleared",(r=x.current)==null||r.abort(),x.current=null,T.current=null,I.current=null,$(null),w.current=!1,U.current=null,u([]),f(!1),R("")},[]),z=i.useCallback(r=>{var c;N.current+=1,v.current!==null&&(window.clearTimeout(v.current),v.current=null),S.current="cleared",T.current=null,I.current=null,$(null),w.current||((c=x.current)==null||c.abort(),x.current=null),u(r),w.current||f(!1),R("")},[]);return{messages:h,busy:k,papers:H,sessionError:O,capacityRequest:ue,disabledRequest:he,send:pe,editAndResend:Te,retryCapacity:je,cancelCapacity:oe,dismissDisabled:()=>P(null),stop:ce,toggleBlock:Ce,reset:me,load:z}}const fr="https://huggingface.co/settings/inference-providers",ht="pwc.chat.billing-notice-dismissed.v1",ft=({provider:l})=>{const[h,u]=i.useState(()=>localStorage.getItem(ht)==="1");return!_e()||h||l!=="huggingface"?null:t.jsxs("div",{className:"chat-billing-notice",role:"note",children:[t.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),t.jsxs("div",{className:"chat-billing-notice-actions",children:[t.jsx("a",{href:"/settings",children:"Review billing"}),t.jsx("a",{href:fr,target:"_blank",rel:"noreferrer",children:"Review usage"}),t.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(ht,"1"),u(!0)},children:t.jsx(Dt,{size:15,"aria-hidden":"true"})})]})]})},pt=({enabled:l,fallbackEnabled:h,byokExpected:u})=>{const k=rr(l);if(!l||!k.data)return null;const f=k.data,O=nr(f.resets_at);return t.jsxs("div",{className:"chat-openrouter-usage",role:"status",children:[t.jsxs("span",{children:[t.jsxs("strong",{children:[f.remaining_percent,"% left"]})," this month · resets ",O.local]}),(f.remaining_percent===0||u)&&t.jsx("span",{children:h?"Your OpenRouter account will be billed on this explicit send.":t.jsxs(t.Fragment,{children:[t.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own key in Settings"})," to continue."]})})]})},pr=({retryAt:l,onRetry:h,onCancel:u})=>{const[k,f]=i.useState(()=>Math.max(0,Math.ceil((l-Date.now())/1e3))),O=i.useRef(null);return i.useEffect(()=>{var v;const R=document.activeElement instanceof HTMLElement?document.activeElement:null;(v=O.current)==null||v.focus();const w=()=>f(Math.max(0,Math.ceil((l-Date.now())/1e3)));w();const x=window.setInterval(w,250);return()=>{window.clearInterval(x),R==null||R.focus()}},[l]),t.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:t.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:R=>{R.key==="Escape"&&(R.preventDefault(),u())},children:[t.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),t.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),t.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:k>0?`Try again available in ${k} second${k===1?"":"s"}.`:"You can try again now."}),t.jsxs("div",{className:"chat-capacity-dialog-actions",children:[t.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:O,onClick:u,children:"Cancel"}),t.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:k>0,onClick:h,children:"Try again"})]})]})})},mr=({onClose:l})=>{const h=i.useRef(null);return i.useEffect(()=>{var k;const u=document.activeElement instanceof HTMLElement?document.activeElement:null;return(k=h.current)==null||k.focus(),()=>u==null?void 0:u.focus()},[]),t.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:t.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),l())},children:[t.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),t.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),t.jsx("div",{className:"chat-capacity-dialog-actions",children:t.jsx("button",{ref:h,type:"button",className:"chat-capacity-cancel",onClick:l,children:"Keep editing"})})]})})},Or=()=>{var Ve,Ge,$e,Qe,ze,Je,Xe,Ze;const{sessionId:l}=Ct(),h=Et(),[u,k]=Ot(),{user:f,isLoading:O}=Tt(),{toast:R}=jt(),w=Nt(),x=It(),v=Pt({queryKey:["chatAvailability"],queryFn:()=>At.getChatAvailability(),refetchInterval:3e4,retry:!1,enabled:_e()&&x}),S=((Ve=v.data)==null?void 0:Ve.status)==="paused",[T,I]=i.useState([]),[ue,$]=i.useState(!1),[he,P]=i.useState(""),[C,_]=i.useState(()=>l?{id:l,status:"loading"}:null),[Re,se]=i.useState(0),xe=i.useRef(Ut()),N=i.useRef(u.get("model")||((Ge=xe.current)==null?void 0:Ge.model)),[U,ke]=i.useState(qt),[H,W]=i.useState(N.current||Bt),E=(($e=U.find(e=>e.id===H))==null?void 0:$e.provider)??"huggingface",Se=Zt(!!(f&&E==="openrouter")),fe=i.useRef(E);fe.current=E;const[Oe,q]=i.useState(""),[G,Y]=i.useState(""),[Q,ae]=i.useState(()=>{var e,n;return((e=u.get("q"))==null?void 0:e.trim())||((n=xe.current)==null?void 0:n.prompt)||""}),re=i.useRef(!1),ie=i.useRef(!1),pe=i.useRef(!1),[Te,oe]=i.useState(null),[je,ce]=i.useState(null),[Ce,me]=i.useState(""),[z,r]=i.useState(null),[c,a]=i.useState(()=>typeof window>"u"||window.innerWidth>900),[d,p]=i.useState(!1),[m,g]=i.useState(!1),[y,A]=i.useState(""),M=i.useRef(new Set),J=i.useRef(!1),D=i.useRef(l),B=i.useRef(null),le=i.useRef(null),X=i.useRef(null);D.current=l;const K=i.useCallback(async()=>{if(!f)return;const e=!J.current;e&&$(!0);try{const n=await Ht();I(s=>{const b=B.current,j=b?s.find(be=>be.id===b):void 0;if(!j)return n;const V=n.find(be=>be.id===b);return[V?{...V,title:j.title,is_busy:!0}:j,...n.filter(be=>be.id!==b)]}),J.current=!0,P("")}catch(n){P(n instanceof Error?n.message:"Could not load chats")}finally{e&&$(!1)}},[f]),o=hr({sessionId:l??null,initialModel:H,onSessionId:e=>{B.current=e;const n=e!==D.current,s=D.current===le.current,b=new Date().toISOString();I(j=>j.some(V=>V.id===e)?j.map(V=>V.id===e?{...V,is_busy:!0}:V):[{id:e,title:"New chat",selected_model:H,created_at:b,updated_at:b,message_count:1,is_busy:!0},...j]),n&&s&&q("New chat"),s&&(X.current=e,_({id:e,status:"loaded"}),n&&h(`/chat/${e}`,{replace:!0}))},onTitle:e=>{const n=B.current??D.current;n&&!M.current.has(n)&&(n===D.current&&q(e),I(s=>s.map(b=>b.id===n?{...b,title:e}:b)))},onSettled:e=>{e&&I(n=>n.map(s=>s.id===e?{...s,is_busy:!1}:s)),B.current=null,le.current=null,K()},onProviderTerminal:()=>{fe.current==="openrouter"&&(w.invalidateQueries({queryKey:er}),w.invalidateQueries({queryKey:tr}))},onInterrupted:e=>{Y(e)}});o.load;const L=o.send;i.useEffect(()=>{o.capacityRequest&&Y(o.capacityRequest.question)},[o.capacityRequest]),i.useEffect(()=>{o.busy&&oe(null)},[o.busy]);const Z=i.useCallback(e=>{sessionStorage.setItem(tt,e),sessionStorage.setItem(rt,H),sessionStorage.setItem(nt,"1"),window.location.href=Lt("/chat",!0)},[H]),ge=i.useCallback(async e=>{if(!f){Z(e);return}if(E==="huggingface"&&!ie.current){if(pe.current)return;pe.current=!0;try{const s=await fetch(Me("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not check Hugging Face authorization.");if(!(await s.json()).connected){Z(e);return}ie.current=!0}catch(s){Y(e),P(s instanceof Error?s.message:"Could not check Hugging Face authorization.");return}finally{pe.current=!1}}const n=D.current??null;L(e)&&(le.current=n,B.current=n,Wt(),Y(""))},[Z,E,L,f]);i.useEffect(()=>{if(O||!f)return;const e=sessionStorage.getItem(rt);e&&W(e),K(),Kt().then(b=>{if(ke(b.items),!D.current){const j=N.current||e;W(j&&b.items.some(V=>V.id===j)?j:b.default_model)}});const n=sessionStorage.getItem(tt),s=sessionStorage.getItem(nt)==="1";n&&(s?ae(n):Y(n))},[O,K,f]),i.useEffect(()=>{if(!l){X.current!==null&&(X.current=null,o.reset()),_(null);return}if(X.current===l||(_(n=>(n==null?void 0:n.id)===l&&n.status==="loading"?n:{id:l,status:"loading"}),O||!f))return;let e=!1;return P(""),Ye(l).then(n=>{e||(o.load(mt(n)),W(n.selected_model),q(n.title),X.current=l,_({id:l,status:"loaded"}))}).catch(n=>{if(e)return;const s=n instanceof Error?n.message:"Chat not found";o.reset(),P(s),_({id:l,status:"error",error:s})}),()=>{e=!0}},[O,l,f,o.busy,Re]),i.useEffect(()=>{var b;const e=(b=u.get("q"))==null?void 0:b.trim();if(!e)return;re.current=!1;const n=u.get("model");n&&W(n),ae(e);const s=new URLSearchParams(u);s.delete("q"),s.delete("model"),k(s,{replace:!0})},[u,k]),i.useEffect(()=>{if(O||o.busy||!Q||re.current)return;const e=window.setTimeout(()=>{if(re.current)return;re.current=!0;const n=Q;ae(""),ge(n)},0);return()=>window.clearTimeout(e)},[O,o.busy,Q,ge]),i.useEffect(()=>{const e=()=>{!f||o.busy||K()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[o.busy,K,f]),i.useEffect(()=>{if(!z)return;const e=()=>r(null),n=s=>{s.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",n),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",n)}},[z]);const Fe=()=>{B.current=null,o.reset(),Y(""),q(""),h("/chat")},Ue=async e=>{const n=Ce.trim();if(n)try{const s=await it(e,{title:n});M.current.add(e),e===l&&q(s.title),I(b=>b.map(j=>j.id===e?s:j)),ce(null)}catch(s){P(s instanceof Error?s.message:"Rename failed")}},bt=async e=>{const n=e===l&&o.busy;if(window.confirm(n?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){n&&o.stop();try{if(n){const s=Date.now()+3e3;for(;(await Ye(e)).is_busy;){if(Date.now()>=s)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(j=>window.setTimeout(j,150))}}await Qt(e),e===l&&Fe(),await K()}catch(s){P(s instanceof Error?s.message:"Delete failed")}}},wt=async()=>{var e;if(!m){g(!0);try{const n=await Jt();if(await K(),n.archived_count===0){R({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const s=((e=[...o.messages].reverse().find(b=>b.role==="user"))==null?void 0:e.text)??"";o.reset(),Y(s),q(""),R({title:`${n.archived_count} ${n.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(n){R({variant:"destructive",title:"Could not archive old chats",description:n instanceof Error?n.message:"Try again."})}finally{g(!1)}}},qe=async e=>{const n=H;if(W(e),!!l)try{const s=await it(l,{selected_model:e});I(b=>b.map(j=>j.id===l?{...j,selected_model:s.selected_model}:j)),P("")}catch(s){W(n),P(s instanceof Error?s.message:"Model change failed")}},vt=async()=>{var e;if(!(!l||o.busy||d)){p(!0);try{const n=await zt(l),s=new URL(n.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(s),R({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{A(s)}}catch(n){const s=n instanceof Error?n.message:"Could not share this conversation";P(s),R({variant:"destructive",title:"Share failed",description:s})}finally{p(!1)}}},[_t,Rt]=i.useState(60);i.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const n=()=>Rt(e.offsetHeight);n();const s=new ResizeObserver(n);return s.observe(e),()=>s.disconnect()},[]);const Ne=i.useRef(null),Ee=i.useRef(null),ye=i.useRef(null);i.useEffect(()=>{o.busy||(ye.current=null)},[o.busy]);const xt=(e,n)=>{var s;Ee.current=((s=Ne.current)==null?void 0:s.scrollTop)??null,o.toggleBlock(e,n)};i.useLayoutEffect(()=>{const e=Ne.current;if(e){if(Ee.current!==null){e.scrollTop=Ee.current,Ee.current=null;return}if(ye.current){const n=Array.from(e.querySelectorAll("[data-message-id]")).find(s=>s.dataset.messageId===ye.current);if(n){const s=e.getBoundingClientRect(),b=n.getBoundingClientRect();e.scrollTop+=b.top-s.top-24;return}}e.scrollTop=e.scrollHeight}},[o.messages]);const de=T.find(e=>e.id===l),Be=o.messages.filter(e=>e.role==="user"),Le=(Qe=Be[0])==null?void 0:Qe.id,kt=(ze=Be.at(-1))==null?void 0:ze.id,Ie=o.messages.length===0,He=(Je=[...o.messages].reverse().find(e=>e.role==="assistant"&&e.errorCode))==null?void 0:Je.errorCode,We=He==="openrouter_unavailable"||He==="openrouter_monthly_budget_exhausted",De=(C==null?void 0:C.id)===l,Ae=!!(l&&(O||f&&(!De||(C==null?void 0:C.status)==="loading"))),Ke=De&&(C==null?void 0:C.status)==="error"?C.error:void 0;return t.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${_t}px)`},children:[t.jsxs("aside",{className:`chat-sidebar${c?"":" chat-sidebar-closed"}`,children:[t.jsxs("div",{className:"chat-sidebar-top",children:[t.jsxs("button",{type:"button",className:"chat-new-chat",onClick:Fe,children:[t.jsx(Vt,{})," New chat"]}),t.jsx("button",{type:"button",className:"icon-btn",onClick:()=>a(!1),title:"Collapse sidebar",children:t.jsx(st,{})})]}),t.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[ue&&t.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!ue&&he&&t.jsx("div",{className:"chat-sessions-empty",children:he}),!ue&&!he&&T.length===0&&t.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Gt(T).map(e=>t.jsxs("div",{className:"chat-session-group",children:[t.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(n=>t.jsxs("div",{className:`chat-session${n.id===l?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>h(`/chat/${n.id}`),onKeyDown:s=>{if(s.key==="Enter"&&h(`/chat/${n.id}`),s.key==="F2"&&(ce(n.id),me(n.title)),s.key==="ContextMenu"||s.shiftKey&&s.key==="F10"){s.preventDefault();const b=s.currentTarget.getBoundingClientRect();r({id:n.id,x:b.right-150,y:b.bottom})}},onContextMenu:s=>{s.preventDefault(),r({id:n.id,x:s.clientX,y:s.clientY})},children:[je===n.id?t.jsx("input",{className:"chat-session-title-input",value:Ce,autoFocus:!0,maxLength:80,onClick:s=>s.stopPropagation(),onChange:s=>me(s.target.value),onBlur:()=>void Ue(n.id),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"&&Ue(n.id),s.key==="Escape"&&ce(null)}}):t.jsx("span",{className:"chat-session-title",children:n.title}),t.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:s=>{s.stopPropagation();const b=s.currentTarget.getBoundingClientRect();r({id:n.id,x:b.right-150,y:b.bottom})},children:"⋯"}),t.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:s=>{s.stopPropagation(),bt(n.id)},children:t.jsx($t,{})})]},n.id))]},e.label))]}),z&&t.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:z.x,top:z.y},onClick:e=>e.stopPropagation(),children:t.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=T.find(n=>n.id===z.id);e&&(ce(e.id),me(e.title)),r(null)},children:"Rename chat"})})]}),t.jsxs("section",{className:"chat-main",children:[t.jsxs("div",{className:"chat-topbar",children:[!c&&t.jsx("button",{type:"button",className:"icon-btn",onClick:()=>a(!0),title:"Open sidebar",children:t.jsx(st,{})}),t.jsx("span",{className:"chat-topbar-title",children:Ae?(de==null?void 0:de.title)||"":Oe||(de==null?void 0:de.title)||(Ie?"":"New chat")}),x&&t.jsx("span",{className:"chat-staging-badge",children:"Staging"}),l&&De&&(C==null?void 0:C.status)==="loaded"&&!Ie&&t.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void vt(),disabled:o.busy||d||Ae,"aria-label":"Share conversation",children:[d?t.jsx(at,{}):t.jsx(sr,{"aria-hidden":"true"}),t.jsx("span",{children:"Share"})]})]}),Ae?t.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[t.jsx(at,{}),t.jsx("span",{children:"Loading conversation…"})]}):Ke?t.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[t.jsx("p",{children:Ke}),t.jsx("button",{type:"button",onClick:()=>{_({id:l,status:"loading"}),se(e=>e+1)},children:"Try again"})]}):Ie?t.jsx("div",{className:"chat-empty",children:t.jsxs("div",{className:"chat-empty-inner",children:[t.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),t.jsxs("h1",{className:"chat-empty-title",children:["Ask ",t.jsx("em",{children:"Papers With Code"})]}),t.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),x&&t.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),t.jsx(ft,{provider:E}),t.jsx(pt,{enabled:E==="openrouter",fallbackEnabled:!!((Xe=Se.data)!=null&&Xe.fallback_enabled),byokExpected:We}),S&&t.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),t.jsx(et,{onSend:ge,busy:o.busy,onStop:o.stop,autoFocus:!0,draft:G,onDraftChange:Y,models:U,selectedModel:H,onModelChange:e=>void qe(e),disabled:S,describedBy:S?"chat-paused-description":void 0}),t.jsx("div",{className:"chat-examples",children:Xt.map(e=>t.jsx("button",{type:"button",className:"chat-example",disabled:S,onClick:()=>ge(e),children:e},e))})]})}):t.jsxs(t.Fragment,{children:[o.sessionError&&t.jsx("div",{className:"chat-session-error",role:"alert",children:o.sessionError}),t.jsx("div",{className:"chat-conversation",ref:Ne,children:t.jsx("div",{className:"chat-conversation-inner",children:o.messages.map(e=>e.role==="user"?t.jsx(Yt,{id:e.id,text:e.text??"",isInitial:e.id===Le,editingAllowed:!o.busy&&!!e.revision,editing:Te===e.id,editNotice:e.id===Le?"Sending will start a new chat.":e.id===kt?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>oe(e.id),onCancel:()=>oe(null),onResend:n=>{e.id!==Le&&(ye.current=e.id);const s=o.editAndResend(e.id,n);return s?oe(null):ye.current=null,s}},e.id):t.jsx(Mt,{msg:e,papers:o.papers,onToggleBlock:xt,onArchiveOldChats:()=>void wt(),archivePending:m},e.id))})}),t.jsx("div",{className:"chat-composer-wrap",children:t.jsxs("div",{className:"chat-composer-inner",children:[t.jsx(ft,{provider:E}),t.jsx(pt,{enabled:E==="openrouter",fallbackEnabled:!!((Ze=Se.data)!=null&&Ze.fallback_enabled),byokExpected:We}),S&&t.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),t.jsx(et,{onSend:ge,busy:o.busy,onStop:o.stop,placeholder:G?"Edit and send again…":"Ask a follow-up…",draft:G,onDraftChange:Y,models:U,selectedModel:H,onModelChange:e=>void qe(e),disabled:S,describedBy:S?"chat-paused-description":void 0}),t.jsx("div",{className:"chat-composer-foot",children:_e()?t.jsxs(t.Fragment,{children:[E==="openrouter"?t.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",t.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):t.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",t.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),t.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):t.jsx(t.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),y&&t.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>A(""),children:t.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[t.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),t.jsx("p",{children:"It could not be copied automatically. Copy this link manually:"}),t.jsx("input",{readOnly:!0,value:y,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),t.jsx("button",{type:"button",onClick:()=>A(""),children:"Close"})]})}),o.capacityRequest&&t.jsx(pr,{retryAt:o.capacityRequest.retryAt,onCancel:o.cancelCapacity,onRetry:()=>{o.retryCapacity()&&Y("")}}),o.disabledRequest&&t.jsx(mr,{onClose:()=>{var e;Y(((e=o.disabledRequest)==null?void 0:e.question)??G),o.dismissDisabled(),v.refetch()}})]})};export{pr as ChatCapacityDialog,mr as ChatDisabledDialog,Or as default};
assets/ChatView-BiviZbfg.js DELETED
@@ -1,16 +0,0 @@
1
- import{c as Rt,d as Pe,r as o,j as n,e as xt,u as St,a as kt,f as Ot,g as Ct,h as Tt,k as Et,l as jt,X as Lt}from"./index-Bo5_2OqZ.js";import{C as Je,U as Nt,A as It}from"./ChatMessage-DAiy1xqv.js";import{c as At,g as De,t as ht,r as Dt,F as Pt,D as Mt,l as Yt,C as Xe,a as Ze,b as et,d as Ft,e as Ut,P as qt,f as tt,h as Bt,T as Ht,S as nt,u as rt,i as Wt,j as Vt,k as Gt}from"./chatSessions-Dz4Iu-O1.js";import{S as Kt}from"./chatPrompts-CDY3UGU1.js";import{u as $t,O as zt,a as Qt,b as Jt,r as Xt}from"./openrouter-C1zb8Waa.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DrtqDSb0.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./useQuery-Bh9FZQpL.js";import"./useBaseQuery-B8T7kRNC.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 Zt=Rt("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),q=(l,d)=>new Promise(h=>{const S=setTimeout(f,l);function f(){d==null||d.removeEventListener("abort",f),clearTimeout(S),h()}d==null||d.addEventListener("abort",f)}),te=l=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...l}),ne={name:"Object Detection",slug:"object-detection"},ae={name:"Real-Time Object Detection",slug:"real-time-object-detection"},en={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:te({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[ne,ae],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:te({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[ne,ae],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:te({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[ne,ae],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:te({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[ne,ae],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:te({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[ne,ae],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:te({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[ne,ae],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:te({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},ne],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:te({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[ne,ae],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},ft=l=>l.map(d=>en[d]),st=ft(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),at=ft(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),it="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",ot="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",ct=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve.
7
-
8
- **At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency.
9
-
10
- **At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost.
11
-
12
- **My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,tn=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*nn(l,d){const h=()=>(d==null?void 0:d.aborted)===!0,S=l.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await q(350,d),!h()){yield{type:"reasoning_start"};for(let f=0;f<it.length;f+=6){if(await q(14,d),h())return;yield{type:"reasoning_delta",text:it.slice(f,f+6)}}if(await q(400,d),!h()&&(yield{type:"reasoning_end"},await q(300,d),!h()&&(yield{type:"tool_call",id:"call_1",name:"search_papers",args:{query:S,top_k:8}},await q(1100,d),!h()&&(yield{type:"tool_result",id:"call_1",hits:st.length,took_ms:214,results:st},await q(350,d),!h())))){yield{type:"reasoning_start"};for(let f=0;f<ot.length;f+=6){if(await q(14,d),h())return;yield{type:"reasoning_delta",text:ot.slice(f,f+6)}}if(await q(350,d),!h()&&(yield{type:"reasoning_end"},await q(300,d),!h()&&(yield{type:"tool_call",id:"call_2",name:"search_papers",args:{query:"RT-DETR vs YOLOv12 COCO mAP latency FPS T4 TensorRT comparison",top_k:5}},await q(900,d),!h()&&(yield{type:"tool_result",id:"call_2",hits:at.length,took_ms:176,results:at},await q(400,d),!h())))){for(let f=0;f<ct.length;f+=4){if(await q(11,d),h())return;yield{type:"answer_delta",text:ct.slice(f,f+4)}}yield{type:"done",followups:tn,finish_reason:"success"}}}}}const ke=()=>{const d=String("0").trim().toLowerCase();return d==="1"||d==="true"||d==="yes"};class Se extends Error{constructor(d,h,S,f){super(d),this.code=h,this.status=S,this.retryAfterSeconds=f,this.name="ChatStreamError"}}function rn(l,d){if(ke())try{fetch(Pe(`/api/v1/chat/latency/${encodeURIComponent(l)}`),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",keepalive:!0,body:JSON.stringify(d)}).catch(()=>{})}catch{}}function sn(l,d={}){return ke()?an(l,d.signal):nn(l.message,d.signal)}async function*an(l,d){const h=await fetch(Pe("/api/v1/chat/stream"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"include",body:JSON.stringify(l),signal:d});if(!h.ok||!h.body){const R=await h.json().catch(()=>null),v=R==null?void 0:R.detail,_=h.status===403&&!v,w=Number(h.headers.get("Retry-After")),j=Number.isFinite(w)&&w>=0?Math.min(300,Math.ceil(w)):void 0;throw new Se(_?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(v==null?void 0:v.message)||v||`Chat stream failed (${h.status})`,(v==null?void 0:v.code)||(_?"staging_access_required":void 0),h.status,j)}const S=h.body.getReader(),f=new TextDecoder;let k="";try{for(;;){const{done:R,value:v}=await S.read();if(R)break;k+=f.decode(v,{stream:!0});let _;for(;(_=k.indexOf(`
13
-
14
- `))!==-1;){const w=k.slice(0,_);k=k.slice(_+2);const j=w.split(`
15
- `).filter(L=>L.startsWith("data:")).map(L=>L.slice(5).trimStart()).join(`
16
- `);!j||j==="[DONE]"||(yield JSON.parse(j))}}}finally{S.releaseLock()}}const mt="Preparing research workspace…",on=750;function be(l){if(l.status!==mt)return l;const{status:d,...h}=l;return h}function Ae(l,d){for(let h=l.length-1;h>=0;h-=1)if(d(l[h]))return h;return-1}function cn(l){const[d,h]=o.useState([]),[S,f]=o.useState(!1),[k,R]=o.useState(""),v=o.useRef(!1),_=o.useRef(null),w=o.useRef(null),j=o.useRef("cleared"),L=o.useRef(null),M=o.useRef(null),[F,C]=o.useState(null),I=o.useRef([]),x=o.useRef(l),we=o.useRef(""),re=o.useRef(""),ve=o.useRef(0),T=o.useRef(0),K=o.useRef(l.sessionId),B=o.useRef(l.sessionId);B.current!==l.sessionId&&(B.current=l.sessionId,K.current!==l.sessionId&&(T.current+=1,L.current=null)),x.current=l,I.current=d,o.useEffect(()=>()=>{var t;w.current!==null&&window.clearTimeout(w.current),(t=_.current)==null||t.abort(),M.current=null},[]),o.useEffect(()=>{v.current||(K.current=l.sessionId)},[l.sessionId]);const $=o.useMemo(()=>{const t={};for(const i of d)for(const a of i.blocks??[])if(a.kind==="tool")for(const u of a.results??[])t[u.route_id]=u;return t},[d]),A=()=>`m${++ve.current}_${Date.now().toString(36)}`,D=t=>h(i=>{if(!i.length)return i;const a=i.slice();return a[a.length-1]=t(a[a.length-1]),a}),_e=t=>D(i=>{const a=be(i);return{...a,blocks:[...a.blocks??[],t]}}),he=(t,i)=>D(a=>{const u=be(a);return{...u,blocks:(u.blocks??[]).map((m,p,g)=>t(m,p,g)?i(m):m)}}),Oe=t=>(i,a,u)=>i.kind===t&&Ae(u,m=>m.kind===t)===a,H=t=>{if(_.current!==t||(w.current!==null&&(window.clearTimeout(w.current),w.current=null),j.current==="cleared"))return;const i=j.current==="shown";j.current="cleared",i&&D(be)},z=(t,i)=>{t.requestId&&rn(t.requestId,i)},U=(t,i)=>{const a=L.current;!a||a.controller!==t||(a.requestId=i,a.streamStartReported||(a.streamStartReported=!0,z(a,{submission_to_stream_start_ms:Math.max(0,performance.now()-a.submittedAt)})),a.firstVisibleAt!==void 0&&!a.firstVisibleReported&&(a.firstVisibleReported=!0,z(a,{submission_to_first_visible_delta_ms:Math.max(0,a.firstVisibleAt-a.submittedAt)})))},Q=(t,i)=>{const a=L.current;!a||a.controller!==t||a.terminalReported||(a.terminalReported=!0,z(a,{terminal_classification:i}))};o.useLayoutEffect(()=>{const t=L.current;if(!t||t.firstVisibleAt!==void 0)return;const i=d.at(-1);(i==null?void 0:i.role)!=="assistant"||!(i.blocks??[]).some(u=>u.kind==="tool"||u.kind==="reasoning"&&!!u.text.trim()||u.kind==="answer"&&!!u.text.trim())||(t.firstVisibleAt=performance.now(),t.requestId&&!t.firstVisibleReported&&(t.firstVisibleReported=!0,z(t,{submission_to_first_visible_delta_ms:Math.max(0,t.firstVisibleAt-t.submittedAt)})))},[d]);const ie=t=>{switch(t.type){case"stream_start":t.session_id&&(K.current=t.session_id,x.current.onSessionId(t.session_id));break;case"sandbox_start":case"sandbox_ready":case"workspace_ready":break;case"session_title_start":re.current="";break;case"session_title_delta":re.current+=t.text,x.current.onTitle(re.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":re.current=t.title,x.current.onTitle(t.title);break;case"reasoning_start":D(i=>{const a=be(i);return{...a,blocks:[...(a.blocks??[]).map(u=>u.kind==="reasoning"&&u.active?{...u,active:!1,open:!1}:u),{kind:"reasoning",text:"",active:!0,open:!0}]}});break;case"reasoning_delta":he(Oe("reasoning"),i=>i.kind==="reasoning"?{...i,text:i.text+t.text}:i);break;case"reasoning_end":D(i=>{const a=i.blocks??[],u=Ae(a,g=>g.kind==="reasoning"&&g.active);if(u<0)return i;const m=a[u];if(m.kind!=="reasoning")return i;const p=a[u-1];return(p==null?void 0:p.kind)==="reasoning"&&p.text===m.text?{...i,blocks:a.filter((g,y)=>y!==u)}:{...i,blocks:a.map((g,y)=>y===u?{...m,active:!1,open:!1}:g)}});break;case"tool_call":_e({kind:"tool",id:t.id,name:t.name,args:t.args,status:"running",open:!1});break;case"tool_result":he(i=>i.kind==="tool"&&i.id===t.id,i=>i.kind==="tool"?t.status?{...i,schema_version:2,status:t.status,took_ms:t.took_ms,content:t.content,metadata:t.metadata,open:t.status!=="success"}:{...i,status:"done",hits:t.hits,took_ms:t.took_ms,results:t.results}:i);break;case"answer_delta":D(i=>{const a=be(i),u=a.blocks??[],m=u.at(-1);return(m==null?void 0:m.kind)==="answer"&&!m.done?{...a,blocks:[...u.slice(0,-1),{...m,text:m.text+t.text}]}:{...a,blocks:[...u,{kind:"answer",text:t.text,done:!1}]}});break;case"done":D(i=>({...i,streaming:!1,followups:t.followups,finishReason:t.finish_reason,citations:t.citations,blocks:(i.blocks??[]).map(a=>a.kind==="answer"?{...a,done:!0}:a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break;case"error":D(i=>({...i,streaming:!1,error:t.message,errorCode:t.code,blocks:(i.blocks??[]).map(a=>a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break}},se=async(t,i)=>{const a=await De(t),u=ht(a);return T.current!==i?null:(h(u),I.current=u,u)},oe=(t,i,a,u,m)=>{const p=++T.current;v.current=!0;const g=new AbortController;return _.current=g,we.current=t,K.current=i.session_id,R(""),h(a),f(!0),L.current={controller:g,submittedAt:performance.now(),streamStartReported:!1,firstVisibleReported:!1,terminalReported:!1},w.current!==null&&window.clearTimeout(w.current),j.current="armed",w.current=window.setTimeout(()=>{w.current=null,!(j.current!=="armed"||_.current!==g||g.signal.aborted||T.current!==p)&&(j.current="shown",D(y=>{var P;return y.role==="assistant"&&y.streaming&&(((P=y.blocks)==null?void 0:P.length)??0)===0&&!y.error?{...y,status:mt}:y}))},on),(async()=>{var ue,Z,V;let y=!1,P=!1,Y=!1,X=!1,N=!1,W=!1;try{for await(const c of sn(i,{signal:g.signal})){c.type==="stream_start"&&(y=!0,P=c.provider_execution!==!1,U(g,c.request_id)),(c.type==="workspace_ready"||c.type==="reasoning_start"||c.type==="reasoning_delta"||c.type==="tool_call"||c.type==="answer_delta"||c.type==="done"||c.type==="error")&&H(g),(c.type==="done"||c.type==="error")&&(X=!0,N=c.type==="error",Q(g,c.type==="error"?"error":"complete"),c.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(c.code??"")&&(Y=!0,x.current.onInterrupted(t)));const E=T.current===p;!g.signal.aborted&&(E||c.type==="stream_start"||c.type==="session_title_start"||c.type==="session_title_delta"||c.type==="session_title_done")&&ie(c)}}catch(c){if(N=!0,!g.signal.aborted){if(H(g),c instanceof Se&&c.code==="chat_capacity"){W=!0;const E=c.retryAfterSeconds??5,ee={question:t,request:i,optimistic:a,original:u,edit:m,retryAfterSeconds:E,retryAt:Date.now()+E*1e3};M.current=ee,C({question:t,retryAt:ee.retryAt,retryAfterSeconds:E}),T.current===p&&(h(u),I.current=u,R(""))}else Q(g,"network_error"),c instanceof Se&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(c.code??"")&&(Y=!0,x.current.onInterrupted(t));!W&&T.current===p&&ie({type:"error",message:c instanceof Error?c.message:"The assistant stream failed.",code:c instanceof Se?c.code:void 0})}}finally{if(_.current===g){if(H(g),!X&&!g.signal.aborted&&Q(g,"network_error"),v.current=!1,f(!1),W)x.current.onSettled(i.session_id);else if(!g.signal.aborted){(y&&P||Y)&&((Z=(ue=x.current).onProviderTerminal)==null||Z.call(ue));const c=K.current;if(m&&!y)T.current===p&&(h(m.snapshot),I.current=m.snapshot,R("Couldn’t resend this message. Your original conversation was restored."));else if(c){T.current===p&&m&&!m.first&&(N||!X)&&(h(m.snapshot),I.current=m.snapshot);try{const E=await se(c,p);E&&m&&!m.first&&E.some(ee=>ee.id===m.targetId)&&R("Couldn’t resend this message. Your original conversation was restored.")}catch{T.current===p&&D(E=>E.streaming?{...E,streaming:!1}:E)}}else T.current===p&&D(E=>E.streaming?{...E,streaming:!1}:E);x.current.onSettled(c)}((V=L.current)==null?void 0:V.controller)===g&&(L.current=null)}}})(),!0},fe=o.useCallback(t=>{const i=t.trim();if(!i||i.length>8e3||v.current||M.current)return!1;const a=I.current,u=[...a].reverse().find(Y=>Y.role==="user"),m=u!=null&&u.status&&u.status!=="complete"&&u.revision?{replace_message_id:u.id,prior_revision:u.revision}:null,p={id:A(),role:"user",text:i},g={id:A(),role:"assistant",streaming:!0,blocks:[]},y=m&&u?Ae(a,Y=>Y.id===u.id):-1,P=y<0?[...a,p,g]:[...a.slice(0,y),p,g];return oe(i,{message:i,session_id:x.current.sessionId,client_message_id:crypto.randomUUID(),...!x.current.sessionId&&x.current.initialModel?{initial_model:x.current.initialModel}:{},...m??{}},P,a)},[]),Ce=o.useCallback((t,i)=>{const a=i.trim();if(!a||a.length>8e3||v.current||M.current)return!1;const u=I.current.slice(),m=u.findIndex(N=>N.id===t&&N.role==="user");if(m<0)return!1;const p=u[m],g=u.findIndex(N=>N.role==="user"),y=m===g;if(!y&&(!x.current.sessionId||!p.revision))return!1;const P={id:p.id,role:"user",text:a,revision:y?void 0:p.revision+1,status:"generating"},Y={id:A(),role:"assistant",streaming:!0,blocks:[]},X=y?[P,Y]:[...u.slice(0,m),P,Y];return oe(a,{message:a,session_id:y?null:x.current.sessionId,client_message_id:crypto.randomUUID(),...y&&x.current.initialModel?{initial_model:x.current.initialModel}:{},...y?{}:{replace_message_id:p.id,prior_revision:p.revision}},X,u,{targetId:p.id,snapshot:u,first:y})},[]),ce=o.useCallback(()=>{M.current=null,C(null)},[]),Te=o.useCallback(()=>{const t=M.current;return!t||Date.now()<t.retryAt||v.current?!1:(M.current=null,C(null),oe(t.question,t.request,t.optimistic,t.original,t.edit))},[]),le=o.useCallback(()=>{var u;if(!_.current)return;const t=_.current;H(t),Q(t,"stopped"),t.abort(),_.current=null,((u=L.current)==null?void 0:u.controller)===t&&(L.current=null),v.current=!1,f(!1),h(m=>{const p=m.at(-1);if((p==null?void 0:p.role)!=="assistant")return m;const g=(p.blocks??[]).flatMap(y=>y.kind==="tool"&&y.status==="running"?[]:y.kind==="reasoning"&&y.active?[]:y.kind==="answer"?[{...y,done:!0}]:[y]);return[...m.slice(0,-1),{...p,blocks:g,streaming:!1,finishReason:"stopped"}]}),x.current.onInterrupted(we.current);const i=K.current;i&&At(i).catch(()=>{});const a=++T.current;window.setTimeout(()=>{i&&T.current===a?se(i,a).catch(()=>{}).finally(()=>x.current.onSettled(i)):i||x.current.onSettled(null)},450)},[]),Re=o.useCallback((t,i)=>h(a=>a.map(u=>{var m;return u.id!==t?u:{...u,blocks:(m=u.blocks)==null?void 0:m.map((p,g)=>g===i&&(p.kind==="reasoning"||p.kind==="tool")?{...p,open:!p.open}:p)}})),[]),me=o.useCallback(()=>{var t;T.current+=1,w.current!==null&&(window.clearTimeout(w.current),w.current=null),j.current="cleared",(t=_.current)==null||t.abort(),_.current=null,L.current=null,M.current=null,C(null),v.current=!1,K.current=null,h([]),f(!1),R("")},[]),J=o.useCallback(t=>{var i;T.current+=1,w.current!==null&&(window.clearTimeout(w.current),w.current=null),j.current="cleared",L.current=null,M.current=null,C(null),v.current||((i=_.current)==null||i.abort(),_.current=null),h(t),v.current||f(!1),R("")},[]);return{messages:d,busy:S,papers:$,sessionError:k,capacityRequest:F,send:fe,editAndResend:Ce,retryCapacity:Te,cancelCapacity:ce,stop:le,toggleBlock:Re,reset:me,load:J}}const ln="https://huggingface.co/settings/inference-providers",lt="pwc.chat.billing-notice-dismissed.v1",ut=({provider:l})=>{const[d,h]=o.useState(()=>localStorage.getItem(lt)==="1");return!ke()||d||l!=="huggingface"?null:n.jsxs("div",{className:"chat-billing-notice",role:"note",children:[n.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),n.jsxs("div",{className:"chat-billing-notice-actions",children:[n.jsx("a",{href:"/settings",children:"Review billing"}),n.jsx("a",{href:ln,target:"_blank",rel:"noreferrer",children:"Review usage"}),n.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(lt,"1"),h(!0)},children:n.jsx(Lt,{size:15,"aria-hidden":"true"})})]})]})},dt=({enabled:l,fallbackEnabled:d,byokExpected:h})=>{const S=Jt(l);if(!l||!S.data)return null;const f=S.data,k=Xt(f.resets_at);return n.jsxs("div",{className:"chat-openrouter-usage",role:"status",children:[n.jsxs("span",{children:[n.jsxs("strong",{children:[f.remaining_percent,"% left"]})," this month · resets ",k.local]}),(f.remaining_percent===0||h)&&n.jsx("span",{children:d?"Your OpenRouter account will be billed on this explicit send.":n.jsxs(n.Fragment,{children:[n.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own key in Settings"})," to continue."]})})]})},un=({retryAt:l,onRetry:d,onCancel:h})=>{const[S,f]=o.useState(()=>Math.max(0,Math.ceil((l-Date.now())/1e3))),k=o.useRef(null);return o.useEffect(()=>{var w;const R=document.activeElement instanceof HTMLElement?document.activeElement:null;(w=k.current)==null||w.focus();const v=()=>f(Math.max(0,Math.ceil((l-Date.now())/1e3)));v();const _=window.setInterval(v,250);return()=>{window.clearInterval(_),R==null||R.focus()}},[l]),n.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:n.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:R=>{R.key==="Escape"&&(R.preventDefault(),h())},children:[n.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),n.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),n.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:S>0?`Try again available in ${S} second${S===1?"":"s"}.`:"You can try again now."}),n.jsxs("div",{className:"chat-capacity-dialog-actions",children:[n.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:k,onClick:h,children:"Cancel"}),n.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:S>0,onClick:d,children:"Try again"})]})]})})},xn=()=>{var We,Ve,Ge,Ke,$e,ze,Qe;const{sessionId:l}=xt(),d=St(),[h,S]=kt(),{user:f,isLoading:k}=Ot(),{toast:R}=Ct(),v=Tt(),[_,w]=o.useState([]),[j,L]=o.useState(!1),[M,F]=o.useState(""),[C,I]=o.useState(()=>l?{id:l,status:"loading"}:null),[x,we]=o.useState(0),re=o.useRef(Dt()),ve=o.useRef(h.get("model")||((We=re.current)==null?void 0:We.model)),[T,K]=o.useState(Pt),[B,$]=o.useState(ve.current||Mt),A=((Ve=T.find(e=>e.id===B))==null?void 0:Ve.provider)??"huggingface",D=jt(),_e=$t(!!(f&&A==="openrouter")),he=o.useRef(A);he.current=A;const[Oe,H]=o.useState(""),[z,U]=o.useState(""),[Q,ie]=o.useState(()=>{var e,r;return((e=h.get("q"))==null?void 0:e.trim())||((r=re.current)==null?void 0:r.prompt)||""}),se=o.useRef(!1),oe=o.useRef(!1),fe=o.useRef(!1),[Ce,ce]=o.useState(null),[Te,le]=o.useState(null),[Re,me]=o.useState(""),[J,t]=o.useState(null),[i,a]=o.useState(()=>typeof window>"u"||window.innerWidth>900),[u,m]=o.useState(!1),[p,g]=o.useState(!1),[y,P]=o.useState(""),Y=o.useRef(new Set),X=o.useRef(!1),N=o.useRef(l),W=o.useRef(null),ue=o.useRef(null),Z=o.useRef(null);N.current=l;const V=o.useCallback(async()=>{if(!f)return;const e=!X.current;e&&L(!0);try{const r=await Yt();w(s=>{const b=W.current,O=b?s.find(ye=>ye.id===b):void 0;if(!O)return r;const G=r.find(ye=>ye.id===b);return[G?{...G,title:O.title,is_busy:!0}:O,...r.filter(ye=>ye.id!==b)]}),X.current=!0,F("")}catch(r){F(r instanceof Error?r.message:"Could not load chats")}finally{e&&L(!1)}},[f]),c=cn({sessionId:l??null,initialModel:B,onSessionId:e=>{W.current=e;const r=e!==N.current,s=N.current===ue.current,b=new Date().toISOString();w(O=>O.some(G=>G.id===e)?O.map(G=>G.id===e?{...G,is_busy:!0}:G):[{id:e,title:"New chat",selected_model:B,created_at:b,updated_at:b,message_count:1,is_busy:!0},...O]),r&&s&&H("New chat"),s&&(Z.current=e,I({id:e,status:"loaded"}),r&&d(`/chat/${e}`,{replace:!0}))},onTitle:e=>{const r=W.current??N.current;r&&!Y.current.has(r)&&(r===N.current&&H(e),w(s=>s.map(b=>b.id===r?{...b,title:e}:b)))},onSettled:e=>{e&&w(r=>r.map(s=>s.id===e?{...s,is_busy:!1}:s)),W.current=null,ue.current=null,V()},onProviderTerminal:()=>{he.current==="openrouter"&&(v.invalidateQueries({queryKey:zt}),v.invalidateQueries({queryKey:Qt}))},onInterrupted:e=>{U(e)}});c.load;const E=c.send;o.useEffect(()=>{c.capacityRequest&&U(c.capacityRequest.question)},[c.capacityRequest]),o.useEffect(()=>{c.busy&&ce(null)},[c.busy]);const ee=o.useCallback(e=>{sessionStorage.setItem(Xe,e),sessionStorage.setItem(Ze,B),sessionStorage.setItem(et,"1"),window.location.href=Et("/chat",!0)},[B]),pe=o.useCallback(async e=>{if(!f){ee(e);return}if(A==="huggingface"&&!oe.current){if(fe.current)return;fe.current=!0;try{const s=await fetch(Pe("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not check Hugging Face authorization.");if(!(await s.json()).connected){ee(e);return}oe.current=!0}catch(s){U(e),F(s instanceof Error?s.message:"Could not check Hugging Face authorization.");return}finally{fe.current=!1}}const r=N.current??null;E(e)&&(ue.current=r,W.current=r,Ft(),U(""))},[ee,A,E,f]);o.useEffect(()=>{if(k||!f)return;const e=sessionStorage.getItem(Ze);e&&$(e),V(),Ut().then(b=>{if(K(b.items),!N.current){const O=ve.current||e;$(O&&b.items.some(G=>G.id===O)?O:b.default_model)}});const r=sessionStorage.getItem(Xe),s=sessionStorage.getItem(et)==="1";r&&(s?ie(r):U(r))},[k,V,f]),o.useEffect(()=>{if(!l){Z.current!==null&&(Z.current=null,c.reset()),I(null);return}if(Z.current===l||(I(r=>(r==null?void 0:r.id)===l&&r.status==="loading"?r:{id:l,status:"loading"}),k||!f))return;let e=!1;return F(""),De(l).then(r=>{e||(c.load(ht(r)),$(r.selected_model),H(r.title),Z.current=l,I({id:l,status:"loaded"}))}).catch(r=>{if(e)return;const s=r instanceof Error?r.message:"Chat not found";c.reset(),F(s),I({id:l,status:"error",error:s})}),()=>{e=!0}},[k,l,f,c.busy,x]),o.useEffect(()=>{var b;const e=(b=h.get("q"))==null?void 0:b.trim();if(!e)return;se.current=!1;const r=h.get("model");r&&$(r),ie(e);const s=new URLSearchParams(h);s.delete("q"),s.delete("model"),S(s,{replace:!0})},[h,S]),o.useEffect(()=>{if(k||c.busy||!Q||se.current)return;const e=window.setTimeout(()=>{if(se.current)return;se.current=!0;const r=Q;ie(""),pe(r)},0);return()=>window.clearTimeout(e)},[k,c.busy,Q,pe]),o.useEffect(()=>{const e=()=>{!f||c.busy||V()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[c.busy,V,f]),o.useEffect(()=>{if(!J)return;const e=()=>t(null),r=s=>{s.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",r),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",r)}},[J]);const Me=()=>{W.current=null,c.reset(),U(""),H(""),d("/chat")},Ye=async e=>{const r=Re.trim();if(r)try{const s=await rt(e,{title:r});Y.current.add(e),e===l&&H(s.title),w(b=>b.map(O=>O.id===e?s:O)),le(null)}catch(s){F(s instanceof Error?s.message:"Rename failed")}},pt=async e=>{const r=e===l&&c.busy;if(window.confirm(r?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){r&&c.stop();try{if(r){const s=Date.now()+3e3;for(;(await De(e)).is_busy;){if(Date.now()>=s)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(O=>window.setTimeout(O,150))}}await Wt(e),e===l&&Me(),await V()}catch(s){F(s instanceof Error?s.message:"Delete failed")}}},gt=async()=>{var e;if(!p){g(!0);try{const r=await Gt();if(await V(),r.archived_count===0){R({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const s=((e=[...c.messages].reverse().find(b=>b.role==="user"))==null?void 0:e.text)??"";c.reset(),U(s),H(""),R({title:`${r.archived_count} ${r.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(r){R({variant:"destructive",title:"Could not archive old chats",description:r instanceof Error?r.message:"Try again."})}finally{g(!1)}}},Fe=async e=>{const r=B;if($(e),!!l)try{const s=await rt(l,{selected_model:e});w(b=>b.map(O=>O.id===l?{...O,selected_model:s.selected_model}:O)),F("")}catch(s){$(r),F(s instanceof Error?s.message:"Model change failed")}},yt=async()=>{var e;if(!(!l||c.busy||u)){m(!0);try{const r=await Vt(l),s=new URL(r.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(s),R({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{P(s)}}catch(r){const s=r instanceof Error?r.message:"Could not share this conversation";F(s),R({variant:"destructive",title:"Share failed",description:s})}finally{m(!1)}}},[bt,wt]=o.useState(60);o.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const r=()=>wt(e.offsetHeight);r();const s=new ResizeObserver(r);return s.observe(e),()=>s.disconnect()},[]);const Ee=o.useRef(null),xe=o.useRef(null),ge=o.useRef(null);o.useEffect(()=>{c.busy||(ge.current=null)},[c.busy]);const vt=(e,r)=>{var s;xe.current=((s=Ee.current)==null?void 0:s.scrollTop)??null,c.toggleBlock(e,r)};o.useLayoutEffect(()=>{const e=Ee.current;if(e){if(xe.current!==null){e.scrollTop=xe.current,xe.current=null;return}if(ge.current){const r=Array.from(e.querySelectorAll("[data-message-id]")).find(s=>s.dataset.messageId===ge.current);if(r){const s=e.getBoundingClientRect(),b=r.getBoundingClientRect();e.scrollTop+=b.top-s.top-24;return}}e.scrollTop=e.scrollHeight}},[c.messages]);const de=_.find(e=>e.id===l),Ue=c.messages.filter(e=>e.role==="user"),je=(Ge=Ue[0])==null?void 0:Ge.id,_t=(Ke=Ue.at(-1))==null?void 0:Ke.id,Le=c.messages.length===0,qe=($e=[...c.messages].reverse().find(e=>e.role==="assistant"&&e.errorCode))==null?void 0:$e.errorCode,Be=qe==="openrouter_unavailable"||qe==="openrouter_monthly_budget_exhausted",Ne=(C==null?void 0:C.id)===l,Ie=!!(l&&(k||f&&(!Ne||(C==null?void 0:C.status)==="loading"))),He=Ne&&(C==null?void 0:C.status)==="error"?C.error:void 0;return n.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${bt}px)`},children:[n.jsxs("aside",{className:`chat-sidebar${i?"":" chat-sidebar-closed"}`,children:[n.jsxs("div",{className:"chat-sidebar-top",children:[n.jsxs("button",{type:"button",className:"chat-new-chat",onClick:Me,children:[n.jsx(qt,{})," New chat"]}),n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>a(!1),title:"Collapse sidebar",children:n.jsx(tt,{})})]}),n.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[j&&n.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!j&&M&&n.jsx("div",{className:"chat-sessions-empty",children:M}),!j&&!M&&_.length===0&&n.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Bt(_).map(e=>n.jsxs("div",{className:"chat-session-group",children:[n.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(r=>n.jsxs("div",{className:`chat-session${r.id===l?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>d(`/chat/${r.id}`),onKeyDown:s=>{if(s.key==="Enter"&&d(`/chat/${r.id}`),s.key==="F2"&&(le(r.id),me(r.title)),s.key==="ContextMenu"||s.shiftKey&&s.key==="F10"){s.preventDefault();const b=s.currentTarget.getBoundingClientRect();t({id:r.id,x:b.right-150,y:b.bottom})}},onContextMenu:s=>{s.preventDefault(),t({id:r.id,x:s.clientX,y:s.clientY})},children:[Te===r.id?n.jsx("input",{className:"chat-session-title-input",value:Re,autoFocus:!0,maxLength:80,onClick:s=>s.stopPropagation(),onChange:s=>me(s.target.value),onBlur:()=>void Ye(r.id),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"&&Ye(r.id),s.key==="Escape"&&le(null)}}):n.jsx("span",{className:"chat-session-title",children:r.title}),n.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:s=>{s.stopPropagation();const b=s.currentTarget.getBoundingClientRect();t({id:r.id,x:b.right-150,y:b.bottom})},children:"⋯"}),n.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:s=>{s.stopPropagation(),pt(r.id)},children:n.jsx(Ht,{})})]},r.id))]},e.label))]}),J&&n.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:J.x,top:J.y},onClick:e=>e.stopPropagation(),children:n.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=_.find(r=>r.id===J.id);e&&(le(e.id),me(e.title)),t(null)},children:"Rename chat"})})]}),n.jsxs("section",{className:"chat-main",children:[n.jsxs("div",{className:"chat-topbar",children:[!i&&n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>a(!0),title:"Open sidebar",children:n.jsx(tt,{})}),n.jsx("span",{className:"chat-topbar-title",children:Ie?(de==null?void 0:de.title)||"":Oe||(de==null?void 0:de.title)||(Le?"":"New chat")}),D&&n.jsx("span",{className:"chat-staging-badge",children:"Staging"}),l&&Ne&&(C==null?void 0:C.status)==="loaded"&&!Le&&n.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void yt(),disabled:c.busy||u||Ie,"aria-label":"Share conversation",children:[u?n.jsx(nt,{}):n.jsx(Zt,{"aria-hidden":"true"}),n.jsx("span",{children:"Share"})]})]}),Ie?n.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[n.jsx(nt,{}),n.jsx("span",{children:"Loading conversation…"})]}):He?n.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[n.jsx("p",{children:He}),n.jsx("button",{type:"button",onClick:()=>{I({id:l,status:"loading"}),we(e=>e+1)},children:"Try again"})]}):Le?n.jsx("div",{className:"chat-empty",children:n.jsxs("div",{className:"chat-empty-inner",children:[n.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),n.jsxs("h1",{className:"chat-empty-title",children:["Ask ",n.jsx("em",{children:"Papers With Code"})]}),n.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),D&&n.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),n.jsx(ut,{provider:A}),n.jsx(dt,{enabled:A==="openrouter",fallbackEnabled:!!((ze=_e.data)!=null&&ze.fallback_enabled),byokExpected:Be}),n.jsx(Je,{onSend:pe,busy:c.busy,onStop:c.stop,autoFocus:!0,draft:z,onDraftChange:U,models:T,selectedModel:B,onModelChange:e=>void Fe(e)}),n.jsx("div",{className:"chat-examples",children:Kt.map(e=>n.jsx("button",{type:"button",className:"chat-example",onClick:()=>pe(e),children:e},e))})]})}):n.jsxs(n.Fragment,{children:[c.sessionError&&n.jsx("div",{className:"chat-session-error",role:"alert",children:c.sessionError}),n.jsx("div",{className:"chat-conversation",ref:Ee,children:n.jsx("div",{className:"chat-conversation-inner",children:c.messages.map(e=>e.role==="user"?n.jsx(Nt,{id:e.id,text:e.text??"",isInitial:e.id===je,editingAllowed:!c.busy&&!!e.revision,editing:Ce===e.id,editNotice:e.id===je?"Sending will start a new chat.":e.id===_t?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>ce(e.id),onCancel:()=>ce(null),onResend:r=>{e.id!==je&&(ge.current=e.id);const s=c.editAndResend(e.id,r);return s?ce(null):ge.current=null,s}},e.id):n.jsx(It,{msg:e,papers:c.papers,onToggleBlock:vt,onArchiveOldChats:()=>void gt(),archivePending:p},e.id))})}),n.jsx("div",{className:"chat-composer-wrap",children:n.jsxs("div",{className:"chat-composer-inner",children:[n.jsx(ut,{provider:A}),n.jsx(dt,{enabled:A==="openrouter",fallbackEnabled:!!((Qe=_e.data)!=null&&Qe.fallback_enabled),byokExpected:Be}),n.jsx(Je,{onSend:pe,busy:c.busy,onStop:c.stop,placeholder:z?"Edit and send again…":"Ask a follow-up…",draft:z,onDraftChange:U,models:T,selectedModel:B,onModelChange:e=>void Fe(e)}),n.jsx("div",{className:"chat-composer-foot",children:ke()?n.jsxs(n.Fragment,{children:[A==="openrouter"?n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",n.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",n.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),n.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):n.jsx(n.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),y&&n.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>P(""),children:n.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[n.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),n.jsx("p",{children:"It could not be copied automatically. Copy this link manually:"}),n.jsx("input",{readOnly:!0,value:y,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),n.jsx("button",{type:"button",onClick:()=>P(""),children:"Close"})]})}),c.capacityRequest&&n.jsx(un,{retryAt:c.capacityRequest.retryAt,onCancel:c.cancelCapacity,onRetry:()=>{c.retryCapacity()&&U("")}})]})};export{un as ChatCapacityDialog,xn as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/{ConferenceDetailView-CY-7Wl7R.js → ConferenceDetailView-BxusY5Py.js} RENAMED
@@ -1 +1 @@
1
- import{e as L,r as D,j as e,L as p,b as C}from"./index-Bo5_2OqZ.js";import{u as T}from"./useQuery-Bh9FZQpL.js";import{M as F}from"./MarkdownText-VH1HEGnz.js";import{e as B,h as A,d as E}from"./transform-2Gnjg1jt.js";import{S as f}from"./skeleton-CB-heJjl.js";import{A as P,a as z}from"./alert-_EYQlDHA.js";import"./useBaseQuery-B8T7kRNC.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.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}`},J=()=>{var k,b,S,_,$,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=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.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, outstanding, 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{J as default};
 
1
+ import{e as L,r as D,j as e,L as p,b as C}from"./index-DREEM5p7.js";import{u as T}from"./useQuery-pzEX4kGt.js";import{M as F}from"./MarkdownText-CNYqDApy.js";import{e as B,h as A,d as E}from"./transform-DA_akiPE.js";import{S as f}from"./skeleton-C9cmIM7L.js";import{A as P,a as z}from"./alert-DqWQWZ1R.js";import"./useBaseQuery-BnoYgsiR.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-D-wxSmXC.js";import"./index-Dm_H11O9.js";import"./hover-card-ZrDlt9Lf.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}`},J=()=>{var k,b,S,_,$,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=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.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, outstanding, 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{J as default};
assets/{ConferenceTaskView--e571ntQ.js → ConferenceTaskView-BYv2s9Ee.js} RENAMED
@@ -1 +1 @@
1
- import{e as $,a as D,r as f,j as e,L as b,R as W,b as M}from"./index-Bo5_2OqZ.js";import{u as z}from"./useQuery-Bh9FZQpL.js";import{P as G}from"./components-BbXgE2lV.js";import{P as J}from"./PaperFeedFilters-D2TbUu0j.js";import{M as h}from"./MarkdownText-VH1HEGnz.js";import{t as X,d as Y}from"./transform-2Gnjg1jt.js";import{c as Z}from"./usePapers-CdB1OuZ5.js";import{u as ee}from"./useIntersectionObserver-7HCpY83L.js";import{S as se}from"./skeleton-CB-heJjl.js";import{A as ae,a as te}from"./alert-_EYQlDHA.js";import"./useBaseQuery-B8T7kRNC.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.js";import"./useInfiniteQuery-CzzYUeDW.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=Z({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=ee({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(X),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Y(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{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(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.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:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{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/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.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:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(J,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.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:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{be as default};
 
1
+ import{e as $,a as D,r as f,j as e,L as b,R as W,b as M}from"./index-DREEM5p7.js";import{u as z}from"./useQuery-pzEX4kGt.js";import{P as G}from"./components-DCcxy0XP.js";import{P as J}from"./PaperFeedFilters-tral1E4E.js";import{M as h}from"./MarkdownText-CNYqDApy.js";import{t as X,d as Y}from"./transform-DA_akiPE.js";import{c as Z}from"./usePapers-Ds6XBgz_.js";import{u as ee}from"./useIntersectionObserver-BUuG_jQu.js";import{S as se}from"./skeleton-C9cmIM7L.js";import{A as ae,a as te}from"./alert-DqWQWZ1R.js";import"./useBaseQuery-BnoYgsiR.js";import"./LatexTitle-DYInY1bH.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-D-wxSmXC.js";import"./index-Dm_H11O9.js";import"./hover-card-ZrDlt9Lf.js";import"./useInfiniteQuery-BWf7CLsF.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=Z({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=ee({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(X),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Y(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{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(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.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:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{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/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.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:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(J,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.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:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{be as default};
assets/{ConferencesIndexView-DE7AvizF.js → ConferencesIndexView-DA5w1mt9.js} RENAMED
@@ -1 +1 @@
1
- import{r as p,j as e,L as d,b as u}from"./index-Bo5_2OqZ.js";import{u as h}from"./useQuery-Bh9FZQpL.js";import{S as m}from"./skeleton-CB-heJjl.js";import{A as f,a as g}from"./alert-_EYQlDHA.js";import{T as x}from"./TaxonomySuggestionTile-T8WIATj3.js";import"./useBaseQuery-B8T7kRNC.js";import"./SignInToEditDialog-DW_1sVXp.js";import"./button-D8mDpZUh.js";import"./textarea-Cr9wwZtd.js";import"./dialog-BAxsIFdN.js";import"./useMutation-B8C_NgT5.js";import"./loader-circle-L2ccNPQf.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(t)}, ${i}`},v=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},y=(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)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=p.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=v(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(y)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{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."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((s,i)=>e.jsx(m,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.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:N,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:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(d,{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)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default};
 
1
+ import{r as p,j as e,L as d,b as u}from"./index-DREEM5p7.js";import{u as h}from"./useQuery-pzEX4kGt.js";import{S as m}from"./skeleton-C9cmIM7L.js";import{A as f,a as g}from"./alert-DqWQWZ1R.js";import{T as x}from"./TaxonomySuggestionTile-BFLpa7xW.js";import"./useBaseQuery-BnoYgsiR.js";import"./SignInToEditDialog-B6iSscgi.js";import"./button-BwpTjeyz.js";import"./textarea-DyNUKizV.js";import"./dialog-D77-YHgu.js";import"./useMutation-Bsr7m3Cl.js";import"./loader-circle-visLwNUg.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(t)}, ${i}`},v=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},y=(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)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=p.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=v(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(y)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{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."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((s,i)=>e.jsx(m,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.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:N,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:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(d,{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)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default};
assets/{ContributionsPage-DoaZMKUY.js → ContributionsPage-72YaHqKV.js} RENAMED
@@ -1 +1 @@
1
- import{f as o,j as t,b as n}from"./index-Bo5_2OqZ.js";import{u as c}from"./useInfiniteQuery-CzzYUeDW.js";import{B as d}from"./button-D8mDpZUh.js";import"./useBaseQuery-B8T7kRNC.js";const h=()=>{var r;const{user:s}=o(),a=c({queryKey:["contributions",s==null?void 0:s.username],queryFn:({pageParam:e})=>n.getMyContributions(e),initialPageParam:void 0,getNextPageParam:e=>e.next_cursor??void 0,enabled:!!(s!=null&&s.can_contribute)}),i=((r=a.data)==null?void 0:r.pages.flatMap(e=>e.events))??[];return s!=null&&s.can_contribute?t.jsxs("div",{className:"page max-w-5xl mx-auto px-4 py-8",children:[t.jsx("h1",{className:"text-3xl font-bold",children:"My contributions"}),t.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Private history for catalog changes made through your contributor account."}),a.isLoading&&t.jsx("p",{className:"mt-8",children:"Loading contributions…"}),a.error&&t.jsx("p",{className:"mt-8 text-destructive",children:"Could not load contribution history."}),t.jsxs("div",{className:"mt-6 space-y-3",children:[i.map(e=>t.jsxs("article",{className:"rounded-md border p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("strong",{children:[e.operation," ",e.entity_type]}),t.jsx("time",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),t.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e.entity_id," · ",e.id]}),t.jsxs("details",{className:"mt-3 text-xs",children:[t.jsx("summary",{children:"Before / after"}),t.jsx("pre",{className:"mt-2 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:e.before,after:e.after},null,2)})]})]},e.id)),a.data&&i.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No direct edits yet."}),a.hasNextPage&&t.jsx(d,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older contributions"})]})]}):t.jsxs("div",{className:"page",children:[t.jsx("h1",{children:"Contributions"}),t.jsx("p",{children:"This history is available to project contributors and admins."})]})};export{h as default};
 
1
+ import{f as o,j as t,b as n}from"./index-DREEM5p7.js";import{u as c}from"./useInfiniteQuery-BWf7CLsF.js";import{B as d}from"./button-BwpTjeyz.js";import"./useBaseQuery-BnoYgsiR.js";const h=()=>{var r;const{user:s}=o(),a=c({queryKey:["contributions",s==null?void 0:s.username],queryFn:({pageParam:e})=>n.getMyContributions(e),initialPageParam:void 0,getNextPageParam:e=>e.next_cursor??void 0,enabled:!!(s!=null&&s.can_contribute)}),i=((r=a.data)==null?void 0:r.pages.flatMap(e=>e.events))??[];return s!=null&&s.can_contribute?t.jsxs("div",{className:"page max-w-5xl mx-auto px-4 py-8",children:[t.jsx("h1",{className:"text-3xl font-bold",children:"My contributions"}),t.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Private history for catalog changes made through your contributor account."}),a.isLoading&&t.jsx("p",{className:"mt-8",children:"Loading contributions…"}),a.error&&t.jsx("p",{className:"mt-8 text-destructive",children:"Could not load contribution history."}),t.jsxs("div",{className:"mt-6 space-y-3",children:[i.map(e=>t.jsxs("article",{className:"rounded-md border p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("strong",{children:[e.operation," ",e.entity_type]}),t.jsx("time",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),t.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e.entity_id," · ",e.id]}),t.jsxs("details",{className:"mt-3 text-xs",children:[t.jsx("summary",{children:"Before / after"}),t.jsx("pre",{className:"mt-2 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:e.before,after:e.after},null,2)})]})]},e.id)),a.data&&i.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No direct edits yet."}),a.hasNextPage&&t.jsx(d,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older contributions"})]})]}):t.jsxs("div",{className:"page",children:[t.jsx("h1",{children:"Contributions"}),t.jsx("p",{children:"This history is available to project contributors and admins."})]})};export{h as default};
assets/CronDashboard-CKulhmWw.js DELETED
@@ -1,61 +0,0 @@
1
- import{c as p,r as m,j as e,v as u,N as ke,o as Ce,n as J,a2 as Te,O as Re,Q as Se,q as E,P as Me,t as Fe,S as X,L as Le,h as Ae,b as S,f as Pe}from"./index-Bo5_2OqZ.js";import{u as $}from"./useQuery-Bh9FZQpL.js";import{B as w,D as U,f as De}from"./codexAddEvals-NAKdH-Ge.js";import{B as M}from"./button-D8mDpZUh.js";import{C as Ie}from"./chevron-down-BeEEYUNO.js";import{C as P,a as O,R as V,S as Je}from"./shield-alert-C2VCWA2k.js";import{L as R}from"./loader-circle-L2ccNPQf.js";import{E as Z}from"./external-link-BjWlCUOk.js";import{u as G}from"./useMutation-B8C_NgT5.js";import{u as qe}from"./useInfiniteQuery-CzzYUeDW.js";import"./useBaseQuery-B8T7kRNC.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 D=p("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
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 Ee=p("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
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 $e=p("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 He=p("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
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 Oe=p("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
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 ze=p("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
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 Be=p("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
37
- * @license lucide-react v0.462.0 - ISC
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 Y=p("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
42
- * @license lucide-react v0.462.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */const K=p("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
47
- * @license lucide-react v0.462.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */const Ue=p("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/**
52
- * @license lucide-react v0.462.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const Ve=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"}]]);/**
57
- * @license lucide-react v0.462.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */const Ge=p("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),j=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));j.displayName="Card";const b=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex flex-col space-y-1.5 p-6",s),...a}));b.displayName="CardHeader";const y=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:u("text-2xl font-semibold leading-none tracking-tight",s),...a}));y.displayName="CardTitle";const I=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:u("text-sm text-muted-foreground",s),...a}));I.displayName="CardDescription";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("p-6 pt-0",s),...a}));N.displayName="CardContent";const Ke=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex items-center p-6 pt-0",s),...a}));Ke.displayName="CardFooter";var q="Tabs",[Qe]=Fe(q,[X]),ee=X(),[We,z]=Qe(q),se=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:t,activationMode:c="automatic",...g}=s,x=ke(t),[h,f]=Ce({prop:n,onChange:o,defaultProp:d??"",caller:q});return e.jsx(We,{scope:r,baseId:Te(),value:h,onValueChange:f,orientation:i,dir:x,activationMode:c,children:e.jsx(J.div,{dir:x,"data-orientation":i,...g,ref:a})})});se.displayName=q;var ae="TabsList",re=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...o}=s,d=z(ae,r),i=ee(r);return e.jsx(Re,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(J.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});re.displayName=ae;var te="TabsTrigger",ne=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...d}=s,i=z(te,r),t=ee(r),c=le(i.baseId,n),g=oe(i.baseId,n),x=n===i.value;return e.jsx(Se,{asChild:!0,...t,focusable:!o,active:x,children:e.jsx(J.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":g,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...d,ref:a,onMouseDown:E(s.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?i.onValueChange(n):h.preventDefault()}),onKeyDown:E(s.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(n)}),onFocus:E(s.onFocus,()=>{const h=i.activationMode!=="manual";!x&&!o&&h&&i.onValueChange(n)})})})});ne.displayName=te;var ie="TabsContent",ce=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:o,children:d,...i}=s,t=z(ie,r),c=le(t.baseId,n),g=oe(t.baseId,n),x=n===t.value,h=m.useRef(x);return m.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),e.jsx(Me,{present:o||x,children:({present:f})=>e.jsx(J.div,{"data-state":x?"active":"inactive","data-orientation":t.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:g,tabIndex:0,...i,ref:a,style:{...s.style,animationDuration:h.current?"0s":void 0},children:f&&d})})});ce.displayName=ie;function le(s,a){return`${s}-trigger-${a}`}function oe(s,a){return`${s}-content-${a}`}var Xe=se,de=re,me=ne,xe=ce;const Ze=Xe,ue=m.forwardRef(({className:s,...a},r)=>e.jsx(de,{ref:r,className:u("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));ue.displayName=de.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx(me,{ref:r,className:u("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));L.displayName=me.displayName;const A=m.forwardRef(({className:s,...a},r)=>e.jsx(xe,{ref:r,className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));A.displayName=xe.displayName;function _(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),o=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function he(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function pe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function ge(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const Ye={healthy:O,degraded:Ge,broken:P,running:R,stuck:P,unknown:He};function es({status:s,isRunning:a}){const r=a?"running":s,n=Ye[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function Q({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},n))})]})}function ss({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(D,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",pe(s)],...s.updated_at?[["Updated",_(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(w,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(w,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function as(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function rs({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"outline",className:as(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(Z,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",_(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",_(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",he(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ts({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ue,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(rs,{job:n},n.id))})]})]})}function ns({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:o=!1,paperMarkdownJobsError:d=null}){const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),t=!!(s.db_metrics&&Object.keys(s.db_metrics).length),c=s.job_name==="paper_markdown_backfill",g=i||t||!!s.workflow_status||c;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(es,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(w,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(w,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),g&&(a?e.jsx($e,{className:"h-4 w-4 cron-muted"}):e.jsx(Ie,{className:"h-4 w-4 cron-muted"}))]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Y,{}),"Log: ",_(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(U,{}),"DB: ",_(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ve,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(D,{}),"Duration: ",he(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(Ee,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(K,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(D,{}),"Actions: ",pe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(w,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&g&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&i&&e.jsx(Q,{icon:K,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&t&&e.jsx(Q,{icon:U,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(ss,{workflow:s.workflow_status}),c&&e.jsx(ts,{monitor:n,loading:o,error:d})]})})]})}const fe=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:u("w-full caption-bottom text-sm",s),...a})}));fe.displayName="Table";const je=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:u("[&_tr]:border-b",s),...a}));je.displayName="TableHeader";const Ne=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:u("[&_tr:last-child]:border-0",s),...a}));Ne.displayName="TableBody";const is=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));is.displayName="TableFooter";const H=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:u("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));H.displayName="TableRow";const C=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));C.displayName="TableHead";const T=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));T.displayName="TableCell";const cs=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:u("mt-4 text-sm text-muted-foreground",s),...a}));cs.displayName="TableCaption";const ls={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},os={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ds={queued:Be,dispatching:R,running:Oe,completed:O,failed:P,canceled:ze};function ms({status:s}){const a=ds[s];return e.jsxs(w,{variant:"outline",className:ls[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function xs(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function us({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:o,error:d}=$({queryKey:["codexPaperJobs",a],queryFn:()=>De(100),refetchInterval:s?1e4:!1,retry:!1}),i=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(j,{className:"mb-8",children:[e.jsx(b,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(I,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(N,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&i!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),i===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(t=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:t}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[t]})]},t)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(fe,{children:[e.jsx(je,{children:e.jsxs(H,{children:[e.jsx(C,{children:"Status"}),e.jsx(C,{children:"Paper"}),e.jsx(C,{children:"Action"}),e.jsx(C,{children:"Requested"}),e.jsx(C,{children:"Execution"})]})}),e.jsx(Ne,{children:r.jobs.map(t=>{const c=xs(t);return e.jsxs(H,{children:[e.jsx(T,{className:"align-top",children:e.jsx(ms,{status:t.status})}),e.jsxs(T,{className:"min-w-[260px] align-top",children:[e.jsx(Le,{to:`/paper/${encodeURIComponent(t.paper_route)}`,className:"font-medium hover:underline",children:t.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",t.paper_id]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[os[t.kind],t.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(O,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:_(t.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",t.requested_by]})]}),e.jsxs(T,{className:"max-w-[360px] align-top",children:[t.hf_job_url?e.jsxs("a",{href:t.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Z,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),c&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${t.error?"text-red-700":"cron-muted"}`,title:c,children:c})]})]},t.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",_(r.timestamp)]})]})]})]})}const hs=()=>{var d,i,t;const s=Ae(),a=qe({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>S.getCatalogAudit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(c=>c.events))??[],n=G({mutationFn:()=>S.acknowledgeCatalogAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=G({mutationFn:c=>S.rollbackCatalogEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(j,{children:[e.jsxs(b,{className:"flex-row items-center justify-between",children:[e.jsx(y,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((t=(i=a.data)==null?void 0:i.pages[0])==null?void 0:t.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(N,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:c.before,after:c.after},null,2)})]}),!c.rollback_of_event_id&&e.jsx(M,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>o.mutate(c.id),disabled:o.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(M,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},W={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},Rs=()=>{const[s,a]=m.useState(!0),[r,n]=m.useState(0),[o,d]=m.useState(new Set),{user:i}=Pe(),{data:t,isLoading:c,isFetching:g,error:x,refetch:h}=$({queryKey:["cronStatus",i==null?void 0:i.username],queryFn:()=>S.getCronStatus(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),f=$({queryKey:["paperMarkdownJobs",i==null?void 0:i.username],queryFn:()=>S.getPaperMarkdownJobs(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),ve=(x&&typeof x=="object"&&"status"in x?x.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":x instanceof Error?x.message:void 0,be=l=>{d(v=>{const k=new Set(v);return k.has(l)?k.delete(l):k.add(l),k})},ye=(t==null?void 0:t.jobs.filter(l=>l.critical))??[],F=((t==null?void 0:t.jobs.filter(l=>!l.critical))??[]).reduce((l,v)=>(l[v.category]||(l[v.category]=[]),l[v.category].push(v),l),{}),we=Object.keys(F).sort((l,v)=>{const k=["hourly","daily","weekly"];return k.indexOf(l)-k.indexOf(v)}),B=l=>e.jsx(ns,{job:l,expanded:o.has(l.job_name),onToggle:()=>be(l.job_name),paperMarkdownJobs:l.job_name==="paper_markdown_backfill"?f.data:void 0,paperMarkdownJobsLoading:l.job_name==="paper_markdown_backfill"?f.isLoading:!1,paperMarkdownJobsError:l.job_name==="paper_markdown_backfill"?f.error:null},l.job_name),_e=()=>{n(l=>l+1),h(),f.refetch()};return e.jsx("div",{className:"cron-dashboard","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 gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(D,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(M,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:_e,disabled:g,children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(j,{className:"mb-6",children:e.jsx(N,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",i==null?void 0:i.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(Ze,{defaultValue:"critical-jobs",children:[e.jsxs(ue,{className:"grid w-full grid-cols-3 sm:w-auto",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"})]}),e.jsxs(A,{value:"critical-jobs",className:"mt-6",children:[c&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),x&&e.jsx(j,{className:"cron-status--broken",children:e.jsx(N,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{className:"h-5 w-5"}),e.jsx("p",{children:ve??"Failed to load CRON jobs status. Please try again."})]})})}),t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(l=>e.jsxs(j,{children:[e.jsx(b,{className:"pb-2",children:e.jsx(y,{className:"text-sm font-medium cron-muted capitalize",children:l})}),e.jsx(N,{children:e.jsx("div",{className:"text-2xl font-bold",children:t.summary[l]})})]},l))}),t.summary.critical_issues.length>0&&e.jsxs(j,{className:"mb-6 cron-status--broken",children:[e.jsx(b,{children:e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(Je,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(N,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:t.summary.critical_issues.map(l=>e.jsx("li",{children:l},l))})})]}),e.jsxs(j,{className:"mb-8",children:[e.jsx(b,{children:e.jsx(y,{className:"text-base",children:"What to check next"})}),e.jsxs(N,{children:[e.jsx("p",{className:"text-sm cron-muted",children:t.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Y,{className:"h-4 w-4"}),"Last updated: ",_(t.timestamp)," · Health score:"," ",t.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(j,{className:"mb-8",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Critical jobs"}),e.jsx(I,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(N,{className:"space-y-4",children:ye.map(B)})]}),e.jsx("div",{className:"space-y-6",children:we.map(l=>e.jsxs(j,{children:[e.jsx(b,{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(w,{className:W[l]??W.hourly,children:l}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(I,{children:[F[l].length," job",F[l].length!==1?"s":""]})]})}),e.jsx(N,{className:"space-y-4",children:F[l].map(B)})]},l))})]})]}),e.jsx(A,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(us,{autoRefresh:s,refreshToken:r})}),e.jsx(A,{value:"catalog-audit",className:"mt-6",children:e.jsx(hs,{})})]})]})})};export{Rs as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/CronDashboard-VjNs2ei7.js ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as b,r as m,j as e,v as p,N as Te,o as Se,n as q,a2 as Re,O as Le,Q as Me,q as O,P as Fe,t as Ae,S as Y,L as Pe,h as $e,b as L,f as De}from"./index-DREEM5p7.js";import{u as I}from"./useQuery-pzEX4kGt.js";import{B as w,D as K,f as Ie}from"./codexAddEvals-9YtNb4JX.js";import{B as P}from"./button-BwpTjeyz.js";import{C as Ee}from"./chevron-down-CbBr2xUl.js";import{C as E,a as z,R as Q,S as Je}from"./shield-alert-0lJnM8Xf.js";import{L as T}from"./loader-circle-visLwNUg.js";import{E as ee}from"./external-link-BJNvNNt4.js";import{u as V}from"./useMutation-Bsr7m3Cl.js";import{u as qe}from"./useInfiniteQuery-BWf7CLsF.js";import"./useBaseQuery-BnoYgsiR.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 J=b("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
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 He=b("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
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 Oe=b("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 Ue=b("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
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 ze=b("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
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 Be=b("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
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 We=b("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
37
+ * @license lucide-react v0.462.0 - ISC
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 se=b("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
42
+ * @license lucide-react v0.462.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const G=b("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
47
+ * @license lucide-react v0.462.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const Ke=b("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/**
52
+ * @license lucide-react v0.462.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const Qe=b("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"}]]);/**
57
+ * @license lucide-react v0.462.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const Ve=b("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),h=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:p("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));h.displayName="Card";const g=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:p("flex flex-col space-y-1.5 p-6",s),...a}));g.displayName="CardHeader";const j=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:p("text-2xl font-semibold leading-none tracking-tight",s),...a}));j.displayName="CardTitle";const M=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:p("text-sm text-muted-foreground",s),...a}));M.displayName="CardDescription";const u=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:p("p-6 pt-0",s),...a}));u.displayName="CardContent";const Ge=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:p("flex items-center p-6 pt-0",s),...a}));Ge.displayName="CardFooter";var H="Tabs",[Xe]=Ae(H,[Y]),ae=Y(),[Ze,B]=Xe(H),re=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:i,onValueChange:o,defaultValue:d,orientation:t="horizontal",dir:n,activationMode:c="automatic",...y}=s,x=Te(n),[f,_]=Se({prop:i,onChange:o,defaultProp:d??"",caller:H});return e.jsx(Ze,{scope:r,baseId:Re(),value:f,onValueChange:_,orientation:t,dir:x,activationMode:c,children:e.jsx(q.div,{dir:x,"data-orientation":t,...y,ref:a})})});re.displayName=H;var te="TabsList",ne=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:i=!0,...o}=s,d=B(te,r),t=ae(r);return e.jsx(Le,{asChild:!0,...t,orientation:d.orientation,dir:d.dir,loop:i,children:e.jsx(q.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});ne.displayName=te;var ie="TabsTrigger",ce=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:i,disabled:o=!1,...d}=s,t=B(ie,r),n=ae(r),c=de(t.baseId,i),y=me(t.baseId,i),x=i===t.value;return e.jsx(Me,{asChild:!0,...n,focusable:!o,active:x,children:e.jsx(q.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":y,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...d,ref:a,onMouseDown:O(s.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?t.onValueChange(i):f.preventDefault()}),onKeyDown:O(s.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&t.onValueChange(i)}),onFocus:O(s.onFocus,()=>{const f=t.activationMode!=="manual";!x&&!o&&f&&t.onValueChange(i)})})})});ce.displayName=ie;var le="TabsContent",oe=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:i,forceMount:o,children:d,...t}=s,n=B(le,r),c=de(n.baseId,i),y=me(n.baseId,i),x=i===n.value,f=m.useRef(x);return m.useEffect(()=>{const _=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(_)},[]),e.jsx(Fe,{present:o||x,children:({present:_})=>e.jsx(q.div,{"data-state":x?"active":"inactive","data-orientation":n.orientation,role:"tabpanel","aria-labelledby":c,hidden:!_,id:y,tabIndex:0,...t,ref:a,style:{...s.style,animationDuration:f.current?"0s":void 0},children:_&&d})})});oe.displayName=le;function de(s,a){return`${s}-trigger-${a}`}function me(s,a){return`${s}-content-${a}`}var Ye=re,xe=ne,he=ce,ue=oe;const es=Ye,pe=m.forwardRef(({className:s,...a},r)=>e.jsx(xe,{ref:r,className:p("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));pe.displayName=xe.displayName;const F=m.forwardRef(({className:s,...a},r)=>e.jsx(he,{ref:r,className:p("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));F.displayName=he.displayName;const A=m.forwardRef(({className:s,...a},r)=>e.jsx(ue,{ref:r,className:p("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));A.displayName=ue.displayName;function N(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),i=Math.floor(r/6e4),o=Math.floor(r/36e5),d=Math.floor(r/864e5);return i<1?"Just now":i<60?`${i}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ge(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function je(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function fe(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const ss={healthy:z,degraded:Ve,broken:E,running:T,stuck:E,unknown:Ue};function as({status:s,isRunning:a}){const r=a?"running":s,i=ss[r];return e.jsx(i,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function X({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([i,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:fe(i)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},i))})]})}function rs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(J,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",je(s)],...s.updated_at?[["Updated",N(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(w,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(w,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function ts(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function ns({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"outline",className:ts(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(ee,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",N(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(i=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:i.arxiv_id}),": ",i.error]},`${i.arxiv_id}:${i.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",N(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",ge(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function is({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ke,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(T,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([i,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:fe(i)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},i))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(i=>e.jsx(ns,{job:i},i.id))})]})]})}function cs({job:s,expanded:a,onToggle:r,paperMarkdownJobs:i,paperMarkdownJobsLoading:o=!1,paperMarkdownJobsError:d=null}){const t=!!(s.work_metrics&&Object.keys(s.work_metrics).length),n=!!(s.db_metrics&&Object.keys(s.db_metrics).length),c=s.job_name==="paper_markdown_backfill",y=t||n||!!s.workflow_status||c;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(as,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(w,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(w,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),y&&(a?e.jsx(Oe,{className:"h-4 w-4 cron-muted"}):e.jsx(Ee,{className:"h-4 w-4 cron-muted"}))]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(se,{}),"Log: ",N(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(K,{}),"DB: ",N(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Qe,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(J,{}),"Duration: ",ge(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(He,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(G,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(J,{}),"Actions: ",je(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(w,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&y&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&t&&e.jsx(X,{icon:G,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&n&&e.jsx(X,{icon:K,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(rs,{workflow:s.workflow_status}),c&&e.jsx(is,{monitor:i,loading:o,error:d})]})})]})}const Ne=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:p("w-full caption-bottom text-sm",s),...a})}));Ne.displayName="Table";const ve=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:p("[&_tr]:border-b",s),...a}));ve.displayName="TableHeader";const be=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:p("[&_tr:last-child]:border-0",s),...a}));be.displayName="TableBody";const ls=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:p("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));ls.displayName="TableFooter";const U=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:p("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));U.displayName="TableRow";const S=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:p("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));S.displayName="TableHead";const R=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:p("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));R.displayName="TableCell";const os=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:p("mt-4 text-sm text-muted-foreground",s),...a}));os.displayName="TableCaption";const ds={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},ms={"add-evals":"Add evals","enrich-paper":"Enrich paper"},xs={queued:We,dispatching:T,running:ze,completed:z,failed:E,canceled:Be};function hs({status:s}){const a=xs[s];return e.jsxs(w,{variant:"outline",className:ds[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function us(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function ps({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:i,isFetching:o,error:d}=I({queryKey:["codexPaperJobs",a],queryFn:()=>Ie(100),refetchInterval:s?1e4:!1,retry:!1}),t=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(h,{className:"mb-8",children:[e.jsx(g,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(j,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(M,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!i&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(T,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(u,{children:[i&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(T,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&t!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),t===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(n=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:n}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[n]})]},n)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(Ne,{children:[e.jsx(ve,{children:e.jsxs(U,{children:[e.jsx(S,{children:"Status"}),e.jsx(S,{children:"Paper"}),e.jsx(S,{children:"Action"}),e.jsx(S,{children:"Requested"}),e.jsx(S,{children:"Execution"})]})}),e.jsx(be,{children:r.jobs.map(n=>{const c=us(n);return e.jsxs(U,{children:[e.jsx(R,{className:"align-top",children:e.jsx(hs,{status:n.status})}),e.jsxs(R,{className:"min-w-[260px] align-top",children:[e.jsx(Pe,{to:`/paper/${encodeURIComponent(n.paper_route)}`,className:"font-medium hover:underline",children:n.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",n.paper_id]})]}),e.jsxs(R,{className:"whitespace-nowrap align-top",children:[ms[n.kind],n.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(z,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(R,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:N(n.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",n.requested_by]})]}),e.jsxs(R,{className:"max-w-[360px] align-top",children:[n.hf_job_url?e.jsxs("a",{href:n.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(ee,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),c&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${n.error?"text-red-700":"cron-muted"}`,title:c,children:c})]})]},n.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",N(r.timestamp)]})]})]})]})}const gs=()=>{var d,t,n;const s=$e(),a=qe({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>L.getCatalogAudit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(c=>c.events))??[],i=V({mutationFn:()=>L.acknowledgeCatalogAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=V({mutationFn:c=>L.rollbackCatalogEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(h,{children:[e.jsxs(g,{className:"flex-row items-center justify-between",children:[e.jsx(j,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((n=(t=a.data)==null?void 0:t.pages[0])==null?void 0:n.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>i.mutate(),disabled:i.isPending,children:"Mark read"})]})]}),e.jsxs(u,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:c.before,after:c.after},null,2)})]}),!c.rollback_of_event_id&&e.jsx(P,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>o.mutate(c.id),disabled:o.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(P,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},Z={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},v=s=>`$${(s/1e6).toFixed(2)}`,js=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(T,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const i=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),o=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",d=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(h,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(g,{children:e.jsx(j,{className:"text-sm",children:"Circuit"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:o}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(h,{children:[e.jsx(g,{children:e.jsx(j,{className:"text-sm",children:"Month to date"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:v(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(i),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${i}%`}})})]})]}),e.jsxs(h,{children:[e.jsx(g,{children:e.jsx(j,{className:"text-sm",children:"Application headroom"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:v(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",v(s.application_cap_microusd)]})]})]}),e.jsxs(h,{children:[e.jsx(g,{children:e.jsx(j,{className:"text-sm",children:"Live compute"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(h,{children:[e.jsxs(g,{children:[e.jsx(j,{children:"Accounting and policy"}),e.jsxs(M,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(u,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("label",{children:[e.jsx("strong",{children:"Environment"}),e.jsx("select",{"aria-label":"Chat compute environment",value:s.environment,disabled:!0,className:"block mt-1",children:e.jsx("option",{children:s.environment})})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),v(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),v(s.provider_floor_microusd)," · ",e.jsx(w,{children:d})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),"Environment ",v(s.environment_cap_microusd)," · Workspace ",v(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",v(s.warning_microusd)," · trip ",v(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Staging now $75/$100/$125 · staging with prod $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),N(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?N(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?N(s.last_reconciled_at):"Unavailable",s.next_reconciliation_at?` · next ${N(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${v(s.burn_rate_microusd_per_hour)}/hour`]})]})]}),e.jsxs(h,{children:[e.jsx(g,{children:e.jsx(j,{children:"Live lifecycle"})}),e.jsx(u,{className:"text-sm",children:Object.entries(s.live_states).map(([t,n])=>e.jsxs("span",{className:"mr-4",children:[t,": ",n]},t))})]}),e.jsxs(h,{children:[e.jsx(g,{children:e.jsx(j,{children:"Daily spend"})}),e.jsx(u,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(t=>e.jsxs("li",{children:[t.date,": blank ",v(t.blank_pool_microusd)," · assigned ",v(t.assigned_microusd)]},t.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(h,{children:[e.jsxs(g,{children:[e.jsx(j,{children:"Recent circuit events"}),e.jsx(M,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(u,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(t=>e.jsxs("li",{children:[e.jsx(w,{children:t.severity})," ",t.type," · ",N(t.created_at)]},t.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Ms=()=>{const[s,a]=m.useState(!0),[r,i]=m.useState(0),[o,d]=m.useState(new Set),{user:t}=De(),{data:n,isLoading:c,isFetching:y,error:x,refetch:f}=I({queryKey:["cronStatus",t==null?void 0:t.username],queryFn:()=>L.getCronStatus(),enabled:!!(t!=null&&t.is_admin),refetchInterval:s?3e4:!1,retry:!1}),_=I({queryKey:["paperMarkdownJobs",t==null?void 0:t.username],queryFn:()=>L.getPaperMarkdownJobs(),enabled:!!(t!=null&&t.is_admin),refetchInterval:s?3e4:!1,retry:!1}),$=I({queryKey:["chatSandboxSpend",t==null?void 0:t.username],queryFn:()=>L.getChatSandboxSpend(),enabled:!!(t!=null&&t.is_admin),refetchInterval:s?3e4:!1,retry:!1}),ye=(x&&typeof x=="object"&&"status"in x?x.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":x instanceof Error?x.message:void 0,_e=l=>{d(k=>{const C=new Set(k);return C.has(l)?C.delete(l):C.add(l),C})},we=(n==null?void 0:n.jobs.filter(l=>l.critical))??[],D=((n==null?void 0:n.jobs.filter(l=>!l.critical))??[]).reduce((l,k)=>(l[k.category]||(l[k.category]=[]),l[k.category].push(k),l),{}),ke=Object.keys(D).sort((l,k)=>{const C=["hourly","daily","weekly"];return C.indexOf(l)-C.indexOf(k)}),W=l=>e.jsx(cs,{job:l,expanded:o.has(l.job_name),onToggle:()=>_e(l.job_name),paperMarkdownJobs:l.job_name==="paper_markdown_backfill"?_.data:void 0,paperMarkdownJobsLoading:l.job_name==="paper_markdown_backfill"?_.isLoading:!1,paperMarkdownJobsError:l.job_name==="paper_markdown_backfill"?_.error:null},l.job_name),Ce=()=>{i(l=>l+1),f(),_.refetch(),$.refetch()};return e.jsx("div",{className:"cron-dashboard","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 gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(J,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(P,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(Q,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(P,{variant:"outline",size:"sm",onClick:Ce,disabled:y,children:[e.jsx(Q,{className:`h-4 w-4 mr-2 ${y?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(h,{className:"mb-6",children:e.jsx(u,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",t==null?void 0:t.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(es,{defaultValue:"critical-jobs",children:[e.jsxs(pe,{className:"grid w-full grid-cols-4 sm:w-auto",children:[e.jsx(F,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(F,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(F,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(F,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(A,{value:"critical-jobs",className:"mt-6",children:[c&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(T,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),x&&e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"h-5 w-5"}),e.jsx("p",{children:ye??"Failed to load CRON jobs status. Please try again."})]})})}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(l=>e.jsxs(h,{children:[e.jsx(g,{className:"pb-2",children:e.jsx(j,{className:"text-sm font-medium cron-muted capitalize",children:l})}),e.jsx(u,{children:e.jsx("div",{className:"text-2xl font-bold",children:n.summary[l]})})]},l))}),n.summary.critical_issues.length>0&&e.jsxs(h,{className:"mb-6 cron-status--broken",children:[e.jsx(g,{children:e.jsxs(j,{className:"flex items-center gap-2",children:[e.jsx(Je,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(u,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:n.summary.critical_issues.map(l=>e.jsx("li",{children:l},l))})})]}),e.jsxs(h,{className:"mb-8",children:[e.jsx(g,{children:e.jsx(j,{className:"text-base",children:"What to check next"})}),e.jsxs(u,{children:[e.jsx("p",{className:"text-sm cron-muted",children:n.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(se,{className:"h-4 w-4"}),"Last updated: ",N(n.timestamp)," · Health score:"," ",n.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(h,{className:"mb-8",children:[e.jsxs(g,{children:[e.jsx(j,{className:"text-xl",children:"Critical jobs"}),e.jsx(M,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(u,{className:"space-y-4",children:we.map(W)})]}),e.jsx("div",{className:"space-y-6",children:ke.map(l=>e.jsxs(h,{children:[e.jsx(g,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(j,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:Z[l]??Z.hourly,children:l}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(M,{children:[D[l].length," job",D[l].length!==1?"s":""]})]})}),e.jsx(u,{className:"space-y-4",children:D[l].map(W)})]},l))})]})]}),e.jsx(A,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(ps,{autoRefresh:s,refreshToken:r})}),e.jsx(A,{value:"catalog-audit",className:"mt-6",children:e.jsx(gs,{})}),e.jsx(A,{value:"chat-compute",className:"mt-6",children:e.jsx(js,{data:$.data,loading:$.isLoading,error:$.error})})]})]})})};export{js as ChatComputePanel,Ms as default};
assets/{ExternalSourceEvalBadge-BYtEDxNm.js → ExternalSourceEvalBadge-BLagMwlj.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,L as l}from"./index-Bo5_2OqZ.js";import{H as t,a as n,b as o}from"./hover-card-DrtqDSb0.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{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"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E};
 
1
+ import{j as e,L as l}from"./index-DREEM5p7.js";import{H as t,a as n,b as o}from"./hover-card-ZrDlt9Lf.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{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"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E};
assets/{FeedView-Dv1LDUAN.js → FeedView-51f2avBG.js} RENAMED
@@ -1 +1 @@
1
- import{u as O,r as p,j as e,a as H,L as _,i as F,b as E}from"./index-Bo5_2OqZ.js";import{P as I}from"./components-BbXgE2lV.js";import{P as q}from"./PaperFeedFilters-D2TbUu0j.js";import{D as U,M as $,F as K,A as B,q as W}from"./chatSessions-Dz4Iu-O1.js";import{S as g}from"./chatPrompts-CDY3UGU1.js";import{t as G,d as k}from"./transform-2Gnjg1jt.js";import{u as z}from"./usePapers-CdB1OuZ5.js";import{u as Q}from"./useIntersectionObserver-7HCpY83L.js";import{P as V}from"./usePeriodFilter-DK_4NHrn.js";import{S as f}from"./skeleton-CB-heJjl.js";import{A as X,a as Y}from"./alert-_EYQlDHA.js";import{u as L}from"./useQuery-Bh9FZQpL.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CzzYUeDW.js";import"./useBaseQuery-B8T7kRNC.js";const J=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Z={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},ee={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},S=45,se=1800,te=25,ae=350,re=a=>{const[i,d]=p.useState(g[0].slice(0,1));return p.useEffect(()=>{var r,u;if(!a)return;if((u=(r=window.matchMedia)==null?void 0:r.call(window,"(prefers-reduced-motion: reduce)"))!=null&&u.matches){d(g[0]);return}let m=0,n=1,h=!1,o;d(g[0].slice(0,n));const l=()=>{const x=g[m];if(!h){if(n+=1,d(x.slice(0,n)),n===x.length){h=!0,o=window.setTimeout(l,se);return}o=window.setTimeout(l,S);return}if(n-=1,d(x.slice(0,n)),n===0){h=!1,m=(m+1)%g.length,o=window.setTimeout(l,ae);return}o=window.setTimeout(l,te)};return o=window.setTimeout(l,S),()=>window.clearTimeout(o)},[a]),i},ie=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ne=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",oe=()=>{const a=O(),[i,d]=p.useState(""),[m,n]=p.useState(U),h=re(!i),o=p.useRef(null);p.useEffect(()=>{const r=o.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[i]);const l=(r=i)=>{const u=r.trim();u&&(W(u,m),a("/chat"))};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:o,rows:1,value:i,placeholder:h,"aria-label":"Ask the assistant",onChange:r=>d(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),l())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx($,{models:K,selectedModel:m,onModelChange:n}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${i.trim()?" chat-send-on":""}`,onClick:()=>l(),disabled:!i.trim(),"aria-label":"Ask the assistant",children:e.jsx(B,{})})]})]})},we=()=>{var b,w,v,P,A;const[a,i]=H(),d=ie(a.get("order_by")),m=ne(a.get("time")),n=a.get("has_code")==="true",h=a.get("has_hf_artifacts")==="true",o=ee[m],l=s=>{const t=new URLSearchParams(a);t.set("order_by",s),i(t)},r=s=>{const t=new URLSearchParams(a);t.set("time",Z[s]),i(t)},u=s=>{const t=new URLSearchParams(a);s?t.set("has_code","true"):t.delete("has_code"),i(t)},x=s=>{const t=new URLSearchParams(a);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),i(t)},N=L({queryKey:["top-tasks-sidebar"],queryFn:()=>E.getTopTasks({limit:8}),staleTime:10*60*1e3}),j=L({queryKey:["trending-tasks-sidebar"],queryFn:()=>E.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=z({page_size:30,order_by:d,order_dir:"desc",time:m,include_resources:!0,has_code:n,has_hf_artifacts:h}),y=p.useMemo(()=>{var t;return(((t=c.data)==null?void 0:t.pages.flatMap(R=>R.results))||[]).map(G)},[c.data]),{targetRef:C,isIntersecting:T}=Q({rootMargin:"400px"});p.useEffect(()=>{T&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[T,c.hasNextPage,c.isFetchingNextPage]);const M=c.isLoading,D=c.error;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:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),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"}),N.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),(b=N.data)==null?void 0:b.map(s=>e.jsxs(_,{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.jsx(_,{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"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),((v=(w=j.data)==null?void 0:w.results)==null?void 0:v.length)===0&&!j.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(P=j.data)==null?void 0:P.results)==null?void 0:A.map(s=>e.jsxs(_,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[F()&&e.jsx(oe,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:J.map(([s,t])=>e.jsx("button",{className:`sort-btn ${d===s?"active":""}`,onClick:()=>l(s),children:t},s))}),e.jsx(q,{hasCode:n,hasHfArtifacts:h,onHasCodeChange:u,onHasHfArtifactsChange:x})]}),e.jsx("div",{className:"sort-options sort-options-time",children:V.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${o===s?"active":""}`,onClick:()=>r(s),children:s},s))})]}),D&&e.jsx(X,{variant:"destructive",className:"mb-4",children:e.jsx(Y,{children:"Failed to load papers. Please try again."})}),M?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(f,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(f,{className:"h-6 w-3/4"}),e.jsx(f,{className:"h-4 w-1/2"}),e.jsx(f,{className:"h-12 w-full"})]})]},t))}):y.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:y.map((s,t)=>e.jsx(I,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:C,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{oe as AskAssistant,we as default};
 
1
+ import{u as O,r as p,j as e,a as H,L as _,i as F,b as E}from"./index-DREEM5p7.js";import{P as I}from"./components-DCcxy0XP.js";import{P as q}from"./PaperFeedFilters-tral1E4E.js";import{D as U,M as $,F as K,A as B,q as W}from"./chatSessions-RaHJTN_0.js";import{S as g}from"./chatPrompts-CDY3UGU1.js";import{t as G,d as k}from"./transform-DA_akiPE.js";import{u as z}from"./usePapers-Ds6XBgz_.js";import{u as Q}from"./useIntersectionObserver-BUuG_jQu.js";import{P as V}from"./usePeriodFilter-eyOsDoT9.js";import{S as f}from"./skeleton-C9cmIM7L.js";import{A as X,a as Y}from"./alert-DqWQWZ1R.js";import{u as L}from"./useQuery-pzEX4kGt.js";import"./LatexTitle-DYInY1bH.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-BWf7CLsF.js";import"./useBaseQuery-BnoYgsiR.js";const J=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Z={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},ee={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},S=45,se=1800,te=25,ae=350,re=a=>{const[i,d]=p.useState(g[0].slice(0,1));return p.useEffect(()=>{var r,u;if(!a)return;if((u=(r=window.matchMedia)==null?void 0:r.call(window,"(prefers-reduced-motion: reduce)"))!=null&&u.matches){d(g[0]);return}let m=0,n=1,h=!1,o;d(g[0].slice(0,n));const l=()=>{const x=g[m];if(!h){if(n+=1,d(x.slice(0,n)),n===x.length){h=!0,o=window.setTimeout(l,se);return}o=window.setTimeout(l,S);return}if(n-=1,d(x.slice(0,n)),n===0){h=!1,m=(m+1)%g.length,o=window.setTimeout(l,ae);return}o=window.setTimeout(l,te)};return o=window.setTimeout(l,S),()=>window.clearTimeout(o)},[a]),i},ie=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ne=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",oe=()=>{const a=O(),[i,d]=p.useState(""),[m,n]=p.useState(U),h=re(!i),o=p.useRef(null);p.useEffect(()=>{const r=o.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[i]);const l=(r=i)=>{const u=r.trim();u&&(W(u,m),a("/chat"))};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:o,rows:1,value:i,placeholder:h,"aria-label":"Ask the assistant",onChange:r=>d(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),l())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx($,{models:K,selectedModel:m,onModelChange:n}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${i.trim()?" chat-send-on":""}`,onClick:()=>l(),disabled:!i.trim(),"aria-label":"Ask the assistant",children:e.jsx(B,{})})]})]})},we=()=>{var b,w,v,P,A;const[a,i]=H(),d=ie(a.get("order_by")),m=ne(a.get("time")),n=a.get("has_code")==="true",h=a.get("has_hf_artifacts")==="true",o=ee[m],l=s=>{const t=new URLSearchParams(a);t.set("order_by",s),i(t)},r=s=>{const t=new URLSearchParams(a);t.set("time",Z[s]),i(t)},u=s=>{const t=new URLSearchParams(a);s?t.set("has_code","true"):t.delete("has_code"),i(t)},x=s=>{const t=new URLSearchParams(a);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),i(t)},N=L({queryKey:["top-tasks-sidebar"],queryFn:()=>E.getTopTasks({limit:8}),staleTime:10*60*1e3}),j=L({queryKey:["trending-tasks-sidebar"],queryFn:()=>E.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=z({page_size:30,order_by:d,order_dir:"desc",time:m,include_resources:!0,has_code:n,has_hf_artifacts:h}),y=p.useMemo(()=>{var t;return(((t=c.data)==null?void 0:t.pages.flatMap(R=>R.results))||[]).map(G)},[c.data]),{targetRef:C,isIntersecting:T}=Q({rootMargin:"400px"});p.useEffect(()=>{T&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[T,c.hasNextPage,c.isFetchingNextPage]);const M=c.isLoading,D=c.error;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:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),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"}),N.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),(b=N.data)==null?void 0:b.map(s=>e.jsxs(_,{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.jsx(_,{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"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(f,{className:"h-5 w-full"},t))}),((v=(w=j.data)==null?void 0:w.results)==null?void 0:v.length)===0&&!j.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(P=j.data)==null?void 0:P.results)==null?void 0:A.map(s=>e.jsxs(_,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[F()&&e.jsx(oe,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:J.map(([s,t])=>e.jsx("button",{className:`sort-btn ${d===s?"active":""}`,onClick:()=>l(s),children:t},s))}),e.jsx(q,{hasCode:n,hasHfArtifacts:h,onHasCodeChange:u,onHasHfArtifactsChange:x})]}),e.jsx("div",{className:"sort-options sort-options-time",children:V.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${o===s?"active":""}`,onClick:()=>r(s),children:s},s))})]}),D&&e.jsx(X,{variant:"destructive",className:"mb-4",children:e.jsx(Y,{children:"Failed to load papers. Please try again."})}),M?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(f,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(f,{className:"h-6 w-3/4"}),e.jsx(f,{className:"h-4 w-1/2"}),e.jsx(f,{className:"h-12 w-full"})]})]},t))}):y.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:y.map((s,t)=>e.jsx(I,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:C,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{oe as AskAssistant,we as default};
assets/{FrameworksIndexView-DaHgLjlV.js → FrameworksIndexView-BUEoxJ4T.js} RENAMED
@@ -1 +1 @@
1
- import{R as c,j as e,L as d,b as m}from"./index-Bo5_2OqZ.js";import{u as h}from"./useQuery-Bh9FZQpL.js";import{I as g}from"./components-BbXgE2lV.js";import{e as p,h as u}from"./transform-2Gnjg1jt.js";import"./useBaseQuery-B8T7kRNC.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";const f={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},x={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},j={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},v={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},k={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},w=({platform:r})=>{const i=p(u(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:i.bg,color:i.text},children:f[r]})},_=({framework:r})=>e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card",children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(i=>e.jsx(w,{platform:i},i))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(d,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Paper"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(g,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]}),B=()=>{var l;const r=h({queryKey:["framework-catalog"],queryFn:()=>m.getFrameworkCatalog()}),i=((l=r.data)==null?void 0:l.domains)??[],o=i.reduce((a,s)=>a+s.categories.reduce((n,t)=>n+t.frameworks.length,0),0);return c.useEffect(()=>{var s;const a=window.location.hash.slice(1);a&&((s=document.getElementById(a))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),i.map(a=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:x,children:[e.jsxs("div",{children:[e.jsx("h2",{style:j,children:a.name}),e.jsx("div",{style:v,children:a.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.categories.length," ",a.categories.length===1?"category":"categories"," ·"," ",a.categories.reduce((s,n)=>s+n.frameworks.length,0)," frameworks"]})]}),a.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:k,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(n=>e.jsx(_,{framework:n},n.slug))})]},s.slug))]},a.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[o," frameworks across ",i.length," ",i.length===1?"domain":"domains",". More areas coming soon."]})]})};export{B as default};
 
1
+ import{R as c,j as e,L as d,b as m}from"./index-DREEM5p7.js";import{u as h}from"./useQuery-pzEX4kGt.js";import{I as g}from"./components-DCcxy0XP.js";import{e as p,h as u}from"./transform-DA_akiPE.js";import"./useBaseQuery-BnoYgsiR.js";import"./LatexTitle-DYInY1bH.js";import"./katex.min-BSBacQyE.js";const f={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},x={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},j={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},v={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},k={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},w=({platform:r})=>{const i=p(u(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:i.bg,color:i.text},children:f[r]})},_=({framework:r})=>e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card",children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(i=>e.jsx(w,{platform:i},i))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(d,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Paper"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(g,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]}),B=()=>{var l;const r=h({queryKey:["framework-catalog"],queryFn:()=>m.getFrameworkCatalog()}),i=((l=r.data)==null?void 0:l.domains)??[],o=i.reduce((a,s)=>a+s.categories.reduce((n,t)=>n+t.frameworks.length,0),0);return c.useEffect(()=>{var s;const a=window.location.hash.slice(1);a&&((s=document.getElementById(a))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),i.map(a=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:x,children:[e.jsxs("div",{children:[e.jsx("h2",{style:j,children:a.name}),e.jsx("div",{style:v,children:a.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.categories.length," ",a.categories.length===1?"category":"categories"," ·"," ",a.categories.reduce((s,n)=>s+n.frameworks.length,0)," frameworks"]})]}),a.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:k,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(n=>e.jsx(_,{framework:n},n.slug))})]},s.slug))]},a.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[o," frameworks across ",i.length," ",i.length===1?"domain":"domains",". More areas coming soon."]})]})};export{B as default};
assets/{LatexTitle-qoY4vrTZ.js → LatexTitle-DYInY1bH.js} RENAMED
@@ -1 +1 @@
1
- import{j as o,r as g}from"./index-Bo5_2OqZ.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};
 
1
+ import{j as o,r as g}from"./index-DREEM5p7.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-VH1HEGnz.js → MarkdownText-CNYqDApy.js} RENAMED
@@ -1 +1 @@
1
- import{U as l,j as s,L as u}from"./index-Bo5_2OqZ.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-DTmodbgi.js";import{M as d,r as w}from"./index-C-0CcYmz.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M};
 
1
+ import{U as l,j as s,L as u}from"./index-DREEM5p7.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-D-wxSmXC.js";import{M as d,r as w}from"./index-Dm_H11O9.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M};
assets/{MethodDetailView-M4qvY74O.js → MethodDetailView-Bxf6BpfX.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,r as E,e as W,a as V,L as R,b as v,al as Z}from"./index-Bo5_2OqZ.js";import{u as A}from"./useQuery-Bh9FZQpL.js";import{u as X}from"./useInfiniteQuery-CzzYUeDW.js";import{M as Y,P as J}from"./components-BbXgE2lV.js";import{P as ee}from"./PaperFeedFilters-D2TbUu0j.js";import{M as H}from"./MarkdownText-VH1HEGnz.js";import{s as te}from"./slug-BpH-Nkvz.js";import{t as se}from"./transform-2Gnjg1jt.js";import{u as ae}from"./useIntersectionObserver-7HCpY83L.js";import{S as M}from"./skeleton-CB-heJjl.js";import{A as ie,a as re}from"./alert-_EYQlDHA.js";import"./useBaseQuery-B8T7kRNC.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.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"},p=({x:s,y:a,w:i,h:r,fill:f,stroke:j,label:g,fontSize:c=10,multiline:y})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:a,width:i,height:r,rx:"3",ry:"3",fill:f,stroke:j,strokeWidth:"1"}),y?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:s+i/2,y:a+r/2-2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[0]}),e.jsx("text",{x:s+i/2,y:a+r/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[1]})]}):e.jsx("text",{x:s+i/2,y:a+r/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:g})]}),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:"Scaled Dot-Product Attention"}),e.jsx(p,{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(p,{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(p,{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(p,{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(p,{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(p,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(p,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(p,{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"]})]}),ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const a=30+s*75,i=60-s*8,r=240-s*30;return e.jsx("g",{children:e.jsx("rect",{x:a,y:(420-r)/2,width:i,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][s],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][s],strokeWidth:"1"})},s)}),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"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:50,y:i,width:r,height:f,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${s}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:210,y:i,width:r,height:f,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${s}`)}),[0,1,2,3].map(s=>{const a=60+s*80+(50-s*6)/2,i=50+(100-s*12);return e.jsx("path",{d:`M${i} ${a} L210 ${a}`,stroke:t.faint,strokeDasharray:"4 3"},`s${s}`)}),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"})]}),le=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(s=>[0,1,2].map(a=>e.jsx("rect",{x:20+a*40,y:40+s*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][s*3+a],stroke:t.faint},`${s}-${a}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(p,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(p,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{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×"})]}),O=()=>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(s=>{const a=25+s*56,i=(5-s)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:a,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-i*.1} 0.04 250)`,stroke:t.faint}),i<.4&&e.jsx("circle",{cx:a+25,cy:115,r:12-i*16,fill:t.orange,opacity:1-i*1.5})]},s)}),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)‖²]"})]}),oe=()=>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"})]}),ce=()=>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})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>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"}),de.map(([s,a],i)=>{const r=92+i*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),a?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:a}):null]},s)})]}),xe={attention:G,"self-attention":G,cnn:ne,"u-net":q,unet:q,vit:le,diffusion:O,ddpm:O,gan:oe,vae:ce,"agent-skills":he},me=({method:s})=>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:s.name||"method"}),e.jsx(p,{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(p,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(p,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),fe=({method:s})=>{const a=(s.slug||"").toLowerCase(),i=xe[a];if(i)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(i,{})});if(s.image_url){const r=a==="transformer"||a==="gpt-4"||a==="gpt-4o"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${r}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(me,{method:s})})},L=720,C=138,u={top:8,right:10,bottom:25,left:36},U=56,pe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=s=>pe.format(new Date(`${s}T00:00:00Z`)),ue=(s,a)=>{if(s===0)return new Set;const i=s>48?12:s>36?6:s>18?3:2,r=Math.max(1,Math.ceil(U/a)),f=Math.max(i,r),j=s-1,g=new Set([0,j]);for(let c=f;c<j;c+=f)(j-c)*a>=U&&g.add(c);return g},K=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const a=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${a}`},je=({history:s,methodName:a})=>{const[i,r]=E.useState(null),f=Math.max(1,...s.map(n=>n.paper_count)),j=L-u.left-u.right,g=C-u.top-u.bottom,c=s.length?j/s.length:j,y=Math.max(2,c*.68),d=ue(s.length,c),z=Array.from(new Set([0,Math.ceil(f/2),f])),x=i==null?null:s[i],S=x?K(x):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${L} ${C}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),z.map(n=>{const m=u.top+g-n/f*g;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:L-u.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:m+3,textAnchor:"end",children:n})]},n)}),s.map((n,m)=>{const k=n.paper_count/f*g,b=n.paper_count>0?Math.max(1,k):0,F=u.left+c*m+(c-y)/2,l=u.top+g-b,_=i===m,N=m===s.length-1,w=K(n);return e.jsxs("g",{className:`method-usage-bar${_?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(n.start_date)}: ${n.paper_count} ${n.paper_count===1?"paper":"papers"}${w?`. ${w}`:""}`,onMouseEnter:()=>r(m),onMouseLeave:()=>r(null),onFocus:()=>r(m),onBlur:()=>r(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+c*m,y:u.top,width:c,height:g}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:l,width:y,height:b,rx:"1.5"})]},n.start_date)}),s.map((n,m)=>d.has(m)?e.jsx("text",{className:"method-usage-x-label",x:u.left+c*(m+.5),y:C-11,textAnchor:"middle",children:s.length>48?ge.format(new Date(`${n.start_date}T00:00:00Z`)):B(n.start_date)},n.start_date):null)]}),x&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(x.start_date)}),e.jsxs("span",{children:[x.paper_count," ",x.paper_count===1?"paper":"papers",i===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(x.catalog_share??0).toFixed(2),"% of"," ",(x.catalog_paper_count??0).toLocaleString()," catalog papers"]}),S&&e.jsx("span",{children:S})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Q={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Pe=()=>{var N,w,$,P,T,I;const{methodSlug:s}=W(),[a,i]=V(),[r,f]=E.useState("trending"),j=a.get("has_code")==="true",g=a.get("has_hf_artifacts")==="true",c=o=>{const h=new URLSearchParams(a);o?h.set("has_code","true"):h.delete("has_code"),i(h)},y=o=>{const h=new URLSearchParams(a);o?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),i(h)},d=A({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),z=A({queryKey:["areas-all"],queryFn:()=>v.getAreas({page_size:50,ordering:"name"}),enabled:!!((N=d.data)!=null&&N.area_id),staleTime:10*60*1e3}),x=A({queryKey:["method-trend",s],queryFn:()=>v.getMethodTrend(s),enabled:!!s&&!!d.data,staleTime:10*60*1e3}),S=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",n=X({queryKey:["method-papers-infinite",s,S,j,g],queryFn:({pageParam:o=1})=>v.getMethodPapers(s,{page:o,page_size:20,order_by:S,order_dir:"desc",include_resources:!0,has_code:j,has_hf_artifacts:g}),getNextPageParam:o=>o.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Z}),m=A({queryKey:["related-methods",(w=d.data)==null?void 0:w.slug,($=d.data)==null?void 0:$.area_id,(P=d.data)==null?void 0:P.id],queryFn:async()=>{const o=Q[d.data.slug];return o?Promise.all(o.map(D=>v.getMethod(D))):(await v.getMethods({area_id:d.data.area_id,exclude_id:d.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!d.data&&(!!Q[d.data.slug]||!!d.data.area_id),staleTime:10*60*1e3}),k=E.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(D=>D.results))||[]).map(se)},[n.data]),{targetRef:b,isIntersecting:F}=ae({rootMargin:"200px"});if(E.useEffect(()=>{F&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[F,n.hasNextPage,n.isFetchingNextPage]),d.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(re,{children:"Method not found."})})});const l=d.data,_=(T=z.data)==null?void 0:T.results.find(o=>o.id===l.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(R,{to:"/methods",children:"Methods"}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(R,{to:`/methods#area-${te(_.name)}`,children:_.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:l.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${l.slug==="grokking"||l.slug==="latent-reasoning"?" method-hero-grid--wide-figure":""}`,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:l.name}),l.full_name&&l.full_name!==l.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:l.full_name}),l.description&&e.jsx(H,{className:"method-description",text:l.description}),l.source_url&&l.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:l.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:l.source_title}),l.introduced_year&&e.jsx("span",{className:"method-source-meta",children:l.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(l.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[x.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]})]}),l.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:l.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(je,{history:x.data.history,methodName:l.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(fe,{method:l}),l.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:l.image_credit})})]})]}),(((I=m.data)==null?void 0:I.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(o=>e.jsx(Y,{method:{slug:o.slug,name:o.name}},o.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([o,h])=>e.jsx("button",{className:`sort-btn ${r===o?"active":""}`,onClick:()=>f(o),children:h},o))}),e.jsx(ee,{hasCode:j,hasHfArtifacts:g,onHasCodeChange:c,onHasHfArtifactsChange:y})]}),e.jsxs("div",{className:"results-count",children:[k.length," papers mentioning ",l.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((o,h)=>e.jsx(M,{className:"h-40 w-full"},h))}):k.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:k.map((o,h)=>e.jsx(J,{paper:o,rank:h+1},o.id))}),e.jsx("div",{ref:b,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Pe as default};
 
1
+ import{j as e,r as E,e as W,a as V,L as R,b as v,al as Z}from"./index-DREEM5p7.js";import{u as A}from"./useQuery-pzEX4kGt.js";import{u as X}from"./useInfiniteQuery-BWf7CLsF.js";import{M as Y,P as J}from"./components-DCcxy0XP.js";import{P as ee}from"./PaperFeedFilters-tral1E4E.js";import{M as H}from"./MarkdownText-CNYqDApy.js";import{s as te}from"./slug-BpH-Nkvz.js";import{t as se}from"./transform-DA_akiPE.js";import{u as ae}from"./useIntersectionObserver-BUuG_jQu.js";import{S as M}from"./skeleton-C9cmIM7L.js";import{A as ie,a as re}from"./alert-DqWQWZ1R.js";import"./useBaseQuery-BnoYgsiR.js";import"./LatexTitle-DYInY1bH.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-D-wxSmXC.js";import"./index-Dm_H11O9.js";import"./hover-card-ZrDlt9Lf.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"},p=({x:s,y:a,w:i,h:r,fill:f,stroke:j,label:g,fontSize:c=10,multiline:y})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:a,width:i,height:r,rx:"3",ry:"3",fill:f,stroke:j,strokeWidth:"1"}),y?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:s+i/2,y:a+r/2-2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[0]}),e.jsx("text",{x:s+i/2,y:a+r/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[1]})]}):e.jsx("text",{x:s+i/2,y:a+r/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:g})]}),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:"Scaled Dot-Product Attention"}),e.jsx(p,{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(p,{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(p,{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(p,{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(p,{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(p,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(p,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(p,{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"]})]}),ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const a=30+s*75,i=60-s*8,r=240-s*30;return e.jsx("g",{children:e.jsx("rect",{x:a,y:(420-r)/2,width:i,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][s],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][s],strokeWidth:"1"})},s)}),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"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:50,y:i,width:r,height:f,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${s}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:210,y:i,width:r,height:f,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${s}`)}),[0,1,2,3].map(s=>{const a=60+s*80+(50-s*6)/2,i=50+(100-s*12);return e.jsx("path",{d:`M${i} ${a} L210 ${a}`,stroke:t.faint,strokeDasharray:"4 3"},`s${s}`)}),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"})]}),le=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(s=>[0,1,2].map(a=>e.jsx("rect",{x:20+a*40,y:40+s*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][s*3+a],stroke:t.faint},`${s}-${a}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(p,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(p,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{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×"})]}),O=()=>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(s=>{const a=25+s*56,i=(5-s)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:a,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-i*.1} 0.04 250)`,stroke:t.faint}),i<.4&&e.jsx("circle",{cx:a+25,cy:115,r:12-i*16,fill:t.orange,opacity:1-i*1.5})]},s)}),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)‖²]"})]}),oe=()=>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"})]}),ce=()=>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})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>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"}),de.map(([s,a],i)=>{const r=92+i*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),a?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:a}):null]},s)})]}),xe={attention:G,"self-attention":G,cnn:ne,"u-net":q,unet:q,vit:le,diffusion:O,ddpm:O,gan:oe,vae:ce,"agent-skills":he},me=({method:s})=>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:s.name||"method"}),e.jsx(p,{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(p,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(p,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),fe=({method:s})=>{const a=(s.slug||"").toLowerCase(),i=xe[a];if(i)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(i,{})});if(s.image_url){const r=a==="transformer"||a==="gpt-4"||a==="gpt-4o"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${r}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(me,{method:s})})},L=720,C=138,u={top:8,right:10,bottom:25,left:36},U=56,pe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=s=>pe.format(new Date(`${s}T00:00:00Z`)),ue=(s,a)=>{if(s===0)return new Set;const i=s>48?12:s>36?6:s>18?3:2,r=Math.max(1,Math.ceil(U/a)),f=Math.max(i,r),j=s-1,g=new Set([0,j]);for(let c=f;c<j;c+=f)(j-c)*a>=U&&g.add(c);return g},K=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const a=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${a}`},je=({history:s,methodName:a})=>{const[i,r]=E.useState(null),f=Math.max(1,...s.map(n=>n.paper_count)),j=L-u.left-u.right,g=C-u.top-u.bottom,c=s.length?j/s.length:j,y=Math.max(2,c*.68),d=ue(s.length,c),z=Array.from(new Set([0,Math.ceil(f/2),f])),x=i==null?null:s[i],S=x?K(x):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${L} ${C}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),z.map(n=>{const m=u.top+g-n/f*g;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:L-u.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:m+3,textAnchor:"end",children:n})]},n)}),s.map((n,m)=>{const k=n.paper_count/f*g,b=n.paper_count>0?Math.max(1,k):0,F=u.left+c*m+(c-y)/2,l=u.top+g-b,_=i===m,N=m===s.length-1,w=K(n);return e.jsxs("g",{className:`method-usage-bar${_?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(n.start_date)}: ${n.paper_count} ${n.paper_count===1?"paper":"papers"}${w?`. ${w}`:""}`,onMouseEnter:()=>r(m),onMouseLeave:()=>r(null),onFocus:()=>r(m),onBlur:()=>r(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+c*m,y:u.top,width:c,height:g}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:l,width:y,height:b,rx:"1.5"})]},n.start_date)}),s.map((n,m)=>d.has(m)?e.jsx("text",{className:"method-usage-x-label",x:u.left+c*(m+.5),y:C-11,textAnchor:"middle",children:s.length>48?ge.format(new Date(`${n.start_date}T00:00:00Z`)):B(n.start_date)},n.start_date):null)]}),x&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(x.start_date)}),e.jsxs("span",{children:[x.paper_count," ",x.paper_count===1?"paper":"papers",i===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(x.catalog_share??0).toFixed(2),"% of"," ",(x.catalog_paper_count??0).toLocaleString()," catalog papers"]}),S&&e.jsx("span",{children:S})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Q={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Pe=()=>{var N,w,$,P,T,I;const{methodSlug:s}=W(),[a,i]=V(),[r,f]=E.useState("trending"),j=a.get("has_code")==="true",g=a.get("has_hf_artifacts")==="true",c=o=>{const h=new URLSearchParams(a);o?h.set("has_code","true"):h.delete("has_code"),i(h)},y=o=>{const h=new URLSearchParams(a);o?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),i(h)},d=A({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),z=A({queryKey:["areas-all"],queryFn:()=>v.getAreas({page_size:50,ordering:"name"}),enabled:!!((N=d.data)!=null&&N.area_id),staleTime:10*60*1e3}),x=A({queryKey:["method-trend",s],queryFn:()=>v.getMethodTrend(s),enabled:!!s&&!!d.data,staleTime:10*60*1e3}),S=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",n=X({queryKey:["method-papers-infinite",s,S,j,g],queryFn:({pageParam:o=1})=>v.getMethodPapers(s,{page:o,page_size:20,order_by:S,order_dir:"desc",include_resources:!0,has_code:j,has_hf_artifacts:g}),getNextPageParam:o=>o.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Z}),m=A({queryKey:["related-methods",(w=d.data)==null?void 0:w.slug,($=d.data)==null?void 0:$.area_id,(P=d.data)==null?void 0:P.id],queryFn:async()=>{const o=Q[d.data.slug];return o?Promise.all(o.map(D=>v.getMethod(D))):(await v.getMethods({area_id:d.data.area_id,exclude_id:d.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!d.data&&(!!Q[d.data.slug]||!!d.data.area_id),staleTime:10*60*1e3}),k=E.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(D=>D.results))||[]).map(se)},[n.data]),{targetRef:b,isIntersecting:F}=ae({rootMargin:"200px"});if(E.useEffect(()=>{F&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[F,n.hasNextPage,n.isFetchingNextPage]),d.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(re,{children:"Method not found."})})});const l=d.data,_=(T=z.data)==null?void 0:T.results.find(o=>o.id===l.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(R,{to:"/methods",children:"Methods"}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(R,{to:`/methods#area-${te(_.name)}`,children:_.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:l.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${l.slug==="grokking"||l.slug==="latent-reasoning"?" method-hero-grid--wide-figure":""}`,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:l.name}),l.full_name&&l.full_name!==l.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:l.full_name}),l.description&&e.jsx(H,{className:"method-description",text:l.description}),l.source_url&&l.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:l.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:l.source_title}),l.introduced_year&&e.jsx("span",{className:"method-source-meta",children:l.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(l.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[x.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]})]}),l.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:l.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(je,{history:x.data.history,methodName:l.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(fe,{method:l}),l.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:l.image_credit})})]})]}),(((I=m.data)==null?void 0:I.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(o=>e.jsx(Y,{method:{slug:o.slug,name:o.name}},o.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([o,h])=>e.jsx("button",{className:`sort-btn ${r===o?"active":""}`,onClick:()=>f(o),children:h},o))}),e.jsx(ee,{hasCode:j,hasHfArtifacts:g,onHasCodeChange:c,onHasHfArtifactsChange:y})]}),e.jsxs("div",{className:"results-count",children:[k.length," papers mentioning ",l.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((o,h)=>e.jsx(M,{className:"h-40 w-full"},h))}):k.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:k.map((o,h)=>e.jsx(J,{paper:o,rank:h+1},o.id))}),e.jsx("div",{ref:b,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Pe as default};
assets/{MethodsIndexView-CKAKF4Rt.js → MethodsIndexView-CwdUmTTD.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as g,r as d,j as e,L as j,b as m}from"./index-Bo5_2OqZ.js";import{u as h}from"./useQuery-Bh9FZQpL.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-CB-heJjl.js";import{A as y,a as v}from"./alert-_EYQlDHA.js";import{T as _}from"./TaxonomySuggestionTile-T8WIATj3.js";import"./useBaseQuery-B8T7kRNC.js";import"./SignInToEditDialog-DW_1sVXp.js";import"./button-D8mDpZUh.js";import"./textarea-Cr9wwZtd.js";import"./dialog-BAxsIFdN.js";import"./useMutation-B8C_NgT5.js";import"./loader-circle-L2ccNPQf.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as g,r as d,j as e,L as j,b as m}from"./index-DREEM5p7.js";import{u as h}from"./useQuery-pzEX4kGt.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-C9cmIM7L.js";import{A as y,a as v}from"./alert-DqWQWZ1R.js";import{T as _}from"./TaxonomySuggestionTile-BFLpa7xW.js";import"./useBaseQuery-BnoYgsiR.js";import"./SignInToEditDialog-B6iSscgi.js";import"./button-BwpTjeyz.js";import"./textarea-DyNUKizV.js";import"./dialog-D77-YHgu.js";import"./useMutation-Bsr7m3Cl.js";import"./loader-circle-visLwNUg.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{NotFound-CN-zdP49.js → NotFound-DXRzD9Sh.js} RENAMED
@@ -1 +1 @@
1
- import{aM as o,r as a,j as t,L as s}from"./index-Bo5_2OqZ.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{aM as o,r as a,j as t,L as s}from"./index-DREEM5p7.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-CVziNQLK.js DELETED
@@ -1 +0,0 @@
1
- import{e as t,j as r}from"./index-Bo5_2OqZ.js";import{O as i}from"./OrganizationPaperFeed-BAdi7G6c.js";import m from"./NotFound-CN-zdP49.js";import"./useQuery-Bh9FZQpL.js";import"./useBaseQuery-B8T7kRNC.js";import"./components-BbXgE2lV.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./transform-2Gnjg1jt.js";import"./MarkdownText-VH1HEGnz.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.js";import"./skeleton-CB-heJjl.js";import"./PaperFeedFilters-D2TbUu0j.js";import"./alert-_EYQlDHA.js";import"./searchable-select-DirckEhK.js";import"./button-D8mDpZUh.js";import"./dialog-BAxsIFdN.js";import"./loader-circle-L2ccNPQf.js";import"./useIntersectionObserver-7HCpY83L.js";import"./usePapers-CdB1OuZ5.js";import"./useInfiniteQuery-CzzYUeDW.js";const V=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{V as default};
 
 
assets/OrganizationDetailView-CqgESAO-.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{e as t,j as r}from"./index-DREEM5p7.js";import{O as i}from"./OrganizationPaperFeed-BoBZY1EK.js";import m from"./NotFound-DXRzD9Sh.js";import"./useQuery-pzEX4kGt.js";import"./useBaseQuery-BnoYgsiR.js";import"./components-DCcxy0XP.js";import"./LatexTitle-DYInY1bH.js";import"./katex.min-BSBacQyE.js";import"./transform-DA_akiPE.js";import"./MarkdownText-CNYqDApy.js";import"./PaperPreviewLink-D-wxSmXC.js";import"./index-Dm_H11O9.js";import"./hover-card-ZrDlt9Lf.js";import"./skeleton-C9cmIM7L.js";import"./PaperFeedFilters-tral1E4E.js";import"./alert-DqWQWZ1R.js";import"./searchable-select-DYAHVeuu.js";import"./button-BwpTjeyz.js";import"./dialog-D77-YHgu.js";import"./loader-circle-visLwNUg.js";import"./useIntersectionObserver-BUuG_jQu.js";import"./usePapers-Ds6XBgz_.js";import"./useInfiniteQuery-BWf7CLsF.js";const V=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{V as default};
assets/{OrganizationPaperFeed-BAdi7G6c.js → OrganizationPaperFeed-BoBZY1EK.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,r as b,b as L,u as H,a as W,L as D}from"./index-Bo5_2OqZ.js";import{u as w}from"./useQuery-Bh9FZQpL.js";import{P as G}from"./components-BbXgE2lV.js";import{M as K}from"./MarkdownText-VH1HEGnz.js";import{S as $}from"./skeleton-CB-heJjl.js";import{P as Q}from"./PaperFeedFilters-D2TbUu0j.js";import{A as Z,a as B}from"./alert-_EYQlDHA.js";import{a as Y}from"./searchable-select-DirckEhK.js";import{u as J}from"./useIntersectionObserver-7HCpY83L.js";import{d as V}from"./usePapers-CdB1OuZ5.js";import{d as E,t as X}from"./transform-2Gnjg1jt.js";import ee from"./NotFound-CN-zdP49.js";const v=24*60*60*1e3,C=12,te=3,se=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),R=s=>new Date(`${s}T00:00:00Z`),ae=s=>s.toISOString().slice(0,10),re=(s,c)=>{if(s===0)return 0;const l=c.findIndex(d=>s<=d);return l===-1?4:l+1},ne=s=>{const c=R(s.start_date),l=R(s.end_date),d=new Date(c.getTime()-c.getUTCDay()*v),j=new Date(l.getTime()+(6-l.getUTCDay())*v),g=new Map(s.results.map(a=>[a.date,a.paper_count])),h=s.results.map(a=>a.paper_count).sort((a,N)=>a-N),n=[.25,.5,.75].map(a=>h[Math.min(h.length-1,Math.floor(h.length*a))]??1),u=[];for(let a=d.getTime();a<=j.getTime();a+=v){const N=new Date(a),m=ae(N),_=a>=c.getTime()&&a<=l.getTime(),p=_?g.get(m)??0:0;u.push({key:m,date:N,count:p,inRange:_,level:re(p,n)})}const y=u.length/7,x=[];let f=-1;for(let a=0;a<y;a+=1){const m=u.slice(a*7,a*7+7).find(_=>_.inRange&&(a===0||_.date.getUTCDate()<=7));m&&m.date.getUTCMonth()!==f&&(f=m.date.getUTCMonth(),x.length>0&&a-x[x.length-1].column<3&&x.pop(),x.push({label:m.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:a}))}return{days:u,months:x,weekCount:y}},ie=({data:s,organizationName:c})=>{const l=b.useRef(null),{days:d,months:j,weekCount:g}=b.useMemo(()=>ne(s),[s]),h=g*C+(g-1)*te;return b.useEffect(()=>{const n=l.current;n&&(n.scrollLeft=n.scrollWidth)},[g]),e.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[e.jsxs("div",{className:"organization-contributions-header",children:[e.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:"Paper contributions"}),e.jsxs("p",{className:"organization-contributions-summary",children:[s.total_count.toLocaleString()," ",s.total_count===1?"paper":"papers"," published in the last year"]})]}),e.jsx("div",{className:"organization-contributions-scroll",ref:l,children:e.jsxs("div",{className:"organization-contributions-plot",style:{width:h+34},role:"img","aria-label":`${c} published ${s.total_count} papers in the last year`,children:[e.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((n,u)=>e.jsx("span",{children:se.get(u)??""},u))}),e.jsxs("div",{children:[e.jsx("div",{className:"organization-contributions-months",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:j.map(n=>e.jsx("span",{style:{gridColumnStart:n.column+1},children:n.label},`${n.label}-${n.column}`))}),e.jsx("div",{className:"organization-contributions-grid",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:d.map(n=>e.jsx("span",{className:`organization-contribution-cell ${n.inRange?`level-${n.level}`:"is-outside"}`,title:n.inRange?`${n.count} ${n.count===1?"paper":"papers"} on ${n.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},n.key))})]})]})}),e.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[e.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(n=>e.jsx("span",{className:`organization-contribution-cell level-${n}`},n)),e.jsx("span",{children:"More"})]})]})},oe=({organizationSlug:s,organizationName:c})=>{const l=w({queryKey:["organization-contributions",s],queryFn:()=>L.getOrganizationContributions(s),staleTime:6e5});return l.isLoading?e.jsx($,{className:"organization-contributions-skeleton"}):l.data?e.jsx(ie,{data:l.data,organizationName:c}):null},le=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=s=>s==="date_published"||s==="citation_count"?s:"trending",ye=({organizationSlug:s,taskSlug:c})=>{var k,P,F,M,A,O,z,S;const l=H(),[d,j]=W(),[g,h]=b.useState(!1),n=ce(d.get("order_by")),u=d.get("has_code")==="true",y=d.get("has_hf_artifacts")==="true",x=w({queryKey:["organization",s],queryFn:()=>L.getOrganization(s),staleTime:10*60*1e3}),f=w({queryKey:["organization-areas-with-tasks",s],queryFn:()=>L.getOrganizationAreasWithTasks(s),staleTime:10*60*1e3}),a=V({organizationSlug:s,taskSlug:c,page_size:12,order_by:n,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:y,enabled:!!s}),{targetRef:N,isIntersecting:m}=J({rootMargin:"200px"});b.useEffect(()=>{m&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[m,a.hasNextPage,a.isFetchingNextPage]),b.useEffect(()=>{h(!1)},[s,c]);const _=b.useMemo(()=>{var r;return(((r=f.data)==null?void 0:r.results)??[]).flatMap(i=>i.tasks.filter(o=>!!o.slug).map(o=>({...o,slug:o.slug,label:E(o.name,o.slug)})))},[f.data]),p=_.find(r=>r.slug===c),T=b.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(i=>i.results.map(X))},[a.data]),t=x.data??((k=f.data)==null?void 0:k.organization),I=((F=(P=a.data)==null?void 0:P.pages[0])==null?void 0:F.count)??0;if(((M=x.error)==null?void 0:M.status)===404||((A=f.error)==null?void 0:A.status)===404||((O=a.error)==null?void 0:O.status)===404)return e.jsx(ee,{});if(f.error||a.error)return e.jsx("div",{className:"page",children:e.jsx(Z,{variant:"destructive",children:e.jsx(B,{children:"Failed to load organization papers. Please try again."})})});const U=r=>{const i=r.trim().toLocaleLowerCase();return _.filter(o=>`${o.label} ${o.slug}`.toLocaleLowerCase().includes(i)).map(o=>({value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}))},q=r=>{const i=r==="__all__"?`/orgs/${s}`:`/orgs/${s}/${r}`,o=d.toString();l({pathname:i,search:o?`?${o}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(D,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(D,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(t==null?void 0:t.name)??s}),p&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:E(p.name,p.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[t!=null&&t.logo_url&&!g?e.jsx("img",{src:t.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):t?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:t.name.slice(0,1).toUpperCase()}):null,(t==null?void 0:t.name)??e.jsx($,{className:"h-12 w-64"})]}),t&&e.jsxs("div",{className:"feed-subtitle",children:[((z=t.paper_count)==null?void 0:z.toLocaleString())??0," papers",(t.organization_trending_score??0)>0&&t.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",t.trending_rank," trending this month"]})]}),(t==null?void 0:t.description)&&e.jsx(K,{className:"method-description",text:t.description}),t&&e.jsxs("div",{className:"organization-hero-links",children:[t.website_url&&e.jsx("a",{href:t.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),t.hf_url&&e.jsx("a",{href:t.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),t.github_url&&e.jsx("a",{href:t.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),t&&e.jsx(oe,{organizationSlug:s,organizationName:t.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(Y,{value:c??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:p?{value:p.slug,label:p.label,description:`${p.paper_count.toLocaleString()} ${p.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((S=t==null?void 0:t.paper_count)==null?void 0:S.toLocaleString())??0} papers`},queryKey:["organization-task-options",s],queryFn:async r=>{var i;return[{value:"__all__",label:"All tasks",description:`${((i=t==null?void 0:t.paper_count)==null?void 0:i.toLocaleString())??0} papers`},...U(r)]},enabled:!f.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:le.map(([r,i])=>e.jsx("button",{type:"button",className:`sort-btn ${n===r?"active":""}`,onClick:()=>{const o=new URLSearchParams(d);r==="trending"?o.delete("order_by"):o.set("order_by",r),j(o)},children:i},r))}),e.jsx(Q,{hasCode:u,hasHfArtifacts:y,onHasCodeChange:r=>{const i=new URLSearchParams(d);r?i.set("has_code","true"):i.delete("has_code"),j(i)},onHasHfArtifactsChange:r=>{const i=new URLSearchParams(d);r?i.set("has_hf_artifacts","true"):i.delete("has_hf_artifacts"),j(i)}})]}),e.jsxs("div",{className:"results-count",children:[I.toLocaleString()," papers"]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,i)=>e.jsx($,{className:"h-40 w-full"},i))}):T.length===0?e.jsx("div",{className:"no-results",children:(t==null?void 0:t.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:T.map((r,i)=>e.jsx(G,{paper:r,rank:i+1},r.id))}),e.jsx("div",{ref:N,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ye as O};
 
1
+ import{j as e,r as b,b as L,u as H,a as W,L as D}from"./index-DREEM5p7.js";import{u as w}from"./useQuery-pzEX4kGt.js";import{P as G}from"./components-DCcxy0XP.js";import{M as K}from"./MarkdownText-CNYqDApy.js";import{S as $}from"./skeleton-C9cmIM7L.js";import{P as Q}from"./PaperFeedFilters-tral1E4E.js";import{A as Z,a as B}from"./alert-DqWQWZ1R.js";import{a as Y}from"./searchable-select-DYAHVeuu.js";import{u as J}from"./useIntersectionObserver-BUuG_jQu.js";import{d as V}from"./usePapers-Ds6XBgz_.js";import{d as E,t as X}from"./transform-DA_akiPE.js";import ee from"./NotFound-DXRzD9Sh.js";const v=24*60*60*1e3,C=12,te=3,se=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),R=s=>new Date(`${s}T00:00:00Z`),ae=s=>s.toISOString().slice(0,10),re=(s,c)=>{if(s===0)return 0;const l=c.findIndex(d=>s<=d);return l===-1?4:l+1},ne=s=>{const c=R(s.start_date),l=R(s.end_date),d=new Date(c.getTime()-c.getUTCDay()*v),j=new Date(l.getTime()+(6-l.getUTCDay())*v),g=new Map(s.results.map(a=>[a.date,a.paper_count])),h=s.results.map(a=>a.paper_count).sort((a,N)=>a-N),n=[.25,.5,.75].map(a=>h[Math.min(h.length-1,Math.floor(h.length*a))]??1),u=[];for(let a=d.getTime();a<=j.getTime();a+=v){const N=new Date(a),m=ae(N),_=a>=c.getTime()&&a<=l.getTime(),p=_?g.get(m)??0:0;u.push({key:m,date:N,count:p,inRange:_,level:re(p,n)})}const y=u.length/7,x=[];let f=-1;for(let a=0;a<y;a+=1){const m=u.slice(a*7,a*7+7).find(_=>_.inRange&&(a===0||_.date.getUTCDate()<=7));m&&m.date.getUTCMonth()!==f&&(f=m.date.getUTCMonth(),x.length>0&&a-x[x.length-1].column<3&&x.pop(),x.push({label:m.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:a}))}return{days:u,months:x,weekCount:y}},ie=({data:s,organizationName:c})=>{const l=b.useRef(null),{days:d,months:j,weekCount:g}=b.useMemo(()=>ne(s),[s]),h=g*C+(g-1)*te;return b.useEffect(()=>{const n=l.current;n&&(n.scrollLeft=n.scrollWidth)},[g]),e.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[e.jsxs("div",{className:"organization-contributions-header",children:[e.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:"Paper contributions"}),e.jsxs("p",{className:"organization-contributions-summary",children:[s.total_count.toLocaleString()," ",s.total_count===1?"paper":"papers"," published in the last year"]})]}),e.jsx("div",{className:"organization-contributions-scroll",ref:l,children:e.jsxs("div",{className:"organization-contributions-plot",style:{width:h+34},role:"img","aria-label":`${c} published ${s.total_count} papers in the last year`,children:[e.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((n,u)=>e.jsx("span",{children:se.get(u)??""},u))}),e.jsxs("div",{children:[e.jsx("div",{className:"organization-contributions-months",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:j.map(n=>e.jsx("span",{style:{gridColumnStart:n.column+1},children:n.label},`${n.label}-${n.column}`))}),e.jsx("div",{className:"organization-contributions-grid",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:d.map(n=>e.jsx("span",{className:`organization-contribution-cell ${n.inRange?`level-${n.level}`:"is-outside"}`,title:n.inRange?`${n.count} ${n.count===1?"paper":"papers"} on ${n.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},n.key))})]})]})}),e.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[e.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(n=>e.jsx("span",{className:`organization-contribution-cell level-${n}`},n)),e.jsx("span",{children:"More"})]})]})},oe=({organizationSlug:s,organizationName:c})=>{const l=w({queryKey:["organization-contributions",s],queryFn:()=>L.getOrganizationContributions(s),staleTime:6e5});return l.isLoading?e.jsx($,{className:"organization-contributions-skeleton"}):l.data?e.jsx(ie,{data:l.data,organizationName:c}):null},le=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=s=>s==="date_published"||s==="citation_count"?s:"trending",ye=({organizationSlug:s,taskSlug:c})=>{var k,P,F,M,A,O,z,S;const l=H(),[d,j]=W(),[g,h]=b.useState(!1),n=ce(d.get("order_by")),u=d.get("has_code")==="true",y=d.get("has_hf_artifacts")==="true",x=w({queryKey:["organization",s],queryFn:()=>L.getOrganization(s),staleTime:10*60*1e3}),f=w({queryKey:["organization-areas-with-tasks",s],queryFn:()=>L.getOrganizationAreasWithTasks(s),staleTime:10*60*1e3}),a=V({organizationSlug:s,taskSlug:c,page_size:12,order_by:n,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:y,enabled:!!s}),{targetRef:N,isIntersecting:m}=J({rootMargin:"200px"});b.useEffect(()=>{m&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[m,a.hasNextPage,a.isFetchingNextPage]),b.useEffect(()=>{h(!1)},[s,c]);const _=b.useMemo(()=>{var r;return(((r=f.data)==null?void 0:r.results)??[]).flatMap(i=>i.tasks.filter(o=>!!o.slug).map(o=>({...o,slug:o.slug,label:E(o.name,o.slug)})))},[f.data]),p=_.find(r=>r.slug===c),T=b.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(i=>i.results.map(X))},[a.data]),t=x.data??((k=f.data)==null?void 0:k.organization),I=((F=(P=a.data)==null?void 0:P.pages[0])==null?void 0:F.count)??0;if(((M=x.error)==null?void 0:M.status)===404||((A=f.error)==null?void 0:A.status)===404||((O=a.error)==null?void 0:O.status)===404)return e.jsx(ee,{});if(f.error||a.error)return e.jsx("div",{className:"page",children:e.jsx(Z,{variant:"destructive",children:e.jsx(B,{children:"Failed to load organization papers. Please try again."})})});const U=r=>{const i=r.trim().toLocaleLowerCase();return _.filter(o=>`${o.label} ${o.slug}`.toLocaleLowerCase().includes(i)).map(o=>({value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}))},q=r=>{const i=r==="__all__"?`/orgs/${s}`:`/orgs/${s}/${r}`,o=d.toString();l({pathname:i,search:o?`?${o}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(D,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(D,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(t==null?void 0:t.name)??s}),p&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:E(p.name,p.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[t!=null&&t.logo_url&&!g?e.jsx("img",{src:t.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):t?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:t.name.slice(0,1).toUpperCase()}):null,(t==null?void 0:t.name)??e.jsx($,{className:"h-12 w-64"})]}),t&&e.jsxs("div",{className:"feed-subtitle",children:[((z=t.paper_count)==null?void 0:z.toLocaleString())??0," papers",(t.organization_trending_score??0)>0&&t.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",t.trending_rank," trending this month"]})]}),(t==null?void 0:t.description)&&e.jsx(K,{className:"method-description",text:t.description}),t&&e.jsxs("div",{className:"organization-hero-links",children:[t.website_url&&e.jsx("a",{href:t.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),t.hf_url&&e.jsx("a",{href:t.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),t.github_url&&e.jsx("a",{href:t.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),t&&e.jsx(oe,{organizationSlug:s,organizationName:t.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(Y,{value:c??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:p?{value:p.slug,label:p.label,description:`${p.paper_count.toLocaleString()} ${p.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((S=t==null?void 0:t.paper_count)==null?void 0:S.toLocaleString())??0} papers`},queryKey:["organization-task-options",s],queryFn:async r=>{var i;return[{value:"__all__",label:"All tasks",description:`${((i=t==null?void 0:t.paper_count)==null?void 0:i.toLocaleString())??0} papers`},...U(r)]},enabled:!f.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:le.map(([r,i])=>e.jsx("button",{type:"button",className:`sort-btn ${n===r?"active":""}`,onClick:()=>{const o=new URLSearchParams(d);r==="trending"?o.delete("order_by"):o.set("order_by",r),j(o)},children:i},r))}),e.jsx(Q,{hasCode:u,hasHfArtifacts:y,onHasCodeChange:r=>{const i=new URLSearchParams(d);r?i.set("has_code","true"):i.delete("has_code"),j(i)},onHasHfArtifactsChange:r=>{const i=new URLSearchParams(d);r?i.set("has_hf_artifacts","true"):i.delete("has_hf_artifacts"),j(i)}})]}),e.jsxs("div",{className:"results-count",children:[I.toLocaleString()," papers"]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,i)=>e.jsx($,{className:"h-40 w-full"},i))}):T.length===0?e.jsx("div",{className:"no-results",children:(t==null?void 0:t.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:T.map((r,i)=>e.jsx(G,{paper:r,rank:i+1},r.id))}),e.jsx("div",{ref:N,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ye as O};
assets/OrganizationTaskView-DRLz5DdM.js DELETED
@@ -1 +0,0 @@
1
- import{e as i,j as t}from"./index-Bo5_2OqZ.js";import{O as m}from"./OrganizationPaperFeed-BAdi7G6c.js";import p from"./NotFound-CN-zdP49.js";import"./useQuery-Bh9FZQpL.js";import"./useBaseQuery-B8T7kRNC.js";import"./components-BbXgE2lV.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./transform-2Gnjg1jt.js";import"./MarkdownText-VH1HEGnz.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.js";import"./skeleton-CB-heJjl.js";import"./PaperFeedFilters-D2TbUu0j.js";import"./alert-_EYQlDHA.js";import"./searchable-select-DirckEhK.js";import"./button-D8mDpZUh.js";import"./dialog-BAxsIFdN.js";import"./loader-circle-L2ccNPQf.js";import"./useIntersectionObserver-7HCpY83L.js";import"./usePapers-CdB1OuZ5.js";import"./useInfiniteQuery-CzzYUeDW.js";const V=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{V as default};
 
 
assets/OrganizationTaskView-viUTzDP9.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{e as i,j as t}from"./index-DREEM5p7.js";import{O as m}from"./OrganizationPaperFeed-BoBZY1EK.js";import p from"./NotFound-DXRzD9Sh.js";import"./useQuery-pzEX4kGt.js";import"./useBaseQuery-BnoYgsiR.js";import"./components-DCcxy0XP.js";import"./LatexTitle-DYInY1bH.js";import"./katex.min-BSBacQyE.js";import"./transform-DA_akiPE.js";import"./MarkdownText-CNYqDApy.js";import"./PaperPreviewLink-D-wxSmXC.js";import"./index-Dm_H11O9.js";import"./hover-card-ZrDlt9Lf.js";import"./skeleton-C9cmIM7L.js";import"./PaperFeedFilters-tral1E4E.js";import"./alert-DqWQWZ1R.js";import"./searchable-select-DYAHVeuu.js";import"./button-BwpTjeyz.js";import"./dialog-D77-YHgu.js";import"./loader-circle-visLwNUg.js";import"./useIntersectionObserver-BUuG_jQu.js";import"./usePapers-Ds6XBgz_.js";import"./useInfiniteQuery-BWf7CLsF.js";const V=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{V as default};
assets/{OrganizationsIndexView-BFEZ8aLZ.js → OrganizationsIndexView-CI_hQP0M.js} RENAMED
@@ -1 +1 @@
1
- import{a as u,r as g,j as e,L as x,b as j}from"./index-Bo5_2OqZ.js";import{u as y}from"./useQuery-Bh9FZQpL.js";import{A as f,a as _}from"./alert-_EYQlDHA.js";import{S as N}from"./skeleton-CB-heJjl.js";import"./useBaseQuery-B8T7kRNC.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},q=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{q as default};
 
1
+ import{a as u,r as g,j as e,L as x,b as j}from"./index-DREEM5p7.js";import{u as y}from"./useQuery-pzEX4kGt.js";import{A as f,a as _}from"./alert-DqWQWZ1R.js";import{S as N}from"./skeleton-C9cmIM7L.js";import"./useBaseQuery-BnoYgsiR.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},q=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{q as default};
assets/{PaperDetailView-DAPjYsXV.js → PaperDetailView-BFBITCKf.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as bt,m as Ws,r as m,j as e,P as as,n as _e,o as rs,p as Te,q as Le,s as ns,t as jt,C as je,v as Qe,h as me,g as he,X as is,w as ve,x as Ys,y as os,z as Zs,A as ea,B as ta,D as sa,E as aa,F as Kt,G as ra,H as na,I as ia,J as oa,K as la,f as Je,R as vt,b as ge,M as ls,d as cs,N as ca,O as da,Q as ua,S as ds,T as ma,e as ha,U as pa,u as fa,V as xa,L as xe,W as ga,Y as ba,Z as ja,_ as va,$ as ya,a0 as _a,a1 as ka}from"./index-Bo5_2OqZ.js";import{u as re}from"./useQuery-Bh9FZQpL.js";import{I as J,S as wa,a as Na,T as Ca,M as Ea}from"./components-BbXgE2lV.js";import{C as Sa,E as Ra}from"./ExternalSourceEvalBadge-BYtEDxNm.js";import{L as qe,a as Pa}from"./LatexTitle-qoY4vrTZ.js";import{c as Aa}from"./transform-2Gnjg1jt.js";import{f as $a,D as Ia}from"./latexPlainText-DI8YEXVe.js";import{a as Fa}from"./usePapers-CdB1OuZ5.js";import{S as $e}from"./skeleton-CB-heJjl.js";import{A as La,a as Ta}from"./alert-_EYQlDHA.js";import{B as H}from"./button-D8mDpZUh.js";import{u as us}from"./index-DWt5uuhX.js";import{I as Z}from"./textarea-Cr9wwZtd.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as ue}from"./dialog-BAxsIFdN.js";import{u as pe}from"./useMutation-B8C_NgT5.js";import{S as yt,P as Xe,L as ae,a as Ua}from"./SignInToEditDialog-DW_1sVXp.js";import{S as Ve,a as Ot}from"./searchable-select-DirckEhK.js";import{L as ne}from"./loader-circle-L2ccNPQf.js";import{B as ms,D as Da,c as Ba,g as Ma,s as Ha,a as qa,b as za,d as Ka,i as Oa,e as Ga}from"./codexAddEvals-NAKdH-Ge.js";import{G as Gt}from"./github-D8cWDRad.js";import{M as Qa,r as Va}from"./index-C-0CcYmz.js";import"./useBaseQuery-B8T7kRNC.js";import"./hover-card-DrtqDSb0.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CzzYUeDW.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as bt,m as Ws,r as m,j as e,P as as,n as _e,o as rs,p as Te,q as Le,s as ns,t as jt,C as je,v as Qe,h as me,g as he,X as is,w as ve,x as Ys,y as os,z as Zs,A as ea,B as ta,D as sa,E as aa,F as Kt,G as ra,H as na,I as ia,J as oa,K as la,f as Je,R as vt,b as ge,M as ls,d as cs,N as ca,O as da,Q as ua,S as ds,T as ma,e as ha,U as pa,u as fa,V as xa,L as xe,W as ga,Y as ba,Z as ja,_ as va,$ as ya,a0 as _a,a1 as ka}from"./index-DREEM5p7.js";import{u as re}from"./useQuery-pzEX4kGt.js";import{I as J,S as wa,a as Na,T as Ca,M as Ea}from"./components-DCcxy0XP.js";import{C as Sa,E as Ra}from"./ExternalSourceEvalBadge-BLagMwlj.js";import{L as qe,a as Pa}from"./LatexTitle-DYInY1bH.js";import{c as Aa}from"./transform-DA_akiPE.js";import{f as $a,D as Ia}from"./latexPlainText-DI8YEXVe.js";import{a as Fa}from"./usePapers-Ds6XBgz_.js";import{S as $e}from"./skeleton-C9cmIM7L.js";import{A as La,a as Ta}from"./alert-DqWQWZ1R.js";import{B as H}from"./button-BwpTjeyz.js";import{u as us}from"./index-DRUOZk2M.js";import{I as Z}from"./textarea-DyNUKizV.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as ue}from"./dialog-D77-YHgu.js";import{u as pe}from"./useMutation-Bsr7m3Cl.js";import{S as yt,P as Xe,L as ae,a as Ua}from"./SignInToEditDialog-B6iSscgi.js";import{S as Ve,a as Ot}from"./searchable-select-DYAHVeuu.js";import{L as ne}from"./loader-circle-visLwNUg.js";import{B as ms,D as Da,c as Ba,g as Ma,s as Ha,a as qa,b as za,d as Ka,i as Oa,e as Ga}from"./codexAddEvals-9YtNb4JX.js";import{G as Gt}from"./github-BKa4wH1A.js";import{M as Qa,r as Va}from"./index-Dm_H11O9.js";import"./useBaseQuery-BnoYgsiR.js";import"./hover-card-ZrDlt9Lf.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-BWf7CLsF.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{PaperFeedFilters-D2TbUu0j.js → PaperFeedFilters-tral1E4E.js} RENAMED
@@ -1 +1 @@
1
- import{j as e}from"./index-Bo5_2OqZ.js";import{I as i}from"./components-BbXgE2lV.js";const n=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),d=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[e.jsx(l,{checked:s,icon:e.jsx(i,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(n,{}),label:"Has artifacts",onChange:o})]})]});export{d as P};
 
1
+ import{j as e}from"./index-DREEM5p7.js";import{I as i}from"./components-DCcxy0XP.js";const n=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),d=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[e.jsx(l,{checked:s,icon:e.jsx(i,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(n,{}),label:"Has artifacts",onChange:o})]})]});export{d as P};
assets/{PaperPreviewLink-DTmodbgi.js → PaperPreviewLink-D-wxSmXC.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-C-0CcYmz.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,$ as ce,U as ue,L as he,am as pe}from"./index-Bo5_2OqZ.js";import{u as me}from"./useQuery-Bh9FZQpL.js";import{H as fe,a as de,b as ge}from"./hover-card-DrtqDSb0.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
2
  `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,l,a){const u=o.value||"",p=l.createTracker(a),m="$".repeat(Math.max(ne(u,"$")+1,2)),g=l.enter("mathFlow");let x=p.move(m);if(o.meta){const d=l.enter("mathFlowMeta");x+=p.move(l.safe(o.meta,{after:`
3
  `,before:x,encode:["$"],...p.current()})),d()}return x+=p.move(`
4
  `),u&&(x+=p.move(u+`
 
1
+ import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-Dm_H11O9.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,$ as ce,U as ue,L as he,am as pe}from"./index-DREEM5p7.js";import{u as me}from"./useQuery-pzEX4kGt.js";import{H as fe,a as de,b as ge}from"./hover-card-ZrDlt9Lf.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
2
  `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,l,a){const u=o.value||"",p=l.createTracker(a),m="$".repeat(Math.max(ne(u,"$")+1,2)),g=l.enter("mathFlow");let x=p.move(m);if(o.meta){const d=l.enter("mathFlowMeta");x+=p.move(l.safe(o.meta,{after:`
3
  `,before:x,encode:["$"],...p.current()})),d()}return x+=p.move(`
4
  `),u&&(x+=p.move(u+`
assets/{PapersListView-CiElqeZj.js → PapersListView-DIDxh3hu.js} RENAMED
@@ -1 +1 @@
1
- import{a as A,r as i,j as e,L as I,b as T}from"./index-Bo5_2OqZ.js";import{I as F,P as L}from"./components-BbXgE2lV.js";import{t as C,d as R}from"./transform-2Gnjg1jt.js";import{u as k}from"./usePapers-CdB1OuZ5.js";import{u as D}from"./useDebounce-CIjDquLX.js";import{u as E,P as O}from"./usePeriodFilter-DK_4NHrn.js";import{u as B}from"./useIntersectionObserver-7HCpY83L.js";import{S as c}from"./skeleton-CB-heJjl.js";import{A as $,a as M}from"./alert-_EYQlDHA.js";import{u as q}from"./useQuery-Bh9FZQpL.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CzzYUeDW.js";import"./useBaseQuery-B8T7kRNC.js";const z=[["trending","trending"],["new","newest"],["cited","most cited"]],te=()=>{var x,g,j,f;const[d,N]=A(),o=d.get("search")||"",[p,v]=i.useState(o),t=D(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),N(s,{replace:!0})},[t]);const[n,b]=i.useState("new"),{period:P,setPeriod:y,publishedAfter:S}=E("All Time"),a=k({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:S,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(_=>_.results))||[]).map(C)},[a.data]),{targetRef:w,isIntersecting:h}=B({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:O.map(s=>e.jsx("button",{className:`period-btn ${P===s?"active":""}`,onClick:()=>y(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(F,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>v(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))}),(f=m.data)==null?void 0:f.map(s=>e.jsxs(I,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[R(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:z.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>b(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx($,{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(L,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:w,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};
 
1
+ import{a as A,r as i,j as e,L as I,b as T}from"./index-DREEM5p7.js";import{I as F,P as L}from"./components-DCcxy0XP.js";import{t as C,d as R}from"./transform-DA_akiPE.js";import{u as k}from"./usePapers-Ds6XBgz_.js";import{u as D}from"./useDebounce-Bpp_wNvr.js";import{u as E,P as O}from"./usePeriodFilter-eyOsDoT9.js";import{u as B}from"./useIntersectionObserver-BUuG_jQu.js";import{S as c}from"./skeleton-C9cmIM7L.js";import{A as $,a as M}from"./alert-DqWQWZ1R.js";import{u as q}from"./useQuery-pzEX4kGt.js";import"./LatexTitle-DYInY1bH.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-BWf7CLsF.js";import"./useBaseQuery-BnoYgsiR.js";const z=[["trending","trending"],["new","newest"],["cited","most cited"]],te=()=>{var x,g,j,f;const[d,N]=A(),o=d.get("search")||"",[p,v]=i.useState(o),t=D(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),N(s,{replace:!0})},[t]);const[n,b]=i.useState("new"),{period:P,setPeriod:y,publishedAfter:S}=E("All Time"),a=k({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:S,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(_=>_.results))||[]).map(C)},[a.data]),{targetRef:w,isIntersecting:h}=B({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:O.map(s=>e.jsx("button",{className:`period-btn ${P===s?"active":""}`,onClick:()=>y(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(F,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>v(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))}),(f=m.data)==null?void 0:f.map(s=>e.jsxs(I,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[R(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:z.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>b(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx($,{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(L,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:w,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-Oa-A9M7k.js → SavedPapersView-CaGL_b5-.js} RENAMED
@@ -1 +1 @@
1
- import{f as o,j as s,a7 as m,L as p,b as h}from"./index-Bo5_2OqZ.js";import{u as x}from"./useQuery-Bh9FZQpL.js";import{T as u,P as j}from"./components-BbXgE2lV.js";import{S as r}from"./skeleton-CB-heJjl.js";import{A as v,a as N}from"./alert-_EYQlDHA.js";import{t as g}from"./transform-2Gnjg1jt.js";import"./useBaseQuery-B8T7kRNC.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";const C=()=>{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{C as default};
 
1
+ import{f as o,j as s,a7 as m,L as p,b as h}from"./index-DREEM5p7.js";import{u as x}from"./useQuery-pzEX4kGt.js";import{T as u,P as j}from"./components-DCcxy0XP.js";import{S as r}from"./skeleton-C9cmIM7L.js";import{A as v,a as N}from"./alert-DqWQWZ1R.js";import{t as g}from"./transform-DA_akiPE.js";import"./useBaseQuery-BnoYgsiR.js";import"./LatexTitle-DYInY1bH.js";import"./katex.min-BSBacQyE.js";const C=()=>{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{C as default};
assets/{SearchOverlay-zJH1AgbF.js → SearchOverlay-D_bPcYUC.js} RENAMED
@@ -1 +1 @@
1
- import{r as C,u as L,R as T,i as $,j as s,b as m}from"./index-Bo5_2OqZ.js";import{u as p}from"./useQuery-Bh9FZQpL.js";import{L as A}from"./LatexTitle-qoY4vrTZ.js";import{u as D}from"./useDebounce-CIjDquLX.js";import{e as z,h as M,d as B}from"./transform-2Gnjg1jt.js";import"./useBaseQuery-B8T7kRNC.js";import"./katex.min-BSBacQyE.js";const I=10,J=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/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:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/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))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/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))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{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)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{J as default};
 
1
+ import{r as C,u as L,R as T,i as $,j as s,b as m}from"./index-DREEM5p7.js";import{u as p}from"./useQuery-pzEX4kGt.js";import{L as A}from"./LatexTitle-DYInY1bH.js";import{u as D}from"./useDebounce-Bpp_wNvr.js";import{e as z,h as M,d as B}from"./transform-DA_akiPE.js";import"./useBaseQuery-BnoYgsiR.js";import"./katex.min-BSBacQyE.js";const I=10,J=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/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:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/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))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/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))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{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)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{J as default};
assets/{SettingsView-2Aab7oZR.js → SettingsView-D4puMwAm.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as v,f as q,V as Q,ap as B,R as g,h as z,j as e,a7 as h,d as P,b as y,aq as W}from"./index-Bo5_2OqZ.js";import{u as Y}from"./useQuery-Bh9FZQpL.js";import{u as p}from"./useMutation-B8C_NgT5.js";import{S as F}from"./switch-DGcXQvGy.js";import{f as $,D as K}from"./latexPlainText-DI8YEXVe.js";import{b as V,u as L,r as G,a as j}from"./openrouter-C1zb8Waa.js";import{E as I}from"./external-link-BjWlCUOk.js";import"./useBaseQuery-B8T7kRNC.js";import"./index-DWt5uuhX.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as v,f as q,V as Q,ap as B,R as g,h as z,j as e,a7 as h,d as P,b as y,aq as W}from"./index-DREEM5p7.js";import{u as Y}from"./useQuery-pzEX4kGt.js";import{u as p}from"./useMutation-Bsr7m3Cl.js";import{S as F}from"./switch-BerK6OR6.js";import{f as $,D as K}from"./latexPlainText-DI8YEXVe.js";import{b as V,u as L,r as G,a as j}from"./openrouter-0x0PaeCZ.js";import{E as I}from"./external-link-BJNvNNt4.js";import"./useBaseQuery-BnoYgsiR.js";import"./index-DRUOZk2M.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{SharedChatView-DvAcanFw.js → SharedChatView-CSRRgem6.js} RENAMED
@@ -1 +1 @@
1
- import{e as g,u as f,r as u,j as e,l as x}from"./index-Bo5_2OqZ.js";import{u as v}from"./useQuery-Bh9FZQpL.js";import{C as j,U as S,A as y}from"./ChatMessage-DAiy1xqv.js";import{m as p,S as b,p as N,q,n as C}from"./chatSessions-Dz4Iu-O1.js";import"./useBaseQuery-B8T7kRNC.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DrtqDSb0.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";const k=({detail:d})=>{const[i,h]=u.useState(()=>N(d)),a=u.useMemo(()=>{const t={};for(const n of i)for(const s of n.blocks??[])if(s.kind==="tool")for(const r of s.results??[])t[r.route_id]=r;return t},[i]),l=(t,n)=>{h(s=>s.map(r=>{var o;return r.id!==t?r:{...r,blocks:(o=r.blocks)==null?void 0:o.map((c,m)=>m===n&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??""},t.id):e.jsx(y,{msg:t,papers:a,onToggleBlock:l},t.id))})},B=()=>{const{shareId:d=""}=g(),i=f(),h=x(),a=v({queryKey:["shared-chat",d],queryFn:()=>C(d),retry:(n,s)=>!(s instanceof p&&s.status===404)&&n<1});u.useEffect(()=>{const n=document.title,s=document.head.querySelector('meta[name="robots"]'),r=s==null?void 0:s.content,o=s??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",s||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=n,s?s.content=r??"":o.remove()}},[]);const l=n=>{q(n,void 0,{autoSend:!1}),i("/chat")},t=a.error instanceof p&&a.error.status===404;return a.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(b,{})," Loading shared conversation…"]}):t?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):a.isError||!a.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void a.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(k,{detail:a.data},a.data.updated_at),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users. Hugging Face models also require the Inference Providers permission granted during sign-in; choose personal or organization billing in"," ",e.jsx("a",{href:"/settings",children:"Settings"}),"."]}),e.jsx(j,{onSend:l,placeholder:"Ask a new research question…"})]})]})]})};export{B as default};
 
1
+ import{e as g,u as f,r as u,j as e,l as x}from"./index-DREEM5p7.js";import{u as v}from"./useQuery-pzEX4kGt.js";import{C as j,U as S,A as y}from"./ChatMessage-EkiSiSMU.js";import{m as p,S as b,p as N,q,n as C}from"./chatSessions-RaHJTN_0.js";import"./useBaseQuery-BnoYgsiR.js";import"./katex.min-BSBacQyE.js";import"./hover-card-ZrDlt9Lf.js";import"./PaperPreviewLink-D-wxSmXC.js";import"./index-Dm_H11O9.js";const k=({detail:d})=>{const[i,h]=u.useState(()=>N(d)),a=u.useMemo(()=>{const t={};for(const n of i)for(const s of n.blocks??[])if(s.kind==="tool")for(const r of s.results??[])t[r.route_id]=r;return t},[i]),l=(t,n)=>{h(s=>s.map(r=>{var o;return r.id!==t?r:{...r,blocks:(o=r.blocks)==null?void 0:o.map((c,m)=>m===n&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??""},t.id):e.jsx(y,{msg:t,papers:a,onToggleBlock:l},t.id))})},B=()=>{const{shareId:d=""}=g(),i=f(),h=x(),a=v({queryKey:["shared-chat",d],queryFn:()=>C(d),retry:(n,s)=>!(s instanceof p&&s.status===404)&&n<1});u.useEffect(()=>{const n=document.title,s=document.head.querySelector('meta[name="robots"]'),r=s==null?void 0:s.content,o=s??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",s||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=n,s?s.content=r??"":o.remove()}},[]);const l=n=>{q(n,void 0,{autoSend:!1}),i("/chat")},t=a.error instanceof p&&a.error.status===404;return a.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(b,{})," Loading shared conversation…"]}):t?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):a.isError||!a.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void a.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(k,{detail:a.data},a.data.updated_at),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users. Hugging Face models also require the Inference Providers permission granted during sign-in; choose personal or organization billing in"," ",e.jsx("a",{href:"/settings",children:"Settings"}),"."]}),e.jsx(j,{onSend:l,placeholder:"Ask a new research question…"})]})]})]})};export{B as default};
assets/{SignInToEditDialog-DW_1sVXp.js → SignInToEditDialog-B6iSscgi.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as X,r as i,j as e,a5 as W,v as q,a6 as Q,g as Z,w as ee,X as te,C as se,a7 as ae}from"./index-Bo5_2OqZ.js";import{B as D}from"./button-D8mDpZUh.js";import{I as h,T as re}from"./textarea-Cr9wwZtd.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-BAxsIFdN.js";import{u as oe}from"./useMutation-B8C_NgT5.js";import{L as ie}from"./loader-circle-L2ccNPQf.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as X,r as i,j as e,a5 as W,v as q,a6 as Q,g as Z,w as ee,X as te,C as se,a7 as ae}from"./index-DREEM5p7.js";import{B as D}from"./button-BwpTjeyz.js";import{I as h,T as re}from"./textarea-DyNUKizV.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-D77-YHgu.js";import{u as oe}from"./useMutation-Bsr7m3Cl.js";import{L as ie}from"./loader-circle-visLwNUg.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{SubmissionsDashboard-D7fHw9fZ.js → SubmissionsDashboard-yAoBG5cW.js} RENAMED
@@ -1,4 +1,4 @@
1
- var fe=s=>{throw TypeError(s)};var X=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(X(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(X(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(X(s,t,"access private method"),i);import{as as Ae,at as ee,au as Oe,av as Me,h as ke,r as $,aw as Fe,c as Qe,j as e,ax as Se,ay as qe,R as N,v as q,az as Ie,$ as Ue,f as De,g as we,am as Le,aA as $e,aB as Te,aC as Be,aD as ze,aE as He,aF as se}from"./index-Bo5_2OqZ.js";import{Q as Ee,u as Ke,a as Pe,e as Je,b as We,c as Ve,s as pe,f as Ye,g as Ge}from"./useBaseQuery-B8T7kRNC.js";import{u as ge}from"./useQuery-Bh9FZQpL.js";import{u as be}from"./useMutation-B8C_NgT5.js";import{R as Xe,S as Ze,C as es,a as ss}from"./shield-alert-C2VCWA2k.js";import{L as B}from"./loader-circle-L2ccNPQf.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var D,S,L,U,w,Q,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,D);E(this,S);E(this,L);E(this,U);E(this,w);E(this,Q);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,D,t),_(this,U,n),_(this,L,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,L,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,L));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,L=new WeakMap,U=new WeakMap,w=new WeakMap,Q=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,Q)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,Q,Me(p(this,Q),i(t)))),p(this,Q)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,D).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,D),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,Q),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function Y({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ve(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):Fe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ye(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ge({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ var fe=s=>{throw TypeError(s)};var X=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(X(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(X(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(X(s,t,"access private method"),i);import{as as Ae,at as ee,au as Oe,av as Me,h as ke,r as $,aw as Fe,c as Qe,j as e,ax as Se,ay as qe,R as N,v as q,az as Ie,$ as Ue,f as De,g as we,am as Le,aA as $e,aB as Te,aC as Be,aD as ze,aE as He,aF as se}from"./index-DREEM5p7.js";import{Q as Ee,u as Ke,a as Pe,e as Je,b as We,c as Ve,s as pe,f as Ye,g as Ge}from"./useBaseQuery-BnoYgsiR.js";import{u as ge}from"./useQuery-pzEX4kGt.js";import{u as be}from"./useMutation-Bsr7m3Cl.js";import{R as Xe,S as Ze,C as es,a as ss}from"./shield-alert-0lJnM8Xf.js";import{L as B}from"./loader-circle-visLwNUg.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var D,S,L,U,w,Q,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,D);E(this,S);E(this,L);E(this,U);E(this,w);E(this,Q);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,D,t),_(this,U,n),_(this,L,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,L,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,L));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,L=new WeakMap,U=new WeakMap,w=new WeakMap,Q=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,Q)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,Q,Me(p(this,Q),i(t)))),p(this,Q)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,D).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,D),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,Q),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function Y({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ve(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):Fe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ye(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ge({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{SubmitView-CRMmJZk-.js → SubmitView-JHOOxet2.js} RENAMED
@@ -1 +1 @@
1
- import{u as R,h as T,g as _,R as n,j as e,ar as D}from"./index-Bo5_2OqZ.js";import{u as k}from"./useMutation-B8C_NgT5.js";import{A as w,a as C}from"./alert-_EYQlDHA.js";import{B as j}from"./button-D8mDpZUh.js";import{I as h,T as z}from"./textarea-Cr9wwZtd.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){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=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(g=>g.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,g]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,x]=n.useState(null),u=S(d),v=u==="external",c=k({mutationFn:t=>D(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{x(q(t))}}),P=t=>{if(t.preventDefault(),x(null),u==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};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:P,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(h,{id:"submit-input",value:d,onChange:t=>s(t.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:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="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."})]}),v&&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(h,{id:"submit-title",value:l,onChange:t=>p(t.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(z,{id:"submit-abstract",value:o,onChange:t=>g(t.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(h,{id:"submit-authors",value:f,onChange:t=>I(t.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(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(t.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(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default};
 
1
+ import{u as R,h as T,g as _,R as n,j as e,ar as D}from"./index-DREEM5p7.js";import{u as k}from"./useMutation-Bsr7m3Cl.js";import{A as w,a as C}from"./alert-DqWQWZ1R.js";import{B as j}from"./button-BwpTjeyz.js";import{I as h,T as z}from"./textarea-DyNUKizV.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){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=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(g=>g.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,g]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,x]=n.useState(null),u=S(d),v=u==="external",c=k({mutationFn:t=>D(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{x(q(t))}}),P=t=>{if(t.preventDefault(),x(null),u==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};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:P,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(h,{id:"submit-input",value:d,onChange:t=>s(t.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:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="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."})]}),v&&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(h,{id:"submit-title",value:l,onChange:t=>p(t.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(z,{id:"submit-abstract",value:o,onChange:t=>g(t.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(h,{id:"submit-authors",value:f,onChange:t=>I(t.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(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(t.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(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default};
assets/{TagBrowseView-BItfp6De.js → TagBrowseView-DUDEIoQX.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as je,r as h,o as Z,j as e,n as B,a2 as _e,q as ve,P as Xe,t as Ne,p as ke,a3 as es,R as _,a4 as ss,N as as,v as J,e as ts,u as ns,a as rs,V as os,L as P,$ as cs,b as ge}from"./index-Bo5_2OqZ.js";import{u as be}from"./useQuery-Bh9FZQpL.js";import{P as is,M as ls}from"./components-BbXgE2lV.js";import{B as ds}from"./BenchmarkTrendSparkline-BCbEDZUr.js";import{P as ps}from"./PaperFeedFilters-D2TbUu0j.js";import{M as W}from"./MarkdownText-VH1HEGnz.js";import{t as ms,d as V}from"./transform-2Gnjg1jt.js";import{b as hs}from"./usePapers-CdB1OuZ5.js";import{u as us}from"./useIntersectionObserver-7HCpY83L.js";import{S as U}from"./skeleton-CB-heJjl.js";import{A as xs,a as gs}from"./alert-_EYQlDHA.js";import{C as bs}from"./chevron-down-BeEEYUNO.js";import{G as fe}from"./github-D8cWDRad.js";import"./useBaseQuery-B8T7kRNC.js";import"./LatexTitle-qoY4vrTZ.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DTmodbgi.js";import"./index-C-0CcYmz.js";import"./hover-card-DrtqDSb0.js";import"./useInfiniteQuery-CzzYUeDW.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as je,r as h,o as Z,j as e,n as B,a2 as _e,q as ve,P as Xe,t as Ne,p as ke,a3 as es,R as _,a4 as ss,N as as,v as J,e as ts,u as ns,a as rs,V as os,L as P,$ as cs,b as ge}from"./index-DREEM5p7.js";import{u as be}from"./useQuery-pzEX4kGt.js";import{P as is,M as ls}from"./components-DCcxy0XP.js";import{B as ds}from"./BenchmarkTrendSparkline-D0ycyTpl.js";import{P as ps}from"./PaperFeedFilters-tral1E4E.js";import{M as W}from"./MarkdownText-CNYqDApy.js";import{t as ms,d as V}from"./transform-DA_akiPE.js";import{b as hs}from"./usePapers-Ds6XBgz_.js";import{u as us}from"./useIntersectionObserver-BUuG_jQu.js";import{S as U}from"./skeleton-C9cmIM7L.js";import{A as xs,a as gs}from"./alert-DqWQWZ1R.js";import{C as bs}from"./chevron-down-CbBr2xUl.js";import{G as fe}from"./github-BKa4wH1A.js";import"./useBaseQuery-BnoYgsiR.js";import"./LatexTitle-DYInY1bH.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-D-wxSmXC.js";import"./index-Dm_H11O9.js";import"./hover-card-ZrDlt9Lf.js";import"./useInfiniteQuery-BWf7CLsF.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{TagsIndexView-CFL5RaeB.js → TagsIndexView-orfEvAmh.js} RENAMED
@@ -1 +1 @@
1
- import{r as d,j as e,L as p,b as h}from"./index-Bo5_2OqZ.js";import{u as g}from"./useQuery-Bh9FZQpL.js";import{e as x,h as f,d as u}from"./transform-2Gnjg1jt.js";import{S as m}from"./skeleton-CB-heJjl.js";import{A as j,a as y}from"./alert-_EYQlDHA.js";import{T as k}from"./TaxonomySuggestionTile-T8WIATj3.js";import"./useBaseQuery-B8T7kRNC.js";import"./SignInToEditDialog-DW_1sVXp.js";import"./button-D8mDpZUh.js";import"./textarea-Cr9wwZtd.js";import"./dialog-BAxsIFdN.js";import"./useMutation-B8C_NgT5.js";import"./loader-circle-L2ccNPQf.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>h.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>s[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,t)=>s+t.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,t)=>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,a)=>e.jsx(m,{className:"h-24"},a))})]},t))}):o.map(s=>{const t=s.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(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:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return e.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),e.jsx(k,{kind:"task"})]})]},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{E as default};
 
1
+ import{r as d,j as e,L as p,b as h}from"./index-DREEM5p7.js";import{u as g}from"./useQuery-pzEX4kGt.js";import{e as x,h as f,d as u}from"./transform-DA_akiPE.js";import{S as m}from"./skeleton-C9cmIM7L.js";import{A as j,a as y}from"./alert-DqWQWZ1R.js";import{T as k}from"./TaxonomySuggestionTile-BFLpa7xW.js";import"./useBaseQuery-BnoYgsiR.js";import"./SignInToEditDialog-B6iSscgi.js";import"./button-BwpTjeyz.js";import"./textarea-DyNUKizV.js";import"./dialog-D77-YHgu.js";import"./useMutation-Bsr7m3Cl.js";import"./loader-circle-visLwNUg.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>h.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>s[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,t)=>s+t.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,t)=>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,a)=>e.jsx(m,{className:"h-24"},a))})]},t))}):o.map(s=>{const t=s.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(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:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return e.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),e.jsx(k,{kind:"task"})]})]},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{E as default};
assets/{TaxonomySuggestionTile-T8WIATj3.js → TaxonomySuggestionTile-BFLpa7xW.js} RENAMED
@@ -1 +1 @@
1
- import{f as u,r as o,j as e}from"./index-Bo5_2OqZ.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-DW_1sVXp.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T};
 
1
+ import{f as u,r as o,j as e}from"./index-DREEM5p7.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-B6iSscgi.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T};
assets/{TrendsView-Ch21Eqgg.js → TrendsView-DveKdKyx.js} RENAMED
@@ -1 +1 @@
1
- import{b as X,R as G,j as e}from"./index-Bo5_2OqZ.js";import{u as J}from"./useQuery-Bh9FZQpL.js";import{A as q,a as E}from"./alert-_EYQlDHA.js";import{S as P}from"./skeleton-CB-heJjl.js";import"./useBaseQuery-B8T7kRNC.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r<t.length-1;r+=1){const l=t[r-1]??t[r],c=t[r],o=t[r+1],a=t[r+2]??o,y=c[0]+(o[0]-l[0])/6,s=c[1]+(o[1]-l[1])/6,b=o[0]-(a[0]-c[0])/6,d=o[1]-(a[1]-c[1])/6;i+=` C ${y} ${s} ${b} ${d} ${o[0]} ${o[1]}`}return i},W={fontFamily:"var(--mono)",fontSize:12,fill:"var(--ink-faint)"},z={fontFamily:"var(--mono)",fontSize:11,fontWeight:600,letterSpacing:"0.14em",fill:"var(--ink-faint)",textTransform:"uppercase"},C=({id:t,data:i,color:r,yTicks:l,yLabel:c,xLabel:o})=>{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ne=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});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:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ne as default};
 
1
+ import{b as X,R as G,j as e}from"./index-DREEM5p7.js";import{u as J}from"./useQuery-pzEX4kGt.js";import{A as q,a as E}from"./alert-DqWQWZ1R.js";import{S as P}from"./skeleton-C9cmIM7L.js";import"./useBaseQuery-BnoYgsiR.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r<t.length-1;r+=1){const l=t[r-1]??t[r],c=t[r],o=t[r+1],a=t[r+2]??o,y=c[0]+(o[0]-l[0])/6,s=c[1]+(o[1]-l[1])/6,b=o[0]-(a[0]-c[0])/6,d=o[1]-(a[1]-c[1])/6;i+=` C ${y} ${s} ${b} ${d} ${o[0]} ${o[1]}`}return i},W={fontFamily:"var(--mono)",fontSize:12,fill:"var(--ink-faint)"},z={fontFamily:"var(--mono)",fontSize:11,fontWeight:600,letterSpacing:"0.14em",fill:"var(--ink-faint)",textTransform:"uppercase"},C=({id:t,data:i,color:r,yTicks:l,yLabel:c,xLabel:o})=>{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ne=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});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:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ne as default};
assets/{alert-_EYQlDHA.js → alert-DqWQWZ1R.js} RENAMED
@@ -1 +1 @@
1
- import{r as a,j as s,v as l,a6 as i}from"./index-Bo5_2OqZ.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};
 
1
+ import{r as a,j as s,v as l,a6 as i}from"./index-DREEM5p7.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/{button-D8mDpZUh.js → button-BwpTjeyz.js} RENAMED
@@ -1 +1 @@
1
- import{r as a,j as d,aL as u,v as c,a6 as f}from"./index-Bo5_2OqZ.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B};
 
1
+ import{r as a,j as d,aL as u,v as c,a6 as f}from"./index-DREEM5p7.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B};
assets/{chatSessions-Dz4Iu-O1.js → chatSessions-RaHJTN_0.js} RENAMED
@@ -1 +1 @@
1
- import{j as o,d as f}from"./index-Bo5_2OqZ.js";const _=({light:r})=>o.jsx("span",{className:`chat-spinner${r?" chat-spinner-light":""}`}),w=({open:r})=>o.jsx("svg",{className:`chat-chev${r?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"m6 9 6 6 6-6"})}),x=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]}),S=({size:r=14})=>o.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),b=()=>o.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:o.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),k=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M12 5v14M5 12h14"})}),C=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),o.jsx("path",{d:"M9 4v16"})]}),j=()=>o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),T=({models:r,selectedModel:t,onModelChange:e,disabled:s})=>{var c;const n=((c=r.find(a=>a.id===t))==null?void 0:c.label)??`${t} (unavailable)`,i=Math.min(Math.max(n.length+5,12),32);return o.jsxs("select",{className:"chat-model-select",style:{width:`${i}ch`},value:t,disabled:s,onChange:a=>e(a.target.value),"aria-label":"Research model",children:[!r.some(a=>a.id===t)&&o.jsx("option",{value:t,disabled:!0,children:n}),r.map(a=>o.jsx("option",{value:a.id,children:a.label},a.id))]})},p="pwc:chat-oauth-draft",l="pwc:chat-oauth-model",h="pwc:chat-oauth-auto-send";function I(r,t,e={}){const s=r.trim();s&&(sessionStorage.setItem(p,s),e.autoSend===!1?sessionStorage.removeItem(h):sessionStorage.setItem(h,"1"),t?sessionStorage.setItem(l,t):sessionStorage.removeItem(l))}function R(){var t;if(typeof window>"u"||sessionStorage.getItem(h)!=="1")return null;const r=(t=sessionStorage.getItem(p))==null?void 0:t.trim();return r?{prompt:r,model:sessionStorage.getItem(l)}:null}function M(){sessionStorage.removeItem(p),sessionStorage.removeItem(l),sessionStorage.removeItem(h)}const v="google/gemma-4-31B-it",O=[{id:v,label:"Gemma 4 31B",provider:"huggingface"},{id:"zai-org/GLM-5.2",label:"GLM 5.2",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"},{id:"deepseek-ai/DeepSeek-V4-Flash-0731",label:"DeepSeek V4 Flash 0731",provider:"openrouter"}];async function u(r,t){const e=await fetch(f(r),{credentials:"include",headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t});if(!e.ok){const s=await e.json().catch(()=>null),n=s==null?void 0:s.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${e.status})`)}return e.status===204?void 0:e.json()}class g extends Error{constructor(t,e){super(t),this.status=e}}async function m(r){const t=await fetch(f(r),{headers:{Accept:"application/json"}});if(!t.ok){const e=await t.json().catch(()=>null),s=e==null?void 0:e.detail;throw new g((s==null?void 0:s.message)||s||`Shared conversation request failed (${t.status})`,t.status)}return t.json()}async function A(){const r=[];let t=null;do{const e=new URLSearchParams({limit:"50"});t&&e.set("cursor",t);const s=await u(`/api/v1/chat/sessions?${e.toString()}`);r.push(...s.items),t=s.next_cursor}while(t&&r.length<100);return r}function D(r){return u(`/api/v1/chat/sessions/${r}`)}function P(r,t){return u(`/api/v1/chat/sessions/${r}`,{method:"PATCH",body:JSON.stringify(t)})}function E(r){return u(`/api/v1/chat/sessions/${r}`,{method:"DELETE"})}function $(){return u("/api/v1/chat/sessions/archive-old",{method:"POST"})}function L(r){return u(`/api/v1/chat/sessions/${r}/cancel`,{method:"POST"})}function q(r){return u(`/api/v1/chat/sessions/${r}/share`,{method:"POST"})}function B(r){return m(`/api/v1/chat/shares/${encodeURIComponent(r)}`)}async function Y(){return u("/api/v1/chat/models")}function d(r,t){const e=r.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:t&&(s.status==="error"||s.status==="denied"||s.status==="running")}:{...s,done:!0});return e.filter((s,n)=>{const i=e[n-1];return!(s.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&s.text===i.text)})}function H(r){const t=e=>e==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":e==="hf_inference_credential_expired"?"Your Hugging Face authorization expired. Reconnect in Settings.":e==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":e==="provider_timeout"?"The model provider timed out. Try again shortly.":e==="openrouter_monthly_budget_exhausted"?"You have used this month's Papers With Code OpenRouter allowance. Review the reset time or enable your own key in Settings.":e==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":e==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":e==="openrouter_byok_billing_error"?"OpenRouter could not bill your API key. Review your OpenRouter credits and spending limits.":e==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":["provider_error","provider_unavailable"].includes(e??"")?"The model provider failed before completing the response. You can edit and retry your question.":e==="persistence_error"?"The response could not be saved. You can edit and retry your question.":e==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return r.messages.flatMap(e=>{if(e.role==="assistant")return[{id:e.id,role:"assistant",blocks:d(e.display_blocks,!0),followups:e.followups,citations:e.citations,finishReason:e.finish_reason??void 0,streaming:!1}];const s={id:e.id,role:"user",text:e.content,revision:e.revision,status:e.status,error:e.status==="complete"?void 0:e.error_code||e.status};if(!["error","interrupted"].includes(e.status))return[s];const n=e.status==="interrupted";return[s,{id:`${e.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:d(e.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:t(e.error_code),errorCode:n?void 0:e.error_code??void 0}]})}function F(r){return r.messages.map(t=>t.role==="user"?{id:t.id,role:"user",text:t.content}:{id:t.id,role:"assistant",blocks:d(t.display_blocks,!1),citations:t.citations,finishReason:t.finish_reason??void 0,error:t.error??void 0,streaming:!1})}function K(r){const t=Date.now(),e=new Date().setHours(0,0,0,0),s=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...r].sort((i,c)=>Date.parse(c.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(n.updated_at),c=t-i;i>=e?s[0].items.push(n):c<7*864e5?s[1].items.push(n):c<30*864e5?s[2].items.push(n):s[3].items.push(n)}return s.filter(n=>n.items.length>0)}export{b as A,p as C,v as D,O as F,T as M,k as P,_ as S,j as T,l as a,h as b,L as c,M as d,Y as e,C as f,D as g,K as h,E as i,q as j,$ as k,A as l,g as m,B as n,x as o,F as p,I as q,R as r,w as s,H as t,P as u,S as v};
 
1
+ import{j as o,d as f}from"./index-DREEM5p7.js";const _=({light:r})=>o.jsx("span",{className:`chat-spinner${r?" chat-spinner-light":""}`}),w=({open:r})=>o.jsx("svg",{className:`chat-chev${r?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"m6 9 6 6 6-6"})}),x=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]}),S=({size:r=14})=>o.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),b=()=>o.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:o.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),k=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M12 5v14M5 12h14"})}),C=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),o.jsx("path",{d:"M9 4v16"})]}),j=()=>o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),T=({models:r,selectedModel:t,onModelChange:e,disabled:s})=>{var c;const n=((c=r.find(a=>a.id===t))==null?void 0:c.label)??`${t} (unavailable)`,i=Math.min(Math.max(n.length+5,12),32);return o.jsxs("select",{className:"chat-model-select",style:{width:`${i}ch`},value:t,disabled:s,onChange:a=>e(a.target.value),"aria-label":"Research model",children:[!r.some(a=>a.id===t)&&o.jsx("option",{value:t,disabled:!0,children:n}),r.map(a=>o.jsx("option",{value:a.id,children:a.label},a.id))]})},p="pwc:chat-oauth-draft",l="pwc:chat-oauth-model",h="pwc:chat-oauth-auto-send";function I(r,t,e={}){const s=r.trim();s&&(sessionStorage.setItem(p,s),e.autoSend===!1?sessionStorage.removeItem(h):sessionStorage.setItem(h,"1"),t?sessionStorage.setItem(l,t):sessionStorage.removeItem(l))}function R(){var t;if(typeof window>"u"||sessionStorage.getItem(h)!=="1")return null;const r=(t=sessionStorage.getItem(p))==null?void 0:t.trim();return r?{prompt:r,model:sessionStorage.getItem(l)}:null}function M(){sessionStorage.removeItem(p),sessionStorage.removeItem(l),sessionStorage.removeItem(h)}const v="google/gemma-4-31B-it",O=[{id:v,label:"Gemma 4 31B",provider:"huggingface"},{id:"zai-org/GLM-5.2",label:"GLM 5.2",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"},{id:"deepseek-ai/DeepSeek-V4-Flash-0731",label:"DeepSeek V4 Flash 0731",provider:"openrouter"}];async function u(r,t){const e=await fetch(f(r),{credentials:"include",headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t});if(!e.ok){const s=await e.json().catch(()=>null),n=s==null?void 0:s.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${e.status})`)}return e.status===204?void 0:e.json()}class g extends Error{constructor(t,e){super(t),this.status=e}}async function m(r){const t=await fetch(f(r),{headers:{Accept:"application/json"}});if(!t.ok){const e=await t.json().catch(()=>null),s=e==null?void 0:e.detail;throw new g((s==null?void 0:s.message)||s||`Shared conversation request failed (${t.status})`,t.status)}return t.json()}async function A(){const r=[];let t=null;do{const e=new URLSearchParams({limit:"50"});t&&e.set("cursor",t);const s=await u(`/api/v1/chat/sessions?${e.toString()}`);r.push(...s.items),t=s.next_cursor}while(t&&r.length<100);return r}function D(r){return u(`/api/v1/chat/sessions/${r}`)}function P(r,t){return u(`/api/v1/chat/sessions/${r}`,{method:"PATCH",body:JSON.stringify(t)})}function E(r){return u(`/api/v1/chat/sessions/${r}`,{method:"DELETE"})}function $(){return u("/api/v1/chat/sessions/archive-old",{method:"POST"})}function L(r){return u(`/api/v1/chat/sessions/${r}/cancel`,{method:"POST"})}function q(r){return u(`/api/v1/chat/sessions/${r}/share`,{method:"POST"})}function B(r){return m(`/api/v1/chat/shares/${encodeURIComponent(r)}`)}async function Y(){return u("/api/v1/chat/models")}function d(r,t){const e=r.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:t&&(s.status==="error"||s.status==="denied"||s.status==="running")}:{...s,done:!0});return e.filter((s,n)=>{const i=e[n-1];return!(s.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&s.text===i.text)})}function H(r){const t=e=>e==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":e==="hf_inference_credential_expired"?"Your Hugging Face authorization expired. Reconnect in Settings.":e==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":e==="provider_timeout"?"The model provider timed out. Try again shortly.":e==="openrouter_monthly_budget_exhausted"?"You have used this month's Papers With Code OpenRouter allowance. Review the reset time or enable your own key in Settings.":e==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":e==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":e==="openrouter_byok_billing_error"?"OpenRouter could not bill your API key. Review your OpenRouter credits and spending limits.":e==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":["provider_error","provider_unavailable"].includes(e??"")?"The model provider failed before completing the response. You can edit and retry your question.":e==="persistence_error"?"The response could not be saved. You can edit and retry your question.":e==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return r.messages.flatMap(e=>{if(e.role==="assistant")return[{id:e.id,role:"assistant",blocks:d(e.display_blocks,!0),followups:e.followups,citations:e.citations,finishReason:e.finish_reason??void 0,streaming:!1}];const s={id:e.id,role:"user",text:e.content,revision:e.revision,status:e.status,error:e.status==="complete"?void 0:e.error_code||e.status};if(!["error","interrupted"].includes(e.status))return[s];const n=e.status==="interrupted";return[s,{id:`${e.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:d(e.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:t(e.error_code),errorCode:n?void 0:e.error_code??void 0}]})}function F(r){return r.messages.map(t=>t.role==="user"?{id:t.id,role:"user",text:t.content}:{id:t.id,role:"assistant",blocks:d(t.display_blocks,!1),citations:t.citations,finishReason:t.finish_reason??void 0,error:t.error??void 0,streaming:!1})}function K(r){const t=Date.now(),e=new Date().setHours(0,0,0,0),s=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...r].sort((i,c)=>Date.parse(c.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(n.updated_at),c=t-i;i>=e?s[0].items.push(n):c<7*864e5?s[1].items.push(n):c<30*864e5?s[2].items.push(n):s[3].items.push(n)}return s.filter(n=>n.items.length>0)}export{b as A,p as C,v as D,O as F,T as M,k as P,_ as S,j as T,l as a,h as b,L as c,M as d,Y as e,C as f,D as g,K as h,E as i,q as j,$ as k,A as l,g as m,B as n,x as o,F as p,I as q,R as r,w as s,H as t,P as u,S as v};
assets/{chevron-down-BeEEYUNO.js → chevron-down-CbBr2xUl.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-Bo5_2OqZ.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as o}from"./index-DREEM5p7.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{codexAddEvals-NAKdH-Ge.js → codexAddEvals-9YtNb4JX.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as o,j as i,v as c,a6 as d,d as n}from"./index-Bo5_2OqZ.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as o,j as i,v as c,a6 as d,d as n}from"./index-DREEM5p7.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{components-BbXgE2lV.js → components-DCcxy0XP.js} RENAMED
@@ -1 +1 @@
1
- import{h as R,R as g,b as T,j as e,L,u as w}from"./index-Bo5_2OqZ.js";import{L as E,a as z}from"./LatexTitle-qoY4vrTZ.js";import{h as P,d as Z,f as B,e as H}from"./transform-2Gnjg1jt.js";const D=({slug:t,label:s,onClick:r})=>{const l=w(),x=P(t),o=H(x),h=i=>{if(i.stopPropagation(),r){r(t);return}l(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),Z(s||B(t),t)]})},G=({method:t,onClick:s})=>{const r=w(),l=t.slug||t.id||"";if(!l)return null;const x=o=>{if(o.stopPropagation(),s){s(l);return}r(`/methods/${l}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},N={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=g.useRef(null),l=g.useRef(null),[x,o]=g.useState(t.length);if(g.useLayoutEffect(()=>{const n=r.current,a=l.current;if(!n||!a||t.length===0)return;const m=f=>(a.textContent=f,a.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let c=0,d=0;for(const C of t){const p=m(C.measureText);if(c+p<=f)c+=p,d+=1;else break}if(d<t.length){for(;d>0&&c+m(` · +${t.length-d} more`)>f;)d-=1,c-=m(t[d].measureText);d===0&&(d=1)}o(d)};M();const u=new ResizeObserver(M);return u.observe(n),()=>u.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:l,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,a)=>e.jsxs(g.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[a>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:N[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${a}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const l=g.useMemo(()=>{const o=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(a=>a.rank===i);n.forEach((a,m)=>{const M=m===0,u=M?`${h?"":" · "}${N[i]} on `:", ";o.push({name:a.name,slug:a.slug,rank:i,isGroupStart:M,measureText:u+a.name})}),n.length>0&&(h=!1)}return o},[t]),x=g.useMemo(()=>[1,2,3].map(o=>t.filter(i=>i.rank===o).map((i,n)=>({name:i.name,slug:i.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${N[o]} on `:", ")+i.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):l.length===0?null:e.jsx(F,{units:l,paperHref:s})},O=({name:t,size:s=14})=>{const r={search:e.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:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.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:e.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:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.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:e.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:e.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:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},U=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),K=t=>{let s=2166136261;for(let r=0;r<t.length;r++)s=Math.imul(s^t.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)},_=({paperId:t})=>{const s=K(t),r=160,l=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let k=0;k<i;k++)h.push(.55+s()*.4);const n=s()>.3,a=Math.floor(s()*3),m=[],M=6+Math.floor(s()*3);for(let k=0;k<M;k++)m.push(.5+s()*.45);const u="#9A9588",f="#3A352D",c=5,d=(r-c*2-2)/2,C=c,p=c+d+2;let b=c+2;const S=b;b+=6;const W=b+1;b+=5;const A=b;b+=3;const j=b+1;return e.jsx("div",{style:{width:r,height:l,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:e.jsxs("svg",{width:r,height:l,viewBox:`0 0 ${r} ${l}`,style:{display:"block"},children:[x.map((k,v)=>e.jsx("rect",{x:c+(r-c*2)*(1-k)/2,y:S+v*2.4,width:(r-c*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-o)/2,y:W,width:(r-c*2)*o,height:.9,fill:u,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:A,width:6,height:1,fill:f,opacity:.6}),h.map((k,v)=>{const y=j+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:C,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:j,width:d,height:14,fill:"#F0EBE0",stroke:u,strokeWidth:.3,opacity:.9}),a===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${j+11} ${p+6},${j+8} ${p+10},${j+9} ${p+14},${j+5} ${p+18},${j+6} ${p+22},${j+3}`})}),a===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:p+2,y:j+11,width:d-4,height:1.5,fill:u})]}),a===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:j+5,width:d-6,height:1,fill:f}),e.jsx("rect",{x:p+6,y:j+8,width:d-12,height:.8,fill:f})]})]}),m.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:p,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`r${v}`)})]})})},V=({paperId:t,title:s,thumbnailUrl:r,priority:l=!1})=>{const[x,o]=g.useState(!1),[h,i]=g.useState(0),[n,a]=g.useState(l),m=g.useRef(null);g.useEffect(()=>{o(!1),i(0)},[r]);const M=g.useMemo(()=>{if(!r)return null;if(h===0)return r;const u=r.includes("?")?"&":"?";return`${r}${u}retry=${h}`},[r,h]);return g.useEffect(()=>{if(l||n)return;const u=m.current;if(!u)return;const f=new IntersectionObserver(([c])=>{c.isIntersecting&&(a(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(u),()=>f.disconnect()},[l,n]),r&&!x?e.jsx("div",{ref:m,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:(l||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:l?"eager":"lazy",decoding:"async",fetchPriority:l?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(u=>u+1);return}o(!0)}},M)}):e.jsx(_,{paperId:t})},q="language-modeling";function $(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Y(t){return $(t.slug)==="large language model"||$(t.name)==="large language model"}function Q(t){return t.tags.includes(q)?t.methods.filter(s=>!Y(s)):t.methods}const se=({paper:t,rank:s,onClickTag:r})=>{const l=R(),x=`/paper/${t.id}`,o=g.useCallback(()=>{l.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>T.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,l]),h=t.authors.slice(0,3).join(", "),i=t.authors.length,n=Q(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:x,className:"paper-thumb-wrap",onFocus:o,onMouseEnter:o,children:e.jsx(V,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[e.jsx("h3",{className:"paper-title",children:e.jsx(L,{to:x,onFocus:o,onMouseEnter:o,children:e.jsx(E,{title:t.title})})}),e.jsxs("div",{className:"paper-authors",children:[h,i>3&&e.jsxs("span",{children:[", ","+",i-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[i>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[i>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(z,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:x}),(t.tags.length>0||n.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(a=>e.jsx(D,{slug:a,onClick:r},a)),n.map(a=>e.jsx(G,{method:a},a.id||a.slug||a.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[t.githubUrl&&e.jsxs("a",{className:"paper-resource is-link",href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:a=>a.stopPropagation(),children:[e.jsx(O,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),J(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),t.hfUrl&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:t.hfUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:a=>a.stopPropagation(),children:[e.jsx(U,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function J(t){return t.toFixed(1)}export{O as I,G as M,se as P,I as S,D as T,V as a};
 
1
+ import{h as R,R as g,b as T,j as e,L,u as w}from"./index-DREEM5p7.js";import{L as E,a as z}from"./LatexTitle-DYInY1bH.js";import{h as P,d as Z,f as B,e as H}from"./transform-DA_akiPE.js";const D=({slug:t,label:s,onClick:r})=>{const l=w(),x=P(t),o=H(x),h=i=>{if(i.stopPropagation(),r){r(t);return}l(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),Z(s||B(t),t)]})},G=({method:t,onClick:s})=>{const r=w(),l=t.slug||t.id||"";if(!l)return null;const x=o=>{if(o.stopPropagation(),s){s(l);return}r(`/methods/${l}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},N={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=g.useRef(null),l=g.useRef(null),[x,o]=g.useState(t.length);if(g.useLayoutEffect(()=>{const n=r.current,a=l.current;if(!n||!a||t.length===0)return;const m=f=>(a.textContent=f,a.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let c=0,d=0;for(const C of t){const p=m(C.measureText);if(c+p<=f)c+=p,d+=1;else break}if(d<t.length){for(;d>0&&c+m(` · +${t.length-d} more`)>f;)d-=1,c-=m(t[d].measureText);d===0&&(d=1)}o(d)};M();const u=new ResizeObserver(M);return u.observe(n),()=>u.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:l,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,a)=>e.jsxs(g.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[a>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:N[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${a}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const l=g.useMemo(()=>{const o=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(a=>a.rank===i);n.forEach((a,m)=>{const M=m===0,u=M?`${h?"":" · "}${N[i]} on `:", ";o.push({name:a.name,slug:a.slug,rank:i,isGroupStart:M,measureText:u+a.name})}),n.length>0&&(h=!1)}return o},[t]),x=g.useMemo(()=>[1,2,3].map(o=>t.filter(i=>i.rank===o).map((i,n)=>({name:i.name,slug:i.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${N[o]} on `:", ")+i.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):l.length===0?null:e.jsx(F,{units:l,paperHref:s})},O=({name:t,size:s=14})=>{const r={search:e.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:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.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:e.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:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.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:e.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:e.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:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},U=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),K=t=>{let s=2166136261;for(let r=0;r<t.length;r++)s=Math.imul(s^t.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)},_=({paperId:t})=>{const s=K(t),r=160,l=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let k=0;k<i;k++)h.push(.55+s()*.4);const n=s()>.3,a=Math.floor(s()*3),m=[],M=6+Math.floor(s()*3);for(let k=0;k<M;k++)m.push(.5+s()*.45);const u="#9A9588",f="#3A352D",c=5,d=(r-c*2-2)/2,C=c,p=c+d+2;let b=c+2;const S=b;b+=6;const W=b+1;b+=5;const A=b;b+=3;const j=b+1;return e.jsx("div",{style:{width:r,height:l,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:e.jsxs("svg",{width:r,height:l,viewBox:`0 0 ${r} ${l}`,style:{display:"block"},children:[x.map((k,v)=>e.jsx("rect",{x:c+(r-c*2)*(1-k)/2,y:S+v*2.4,width:(r-c*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-o)/2,y:W,width:(r-c*2)*o,height:.9,fill:u,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:A,width:6,height:1,fill:f,opacity:.6}),h.map((k,v)=>{const y=j+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:C,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:j,width:d,height:14,fill:"#F0EBE0",stroke:u,strokeWidth:.3,opacity:.9}),a===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${j+11} ${p+6},${j+8} ${p+10},${j+9} ${p+14},${j+5} ${p+18},${j+6} ${p+22},${j+3}`})}),a===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:p+2,y:j+11,width:d-4,height:1.5,fill:u})]}),a===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:j+5,width:d-6,height:1,fill:f}),e.jsx("rect",{x:p+6,y:j+8,width:d-12,height:.8,fill:f})]})]}),m.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:p,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`r${v}`)})]})})},V=({paperId:t,title:s,thumbnailUrl:r,priority:l=!1})=>{const[x,o]=g.useState(!1),[h,i]=g.useState(0),[n,a]=g.useState(l),m=g.useRef(null);g.useEffect(()=>{o(!1),i(0)},[r]);const M=g.useMemo(()=>{if(!r)return null;if(h===0)return r;const u=r.includes("?")?"&":"?";return`${r}${u}retry=${h}`},[r,h]);return g.useEffect(()=>{if(l||n)return;const u=m.current;if(!u)return;const f=new IntersectionObserver(([c])=>{c.isIntersecting&&(a(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(u),()=>f.disconnect()},[l,n]),r&&!x?e.jsx("div",{ref:m,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:(l||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:l?"eager":"lazy",decoding:"async",fetchPriority:l?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(u=>u+1);return}o(!0)}},M)}):e.jsx(_,{paperId:t})},q="language-modeling";function $(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Y(t){return $(t.slug)==="large language model"||$(t.name)==="large language model"}function Q(t){return t.tags.includes(q)?t.methods.filter(s=>!Y(s)):t.methods}const se=({paper:t,rank:s,onClickTag:r})=>{const l=R(),x=`/paper/${t.id}`,o=g.useCallback(()=>{l.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>T.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,l]),h=t.authors.slice(0,3).join(", "),i=t.authors.length,n=Q(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:x,className:"paper-thumb-wrap",onFocus:o,onMouseEnter:o,children:e.jsx(V,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[e.jsx("h3",{className:"paper-title",children:e.jsx(L,{to:x,onFocus:o,onMouseEnter:o,children:e.jsx(E,{title:t.title})})}),e.jsxs("div",{className:"paper-authors",children:[h,i>3&&e.jsxs("span",{children:[", ","+",i-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[i>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[i>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(z,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:x}),(t.tags.length>0||n.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(a=>e.jsx(D,{slug:a,onClick:r},a)),n.map(a=>e.jsx(G,{method:a},a.id||a.slug||a.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[t.githubUrl&&e.jsxs("a",{className:"paper-resource is-link",href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:a=>a.stopPropagation(),children:[e.jsx(O,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),J(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),t.hfUrl&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:t.hfUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:a=>a.stopPropagation(),children:[e.jsx(U,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function J(t){return t.toFixed(1)}export{O as I,G as M,se as P,I as S,D as T,V as a};
assets/{dialog-BAxsIFdN.js → dialog-D77-YHgu.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as s,j as i,a8 as Z,o as K,a2 as R,P as h,ac as U,n as D,q as x,t as X,p as N,ad as Y,ae as J,af as Q,ag as ee,ah as te,ak as oe,X as ne,v as p}from"./index-Bo5_2OqZ.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?Z(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=N(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(h,{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(h,{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(h,{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=N(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=N(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
 
 
1
+ import{r as s,j as i,a8 as Z,o as K,a2 as R,P as h,ac as U,n as D,q as x,t as X,p as N,ad as Y,ae as J,af as Q,ag as ee,ah as te,ak as oe,X as ne,v as p}from"./index-DREEM5p7.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?Z(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=N(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(h,{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(h,{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(h,{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=N(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=N(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