nielsr HF Staff commited on
Commit
5b7daf2
·
verified ·
1 Parent(s): fe9237c

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-BROI0ZmS.js → AiDeadlinesView-BpSthBaV.js} +1 -1
  2. assets/{AuthorDetailView-BqQhih_3.js → AuthorDetailView-B88e4SG9.js} +1 -1
  3. assets/{BenchmarkDetailView-Cg86MceH.js → BenchmarkDetailView-C5SE268J.js} +1 -1
  4. assets/{BenchmarkTrendSparkline-5roKNW3d.js → BenchmarkTrendSparkline-XIo_GVud.js} +1 -1
  5. assets/{ChatMessage-CKuWDpNc.js → ChatMessage-DwVcq3Ve.js} +1 -1
  6. assets/ChatView-CdOXetxL.js +0 -16
  7. assets/ChatView-D5ne7HbB.js +16 -0
  8. assets/{ConferenceDetailView-BF2p7fm_.js → ConferenceDetailView-Dbc2ENP6.js} +1 -1
  9. assets/{ConferenceTaskView-ny-_UWtG.js → ConferenceTaskView-BAJItIua.js} +1 -1
  10. assets/{ConferencesIndexView-BYCd9xd-.js → ConferencesIndexView-CNg__9k_.js} +1 -1
  11. assets/{CronDashboard-B0A5D1GB.js → CronDashboard-BnvHXrkn.js} +2 -2
  12. assets/ExternalSourceEvalBadge-25ezslre.js +1 -0
  13. assets/ExternalSourceEvalBadge-CXYkyGiT.js +0 -1
  14. assets/{FeedView-L4wL0Zxa.js → FeedView-CIK3mTNn.js} +1 -1
  15. assets/{FrameworksIndexView-I7yKuqQY.js → FrameworksIndexView-ByziIlRP.js} +1 -1
  16. assets/{LatexTitle-BJSVMlZ1.js → LatexTitle-B7GPgo8C.js} +1 -1
  17. assets/{MarkdownText-CNM4Jz9h.js → MarkdownText-QvkQ9FeM.js} +1 -1
  18. assets/{MethodDetailView-kXZaPUhq.js → MethodDetailView-CiYmZ5G6.js} +1 -1
  19. assets/{MethodsIndexView-ooJqtLOL.js → MethodsIndexView-geijTR_Z.js} +1 -1
  20. assets/{NotFound-CksCbtS8.js → NotFound--BkOSvuh.js} +1 -1
  21. assets/{OrganizationContributionGraph-0Wm7L2tv.js → OrganizationContributionGraph-BroNa3f8.js} +1 -1
  22. assets/OrganizationDetailView-7XdyiyeW.js +0 -1
  23. assets/OrganizationDetailView-B70eYNbJ.js +1 -0
  24. assets/{OrganizationPaperFeed-BFjRG1j0.js → OrganizationPaperFeed-F7htGhMz.js} +1 -1
  25. assets/OrganizationTaskView-DdRJ05b_.js +1 -0
  26. assets/OrganizationTaskView-LqFkQbPW.js +0 -1
  27. assets/{OrganizationsIndexView-CIxnPMcd.js → OrganizationsIndexView-wDeeuR4B.js} +1 -1
  28. assets/{PaperDetailView-DQZWeXKk.js → PaperDetailView-Dys6fQi8.js} +0 -0
  29. assets/{PaperPreviewLink-BCdZ9yj3.js → PaperPreviewLink-B25cD-_k.js} +3 -3
  30. assets/PaperReaderView-Lr_OJaUk.css +1 -0
  31. assets/PaperReaderView-fLXDbLBc.js +0 -0
  32. assets/{PapersListView-BYepbpX4.js → PapersListView-DTuy4U-C.js} +1 -1
  33. assets/{PrivacyView-CcXQdpRo.js → PrivacyView-BKFNJZvc.js} +1 -1
  34. assets/{RateLimitsView-BcVoE98a.js → RateLimitsView-DckIJRFx.js} +1 -1
  35. assets/{SavedPapersView-DhFWb_wi.js → SavedPapersView-Czyc5GTN.js} +1 -1
  36. assets/{SearchOverlay-BRKHPZ6C.js → SearchOverlay-C4cuTRdQ.js} +1 -1
  37. assets/{SettingsView-BGS_66Ni.js → SettingsView-CbC3PqlO.js} +3 -3
  38. assets/{SharedChatView-CZGxCKbv.js → SharedChatView-gssSniE9.js} +1 -1
  39. assets/{SignInToEditDialog-Dcu4wTOX.js → SignInToEditDialog-DZLQNGaN.js} +2 -2
  40. assets/{StagingAccessRequestView-CAvxF8g0.js → StagingAccessRequestView-BS5zzPgR.js} +1 -1
  41. assets/{SubmissionsDashboard-Fm_NO7Rs.js → SubmissionsDashboard-DxR4REQK.js} +2 -2
  42. assets/{SubmitView-Bq6nl10o.js → SubmitView-Bt-NFHA_.js} +1 -1
  43. assets/{TagBrowseView-B6A9Mvnz.js → TagBrowseView-Dw0_Dir3.js} +2 -2
  44. assets/{TagsIndexView-DZXTETvq.js → TagsIndexView-Zr6z-Y-4.js} +1 -1
  45. assets/{TaxonomySuggestionTile-BkE17zPJ.js → TaxonomySuggestionTile-DgDd6ghr.js} +1 -1
  46. assets/TrendsView-BvtNL0dp.js +0 -1
  47. assets/TrendsView-Gyl495vi.js +1 -0
  48. assets/{UserProfileView-CRGhrhTR.js → UserProfileView-flvwm70w.js} +1 -1
  49. assets/__vite-browser-external-BIHI7g3E.js +1 -0
  50. assets/alert-B2j1kc2o.js +1 -0
assets/{AiDeadlinesView-BROI0ZmS.js → AiDeadlinesView-BpSthBaV.js} RENAMED
@@ -1,3 +1,3 @@
1
- import{r as x,j as t}from"./index-BrhBTT14.js";import{u as A}from"./useQuery-GhY2LXSI.js";import{c as B}from"./catalog-CkpmYxEk.js";import{S as U}from"./switch-DpBsrlqh.js";import{S as W}from"./skeleton-DHdzoBmM.js";import{A as O,a as V}from"./alert-c1n3ZtEC.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-BhRZv4T5.js";import"./index-WJQaPd7m.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"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(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}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(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`},X=(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)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(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}/,""),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=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(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
  `),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),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)},ne=({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?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{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:[m&&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:m})]}),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})]})]}),u!=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:_(u,r)},children:X(u,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,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=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:h&&!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:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),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:z(e.url)??void 0,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:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({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(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(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:p=>{(p.key==="Enter"||p.key===" ")&&(p.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:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.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:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.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))),g=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[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{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(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"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:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):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(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default};
 
1
+ import{r as x,j as t}from"./index-D_-UZEuL.js";import{u as A}from"./useQuery-BZo4MZ3s.js";import{c as B}from"./catalog-CjU2vAfw.js";import{S as U}from"./switch-giaX-T5P.js";import{S as W}from"./skeleton-CCZ1iXls.js";import{A as O,a as V}from"./alert-B2j1kc2o.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-ChaQ5z93.js";import"./index-DlwDDz8H.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"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(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}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(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`},X=(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)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(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}/,""),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=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(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
  `),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),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)},ne=({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?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{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:[m&&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:m})]}),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})]})]}),u!=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:_(u,r)},children:X(u,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,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=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:h&&!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:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),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:z(e.url)??void 0,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:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({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(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(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:p=>{(p.key==="Enter"||p.key===" ")&&(p.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:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.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:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.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))),g=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[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{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(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"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:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):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(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default};
assets/{AuthorDetailView-BqQhih_3.js → AuthorDetailView-B88e4SG9.js} RENAMED
@@ -1 +1 @@
1
- import{e as m,j as e,L as x}from"./index-BrhBTT14.js";import{u as h}from"./useQuery-GhY2LXSI.js";import{p as d}from"./papers-DBaPliAp.js";import{S as p}from"./skeleton-DHdzoBmM.js";import g from"./NotFound-CksCbtS8.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=h({queryKey:["author",a],queryFn:()=>d.getAuthor(a),enabled:!!a}),t=h({queryKey:["author-papers",a],queryFn:()=>d.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(g,{}):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(p,{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(p,{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 c=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(x,{to:`/paper/${c}`,children:s.title})},s.id)})})]})]})};export{_ as default};
 
1
+ import{c as m,j as e,L as x}from"./index-D_-UZEuL.js";import{u as h}from"./useQuery-BZo4MZ3s.js";import{p as d}from"./papers-DHqjKX7p.js";import{S as c}from"./skeleton-CCZ1iXls.js";import g from"./NotFound--BkOSvuh.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=h({queryKey:["author",a],queryFn:()=>d.getAuthor(a),enabled:!!a}),t=h({queryKey:["author-papers",a],queryFn:()=>d.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(g,{}):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(x,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default};
assets/{BenchmarkDetailView-Cg86MceH.js → BenchmarkDetailView-C5SE268J.js} RENAMED
@@ -1,2 +1,2 @@
1
- import{u as jt,r as w,j as n,w as ie,d as _t,e as kt,a as St,l as Ct,L as te}from"./index-BrhBTT14.js";import{u as Y}from"./useQuery-GhY2LXSI.js";import{c as re}from"./catalog-CkpmYxEk.js";import{C as Et,E as Nt,e as Rt}from"./ExternalSourceEvalBadge-CXYkyGiT.js";import{S as be}from"./skeleton-DHdzoBmM.js";import{S as Ze}from"./switch-DpBsrlqh.js";import{A as $t,a as Tt}from"./alert-c1n3ZtEC.js";import{L as we}from"./LatexTitle-BJSVMlZ1.js";import{B as Ft}from"./BenchmarkTrendSparkline-5roKNW3d.js";import{I as Mt}from"./components-74u_bIKK.js";import{s as Lt}from"./safeExternalHref-CkBrsh84.js";import{s as It}from"./slug-BpH-Nkvz.js";import"./papers-DBaPliAp.js";import"./hover-card-BcKGA4Et.js";import"./index-WJQaPd7m.js";import"./katex.min-BSBacQyE.js";import"./transform-Duf4Shfn.js";function At(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],a=s.filter(l=>l.is_open===!1),i=a.reduce((l,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function et(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ne(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Pt(e,t){if(e===t){const{year:u,month:p}=Ne(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ee[p]} ${u}`}]}const r=Ne(e),s=Ne(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?`${Ee[x]} ${r.year}`:Ee[x]});return y}const a=s.year-r.year+1;let i=1;const l=12;a>l&&(i=Math.ceil(a/l));const c=[];for(let u=r.year;u<=s.year;u+=i)c.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return c}const Dt=({points:e,metric:t})=>{const r=jt(),[s,a]=w.useState(null),i=880,l=320,c=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,le=i-c-u,I=l-p-f,T=e.map(o=>et(o.date)),K=Math.min(...T),A=Math.max(...T),ce=A-K||1,J=o=>K===A?c+le/2:c+(o-K)/ce*le,G=e.map((o,m)=>{const k=J(et(o.date)),v=(o.value-x)/U,F=p+I*(1-v);return{x:k,y:F,data:o,idx:m}}),R=G.filter(o=>o.data.isSota);let q="";if(R.length>=2){q=`M${R[0].x},${R[0].y}`;for(let o=1;o<R.length;o++){const m=R[o-1],k=R[o],v=(m.x+k.x)/2;q+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const V=5.4,he=8,Z=9,B=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*V;let F=o.x-v/2,E=o.x+v/2,O="middle";return F<c?(F=c,E=c+v,O="start"):E>i-u&&(E=i-u,F=E-v,O="end"),{x:O==="start"?c:O==="end"?i-u:o.x,y:o.y-Z,text:k,anchor:O,left:F,right:E}},oe=[],b=R.length>0?B(R[R.length-1]):null;let ke=-1/0;for(let o=0;o<R.length-1;o++){const m=B(R[o]);m&&(m.left<ke+he||b&&m.right>b.left-he||(ke=m.right,oe.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&oe.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const Q=Pt(K,A),W=5,de=o=>a(m=>m===o?null:m),ue=o=>{o&&r(`/paper/${o}`)},fe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ie(o.data.value)} on ${o.data.dateLabel}`,F=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:F?"pointer":"default",outline:"none"},tabIndex:0,role:F?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>de(o.idx),onFocus:()=>a(o.idx),onBlur:()=>de(o.idx),onClick:()=>ue(o.data.paperRouteId),onKeyDown:E=>{F&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),ue(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[n.jsx("text",{x:c-38,y:p+I/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${p+I/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+I*(1-k),F=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:c,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:c-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ie(F)})]},m)}),Q.map(o=>{const m=J(o.timestamp);return n.jsx("text",{x:m,y:l-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 fe(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"}}))}),q&&n.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),R.map(o=>{const m=s===o.idx;return fe(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"}}))}),oe.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}: ${ie(o.data.value)}`,E=Math.max(120,Math.min(340,v.length*6.6+24)),O=30;let S=o.x-E/2;S<c&&(S=c),S+E>i-u&&(S=i-u-E);const j=o.y-O-14>=p?o.y-O-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:S,y:j,width:E,height:O,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:S+12,y:j+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function Bt(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 Ht=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function z(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let se=null;function ut(e={}){return se||(e.includeStyleProperties?(se=e.includeStyleProperties,se):(se=z(window.getComputedStyle(document.documentElement)),se))}function ve(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Vt(e){const t=ve(e,"border-left-width"),r=ve(e,"border-right-width");return e.clientWidth+t+r}function Ot(e){const t=ve(e,"border-top-width"),r=ve(e,"border-bottom-width");return e.clientHeight+t+r}function mt(e,t={}){const r=t.width||Vt(e),s=t.height||Ot(e);return{width:r,height:s}}function qt(){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 H=16384;function Ut(e){(e.width>H||e.height>H)&&(e.width>H&&e.height>H?e.width>e.height?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H):e.width>H?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H))}function Wt(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 l=0;l<a;l+=1)i[l]=s.charCodeAt(l);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function je(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 zt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Kt(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),zt(a)}const D=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||D(r,t)};function Gt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Qt(e,t){return ut(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Xt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Gt(r):Qt(r,s);return document.createTextNode(`${a}{${i}}`)}function tt(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const l=Ht();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Xt(l,r,a,s)),t.appendChild(c)}function Yt(e,t,r){tt(e,t,":before",r),tt(e,t,":after",r)}const rt="application/font-woff",st="image/jpeg",Jt={woff:rt,woff2:rt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:st,jpeg:st,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Zt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Fe(e){const t=Zt(e).toLowerCase();return Jt[t]||""}function er(e){return e.split(/,/)[1]}function $e(e){return e.search(/^(data:)/)!==-1}function tr(e,t){return`data:${t};base64,${e}`}async function ht(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,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(u){l(u)}},c.readAsDataURL(a)})}const Re={};function rr(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=rr(e,t,r.includeQueryParams);if(Re[s]!=null)return Re[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await ht(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),er(c)));a=tr(i,t)}catch(i){a=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return Re[s]=a,a}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):je(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const c=i.toDataURL();return je(c)}const r=e.poster,s=Fe(r),a=await Me(r,s,t);return je(a)}async function ar(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await _e(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function ir(e,t){return D(e,HTMLCanvasElement)?sr(e):D(e,HTMLVideoElement)?nr(e,t):D(e,HTMLIFrameElement)?ar(e,t):e.cloneNode(ft(e))}const lr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ft=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function cr(e,t,r){var s,a;if(ft(t))return t;let i=[];return lr(e)&&e.assignedNodes?i=z(e.assignedNodes()):D(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=z(e.contentDocument.body.childNodes):i=z(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||D(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>_e(c,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function or(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):ut(r).forEach(i=>{let l=a.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),D(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,a.getPropertyPriority(i))})}function dr(e,t){D(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),D(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function ur(e,t){if(D(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function mr(e,t,r){return D(t,Element)&&(or(e,t,r),Yt(e,t,r),dr(e,t),ur(e,t)),t}async function hr(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 c=r[i].getAttribute("xlink:href");if(c){const u=e.querySelector(c),p=document.querySelector(c);!u&&p&&!s[c]&&(s[c]=await _e(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const c=document.createElementNS(i,"defs");l.appendChild(c);for(let u=0;u<a.length;u++)c.appendChild(a[u]);e.appendChild(l)}return e}async function _e(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>ir(s,t)).then(s=>cr(e,s,t)).then(s=>mr(e,s,t)).then(s=>hr(s,t))}const pt=/url\((['"]?)([^'"]+?)\1\)/g,fr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,pr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function gr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function xr(e){const t=[];return e.replace(pt,(r,s,a)=>(t.push(a),r)),t.filter(r=>!$e(r))}async function br(e,t,r,s,a){try{const i=r?Bt(t,r):t,l=Fe(t);let c;return a||(c=await Me(i,l,s)),e.replace(gr(t),`$1${c}$3`)}catch{}return e}function yr(e,{preferredFontFormat:t}){return t?e.replace(pr,r=>{for(;;){const[s,,a]=fr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function gt(e){return e.search(pt)!==-1}async function xt(e,t,r){if(!gt(e))return e;const s=yr(e,r);return xr(s).reduce((i,l)=>i.then(c=>br(c,l,t,r)),Promise.resolve(s))}async function ne(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await xt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function wr(e,t){await ne("background",e,t)||await ne("background-image",e,t),await ne("mask",e,t)||await ne("-webkit-mask",e,t)||await ne("mask-image",e,t)||await ne("-webkit-mask-image",e,t)}async function vr(e,t){const r=D(e,HTMLImageElement);if(!(r&&!$e(e.src))&&!(D(e,SVGImageElement)&&!$e(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Fe(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){l(p)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function jr(e,t){const s=z(e.childNodes).map(a=>bt(a,t));await Promise.all(s).then(()=>e)}async function bt(e,t){D(e,Element)&&(await wr(e,t),await vr(e,t),await jr(e,t))}function _r(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 nt={};async function at(e){let t=nt[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},nt[e]=t,t}async function it(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),ht(c,t.fetchRequestInit,({result:u})=>(r=r.replace(l,`url(${u})`),[l,u]))});return Promise.all(i).then(()=>r)}function lt(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,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=c.exec(s),u===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(u[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{z(a.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const u=i.href,p=at(u).then(f=>it(f,t)).then(f=>lt(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?c+=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 l=e.find(c=>c.href==null)||document.styleSheets[0];a.href!=null&&s.push(at(a.href).then(c=>it(c,t)).then(c=>lt(c).forEach(u=>{l.insertRule(u,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{z(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function Sr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>gt(t.style.getPropertyValue("src")))}async function Cr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=z(e.ownerDocument.styleSheets),s=await kr(r,t);return Sr(s)}function yt(e){return e.trim().replace(/["']/g,"")}function Er(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(yt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Nr(e,t){const r=await Cr(e,t),s=Er(e);return(await Promise.all(r.filter(i=>s.has(yt(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return xt(i.cssText,l,t)}))).join(`
2
  `)}async function Rr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nr(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 $r(e,t={}){const{width:r,height:s}=mt(e,t),a=await _e(e,t,!0);return await Rr(a,t),await bt(a,t),_r(a,t),await Kt(a,r,s)}async function Tr(e,t={}){const{width:r,height:s}=mt(e,t),a=await $r(e,t),i=await je(a),l=document.createElement("canvas"),c=l.getContext("2d"),u=t.pixelRatio||qt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return l.width=p*u,l.height=f*u,t.skipAutoScale||Ut(l),l.style.width=`${p}`,l.style.height=`${f}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function Fr(e,t={}){const r=await Tr(e,t);return await Wt(r)}const Te="#ffffff";function Mr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Lr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Mr():t}async function Ir(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 Fr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Lr(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}=_t(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=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 Ir(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]),c=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx(Mt,{name:"copy",size:11}),c]})};function ae(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 Ar(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Pr(e){const t=new Map;for(const r of e){const s=Ar(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 ot(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function dt(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Dr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var N;const y=ae((N=f.metrics)==null?void 0:N[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 c=e.map(f=>{var y;return{eval:f,value:ae((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=(c==null?void 0:c.value)??0,p=(c==null?void 0:c.eval.model_name)||(c==null?void 0:c.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Br=5;function Hr(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 ye(e,t){return e?n.jsx(we,{title:e}):t||"—"}const ns=()=>{var Ie,Ae,Pe,De,Be,He,Ve,Oe,qe,Ue,We,ze,Ke;const{datasetSlug:e}=kt(),[t]=St(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=Ct(),[l,c]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=Y({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),N=Y({queryKey:["dataset-evals",(Ie=x.data)==null?void 0:Ie.id],queryFn:()=>Rt.byDataset(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:5*60*1e3}),U=Y({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>re.datasetTasks(x.data.id),enabled:!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),le=Y({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),I=w.useMemo(()=>{var d;return!s||!((d=N.data)!=null&&d.length)?null:N.data.find(g=>g.id===s)||null},[s,N.data]),T=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(I!=null&&I.task_id&&d.some(h=>h.id===I.task_id))return I.task_id;if(r){const h=d.find(C=>C.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=N.data||[];if(g.length>0){const h=new Map;for(const _ of g)h.set(_.task_id,(h.get(_.task_id)||0)+1);let C=null,L=-1;for(const _ of d){const P=h.get(_.id)||0;P>L&&(L=P,C=_.id)}if(C)return C}return d[0].id},[U.data,N.data,r,I]),K=Y({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((Be=x.data)!=null&&Be.id),staleTime:10*60*1e3}),A=w.useMemo(()=>{var d;return(((d=K.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[K.data,(He=x.data)==null?void 0:He.id]),ce=Y({queryKey:["leaderboard-metrics",(Ve=x.data)==null?void 0:Ve.id,T],queryFn:()=>re.leaderboardMetrics(x.data.id,T),enabled:!!((Oe=x.data)!=null&&Oe.id)&&!!T,staleTime:10*60*1e3}),J=w.useMemo(()=>At(N.data,T,a.hide_closed_source_evals),[N.data,T,a.hide_closed_source_evals]),G=J.visible,R=J.hiddenClosed,q=J.topHiddenClosed,V=w.useMemo(()=>Pr(G),[G]),he=w.useMemo(()=>{const d=new Set;return V.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[V]),Z=w.useMemo(()=>(ce.data||[]).map(d=>d.metric_name),[ce.data]),B=Z.length?Z:he,oe=w.useMemo(()=>{var C,L;if(V.length===0)return B[0]||"";const d=new Map;for(const _ of V){const P=_.best_metric;!P||ae((C=_.metrics)==null?void 0:C[P])===null||Z.length&&!B.includes(P)||d.set(P,(d.get(P)||0)+1)}let g=null,h=0;for(const[_,P]of d)P>h&&(h=P,g=_);return g||B[0]||((L=V[0])==null?void 0:L.best_metric)||""},[V,B,Z]),b=l||(I==null?void 0:I.best_metric)||oe,Q=(((Ue=(qe=le.data)==null?void 0:qe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!B.includes(b)?B:[b,...B.filter(d=>d!==b)],[B,b]),de=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Br),[W,b]),{points:ue,sota:fe,sotaModel:o}=w.useMemo(()=>Dr(V,b,Q),[V,b,Q]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=N.isSuccess&&U.isSuccess&&le.isSuccess&&(!T||ce.isSuccess),v=k?b:m==null?void 0:m.metric,F=k?fe:m==null?void 0:m.value,E=k?o:m==null?void 0:m.model_name,O=!k&&!m;w.useEffect(()=>{if(p.current||!s||!N.data||N.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,N.data]);const S=w.useMemo(()=>{const d=U.data||[];return T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]),pe=Y({queryKey:["area",S==null?void 0:S.area_id],queryFn:()=>re.getArea(S.area_id),enabled:!!(S!=null&&S.area_id),staleTime:10*60*1e3});if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(be,{className:"h-12 w-1/2 mb-6"}),n.jsx(be,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx($t,{variant:"destructive",children:n.jsx(Tt,{children:"Benchmark not found."})})});const j=x.data,ge=V.slice().sort((d,g)=>{var L,_;const h=ae((L=d.metrics)==null?void 0:L[b]),C=ae((_=g.metrics)==null?void 0:_[b]);return h!==null&&C!==null?Q==="↓"?h-C:C-h:h!==null?-1:C!==null?1:dt(d,b)-dt(g,b)}),Le=!!j.supports_harness,$=s&&ge.find(d=>ot(d,s))||null,M=j.introducing_paper??void 0,me=(M==null?void 0:M.arxiv_id)||(M==null?void 0:M.id)||Hr(j.paper_url),X=(M==null?void 0:M.title)||j.introducing_paper_title||null,ee=((ze=M==null?void 0:M.published)==null?void 0:ze.slice(0,4))||j.introduced_year||null,wt=!!me||!!j.paper_url||!!X,vt=M!=null&&M.arxiv_id||(Ke=j.paper_url)!=null&&Ke.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${me}`:`Paper ${me}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(te,{to:"/tasks",children:"Tasks"}),pe.data&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(te,{to:`/tasks#area-${It(pe.data.name)}`,children:pe.data.name})]}),S&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(te,{to:`/tasks/${S.slug||S.id}`,children:S.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:j.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:j.name}),A&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${j.name} reporting trend`,children:[n.jsx(Ft,{history:A.history,benchmarkName:A.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:A.recent_paper_count})," ",A.recent_paper_count===1?"paper":"papers",A.rate_change==null?A.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${A.rate_change>=1?"is-up":"is-down"}`,children:[A.rate_change>=1?"↑":"↓"," ",A.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[O?n.jsx(be,{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:"·"})]}),E?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ie(F)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:E})]}):n.jsxs("span",{children:[ge.length," evaluations"]})]}),j.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:j.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),j.description&&n.jsx("p",{className:"bm-description",children:j.description}),a.hide_closed_source_evals&&R.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[R.length," closed-source ",R.length===1?"row is":"rows are"," hidden",q!=null&&q.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:q.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),wt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),me?n.jsxs(te,{to:`/paper/${me}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):vt}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]}):j.paper_url?n.jsxs("a",{href:Lt(j.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):j.paper_url}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):null}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]})]}),ue.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:j.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:[B.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=>c(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(Ze,{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(Dt,{points:ue,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"]})]}),$&&(()=>{var L,_;const d=$.paper_arxiv_id||$.paper_id,g=$.paper_title||($.paper_arxiv_id?`arXiv:${$.paper_arxiv_id}`:null),h=$.best_metric&&((L=$.metrics)==null?void 0:L[$.best_metric])!==void 0?$.best_metric:b,C=(_=$.metrics)==null?void 0:_[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:[$.model_name||g||"—",$.harness?` · ${$.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[C!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ie(C),g?" · ":""]}):null,d?n.jsx(te,{to:`/paper/${d}`,children:ye($.paper_title,g)}):ye($.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:j.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:[B.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=>c(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(Ze,{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"})]})]}),N.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(be,{className:"h-10 w-full mb-2"},g))}):ge.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"}),Le&&n.jsx("th",{className:"col-harness",children:"Harness"}),de.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?Q==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>c(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${Q}`:""]})},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 ge.map((h,C)=>{var Qe,Xe;const L=ae((Qe=h.metrics)==null?void 0:Qe[b]);let _=null;L!==null&&((d===null||L!==d)&&(g=C+1,d=L),_=g);const P=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),Se=ot(h,s);return n.jsxs("tr",{ref:Se?u:void 0,className:Se?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:_??"—"}),n.jsxs("td",{className:"col-model",children:[Se&&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(Et,{}),(h.external??h.is_external)&&n.jsx(Nt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Le&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),de.map(Ce=>{var Je;const Ye=Ce===b,xe=(Je=h.metrics)==null?void 0:Je[Ce];return n.jsx("td",{className:`col-value${Ye?" is-active":""}${Ye&&_===1?" is-best":""}`,children:xe!=null&&xe!==""?ie(xe):"—"},Ce)}),n.jsx("td",{className:"col-paper",children:P?n.jsx(te,{to:`/paper/${P}`,children:ye(h.paper_title,Ge)}):ye(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Xe=h.paper_published_date)==null?void 0:Xe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{ns as default};
 
1
+ import{u as jt,r as w,j as n,s as ie,e as _t,c as kt,a as St,f as Ct,L as te}from"./index-D_-UZEuL.js";import{u as Y}from"./useQuery-BZo4MZ3s.js";import{c as re}from"./catalog-CjU2vAfw.js";import{C as Et,E as Nt,e as Rt}from"./ExternalSourceEvalBadge-25ezslre.js";import{S as be}from"./skeleton-CCZ1iXls.js";import{S as Ze}from"./switch-giaX-T5P.js";import{A as $t,a as Tt}from"./alert-B2j1kc2o.js";import{L as we}from"./LatexTitle-B7GPgo8C.js";import{B as Ft}from"./BenchmarkTrendSparkline-XIo_GVud.js";import{I as Mt}from"./components-CmC5jqhM.js";import{s as Lt}from"./safeExternalHref-CkBrsh84.js";import{s as It}from"./slug-BpH-Nkvz.js";import"./papers-DHqjKX7p.js";import"./hover-card-DiJQFgx9.js";import"./index-DlwDDz8H.js";import"./katex.min-BSBacQyE.js";import"./transform-CUuA-koJ.js";function At(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],a=s.filter(l=>l.is_open===!1),i=a.reduce((l,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function et(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ne(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Pt(e,t){if(e===t){const{year:u,month:p}=Ne(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ee[p]} ${u}`}]}const r=Ne(e),s=Ne(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?`${Ee[x]} ${r.year}`:Ee[x]});return y}const a=s.year-r.year+1;let i=1;const l=12;a>l&&(i=Math.ceil(a/l));const c=[];for(let u=r.year;u<=s.year;u+=i)c.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return c}const Dt=({points:e,metric:t})=>{const r=jt(),[s,a]=w.useState(null),i=880,l=320,c=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,le=i-c-u,I=l-p-f,T=e.map(o=>et(o.date)),K=Math.min(...T),A=Math.max(...T),ce=A-K||1,J=o=>K===A?c+le/2:c+(o-K)/ce*le,G=e.map((o,m)=>{const k=J(et(o.date)),v=(o.value-x)/U,F=p+I*(1-v);return{x:k,y:F,data:o,idx:m}}),R=G.filter(o=>o.data.isSota);let q="";if(R.length>=2){q=`M${R[0].x},${R[0].y}`;for(let o=1;o<R.length;o++){const m=R[o-1],k=R[o],v=(m.x+k.x)/2;q+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const V=5.4,he=8,Z=9,B=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*V;let F=o.x-v/2,E=o.x+v/2,O="middle";return F<c?(F=c,E=c+v,O="start"):E>i-u&&(E=i-u,F=E-v,O="end"),{x:O==="start"?c:O==="end"?i-u:o.x,y:o.y-Z,text:k,anchor:O,left:F,right:E}},oe=[],b=R.length>0?B(R[R.length-1]):null;let ke=-1/0;for(let o=0;o<R.length-1;o++){const m=B(R[o]);m&&(m.left<ke+he||b&&m.right>b.left-he||(ke=m.right,oe.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&oe.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const Q=Pt(K,A),W=5,de=o=>a(m=>m===o?null:m),ue=o=>{o&&r(`/paper/${o}`)},fe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ie(o.data.value)} on ${o.data.dateLabel}`,F=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:F?"pointer":"default",outline:"none"},tabIndex:0,role:F?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>de(o.idx),onFocus:()=>a(o.idx),onBlur:()=>de(o.idx),onClick:()=>ue(o.data.paperRouteId),onKeyDown:E=>{F&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),ue(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[n.jsx("text",{x:c-38,y:p+I/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${p+I/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+I*(1-k),F=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:c,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:c-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ie(F)})]},m)}),Q.map(o=>{const m=J(o.timestamp);return n.jsx("text",{x:m,y:l-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 fe(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"}}))}),q&&n.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),R.map(o=>{const m=s===o.idx;return fe(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"}}))}),oe.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}: ${ie(o.data.value)}`,E=Math.max(120,Math.min(340,v.length*6.6+24)),O=30;let S=o.x-E/2;S<c&&(S=c),S+E>i-u&&(S=i-u-E);const j=o.y-O-14>=p?o.y-O-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:S,y:j,width:E,height:O,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:S+12,y:j+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function Bt(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 Ht=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function z(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let se=null;function ut(e={}){return se||(e.includeStyleProperties?(se=e.includeStyleProperties,se):(se=z(window.getComputedStyle(document.documentElement)),se))}function ve(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Vt(e){const t=ve(e,"border-left-width"),r=ve(e,"border-right-width");return e.clientWidth+t+r}function Ot(e){const t=ve(e,"border-top-width"),r=ve(e,"border-bottom-width");return e.clientHeight+t+r}function mt(e,t={}){const r=t.width||Vt(e),s=t.height||Ot(e);return{width:r,height:s}}function qt(){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 H=16384;function Ut(e){(e.width>H||e.height>H)&&(e.width>H&&e.height>H?e.width>e.height?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H):e.width>H?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H))}function Wt(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 l=0;l<a;l+=1)i[l]=s.charCodeAt(l);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function je(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 zt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Kt(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),zt(a)}const D=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||D(r,t)};function Gt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Qt(e,t){return ut(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Xt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Gt(r):Qt(r,s);return document.createTextNode(`${a}{${i}}`)}function tt(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const l=Ht();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Xt(l,r,a,s)),t.appendChild(c)}function Yt(e,t,r){tt(e,t,":before",r),tt(e,t,":after",r)}const rt="application/font-woff",st="image/jpeg",Jt={woff:rt,woff2:rt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:st,jpeg:st,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Zt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Fe(e){const t=Zt(e).toLowerCase();return Jt[t]||""}function er(e){return e.split(/,/)[1]}function $e(e){return e.search(/^(data:)/)!==-1}function tr(e,t){return`data:${t};base64,${e}`}async function ht(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,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(u){l(u)}},c.readAsDataURL(a)})}const Re={};function rr(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=rr(e,t,r.includeQueryParams);if(Re[s]!=null)return Re[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await ht(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),er(c)));a=tr(i,t)}catch(i){a=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return Re[s]=a,a}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):je(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const c=i.toDataURL();return je(c)}const r=e.poster,s=Fe(r),a=await Me(r,s,t);return je(a)}async function ar(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await _e(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function ir(e,t){return D(e,HTMLCanvasElement)?sr(e):D(e,HTMLVideoElement)?nr(e,t):D(e,HTMLIFrameElement)?ar(e,t):e.cloneNode(ft(e))}const lr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ft=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function cr(e,t,r){var s,a;if(ft(t))return t;let i=[];return lr(e)&&e.assignedNodes?i=z(e.assignedNodes()):D(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=z(e.contentDocument.body.childNodes):i=z(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||D(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>_e(c,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function or(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):ut(r).forEach(i=>{let l=a.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),D(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,a.getPropertyPriority(i))})}function dr(e,t){D(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),D(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function ur(e,t){if(D(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function mr(e,t,r){return D(t,Element)&&(or(e,t,r),Yt(e,t,r),dr(e,t),ur(e,t)),t}async function hr(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 c=r[i].getAttribute("xlink:href");if(c){const u=e.querySelector(c),p=document.querySelector(c);!u&&p&&!s[c]&&(s[c]=await _e(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const c=document.createElementNS(i,"defs");l.appendChild(c);for(let u=0;u<a.length;u++)c.appendChild(a[u]);e.appendChild(l)}return e}async function _e(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>ir(s,t)).then(s=>cr(e,s,t)).then(s=>mr(e,s,t)).then(s=>hr(s,t))}const pt=/url\((['"]?)([^'"]+?)\1\)/g,fr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,pr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function gr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function xr(e){const t=[];return e.replace(pt,(r,s,a)=>(t.push(a),r)),t.filter(r=>!$e(r))}async function br(e,t,r,s,a){try{const i=r?Bt(t,r):t,l=Fe(t);let c;return a||(c=await Me(i,l,s)),e.replace(gr(t),`$1${c}$3`)}catch{}return e}function yr(e,{preferredFontFormat:t}){return t?e.replace(pr,r=>{for(;;){const[s,,a]=fr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function gt(e){return e.search(pt)!==-1}async function xt(e,t,r){if(!gt(e))return e;const s=yr(e,r);return xr(s).reduce((i,l)=>i.then(c=>br(c,l,t,r)),Promise.resolve(s))}async function ne(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await xt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function wr(e,t){await ne("background",e,t)||await ne("background-image",e,t),await ne("mask",e,t)||await ne("-webkit-mask",e,t)||await ne("mask-image",e,t)||await ne("-webkit-mask-image",e,t)}async function vr(e,t){const r=D(e,HTMLImageElement);if(!(r&&!$e(e.src))&&!(D(e,SVGImageElement)&&!$e(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Fe(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){l(p)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function jr(e,t){const s=z(e.childNodes).map(a=>bt(a,t));await Promise.all(s).then(()=>e)}async function bt(e,t){D(e,Element)&&(await wr(e,t),await vr(e,t),await jr(e,t))}function _r(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 nt={};async function at(e){let t=nt[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},nt[e]=t,t}async function it(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),ht(c,t.fetchRequestInit,({result:u})=>(r=r.replace(l,`url(${u})`),[l,u]))});return Promise.all(i).then(()=>r)}function lt(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,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=c.exec(s),u===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(u[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{z(a.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const u=i.href,p=at(u).then(f=>it(f,t)).then(f=>lt(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?c+=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 l=e.find(c=>c.href==null)||document.styleSheets[0];a.href!=null&&s.push(at(a.href).then(c=>it(c,t)).then(c=>lt(c).forEach(u=>{l.insertRule(u,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{z(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function Sr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>gt(t.style.getPropertyValue("src")))}async function Cr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=z(e.ownerDocument.styleSheets),s=await kr(r,t);return Sr(s)}function yt(e){return e.trim().replace(/["']/g,"")}function Er(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(yt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Nr(e,t){const r=await Cr(e,t),s=Er(e);return(await Promise.all(r.filter(i=>s.has(yt(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return xt(i.cssText,l,t)}))).join(`
2
  `)}async function Rr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nr(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 $r(e,t={}){const{width:r,height:s}=mt(e,t),a=await _e(e,t,!0);return await Rr(a,t),await bt(a,t),_r(a,t),await Kt(a,r,s)}async function Tr(e,t={}){const{width:r,height:s}=mt(e,t),a=await $r(e,t),i=await je(a),l=document.createElement("canvas"),c=l.getContext("2d"),u=t.pixelRatio||qt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return l.width=p*u,l.height=f*u,t.skipAutoScale||Ut(l),l.style.width=`${p}`,l.style.height=`${f}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function Fr(e,t={}){const r=await Tr(e,t);return await Wt(r)}const Te="#ffffff";function Mr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Lr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Mr():t}async function Ir(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 Fr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Lr(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}=_t(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=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 Ir(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]),c=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx(Mt,{name:"copy",size:11}),c]})};function ae(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 Ar(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Pr(e){const t=new Map;for(const r of e){const s=Ar(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 ot(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function dt(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Dr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var N;const y=ae((N=f.metrics)==null?void 0:N[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 c=e.map(f=>{var y;return{eval:f,value:ae((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=(c==null?void 0:c.value)??0,p=(c==null?void 0:c.eval.model_name)||(c==null?void 0:c.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Br=5;function Hr(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 ye(e,t){return e?n.jsx(we,{title:e}):t||"—"}const ns=()=>{var Ie,Ae,Pe,De,Be,He,Ve,Oe,qe,Ue,We,ze,Ke;const{datasetSlug:e}=kt(),[t]=St(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=Ct(),[l,c]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=Y({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),N=Y({queryKey:["dataset-evals",(Ie=x.data)==null?void 0:Ie.id],queryFn:()=>Rt.byDataset(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:5*60*1e3}),U=Y({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>re.datasetTasks(x.data.id),enabled:!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),le=Y({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),I=w.useMemo(()=>{var d;return!s||!((d=N.data)!=null&&d.length)?null:N.data.find(g=>g.id===s)||null},[s,N.data]),T=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(I!=null&&I.task_id&&d.some(h=>h.id===I.task_id))return I.task_id;if(r){const h=d.find(C=>C.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=N.data||[];if(g.length>0){const h=new Map;for(const _ of g)h.set(_.task_id,(h.get(_.task_id)||0)+1);let C=null,L=-1;for(const _ of d){const P=h.get(_.id)||0;P>L&&(L=P,C=_.id)}if(C)return C}return d[0].id},[U.data,N.data,r,I]),K=Y({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((Be=x.data)!=null&&Be.id),staleTime:10*60*1e3}),A=w.useMemo(()=>{var d;return(((d=K.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[K.data,(He=x.data)==null?void 0:He.id]),ce=Y({queryKey:["leaderboard-metrics",(Ve=x.data)==null?void 0:Ve.id,T],queryFn:()=>re.leaderboardMetrics(x.data.id,T),enabled:!!((Oe=x.data)!=null&&Oe.id)&&!!T,staleTime:10*60*1e3}),J=w.useMemo(()=>At(N.data,T,a.hide_closed_source_evals),[N.data,T,a.hide_closed_source_evals]),G=J.visible,R=J.hiddenClosed,q=J.topHiddenClosed,V=w.useMemo(()=>Pr(G),[G]),he=w.useMemo(()=>{const d=new Set;return V.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[V]),Z=w.useMemo(()=>(ce.data||[]).map(d=>d.metric_name),[ce.data]),B=Z.length?Z:he,oe=w.useMemo(()=>{var C,L;if(V.length===0)return B[0]||"";const d=new Map;for(const _ of V){const P=_.best_metric;!P||ae((C=_.metrics)==null?void 0:C[P])===null||Z.length&&!B.includes(P)||d.set(P,(d.get(P)||0)+1)}let g=null,h=0;for(const[_,P]of d)P>h&&(h=P,g=_);return g||B[0]||((L=V[0])==null?void 0:L.best_metric)||""},[V,B,Z]),b=l||(I==null?void 0:I.best_metric)||oe,Q=(((Ue=(qe=le.data)==null?void 0:qe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!B.includes(b)?B:[b,...B.filter(d=>d!==b)],[B,b]),de=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Br),[W,b]),{points:ue,sota:fe,sotaModel:o}=w.useMemo(()=>Dr(V,b,Q),[V,b,Q]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=N.isSuccess&&U.isSuccess&&le.isSuccess&&(!T||ce.isSuccess),v=k?b:m==null?void 0:m.metric,F=k?fe:m==null?void 0:m.value,E=k?o:m==null?void 0:m.model_name,O=!k&&!m;w.useEffect(()=>{if(p.current||!s||!N.data||N.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,N.data]);const S=w.useMemo(()=>{const d=U.data||[];return T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]),pe=Y({queryKey:["area",S==null?void 0:S.area_id],queryFn:()=>re.getArea(S.area_id),enabled:!!(S!=null&&S.area_id),staleTime:10*60*1e3});if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(be,{className:"h-12 w-1/2 mb-6"}),n.jsx(be,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx($t,{variant:"destructive",children:n.jsx(Tt,{children:"Benchmark not found."})})});const j=x.data,ge=V.slice().sort((d,g)=>{var L,_;const h=ae((L=d.metrics)==null?void 0:L[b]),C=ae((_=g.metrics)==null?void 0:_[b]);return h!==null&&C!==null?Q==="↓"?h-C:C-h:h!==null?-1:C!==null?1:dt(d,b)-dt(g,b)}),Le=!!j.supports_harness,$=s&&ge.find(d=>ot(d,s))||null,M=j.introducing_paper??void 0,me=(M==null?void 0:M.arxiv_id)||(M==null?void 0:M.id)||Hr(j.paper_url),X=(M==null?void 0:M.title)||j.introducing_paper_title||null,ee=((ze=M==null?void 0:M.published)==null?void 0:ze.slice(0,4))||j.introduced_year||null,wt=!!me||!!j.paper_url||!!X,vt=M!=null&&M.arxiv_id||(Ke=j.paper_url)!=null&&Ke.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${me}`:`Paper ${me}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(te,{to:"/tasks",children:"Tasks"}),pe.data&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(te,{to:`/tasks#area-${It(pe.data.name)}`,children:pe.data.name})]}),S&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(te,{to:`/tasks/${S.slug||S.id}`,children:S.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:j.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:j.name}),A&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${j.name} reporting trend`,children:[n.jsx(Ft,{history:A.history,benchmarkName:A.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:A.recent_paper_count})," ",A.recent_paper_count===1?"paper":"papers",A.rate_change==null?A.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${A.rate_change>=1?"is-up":"is-down"}`,children:[A.rate_change>=1?"↑":"↓"," ",A.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[O?n.jsx(be,{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:"·"})]}),E?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ie(F)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:E})]}):n.jsxs("span",{children:[ge.length," evaluations"]})]}),j.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:j.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),j.description&&n.jsx("p",{className:"bm-description",children:j.description}),a.hide_closed_source_evals&&R.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[R.length," closed-source ",R.length===1?"row is":"rows are"," hidden",q!=null&&q.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:q.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),wt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),me?n.jsxs(te,{to:`/paper/${me}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):vt}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]}):j.paper_url?n.jsxs("a",{href:Lt(j.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):j.paper_url}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(we,{title:X}):null}),ee&&n.jsx("span",{className:"method-source-meta",children:ee})]})]}),ue.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:j.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:[B.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=>c(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(Ze,{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(Dt,{points:ue,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"]})]}),$&&(()=>{var L,_;const d=$.paper_arxiv_id||$.paper_id,g=$.paper_title||($.paper_arxiv_id?`arXiv:${$.paper_arxiv_id}`:null),h=$.best_metric&&((L=$.metrics)==null?void 0:L[$.best_metric])!==void 0?$.best_metric:b,C=(_=$.metrics)==null?void 0:_[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:[$.model_name||g||"—",$.harness?` · ${$.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[C!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ie(C),g?" · ":""]}):null,d?n.jsx(te,{to:`/paper/${d}`,children:ye($.paper_title,g)}):ye($.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:j.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:[B.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=>c(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(Ze,{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"})]})]}),N.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(be,{className:"h-10 w-full mb-2"},g))}):ge.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"}),Le&&n.jsx("th",{className:"col-harness",children:"Harness"}),de.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?Q==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>c(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${Q}`:""]})},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 ge.map((h,C)=>{var Qe,Xe;const L=ae((Qe=h.metrics)==null?void 0:Qe[b]);let _=null;L!==null&&((d===null||L!==d)&&(g=C+1,d=L),_=g);const P=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),Se=ot(h,s);return n.jsxs("tr",{ref:Se?u:void 0,className:Se?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:_??"—"}),n.jsxs("td",{className:"col-model",children:[Se&&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(Et,{}),(h.external??h.is_external)&&n.jsx(Nt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Le&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),de.map(Ce=>{var Je;const Ye=Ce===b,xe=(Je=h.metrics)==null?void 0:Je[Ce];return n.jsx("td",{className:`col-value${Ye?" is-active":""}${Ye&&_===1?" is-best":""}`,children:xe!=null&&xe!==""?ie(xe):"—"},Ce)}),n.jsx("td",{className:"col-paper",children:P?n.jsx(te,{to:`/paper/${P}`,children:ye(h.paper_title,Ge)}):ye(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Xe=h.paper_published_date)==null?void 0:Xe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{ns as default};
assets/{BenchmarkTrendSparkline-5roKNW3d.js → BenchmarkTrendSparkline-XIo_GVud.js} RENAMED
@@ -1 +1 @@
1
- import{r as C,j as t}from"./index-BrhBTT14.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-D_-UZEuL.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-CKuWDpNc.js → ChatMessage-DwVcq3Ve.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as $,r as I,j as e,R as p,C as ee}from"./index-BrhBTT14.js";import{u as K,a as V,b as Y,M as te,R as ae,W as se,f as O,A as re,F as ne,G as B,H as ie}from"./chatSessions-Dx6Tu-Jq.js";import"./katex.min-BSBacQyE.js";import{H as D,a as q,b as A}from"./hover-card-BcKGA4Et.js";import{u as oe}from"./useQuery-GhY2LXSI.js";import{f as ce,p as le}from"./github-BtTCuUR0.js";import{G as W}from"./github-XgFsJJRC.js";import{r as de,a as ue,P as X}from"./PaperPreviewLink-BCdZ9yj3.js";import{M as he,r as pe,d as me}from"./index-BLqBUiom.js";import{c as z}from"./chat-Ck3hlrgT.js";import{F as ge}from"./file-text-DROKoLCd.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{d as $,r as I,j as e,z as p,C as ee}from"./index-D_-UZEuL.js";import{u as K,a as V,b as Y,M as te,R as ae,W as se,d as O,A as re,F as ne,G as B,H as ie}from"./chatSessions-CPPX7pkh.js";import"./katex.min-BSBacQyE.js";import{H as D,a as q,b as A}from"./hover-card-DiJQFgx9.js";import{u as oe}from"./useQuery-BZo4MZ3s.js";import{f as ce,p as le}from"./github-DQuIliTJ.js";import{G as W}from"./github-iFSl-B6V.js";import{r as de,a as ue,P as X}from"./PaperPreviewLink-B25cD-_k.js";import{M as he,r as pe,d as me}from"./index-vCOH2DKd.js";import{c as z}from"./chat-7zW8PrrA.js";import{F as ge}from"./file-text--vrXMvWb.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/ChatView-CdOXetxL.js DELETED
@@ -1,16 +0,0 @@
1
- var xt=Object.defineProperty;var Rt=(e,t,n)=>t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ke=(e,t,n)=>Rt(e,typeof t!="symbol"?t+"":t,n);import{c as St,A as Et,n as Ct,j as r,r as o,X as Tt,d as ft,e as kt,u as Ot,a as It,f as At,g as jt,h as Nt,b as Lt}from"./index-BrhBTT14.js";import{u as Mt}from"./useQuery-GhY2LXSI.js";import{C as Dt,U as rt,A as Pt}from"./ChatMessage-CKuWDpNc.js";import{c as Ge}from"./chat-Ck3hlrgT.js";import{u as Ft,r as Yt,a as Ut,O as qt,b as Bt}from"./openrouter-DzllS15k.js";import{d as Ht,e as mt,g as Wt,T as Vt,f as pt,h as Gt,i as Kt,j as $t,k as Qt,l as nt,t as gt,r as zt,S as Jt,P as Xt,D as Zt,m as en,C as et,n as Je,o as tn,p as Xe,s as Ze,v as nn,w as rn,x as tt,y as sn}from"./chatSessions-Dx6Tu-Jq.js";import{S as an}from"./chatPrompts-CDY3UGU1.js";import"./katex.min-BSBacQyE.js";import"./hover-card-BcKGA4Et.js";import"./github-BtTCuUR0.js";import"./github-XgFsJJRC.js";import"./PaperPreviewLink-BCdZ9yj3.js";import"./index-BLqBUiom.js";import"./papers-DBaPliAp.js";import"./file-text-DROKoLCd.js";import"./chevron-down-CKySK_lE.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 on=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"}]]),ee=(e,t)=>new Promise(n=>{const a=setTimeout(s,e);function s(){t==null||t.removeEventListener("abort",s),clearTimeout(a),n()}t==null||t.addEventListener("abort",s)}),_e=e=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...e}),ve={name:"Object Detection",slug:"object-detection"},Oe={name:"Real-Time Object Detection",slug:"real-time-object-detection"},cn={"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:_e({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[ve,Oe],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:_e({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[ve,Oe],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:_e({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:[ve,Oe],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:_e({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[ve,Oe],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:_e({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:[ve,Oe],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:_e({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:[ve,Oe],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:_e({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"},ve],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:_e({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[ve,Oe],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},yt=e=>e.map(t=>cn[t]),st=yt(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),at=yt(["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.`,ln=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*un(e,t){const n=()=>(t==null?void 0:t.aborted)===!0,a=e.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 ee(350,t),!n()){yield{type:"reasoning_start"};for(let s=0;s<it.length;s+=6){if(await ee(14,t),n())return;yield{type:"reasoning_delta",text:it.slice(s,s+6)}}if(await ee(400,t),!n()&&(yield{type:"reasoning_end"},await ee(300,t),!n()&&(yield{type:"tool_call",id:"call_1",name:"search_papers",args:{query:a,top_k:8}},await ee(1100,t),!n()&&(yield{type:"tool_result",id:"call_1",hits:st.length,took_ms:214,results:st},await ee(350,t),!n())))){yield{type:"reasoning_start"};for(let s=0;s<ot.length;s+=6){if(await ee(14,t),n())return;yield{type:"reasoning_delta",text:ot.slice(s,s+6)}}if(await ee(350,t),!n()&&(yield{type:"reasoning_end"},await ee(300,t),!n()&&(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 ee(900,t),!n()&&(yield{type:"tool_result",id:"call_2",hits:at.length,took_ms:176,results:at},await ee(400,t),!n())))){for(let s=0;s<ct.length;s+=4){if(await ee(11,t),n())return;yield{type:"answer_delta",text:ct.slice(s,s+4)}}yield{type:"done",followups:ln,finish_reason:"success"}}}}}const Le=()=>{const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"},dn=()=>!0;class Ne extends Error{constructor(t,n,a,s){super(t),this.code=n,this.status=a,this.retryAfterSeconds=s,this.name="ChatStreamError"}}function hn(e,t){if(Le())try{Ge.reportLatency(e,t).catch(()=>{})}catch{}}function fn(e,t={}){return Le()?pn(e,t.signal):un(e.message,t.signal)}function mn(e,t={}){return gn(e,t.signal)}async function*pn(e,t){const n=await Ge.stream(e,t);yield*bt(n)}async function*gn(e,t){const n=await Ge.resumeStream(e,t);yield*bt(n)}async function*bt(e){if(!e.ok||!e.body){const s=e.ok?null:new Et(e,await e.text());s&&Ct(s);const d=s==null?void 0:s.detail,l=typeof d=="object"&&d!==null?d:null,m=e.status===403&&!d,h=Number(e.headers.get("Retry-After")),x=Number.isFinite(h)&&h>=0?Math.min(300,Math.ceil(h)):void 0;throw new Ne(m?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(s==null?void 0:s.message)||`Chat stream failed (${e.status})`,l&&"code"in l&&typeof l.code=="string"?l.code:m?"staging_access_required":void 0,e.status,x)}const t=e.body.getReader(),n=new TextDecoder;let a="";try{for(;;){const{done:s,value:d}=await t.read();if(s)break;a+=n.decode(d,{stream:!0});let l;for(;(l=a.indexOf(`
13
-
14
- `))!==-1;){const m=a.slice(0,l);a=a.slice(l+2);const h=m.split(`
15
- `).filter(x=>x.startsWith("data:")).map(x=>x.slice(5).trimStart()).join(`
16
- `);!h||h==="[DONE]"||(yield JSON.parse(h))}}}finally{t.releaseLock()}}const yn="https://huggingface.co/settings/inference-providers",bn="https://paperswithcode.co/chat",lt="pwc.chat.billing-notice-dismissed.v1";function _n({provider:e}){const[t,n]=o.useState(()=>localStorage.getItem(lt)==="1");return!Le()||t||e!=="huggingface"?null:r.jsxs("div",{className:"chat-billing-notice",role:"note",children:[r.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."}),r.jsxs("div",{className:"chat-billing-notice-actions",children:[r.jsx("a",{href:"/settings",children:"Review billing"}),r.jsx("a",{href:yn,target:"_blank",rel:"noreferrer",children:"Review usage"}),r.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(lt,"1"),n(!0)},children:r.jsx(Tt,{size:15,"aria-hidden":"true"})})]})]})}function vn({enabled:e,fallbackEnabled:t,byokExpected:n}){const a=Ft(e);if(!e||!a.data)return null;const s=a.data,d=Yt(s.resets_at),l=s.unavailable_reason==="staging_funding_disabled",m=s.unavailable_reason==="shared_credits_exhausted"||s.unavailable_reason==="workspace_limit_exhausted"||s.unavailable_reason==="provider_status_unavailable";return r.jsxs("div",{className:"chat-openrouter-usage",role:"status",children:[r.jsx("span",{children:l?r.jsx("strong",{children:"Chat is now live on paperswithcode.co"}):m?r.jsxs(r.Fragment,{children:[r.jsx("strong",{children:"Shared OpenRouter credits unavailable"})," · ",s.remaining_percent,"% of your allowance remains"]}):r.jsxs(r.Fragment,{children:[r.jsxs("strong",{children:[s.remaining_percent,"% left"]})," this month · resets ",d.local]})}),l?r.jsxs("span",{children:[r.jsx("a",{href:s.production_chat_url||bn,children:"Continue on production"}),t&&" · Your connected OpenRouter key remains available on staging."]}):(!s.available||n)&&r.jsx("span",{children:t?"Your connected OpenRouter key will be used on your next explicit send.":r.jsxs(r.Fragment,{children:[r.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own key in Settings"})," to continue."]})})]})}function ut({variant:e,composerProps:t,provider:n,openRouterFallbackEnabled:a,byokExpected:s,paused:d,suggestions:l=[]}){var h;const m=r.jsxs(r.Fragment,{children:[r.jsx(_n,{provider:n}),r.jsx(vn,{enabled:n==="openrouter",fallbackEnabled:a,byokExpected:s}),d&&r.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."}),r.jsx(Dt,{...t,...e==="empty"?{autoFocus:!0}:{placeholder:(h=t.draft)!=null&&h.text?"Edit and send again…":"Ask a follow-up…"}}),e==="empty"&&r.jsx("div",{className:"chat-examples",children:l.map(x=>r.jsx("button",{type:"button",className:"chat-example",disabled:d,onClick:()=>t.onSend({text:x,paperMentions:[]}),children:x},x))})]});return e==="empty"?m:r.jsx("div",{className:"chat-composer-wrap",children:r.jsxs("div",{className:"chat-composer-inner",children:[m,r.jsx("div",{className:"chat-composer-foot",children:Le()?r.jsxs(r.Fragment,{children:[n==="openrouter"?r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",r.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",r.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),r.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):r.jsx(r.Fragment,{children:"Assistant preview — responses are simulated."})})]})})}function wn({messages:e,papers:t,busy:n,queuedDraft:a,paperMentionsEnabled:s,archivePending:d,openRouterFallbackEnabled:l,onToggleBlock:m,onEditAndResend:h,onArchiveOld:x,onArchiveOldest:D}){var g,y;const[_,k]=o.useState(null),H=o.useRef(null),O=o.useRef(null),E=o.useRef(null);o.useEffect(()=>{n?k(null):E.current=null},[n]),o.useLayoutEffect(()=>{const u=H.current;if(u){if(O.current!==null){u.scrollTop=O.current,O.current=null;return}if(E.current){const q=Array.from(u.querySelectorAll("[data-message-id]")).find(C=>C.dataset.messageId===E.current);if(q){const C=u.getBoundingClientRect(),V=q.getBoundingClientRect();u.scrollTop+=V.top-C.top-24;return}}u.scrollTop=u.scrollHeight}},[e]);const S=e.filter(u=>u.role==="user"),F=(g=S[0])==null?void 0:g.id,ne=(y=S.at(-1))==null?void 0:y.id,j=(u,q)=>{var C;O.current=((C=H.current)==null?void 0:C.scrollTop)??null,m(u,q)};return r.jsx("div",{className:"chat-conversation",ref:H,children:r.jsxs("div",{className:"chat-conversation-inner",children:[e.length===0&&(a==null?void 0:a.text)&&r.jsx(rt,{id:"queued-launch-preview",text:a.text,paperMentions:a.paperMentions,isInitial:!0}),e.map(u=>u.role==="user"?r.jsx(rt,{id:u.id,text:u.text??"",paperMentions:u.paperMentions??[],paperMentionsEnabled:s,isInitial:u.id===F,editingAllowed:!n&&!!u.revision,editing:_===u.id,editNotice:u.id===F?"Sending will replace this conversation.":u.id===ne?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>k(u.id),onCancel:()=>k(null),onResendDraft:q=>{u.id!==F&&(E.current=u.id);const C=h(u.id,q);return C?k(null):E.current=null,C}},u.id):r.jsx(Pt,{msg:u,papers:t,onToggleBlock:j,onArchiveOldChats:x,onArchiveOldestChats:D,archivePending:d,hfBilling:null,openRouterFallbackEnabled:l,feedbackEnabled:!0},u.id))]})})}function xn({retryAt:e,onRetry:t,onCancel:n}){const[a,s]=o.useState(()=>Math.max(0,Math.ceil((e-Date.now())/1e3))),d=o.useRef(null);return o.useEffect(()=>{var x;const l=document.activeElement instanceof HTMLElement?document.activeElement:null;(x=d.current)==null||x.focus();const m=()=>s(Math.max(0,Math.ceil((e-Date.now())/1e3)));m();const h=window.setInterval(m,250);return()=>{window.clearInterval(h),l==null||l.focus()}},[e]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:l=>{l.key==="Escape"&&(l.preventDefault(),n())},children:[r.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),r.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),r.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:a>0?`Try again available in ${a} second${a===1?"":"s"}.`:"You can try again now."}),r.jsxs("div",{className:"chat-capacity-dialog-actions",children:[r.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:d,onClick:n,children:"Cancel"}),r.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:a>0,onClick:t,children:"Try again"})]})]})})}function Rn({onClose:e}){const t=o.useRef(null);return o.useEffect(()=>{var a;const n=document.activeElement instanceof HTMLElement?document.activeElement:null;return(a=t.current)==null||a.focus(),()=>n==null?void 0:n.focus()},[]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:n=>{n.key==="Escape"&&(n.preventDefault(),e())},children:[r.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),r.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."}),r.jsx("div",{className:"chat-capacity-dialog-actions",children:r.jsx("button",{ref:t,type:"button",className:"chat-capacity-cancel",onClick:e,children:"Keep editing"})})]})})}function Sn({url:e,onClose:t}){return e?r.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:t,children:r.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:n=>n.stopPropagation(),children:[r.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),r.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),r.jsx("input",{readOnly:!0,value:e,"aria-label":"Public conversation link",autoFocus:!0,onFocus:n=>n.currentTarget.select()}),r.jsx("button",{type:"button",onClick:t,children:"Close"})]})}):null}function En({sessions:e,activeSessionId:t,loading:n,error:a,open:s,onClose:d,onNew:l,onNavigate:m,onRename:h,onDelete:x}){const[D,_]=o.useState(null),[k,H]=o.useState(""),[O,E]=o.useState(null);o.useEffect(()=>{if(!O)return;const j=()=>E(null),g=y=>{y.key==="Escape"&&j()};return window.addEventListener("click",j),window.addEventListener("keydown",g),()=>{window.removeEventListener("click",j),window.removeEventListener("keydown",g)}},[O]);const S=j=>{_(j.id),H(j.title)},F=async j=>{const g=k.trim();g&&await h(j,g)&&_(null)},ne=(j,g,y)=>E({id:j,x:g,y});return r.jsxs("aside",{className:`chat-sidebar${s?"":" chat-sidebar-closed"}`,children:[r.jsxs("div",{className:"chat-sidebar-top",children:[r.jsxs("button",{type:"button",className:"chat-new-chat",onClick:l,children:[r.jsx(Ht,{})," New chat"]}),r.jsx("button",{type:"button",className:"icon-btn",onClick:d,title:"Collapse sidebar",children:r.jsx(mt,{})})]}),r.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[n&&r.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!n&&a&&r.jsx("div",{className:"chat-sessions-empty",children:a}),!n&&!a&&e.length===0&&r.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Wt(e).map(j=>r.jsxs("div",{className:"chat-session-group",children:[r.jsx("div",{className:"chat-session-group-label",children:j.label}),j.items.map(g=>r.jsxs("div",{className:`chat-session${g.id===t?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>m(g.id),onKeyDown:y=>{if(y.key==="Enter"&&m(g.id),y.key==="F2"&&S(g),y.key==="ContextMenu"||y.shiftKey&&y.key==="F10"){y.preventDefault();const u=y.currentTarget.getBoundingClientRect();ne(g.id,u.right-150,u.bottom)}},onContextMenu:y=>{y.preventDefault(),ne(g.id,y.clientX,y.clientY)},children:[D===g.id?r.jsx("input",{className:"chat-session-title-input",value:k,autoFocus:!0,maxLength:80,onClick:y=>y.stopPropagation(),onChange:y=>H(y.target.value),onBlur:()=>void F(g.id),onKeyDown:y=>{y.stopPropagation(),y.key==="Enter"&&F(g.id),y.key==="Escape"&&_(null)}}):r.jsx("span",{className:"chat-session-title",children:g.title}),r.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:y=>{y.stopPropagation();const u=y.currentTarget.getBoundingClientRect();ne(g.id,u.right-150,u.bottom)},children:"⋯"}),r.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:y=>{y.stopPropagation(),x(g.id)},children:r.jsx(Vt,{})})]},g.id))]},j.label))]}),O&&r.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:O.x,top:O.y},onClick:j=>j.stopPropagation(),children:r.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const j=e.find(g=>g.id===O.id);j&&S(j),E(null)},children:"Rename chat"})})]})}function Cn({sessionId:e,busy:t,loading:n,onError:a}){const{toast:s}=ft(),[d,l]=o.useState(!1),[m,h]=o.useState(""),x=async()=>{var D;if(!(t||d)){l(!0);try{const _=await Gt(e),k=new URL(_.public_path,window.location.origin).toString();try{if(!((D=navigator.clipboard)!=null&&D.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(k),s({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{h(k)}}catch(_){const k=_ instanceof Error?_.message:"Could not share this conversation";a(k),s({variant:"destructive",title:"Share failed",description:k})}finally{l(!1)}}};return r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void x(),disabled:t||d||n,"aria-label":"Share conversation",children:[d?r.jsx(pt,{}):r.jsx(on,{"aria-hidden":"true"}),r.jsx("span",{children:"Share"})]}),r.jsx(Sn,{url:m,onClose:()=>h("")})]})}function Tn({messages:e,refreshSessions:t,resetChat:n,restoreDraft:a,clearTitle:s}){const{toast:d}=ft(),[l,m]=o.useState(null),h=()=>{const _=[...e].reverse().find(k=>k.role==="user");n(),a({text:(_==null?void 0:_.text)??"",paperMentions:(_==null?void 0:_.paperMentions)??[]}),s()};return{pending:l,archiveOld:async()=>{if(l===null){m("old");try{const _=await $t();if(await t(),_.archived_count===0){d({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}h(),d({title:`${_.archived_count} ${_.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(_){d({variant:"destructive",title:"Could not archive old chats",description:_ instanceof Error?_.message:"Try again."})}finally{m(null)}}},archiveOldest:async()=>{if(l===null){m("oldest");try{const _=await Kt();await t(),h(),d({title:`${_.archived_count} ${_.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(_){d({variant:"destructive",title:"Could not archive chats",description:_ instanceof Error?_.message:"Try again."})}finally{m(null)}}}}}class kn{constructor(t,n=hn){ke(this,"requestId");ke(this,"firstVisibleAt");ke(this,"streamStartReported",!1);ke(this,"firstVisibleReported",!1);ke(this,"terminalReported",!1);ke(this,"semanticReported",new Set);this.submittedAt=t,this.report=n}recordStreamStart(t,n){this.requestId=t,this.streamStartReported||(this.streamStartReported=!0,this.send({submission_to_stream_start_ms:Math.max(0,n-this.submittedAt)})),this.reportFirstVisible()}recordFirstVisible(t){this.firstVisibleAt===void 0&&(this.firstVisibleAt=t,this.reportFirstVisible())}recordSemantic(t,n){if(this.semanticReported.has(t))return;this.semanticReported.add(t);const a=Math.max(0,n-this.submittedAt);this.send(t==="reasoning"?{submission_to_first_reasoning_delta_ms:a}:t==="tool"?{submission_to_first_tool_call_ms:a}:{submission_to_first_answer_delta_ms:a})}recordTerminal(t){this.terminalReported||(this.terminalReported=!0,this.send({terminal_classification:t}))}reportFirstVisible(){!this.requestId||this.firstVisibleAt===void 0||this.firstVisibleReported||(this.firstVisibleReported=!0,this.send({submission_to_first_visible_delta_ms:Math.max(0,this.firstVisibleAt-this.submittedAt)}))}send(t){this.requestId&&this.report(this.requestId,t)}}const _t="Preparing research workspace…",vt={preparing_workspace:"Preparing secure workspace…",starting_agent:"Starting research agent…",connecting_model:"Connecting to model…"},wt=()=>({messages:[],sessionId:null,title:"",phase:"idle"});function dt(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return n;return-1}function Ve(e){if(e.status!==_t&&!Object.values(vt).includes(e.status))return e;const{status:t,...n}=e;return n}function te(e,t){if(!e.length)return e;const n=e.slice();return n[n.length-1]=t(n[n.length-1]),n}function ht(e,t,n){return te(e,a=>{const s=Ve(a),d=s.blocks??[];return{...s,blocks:d.map((l,m)=>t(l,m,d)?n(l):l)}})}function On(e,t){switch(t.type){case"stream_start":return t.session_id?{...e,sessionId:t.session_id}:e;case"sandbox_start":case"sandbox_ready":case"workspace_ready":return e;case"lifecycle":return{...e,messages:te(e.messages,n=>{var a;return n.role==="assistant"&&n.streaming&&(((a=n.blocks)==null?void 0:a.length)??0)===0?{...n,status:vt[t.phase]}:n})};case"session_title_start":return{...e,title:""};case"session_title_delta":return{...e,title:`${e.title}${t.text}`.replace(/\s+/g," ").slice(0,80)};case"session_title_done":return{...e,title:t.title};case"reasoning_start":return{...e,messages:te(e.messages,n=>{const a=Ve(n);return{...a,blocks:[...(a.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s),{kind:"reasoning",text:"",active:!0,open:!0}]}})};case"reasoning_delta":return{...e,messages:ht(e.messages,(n,a,s)=>n.kind==="reasoning"&&dt(s,d=>d.kind==="reasoning")===a,n=>n.kind==="reasoning"?{...n,text:n.text+t.text}:n)};case"reasoning_end":return{...e,messages:te(e.messages,n=>{const a=n.blocks??[],s=dt(a,m=>m.kind==="reasoning"&&m.active);if(s<0)return n;const d=a[s];if(d.kind!=="reasoning")return n;const l=a[s-1];return(l==null?void 0:l.kind)==="reasoning"&&l.text===d.text?{...n,blocks:a.filter((m,h)=>h!==s)}:{...n,blocks:a.map((m,h)=>h===s?{...d,active:!1,open:!1}:m)}})};case"tool_call":return{...e,messages:te(e.messages,n=>{const a=Ve(n);return{...a,blocks:[...a.blocks??[],{kind:"tool",id:t.id,name:t.name,args:t.args,status:"running",open:!1}]}})};case"tool_result":return{...e,messages:ht(e.messages,n=>n.kind==="tool"&&n.id===t.id,n=>n.kind!=="tool"?n:t.status?{...n,schema_version:2,status:t.status,took_ms:t.took_ms,content:t.content,metadata:t.metadata,open:t.status!=="success"}:{...n,status:"done",hits:t.hits,took_ms:t.took_ms,results:t.results})};case"answer_delta":return{...e,messages:te(e.messages,n=>{const a=Ve(n),s=a.blocks??[],d=s.at(-1);return(d==null?void 0:d.kind)==="answer"&&!d.done?{...a,blocks:[...s.slice(0,-1),{...d,text:d.text+t.text}]}:{...a,blocks:[...s,{kind:"answer",text:t.text,done:!1}]}})};case"done":return{...e,phase:"complete",messages:te(e.messages,n=>({...n,streaming:!1,followups:t.followups,finishReason:t.finish_reason,citations:t.citations,blocks:(n.blocks??[]).map(a=>a.kind==="answer"?{...a,done:!0}:a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}))};case"error":return{...e,phase:"failed",messages:te(e.messages,n=>({...n,streaming:!1,error:t.message,errorCode:t.code,blocks:(n.blocks??[]).map(a=>a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}))}}}function In(e){return te(e,t=>{if(t.role!=="assistant")return t;const n=(t.blocks??[]).flatMap(a=>a.kind==="tool"&&a.status==="running"?[]:a.kind==="reasoning"&&a.active?a.text?[{...a,active:!1,open:!1}]:[]:a.kind==="answer"?[{...a,done:!0}]:[a]);return{...t,blocks:n,streaming:!1,finishReason:"stopped"}})}function He(e,t){switch(t.type){case"start":return{messages:t.messages,sessionId:t.sessionId,title:"",phase:"streaming"};case"event":return On(e,t.event);case"load":return{messages:t.messages,sessionId:t.sessionId,title:e.title,phase:"idle"};case"workspace_status":return{...e,messages:te(e.messages,n=>{var a;return n.role==="assistant"&&n.streaming&&(((a=n.blocks)==null?void 0:a.length)??0)===0&&!n.error?{...n,status:_t}:n})};case"clear_workspace_status":return{...e,messages:te(e.messages,Ve)};case"settle":return{...e,phase:"idle",messages:te(e.messages,n=>n.streaming?{...n,streaming:!1}:n)};case"stop":return{...e,messages:In(e.messages),phase:"stopped"};case"reset":return wt()}}const we={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},An={now:()=>performance.now(),sleep:(e,t)=>new Promise(n=>{if(t!=null&&t.aborted||e<=0){n();return}const a=window.setTimeout(s,e);function s(){t==null||t.removeEventListener("abort",s),window.clearTimeout(a),n()}t==null||t.addEventListener("abort",s,{once:!0})})};function jn(e){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(e.type)}function Nn(e,t=!1,n=we.maxPendingChars){var s;if(!e)return{pieces:[],pending:""};if(t)return{pieces:[e],pending:""};const a=Intl.Segmenter;if(a){const l=[...new a(void 0,{granularity:"word"}).segment(e)].filter(h=>h.isWordLike);let m=0;if(l.length>1&&(m=l.at(-1).index),l.length&&/\s$/u.test(e)&&(m=e.length),m>0){const h=e.slice(0,m),x=[],_=[...new a(void 0,{granularity:"word"}).segment(h)].filter(k=>k.isWordLike);for(let k=0;k<_.length;k+=1){const H=k===0?0:_[k].index,O=((s=_[k+1])==null?void 0:s.index)??h.length;O>H&&x.push(h.slice(H,O))}return _.length||x.push(h),{pieces:x,pending:e.slice(m)}}}else{const d=[...e.matchAll(/\s+/gu)];if(d.length){const l=[];let m=0;for(const h of d){const x=h.index+h[0].length;l.push(e.slice(m,x)),m=x}return{pieces:l,pending:e.slice(m)}}}return e.length>=n?{pieces:[e.slice(0,n)],pending:e.slice(n)}:{pieces:[],pending:e}}function Ln(e,t={}){const n={minDelayMs:t.minDelayMs??we.minDelayMs,maxDelayMs:t.maxDelayMs??we.maxDelayMs,minRateCharsPerMs:t.minRateCharsPerMs??we.minRateCharsPerMs,maxBufferedMs:t.maxBufferedMs??we.maxBufferedMs,arrivalRateTauMs:t.arrivalRateTauMs??we.arrivalRateTauMs,arrivalRateHeadroom:t.arrivalRateHeadroom??we.arrivalRateHeadroom,maxPendingChars:t.maxPendingChars??we.maxPendingChars},a=t.clock??An,s=[];let d="",l=null,m=0,h=!0,x=!1,D=null,_=0,k=a.now();const H=()=>{D==null||D(),D=null},O=(g,y)=>{const u=g.type==="reasoning_delta"||g.type==="answer_delta"?g.text.length:0;s.push({kind:"event",event:g,arrivedAt:y,chars:u}),H()},E=g=>{if(!l||!d)return;const y=Nn(d,g,n.maxPendingChars);for(const u of y.pieces)u&&O({type:l,text:u},m),m=a.now();d=y.pending,d||(l=null)},S=g=>{if(!h)return;const y=a.now();if(g.type==="reasoning_delta"||g.type==="answer_delta"){const u=g.type;if(!g.text)return;l&&l!==u&&E(!0),l||(l=u,m=y),d+=g.text;const q=Math.max(0,y-k);for(_*=Math.exp(-q/n.arrivalRateTauMs),_+=g.text.length,k=y,E(!1);d.length>=n.maxPendingChars;)E(!1);return}jn(g)&&E(!0),O(g,y)},F=(async()=>{var g;try{for await(const y of e)S(y);h&&E(!0)}catch(y){h&&!((g=t.signal)!=null&&g.aborted)&&(E(!0),s.push({kind:"error",error:y,arrivedAt:a.now(),chars:0}))}finally{x=!0,H()}})(),ne=()=>s.length||x?Promise.resolve():new Promise(g=>{D=g});return{events:async function*(){var y,u,q,C;let g=Number.NEGATIVE_INFINITY;try{for(;;){if(await ne(),!s.length){if(x||!h)return;continue}const V=s[0];if(V.kind==="error")throw s.shift(),V.error;if(V.chars&&!((y=t.isHidden)!=null&&y.call(t))){const Y=a.now(),A=s.reduce((J,ge)=>J+ge.chars,0),xe=((u=s.find(J=>J.chars))==null?void 0:u.arrivedAt)??Y,Ie=Math.max(0,n.maxBufferedMs-(Y-xe)),P=_*Math.exp(-Math.max(0,Y-k)/n.arrivalRateTauMs)/n.arrivalRateTauMs,K=Ie>0?A/Ie:Number.POSITIVE_INFINITY,$=Math.max(n.minRateCharsPerMs,P*n.arrivalRateHeadroom,K),he=Math.min(n.maxDelayMs,Math.max(n.minDelayMs,V.chars/$)),ae=Math.max(0,V.arrivedAt+n.maxBufferedMs-Y),Q=Math.max(V.arrivedAt,g+Math.min(he,ae));if(await a.sleep(Math.max(0,Q-a.now()),t.signal),!h||(q=t.signal)!=null&&q.aborted)return}s.shift(),g=a.now(),yield V.event}}finally{h&&(h=!1,H(),await((C=e.return)==null?void 0:C.call(e,void 0))),await F}}(),takeAcceptedForStop(){var y;if(!h)return[];h=!1,l&&d&&(O({type:l,text:d},m),d="",l=null);const g=s.flatMap(u=>u.kind==="event"&&u.event.type!=="done"&&u.event.type!=="error"?[u.event]:[]);return s.length=0,H(),(y=e.return)==null||y.call(e,void 0),g}}}const Mn=750;function Dn(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return n;return-1}function We(e){const t=o.useRef(e);return o.useLayoutEffect(()=>{t.current=e}),o.useCallback((...n)=>t.current(...n),[])}function Pn(e){const[t,n]=o.useState([]),[a,s]=o.useState(!1),[d,l]=o.useState(""),m=o.useRef(!1),h=o.useRef(null),x=o.useRef(null),D=o.useRef(null),_=o.useRef(null),k=o.useRef(!1),H=o.useRef(null),O=o.useRef(null),E=o.useRef("cleared"),S=o.useRef(null),F=o.useRef(null),[ne,j]=o.useState(null),[g,y]=o.useState(null),u=o.useRef([]),q=o.useRef(wt()),C=o.useRef(null),V=o.useRef(null),Y=o.useRef(!1),A=o.useRef(e),xe=o.useRef({text:"",paperMentions:[]}),Ie=o.useRef(0),P=o.useRef(0),K=o.useRef(e.sessionId),$=o.useRef(e.sessionId);$.current!==e.sessionId&&($.current=e.sessionId,K.current!==e.sessionId&&(P.current+=1,S.current=null)),A.current=e,u.current=t,o.useEffect(()=>()=>{var c;O.current!==null&&window.clearTimeout(O.current),(c=h.current)==null||c.abort(),x.current=null,D.current!==null&&cancelAnimationFrame(D.current),_.current!==null&&window.clearTimeout(_.current),F.current=null},[]),o.useEffect(()=>{m.current||(K.current=e.sessionId)},[e.sessionId]),o.useEffect(()=>{const c=m.current&&e.sessionId===K.current?C.current:null;Y.current=c!==null,c&&(n(c),u.current=c)},[e.sessionId]);const he=o.useMemo(()=>{const c={};for(const v of t)for(const R of v.blocks??[])if(R.kind==="tool")for(const p of R.results??[])c[p.route_id]=p;return c},[t]),ae=()=>`m${++Ie.current}_${Date.now().toString(36)}`,Q=(c,v=!0)=>{const R={...q.current,messages:C.current??u.current,sessionId:K.current},p=He(R,c);q.current=p,C.current&&(C.current=p.messages);const b=c.type==="event"&&c.event.type==="stream_start"?c.event.session_id:null;return b?(K.current=b,A.current.onSessionId(b)):p.sessionId&&p.sessionId!==R.sessionId&&(K.current=p.sessionId,A.current.onSessionId(p.sessionId)),p.title!==R.title&&A.current.onTitle(p.title),v&&(u.current=p.messages,n(p.messages)),p},J=()=>V.current===P.current||Y.current,ge=()=>{D.current!==null&&(cancelAnimationFrame(D.current),D.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)},Z=()=>{ge(),document.visibilityState!=="hidden"&&(!Y.current||!C.current||(k.current=!1,u.current=C.current,n(C.current)))},Re=()=>{if(!Y.current||document.visibilityState==="hidden"||D.current!==null||_.current!==null)return;const c=()=>{D.current=null,_.current=null,Z()};typeof requestAnimationFrame=="function"?D.current=requestAnimationFrame(c):_.current=window.setTimeout(c,0)};o.useEffect(()=>{const c=()=>{document.visibilityState==="visible"&&k.current&&Re()};return document.addEventListener("visibilitychange",c),()=>document.removeEventListener("visibilitychange",c)});const ie=c=>{if(h.current!==c||(O.current!==null&&(window.clearTimeout(O.current),O.current=null),E.current==="cleared"))return;const v=E.current==="shown";E.current="cleared",v&&Q({type:"clear_workspace_status"},J())},Ke=(c,v)=>{O.current!==null&&window.clearTimeout(O.current),E.current="armed",O.current=window.setTimeout(()=>{O.current=null,!(E.current!=="armed"||h.current!==c||c.signal.aborted||P.current!==v)&&(E.current="shown",Q({type:"workspace_status"},J()))},Mn)},Me=(c,v)=>{const R=S.current;!R||R.controller!==c||R.tracker.recordStreamStart(v,performance.now())},Se=(c,v)=>{const R=S.current;!R||R.controller!==c||R.tracker.recordTerminal(v)};o.useLayoutEffect(()=>{const c=S.current;if(!c)return;const v=t.at(-1);if((v==null?void 0:v.role)!=="assistant"||!(v.blocks??[]).some(b=>b.kind==="tool"||b.kind==="reasoning"&&!!b.text.trim()||b.kind==="answer"&&!!b.text.trim()))return;const p=performance.now();c.tracker.recordFirstVisible(p);for(const b of v.blocks??[])b.kind==="reasoning"&&b.text.trim()?c.tracker.recordSemantic("reasoning",p):b.kind==="tool"?c.tracker.recordSemantic("tool",p):b.kind==="answer"&&b.text.trim()&&c.tracker.recordSemantic("answer",p)},[t]);const ye=(c,v=!0)=>{Q({type:"event",event:c},v)},De=async(c,v)=>{var b;const R=await nt(c);let p=gt(R);return((b=H.current)==null?void 0:b.sessionId)===c&&(p=H.current.messages,H.current=null),P.current!==v&&!(V.current===v&&Y.current&&A.current.sessionId===c)?null:(n(p),u.current=p,C.current=p,q.current=He(q.current,{type:"load",messages:p,sessionId:c}),p)},Ee=(c,v,R,p,b,M)=>{const N=++P.current;V.current=N,Y.current=!0,m.current=!0;const I=new AbortController;h.current=I;const oe=c.text;return xe.current=c,K.current=v.session_id,l(""),n(R),C.current=R,q.current=He(q.current,{type:"start",messages:R,sessionId:v.session_id}),s(!0),S.current=M?null:{controller:I,tracker:new kn(performance.now())},E.current="cleared",(async()=>{var Ae,Ye,je,Ue;let me=!1,G=!1,se=!1,ce=!1,le=!1,pe=!1;try{const B=M?mn(M,{signal:I.signal}):fn(v,{signal:I.signal}),z=!M&&Le()&&dn(),X=z?Ln(B,{signal:I.signal,isHidden:()=>document.visibilityState==="hidden"}):null;X&&(x.current={controller:I,stream:X});for await(const L of(X==null?void 0:X.events)??B){L.type==="stream_start"&&(me=!0,G=L.provider_execution!==!1,Me(I,L.request_id)),L.type==="sandbox_start"&&Ke(I,N),L.type==="lifecycle"&&ie(I),(L.type==="reasoning_start"||L.type==="reasoning_delta"||L.type==="tool_call"||L.type==="answer_delta"||L.type==="done"||L.type==="error")&&ie(I),(L.type==="done"||L.type==="error")&&(ce=!0,le=L.type==="error",Se(I,L.type==="error"?"error":"complete"),L.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(L.code??"")&&(se=!0,A.current.onInterrupted(c)));const Te=J(),qe=Te&&!(z&&document.visibilityState==="hidden"),Qe=L.type==="reasoning_delta"||L.type==="answer_delta",ze=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta"].includes(L.type);z&&ze&&Z(),!I.signal.aborted&&(Te||L.type==="stream_start"||L.type==="session_title_start"||L.type==="session_title_delta"||L.type==="session_title_done")?z&&Qe?(ye(L,!1),k.current=k.current||Te,Re()):(ye(L,qe),z&&Te&&!qe&&(k.current=!0)):I.signal.aborted||ye(L,!1)}}catch(B){if(le=!0,!I.signal.aborted){if(ie(I),B instanceof Ne&&B.code==="chat_temporarily_disabled")pe=!0,y({question:oe,draft:c}),P.current===N&&(n(p),u.current=p,l(""));else if(B instanceof Ne&&B.code==="chat_capacity"){pe=!0;const z=B.retryAfterSeconds??5,X={question:oe,draft:c,request:v,optimistic:R,original:p,edit:b,retryAfterSeconds:z,retryAt:Date.now()+z*1e3};F.current=X,j({question:oe,draft:c,retryAt:X.retryAt,retryAfterSeconds:z}),P.current===N&&(n(p),u.current=p,l(""))}else Se(I,"network_error"),B instanceof Ne&&["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","chat_storage_quota_exceeded"].includes(B.code??"")&&(pe=!0,A.current.onInterrupted(c),P.current===N&&(n(p),u.current=p,l(B.message))),B instanceof Ne&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(B.code??"")&&(se=!0,A.current.onInterrupted(c));!pe&&P.current===N&&ye({type:"error",message:B instanceof Error?B.message:"The assistant stream failed.",code:B instanceof Ne?B.code:void 0})}}finally{if(h.current===I){if(((Ae=x.current)==null?void 0:Ae.controller)===I&&(Z(),x.current=null),ie(I),!ce&&!I.signal.aborted&&Se(I,"network_error"),m.current=!1,s(!1),pe)A.current.onSettled(v.session_id);else if(!I.signal.aborted){(me&&G||se)&&((je=(Ye=A.current).onProviderTerminal)==null||je.call(Ye));const B=K.current;if(b&&!me)P.current===N&&(n(b.snapshot),u.current=b.snapshot,l("Couldn’t resend this message. Your original conversation was restored."));else if(B){P.current===N&&b&&(le||!ce)&&(n(b.snapshot),u.current=b.snapshot);try{const z=await De(B,N);z&&b&&z.some(X=>X.id===b.targetId)&&l("Couldn’t resend this message. Your original conversation was restored.")}catch{P.current===N&&Q({type:"settle"})}}else P.current===N&&Q({type:"settle"});A.current.onSettled(B)}((Ue=S.current)==null?void 0:Ue.controller)===I&&(S.current=null)}}})(),!0},re=We(c=>{const v=typeof c=="string"?{text:c.trim(),paperMentions:[]}:c,R=v.text;if(!R||R.length>8e3||m.current||F.current)return!1;const p=u.current,b=[...p].reverse().find(G=>G.role==="user"),M=b!=null&&b.status&&b.status!=="complete"&&b.revision?{replace_message_id:b.id,prior_revision:b.revision}:null,N={id:ae(),role:"user",text:R,paperMentions:v.paperMentions},I={id:ae(),role:"assistant",streaming:!0,blocks:[]},oe=M&&b?Dn(p,G=>G.id===b.id):-1,me=oe<0?[...p,N,I]:[...p.slice(0,oe),N,I];return Ee(v,{message:R,paper_mentions:v.paperMentions.map(({route_id:G,title:se,start:ce,end:le})=>({route_id:G,title:se,start:ce,end:le})),session_id:A.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!A.current.webSearchEnabled,reasoning_effort:A.current.reasoningEffort??"low",...!A.current.sessionId&&A.current.initialModel?{initial_model:A.current.initialModel}:{},...M??{}},me,p)}),be=We((c,v)=>{const R=typeof v=="string"?{text:v.trim(),paperMentions:[]}:v,p=R.text;if(!p||p.length>8e3||m.current||F.current)return!1;const b=u.current.slice(),M=b.findIndex(G=>G.id===c&&G.role==="user");if(M<0)return!1;const N=b[M];if(!A.current.sessionId||!N.revision)return!1;const I={id:N.id,role:"user",text:p,paperMentions:R.paperMentions,revision:N.revision+1,status:"generating"},oe={id:ae(),role:"assistant",streaming:!0,blocks:[]},me=[...b.slice(0,M),I,oe];return Ee(R,{message:p,paper_mentions:R.paperMentions.map(({route_id:G,title:se,start:ce,end:le})=>({route_id:G,title:se,start:ce,end:le})),session_id:A.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!A.current.webSearchEnabled,reasoning_effort:A.current.reasoningEffort??"low",replace_message_id:N.id,prior_revision:N.revision},me,b,{targetId:N.id,snapshot:b})}),Pe=o.useCallback(()=>{F.current=null,j(null)},[]),Ce=We(()=>{const c=F.current;return!c||Date.now()<c.retryAt||m.current?!1:(F.current=null,j(null),Ee(c.draft,c.request,c.optimistic,c.original,c.edit))}),fe=We(()=>{var M,N;if(!h.current)return;const c=h.current;ie(c),Se(c,"stopped"),c.abort();const v=((M=x.current)==null?void 0:M.controller)===c?x.current.stream.takeAcceptedForStop():[];x.current=null;for(const I of v)ye(I,!1);Z(),h.current=null,((N=S.current)==null?void 0:N.controller)===c&&(S.current=null),m.current=!1,s(!1);const R=Q({type:"stop"},!1).messages;C.current=R,u.current=R,n(R),A.current.onInterrupted(xe.current);const p=K.current;p&&(H.current={sessionId:p,messages:R}),p&&Qt(p).catch(()=>{});const b=++P.current;window.setTimeout(()=>{p&&P.current===b?De(p,b).catch(()=>{}).finally(()=>A.current.onSettled(p)):p||A.current.onSettled(null)},450)}),T=o.useCallback((c,v)=>n(R=>R.map(p=>{var b;return p.id!==c?p:{...p,blocks:(b=p.blocks)==null?void 0:b.map((M,N)=>N===v&&(M.kind==="reasoning"||M.kind==="tool")?{...M,open:!M.open}:M)}})),[]),$e=o.useCallback(()=>{var c;P.current+=1,O.current!==null&&(window.clearTimeout(O.current),O.current=null),E.current="cleared",(c=h.current)==null||c.abort(),h.current=null,x.current=null,ge(),k.current=!1,H.current=null,S.current=null,F.current=null,j(null),m.current=!1,K.current=null,C.current=null,q.current=He(q.current,{type:"reset"}),V.current=null,Y.current=!1,n([]),s(!1),l("")},[]),Fe=We((c,v,R=!1)=>{var p;if(P.current+=1,O.current!==null&&(window.clearTimeout(O.current),O.current=null),E.current="cleared",ge(),k.current=!1,S.current=null,F.current=null,j(null),m.current&&v!==void 0&&v===K.current&&C.current){Y.current=!0,n(C.current),u.current=C.current,l("");return}if(Y.current=!1,m.current||((p=h.current)==null||p.abort(),h.current=null,C.current=null,V.current=null,Y.current=!1),R&&v){const b=[...c].reverse().find(M=>M.role==="user");if(b){const M={text:b.text??"",paperMentions:b.paperMentions??[]},N=[...c,{id:`${b.id}-active`,role:"assistant",streaming:!0,blocks:[]}];Ee(M,{message:M.text,session_id:v,client_message_id:"reconnect",web_search_enabled:!!A.current.webSearchEnabled,reasoning_effort:A.current.reasoningEffort??"low"},N,c,void 0,v);return}}n(c),u.current=c,q.current=He(q.current,{type:"load",messages:c,sessionId:v??A.current.sessionId}),m.current||s(!1),l("")});return{messages:t,busy:a,papers:he,sessionError:d,capacityRequest:ne,disabledRequest:g,send:re,editAndResend:be,retryCapacity:Ce,cancelCapacity:Pe,dismissDisabled:()=>y(null),stop:fe,toggleBlock:T,reset:$e,load:Fe}}const de=(e="")=>({text:e,paperMentions:[]}),Fn=()=>{const e=sessionStorage.getItem(et);if(!e)return null;try{const t=JSON.parse(e);if(typeof t.text=="string"&&Array.isArray(t.paperMentions))return t}catch{}return de(e)},rr=()=>{var B,z,X,L,Te,qe,Qe,ze;const{sessionId:e}=kt(),t=Ot(),[n,a]=It(),{user:s,isLoading:d}=At(),l=jt(),m=Lt(),h=Mt({queryKey:["chatAvailability"],queryFn:()=>Ge.getAvailability(),refetchInterval:3e4,retry:!1,enabled:Le()&&!!s}),x=((B=h.data)==null?void 0:B.status)==="paused",[D,_]=o.useState([]),[k,H]=o.useState(!1),[O,E]=o.useState(""),[S,F]=o.useState(()=>e?{id:e,status:"loading"}:null),[ne,j]=o.useState(0),g=o.useRef(zt()),y=o.useRef(n.get("model")||((z=g.current)==null?void 0:z.model)),[u,q]=o.useState(m?Jt:Xt),[C,V]=o.useState(y.current||Zt),Y=((X=u.find(i=>i.id===C))==null?void 0:X.provider)??"huggingface",A=Ut(!!(s&&Y==="openrouter")),xe=o.useRef(Y);xe.current=Y;const[Ie,P]=o.useState(""),[K,$]=o.useState(()=>de()),[he,ae]=o.useState(()=>{var i;return((i=g.current)==null?void 0:i.webSearchEnabled)??!1}),[Q,J]=o.useState(()=>{var i;return((i=g.current)==null?void 0:i.reasoningEffort)??"low"}),ge=!!((L=h.data)!=null&&L.web_search_available),[Z,Re]=o.useState(()=>{var f,w;const i=(f=n.get("q"))==null?void 0:f.trim();return i?de(i):((w=g.current)==null?void 0:w.draft)??de()}),ie=o.useRef(!1),Ke=o.useRef(!1),Me=o.useRef(!1),[Se,ye]=o.useState(()=>typeof window>"u"||window.innerWidth>900),De=o.useRef(new Set),Ee=o.useRef(!1),re=o.useRef(e),be=o.useRef(null),Pe=o.useRef(null),Ce=o.useRef(null);re.current=e;const fe=o.useCallback(async()=>{if(!s)return;const i=!Ee.current;i&&H(!0);try{const f=await en();_(w=>{const U=be.current,W=U?w.find(Be=>Be.id===U):void 0;if(!W)return f;const ue=f.find(Be=>Be.id===U);return[ue?{...ue,title:W.title,is_busy:!0}:W,...f.filter(Be=>Be.id!==U)]}),Ee.current=!0,E("")}catch(f){E(f instanceof Error?f.message:"Could not load chats")}finally{i&&H(!1)}},[s]),T=Pn({sessionId:e??null,initialModel:C,webSearchEnabled:ge&&he,reasoningEffort:Q,onSessionId:i=>{be.current=i;const f=i!==re.current,w=(re.current??null)===Pe.current,U=new Date().toISOString();_(W=>W.some(ue=>ue.id===i)?W.map(ue=>ue.id===i?{...ue,is_busy:!0}:ue):[{id:i,title:"New chat",selected_model:C,created_at:U,updated_at:U,message_count:1,is_busy:!0,web_search_enabled:he,reasoning_effort:Q},...W]),f&&w&&P("New chat"),w&&(Ce.current=i,F({id:i,status:"loaded"}),f&&t(`/chat/${i}`,{replace:!0}))},onTitle:i=>{const f=be.current??re.current;f&&!De.current.has(f)&&(f===re.current&&P(i),_(w=>w.map(U=>U.id===f?{...U,title:i}:U)))},onSettled:i=>{i&&_(f=>f.map(w=>w.id===i?{...w,is_busy:!1}:w)),be.current=null,Pe.current=null,fe()},onProviderTerminal:()=>{xe.current==="openrouter"&&(l.invalidateQueries({queryKey:qt}),l.invalidateQueries({queryKey:Bt}))},onInterrupted:i=>{$(i)}}),$e=T.send;o.useEffect(()=>{T.capacityRequest&&$(T.capacityRequest.draft)},[T.capacityRequest]);const Fe=o.useCallback(i=>{sessionStorage.setItem(et,JSON.stringify(i)),sessionStorage.setItem(Je,C),sessionStorage.setItem(tn,Q),sessionStorage.setItem(Xe,"1"),sessionStorage.setItem(Ze,"1");const f=re.current?`/chat/${re.current}`:"/chat";window.location.href=Nt(f,Y==="huggingface")},[Q,C,Y]),c=o.useCallback((i,f)=>{sessionStorage.setItem(et,JSON.stringify(i)),sessionStorage.setItem(Je,C),sessionStorage.removeItem(Xe),sessionStorage.removeItem(Ze),Re(de()),$(i),E(f)},[C]),v=o.useCallback(async i=>{if(!s){Fe(i);return}if(Y==="huggingface"&&!Ke.current){if(Me.current)return;Me.current=!0;try{if(!(await Ge.getInferenceBilling()).connected){if(sessionStorage.getItem(Ze)==="1"){c(i,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}Fe(i);return}Ke.current=!0}catch(w){c(i,w instanceof Error?w.message:"Could not check Hugging Face authorization.");return}finally{Me.current=!1}}const f=re.current??null;if(sessionStorage.removeItem(Xe),!$e(i)){c(i,"Your prompt was not sent. It is ready to retry.");return}Pe.current=f,be.current=f,sessionStorage.removeItem(et),sessionStorage.removeItem(Je),sessionStorage.removeItem(Ze),nn(),$(de())},[Fe,c,Y,$e,s]);o.useEffect(()=>{if(d||!s)return;const i=sessionStorage.getItem(Je);i&&V(i),fe(),rn().then(U=>{if(q(U.items),!re.current){const W=y.current||i;V(W&&U.items.some(ue=>ue.id===W)?W:U.default_model)}});const f=Fn(),w=sessionStorage.getItem(Xe)==="1";f&&(w?Re(f):$(f))},[d,fe,s]),o.useEffect(()=>{if(!e){Ce.current!==null&&(Ce.current=null,T.reset(),ae(!1),J("low")),F(null);return}if(Ce.current===e||(F(f=>(f==null?void 0:f.id)===e&&f.status==="loading"?f:{id:e,status:"loading"}),d||!s))return;let i=!1;return E(""),nt(e).then(f=>{i||(T.load(gt(f),e,f.is_busy),V(f.selected_model),ae(g.current&&f.messages.length===0?g.current.webSearchEnabled:f.web_search_enabled),J(g.current&&f.messages.length===0?g.current.reasoningEffort:f.reasoning_effort??"high"),P(f.title),Ce.current=e,F({id:e,status:"loaded"}))}).catch(f=>{if(i)return;const w=f instanceof Error?f.message:"Chat not found";T.reset(),E(w),F({id:e,status:"error",error:w})}),()=>{i=!0}},[d,e,s,T.busy,ne]),o.useEffect(()=>{var U;const i=(U=n.get("q"))==null?void 0:U.trim();if(!i)return;ie.current=!1;const f=n.get("model");f&&V(f),Re(de(i));const w=new URLSearchParams(n);w.delete("q"),w.delete("model"),a(w,{replace:!0})},[n,a]),o.useEffect(()=>{if(d||T.busy||!Z.text||ie.current||s&&he&&h.isFetching||e&&(S==null?void 0:S.status)!=="loaded")return;const i=window.setTimeout(()=>{if(ie.current)return;ie.current=!0,v(Z).finally(()=>Re(de()))},0);return()=>window.clearTimeout(i)},[d,h.isFetching,T.busy,Z,e,S==null?void 0:S.status,v,s,he]),o.useEffect(()=>{const i=()=>{!s||T.busy||fe()};return window.addEventListener("focus",i),()=>window.removeEventListener("focus",i)},[T.busy,fe,s]);const R=()=>{be.current=null,T.reset(),$(de()),ae(!1),J("low"),P(""),t("/chat")},p=async(i,f)=>{try{const w=await tt(i,{title:f});return De.current.add(i),i===e&&P(w.title),_(U=>U.map(W=>W.id===i?w:W)),!0}catch(w){return E(w instanceof Error?w.message:"Rename failed"),!1}},b=async i=>{const f=i===e&&T.busy;if(window.confirm(f?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){f&&T.stop();try{if(f){const w=Date.now()+3e3;for(;(await nt(i)).is_busy;){if(Date.now()>=w)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(W=>window.setTimeout(W,150))}}await sn(i),i===e&&R(),await fe()}catch(w){E(w instanceof Error?w.message:"Delete failed")}}},M=Tn({messages:T.messages,refreshSessions:fe,resetChat:T.reset,restoreDraft:$,clearTitle:()=>P("")}),N=async i=>{const f=C;if(V(i),!!e)try{const w=await tt(e,{selected_model:i});_(U=>U.map(W=>W.id===e?{...W,selected_model:w.selected_model}:W)),E("")}catch(w){V(f),E(w instanceof Error?w.message:"Model change failed")}},I=async i=>{const f=Q;if(J(i),!!e)try{const w=await tt(e,{reasoning_effort:i});_(U=>U.map(W=>W.id===e?w:W))}catch(w){J(f),E(w instanceof Error?w.message:"Effort change failed")}},[oe,me]=o.useState(60);o.useLayoutEffect(()=>{const i=document.querySelector(".app-header");if(!i)return;const f=()=>me(i.offsetHeight);f();const w=new ResizeObserver(f);return w.observe(i),()=>w.disconnect()},[]);const G=D.find(i=>i.id===e),se=T.messages.length===0,ce=(Te=[...T.messages].reverse().find(i=>i.role==="assistant"&&i.errorCode))==null?void 0:Te.errorCode,le=ce==="openrouter_unavailable"||ce==="openrouter_monthly_budget_exhausted",pe=(S==null?void 0:S.id)===e,Ae=!!(e&&(d||s&&(!pe||(S==null?void 0:S.status)==="loading"))),Ye=pe&&(S==null?void 0:S.status)==="error"?S.error:void 0,je=!!((qe=A.data)!=null&&qe.fallback_enabled),Ue={onSend:v,busy:T.busy,onStop:T.stop,draft:K,onDraftChange:$,models:u,selectedModel:C,onModelChange:i=>void N(i),disabled:x,describedBy:x?"chat-paused-description":void 0,paperMentionsEnabled:!!((Qe=h.data)!=null&&Qe.paper_mentions_enabled),webSearchAvailable:ge,webSearchEnabled:he,onWebSearchChange:ae,reasoningEffort:Q,onReasoningEffortChange:i=>void I(i)};return r.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${oe}px)`},children:[r.jsx(En,{sessions:D,activeSessionId:e,loading:k,error:O,open:Se,onClose:()=>ye(!1),onNew:R,onNavigate:i=>t(`/chat/${i}`),onRename:p,onDelete:i=>void b(i)}),r.jsxs("section",{className:"chat-main",children:[r.jsxs("div",{className:"chat-topbar",children:[!Se&&r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>ye(!0),title:"Open sidebar",children:r.jsx(mt,{})}),r.jsx("span",{className:"chat-topbar-title",children:Ae?(G==null?void 0:G.title)||"":Ie||(G==null?void 0:G.title)||(se?"":"New chat")}),m&&r.jsx("span",{className:"chat-staging-badge",children:"Staging"}),e&&pe&&(S==null?void 0:S.status)==="loaded"&&!se&&r.jsx(Cn,{sessionId:e,busy:T.busy,loading:Ae,onError:E})]}),Ae&&!Z.text?r.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[r.jsx(pt,{}),r.jsx("span",{children:"Loading conversation…"})]}):Ye?r.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[r.jsx("p",{children:Ye}),r.jsx("button",{type:"button",onClick:()=>{F({id:e,status:"loading"}),j(i=>i+1)},children:"Try again"})]}):se&&!Z.text?r.jsx("div",{className:"chat-empty",children:r.jsxs("div",{className:"chat-empty-inner",children:[r.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant"}),r.jsxs("h1",{className:"chat-empty-title",children:["Ask ",r.jsx("em",{children:"Papers With Code"})]}),r.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."}),m&&r.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),r.jsx(ut,{variant:"empty",composerProps:Ue,provider:Y,openRouterFallbackEnabled:je,byokExpected:le,paused:x,suggestions:an})]})}):r.jsxs(r.Fragment,{children:[T.sessionError&&r.jsx("div",{className:"chat-session-error",role:"alert",children:T.sessionError}),r.jsx(wn,{messages:T.messages,papers:T.papers,busy:T.busy,queuedDraft:Z.text?Z:void 0,paperMentionsEnabled:!!((ze=h.data)!=null&&ze.paper_mentions_enabled),archivePending:M.pending,openRouterFallbackEnabled:je,onToggleBlock:T.toggleBlock,onEditAndResend:T.editAndResend,onArchiveOld:()=>void M.archiveOld(),onArchiveOldest:()=>void M.archiveOldest()}),r.jsx(ut,{variant:"followup",composerProps:Ue,provider:Y,openRouterFallbackEnabled:je,byokExpected:le,paused:x})]})]}),T.capacityRequest&&r.jsx(xn,{retryAt:T.capacityRequest.retryAt,onCancel:T.cancelCapacity,onRetry:()=>{T.retryCapacity()&&$(de())}}),T.disabledRequest&&r.jsx(Rn,{onClose:()=>{var i;$(((i=T.disabledRequest)==null?void 0:i.draft)??K),T.dismissDisabled(),h.refetch()}})]})};export{xn as ChatCapacityDialog,vn as OpenRouterUsageNotice,rr as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/ChatView-D5ne7HbB.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var Nt=Object.defineProperty;var Mt=(e,t,n)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Te=(e,t,n)=>Mt(e,typeof t!="symbol"?t+"":t,n);import{d as Dt,A as Pt,V as Ft,j as r,r as o,X as Yt,e as Et,c as Ut,u as qt,a as Bt,y as Ht,g as Vt,W as Wt,L as pt,b as $t}from"./index-D_-UZEuL.js";import{u as Gt}from"./useQuery-BZo4MZ3s.js";import{C as Kt,U as mt,A as Qt}from"./ChatMessage-DwVcq3Ve.js";import{c as Be}from"./chat-7zW8PrrA.js";import{u as zt,r as Jt,a as Xt,O as Zt,b as en}from"./openrouter-DNgcWuY9.js";import{e as tn,f as Ct,h as nn,T as rn,d as kt,i as sn,j as an,k as on,l as cn,m as rt,t as Tt,r as ln,S as un,P as dn,D as hn,n as fn,o as et,s as Je,v as pn,w as Xe,x as Ze,y as mn,z as gn,B as nt,E as yn}from"./chatSessions-CPPX7pkh.js";import{S as bn}from"./chatPrompts-CDY3UGU1.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DiJQFgx9.js";import"./github-DQuIliTJ.js";import"./github-iFSl-B6V.js";import"./PaperPreviewLink-B25cD-_k.js";import"./index-vCOH2DKd.js";import"./papers-DHqjKX7p.js";import"./file-text--vrXMvWb.js";import"./chevron-down-DI19XsBw.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 _n=Dt("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"}]]),se=(e,t)=>new Promise(n=>{const s=setTimeout(a,e);function a(){t==null||t.removeEventListener("abort",a),clearTimeout(s),n()}t==null||t.addEventListener("abort",a)}),xe=e=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...e}),Re={name:"Object Detection",slug:"object-detection"},Oe={name:"Real-Time Object Detection",slug:"real-time-object-detection"},vn={"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:xe({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[Re,Oe],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:xe({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[Re,Oe],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:xe({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:[Re,Oe],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:xe({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[Re,Oe],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:xe({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:[Re,Oe],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:xe({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:[Re,Oe],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:xe({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"},Re],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:xe({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[Re,Oe],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},Ot=e=>e.map(t=>vn[t]),gt=Ot(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),yt=Ot(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),bt="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.",_t="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.",vt=`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.`,wn=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*xn(e,t){const n=()=>(t==null?void 0:t.aborted)===!0,s=e.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 se(350,t),!n()){yield{type:"reasoning_start"};for(let a=0;a<bt.length;a+=6){if(await se(14,t),n())return;yield{type:"reasoning_delta",text:bt.slice(a,a+6)}}if(await se(400,t),!n()&&(yield{type:"reasoning_end"},await se(300,t),!n()&&(yield{type:"tool_call",id:"call_1",name:"search_papers",args:{query:s,top_k:8}},await se(1100,t),!n()&&(yield{type:"tool_result",id:"call_1",hits:gt.length,took_ms:214,results:gt},await se(350,t),!n())))){yield{type:"reasoning_start"};for(let a=0;a<_t.length;a+=6){if(await se(14,t),n())return;yield{type:"reasoning_delta",text:_t.slice(a,a+6)}}if(await se(350,t),!n()&&(yield{type:"reasoning_end"},await se(300,t),!n()&&(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 se(900,t),!n()&&(yield{type:"tool_result",id:"call_2",hits:yt.length,took_ms:176,results:yt},await se(400,t),!n())))){for(let a=0;a<vt.length;a+=4){if(await se(11,t),n())return;yield{type:"answer_delta",text:vt.slice(a,a+4)}}yield{type:"done",followups:wn,finish_reason:"success"}}}}}const Ne=()=>{const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"},Rn=()=>!0;class Le extends Error{constructor(t,n,s,a){super(t),this.code=n,this.status=s,this.retryAfterSeconds=a,this.name="ChatStreamError"}}function Sn(e,t){if(Ne())try{Be.reportLatency(e,t).catch(()=>{})}catch{}}function En(e,t={}){return Ne()?kn(e,t.signal):xn(e.message,t.signal)}function Cn(e,t={}){return Tn(e,t.signal)}async function*kn(e,t){const n=await Be.stream(e,t);yield*It(n)}async function*Tn(e,t){const n=await Be.resumeStream(e,t);yield*It(n)}async function*It(e){if(!e.ok||!e.body){const a=e.ok?null:new Pt(e,await e.text());a&&Ft(a);const m=a==null?void 0:a.detail,u=typeof m=="object"&&m!==null?m:null,g=e.status===403&&!m,c=Number(e.headers.get("Retry-After")),C=Number.isFinite(c)&&c>=0?Math.min(300,Math.ceil(c)):void 0;throw new Le(g?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(a==null?void 0:a.message)||`Chat stream failed (${e.status})`,u&&"code"in u&&typeof u.code=="string"?u.code:g?"staging_access_required":void 0,e.status,C)}const t=e.body.getReader(),n=new TextDecoder;let s="";try{for(;;){const{done:a,value:m}=await t.read();if(a)break;s+=n.decode(m,{stream:!0});let u;for(;(u=s.indexOf(`
13
+
14
+ `))!==-1;){const g=s.slice(0,u);s=s.slice(u+2);const c=g.split(`
15
+ `).filter(C=>C.startsWith("data:")).map(C=>C.slice(5).trimStart()).join(`
16
+ `);!c||c==="[DONE]"||(yield JSON.parse(c))}}}finally{t.releaseLock()}}const On="https://huggingface.co/settings/inference-providers",In="https://paperswithcode.co/chat",wt="pwc.chat.billing-notice-dismissed.v1";function An({provider:e}){const[t,n]=o.useState(()=>localStorage.getItem(wt)==="1");return!Ne()||t||e!=="huggingface"?null:r.jsxs("div",{className:"chat-billing-notice",role:"note",children:[r.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."}),r.jsxs("div",{className:"chat-billing-notice-actions",children:[r.jsx("a",{href:"/settings",children:"Review billing"}),r.jsx("a",{href:On,target:"_blank",rel:"noreferrer",children:"Review usage"}),r.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(wt,"1"),n(!0)},children:r.jsx(Yt,{size:15,"aria-hidden":"true"})})]})]})}function jn({enabled:e,fallbackEnabled:t,byokExpected:n}){const s=zt(e);if(!e||!s.data)return null;const a=s.data,m=Jt(a.resets_at),u=a.unavailable_reason==="staging_funding_disabled",g=a.unavailable_reason==="shared_credits_exhausted"||a.unavailable_reason==="workspace_limit_exhausted"||a.unavailable_reason==="provider_status_unavailable";return r.jsxs("div",{className:"chat-openrouter-usage",role:"status",children:[r.jsx("span",{children:u?r.jsx("strong",{children:"Chat is now live on paperswithcode.co"}):g?r.jsxs(r.Fragment,{children:[r.jsx("strong",{children:"Shared OpenRouter credits unavailable"})," · ",a.remaining_percent,"% of your allowance remains"]}):r.jsxs(r.Fragment,{children:[r.jsxs("strong",{children:[a.remaining_percent,"% left"]})," this month · resets ",m.local]})}),u?r.jsxs("span",{children:[r.jsx("a",{href:a.production_chat_url||In,children:"Continue on production"}),t&&" · Your connected OpenRouter key remains available on staging."]}):(!a.available||n)&&r.jsx("span",{children:t?"Your connected OpenRouter key will be used on your next explicit send.":r.jsxs(r.Fragment,{children:[r.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own key in Settings"})," to continue."]})})]})}function xt({variant:e,composerProps:t,provider:n,openRouterFallbackEnabled:s,byokExpected:a,paused:m,suggestions:u=[]}){var c;const g=r.jsxs(r.Fragment,{children:[r.jsx(An,{provider:n}),r.jsx(jn,{enabled:n==="openrouter",fallbackEnabled:s,byokExpected:a}),m&&r.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."}),r.jsx(Kt,{...t,...e==="empty"?{autoFocus:!0}:{placeholder:(c=t.draft)!=null&&c.text?"Edit and send again…":"Ask a follow-up…"}}),e==="empty"&&r.jsx("div",{className:"chat-examples",children:u.map(C=>r.jsx("button",{type:"button",className:"chat-example",disabled:m,onClick:()=>t.onSend({text:C,paperMentions:[]}),children:C},C))})]});return e==="empty"?g:r.jsx("div",{className:"chat-composer-wrap",children:r.jsxs("div",{className:"chat-composer-inner",children:[g,r.jsx("div",{className:"chat-composer-foot",children:Ne()?r.jsxs(r.Fragment,{children:[n==="openrouter"?r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",r.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",r.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),r.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):r.jsx(r.Fragment,{children:"Assistant preview — responses are simulated."})})]})})}function Ln({messages:e,papers:t,busy:n,queuedDraft:s,paperMentionsEnabled:a,archivePending:m,openRouterFallbackEnabled:u,onToggleBlock:g,onEditAndResend:c,onArchiveOld:C,onArchiveOldest:L}){var _,b;const[w,x]=o.useState(null),D=o.useRef(null),k=o.useRef(null),N=o.useRef(null);o.useEffect(()=>{n?x(null):N.current=null},[n]),o.useLayoutEffect(()=>{const d=D.current;if(d){if(k.current!==null){d.scrollTop=k.current,k.current=null;return}if(N.current){const A=Array.from(d.querySelectorAll("[data-message-id]")).find(E=>E.dataset.messageId===N.current);if(A){const E=d.getBoundingClientRect(),H=A.getBoundingClientRect();d.scrollTop+=H.top-E.top-24;return}}d.scrollTop=d.scrollHeight}},[e]);const P=e.filter(d=>d.role==="user"),q=(_=P[0])==null?void 0:_.id,ne=(b=P.at(-1))==null?void 0:b.id,O=(d,A)=>{var E;k.current=((E=D.current)==null?void 0:E.scrollTop)??null,g(d,A)};return r.jsx("div",{className:"chat-conversation",ref:D,children:r.jsxs("div",{className:"chat-conversation-inner",children:[e.length===0&&(s==null?void 0:s.text)&&r.jsx(mt,{id:"queued-launch-preview",text:s.text,paperMentions:s.paperMentions,isInitial:!0}),e.map(d=>d.role==="user"?r.jsx(mt,{id:d.id,text:d.text??"",paperMentions:d.paperMentions??[],paperMentionsEnabled:a,isInitial:d.id===q,editingAllowed:!n&&!!d.revision,editing:w===d.id,editNotice:d.id===q?"Sending will replace this conversation.":d.id===ne?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>x(d.id),onCancel:()=>x(null),onResendDraft:A=>{d.id!==q&&(N.current=d.id);const E=c(d.id,A);return E?x(null):N.current=null,E}},d.id):r.jsx(Qt,{msg:d,papers:t,onToggleBlock:O,onArchiveOldChats:C,onArchiveOldestChats:L,archivePending:m,hfBilling:null,openRouterFallbackEnabled:u,feedbackEnabled:!0},d.id))]})})}function Nn({retryAt:e,onRetry:t,onCancel:n}){const[s,a]=o.useState(()=>Math.max(0,Math.ceil((e-Date.now())/1e3))),m=o.useRef(null);return o.useEffect(()=>{var C;const u=document.activeElement instanceof HTMLElement?document.activeElement:null;(C=m.current)==null||C.focus();const g=()=>a(Math.max(0,Math.ceil((e-Date.now())/1e3)));g();const c=window.setInterval(g,250);return()=>{window.clearInterval(c),u==null||u.focus()}},[e]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),n())},children:[r.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),r.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),r.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."}),r.jsxs("div",{className:"chat-capacity-dialog-actions",children:[r.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:m,onClick:n,children:"Cancel"}),r.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:s>0,onClick:t,children:"Try again"})]})]})})}function Mn({onClose:e}){const t=o.useRef(null);return o.useEffect(()=>{var s;const n=document.activeElement instanceof HTMLElement?document.activeElement:null;return(s=t.current)==null||s.focus(),()=>n==null?void 0:n.focus()},[]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:n=>{n.key==="Escape"&&(n.preventDefault(),e())},children:[r.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),r.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."}),r.jsx("div",{className:"chat-capacity-dialog-actions",children:r.jsx("button",{ref:t,type:"button",className:"chat-capacity-cancel",onClick:e,children:"Keep editing"})})]})})}function Dn({url:e,onClose:t}){return e?r.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:t,children:r.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:n=>n.stopPropagation(),children:[r.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),r.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),r.jsx("input",{readOnly:!0,value:e,"aria-label":"Public conversation link",autoFocus:!0,onFocus:n=>n.currentTarget.select()}),r.jsx("button",{type:"button",onClick:t,children:"Close"})]})}):null}function Pn({sessions:e,activeSessionId:t,loading:n,error:s,open:a,onClose:m,onNew:u,onNavigate:g,onRename:c,onDelete:C}){const[L,w]=o.useState(null),[x,D]=o.useState(""),[k,N]=o.useState(null);o.useEffect(()=>{if(!k)return;const O=()=>N(null),_=b=>{b.key==="Escape"&&O()};return window.addEventListener("click",O),window.addEventListener("keydown",_),()=>{window.removeEventListener("click",O),window.removeEventListener("keydown",_)}},[k]);const P=O=>{w(O.id),D(O.title)},q=async O=>{const _=x.trim();_&&await c(O,_)&&w(null)},ne=(O,_,b)=>N({id:O,x:_,y:b});return r.jsxs("aside",{className:`chat-sidebar${a?"":" chat-sidebar-closed"}`,children:[r.jsxs("div",{className:"chat-sidebar-top",children:[r.jsxs("button",{type:"button",className:"chat-new-chat",onClick:u,children:[r.jsx(tn,{})," New chat"]}),r.jsx("button",{type:"button",className:"icon-btn",onClick:m,title:"Collapse sidebar",children:r.jsx(Ct,{})})]}),r.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[n&&r.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!n&&s&&r.jsx("div",{className:"chat-sessions-empty",children:s}),!n&&!s&&e.length===0&&r.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),nn(e).map(O=>r.jsxs("div",{className:"chat-session-group",children:[r.jsx("div",{className:"chat-session-group-label",children:O.label}),O.items.map(_=>r.jsxs("div",{className:`chat-session${_.id===t?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>g(_.id),onKeyDown:b=>{if(b.key==="Enter"&&g(_.id),b.key==="F2"&&P(_),b.key==="ContextMenu"||b.shiftKey&&b.key==="F10"){b.preventDefault();const d=b.currentTarget.getBoundingClientRect();ne(_.id,d.right-150,d.bottom)}},onContextMenu:b=>{b.preventDefault(),ne(_.id,b.clientX,b.clientY)},children:[L===_.id?r.jsx("input",{className:"chat-session-title-input",value:x,autoFocus:!0,maxLength:80,onClick:b=>b.stopPropagation(),onChange:b=>D(b.target.value),onBlur:()=>void q(_.id),onKeyDown:b=>{b.stopPropagation(),b.key==="Enter"&&q(_.id),b.key==="Escape"&&w(null)}}):r.jsx("span",{className:"chat-session-title",children:_.title}),r.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:b=>{b.stopPropagation();const d=b.currentTarget.getBoundingClientRect();ne(_.id,d.right-150,d.bottom)},children:"⋯"}),r.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:b=>{b.stopPropagation(),C(_.id)},children:r.jsx(rn,{})})]},_.id))]},O.label))]}),k&&r.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:k.x,top:k.y},onClick:O=>O.stopPropagation(),children:r.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const O=e.find(_=>_.id===k.id);O&&P(O),N(null)},children:"Rename chat"})})]})}function Fn({sessionId:e,busy:t,loading:n,onError:s}){const{toast:a}=Et(),[m,u]=o.useState(!1),[g,c]=o.useState(""),C=async()=>{var L;if(!(t||m)){u(!0);try{const w=await sn(e),x=new URL(w.public_path,window.location.origin).toString();try{if(!((L=navigator.clipboard)!=null&&L.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(x),a({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{c(x)}}catch(w){const x=w instanceof Error?w.message:"Could not share this conversation";s(x),a({variant:"destructive",title:"Share failed",description:x})}finally{u(!1)}}};return r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void C(),disabled:t||m||n,"aria-label":"Share conversation",children:[m?r.jsx(kt,{}):r.jsx(_n,{"aria-hidden":"true"}),r.jsx("span",{children:"Share"})]}),r.jsx(Dn,{url:g,onClose:()=>c("")})]})}function Yn({messages:e,refreshSessions:t,resetChat:n,restoreDraft:s,clearTitle:a}){const{toast:m}=Et(),[u,g]=o.useState(null),c=()=>{const w=[...e].reverse().find(x=>x.role==="user");n(),s({text:(w==null?void 0:w.text)??"",paperMentions:(w==null?void 0:w.paperMentions)??[]}),a()};return{pending:u,archiveOld:async()=>{if(u===null){g("old");try{const w=await on();if(await t(),w.archived_count===0){m({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}c(),m({title:`${w.archived_count} ${w.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(w){m({variant:"destructive",title:"Could not archive old chats",description:w instanceof Error?w.message:"Try again."})}finally{g(null)}}},archiveOldest:async()=>{if(u===null){g("oldest");try{const w=await an();await t(),c(),m({title:`${w.archived_count} ${w.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(w){m({variant:"destructive",title:"Could not archive chats",description:w instanceof Error?w.message:"Try again."})}finally{g(null)}}}}}class Un{constructor(t,n=Sn){Te(this,"requestId");Te(this,"firstVisibleAt");Te(this,"streamStartReported",!1);Te(this,"firstVisibleReported",!1);Te(this,"terminalReported",!1);Te(this,"semanticReported",new Set);this.submittedAt=t,this.report=n}recordStreamStart(t,n){this.requestId=t,this.streamStartReported||(this.streamStartReported=!0,this.send({submission_to_stream_start_ms:Math.max(0,n-this.submittedAt)})),this.reportFirstVisible()}recordFirstVisible(t){this.firstVisibleAt===void 0&&(this.firstVisibleAt=t,this.reportFirstVisible())}recordSemantic(t,n){if(this.semanticReported.has(t))return;this.semanticReported.add(t);const s=Math.max(0,n-this.submittedAt);this.send(t==="reasoning"?{submission_to_first_reasoning_delta_ms:s}:t==="tool"?{submission_to_first_tool_call_ms:s}:{submission_to_first_answer_delta_ms:s})}recordTerminal(t){this.terminalReported||(this.terminalReported=!0,this.send({terminal_classification:t}))}reportFirstVisible(){!this.requestId||this.firstVisibleAt===void 0||this.firstVisibleReported||(this.firstVisibleReported=!0,this.send({submission_to_first_visible_delta_ms:Math.max(0,this.firstVisibleAt-this.submittedAt)}))}send(t){this.requestId&&this.report(this.requestId,t)}}const At="Preparing research workspace…",jt={preparing_workspace:"Preparing secure workspace…",starting_agent:"Starting research agent…",connecting_model:"Connecting to model…"},Lt=()=>({messages:[],sessionId:null,title:"",phase:"idle"});function Rt(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return n;return-1}function qe(e){if(e.status!==At&&!Object.values(jt).includes(e.status))return e;const{status:t,...n}=e;return n}function ae(e,t){if(!e.length)return e;const n=e.slice();return n[n.length-1]=t(n[n.length-1]),n}function St(e,t,n){return ae(e,s=>{const a=qe(s),m=a.blocks??[];return{...a,blocks:m.map((u,g)=>t(u,g,m)?n(u):u)}})}function qn(e,t){switch(t.type){case"stream_start":return t.session_id?{...e,sessionId:t.session_id}:e;case"sandbox_start":case"sandbox_ready":case"workspace_ready":return e;case"lifecycle":return{...e,messages:ae(e.messages,n=>{var s;return n.role==="assistant"&&n.streaming&&(((s=n.blocks)==null?void 0:s.length)??0)===0?{...n,status:jt[t.phase]}:n})};case"session_title_start":return{...e,title:""};case"session_title_delta":return{...e,title:`${e.title}${t.text}`.replace(/\s+/g," ").slice(0,80)};case"session_title_done":return{...e,title:t.title};case"reasoning_start":return{...e,messages:ae(e.messages,n=>{const s=qe(n);return{...s,blocks:[...(s.blocks??[]).map(a=>a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a),{kind:"reasoning",text:"",active:!0,open:!0}]}})};case"reasoning_delta":return{...e,messages:St(e.messages,(n,s,a)=>n.kind==="reasoning"&&Rt(a,m=>m.kind==="reasoning")===s,n=>n.kind==="reasoning"?{...n,text:n.text+t.text}:n)};case"reasoning_end":return{...e,messages:ae(e.messages,n=>{const s=n.blocks??[],a=Rt(s,g=>g.kind==="reasoning"&&g.active);if(a<0)return n;const m=s[a];if(m.kind!=="reasoning")return n;const u=s[a-1];return(u==null?void 0:u.kind)==="reasoning"&&u.text===m.text?{...n,blocks:s.filter((g,c)=>c!==a)}:{...n,blocks:s.map((g,c)=>c===a?{...m,active:!1,open:!1}:g)}})};case"tool_call":return{...e,messages:ae(e.messages,n=>{const s=qe(n);return{...s,blocks:[...s.blocks??[],{kind:"tool",id:t.id,name:t.name,args:t.args,status:"running",open:!1}]}})};case"tool_result":return{...e,messages:St(e.messages,n=>n.kind==="tool"&&n.id===t.id,n=>n.kind!=="tool"?n:t.status?{...n,schema_version:2,status:t.status,took_ms:t.took_ms,content:t.content,metadata:t.metadata,open:t.status!=="success"}:{...n,status:"done",hits:t.hits,took_ms:t.took_ms,results:t.results})};case"answer_delta":return{...e,messages:ae(e.messages,n=>{const s=qe(n),a=s.blocks??[],m=a.at(-1);return(m==null?void 0:m.kind)==="answer"&&!m.done?{...s,blocks:[...a.slice(0,-1),{...m,text:m.text+t.text}]}:{...s,blocks:[...a,{kind:"answer",text:t.text,done:!1}]}})};case"done":return{...e,phase:"complete",messages:ae(e.messages,n=>({...n,streaming:!1,followups:t.followups,finishReason:t.finish_reason,citations:t.citations,blocks:(n.blocks??[]).map(s=>s.kind==="answer"?{...s,done:!0}:s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}))};case"error":return{...e,phase:"failed",messages:ae(e.messages,n=>({...n,streaming:!1,error:t.message,errorCode:t.code,blocks:(n.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}))}}}function Bn(e){return ae(e,t=>{if(t.role!=="assistant")return t;const n=(t.blocks??[]).flatMap(s=>s.kind==="tool"&&s.status==="running"?[]:s.kind==="reasoning"&&s.active?s.text?[{...s,active:!1,open:!1}]:[]:s.kind==="answer"?[{...s,done:!0}]:[s]);return{...t,blocks:n,streaming:!1,finishReason:"stopped"}})}function Ye(e,t){switch(t.type){case"start":return{messages:t.messages,sessionId:t.sessionId,title:"",phase:"streaming"};case"event":return qn(e,t.event);case"load":return{messages:t.messages,sessionId:t.sessionId,title:e.title,phase:"idle"};case"workspace_status":return{...e,messages:ae(e.messages,n=>{var s;return n.role==="assistant"&&n.streaming&&(((s=n.blocks)==null?void 0:s.length)??0)===0&&!n.error?{...n,status:At}:n})};case"clear_workspace_status":return{...e,messages:ae(e.messages,qe)};case"settle":return{...e,phase:"idle",messages:ae(e.messages,n=>n.streaming?{...n,streaming:!1}:n)};case"stop":return{...e,messages:Bn(e.messages),phase:"stopped"};case"reset":return Lt()}}const Se={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},Hn={now:()=>performance.now(),sleep:(e,t)=>new Promise(n=>{if(t!=null&&t.aborted||e<=0){n();return}const s=window.setTimeout(a,e);function a(){t==null||t.removeEventListener("abort",a),window.clearTimeout(s),n()}t==null||t.addEventListener("abort",a,{once:!0})})};function Vn(e){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(e.type)}function Wn(e,t=!1,n=Se.maxPendingChars){var a;if(!e)return{pieces:[],pending:""};if(t)return{pieces:[e],pending:""};const s=Intl.Segmenter;if(s){const u=[...new s(void 0,{granularity:"word"}).segment(e)].filter(c=>c.isWordLike);let g=0;if(u.length>1&&(g=u.at(-1).index),u.length&&/\s$/u.test(e)&&(g=e.length),g>0){const c=e.slice(0,g),C=[],w=[...new s(void 0,{granularity:"word"}).segment(c)].filter(x=>x.isWordLike);for(let x=0;x<w.length;x+=1){const D=x===0?0:w[x].index,k=((a=w[x+1])==null?void 0:a.index)??c.length;k>D&&C.push(c.slice(D,k))}return w.length||C.push(c),{pieces:C,pending:e.slice(g)}}}else{const m=[...e.matchAll(/\s+/gu)];if(m.length){const u=[];let g=0;for(const c of m){const C=c.index+c[0].length;u.push(e.slice(g,C)),g=C}return{pieces:u,pending:e.slice(g)}}}return e.length>=n?{pieces:[e.slice(0,n)],pending:e.slice(n)}:{pieces:[],pending:e}}function $n(e,t={}){const n={minDelayMs:t.minDelayMs??Se.minDelayMs,maxDelayMs:t.maxDelayMs??Se.maxDelayMs,minRateCharsPerMs:t.minRateCharsPerMs??Se.minRateCharsPerMs,maxBufferedMs:t.maxBufferedMs??Se.maxBufferedMs,arrivalRateTauMs:t.arrivalRateTauMs??Se.arrivalRateTauMs,arrivalRateHeadroom:t.arrivalRateHeadroom??Se.arrivalRateHeadroom,maxPendingChars:t.maxPendingChars??Se.maxPendingChars},s=t.clock??Hn,a=[];let m="",u=null,g=0,c=!0,C=!1,L=null,w=0,x=s.now();const D=()=>{L==null||L(),L=null},k=(_,b)=>{const d=_.type==="reasoning_delta"||_.type==="answer_delta"?_.text.length:0;a.push({kind:"event",event:_,arrivedAt:b,chars:d}),D()},N=_=>{if(!u||!m)return;const b=Wn(m,_,n.maxPendingChars);for(const d of b.pieces)d&&k({type:u,text:d},g),g=s.now();m=b.pending,m||(u=null)},P=_=>{if(!c)return;const b=s.now();if(_.type==="reasoning_delta"||_.type==="answer_delta"){const d=_.type;if(!_.text)return;u&&u!==d&&N(!0),u||(u=d,g=b),m+=_.text;const A=Math.max(0,b-x);for(w*=Math.exp(-A/n.arrivalRateTauMs),w+=_.text.length,x=b,N(!1);m.length>=n.maxPendingChars;)N(!1);return}Vn(_)&&N(!0),k(_,b)},q=(async()=>{var _;try{for await(const b of e)P(b);c&&N(!0)}catch(b){c&&!((_=t.signal)!=null&&_.aborted)&&(N(!0),a.push({kind:"error",error:b,arrivedAt:s.now(),chars:0}))}finally{C=!0,D()}})(),ne=()=>a.length||C?Promise.resolve():new Promise(_=>{L=_});return{events:async function*(){var b,d,A,E;let _=Number.NEGATIVE_INFINITY;try{for(;;){if(await ne(),!a.length){if(C||!c)return;continue}const H=a[0];if(H.kind==="error")throw a.shift(),H.error;if(H.chars&&!((b=t.isHidden)!=null&&b.call(t))){const W=s.now(),T=a.reduce((he,Ce)=>he+Ce.chars,0),J=((d=a.find(he=>he.chars))==null?void 0:d.arrivedAt)??W,Ee=Math.max(0,n.maxBufferedMs-(W-J)),V=w*Math.exp(-Math.max(0,W-x)/n.arrivalRateTauMs)/n.arrivalRateTauMs,G=Ee>0?T/Ee:Number.POSITIVE_INFINITY,Q=Math.max(n.minRateCharsPerMs,V*n.arrivalRateHeadroom,G),ue=Math.min(n.maxDelayMs,Math.max(n.minDelayMs,H.chars/Q)),K=Math.max(0,H.arrivedAt+n.maxBufferedMs-W),de=Math.max(H.arrivedAt,_+Math.min(ue,K));if(await s.sleep(Math.max(0,de-s.now()),t.signal),!c||(A=t.signal)!=null&&A.aborted)return}a.shift(),_=s.now(),yield H.event}}finally{c&&(c=!1,D(),await((E=e.return)==null?void 0:E.call(e,void 0))),await q}}(),takeAcceptedForStop(){var b;if(!c)return[];c=!1,u&&m&&(k({type:u,text:m},g),m="",u=null);const _=a.flatMap(d=>d.kind==="event"&&d.event.type!=="done"&&d.event.type!=="error"?[d.event]:[]);return a.length=0,D(),(b=e.return)==null||b.call(e,void 0),_}}}const Gn=750;function Kn(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return n;return-1}function Ue(e){const t=o.useRef(e);return o.useLayoutEffect(()=>{t.current=e}),o.useCallback((...n)=>t.current(...n),[])}function Qn(e){const[t,n]=o.useState([]),[s,a]=o.useState(!1),[m,u]=o.useState(""),g=o.useRef(!1),c=o.useRef(null),C=o.useRef(null),L=o.useRef(null),w=o.useRef(null),x=o.useRef(!1),D=o.useRef(null),k=o.useRef(null),N=o.useRef("cleared"),P=o.useRef(null),q=o.useRef(null),[ne,O]=o.useState(null),[_,b]=o.useState(null),d=o.useRef([]),A=o.useRef(Lt()),E=o.useRef(null),H=o.useRef(null),W=o.useRef(!1),T=o.useRef(e),J=o.useRef({text:"",paperMentions:[]}),Ee=o.useRef(0),V=o.useRef(0),G=o.useRef(e.sessionId),Q=o.useRef(e.sessionId);Q.current!==e.sessionId&&(Q.current=e.sessionId,G.current!==e.sessionId&&(V.current+=1,P.current=null)),T.current=e,d.current=t,o.useEffect(()=>()=>{var l;k.current!==null&&window.clearTimeout(k.current),(l=c.current)==null||l.abort(),C.current=null,L.current!==null&&cancelAnimationFrame(L.current),w.current!==null&&window.clearTimeout(w.current),q.current=null},[]),o.useEffect(()=>{g.current||(G.current=e.sessionId)},[e.sessionId]),o.useEffect(()=>{const l=g.current&&e.sessionId===G.current?E.current:null;W.current=l!==null,l&&(n(l),d.current=l)},[e.sessionId]);const ue=o.useMemo(()=>{const l={};for(const R of t)for(const S of R.blocks??[])if(S.kind==="tool")for(const h of S.results??[])l[h.route_id]=h;return l},[t]),K=()=>`m${++Ee.current}_${Date.now().toString(36)}`,de=(l,R=!0)=>{const S={...A.current,messages:E.current??d.current,sessionId:G.current},h=Ye(S,l);A.current=h,E.current&&(E.current=h.messages);const y=l.type==="event"&&l.event.type==="stream_start"?l.event.session_id:null;return y?(G.current=y,T.current.onSessionId(y)):h.sessionId&&h.sessionId!==S.sessionId&&(G.current=h.sessionId,T.current.onSessionId(h.sessionId)),h.title!==S.title&&T.current.onTitle(h.title),R&&(d.current=h.messages,n(h.messages)),h},he=()=>H.current===V.current||W.current,Ce=()=>{L.current!==null&&(cancelAnimationFrame(L.current),L.current=null),w.current!==null&&(window.clearTimeout(w.current),w.current=null)},ie=()=>{Ce(),document.visibilityState!=="hidden"&&(!W.current||!E.current||(x.current=!1,d.current=E.current,n(E.current)))},Me=()=>{if(!W.current||document.visibilityState==="hidden"||L.current!==null||w.current!==null)return;const l=()=>{L.current=null,w.current=null,ie()};typeof requestAnimationFrame=="function"?L.current=requestAnimationFrame(l):w.current=window.setTimeout(l,0)};o.useEffect(()=>{const l=()=>{document.visibilityState==="visible"&&x.current&&Me()};return document.addEventListener("visibilitychange",l),()=>document.removeEventListener("visibilitychange",l)});const be=l=>{if(c.current!==l||(k.current!==null&&(window.clearTimeout(k.current),k.current=null),N.current==="cleared"))return;const R=N.current==="shown";N.current="cleared",R&&de({type:"clear_workspace_status"},he())},He=(l,R)=>{k.current!==null&&window.clearTimeout(k.current),N.current="armed",k.current=window.setTimeout(()=>{k.current=null,!(N.current!=="armed"||c.current!==l||l.signal.aborted||V.current!==R)&&(N.current="shown",de({type:"workspace_status"},he()))},Gn)},re=(l,R)=>{const S=P.current;!S||S.controller!==l||S.tracker.recordStreamStart(R,performance.now())},fe=(l,R)=>{const S=P.current;!S||S.controller!==l||S.tracker.recordTerminal(R)};o.useLayoutEffect(()=>{const l=P.current;if(!l)return;const R=t.at(-1);if((R==null?void 0:R.role)!=="assistant"||!(R.blocks??[]).some(y=>y.kind==="tool"||y.kind==="reasoning"&&!!y.text.trim()||y.kind==="answer"&&!!y.text.trim()))return;const h=performance.now();l.tracker.recordFirstVisible(h);for(const y of R.blocks??[])y.kind==="reasoning"&&y.text.trim()?l.tracker.recordSemantic("reasoning",h):y.kind==="tool"?l.tracker.recordSemantic("tool",h):y.kind==="answer"&&y.text.trim()&&l.tracker.recordSemantic("answer",h)},[t]);const pe=(l,R=!0)=>{de({type:"event",event:l},R)},_e=async(l,R)=>{var y;const S=await rt(l);let h=Tt(S);return((y=D.current)==null?void 0:y.sessionId)===l&&(h=D.current.messages,D.current=null),V.current!==R&&!(H.current===R&&W.current&&T.current.sessionId===l)?null:(n(h),d.current=h,E.current=h,A.current=Ye(A.current,{type:"load",messages:h,sessionId:l}),h)},me=(l,R,S,h,y,j)=>{const I=++V.current;H.current=I,W.current=!0,g.current=!0;const f=new AbortController;c.current=f;const oe=l.text;return J.current=l,G.current=R.session_id,u(""),n(S),E.current=S,A.current=Ye(A.current,{type:"start",messages:S,sessionId:R.session_id}),a(!0),P.current=j?null:{controller:f,tracker:new Un(performance.now())},N.current="cleared",(async()=>{var ge,we,Ke,Qe;let ce=!1,X=!1,Z=!1,ee=!1,$=!1,le=!1;try{const B=j?Cn(j,{signal:f.signal}):En(R,{signal:f.signal}),U=!j&&Ne()&&Rn(),z=U?$n(B,{signal:f.signal,isHidden:()=>document.visibilityState==="hidden"}):null;z&&(C.current={controller:f,stream:z});for await(const M of(z==null?void 0:z.events)??B){M.type==="stream_start"&&(ce=!0,X=M.provider_execution!==!1,re(f,M.request_id)),M.type==="sandbox_start"&&He(f,I),M.type==="lifecycle"&&be(f),(M.type==="reasoning_start"||M.type==="reasoning_delta"||M.type==="tool_call"||M.type==="answer_delta"||M.type==="done"||M.type==="error")&&be(f),(M.type==="done"||M.type==="error")&&(ee=!0,$=M.type==="error",fe(f,M.type==="error"?"error":"complete"),M.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(M.code??"")&&(Z=!0,T.current.onInterrupted(l)));const ke=he(),je=ke&&!(U&&document.visibilityState==="hidden"),Pe=M.type==="reasoning_delta"||M.type==="answer_delta",ze=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta"].includes(M.type);U&&ze&&ie(),!f.signal.aborted&&(ke||M.type==="stream_start"||M.type==="session_title_start"||M.type==="session_title_delta"||M.type==="session_title_done")?U&&Pe?(pe(M,!1),x.current=x.current||ke,Me()):(pe(M,je),U&&ke&&!je&&(x.current=!0)):f.signal.aborted||pe(M,!1)}}catch(B){if($=!0,!f.signal.aborted){if(be(f),B instanceof Le&&B.code==="chat_temporarily_disabled")le=!0,b({question:oe,draft:l}),V.current===I&&(n(h),d.current=h,u(""));else if(B instanceof Le&&B.code==="chat_capacity"){le=!0;const U=B.retryAfterSeconds??5,z={question:oe,draft:l,request:R,optimistic:S,original:h,edit:y,retryAfterSeconds:U,retryAt:Date.now()+U*1e3};q.current=z,O({question:oe,draft:l,retryAt:z.retryAt,retryAfterSeconds:U}),V.current===I&&(n(h),d.current=h,u(""))}else fe(f,"network_error"),B instanceof Le&&["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","chat_storage_quota_exceeded"].includes(B.code??"")&&(le=!0,T.current.onInterrupted(l),V.current===I&&(n(h),d.current=h,u(B.message))),B instanceof Le&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(B.code??"")&&(Z=!0,T.current.onInterrupted(l));!le&&V.current===I&&pe({type:"error",message:B instanceof Error?B.message:"The assistant stream failed.",code:B instanceof Le?B.code:void 0})}}finally{if(c.current===f){if(((ge=C.current)==null?void 0:ge.controller)===f&&(ie(),C.current=null),be(f),!ee&&!f.signal.aborted&&fe(f,"network_error"),g.current=!1,a(!1),le)T.current.onSettled(R.session_id);else if(!f.signal.aborted){(ce&&X||Z)&&((Ke=(we=T.current).onProviderTerminal)==null||Ke.call(we));const B=G.current;if(y&&!ce)V.current===I&&(n(y.snapshot),d.current=y.snapshot,u("Couldn’t resend this message. Your original conversation was restored."));else if(B){V.current===I&&y&&($||!ee)&&(n(y.snapshot),d.current=y.snapshot);try{const U=await _e(B,I);U&&y&&U.some(z=>z.id===y.targetId)&&u("Couldn’t resend this message. Your original conversation was restored.")}catch{V.current===I&&de({type:"settle"})}}else V.current===I&&de({type:"settle"});T.current.onSettled(B)}((Qe=P.current)==null?void 0:Qe.controller)===f&&(P.current=null)}}})(),!0},Ve=Ue(l=>{var Z,ee;const R=typeof l=="string"?{text:l.trim(),paperMentions:[]}:l,S=R.text;if(!S||S.length>8e3||g.current||q.current)return!1;const h=d.current,y=[...h].reverse().find($=>$.role==="user"),j=y!=null&&y.status&&y.status!=="complete"&&y.revision?{replace_message_id:y.id,prior_revision:y.revision}:null,I={id:K(),role:"user",text:S,paperMentions:R.paperMentions},f={id:K(),role:"assistant",streaming:!0,blocks:[]},oe=j&&y?Kn(h,$=>$.id===y.id):-1,ce=oe<0?[...h,I,f]:[...h.slice(0,oe),I,f],X=(ee=(Z=T.current).viewerContext)==null?void 0:ee.call(Z);return me(R,{message:S,paper_mentions:R.paperMentions.map(({route_id:$,title:le,start:ge,end:we})=>({route_id:$,title:le,start:ge,end:we})),session_id:T.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!T.current.webSearchEnabled,reasoning_effort:T.current.reasoningEffort??"low",...T.current.primaryPaperRouteId?{primary_paper_route_id:T.current.primaryPaperRouteId}:{},...X?{viewer_context:X}:{},...!T.current.sessionId&&T.current.initialModel?{initial_model:T.current.initialModel}:{},...j??{}},ce,h)}),ve=Ue((l,R)=>{var Z,ee;const S=typeof R=="string"?{text:R.trim(),paperMentions:[]}:R,h=S.text;if(!h||h.length>8e3||g.current||q.current)return!1;const y=d.current.slice(),j=y.findIndex($=>$.id===l&&$.role==="user");if(j<0)return!1;const I=y[j];if(!T.current.sessionId||!I.revision)return!1;const f={id:I.id,role:"user",text:h,paperMentions:S.paperMentions,revision:I.revision+1,status:"generating"},oe={id:K(),role:"assistant",streaming:!0,blocks:[]},ce=[...y.slice(0,j),f,oe],X=(ee=(Z=T.current).viewerContext)==null?void 0:ee.call(Z);return me(S,{message:h,paper_mentions:S.paperMentions.map(({route_id:$,title:le,start:ge,end:we})=>({route_id:$,title:le,start:ge,end:we})),session_id:T.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!T.current.webSearchEnabled,reasoning_effort:T.current.reasoningEffort??"low",...T.current.primaryPaperRouteId?{primary_paper_route_id:T.current.primaryPaperRouteId}:{},...X?{viewer_context:X}:{},replace_message_id:I.id,prior_revision:I.revision},ce,y,{targetId:I.id,snapshot:y})}),Ie=o.useCallback(()=>{q.current=null,O(null)},[]),Ae=Ue(()=>{const l=q.current;return!l||Date.now()<l.retryAt||g.current?!1:(q.current=null,O(null),me(l.draft,l.request,l.optimistic,l.original,l.edit))}),We=Ue(()=>{var j,I;if(!c.current)return;const l=c.current;be(l),fe(l,"stopped"),l.abort();const R=((j=C.current)==null?void 0:j.controller)===l?C.current.stream.takeAcceptedForStop():[];C.current=null;for(const f of R)pe(f,!1);ie(),c.current=null,((I=P.current)==null?void 0:I.controller)===l&&(P.current=null),g.current=!1,a(!1);const S=de({type:"stop"},!1).messages;E.current=S,d.current=S,n(S),T.current.onInterrupted(J.current);const h=G.current;h&&(D.current={sessionId:h,messages:S}),h&&cn(h).catch(()=>{});const y=++V.current;window.setTimeout(()=>{h&&V.current===y?_e(h,y).catch(()=>{}).finally(()=>T.current.onSettled(h)):h||T.current.onSettled(null)},450)}),De=o.useCallback((l,R)=>n(S=>S.map(h=>{var y;return h.id!==l?h:{...h,blocks:(y=h.blocks)==null?void 0:y.map((j,I)=>I===R&&(j.kind==="reasoning"||j.kind==="tool")?{...j,open:!j.open}:j)}})),[]),$e=o.useCallback(()=>{var l;V.current+=1,k.current!==null&&(window.clearTimeout(k.current),k.current=null),N.current="cleared",(l=c.current)==null||l.abort(),c.current=null,C.current=null,Ce(),x.current=!1,D.current=null,P.current=null,q.current=null,O(null),g.current=!1,G.current=null,E.current=null,A.current=Ye(A.current,{type:"reset"}),H.current=null,W.current=!1,n([]),a(!1),u("")},[]),Ge=Ue((l,R,S=!1)=>{var h;if(V.current+=1,k.current!==null&&(window.clearTimeout(k.current),k.current=null),N.current="cleared",Ce(),x.current=!1,P.current=null,q.current=null,O(null),g.current&&R!==void 0&&R===G.current&&E.current){W.current=!0,n(E.current),d.current=E.current,u("");return}if(W.current=!1,g.current||((h=c.current)==null||h.abort(),c.current=null,E.current=null,H.current=null,W.current=!1),S&&R){const y=[...l].reverse().find(j=>j.role==="user");if(y){const j={text:y.text??"",paperMentions:y.paperMentions??[]},I=[...l,{id:`${y.id}-active`,role:"assistant",streaming:!0,blocks:[]}];me(j,{message:j.text,session_id:R,client_message_id:"reconnect",web_search_enabled:!!T.current.webSearchEnabled,reasoning_effort:T.current.reasoningEffort??"low"},I,l,void 0,R);return}}n(l),d.current=l,A.current=Ye(A.current,{type:"load",messages:l,sessionId:R??T.current.sessionId}),g.current||a(!1),u("")});return{messages:t,busy:s,papers:ue,sessionError:m,capacityRequest:ne,disabledRequest:_,send:Ve,editAndResend:ve,retryCapacity:Ae,cancelCapacity:Ie,dismissDisabled:()=>b(null),stop:We,toggleBlock:De,reset:$e,load:Ge}}const ye=(e="")=>({text:e,paperMentions:[]}),zn=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],Jn=()=>{const e=sessionStorage.getItem(et);if(!e)return null;try{const t=JSON.parse(e);if(typeof t.text=="string"&&Array.isArray(t.paperMentions))return t}catch{}return ye(e)},Xn=({mode:e="general",routeSessionId:t,primaryPaper:n,currentPage:s,onSessionId:a,onReaderSubmit:m,onReaderNewChat:u})=>{var at,it,ot,ct,lt,ut,dt,ht,ft;const{sessionId:g}=Ut(),c=t??(e==="general"?g:void 0),C=qt(),[L,w]=Bt(),{user:x,isLoading:D}=Ht(),k=Vt(),N=$t(),P=Gt({queryKey:["chatAvailability"],queryFn:()=>Be.getAvailability(),refetchInterval:3e4,retry:!1,enabled:Ne()&&!!x}),q=((at=P.data)==null?void 0:at.status)==="paused"||e==="paper"&&((it=P.data)==null?void 0:it.paper_reader_chat_enabled)===!1,[ne,O]=o.useState([]),[_,b]=o.useState(!1),[d,A]=o.useState(""),[E,H]=o.useState(()=>c?{id:c,status:"loading"}:null),[W,T]=o.useState(0),J=o.useRef(ln()),Ee=o.useRef(L.get("model")||((ot=J.current)==null?void 0:ot.model)),[V,G]=o.useState(N?un:dn),[Q,ue]=o.useState(Ee.current||hn),K=((ct=V.find(i=>i.id===Q))==null?void 0:ct.provider)??"huggingface",de=Xt(!!(x&&K==="openrouter")),he=o.useRef(K);he.current=K;const[Ce,ie]=o.useState(""),[Me,be]=o.useState(null),[He,re]=o.useState(()=>ye()),[fe,pe]=o.useState(()=>{var i;return((i=J.current)==null?void 0:i.webSearchEnabled)??!1}),[_e,me]=o.useState(()=>{var i;return((i=J.current)==null?void 0:i.reasoningEffort)??"low"}),Ve=!!((lt=P.data)!=null&&lt.web_search_available),[ve,Ie]=o.useState(()=>{var p,v;const i=(p=L.get("q"))==null?void 0:p.trim();return i?ye(i):((v=J.current)==null?void 0:v.draft)??ye()}),Ae=o.useRef(!1),We=o.useRef(!1),De=o.useRef(!1),[$e,Ge]=o.useState(()=>typeof window>"u"||window.innerWidth>900),l=o.useRef(new Set),R=o.useRef(!1),S=o.useRef(c),h=o.useRef(null),y=o.useRef(null),j=o.useRef(null);S.current=c;const I=o.useCallback(async()=>{if(!x)return;const i=!R.current;i&&b(!0);try{const p=await fn();O(v=>{const F=h.current,Y=F?v.find(Fe=>Fe.id===F):void 0;if(!Y)return p;const te=p.find(Fe=>Fe.id===F);return[te?{...te,title:Y.title,is_busy:!0}:Y,...p.filter(Fe=>Fe.id!==F)]}),R.current=!0,A("")}catch(p){A(p instanceof Error?p.message:"Could not load chats")}finally{i&&b(!1)}},[x]),f=Qn({sessionId:c??null,initialModel:Q,webSearchEnabled:Ve&&fe,reasoningEffort:_e,primaryPaperRouteId:e==="paper"?n==null?void 0:n.routeId:void 0,viewerContext:e==="paper"&&s?()=>({page:Math.max(1,Math.min(1e4,s()))}):void 0,onSessionId:i=>{h.current=i;const p=i!==S.current,v=(S.current??null)===y.current,F=new Date().toISOString();O(Y=>Y.some(te=>te.id===i)?Y.map(te=>te.id===i?{...te,is_busy:!0}:te):[{id:i,title:"New chat",selected_model:Q,created_at:F,updated_at:F,message_count:1,is_busy:!0,web_search_enabled:fe,reasoning_effort:_e},...Y]),p&&v&&ie("New chat"),v&&(j.current=i,H({id:i,status:"loaded"}),p&&(e==="paper"?a==null||a(i):C(`/chat/${i}`,{replace:!0})))},onTitle:i=>{const p=h.current??S.current;p&&!l.current.has(p)&&(p===S.current&&ie(i),O(v=>v.map(F=>F.id===p?{...F,title:i}:F)))},onSettled:i=>{i&&O(p=>p.map(v=>v.id===i?{...v,is_busy:!1}:v)),h.current=null,y.current=null,I()},onProviderTerminal:()=>{he.current==="openrouter"&&(k.invalidateQueries({queryKey:Zt}),k.invalidateQueries({queryKey:en}))},onInterrupted:i=>{re(i)}}),oe=f.send;o.useEffect(()=>{f.capacityRequest&&re(f.capacityRequest.draft)},[f.capacityRequest]);const ce=o.useCallback(i=>{sessionStorage.setItem(et,JSON.stringify(i)),sessionStorage.setItem(Je,Q),sessionStorage.setItem(pn,_e),sessionStorage.setItem(Xe,"1"),sessionStorage.setItem(Ze,"1");const p=e==="paper"&&n?`/pdf/${n.routeId}`:S.current?`/chat/${S.current}`:"/chat";window.location.href=Wt(p,K==="huggingface")},[e,n,_e,Q,K]),X=o.useCallback((i,p)=>{sessionStorage.setItem(et,JSON.stringify(i)),sessionStorage.setItem(Je,Q),sessionStorage.removeItem(Xe),sessionStorage.removeItem(Ze),Ie(ye()),re(i),A(p)},[Q]),Z=o.useCallback(async i=>{if(!x){ce(i);return}if(K==="huggingface"&&!We.current){if(De.current)return;De.current=!0;try{if(!(await Be.getInferenceBilling()).connected){if(sessionStorage.getItem(Ze)==="1"){X(i,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}ce(i);return}We.current=!0}catch(v){X(i,v instanceof Error?v.message:"Could not check Hugging Face authorization.");return}finally{De.current=!1}}const p=S.current??null;if(sessionStorage.removeItem(Xe),!oe(i)){X(i,"Your prompt was not sent. It is ready to retry.");return}y.current=p,h.current=p,sessionStorage.removeItem(et),sessionStorage.removeItem(Je),sessionStorage.removeItem(Ze),mn(),re(ye()),e==="paper"&&(m==null||m())},[ce,e,m,X,K,oe,x]);o.useEffect(()=>{if(D||!x)return;const i=sessionStorage.getItem(Je);i&&ue(i),I(),gn().then(F=>{if(G(F.items),!S.current){const Y=Ee.current||i;ue(Y&&F.items.some(te=>te.id===Y)?Y:F.default_model)}});const p=Jn(),v=sessionStorage.getItem(Xe)==="1";p&&(v?Ie(p):re(p))},[D,I,x]),o.useEffect(()=>{if(!c){j.current!==null&&(j.current=null,f.reset(),pe(!1),me("low")),H(null),be(null);return}if(j.current===c||(be(null),H(p=>(p==null?void 0:p.id)===c&&p.status==="loading"?p:{id:c,status:"loading"}),D||!x))return;let i=!1;return A(""),rt(c).then(p=>{var F,Y;if(i)return;f.load(Tt(p),c,p.is_busy),ue(p.selected_model),pe(J.current&&p.messages.length===0?J.current.webSearchEnabled:p.web_search_enabled),me(J.current&&p.messages.length===0?J.current.reasoningEffort:p.reasoning_effort??"high"),ie(p.title);const v=(Y=(F=[...p.messages].reverse().find(te=>te.role==="user"&&te.viewer_context))==null?void 0:F.viewer_context)==null?void 0:Y.page;be(v??null),j.current=c,H({id:c,status:"loaded"})}).catch(p=>{if(i)return;const v=p instanceof Error?p.message:"Chat not found";f.reset(),A(v),H({id:c,status:"error",error:v})}),()=>{i=!0}},[D,c,x,f.busy,W]),o.useEffect(()=>{var F;const i=(F=L.get("q"))==null?void 0:F.trim();if(!i)return;Ae.current=!1;const p=L.get("model");p&&ue(p),Ie(ye(i));const v=new URLSearchParams(L);v.delete("q"),v.delete("model"),w(v,{replace:!0})},[L,w]),o.useEffect(()=>{if(D||f.busy||!ve.text||Ae.current||x&&fe&&P.isFetching||c&&(E==null?void 0:E.status)!=="loaded")return;const i=window.setTimeout(()=>{if(Ae.current)return;Ae.current=!0,Z(ve).finally(()=>Ie(ye()))},0);return()=>window.clearTimeout(i)},[D,P.isFetching,f.busy,ve,c,E==null?void 0:E.status,Z,x,fe]),o.useEffect(()=>{const i=()=>{!x||f.busy||I()};return window.addEventListener("focus",i),()=>window.removeEventListener("focus",i)},[f.busy,I,x]);const ee=()=>{h.current=null,f.reset(),re(ye()),pe(!1),me("low"),ie(""),e==="paper"?u==null||u():C("/chat")},$=async(i,p)=>{try{const v=await nt(i,{title:p});return l.current.add(i),i===c&&ie(v.title),O(F=>F.map(Y=>Y.id===i?v:Y)),!0}catch(v){return A(v instanceof Error?v.message:"Rename failed"),!1}},le=async i=>{const p=i===c&&f.busy;if(window.confirm(p?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){p&&f.stop();try{if(p){const v=Date.now()+3e3;for(;(await rt(i)).is_busy;){if(Date.now()>=v)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(Y=>window.setTimeout(Y,150))}}await yn(i),i===c&&ee(),await I()}catch(v){A(v instanceof Error?v.message:"Delete failed")}}},ge=Yn({messages:f.messages,refreshSessions:I,resetChat:f.reset,restoreDraft:re,clearTitle:()=>ie("")}),we=async i=>{const p=Q;if(ue(i),!!c)try{const v=await nt(c,{selected_model:i});O(F=>F.map(Y=>Y.id===c?{...Y,selected_model:v.selected_model}:Y)),A("")}catch(v){ue(p),A(v instanceof Error?v.message:"Model change failed")}},Ke=async i=>{const p=_e;if(me(i),!!c)try{const v=await nt(c,{reasoning_effort:i});O(F=>F.map(Y=>Y.id===c?v:Y))}catch(v){me(p),A(v instanceof Error?v.message:"Effort change failed")}},[Qe,B]=o.useState(60);o.useLayoutEffect(()=>{const i=document.querySelector(".app-header");if(!i)return;const p=()=>B(i.offsetHeight);p();const v=new ResizeObserver(p);return v.observe(i),()=>v.disconnect()},[]);const U=ne.find(i=>i.id===c),z=f.messages.length===0,M=(ut=[...f.messages].reverse().find(i=>i.role==="assistant"&&i.errorCode))==null?void 0:ut.errorCode,ke=M==="openrouter_unavailable"||M==="openrouter_monthly_budget_exhausted",je=(E==null?void 0:E.id)===c,Pe=!!(c&&(D||x&&(!je||(E==null?void 0:E.status)==="loading"))),ze=je&&(E==null?void 0:E.status)==="error"?E.error:void 0,tt=!!((dt=de.data)!=null&&dt.fallback_enabled),st={onSend:Z,busy:f.busy,onStop:f.stop,draft:He,onDraftChange:re,models:V,selectedModel:Q,onModelChange:i=>void we(i),disabled:q,describedBy:q?"chat-paused-description":void 0,paperMentionsEnabled:!!((ht=P.data)!=null&&ht.paper_mentions_enabled),webSearchAvailable:Ve,webSearchEnabled:fe,onWebSearchChange:pe,reasoningEffort:_e,onReasoningEffortChange:i=>void Ke(i)};return r.jsxs("div",{className:`chat-page${e==="paper"?" chat-page--reader":""}`,style:{height:e==="paper"?"100%":`calc(100dvh - ${Qe}px)`},children:[e==="general"&&r.jsx(Pn,{sessions:ne,activeSessionId:c,loading:_,error:d,open:$e,onClose:()=>Ge(!1),onNew:ee,onNavigate:i=>C(`/chat/${i}`),onRename:$,onDelete:i=>void le(i)}),r.jsxs("section",{className:"chat-main",children:[r.jsxs("div",{className:"chat-topbar",children:[e==="general"&&!$e&&r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>Ge(!0),title:"Open sidebar",children:r.jsx(Ct,{})}),e==="paper"&&r.jsx("button",{type:"button",className:"chat-reader-action",onClick:ee,children:"New chat"}),r.jsx("span",{className:"chat-topbar-title",children:Pe?(U==null?void 0:U.title)||"":Ce||(U==null?void 0:U.title)||(z?"":"New chat")}),N&&r.jsx("span",{className:"chat-staging-badge",children:"Staging"}),e==="paper"&&r.jsx(pt,{className:"chat-reader-action",to:"/chat",children:"All chats"}),e==="general"&&(U==null?void 0:U.primary_paper)&&r.jsx(pt,{className:"chat-reader-action",to:`/pdf/${U.primary_paper.route_id}`,onClick:()=>{const i=U.primary_paper.route_id;sessionStorage.setItem(`pwc:reader:session:${i}`,U.id),Me&&sessionStorage.setItem(`pwc:reader:page:${i}`,String(Me))},children:"Open reader"}),c&&je&&(E==null?void 0:E.status)==="loaded"&&!z&&r.jsx(Fn,{sessionId:c,busy:f.busy,loading:Pe,onError:A})]}),Pe&&!ve.text?r.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[r.jsx(kt,{}),r.jsx("span",{children:"Loading conversation…"})]}):ze?r.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[r.jsx("p",{children:ze}),r.jsx("button",{type:"button",onClick:()=>{H({id:c,status:"loading"}),T(i=>i+1)},children:"Try again"})]}):z&&!ve.text?r.jsx("div",{className:"chat-empty",children:r.jsxs("div",{className:"chat-empty-inner",children:[r.jsx("div",{className:"chat-empty-eyebrow",children:e==="paper"?"Paper assistant":"AI research assistant"}),r.jsx("h1",{className:"chat-empty-title",children:e==="paper"?"Ask about this paper":r.jsxs(r.Fragment,{children:["Ask ",r.jsx("em",{children:"Papers With Code"})]})}),r.jsx("p",{className:"chat-empty-sub",children:e==="paper"?"Questions are grounded in the open paper. Add up to three other papers with @.":"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),N&&r.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),r.jsx(xt,{variant:"empty",composerProps:st,provider:K,openRouterFallbackEnabled:tt,byokExpected:ke,paused:q,suggestions:e==="paper"?zn:bn})]})}):r.jsxs(r.Fragment,{children:[f.sessionError&&r.jsx("div",{className:"chat-session-error",role:"alert",children:f.sessionError}),r.jsx(Ln,{messages:f.messages,papers:f.papers,busy:f.busy,queuedDraft:ve.text?ve:void 0,paperMentionsEnabled:!!((ft=P.data)!=null&&ft.paper_mentions_enabled),archivePending:ge.pending,openRouterFallbackEnabled:tt,onToggleBlock:f.toggleBlock,onEditAndResend:f.editAndResend,onArchiveOld:()=>void ge.archiveOld(),onArchiveOldest:()=>void ge.archiveOldest()}),r.jsx(xt,{variant:"followup",composerProps:st,provider:K,openRouterFallbackEnabled:tt,byokExpected:ke,paused:q})]})]}),f.capacityRequest&&r.jsx(Nn,{retryAt:f.capacityRequest.retryAt,onCancel:f.cancelCapacity,onRetry:()=>{f.retryCapacity()&&re(ye())}}),f.disabledRequest&&r.jsx(Mn,{onClose:()=>{var i;re(((i=f.disabledRequest)==null?void 0:i.draft)??He),f.dismissDisabled(),P.refetch()}})]})},yr=()=>r.jsx(Xn,{});export{Nn as ChatCapacityDialog,Xn as ChatExperience,jn as OpenRouterUsageNotice,yr as default};
assets/{ConferenceDetailView-BF2p7fm_.js → ConferenceDetailView-Dbc2ENP6.js} RENAMED
@@ -1 +1 @@
1
- import{e as L,r as D,j as e,L as p}from"./index-BrhBTT14.js";import{u as T}from"./useQuery-GhY2LXSI.js";import{M as F}from"./MarkdownText-CNM4Jz9h.js";import{c as A}from"./catalog-CkpmYxEk.js";import{c as B,h as C,d as E}from"./transform-Duf4Shfn.js";import{S as f}from"./skeleton-DHdzoBmM.js";import{A as P,a as z}from"./alert-c1n3ZtEC.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BCdZ9yj3.js";import"./index-BLqBUiom.js";import"./hover-card-BcKGA4Et.js";import"./papers-DBaPliAp.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(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}`},ee=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.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?O(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:M(s.url)??void 0,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:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.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((n,r)=>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))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.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:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(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)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{ee as default};
 
1
+ import{c as L,r as D,j as e,L as p}from"./index-D_-UZEuL.js";import{u as T}from"./useQuery-BZo4MZ3s.js";import{M as F}from"./MarkdownText-QvkQ9FeM.js";import{c as A}from"./catalog-CjU2vAfw.js";import{c as B,h as C,d as E}from"./transform-CUuA-koJ.js";import{S as f}from"./skeleton-CCZ1iXls.js";import{A as P,a as z}from"./alert-B2j1kc2o.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-B25cD-_k.js";import"./index-vCOH2DKd.js";import"./hover-card-DiJQFgx9.js";import"./papers-DHqjKX7p.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(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}`},ee=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.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?O(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:M(s.url)??void 0,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:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.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((n,r)=>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))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.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:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(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)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{ee as default};
assets/{ConferenceTaskView-ny-_UWtG.js → ConferenceTaskView-BAJItIua.js} RENAMED
@@ -1 +1 @@
1
- import{e as $,a as D,r as f,j as e,L as b,R as W}from"./index-BrhBTT14.js";import{u as M}from"./useQuery-GhY2LXSI.js";import{P as G}from"./components-74u_bIKK.js";import{u as J,P as X}from"./useIntersectionObserver-Lj6hnXj6.js";import{M as h}from"./MarkdownText-CNM4Jz9h.js";import{c as z}from"./catalog-CkpmYxEk.js";import{t as Y,d as Z}from"./transform-Duf4Shfn.js";import{c as ee}from"./usePapers-C1lfz0oo.js";import{S as se}from"./skeleton-DHdzoBmM.js";import{A as ae,a as te}from"./alert-c1n3ZtEC.js";import"./LatexTitle-BJSVMlZ1.js";import"./katex.min-BSBacQyE.js";import"./papers-DBaPliAp.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-BCdZ9yj3.js";import"./index-BLqBUiom.js";import"./hover-card-BcKGA4Et.js";import"./useInfiniteQuery-bETtM5yS.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ye=()=>{var A,F,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=M({queryKey:["conference",a],queryFn:()=>z.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({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:R}=J({rootMargin:"200px"});f.useEffect(()=>{R&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[R,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(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((A=x.data)==null?void 0:A.name)||n||"",((F=x.data)==null?void 0:F.slug)||n),C=((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:C.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:["[",C.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(X,{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{ye as default};
 
1
+ import{c as $,a as D,r as f,j as e,L as b,z as W}from"./index-D_-UZEuL.js";import{u as M}from"./useQuery-BZo4MZ3s.js";import{P as G}from"./components-CmC5jqhM.js";import{u as J,P as X}from"./useIntersectionObserver-Cq9n7uOQ.js";import{M as h}from"./MarkdownText-QvkQ9FeM.js";import{c as z}from"./catalog-CjU2vAfw.js";import{t as Y,d as Z}from"./transform-CUuA-koJ.js";import{c as ee}from"./usePapers-BCHtBW8G.js";import{S as se}from"./skeleton-CCZ1iXls.js";import{A as ae,a as te}from"./alert-B2j1kc2o.js";import"./LatexTitle-B7GPgo8C.js";import"./katex.min-BSBacQyE.js";import"./papers-DHqjKX7p.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-B25cD-_k.js";import"./index-vCOH2DKd.js";import"./hover-card-DiJQFgx9.js";import"./useInfiniteQuery-CFUEkcEs.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ye=()=>{var A,F,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=M({queryKey:["conference",a],queryFn:()=>z.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({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}=J({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(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((A=x.data)==null?void 0:A.name)||n||"",((F=x.data)==null?void 0:F.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(X,{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{ye as default};
assets/{ConferencesIndexView-BYCd9xd-.js → ConferencesIndexView-CNg__9k_.js} RENAMED
@@ -1 +1 @@
1
- import{r as u,j as e,L as d}from"./index-BrhBTT14.js";import{u as p}from"./useQuery-GhY2LXSI.js";import{c as f}from"./catalog-CkpmYxEk.js";import{S as m}from"./skeleton-DHdzoBmM.js";import{A as h,a as g}from"./alert-c1n3ZtEC.js";import{T as x}from"./TaxonomySuggestionTile-BkE17zPJ.js";import"./SignInToEditDialog-Dcu4wTOX.js";import"./button-CusGeqPB.js";import"./textarea-D6mDqvzM.js";import"./dialog-BhRZv4T5.js";import"./useMutation-DqfuSW7Q.js";import"./submissions-C1hG3qlt.js";import"./loader-circle-BqZ1qbXL.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(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 a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},M=()=>{const r=p({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{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"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.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:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{M as default};
 
1
+ import{r as u,j as e,L as d}from"./index-D_-UZEuL.js";import{u as p}from"./useQuery-BZo4MZ3s.js";import{c as f}from"./catalog-CjU2vAfw.js";import{S as m}from"./skeleton-CCZ1iXls.js";import{A as h,a as g}from"./alert-B2j1kc2o.js";import{T as x}from"./TaxonomySuggestionTile-DgDd6ghr.js";import"./SignInToEditDialog-DZLQNGaN.js";import"./button-Cc8PFtC1.js";import"./textarea-DlQmtN_E.js";import"./dialog-ChaQ5z93.js";import"./useMutation-P0Dg96Vh.js";import"./submissions-BpzsA2lc.js";import"./loader-circle-D1SscQUT.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(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 a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},M=()=>{const r=p({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{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"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.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:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{M as default};
assets/{CronDashboard-B0A5D1GB.js → CronDashboard-BnvHXrkn.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as C,r as m,j as e,v as y,x as We,o as Be,m as W,O as Ue,y as ze,I as Ke,q as z,P as Ge,t as Qe,z as ue,L as Ve,g as Xe,U as Ye,f as Ze,b as es}from"./index-BrhBTT14.js";import{u as E}from"./useQuery-GhY2LXSI.js";import{B as w,D as ne,f as ss}from"./codexAddEvals-BzRfrE5R.js";import{B as A}from"./button-CusGeqPB.js";import{C as as}from"./chevron-down-CKySK_lE.js";import{F as te}from"./file-text-DROKoLCd.js";import{C as q,R as ie,S as rs}from"./shield-alert-BkQ9lngS.js";import{L as S}from"./loader-circle-BqZ1qbXL.js";import{C as Q}from"./circle-check-DVQOUjVS.js";import{E as pe}from"./external-link-uK7nAEgd.js";import{u as ce}from"./useMutation-DqfuSW7Q.js";import{u as ns}from"./useInfiniteQuery-bETtM5yS.js";import{c as K}from"./catalog-CkpmYxEk.js";import{c as le}from"./chat-Ck3hlrgT.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
@@ -53,4 +53,4 @@ import{c as C,r as m,j as e,v as y,x as We,o as Be,m as W,O as Ue,y as ze,I as K
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 je=C("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:y("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));h.displayName="Card";const v=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("flex flex-col space-y-1.5 p-6",s),...a}));v.displayName="CardHeader";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:y("text-2xl font-semibold leading-none tracking-tight",s),...a}));N.displayName="CardTitle";const k=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:y("text-sm text-muted-foreground",s),...a}));k.displayName="CardDescription";const u=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("p-6 pt-0",s),...a}));u.displayName="CardContent";const xs=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("flex items-center p-6 pt-0",s),...a}));xs.displayName="CardFooter";var B="Tabs",[hs]=Qe(B,[ue]),fe=ue(),[us,V]=hs(B),ve=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:c,defaultValue:d,orientation:x="horizontal",dir:o,activationMode:i="automatic",...g}=s,p=We(o),[b,l]=Be({prop:n,onChange:c,defaultProp:d??"",caller:B});return e.jsx(us,{scope:r,baseId:Ue(),value:b,onValueChange:l,orientation:x,dir:p,activationMode:i,children:e.jsx(W.div,{dir:p,"data-orientation":x,...g,ref:a})})});ve.displayName=B;var Ne="TabsList",be=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...c}=s,d=V(Ne,r),x=fe(r);return e.jsx(ze,{asChild:!0,...x,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(W.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});be.displayName=Ne;var ye="TabsTrigger",_e=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:c=!1,...d}=s,x=V(ye,r),o=fe(r),i=Ce(x.baseId,n),g=Se(x.baseId,n),p=n===x.value;return e.jsx(Ke,{asChild:!0,...o,focusable:!c,active:p,children:e.jsx(W.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":g,"data-state":p?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:i,...d,ref:a,onMouseDown:z(s.onMouseDown,b=>{!c&&b.button===0&&b.ctrlKey===!1?x.onValueChange(n):b.preventDefault()}),onKeyDown:z(s.onKeyDown,b=>{[" ","Enter"].includes(b.key)&&x.onValueChange(n)}),onFocus:z(s.onFocus,()=>{const b=x.activationMode!=="manual";!p&&!c&&b&&x.onValueChange(n)})})})});_e.displayName=ye;var we="TabsContent",ke=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:c,children:d,...x}=s,o=V(we,r),i=Ce(o.baseId,n),g=Se(o.baseId,n),p=n===o.value,b=m.useRef(p);return m.useEffect(()=>{const l=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(l)},[]),e.jsx(Ge,{present:c||p,children:({present:l})=>e.jsx(W.div,{"data-state":p?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":i,hidden:!l,id:g,tabIndex:0,...x,ref:a,style:{...s.style,animationDuration:b.current?"0s":void 0},children:l&&d})})});ke.displayName=we;function Ce(s,a){return`${s}-trigger-${a}`}function Se(s,a){return`${s}-content-${a}`}var ps=ve,$e=be,Re=_e,Te=ke;const gs=ps,Le=m.forwardRef(({className:s,...a},r)=>e.jsx($e,{ref:r,className:y("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Le.displayName=$e.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx(Re,{ref:r,className:y("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=Re.displayName;const P=m.forwardRef(({className:s,...a},r)=>e.jsx(Te,{ref:r,className:y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));P.displayName=Te.displayName;function f(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),c=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:c<24?`${c}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Pe(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 Fe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function X(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const js={healthy:Q,degraded:je,broken:q,running:S,stuck:q,unknown:is};function fs({status:s,isRunning:a}){const r=a?"running":s,n=js[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function de({label:s,axis:a}){return e.jsxs(w,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function me({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,c])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof c=="number"?c.toLocaleString():c})]},n))})]})}function vs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(H,{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",Fe(s)],...s.updated_at?[["Updated",f(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 Ns(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function bs({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:Ns(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(pe,{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 ",f(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 ",f(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",Pe(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ys({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(ds,{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(S,{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,c])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:c.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(bs,{job:n},n.id))})]})]})}function _s({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:c=!1,paperMarkdownJobsError:d=null}){const x=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),i=s.job_name==="paper_markdown_backfill";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(fs,{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:"Held lock"}),e.jsx(de,{label:"Execution",axis:s.execution_health}),e.jsx(de,{label:"Output",axis:s.output_health}),a?e.jsx(ts,{className:"h-4 w-4 cron-muted"}):e.jsx(as,{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(ge,{}),"Log: ",f(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(ne,{}),"DB: ",f(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ms,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Duration: ",Pe(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(oe,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(te,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Actions: ",Fe(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&&!0&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",f(s.execution_health.last_expected_at??null)],["Last started",f(s.execution_health.last_started_at??null)],["Last completed",f(s.execution_health.last_completed_at??null)],["Next expected",f(s.execution_health.next_expected_at??null)]].map(([p,b])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:p}),e.jsx("span",{children:b})]},p))})]}),s.work_metrics&&x&&e.jsx(me,{icon:te,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(me,{icon:ne,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(vs,{workflow:s.workflow_status}),i&&e.jsx(ys,{monitor:n,loading:c,error:d}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(p=>p.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(je,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,p])=>p.length>0).map(([p,b])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:X(p)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:b.map(l=>e.jsx("li",{children:l},l))})]},p))})]})]})})]})}const Me=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:y("w-full caption-bottom text-sm",s),...a})}));Me.displayName="Table";const Ae=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:y("[&_tr]:border-b",s),...a}));Ae.displayName="TableHeader";const Ee=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:y("[&_tr:last-child]:border-0",s),...a}));Ee.displayName="TableBody";const ws=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));ws.displayName="TableFooter";const G=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:y("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));G.displayName="TableRow";const F=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:y("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));F.displayName="TableHead";const M=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:y("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));M.displayName="TableCell";const ks=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:y("mt-4 text-sm text-muted-foreground",s),...a}));ks.displayName="TableCaption";const Cs={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},Ss={"add-evals":"Add evals","enrich-paper":"Enrich paper"},$s={queued:os,dispatching:S,running:cs,completed:Q,failed:q,canceled:ls};function Rs({status:s}){const a=$s[s];return e.jsxs(w,{variant:"outline",className:Cs[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function Ts(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 Ls({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:c,error:d}=E({queryKey:["codexPaperJobs",a],queryFn:()=>ss(100),refetchInterval:s?1e4:!1,retry:!1}),x=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(h,{className:"mb-8",children:[e.jsx(v,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(k,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),c&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(u,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(S,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&x!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),x===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(o=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:o}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[o]})]},o)),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(Me,{children:[e.jsx(Ae,{children:e.jsxs(G,{children:[e.jsx(F,{children:"Status"}),e.jsx(F,{children:"Paper"}),e.jsx(F,{children:"Action"}),e.jsx(F,{children:"Requested"}),e.jsx(F,{children:"Execution"})]})}),e.jsx(Ee,{children:r.jobs.map(o=>{const i=Ts(o);return e.jsxs(G,{children:[e.jsx(M,{className:"align-top",children:e.jsx(Rs,{status:o.status})}),e.jsxs(M,{className:"min-w-[260px] align-top",children:[e.jsx(Ve,{to:`/paper/${encodeURIComponent(o.paper_route)}`,className:"font-medium hover:underline",children:o.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",o.paper_id]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[Ss[o.kind],o.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(Q,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:f(o.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",o.requested_by]})]}),e.jsxs(M,{className:"max-w-[360px] align-top",children:[o.hf_job_url?e.jsxs("a",{href:o.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(pe,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),i&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${o.error?"text-red-700":"cron-muted"}`,title:i,children:i})]})]},o.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",f(r.timestamp)]})]})]})]})}const Ps=()=>{var d,x,o;const s=Xe(),a=ns({queryKey:["catalog-audit"],queryFn:({pageParam:i})=>K.audit(i),initialPageParam:void 0,getNextPageParam:i=>i.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(i=>i.events))??[],n=ce({mutationFn:()=>K.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),c=ce({mutationFn:i=>K.rollbackEvent(i),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(h,{children:[e.jsxs(v,{className:"flex-row items-center justify-between",children:[e.jsx(N,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((o=(x=a.data)==null?void 0:x.pages[0])==null?void 0:o.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(A,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.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(i=>e.jsxs("article",{className:`rounded-md border p-3 ${i.operation==="delete"||i.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:[i.operation," ",i.entity_type," ",i.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",i.actor_username??i.actor_role," ·"," ",new Date(i.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:i.before,after:i.after},null,2)})]}),!i.rollback_of_event_id&&e.jsx(A,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>c.mutate(i.id),disabled:c.isPending||i.rollback_eligible===!1,children:i.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},i.id)),a.hasNextPage&&e.jsx(A,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})};class Fs{constructor(a){this.request=a}getCronStatus(a=!1){const r=a?"?force_refresh=true":"";return this.request(`/cron/status${r}`,{cache:"no-store"})}getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}}const xe=new Fs(Ye),he={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},_=s=>`$${(s/1e6).toFixed(2)}`,Ms=({data:s,loading:a,error:r})=>{const[n,c]=m.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(S,{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 x=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",i=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(v,{children:e.jsx(N,{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(v,{children:e.jsx(N,{className:"text-sm",children:"Month to date"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(x),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${x}%`}})})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Application headroom"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",_(s.application_cap_microusd)]})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{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(v,{children:[e.jsx(N,{children:"Accounting and policy"}),e.jsxs(k,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(u,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:n,onChange:g=>c(g.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[n]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),_(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),_(s.provider_floor_microusd)," · ",e.jsx(w,{children:i})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${_(s.environment_cap_microusd)}`," · Workspace ",_(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",_(s.warning_microusd)," · trip ",_(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),f(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?f(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?f(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${f(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${f(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":`${_(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${f(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${_(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{children:"Live lifecycle"})}),e.jsx(u,{className:"text-sm",children:Object.entries(s.live_states).map(([g,p])=>e.jsxs("span",{className:"mr-4",children:[g,": ",p]},g))})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{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(g=>e.jsxs("li",{children:[g.date,": blank ",_(g.blank_pool_microusd)," · assigned ",_(g.assigned_microusd)]},g.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(h,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Recent circuit events"}),e.jsx(k,{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(g=>e.jsxs("li",{children:[e.jsx(w,{children:g.severity})," ",g.type," · ",f(g.created_at)]},g.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},As=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(S,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(r||!s)return e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const n=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(h,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Web search"}),e.jsxs(k,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(u,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${n}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",f(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${f(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(c=>e.jsxs("li",{children:[c.type," · ",f(c.created_at),c.error_class?` · ${c.error_class}`:""]},c.id))})]})]})},Es=({data:s})=>s!=null&&s.snapshot_stale?e.jsx(h,{className:"mb-6 cron-status--degraded",role:"status",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Refreshing status… Current snapshot is ",Math.ceil(s.snapshot_age_seconds)," seconds old."]})]})})}):null,qs=(s,a)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?1e3:a?3e4:!1,Zs=()=>{const s=es(),[a,r]=m.useState(!0),[n,c]=m.useState(0),[d,x]=m.useState(""),[o,i]=m.useState(""),[g,p]=m.useState(new Set),b=m.useRef(!1),{user:l}=Ze(),{data:j,isLoading:Y,isFetching:Z,error:$,refetch:qe}=E({queryKey:["cronStatus",l==null?void 0:l.username],queryFn:()=>{const t=b.current;return b.current=!1,xe.getCronStatus(t)},enabled:!!(l!=null&&l.is_admin),refetchInterval:t=>qs(t.state.data,a),retry:!1}),D=E({queryKey:["paperMarkdownJobs",l==null?void 0:l.username],queryFn:()=>xe.getPaperMarkdownJobs(),enabled:!!(l!=null&&l.is_admin),refetchInterval:a?3e4:!1,retry:!1}),I=E({queryKey:["chatSandboxSpend",l==null?void 0:l.username,o],queryFn:()=>le.getSandboxSpend(o||void 0),enabled:!!(l!=null&&l.is_admin),refetchInterval:a?3e4:!1,retry:!1}),U=E({queryKey:["chatWebSearchBudget",l==null?void 0:l.username],queryFn:()=>le.getWebSearchBudget(),enabled:!!(l!=null&&l.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),ee=($&&typeof $=="object"&&"status"in $?$.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":$ instanceof Error?$.message:void 0,De=t=>{p(R=>{const T=new Set(R);return T.has(t)?T.delete(t):T.add(t),T})},se=(j==null?void 0:j.jobs.filter(t=>t.dashboard_group==="leaderboard_sync"))??[],ae=(j==null?void 0:j.jobs.filter(t=>t.category!=="manual"&&t.dashboard_group!=="leaderboard_sync"))??[],Ie=ae.filter(t=>t.critical),Je=ae.filter(t=>!t.critical),re=(j==null?void 0:j.manual_operations)??[],J=Je.reduce((t,R)=>(t[R.category]||(t[R.category]=[]),t[R.category].push(R),t),{}),Oe=Object.keys(J).sort((t,R)=>{const T=["systemd","hourly","daily","weekly","backfill"];return T.indexOf(t)-T.indexOf(R)}),O=t=>e.jsx(_s,{job:t,expanded:g.has(t.job_name),onToggle:()=>De(t.job_name),paperMarkdownJobs:t.job_name==="paper_markdown_backfill"?D.data:void 0,paperMarkdownJobsLoading:t.job_name==="paper_markdown_backfill"?D.isLoading:!1,paperMarkdownJobsError:t.job_name==="paper_markdown_backfill"?D.error:null},t.job_name),He=()=>{c(t=>t+1),b.current=!0,qe(),D.refetch(),I.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(H,{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(A,{variant:"outline",size:"sm",onClick:()=>r(!a),className:a?"cron-status--running":"",children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(A,{variant:"outline",size:"sm",onClick:He,disabled:Z,children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${Z?"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:["@",l==null?void 0:l.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsx(Es,{data:j}),e.jsxs(gs,{defaultValue:"critical-jobs",children:[e.jsxs(Le,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(L,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(P,{value:"critical-jobs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),$&&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(q,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load CRON jobs status. Please try again."})]})})}),j&&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(t=>e.jsxs(h,{children:[e.jsx(v,{className:"pb-2",children:e.jsx(N,{className:"text-sm font-medium cron-muted capitalize",children:t})}),e.jsx(u,{children:e.jsx("div",{className:"text-2xl font-bold",children:j.summary[t]})})]},t))}),j.summary.critical_issues.length>0&&e.jsxs(h,{className:"mb-6 cron-status--broken",children:[e.jsx(v,{children:e.jsxs(N,{className:"flex items-center gap-2",children:[e.jsx(rs,{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:j.summary.critical_issues.map(t=>e.jsx("li",{children:t},t))})})]}),e.jsxs(h,{className:"mb-8",children:[e.jsx(v,{children:e.jsx(N,{className:"text-base",children:"What to check next"})}),e.jsxs(u,{children:[e.jsx("p",{className:"text-sm cron-muted",children:j.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(ge,{className:"h-4 w-4"}),"Last updated: ",f(j.timestamp)," · Health score:"," ",j.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(h,{className:`mb-8 ${j.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-base",children:"Coverage"}),e.jsx(k,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(u,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(h,{className:"mb-8",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Critical jobs"}),e.jsx(k,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(u,{className:"space-y-4",children:Ie.map(O)})]}),e.jsx("div",{className:"space-y-6",children:Oe.map(t=>e.jsxs(h,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(N,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:he[t]??he.hourly,children:t}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(k,{children:[J[t].length," job",J[t].length!==1?"s":""]})]})}),e.jsx(u,{className:"space-y-4",children:J[t].map(O)})]},t))}),re.length>0&&e.jsxs(h,{className:"mt-6",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Manual operations"}),e.jsx(k,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(u,{className:"space-y-4",children:re.map(O)})]})]})]}),e.jsxs(P,{value:"leaderboard-syncs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),$&&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(q,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load leaderboard sync status. Please try again."})]})})}),j&&e.jsxs(h,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(k,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(w,{children:[se.length," jobs"]})]})}),e.jsx(u,{className:"space-y-4",children:se.map(O)})]})]}),e.jsx(P,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(Ls,{autoRefresh:a,refreshToken:n})}),e.jsx(P,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ps,{})}),e.jsxs(P,{value:"chat-compute",className:"mt-6",children:[e.jsxs(h,{className:"mb-6",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Environment record"}),e.jsx(k,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(u,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:d,onChange:t=>x(t.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(A,{onClick:()=>i(d.trim()),children:"Load"})]})]}),e.jsx(Ms,{data:I.data,loading:I.isLoading,error:I.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(As,{data:U.data,loading:U.isLoading,error:U.error})})]})]})]})})};export{Ms as ChatComputePanel,Es as CronSnapshotNotice,As as WebSearchBudgetPanel,qs as cronStatusRefetchInterval,Zs as default};
 
1
+ import{d as C,r as m,j as e,q as y,t as We,k as Be,h as W,Y as Ue,R as ze,I as Ke,m as z,P as Ge,p as Qe,v as ue,L as Ve,g as Xe,a0 as Ye,y as Ze,b as es}from"./index-D_-UZEuL.js";import{u as E}from"./useQuery-BZo4MZ3s.js";import{B as w,D as ne,f as ss}from"./codexAddEvals-BKeHrC5p.js";import{B as A}from"./button-Cc8PFtC1.js";import{C as as}from"./chevron-down-DI19XsBw.js";import{F as te}from"./file-text--vrXMvWb.js";import{C as q,R as ie,S as rs}from"./shield-alert-Dix0M7Y-.js";import{L as S}from"./loader-circle-D1SscQUT.js";import{C as Q}from"./circle-check-BpugpgkG.js";import{E as pe}from"./external-link-Dm5dHWqK.js";import{u as ce}from"./useMutation-P0Dg96Vh.js";import{u as ns}from"./useInfiniteQuery-CFUEkcEs.js";import{c as K}from"./catalog-CjU2vAfw.js";import{c as le}from"./chat-7zW8PrrA.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
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 je=C("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:y("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));h.displayName="Card";const v=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("flex flex-col space-y-1.5 p-6",s),...a}));v.displayName="CardHeader";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:y("text-2xl font-semibold leading-none tracking-tight",s),...a}));N.displayName="CardTitle";const k=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:y("text-sm text-muted-foreground",s),...a}));k.displayName="CardDescription";const u=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("p-6 pt-0",s),...a}));u.displayName="CardContent";const xs=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("flex items-center p-6 pt-0",s),...a}));xs.displayName="CardFooter";var B="Tabs",[hs]=Qe(B,[ue]),fe=ue(),[us,V]=hs(B),ve=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:c,defaultValue:d,orientation:x="horizontal",dir:o,activationMode:i="automatic",...g}=s,p=We(o),[b,l]=Be({prop:n,onChange:c,defaultProp:d??"",caller:B});return e.jsx(us,{scope:r,baseId:Ue(),value:b,onValueChange:l,orientation:x,dir:p,activationMode:i,children:e.jsx(W.div,{dir:p,"data-orientation":x,...g,ref:a})})});ve.displayName=B;var Ne="TabsList",be=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...c}=s,d=V(Ne,r),x=fe(r);return e.jsx(ze,{asChild:!0,...x,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(W.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});be.displayName=Ne;var ye="TabsTrigger",_e=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:c=!1,...d}=s,x=V(ye,r),o=fe(r),i=Ce(x.baseId,n),g=Se(x.baseId,n),p=n===x.value;return e.jsx(Ke,{asChild:!0,...o,focusable:!c,active:p,children:e.jsx(W.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":g,"data-state":p?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:i,...d,ref:a,onMouseDown:z(s.onMouseDown,b=>{!c&&b.button===0&&b.ctrlKey===!1?x.onValueChange(n):b.preventDefault()}),onKeyDown:z(s.onKeyDown,b=>{[" ","Enter"].includes(b.key)&&x.onValueChange(n)}),onFocus:z(s.onFocus,()=>{const b=x.activationMode!=="manual";!p&&!c&&b&&x.onValueChange(n)})})})});_e.displayName=ye;var we="TabsContent",ke=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:c,children:d,...x}=s,o=V(we,r),i=Ce(o.baseId,n),g=Se(o.baseId,n),p=n===o.value,b=m.useRef(p);return m.useEffect(()=>{const l=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(l)},[]),e.jsx(Ge,{present:c||p,children:({present:l})=>e.jsx(W.div,{"data-state":p?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":i,hidden:!l,id:g,tabIndex:0,...x,ref:a,style:{...s.style,animationDuration:b.current?"0s":void 0},children:l&&d})})});ke.displayName=we;function Ce(s,a){return`${s}-trigger-${a}`}function Se(s,a){return`${s}-content-${a}`}var ps=ve,Re=be,$e=_e,Te=ke;const gs=ps,Le=m.forwardRef(({className:s,...a},r)=>e.jsx(Re,{ref:r,className:y("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Le.displayName=Re.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx($e,{ref:r,className:y("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=$e.displayName;const P=m.forwardRef(({className:s,...a},r)=>e.jsx(Te,{ref:r,className:y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));P.displayName=Te.displayName;function f(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),c=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:c<24?`${c}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Pe(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 Fe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function X(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const js={healthy:Q,degraded:je,broken:q,running:S,stuck:q,unknown:is};function fs({status:s,isRunning:a}){const r=a?"running":s,n=js[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function de({label:s,axis:a}){return e.jsxs(w,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function me({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,c])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof c=="number"?c.toLocaleString():c})]},n))})]})}function vs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(H,{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",Fe(s)],...s.updated_at?[["Updated",f(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 Ns(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function bs({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:Ns(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(pe,{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 ",f(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 ",f(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",Pe(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ys({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(ds,{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(S,{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,c])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:c.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(bs,{job:n},n.id))})]})]})}function _s({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:c=!1,paperMarkdownJobsError:d=null}){const x=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),i=s.job_name==="paper_markdown_backfill";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(fs,{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:"Held lock"}),e.jsx(de,{label:"Execution",axis:s.execution_health}),e.jsx(de,{label:"Output",axis:s.output_health}),a?e.jsx(ts,{className:"h-4 w-4 cron-muted"}):e.jsx(as,{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(ge,{}),"Log: ",f(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(ne,{}),"DB: ",f(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ms,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Duration: ",Pe(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(oe,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(te,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Actions: ",Fe(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&&!0&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",f(s.execution_health.last_expected_at??null)],["Last started",f(s.execution_health.last_started_at??null)],["Last completed",f(s.execution_health.last_completed_at??null)],["Next expected",f(s.execution_health.next_expected_at??null)]].map(([p,b])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:p}),e.jsx("span",{children:b})]},p))})]}),s.work_metrics&&x&&e.jsx(me,{icon:te,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(me,{icon:ne,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(vs,{workflow:s.workflow_status}),i&&e.jsx(ys,{monitor:n,loading:c,error:d}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(p=>p.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(je,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,p])=>p.length>0).map(([p,b])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:X(p)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:b.map(l=>e.jsx("li",{children:l},l))})]},p))})]})]})})]})}const Me=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:y("w-full caption-bottom text-sm",s),...a})}));Me.displayName="Table";const Ae=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:y("[&_tr]:border-b",s),...a}));Ae.displayName="TableHeader";const Ee=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:y("[&_tr:last-child]:border-0",s),...a}));Ee.displayName="TableBody";const ws=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));ws.displayName="TableFooter";const G=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:y("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));G.displayName="TableRow";const F=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:y("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));F.displayName="TableHead";const M=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:y("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));M.displayName="TableCell";const ks=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:y("mt-4 text-sm text-muted-foreground",s),...a}));ks.displayName="TableCaption";const Cs={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},Ss={"add-evals":"Add evals","enrich-paper":"Enrich paper"},Rs={queued:os,dispatching:S,running:cs,completed:Q,failed:q,canceled:ls};function $s({status:s}){const a=Rs[s];return e.jsxs(w,{variant:"outline",className:Cs[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function Ts(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 Ls({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:c,error:d}=E({queryKey:["codexPaperJobs",a],queryFn:()=>ss(100),refetchInterval:s?1e4:!1,retry:!1}),x=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(h,{className:"mb-8",children:[e.jsx(v,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(k,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),c&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(u,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(S,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&x!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),x===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(o=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:o}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[o]})]},o)),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(Me,{children:[e.jsx(Ae,{children:e.jsxs(G,{children:[e.jsx(F,{children:"Status"}),e.jsx(F,{children:"Paper"}),e.jsx(F,{children:"Action"}),e.jsx(F,{children:"Requested"}),e.jsx(F,{children:"Execution"})]})}),e.jsx(Ee,{children:r.jobs.map(o=>{const i=Ts(o);return e.jsxs(G,{children:[e.jsx(M,{className:"align-top",children:e.jsx($s,{status:o.status})}),e.jsxs(M,{className:"min-w-[260px] align-top",children:[e.jsx(Ve,{to:`/paper/${encodeURIComponent(o.paper_route)}`,className:"font-medium hover:underline",children:o.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",o.paper_id]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[Ss[o.kind],o.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(Q,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:f(o.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",o.requested_by]})]}),e.jsxs(M,{className:"max-w-[360px] align-top",children:[o.hf_job_url?e.jsxs("a",{href:o.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(pe,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),i&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${o.error?"text-red-700":"cron-muted"}`,title:i,children:i})]})]},o.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",f(r.timestamp)]})]})]})]})}const Ps=()=>{var d,x,o;const s=Xe(),a=ns({queryKey:["catalog-audit"],queryFn:({pageParam:i})=>K.audit(i),initialPageParam:void 0,getNextPageParam:i=>i.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(i=>i.events))??[],n=ce({mutationFn:()=>K.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),c=ce({mutationFn:i=>K.rollbackEvent(i),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(h,{children:[e.jsxs(v,{className:"flex-row items-center justify-between",children:[e.jsx(N,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((o=(x=a.data)==null?void 0:x.pages[0])==null?void 0:o.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(A,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.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(i=>e.jsxs("article",{className:`rounded-md border p-3 ${i.operation==="delete"||i.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:[i.operation," ",i.entity_type," ",i.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",i.actor_username??i.actor_role," ·"," ",new Date(i.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:i.before,after:i.after},null,2)})]}),!i.rollback_of_event_id&&e.jsx(A,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>c.mutate(i.id),disabled:c.isPending||i.rollback_eligible===!1,children:i.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},i.id)),a.hasNextPage&&e.jsx(A,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})};class Fs{constructor(a){this.request=a}getCronStatus(a=!1){const r=a?"?force_refresh=true":"";return this.request(`/cron/status${r}`,{cache:"no-store"})}getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}}const xe=new Fs(Ye),he={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},_=s=>`$${(s/1e6).toFixed(2)}`,Ms=({data:s,loading:a,error:r})=>{const[n,c]=m.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(S,{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 x=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",i=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(v,{children:e.jsx(N,{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(v,{children:e.jsx(N,{className:"text-sm",children:"Month to date"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(x),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${x}%`}})})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Application headroom"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",_(s.application_cap_microusd)]})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{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(v,{children:[e.jsx(N,{children:"Accounting and policy"}),e.jsxs(k,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(u,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:n,onChange:g=>c(g.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[n]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),_(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),_(s.provider_floor_microusd)," · ",e.jsx(w,{children:i})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${_(s.environment_cap_microusd)}`," · Workspace ",_(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",_(s.warning_microusd)," · trip ",_(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),f(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?f(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?f(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${f(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${f(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":`${_(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${f(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${_(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{children:"Live lifecycle"})}),e.jsx(u,{className:"text-sm",children:Object.entries(s.live_states).map(([g,p])=>e.jsxs("span",{className:"mr-4",children:[g,": ",p]},g))})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{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(g=>e.jsxs("li",{children:[g.date,": blank ",_(g.blank_pool_microusd)," · assigned ",_(g.assigned_microusd)]},g.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(h,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Recent circuit events"}),e.jsx(k,{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(g=>e.jsxs("li",{children:[e.jsx(w,{children:g.severity})," ",g.type," · ",f(g.created_at)]},g.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},As=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(S,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(r||!s)return e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const n=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(h,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Web search"}),e.jsxs(k,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(u,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${n}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",f(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${f(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(c=>e.jsxs("li",{children:[c.type," · ",f(c.created_at),c.error_class?` · ${c.error_class}`:""]},c.id))})]})]})},Es=({data:s})=>s!=null&&s.snapshot_stale?e.jsx(h,{className:"mb-6 cron-status--degraded",role:"status",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Refreshing status… Current snapshot is ",Math.ceil(s.snapshot_age_seconds)," seconds old."]})]})})}):null,qs=(s,a)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?1e3:a?3e4:!1,Zs=()=>{const s=es(),[a,r]=m.useState(!0),[n,c]=m.useState(0),[d,x]=m.useState(""),[o,i]=m.useState(""),[g,p]=m.useState(new Set),b=m.useRef(!1),{user:l}=Ze(),{data:j,isLoading:Y,isFetching:Z,error:R,refetch:qe}=E({queryKey:["cronStatus",l==null?void 0:l.username],queryFn:()=>{const t=b.current;return b.current=!1,xe.getCronStatus(t)},enabled:!!(l!=null&&l.is_admin),refetchInterval:t=>qs(t.state.data,a),retry:!1}),D=E({queryKey:["paperMarkdownJobs",l==null?void 0:l.username],queryFn:()=>xe.getPaperMarkdownJobs(),enabled:!!(l!=null&&l.is_admin),refetchInterval:a?3e4:!1,retry:!1}),I=E({queryKey:["chatSandboxSpend",l==null?void 0:l.username,o],queryFn:()=>le.getSandboxSpend(o||void 0),enabled:!!(l!=null&&l.is_admin),refetchInterval:a?3e4:!1,retry:!1}),U=E({queryKey:["chatWebSearchBudget",l==null?void 0:l.username],queryFn:()=>le.getWebSearchBudget(),enabled:!!(l!=null&&l.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),ee=(R&&typeof R=="object"&&"status"in R?R.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":R instanceof Error?R.message:void 0,De=t=>{p($=>{const T=new Set($);return T.has(t)?T.delete(t):T.add(t),T})},se=(j==null?void 0:j.jobs.filter(t=>t.dashboard_group==="leaderboard_sync"))??[],ae=(j==null?void 0:j.jobs.filter(t=>t.category!=="manual"&&t.dashboard_group!=="leaderboard_sync"))??[],Ie=ae.filter(t=>t.critical),Je=ae.filter(t=>!t.critical),re=(j==null?void 0:j.manual_operations)??[],J=Je.reduce((t,$)=>(t[$.category]||(t[$.category]=[]),t[$.category].push($),t),{}),Oe=Object.keys(J).sort((t,$)=>{const T=["systemd","hourly","daily","weekly","backfill"];return T.indexOf(t)-T.indexOf($)}),O=t=>e.jsx(_s,{job:t,expanded:g.has(t.job_name),onToggle:()=>De(t.job_name),paperMarkdownJobs:t.job_name==="paper_markdown_backfill"?D.data:void 0,paperMarkdownJobsLoading:t.job_name==="paper_markdown_backfill"?D.isLoading:!1,paperMarkdownJobsError:t.job_name==="paper_markdown_backfill"?D.error:null},t.job_name),He=()=>{c(t=>t+1),b.current=!0,qe(),D.refetch(),I.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(H,{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(A,{variant:"outline",size:"sm",onClick:()=>r(!a),className:a?"cron-status--running":"",children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(A,{variant:"outline",size:"sm",onClick:He,disabled:Z,children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${Z?"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:["@",l==null?void 0:l.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsx(Es,{data:j}),e.jsxs(gs,{defaultValue:"critical-jobs",children:[e.jsxs(Le,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(L,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(P,{value:"critical-jobs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),R&&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(q,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load CRON jobs status. Please try again."})]})})}),j&&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(t=>e.jsxs(h,{children:[e.jsx(v,{className:"pb-2",children:e.jsx(N,{className:"text-sm font-medium cron-muted capitalize",children:t})}),e.jsx(u,{children:e.jsx("div",{className:"text-2xl font-bold",children:j.summary[t]})})]},t))}),j.summary.critical_issues.length>0&&e.jsxs(h,{className:"mb-6 cron-status--broken",children:[e.jsx(v,{children:e.jsxs(N,{className:"flex items-center gap-2",children:[e.jsx(rs,{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:j.summary.critical_issues.map(t=>e.jsx("li",{children:t},t))})})]}),e.jsxs(h,{className:"mb-8",children:[e.jsx(v,{children:e.jsx(N,{className:"text-base",children:"What to check next"})}),e.jsxs(u,{children:[e.jsx("p",{className:"text-sm cron-muted",children:j.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(ge,{className:"h-4 w-4"}),"Last updated: ",f(j.timestamp)," · Health score:"," ",j.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(h,{className:`mb-8 ${j.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-base",children:"Coverage"}),e.jsx(k,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(u,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(h,{className:"mb-8",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Critical jobs"}),e.jsx(k,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(u,{className:"space-y-4",children:Ie.map(O)})]}),e.jsx("div",{className:"space-y-6",children:Oe.map(t=>e.jsxs(h,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(N,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:he[t]??he.hourly,children:t}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(k,{children:[J[t].length," job",J[t].length!==1?"s":""]})]})}),e.jsx(u,{className:"space-y-4",children:J[t].map(O)})]},t))}),re.length>0&&e.jsxs(h,{className:"mt-6",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Manual operations"}),e.jsx(k,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(u,{className:"space-y-4",children:re.map(O)})]})]})]}),e.jsxs(P,{value:"leaderboard-syncs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),R&&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(q,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load leaderboard sync status. Please try again."})]})})}),j&&e.jsxs(h,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(k,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(w,{children:[se.length," jobs"]})]})}),e.jsx(u,{className:"space-y-4",children:se.map(O)})]})]}),e.jsx(P,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(Ls,{autoRefresh:a,refreshToken:n})}),e.jsx(P,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ps,{})}),e.jsxs(P,{value:"chat-compute",className:"mt-6",children:[e.jsxs(h,{className:"mb-6",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Environment record"}),e.jsx(k,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(u,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:d,onChange:t=>x(t.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(A,{onClick:()=>i(d.trim()),children:"Load"})]})]}),e.jsx(Ms,{data:I.data,loading:I.isLoading,error:I.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(As,{data:U.data,loading:U.isLoading,error:U.error})})]})]})]})})};export{Ms as ChatComputePanel,Es as CronSnapshotNotice,As as WebSearchBudgetPanel,qs as cronStatusRefetchInterval,Zs as default};
assets/ExternalSourceEvalBadge-25ezslre.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{a as l}from"./papers-DHqjKX7p.js";import{a0 as h,j as a,L as u}from"./index-D_-UZEuL.js";import{H as c,a as d,b as p}from"./hover-card-DiJQFgx9.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";class m{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(s=>s[1]!==void 0).map(([s,n])=>[s,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const s=await this.list({...e,page_size:100}),n=[...s.results];let i=s.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const w=new m(h),S=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{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"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function x(r){if(!r)return"Evaluation sourced outside this paper";const e=r.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(r,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return r}}const j=({sourceUrl:r})=>{const e=g(r),t=typeof r=="string"&&r.startsWith("/paper/")?r:null,s=x(r);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${s}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):a.jsxs(a.Fragment,{children:[" ",s,"."]})]})]})};export{S as C,j as E,w as e};
assets/ExternalSourceEvalBadge-CXYkyGiT.js DELETED
@@ -1 +0,0 @@
1
- import{a as l}from"./papers-DBaPliAp.js";import{U as h,j as a,L as u}from"./index-BrhBTT14.js";import{H as c,a as d,b as p}from"./hover-card-BcKGA4Et.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";class m{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(s=>s[1]!==void 0).map(([s,n])=>[s,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const s=await this.list({...e,page_size:100}),n=[...s.results];let i=s.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const w=new m(h),S=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{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"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function x(r){if(!r)return"Evaluation sourced outside this paper";const e=r.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(r,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return r}}const j=({sourceUrl:r})=>{const e=g(r),t=typeof r=="string"&&r.startsWith("/paper/")?r:null,s=x(r);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${s}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):a.jsxs(a.Fragment,{children:[" ",s,"."]})]})]})};export{S as C,j as E,w as e};
 
 
assets/{FeedView-L4wL0Zxa.js → FeedView-CIK3mTNn.js} RENAMED
@@ -1 +1 @@
1
- import{u as U,r as d,i as R,j as e,a as B,L as M,b as K}from"./index-BrhBTT14.js";import{P as W}from"./components-74u_bIKK.js";import{u as z,P as G}from"./useIntersectionObserver-Lj6hnXj6.js";import{D as Q,S as V,P as X,u as Y,a as J,M as Z,R as ee,W as se,A as te,b as ae,q as re,c as ie}from"./chatSessions-Dx6Tu-Jq.js";import{c as ne}from"./chat-Ck3hlrgT.js";import{c as I}from"./catalog-CkpmYxEk.js";import{S as w}from"./chatPrompts-CDY3UGU1.js";import{t as oe,d as H}from"./transform-Duf4Shfn.js";import{u as le}from"./usePapers-C1lfz0oo.js";import{P as ce}from"./usePeriodFilter-By9tdCWv.js";import{S as N}from"./skeleton-DHdzoBmM.js";import{A as de,a as me}from"./alert-c1n3ZtEC.js";import{u as D}from"./useQuery-GhY2LXSI.js";import"./LatexTitle-BJSVMlZ1.js";import"./katex.min-BSBacQyE.js";import"./papers-DBaPliAp.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-CKySK_lE.js";import"./useInfiniteQuery-bETtM5yS.js";const he=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],pe={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},ue={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},O=45,fe=1800,ge=25,xe=350,be=i=>{const[h,o]=d.useState(w[0].slice(0,1));return d.useEffect(()=>{var v,_;if(!i)return;if((_=(v=window.matchMedia)==null?void 0:v.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){o(w[0]);return}let u=0,n=1,f=!1,m;o(w[0].slice(0,n));const l=()=>{const g=w[u];if(!f){if(n+=1,o(g.slice(0,n)),n===g.length){f=!0,m=window.setTimeout(l,fe);return}m=window.setTimeout(l,O);return}if(n-=1,o(g.slice(0,n)),n===0){f=!1,u=(u+1)%w.length,m=window.setTimeout(l,xe);return}m=window.setTimeout(l,ge)};return m=window.setTimeout(l,O),()=>window.clearTimeout(m)},[i]),h},je=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",ve=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",_e=()=>{var A,s,a;const i=U(),h=K()?V:X,[o,u]=d.useState({text:"",paperMentions:[]}),n=o.text,[f,m]=d.useState(0),[l,v]=d.useState(Q),_=(A=h.find(t=>t.id===l))==null?void 0:A.provider,[g,E]=d.useState(!1),[x,c]=d.useState("low"),[b,C]=d.useState(!1),k=be(!n),T=d.useRef(null),L=D({queryKey:["chatAvailability"],queryFn:()=>ne.getAvailability(),retry:!1,enabled:R()}),P=!!((s=L.data)!=null&&s.web_search_available),j=R()&&((a=L.data)==null?void 0:a.paper_mentions_enabled)!==!1,r=Y({draft:o,onChange:u,enabled:j,textareaRef:T});d.useLayoutEffect(()=>{const t=T.current;if(!t)return;const p=()=>{if(t.style.height="auto",n){t.style.height=`${Math.min(t.scrollHeight,160)}px`;return}const y=t.placeholder,F=w.reduce((q,$)=>(t.placeholder=$,Math.max(q,t.scrollHeight)),0);t.placeholder=y,t.style.height=`${Math.min(F,160)}px`};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[n]);const S=async(t=o)=>{if(!(!t.text.trim()||b)){C(!0),re(t,l,{webSearchEnabled:P&&g,reasoningEffort:x});try{const y=await ie(l,x);i(`/chat/${y.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(J,{text:o.text,mentions:o.paperMentions,scrollTop:f,variant:"home"}),e.jsx("textarea",{ref:T,rows:1,value:n,placeholder:k,"aria-label":"Ask the assistant",disabled:b,onChange:t=>r.updateText(t.target.value,t.target.selectionStart),onSelect:t=>r.refresh(t.currentTarget.selectionStart),onClick:t=>r.refresh(t.currentTarget.selectionStart),onScroll:t=>m(t.currentTarget.scrollTop),onBlur:t=>{var p,y;(y=(p=t.relatedTarget)==null?void 0:p.closest)!=null&&y.call(p,".chat-paper-picker")||window.setTimeout(r.close,0)},onKeyDown:t=>{r.keyDown(t)||t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),S())},role:j?"combobox":void 0,"aria-expanded":j?r.open:void 0,"aria-controls":r.open?r.pickerId:void 0,"aria-activedescendant":r.open&&r.results.length?`${r.optionIdPrefix}-${r.activeIndex}`:void 0,"aria-autocomplete":j?"list":void 0,"aria-describedby":r.message?"ask-home-paper-mention-message":void 0})]}),r.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:r.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(Z,{models:h,selectedModel:l,onModelChange:v}),e.jsx(ee,{value:x,onChange:c,disabled:b}),P&&e.jsx(se,{enabled:g,onChange:E,disabled:b}),_!=="openrouter"&&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${n.trim()?" chat-send-on":""}`,onClick:()=>void S(),disabled:!n.trim()||b,"aria-label":"Ask the assistant",children:e.jsx(te,{})})]}),e.jsx(ae,{open:r.open,query:r.query,results:r.results,activeIndex:r.activeIndex,loading:r.loading,error:r.error,onSelect:r.select,id:r.pickerId,optionIdPrefix:r.optionIdPrefix})]})]})},$e=()=>{var P,j,r,S,A;const[i,h]=B(),o=je(i.get("order_by")),u=ve(i.get("time")),n=i.get("has_code")==="true",f=i.get("has_hf_artifacts")==="true",m=ue[u],l=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},v=s=>{const a=new URLSearchParams(i);a.set("time",pe[s]),h(a)},_=s=>{const a=new URLSearchParams(i);s?a.set("has_code","true"):a.delete("has_code"),h(a)},g=s=>{const a=new URLSearchParams(i);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),h(a)},E=D({queryKey:["top-tasks-sidebar"],queryFn:()=>I.topTasks(8),staleTime:10*60*1e3}),x=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>I.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=le({page_size:30,order_by:o,order_dir:"desc",time:u,include_resources:!0,has_code:n,has_hf_artifacts:f}),b=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(t=>t.results))||[]).map(oe)},[c.data]),{targetRef:C,isIntersecting:k}=z({rootMargin:"400px"});d.useEffect(()=>{k&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[k,c.hasNextPage,c.isFetchingNextPage]);const T=c.isLoading,L=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"}),E.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"h-5 w-full"},a))}),(P=E.data)==null?void 0:P.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"h-5 w-full"},a))}),((r=(j=x.data)==null?void 0:j.results)==null?void 0:r.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(S=x.data)==null?void 0:S.results)==null?void 0:A.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[R()&&e.jsx(_e,{}),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:he.map(([s,a])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:a},s))}),e.jsx(G,{hasCode:n,hasHfArtifacts:f,onHasCodeChange:_,onHasHfArtifactsChange:g})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ce.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>v(s),children:s},s))})]}),L&&e.jsx(de,{variant:"destructive",className:"mb-4",children:e.jsx(me,{children:"Failed to load papers. Please try again."})}),T?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(N,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(N,{className:"h-6 w-3/4"}),e.jsx(N,{className:"h-4 w-1/2"}),e.jsx(N,{className:"h-12 w-full"})]})]},a))}):b.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:b.map((s,a)=>e.jsx(W,{paper:s,rank:a+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{_e as AskAssistant,$e as default};
 
1
+ import{u as U,r as d,i as R,j as e,a as B,L as M,b as K}from"./index-D_-UZEuL.js";import{P as W}from"./components-CmC5jqhM.js";import{u as z,P as G}from"./useIntersectionObserver-Cq9n7uOQ.js";import{D as Q,S as V,P as X,u as Y,a as J,M as Z,R as ee,W as se,A as te,b as ae,q as re,c as ie}from"./chatSessions-CPPX7pkh.js";import{c as ne}from"./chat-7zW8PrrA.js";import{c as I}from"./catalog-CjU2vAfw.js";import{S as w}from"./chatPrompts-CDY3UGU1.js";import{t as oe,d as H}from"./transform-CUuA-koJ.js";import{u as le}from"./usePapers-BCHtBW8G.js";import{P as ce}from"./usePeriodFilter-fHKAAcyd.js";import{S as N}from"./skeleton-CCZ1iXls.js";import{A as de,a as me}from"./alert-B2j1kc2o.js";import{u as D}from"./useQuery-BZo4MZ3s.js";import"./LatexTitle-B7GPgo8C.js";import"./katex.min-BSBacQyE.js";import"./papers-DHqjKX7p.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-DI19XsBw.js";import"./useInfiniteQuery-CFUEkcEs.js";const he=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],pe={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},ue={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},O=45,fe=1800,ge=25,xe=350,be=i=>{const[h,o]=d.useState(w[0].slice(0,1));return d.useEffect(()=>{var v,_;if(!i)return;if((_=(v=window.matchMedia)==null?void 0:v.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){o(w[0]);return}let u=0,n=1,f=!1,m;o(w[0].slice(0,n));const l=()=>{const g=w[u];if(!f){if(n+=1,o(g.slice(0,n)),n===g.length){f=!0,m=window.setTimeout(l,fe);return}m=window.setTimeout(l,O);return}if(n-=1,o(g.slice(0,n)),n===0){f=!1,u=(u+1)%w.length,m=window.setTimeout(l,xe);return}m=window.setTimeout(l,ge)};return m=window.setTimeout(l,O),()=>window.clearTimeout(m)},[i]),h},je=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",ve=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",_e=()=>{var A,s,a;const i=U(),h=K()?V:X,[o,u]=d.useState({text:"",paperMentions:[]}),n=o.text,[f,m]=d.useState(0),[l,v]=d.useState(Q),_=(A=h.find(t=>t.id===l))==null?void 0:A.provider,[g,E]=d.useState(!1),[x,c]=d.useState("low"),[b,C]=d.useState(!1),k=be(!n),T=d.useRef(null),L=D({queryKey:["chatAvailability"],queryFn:()=>ne.getAvailability(),retry:!1,enabled:R()}),P=!!((s=L.data)!=null&&s.web_search_available),j=R()&&((a=L.data)==null?void 0:a.paper_mentions_enabled)!==!1,r=Y({draft:o,onChange:u,enabled:j,textareaRef:T});d.useLayoutEffect(()=>{const t=T.current;if(!t)return;const p=()=>{if(t.style.height="auto",n){t.style.height=`${Math.min(t.scrollHeight,160)}px`;return}const y=t.placeholder,F=w.reduce((q,$)=>(t.placeholder=$,Math.max(q,t.scrollHeight)),0);t.placeholder=y,t.style.height=`${Math.min(F,160)}px`};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[n]);const S=async(t=o)=>{if(!(!t.text.trim()||b)){C(!0),re(t,l,{webSearchEnabled:P&&g,reasoningEffort:x});try{const y=await ie(l,x);i(`/chat/${y.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(J,{text:o.text,mentions:o.paperMentions,scrollTop:f,variant:"home"}),e.jsx("textarea",{ref:T,rows:1,value:n,placeholder:k,"aria-label":"Ask the assistant",disabled:b,onChange:t=>r.updateText(t.target.value,t.target.selectionStart),onSelect:t=>r.refresh(t.currentTarget.selectionStart),onClick:t=>r.refresh(t.currentTarget.selectionStart),onScroll:t=>m(t.currentTarget.scrollTop),onBlur:t=>{var p,y;(y=(p=t.relatedTarget)==null?void 0:p.closest)!=null&&y.call(p,".chat-paper-picker")||window.setTimeout(r.close,0)},onKeyDown:t=>{r.keyDown(t)||t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),S())},role:j?"combobox":void 0,"aria-expanded":j?r.open:void 0,"aria-controls":r.open?r.pickerId:void 0,"aria-activedescendant":r.open&&r.results.length?`${r.optionIdPrefix}-${r.activeIndex}`:void 0,"aria-autocomplete":j?"list":void 0,"aria-describedby":r.message?"ask-home-paper-mention-message":void 0})]}),r.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:r.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(Z,{models:h,selectedModel:l,onModelChange:v}),e.jsx(ee,{value:x,onChange:c,disabled:b}),P&&e.jsx(se,{enabled:g,onChange:E,disabled:b}),_!=="openrouter"&&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${n.trim()?" chat-send-on":""}`,onClick:()=>void S(),disabled:!n.trim()||b,"aria-label":"Ask the assistant",children:e.jsx(te,{})})]}),e.jsx(ae,{open:r.open,query:r.query,results:r.results,activeIndex:r.activeIndex,loading:r.loading,error:r.error,onSelect:r.select,id:r.pickerId,optionIdPrefix:r.optionIdPrefix})]})]})},$e=()=>{var P,j,r,S,A;const[i,h]=B(),o=je(i.get("order_by")),u=ve(i.get("time")),n=i.get("has_code")==="true",f=i.get("has_hf_artifacts")==="true",m=ue[u],l=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},v=s=>{const a=new URLSearchParams(i);a.set("time",pe[s]),h(a)},_=s=>{const a=new URLSearchParams(i);s?a.set("has_code","true"):a.delete("has_code"),h(a)},g=s=>{const a=new URLSearchParams(i);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),h(a)},E=D({queryKey:["top-tasks-sidebar"],queryFn:()=>I.topTasks(8),staleTime:10*60*1e3}),x=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>I.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=le({page_size:30,order_by:o,order_dir:"desc",time:u,include_resources:!0,has_code:n,has_hf_artifacts:f}),b=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(t=>t.results))||[]).map(oe)},[c.data]),{targetRef:C,isIntersecting:k}=z({rootMargin:"400px"});d.useEffect(()=>{k&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[k,c.hasNextPage,c.isFetchingNextPage]);const T=c.isLoading,L=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"}),E.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"h-5 w-full"},a))}),(P=E.data)==null?void 0:P.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"h-5 w-full"},a))}),((r=(j=x.data)==null?void 0:j.results)==null?void 0:r.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(S=x.data)==null?void 0:S.results)==null?void 0:A.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[R()&&e.jsx(_e,{}),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:he.map(([s,a])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:a},s))}),e.jsx(G,{hasCode:n,hasHfArtifacts:f,onHasCodeChange:_,onHasHfArtifactsChange:g})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ce.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>v(s),children:s},s))})]}),L&&e.jsx(de,{variant:"destructive",className:"mb-4",children:e.jsx(me,{children:"Failed to load papers. Please try again."})}),T?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(N,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(N,{className:"h-6 w-3/4"}),e.jsx(N,{className:"h-4 w-1/2"}),e.jsx(N,{className:"h-12 w-full"})]})]},a))}):b.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:b.map((s,a)=>e.jsx(W,{paper:s,rank:a+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{_e as AskAssistant,$e as default};
assets/{FrameworksIndexView-I7yKuqQY.js → FrameworksIndexView-ByziIlRP.js} RENAMED
@@ -1 +1 @@
1
- import{u as d,j as e,L as o,R as m}from"./index-BrhBTT14.js";import{u as p}from"./useQuery-GhY2LXSI.js";import{I as h}from"./components-74u_bIKK.js";import{c as u}from"./catalog-CkpmYxEk.js";import{c as g,h as f}from"./transform-Duf4Shfn.js";import"./LatexTitle-BJSVMlZ1.js";import"./katex.min-BSBacQyE.js";import"./papers-DBaPliAp.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},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(a=>e.jsx(b,{platform:a},a))})]}),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(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{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"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==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."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.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:v,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(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,E as default};
 
1
+ import{u as d,j as e,L as o,z as m}from"./index-D_-UZEuL.js";import{u as p}from"./useQuery-BZo4MZ3s.js";import{I as h}from"./components-CmC5jqhM.js";import{c as u}from"./catalog-CjU2vAfw.js";import{c as g,h as f}from"./transform-CUuA-koJ.js";import"./LatexTitle-B7GPgo8C.js";import"./katex.min-BSBacQyE.js";import"./papers-DHqjKX7p.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},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(a=>e.jsx(b,{platform:a},a))})]}),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(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{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"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==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."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.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:v,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(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,E as default};
assets/{LatexTitle-BJSVMlZ1.js → LatexTitle-B7GPgo8C.js} RENAMED
@@ -1 +1 @@
1
- import{j as o,r as g}from"./index-BrhBTT14.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-D_-UZEuL.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-CNM4Jz9h.js → MarkdownText-QvkQ9FeM.js} RENAMED
@@ -1 +1 @@
1
- import{k as l,j as s,L as u}from"./index-BrhBTT14.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-BCdZ9yj3.js";import{M as d,r as w}from"./index-BLqBUiom.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 k(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 f(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=k(t);if(i){const c=f(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,k as r};
 
1
+ import{n as l,j as s,L as u}from"./index-D_-UZEuL.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-B25cD-_k.js";import{M as d,r as w}from"./index-vCOH2DKd.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,f as r};
assets/{MethodDetailView-kXZaPUhq.js → MethodDetailView-CiYmZ5G6.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,r as L,e as W,a as Z,L as C,aa as V}from"./index-BrhBTT14.js";import{u as M}from"./useQuery-GhY2LXSI.js";import{u as X}from"./useInfiniteQuery-bETtM5yS.js";import{M as Y,P as J}from"./components-74u_bIKK.js";import{u as ee,P as te}from"./useIntersectionObserver-Lj6hnXj6.js";import{r as se,M as O}from"./MarkdownText-CNM4Jz9h.js";import{c as b}from"./catalog-CkpmYxEk.js";import{p as ae}from"./papers-DBaPliAp.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-Duf4Shfn.js";import{S as A}from"./skeleton-DHdzoBmM.js";import{A as ie,a as le}from"./alert-c1n3ZtEC.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-BJSVMlZ1.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BCdZ9yj3.js";import"./index-BLqBUiom.js";import"./hover-card-BcKGA4Et.js";const s={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"},j=({x:t,y:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),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:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>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:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),de.map(([t,n],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({method:t})=>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:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c<g;c+=f)(g-c)*n>=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},ze=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=X({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>ae.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=ee({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=se(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" 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:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.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:(a.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.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:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(Y,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(te,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.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:v.map((r,d)=>e.jsx(J,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ze as default};
 
1
+ import{j as e,r as L,c as W,a as Z,L as C,ag as V}from"./index-D_-UZEuL.js";import{u as M}from"./useQuery-BZo4MZ3s.js";import{u as X}from"./useInfiniteQuery-CFUEkcEs.js";import{M as Y,P as J}from"./components-CmC5jqhM.js";import{u as ee,P as te}from"./useIntersectionObserver-Cq9n7uOQ.js";import{r as se,M as O}from"./MarkdownText-QvkQ9FeM.js";import{c as b}from"./catalog-CjU2vAfw.js";import{p as ae}from"./papers-DHqjKX7p.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-CUuA-koJ.js";import{S as A}from"./skeleton-CCZ1iXls.js";import{A as ie,a as le}from"./alert-B2j1kc2o.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-B7GPgo8C.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-B25cD-_k.js";import"./index-vCOH2DKd.js";import"./hover-card-DiJQFgx9.js";const s={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"},j=({x:t,y:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),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:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>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:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),de.map(([t,n],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({method:t})=>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:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c<g;c+=f)(g-c)*n>=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},ze=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=X({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>ae.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=ee({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=se(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" 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:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.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:(a.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.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:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(Y,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(te,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.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:v.map((r,d)=>e.jsx(J,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ze as default};
assets/{MethodsIndexView-ooJqtLOL.js → MethodsIndexView-geijTR_Z.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as g,r as d,j as e,L as f}from"./index-BrhBTT14.js";import{u as m}from"./useQuery-GhY2LXSI.js";import{c as h}from"./catalog-CkpmYxEk.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-DHdzoBmM.js";import{A as y,a as v}from"./alert-c1n3ZtEC.js";import{T as _}from"./TaxonomySuggestionTile-BkE17zPJ.js";import"./SignInToEditDialog-Dcu4wTOX.js";import"./button-CusGeqPB.js";import"./textarea-D6mDqvzM.js";import"./dialog-BhRZv4T5.js";import"./useMutation-DqfuSW7Q.js";import"./submissions-C1hG3qlt.js";import"./loader-circle-BqZ1qbXL.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{d as g,r as d,j as e,L as f}from"./index-D_-UZEuL.js";import{u as m}from"./useQuery-BZo4MZ3s.js";import{c as h}from"./catalog-CjU2vAfw.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-CCZ1iXls.js";import{A as y,a as v}from"./alert-B2j1kc2o.js";import{T as _}from"./TaxonomySuggestionTile-DgDd6ghr.js";import"./SignInToEditDialog-DZLQNGaN.js";import"./button-Cc8PFtC1.js";import"./textarea-DlQmtN_E.js";import"./dialog-ChaQ5z93.js";import"./useMutation-P0Dg96Vh.js";import"./submissions-BpzsA2lc.js";import"./loader-circle-D1SscQUT.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{NotFound-CksCbtS8.js → NotFound--BkOSvuh.js} RENAMED
@@ -1 +1 @@
1
- import{au as o,r as a,j as t,L as s}from"./index-BrhBTT14.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{az as o,r as a,j as t,L as s}from"./index-D_-UZEuL.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/{OrganizationContributionGraph-0Wm7L2tv.js → OrganizationContributionGraph-BroNa3f8.js} RENAMED
@@ -1 +1 @@
1
- import{r as b,j as o}from"./index-BrhBTT14.js";import{u as z}from"./useQuery-GhY2LXSI.js";import{S as T}from"./skeleton-DHdzoBmM.js";import{c as w}from"./catalog-CkpmYxEk.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;e<t;e+=1){const d=l.slice(e*7,e*7+7).find(g=>g.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O};
 
1
+ import{r as b,j as o}from"./index-D_-UZEuL.js";import{u as z}from"./useQuery-BZo4MZ3s.js";import{S as T}from"./skeleton-CCZ1iXls.js";import{c as w}from"./catalog-CjU2vAfw.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;e<t;e+=1){const d=l.slice(e*7,e*7+7).find(g=>g.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O};
assets/OrganizationDetailView-7XdyiyeW.js DELETED
@@ -1 +0,0 @@
1
- import{e as t,j as r}from"./index-BrhBTT14.js";import{O as i}from"./OrganizationPaperFeed-BFjRG1j0.js";import m from"./NotFound-CksCbtS8.js";import"./useQuery-GhY2LXSI.js";import"./components-74u_bIKK.js";import"./LatexTitle-BJSVMlZ1.js";import"./katex.min-BSBacQyE.js";import"./transform-Duf4Shfn.js";import"./papers-DBaPliAp.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-CNM4Jz9h.js";import"./PaperPreviewLink-BCdZ9yj3.js";import"./index-BLqBUiom.js";import"./hover-card-BcKGA4Et.js";import"./OrganizationContributionGraph-0Wm7L2tv.js";import"./skeleton-DHdzoBmM.js";import"./catalog-CkpmYxEk.js";import"./useIntersectionObserver-Lj6hnXj6.js";import"./alert-c1n3ZtEC.js";import"./searchable-select-7qMDVvfT.js";import"./button-CusGeqPB.js";import"./dialog-BhRZv4T5.js";import"./loader-circle-BqZ1qbXL.js";import"./usePapers-C1lfz0oo.js";import"./useInfiniteQuery-bETtM5yS.js";const h=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{h as default};
 
 
assets/OrganizationDetailView-B70eYNbJ.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{c as t,j as r}from"./index-D_-UZEuL.js";import{O as i}from"./OrganizationPaperFeed-F7htGhMz.js";import m from"./NotFound--BkOSvuh.js";import"./useQuery-BZo4MZ3s.js";import"./components-CmC5jqhM.js";import"./LatexTitle-B7GPgo8C.js";import"./katex.min-BSBacQyE.js";import"./transform-CUuA-koJ.js";import"./papers-DHqjKX7p.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-QvkQ9FeM.js";import"./PaperPreviewLink-B25cD-_k.js";import"./index-vCOH2DKd.js";import"./hover-card-DiJQFgx9.js";import"./OrganizationContributionGraph-BroNa3f8.js";import"./skeleton-CCZ1iXls.js";import"./catalog-CjU2vAfw.js";import"./useIntersectionObserver-Cq9n7uOQ.js";import"./alert-B2j1kc2o.js";import"./searchable-select-Dmf1cwUh.js";import"./button-Cc8PFtC1.js";import"./dialog-ChaQ5z93.js";import"./loader-circle-D1SscQUT.js";import"./usePapers-BCHtBW8G.js";import"./useInfiniteQuery-CFUEkcEs.js";const h=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{h as default};
assets/{OrganizationPaperFeed-BFjRG1j0.js → OrganizationPaperFeed-F7htGhMz.js} RENAMED
@@ -1 +1 @@
1
- import{u as E,a as Q,r as d,j as e,L as w}from"./index-BrhBTT14.js";import{u as A}from"./useQuery-GhY2LXSI.js";import{P as U}from"./components-74u_bIKK.js";import{M as B}from"./MarkdownText-CNM4Jz9h.js";import{O as G}from"./OrganizationContributionGraph-0Wm7L2tv.js";import{u as K,P as W}from"./useIntersectionObserver-Lj6hnXj6.js";import{A as D,a as Z}from"./alert-c1n3ZtEC.js";import{S as z}from"./searchable-select-7qMDVvfT.js";import{S as C}from"./skeleton-DHdzoBmM.js";import{d as J}from"./usePapers-C1lfz0oo.js";import{c as $}from"./catalog-CkpmYxEk.js";import{d as T,t as V}from"./transform-Duf4Shfn.js";import X from"./NotFound-CksCbtS8.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",ue=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>$.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>$.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:f,enabled:!!n}),{targetRef:H,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=_.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=_.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const S=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},q=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.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:[s!=null&&s.logo_url&&!M?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx(C,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...S(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx(C,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.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:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ue as O};
 
1
+ import{u as E,a as Q,r as d,j as e,L as w}from"./index-D_-UZEuL.js";import{u as A}from"./useQuery-BZo4MZ3s.js";import{P as U}from"./components-CmC5jqhM.js";import{M as B}from"./MarkdownText-QvkQ9FeM.js";import{O as G}from"./OrganizationContributionGraph-BroNa3f8.js";import{u as K,P as W}from"./useIntersectionObserver-Cq9n7uOQ.js";import{A as D,a as Z}from"./alert-B2j1kc2o.js";import{S as z}from"./searchable-select-Dmf1cwUh.js";import{S as C}from"./skeleton-CCZ1iXls.js";import{d as J}from"./usePapers-BCHtBW8G.js";import{c as $}from"./catalog-CjU2vAfw.js";import{d as T,t as V}from"./transform-CUuA-koJ.js";import X from"./NotFound--BkOSvuh.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",ue=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>$.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>$.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:f,enabled:!!n}),{targetRef:H,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=_.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=_.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const S=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},q=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.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:[s!=null&&s.logo_url&&!M?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx(C,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...S(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx(C,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.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:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ue as O};
assets/OrganizationTaskView-DdRJ05b_.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{c as i,j as t}from"./index-D_-UZEuL.js";import{O as m}from"./OrganizationPaperFeed-F7htGhMz.js";import p from"./NotFound--BkOSvuh.js";import"./useQuery-BZo4MZ3s.js";import"./components-CmC5jqhM.js";import"./LatexTitle-B7GPgo8C.js";import"./katex.min-BSBacQyE.js";import"./transform-CUuA-koJ.js";import"./papers-DHqjKX7p.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-QvkQ9FeM.js";import"./PaperPreviewLink-B25cD-_k.js";import"./index-vCOH2DKd.js";import"./hover-card-DiJQFgx9.js";import"./OrganizationContributionGraph-BroNa3f8.js";import"./skeleton-CCZ1iXls.js";import"./catalog-CjU2vAfw.js";import"./useIntersectionObserver-Cq9n7uOQ.js";import"./alert-B2j1kc2o.js";import"./searchable-select-Dmf1cwUh.js";import"./button-Cc8PFtC1.js";import"./dialog-ChaQ5z93.js";import"./loader-circle-D1SscQUT.js";import"./usePapers-BCHtBW8G.js";import"./useInfiniteQuery-CFUEkcEs.js";const h=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{h as default};
assets/OrganizationTaskView-LqFkQbPW.js DELETED
@@ -1 +0,0 @@
1
- import{e as i,j as t}from"./index-BrhBTT14.js";import{O as m}from"./OrganizationPaperFeed-BFjRG1j0.js";import p from"./NotFound-CksCbtS8.js";import"./useQuery-GhY2LXSI.js";import"./components-74u_bIKK.js";import"./LatexTitle-BJSVMlZ1.js";import"./katex.min-BSBacQyE.js";import"./transform-Duf4Shfn.js";import"./papers-DBaPliAp.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-CNM4Jz9h.js";import"./PaperPreviewLink-BCdZ9yj3.js";import"./index-BLqBUiom.js";import"./hover-card-BcKGA4Et.js";import"./OrganizationContributionGraph-0Wm7L2tv.js";import"./skeleton-DHdzoBmM.js";import"./catalog-CkpmYxEk.js";import"./useIntersectionObserver-Lj6hnXj6.js";import"./alert-c1n3ZtEC.js";import"./searchable-select-7qMDVvfT.js";import"./button-CusGeqPB.js";import"./dialog-BhRZv4T5.js";import"./loader-circle-BqZ1qbXL.js";import"./usePapers-C1lfz0oo.js";import"./useInfiniteQuery-bETtM5yS.js";const h=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{h as default};
 
 
assets/{OrganizationsIndexView-CIxnPMcd.js → OrganizationsIndexView-wDeeuR4B.js} RENAMED
@@ -1 +1 @@
1
- import{a as u,r as g,j as e,L as x}from"./index-BrhBTT14.js";import{u as j}from"./useQuery-GhY2LXSI.js";import{A as y,a as f}from"./alert-c1n3ZtEC.js";import{S as _}from"./skeleton-DHdzoBmM.js";import{c as N}from"./catalog-CkpmYxEk.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)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizations(!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(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{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{A as default};
 
1
+ import{a as u,r as g,j as e,L as x}from"./index-D_-UZEuL.js";import{u as j}from"./useQuery-BZo4MZ3s.js";import{A as y,a as f}from"./alert-B2j1kc2o.js";import{S as _}from"./skeleton-CCZ1iXls.js";import{c as N}from"./catalog-CjU2vAfw.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)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizations(!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(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{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{A as default};
assets/{PaperDetailView-DQZWeXKk.js → PaperDetailView-Dys6fQi8.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/{PaperPreviewLink-BCdZ9yj3.js → PaperPreviewLink-B25cD-_k.js} RENAMED
@@ -1,7 +1,7 @@
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-BLqBUiom.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,N as ce,k as ue,L as he}from"./index-BrhBTT14.js";import{u as pe}from"./useQuery-GhY2LXSI.js";import{H as me,a as fe,b as de}from"./hover-card-BcKGA4Et.js";import{p as ge}from"./papers-DBaPliAp.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+`
5
- `)),x+=p.move(m),g(),x}function r(o,s,l){let a=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(a);)u++;const p="$".repeat(u);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let m=-1;for(;++m<l.unsafe.length;){const g=l.unsafe[m];if(!g.atBreak)continue;const x=l.compilePattern(g);let d;for(;d=x.exec(a);){let h=d.index;a.codePointAt(h)===10&&a.codePointAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(d.index+1)}}return p+a+p}function i(){return"$"}}const we={tokenize:be,concrete:!0,name:"mathFlow"},O={tokenize:Ne,partial:!0};function be(e,t,n){const r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let s=0;return l;function l(c){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),a(c)}function a(c){return c===36?(e.consume(c),s++,a):s<2?n(c):(e.exit("mathFlowFenceSequence"),v(e,u,"whitespace")(c))}function u(c){return c===null||b(c)?m(c):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(c))}function p(c){return c===null||b(c)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),m(c)):c===36?n(c):(e.consume(c),p)}function m(c){return e.exit("mathFlowFence"),r.interrupt?t(c):e.attempt(O,g,w)(c)}function g(c){return e.attempt({tokenize:k,partial:!0},w,x)(c)}function x(c){return(o?v(e,d,"linePrefix",o+1):d)(c)}function d(c){return c===null?w(c):b(c)?e.attempt(O,g,w)(c):(e.enter("mathFlowValue"),h(c))}function h(c){return c===null||b(c)?(e.exit("mathFlowValue"),d(c)):(e.consume(c),h)}function w(c){return e.exit("mathFlow"),t(c)}function k(c,Z,S){let A=0;return v(c,ee,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function ee(y){return c.enter("mathFlowFence"),c.enter("mathFlowFenceSequence"),P(y)}function P(y){return y===36?(A++,c.consume(y),P):A<s?S(y):(c.exit("mathFlowFenceSequence"),v(c,te,"whitespace")(y))}function te(y){return y===null||b(y)?(c.exit("mathFlowFence"),Z(y)):S(y)}}}function Ne(e,t,n){const r=this;return i;function i(s){return s===null?t(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Fe(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:ke,previous:ve,name:"mathText"};function r(i,o,s){let l=0,a,u;return p;function p(h){return i.enter("mathText"),i.enter("mathTextSequence"),m(h)}function m(h){return h===36?(i.consume(h),l++,m):l<2&&!n?s(h):(i.exit("mathTextSequence"),g(h))}function g(h){return h===null?s(h):h===36?(u=i.enter("mathTextSequence"),a=0,d(h)):h===32?(i.enter("space"),i.consume(h),i.exit("space"),g):b(h)?(i.enter("lineEnding"),i.consume(h),i.exit("lineEnding"),g):(i.enter("mathTextData"),x(h))}function x(h){return h===null||h===32||h===36||b(h)?(i.exit("mathTextData"),g(h)):(i.consume(h),x)}function d(h){return h===36?(i.consume(h),a++,d):a===l?(i.exit("mathTextSequence"),i.exit("mathText"),o(h)):(u.type="mathTextData",x(h))}}}function ke(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="mathTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ve(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Ce(e){return{flow:{36:we},text:{36:Fe(e)}}}const Te={};function xt(e){const t=this,n=e||Te,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Ce(n)),o.push(xe()),s.push(ye(n))}const q=/[#.]/g;function Me(e,t){const n=e||"",r={};let i=0,o,s;for(;i<n.length;){q.lastIndex=i;const l=q.exec(n),a=n.slice(i,l?l.index:n.length);a&&(o?o==="#"?r.id=a:Array.isArray(r.className)?r.className.push(a):r.className=[a]:s=a,i+=a.length),l&&(o=l[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function V(e,t,n){const r=n?Ae(n):void 0;function i(o,s,...l){let a;if(o==null){a={type:"root",children:[]};const u=s;l.unshift(u)}else{a=Me(o,t);const u=a.tagName.toLowerCase(),p=r?r.get(u):void 0;if(a.tagName=p||u,je(s))l.unshift(s);else for(const[m,g]of Object.entries(s))Ee(e,a.properties,m,g)}for(const u of l)M(a.children,u);return a.type==="element"&&a.tagName==="template"&&(a.content={type:"root",children:a.children},a.children=[]),a}return i}function je(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const o=i;for(const s of o)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Ee(e,t,n,r){const i=re(e,n);let o;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;o=r}else typeof r=="boolean"?o=r:typeof r=="string"?i.spaceSeparated?o=I(r):i.commaSeparated?o=$(r):i.commaOrSpaceSeparated?o=I($(r).join(" ")):o=D(i,i.property,r):Array.isArray(r)?o=[...r]:o=i.property==="style"?Se(r):String(r);if(Array.isArray(o)){const s=[];for(const l of o)s.push(D(i,i.property,l));o=s}i.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[i.property]=o}}function M(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)M(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?M(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function D(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||L(n)===L(t)))return!0}return n}function Se(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Ae(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Pe=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Ie=V(ie,"div"),$e=V(ae,"g",Pe),C={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function Le(e,t){return K(e,{})||{type:"root",children:[]}}function K(e,t){const n=ze(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function ze(e,t){switch(e.nodeType){case 1:return _e(e,t);case 3:return qe(e);case 8:return De(e);case 9:return _(e,t);case 10:return Oe();case 11:return _(e,t);default:return}}function _(e,t){return{type:"root",children:X(e,t)}}function Oe(){return{type:"doctype"}}function qe(e){return{type:"text",value:e.nodeValue||""}}function De(e){return{type:"comment",value:e.nodeValue||""}}function _e(e,t){const n=e.namespaceURI,r=n===C.svg?$e:Ie,i=n===C.html?e.tagName.toLowerCase():e.tagName,o=n===C.html&&i==="template"?e.content:e,s=e.getAttributeNames(),l={};let a=-1;for(;++a<s.length;)l[s[a]]=e.getAttribute(s[a])||"";return r(i,l,X(o,t))}function X(e,t){const n=e.childNodes,r=[];let i=-1;for(;++i<n.length;){const o=K(n[i],t);o!==void 0&&r.push(o)}return r}new DOMParser;function Be(e,t){const n=Re(e);return Le(n)}function Re(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const B=function(e,t,n){const r=oe(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]},N=function(e){if(e==null)return He;if(typeof e=="string")return Ge(e);if(typeof e=="object")return Ue(e);if(typeof e=="function")return E(e);throw new Error("Expected function, string, or array as `test`")};function Ue(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=N(e[n]);return E(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Ge(e){return E(t);function t(n){return n.tagName===e}}function E(e){return t;function t(n,r,i){return!!(Ve(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function He(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Ve(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const R=/\n/g,U=/[\t ]+/g,j=N("br"),G=N(et),Ke=N("p"),H=N("tr"),Xe=N(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Ze,tt]),W=N(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function We(e,t){const n=t||{},r="children"in e?e.children:[],i=W(e),o=J(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(...Y(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)s.push(...Q(r[l],e,{whitespace:o,breakBefore:l?void 0:i,breakAfter:l<r.length-1?j(r[l+1]):i}));const a=[];let u;for(l=-1;++l<s.length;){const p=s[l];typeof p=="number"?u!==void 0&&p>u&&(u=p):p&&(u!==void 0&&u>-1&&a.push(`
6
  `.repeat(u)||" "),u=-1,a.push(p))}return a.join("")}function Q(e,t,n){return e.type==="element"?Qe(e,t,n):e.type==="text"?n.whitespace==="normal"?Y(e,n):Ye(e):[]}function Qe(e,t,n){const r=J(e,n),i=e.children||[];let o=-1,s=[];if(Xe(e))return s;let l,a;for(j(e)||H(e)&&B(t,e,H)?a=`
7
- `:Ke(e)?(l=2,a=2):W(e)&&(l=1,a=1);++o<i.length;)s=s.concat(Q(i[o],e,{whitespace:r,breakBefore:o?void 0:l,breakAfter:o<i.length-1?j(i[o+1]):a}));return G(e)&&B(t,e,G)&&s.push(" "),l&&s.unshift(l),a&&s.push(a),s}function Y(e,t){const n=String(e.value),r=[],i=[];let o=0;for(;o<=n.length;){R.lastIndex=o;const a=R.exec(n),u=a&&"index"in a?a.index:n.length;r.push(Je(n.slice(o,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),o=u+1}let s=-1,l;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(i.push(r[s]),l=void 0):r[s]?(typeof l=="number"&&i.push(l),i.push(r[s]),l=0):(s===0||s===r.length-1)&&i.push(0);return i}function Ye(e){return[String(e.value)]}function Je(e,t,n){const r=[];let i=0,o;for(;i<e.length;){U.lastIndex=i;const s=U.exec(e);o=s?s.index:e.length,!i&&!o&&s&&!t&&r.push(""),i!==o&&r.push(e.slice(i,o)),i=s?o+s[0].length:o}return i!==o&&!n&&r.push(""),r.join(" ")}function J(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function Ze(e){return!!(e.properties||{}).hidden}function et(e){return e.tagName==="td"||e.tagName==="th"}function tt(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const nt={},rt=[];function yt(e){const t=e||nt;return function(n,r){se(n,"element",function(i,o){const s=Array.isArray(i.properties.className)?i.properties.className:rt,l=s.includes("language-math"),a=s.includes("math-display"),u=s.includes("math-inline");let p=a;if(!l&&!a&&!u)return;let m=o[o.length-1],g=i;if(i.tagName==="code"&&l&&m&&m.type==="element"&&m.tagName==="pre"&&(g=m,m=o[o.length-2],p=!0),!m)return;const x=We(g,{whitespace:"pre"});let d;try{d=z.renderToString(x,{...t,displayMode:p,throwOnError:!0})}catch(w){const k=w,c=k.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...o,i],cause:k,place:i.position,ruleId:c,source:"rehype-katex"});try{d=z.renderToString(x,{...t,displayMode:p,strict:"ignore",throwOnError:!1})}catch{d=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(w)},children:[{type:"text",value:x}]}]}}typeof d=="string"&&(d=Be(d).children);const h=m.children.indexOf(g);return m.children.splice(h,1,...d),le})}}function it(e,t=e.arxiv_id??e.id){return{routeId:t,title:e.title,arxivId:e.arxiv_id,source:e.source??(e.arxiv_id?"arxiv":"external"),sourceUrl:e.source_url??e.url_abs,thumbnailUrl:e.thumbnail_url??null,authors:e.authors,published:e.published??null,conference:e.conference_name??e.conference??null,citationCount:e.citation_count,tasks:(e.tasks??[]).map(n=>({name:n.name,slug:n.slug??""}))}}function at(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ot(e){var n;if(e.conference)return e.conference;const t=(n=e.published)==null?void 0:n.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const st=({seed:e=0})=>f.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[f.jsxs("div",{className:"paper-preview-thumb-title",children:[f.jsx("span",{}),f.jsx("span",{})]}),f.jsx("div",{className:"paper-preview-thumb-auth"}),f.jsxs("div",{className:"paper-preview-thumb-cols",children:[f.jsx("div",{className:"paper-preview-thumb-col"}),f.jsx("div",{className:"paper-preview-thumb-col"})]}),f.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),lt=({thumbnailUrl:e,seed:t})=>{const[n,r]=T.useState(!1),i=ce(e);return T.useEffect(()=>r(!1),[i]),!i||n?f.jsx(st,{seed:t}):f.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:f.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>r(!0)})})},ct=({data:e})=>{const t=e.routeId.split("").reduce((r,i)=>r+i.charCodeAt(0),0),n=at(e);return f.jsxs("div",{className:"paper-preview-inner",children:[f.jsx(lt,{thumbnailUrl:e.thumbnailUrl,seed:t}),f.jsxs("div",{className:"paper-preview-meta",children:[f.jsx("div",{className:"paper-preview-title",children:e.title}),n&&f.jsx("div",{className:"paper-preview-auth",children:n}),f.jsxs("div",{className:"paper-preview-venue",children:[ot(e),e.arxivId&&f.jsxs(f.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&f.jsxs(f.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&f.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(r=>f.jsx("span",{className:"paper-preview-tag",children:r.name},r.slug||r.name))})]})]})},ut=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,wt=({routeId:e,to:t,initialData:n,className:r,children:i,target:o,title:s})=>{const l=ue(e),[a,u]=T.useState(!1),p=!!(n!=null&&n.title.trim()),m=pe({queryKey:["paper-preview",l],queryFn:()=>ge.get(l,!1),enabled:a&&!p,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),g=n??(m.data?it(m.data,l):void 0),x=f.jsx(he,{className:r,to:t??`/paper/${l}`,target:o,title:s,rel:o==="_blank"?"noopener noreferrer":void 0,children:i});return f.jsxs(me,{open:a,onOpenChange:d=>{(!d||!ut())&&u(d)},openDelay:150,closeDelay:100,children:[f.jsx(fe,{asChild:!0,children:x}),f.jsx(de,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:g?f.jsx(ct,{data:g}):m.isError?f.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):f.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{wt as P,xt as a,yt as r};
 
1
+ import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as z,h as ie,s as ae,c as oe,v as se,S as le}from"./index-vCOH2DKd.js";import{k as L}from"./katex.min-BSBacQyE.js";import{j as f,z as T,M as ce,n as ue,L as he}from"./index-D_-UZEuL.js";import{u as pe}from"./useQuery-BZo4MZ3s.js";import{H as me,a as fe,b as de}from"./hover-card-DiJQFgx9.js";import{p as ge}from"./papers-DHqjKX7p.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+`
5
+ `)),x+=p.move(m),g(),x}function r(o,s,l){let a=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(a);)u++;const p="$".repeat(u);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let m=-1;for(;++m<l.unsafe.length;){const g=l.unsafe[m];if(!g.atBreak)continue;const x=l.compilePattern(g);let d;for(;d=x.exec(a);){let h=d.index;a.codePointAt(h)===10&&a.codePointAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(d.index+1)}}return p+a+p}function i(){return"$"}}const we={tokenize:be,concrete:!0,name:"mathFlow"},O={tokenize:Ne,partial:!0};function be(e,t,n){const r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let s=0;return l;function l(c){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),a(c)}function a(c){return c===36?(e.consume(c),s++,a):s<2?n(c):(e.exit("mathFlowFenceSequence"),v(e,u,"whitespace")(c))}function u(c){return c===null||b(c)?m(c):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(c))}function p(c){return c===null||b(c)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),m(c)):c===36?n(c):(e.consume(c),p)}function m(c){return e.exit("mathFlowFence"),r.interrupt?t(c):e.attempt(O,g,w)(c)}function g(c){return e.attempt({tokenize:k,partial:!0},w,x)(c)}function x(c){return(o?v(e,d,"linePrefix",o+1):d)(c)}function d(c){return c===null?w(c):b(c)?e.attempt(O,g,w)(c):(e.enter("mathFlowValue"),h(c))}function h(c){return c===null||b(c)?(e.exit("mathFlowValue"),d(c)):(e.consume(c),h)}function w(c){return e.exit("mathFlow"),t(c)}function k(c,Z,S){let A=0;return v(c,ee,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function ee(y){return c.enter("mathFlowFence"),c.enter("mathFlowFenceSequence"),P(y)}function P(y){return y===36?(A++,c.consume(y),P):A<s?S(y):(c.exit("mathFlowFenceSequence"),v(c,te,"whitespace")(y))}function te(y){return y===null||b(y)?(c.exit("mathFlowFence"),Z(y)):S(y)}}}function Ne(e,t,n){const r=this;return i;function i(s){return s===null?t(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Fe(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:ke,previous:ve,name:"mathText"};function r(i,o,s){let l=0,a,u;return p;function p(h){return i.enter("mathText"),i.enter("mathTextSequence"),m(h)}function m(h){return h===36?(i.consume(h),l++,m):l<2&&!n?s(h):(i.exit("mathTextSequence"),g(h))}function g(h){return h===null?s(h):h===36?(u=i.enter("mathTextSequence"),a=0,d(h)):h===32?(i.enter("space"),i.consume(h),i.exit("space"),g):b(h)?(i.enter("lineEnding"),i.consume(h),i.exit("lineEnding"),g):(i.enter("mathTextData"),x(h))}function x(h){return h===null||h===32||h===36||b(h)?(i.exit("mathTextData"),g(h)):(i.consume(h),x)}function d(h){return h===36?(i.consume(h),a++,d):a===l?(i.exit("mathTextSequence"),i.exit("mathText"),o(h)):(u.type="mathTextData",x(h))}}}function ke(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="mathTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ve(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Ce(e){return{flow:{36:we},text:{36:Fe(e)}}}const Te={};function xt(e){const t=this,n=e||Te,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Ce(n)),o.push(xe()),s.push(ye(n))}const q=/[#.]/g;function Me(e,t){const n=e||"",r={};let i=0,o,s;for(;i<n.length;){q.lastIndex=i;const l=q.exec(n),a=n.slice(i,l?l.index:n.length);a&&(o?o==="#"?r.id=a:Array.isArray(r.className)?r.className.push(a):r.className=[a]:s=a,i+=a.length),l&&(o=l[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function V(e,t,n){const r=n?Ae(n):void 0;function i(o,s,...l){let a;if(o==null){a={type:"root",children:[]};const u=s;l.unshift(u)}else{a=Me(o,t);const u=a.tagName.toLowerCase(),p=r?r.get(u):void 0;if(a.tagName=p||u,je(s))l.unshift(s);else for(const[m,g]of Object.entries(s))Ee(e,a.properties,m,g)}for(const u of l)M(a.children,u);return a.type==="element"&&a.tagName==="template"&&(a.content={type:"root",children:a.children},a.children=[]),a}return i}function je(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const o=i;for(const s of o)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Ee(e,t,n,r){const i=re(e,n);let o;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;o=r}else typeof r=="boolean"?o=r:typeof r=="string"?i.spaceSeparated?o=I(r):i.commaSeparated?o=$(r):i.commaOrSpaceSeparated?o=I($(r).join(" ")):o=D(i,i.property,r):Array.isArray(r)?o=[...r]:o=i.property==="style"?Se(r):String(r);if(Array.isArray(o)){const s=[];for(const l of o)s.push(D(i,i.property,l));o=s}i.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[i.property]=o}}function M(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)M(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?M(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function D(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||z(n)===z(t)))return!0}return n}function Se(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Ae(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Pe=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Ie=V(ie,"div"),$e=V(ae,"g",Pe),C={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function ze(e,t){return K(e,{})||{type:"root",children:[]}}function K(e,t){const n=Le(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function Le(e,t){switch(e.nodeType){case 1:return _e(e,t);case 3:return qe(e);case 8:return De(e);case 9:return _(e,t);case 10:return Oe();case 11:return _(e,t);default:return}}function _(e,t){return{type:"root",children:X(e,t)}}function Oe(){return{type:"doctype"}}function qe(e){return{type:"text",value:e.nodeValue||""}}function De(e){return{type:"comment",value:e.nodeValue||""}}function _e(e,t){const n=e.namespaceURI,r=n===C.svg?$e:Ie,i=n===C.html?e.tagName.toLowerCase():e.tagName,o=n===C.html&&i==="template"?e.content:e,s=e.getAttributeNames(),l={};let a=-1;for(;++a<s.length;)l[s[a]]=e.getAttribute(s[a])||"";return r(i,l,X(o,t))}function X(e,t){const n=e.childNodes,r=[];let i=-1;for(;++i<n.length;){const o=K(n[i],t);o!==void 0&&r.push(o)}return r}new DOMParser;function Be(e,t){const n=Re(e);return ze(n)}function Re(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const B=function(e,t,n){const r=oe(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]},N=function(e){if(e==null)return He;if(typeof e=="string")return Ge(e);if(typeof e=="object")return Ue(e);if(typeof e=="function")return E(e);throw new Error("Expected function, string, or array as `test`")};function Ue(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=N(e[n]);return E(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Ge(e){return E(t);function t(n){return n.tagName===e}}function E(e){return t;function t(n,r,i){return!!(Ve(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function He(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Ve(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const R=/\n/g,U=/[\t ]+/g,j=N("br"),G=N(et),Ke=N("p"),H=N("tr"),Xe=N(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Ze,tt]),W=N(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function We(e,t){const n=t||{},r="children"in e?e.children:[],i=W(e),o=J(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(...Y(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)s.push(...Q(r[l],e,{whitespace:o,breakBefore:l?void 0:i,breakAfter:l<r.length-1?j(r[l+1]):i}));const a=[];let u;for(l=-1;++l<s.length;){const p=s[l];typeof p=="number"?u!==void 0&&p>u&&(u=p):p&&(u!==void 0&&u>-1&&a.push(`
6
  `.repeat(u)||" "),u=-1,a.push(p))}return a.join("")}function Q(e,t,n){return e.type==="element"?Qe(e,t,n):e.type==="text"?n.whitespace==="normal"?Y(e,n):Ye(e):[]}function Qe(e,t,n){const r=J(e,n),i=e.children||[];let o=-1,s=[];if(Xe(e))return s;let l,a;for(j(e)||H(e)&&B(t,e,H)?a=`
7
+ `:Ke(e)?(l=2,a=2):W(e)&&(l=1,a=1);++o<i.length;)s=s.concat(Q(i[o],e,{whitespace:r,breakBefore:o?void 0:l,breakAfter:o<i.length-1?j(i[o+1]):a}));return G(e)&&B(t,e,G)&&s.push(" "),l&&s.unshift(l),a&&s.push(a),s}function Y(e,t){const n=String(e.value),r=[],i=[];let o=0;for(;o<=n.length;){R.lastIndex=o;const a=R.exec(n),u=a&&"index"in a?a.index:n.length;r.push(Je(n.slice(o,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),o=u+1}let s=-1,l;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(i.push(r[s]),l=void 0):r[s]?(typeof l=="number"&&i.push(l),i.push(r[s]),l=0):(s===0||s===r.length-1)&&i.push(0);return i}function Ye(e){return[String(e.value)]}function Je(e,t,n){const r=[];let i=0,o;for(;i<e.length;){U.lastIndex=i;const s=U.exec(e);o=s?s.index:e.length,!i&&!o&&s&&!t&&r.push(""),i!==o&&r.push(e.slice(i,o)),i=s?o+s[0].length:o}return i!==o&&!n&&r.push(""),r.join(" ")}function J(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function Ze(e){return!!(e.properties||{}).hidden}function et(e){return e.tagName==="td"||e.tagName==="th"}function tt(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const nt={},rt=[];function yt(e){const t=e||nt;return function(n,r){se(n,"element",function(i,o){const s=Array.isArray(i.properties.className)?i.properties.className:rt,l=s.includes("language-math"),a=s.includes("math-display"),u=s.includes("math-inline");let p=a;if(!l&&!a&&!u)return;let m=o[o.length-1],g=i;if(i.tagName==="code"&&l&&m&&m.type==="element"&&m.tagName==="pre"&&(g=m,m=o[o.length-2],p=!0),!m)return;const x=We(g,{whitespace:"pre"});let d;try{d=L.renderToString(x,{...t,displayMode:p,throwOnError:!0})}catch(w){const k=w,c=k.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...o,i],cause:k,place:i.position,ruleId:c,source:"rehype-katex"});try{d=L.renderToString(x,{...t,displayMode:p,strict:"ignore",throwOnError:!1})}catch{d=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(w)},children:[{type:"text",value:x}]}]}}typeof d=="string"&&(d=Be(d).children);const h=m.children.indexOf(g);return m.children.splice(h,1,...d),le})}}function it(e,t=e.arxiv_id??e.id){return{routeId:t,title:e.title,arxivId:e.arxiv_id,source:e.source??(e.arxiv_id?"arxiv":"external"),sourceUrl:e.source_url??e.url_abs,thumbnailUrl:e.thumbnail_url??null,authors:e.authors,published:e.published??null,conference:e.conference_name??e.conference??null,citationCount:e.citation_count,tasks:(e.tasks??[]).map(n=>({name:n.name,slug:n.slug??""}))}}function at(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ot(e){var n;if(e.conference)return e.conference;const t=(n=e.published)==null?void 0:n.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const st=({seed:e=0})=>f.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[f.jsxs("div",{className:"paper-preview-thumb-title",children:[f.jsx("span",{}),f.jsx("span",{})]}),f.jsx("div",{className:"paper-preview-thumb-auth"}),f.jsxs("div",{className:"paper-preview-thumb-cols",children:[f.jsx("div",{className:"paper-preview-thumb-col"}),f.jsx("div",{className:"paper-preview-thumb-col"})]}),f.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),lt=({thumbnailUrl:e,seed:t})=>{const[n,r]=T.useState(!1),i=ce(e);return T.useEffect(()=>r(!1),[i]),!i||n?f.jsx(st,{seed:t}):f.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:f.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>r(!0)})})},ct=({data:e})=>{const t=e.routeId.split("").reduce((r,i)=>r+i.charCodeAt(0),0),n=at(e);return f.jsxs("div",{className:"paper-preview-inner",children:[f.jsx(lt,{thumbnailUrl:e.thumbnailUrl,seed:t}),f.jsxs("div",{className:"paper-preview-meta",children:[f.jsx("div",{className:"paper-preview-title",children:e.title}),n&&f.jsx("div",{className:"paper-preview-auth",children:n}),f.jsxs("div",{className:"paper-preview-venue",children:[ot(e),e.arxivId&&f.jsxs(f.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&f.jsxs(f.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&f.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(r=>f.jsx("span",{className:"paper-preview-tag",children:r.name},r.slug||r.name))})]})]})},ut=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,wt=({routeId:e,to:t,initialData:n,className:r,children:i,target:o,title:s})=>{const l=ue(e),[a,u]=T.useState(!1),p=!!(n!=null&&n.title.trim()),m=pe({queryKey:["paper-preview",l],queryFn:()=>ge.get(l,!1),enabled:a&&!p,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),g=n??(m.data?it(m.data,l):void 0),x=f.jsx(he,{className:r,to:t??`/paper/${l}`,target:o,title:s,rel:o==="_blank"?"noopener noreferrer":void 0,children:i});return f.jsxs(me,{open:a,onOpenChange:d=>{(!d||!ut())&&u(d)},openDelay:150,closeDelay:100,children:[f.jsx(fe,{asChild:!0,children:x}),f.jsx(de,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:g?f.jsx(ct,{data:g}):m.isError?f.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):f.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{wt as P,xt as a,yt as r};
assets/PaperReaderView-Lr_OJaUk.css ADDED
@@ -0,0 +1 @@
 
 
1
+ :root{--react-pdf-text-layer: 1;--highlight-bg-color: rgba(180, 0, 170, 1);--highlight-selected-bg-color: rgba(0, 100, 0, 1)}@media screen and (forced-colors: active){:root{--highlight-bg-color: Highlight;--highlight-selected-bg-color: ButtonText}}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}.textLayer{position:absolute;text-align:initial;top:0;right:0;bottom:0;left:0;overflow:hidden;line-height:1;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;z-index:2}.textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;margin:0;transform-origin:0 0}.textLayer span.markedContent{top:0;height:0}.textLayer .highlight{margin:-1px;padding:1px;background-color:var(--highlight-bg-color);border-radius:4px}.textLayer .highlight.appended{position:initial}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:var(--highlight-selected-bg-color)}.textLayer br::-moz-selection{background:transparent}.textLayer br::selection{background:transparent}.textLayer .endOfContent{display:block;position:absolute;top:100%;right:0;bottom:0;left:0;z-index:-1;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer.selecting .endOfContent{top:0}.hiddenCanvasElement{position:absolute;top:0;left:0;width:0;height:0;display:none}:root{--react-pdf-annotation-layer: 1;--annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");--input-focus-border-color: Highlight;--input-focus-outline: 1px solid Canvas;--input-unfocused-border-color: transparent;--input-disabled-border-color: transparent;--input-hover-border-color: black;--link-outline: none}@media screen and (forced-colors: active){:root{--input-focus-border-color: CanvasText;--input-unfocused-border-color: ActiveText;--input-disabled-border-color: GrayText;--input-hover-border-color: Highlight;--link-outline: 1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selectedItem}.annotationLayer .linkAnnotation:hover{-webkit-backdrop-filter:invert(100%);backdrop-filter:invert(100%)}}.annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0;z-index:3}.annotationLayer[data-main-rotation="90"] .norotate{transform:rotate(270deg) translate(-100%)}.annotationLayer[data-main-rotation="180"] .norotate{transform:rotate(180deg) translate(-100%,-100%)}.annotationLayer[data-main-rotation="270"] .norotate{transform:rotate(90deg) translateY(-100%)}.annotationLayer canvas{position:absolute;width:100%;height:100%}.annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;margin:0;transform-origin:0 0}.annotationLayer .linkAnnotation{outline:var(--link-outline)}.textLayer.selecting~.annotationLayer section{pointer-events:none}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a:hover{opacity:.2;background:#ff0;box-shadow:0 2px 10px #ff0}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation :is(input,textarea)[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{background:none;border:2px solid var(--input-disabled-border-color);cursor:not-allowed}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-image:none;background-color:transparent}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:"";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.annotationLayer .popupTriggerArea{height:100%;width:100%}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{position:absolute}.annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}.annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}.annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}.annotationLayer .popupContent{border-top:1px solid rgba(51,51,51,1);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}.annotationLayer .highlightAnnotation,.annotationLayer .underlineAnnotation,.annotationLayer .squigglyAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .lineAnnotation svg line,.annotationLayer .squareAnnotation svg rect,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .caretAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .stampAnnotation,.annotationLayer .fileAttachmentAnnotation{cursor:pointer}.annotationLayer section svg{position:absolute;width:100%;height:100%;top:0;left:0}.annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.annotationLayer .annotationTextContent span{width:100%;display:inline-block}
assets/PaperReaderView-fLXDbLBc.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/{PapersListView-BYepbpX4.js → PapersListView-DTuy4U-C.js} RENAMED
@@ -1 +1 @@
1
- import{a as q,r as m,A as z,j as e,L as x}from"./index-BrhBTT14.js";import{I as E,T as G,P as Q}from"./components-74u_bIKK.js";import{c as U}from"./catalog-CkpmYxEk.js";import{t as W,d as K}from"./transform-Duf4Shfn.js";import{u as V}from"./usePapers-C1lfz0oo.js";import{u as J}from"./useDebounce-DzNGzmqr.js";import{P as X}from"./usePeriodFilter-By9tdCWv.js";import{u as Y,P as Z}from"./useIntersectionObserver-Lj6hnXj6.js";import{S as p}from"./skeleton-DHdzoBmM.js";import{A as ee,a as se}from"./alert-c1n3ZtEC.js";import{u as ae}from"./useQuery-GhY2LXSI.js";import"./LatexTitle-BJSVMlZ1.js";import"./katex.min-BSBacQyE.js";import"./papers-DBaPliAp.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-bETtM5yS.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),be=()=>{var T,A,C,I,L,R,H;const[r,_]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[b,k]=m.useState(u),d=J(b,300);m.useEffect(()=>k(u),[u]),m.useEffect(()=>{if(d===u)return;const s=new URLSearchParams(r);d?s.set("search",d):s.delete("search"),_(s,{replace:!0})},[d]);const j=r.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const l=new URLSearchParams(r);i?l.set(s,i):l.delete(s),_(l)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:d||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>U.topTasks(8),enabled:!n,staleTime:10*60*1e3}),v=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(l=>l.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((C=(A=(T=t.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?(a==null?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(G,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:s=>k(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[K(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,i)=>e.jsx(Q,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{be as default};
 
1
+ import{a as q,r as m,A as z,j as e,L as x}from"./index-D_-UZEuL.js";import{I as E,T as G,P as Q}from"./components-CmC5jqhM.js";import{c as U}from"./catalog-CjU2vAfw.js";import{t as W,d as K}from"./transform-CUuA-koJ.js";import{u as V}from"./usePapers-BCHtBW8G.js";import{u as J}from"./useDebounce-iJszRYwl.js";import{P as X}from"./usePeriodFilter-fHKAAcyd.js";import{u as Y,P as Z}from"./useIntersectionObserver-Cq9n7uOQ.js";import{S as p}from"./skeleton-CCZ1iXls.js";import{A as ee,a as se}from"./alert-B2j1kc2o.js";import{u as ae}from"./useQuery-BZo4MZ3s.js";import"./LatexTitle-B7GPgo8C.js";import"./katex.min-BSBacQyE.js";import"./papers-DHqjKX7p.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-CFUEkcEs.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),be=()=>{var T,A,C,I,L,R,H;const[r,_]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[b,k]=m.useState(u),d=J(b,300);m.useEffect(()=>k(u),[u]),m.useEffect(()=>{if(d===u)return;const s=new URLSearchParams(r);d?s.set("search",d):s.delete("search"),_(s,{replace:!0})},[d]);const j=r.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const l=new URLSearchParams(r);i?l.set(s,i):l.delete(s),_(l)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:d||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>U.topTasks(8),enabled:!n,staleTime:10*60*1e3}),v=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(l=>l.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((C=(A=(T=t.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?(a==null?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(G,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:s=>k(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[K(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,i)=>e.jsx(Q,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{be as default};
assets/{PrivacyView-CcXQdpRo.js → PrivacyView-BKFNJZvc.js} RENAMED
@@ -1 +1 @@
1
- import{R as s,j as e}from"./index-BrhBTT14.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 100 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default};
 
1
+ import{z as s,j as e}from"./index-D_-UZEuL.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 100 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default};
assets/{RateLimitsView-BcVoE98a.js → RateLimitsView-DckIJRFx.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,E as t}from"./index-BrhBTT14.js";import{u as s}from"./useQuery-GhY2LXSI.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default};
 
1
+ import{j as e,B as t}from"./index-D_-UZEuL.js";import{u as s}from"./useQuery-BZo4MZ3s.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default};
assets/{SavedPapersView-DhFWb_wi.js → SavedPapersView-Czyc5GTN.js} RENAMED
@@ -1 +1 @@
1
- import{f as h,A as g,j as e,Y as v,L as x,E as j}from"./index-BrhBTT14.js";import{u as f}from"./useQuery-GhY2LXSI.js";import{T as N,P as b}from"./components-74u_bIKK.js";import{S as r}from"./skeleton-DHdzoBmM.js";import{A as k,a as y}from"./alert-c1n3ZtEC.js";import{t as w}from"./transform-Duf4Shfn.js";import{s as A}from"./savedPapersAuth-D0oFR2zr.js";import"./LatexTitle-BJSVMlZ1.js";import"./katex.min-BSBacQyE.js";import"./papers-DBaPliAp.js";import"./safeExternalHref-CkBrsh84.js";const z=()=>{var d,o;const{user:t,isLoading:u}=h(),a=f({queryKey:["my-bookmarks"],queryFn:()=>j.getBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(N,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(b,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{z as default};
 
1
+ import{y as h,A as g,j as e,S as v,L as x,B as j}from"./index-D_-UZEuL.js";import{u as N}from"./useQuery-BZo4MZ3s.js";import{T as b,P as f}from"./components-CmC5jqhM.js";import{S as r}from"./skeleton-CCZ1iXls.js";import{A as k,a as y}from"./alert-B2j1kc2o.js";import{t as w}from"./transform-CUuA-koJ.js";import{s as A}from"./savedPapersAuth-CrQIIpSo.js";import"./LatexTitle-B7GPgo8C.js";import"./katex.min-BSBacQyE.js";import"./papers-DHqjKX7p.js";import"./safeExternalHref-CkBrsh84.js";const z=()=>{var d,o;const{user:t,isLoading:u}=h(),a=N({queryKey:["my-bookmarks"],queryFn:()=>j.getBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{z as default};
assets/{SearchOverlay-BRKHPZ6C.js → SearchOverlay-C4cuTRdQ.js} RENAMED
@@ -1 +1 @@
1
- import{r as C,u as K,R as T,i as L,j as s}from"./index-BrhBTT14.js";import{u as m}from"./useQuery-GhY2LXSI.js";import{L as $}from"./LatexTitle-BJSVMlZ1.js";import{c as j}from"./catalog-CkpmYxEk.js";import{p as D}from"./papers-DBaPliAp.js";import{u as z}from"./useDebounce-DzNGzmqr.js";import{c as M,h as B,d as I}from"./transform-Duf4Shfn.js";import"./katex.min-BSBacQyE.js";const X=10,Y=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=K(),[c,R]=T.useState(""),[h,p]=T.useState(1),a=z(c,200),g=L();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=A=>{A.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=m({queryKey:["search-papers",a,h],queryFn:()=>D.search(a,h,X),enabled:n&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=m({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({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)||[],x=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||x.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),p(1)},onKeyDown:e=>{g&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[g&&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.",g&&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=M(B(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:I(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))]}),x.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),x.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($,{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 p(((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&&p(t.data.next_page)},children:"Next"})]})]})]})]})})};export{Y as default};
 
1
+ import{r as C,u as K,z as T,i as L,j as s}from"./index-D_-UZEuL.js";import{u as m}from"./useQuery-BZo4MZ3s.js";import{L as $}from"./LatexTitle-B7GPgo8C.js";import{c as j}from"./catalog-CjU2vAfw.js";import{p as z}from"./papers-DHqjKX7p.js";import{u as D}from"./useDebounce-iJszRYwl.js";import{c as M,h as B,d as I}from"./transform-CUuA-koJ.js";import"./katex.min-BSBacQyE.js";const X=10,Y=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=K(),[c,R]=T.useState(""),[h,p]=T.useState(1),a=D(c,200),g=L();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=A=>{A.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=m({queryKey:["search-papers",a,h],queryFn:()=>z.search(a,h,X),enabled:n&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=m({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({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)||[],x=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||x.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),p(1)},onKeyDown:e=>{g&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[g&&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.",g&&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=M(B(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:I(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))]}),x.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),x.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($,{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 p(((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&&p(t.data.next_page)},children:"Next"})]})]})]})]})})};export{Y as default};
assets/{SettingsView-BGS_66Ni.js → SettingsView-CbC3PqlO.js} RENAMED
@@ -1,9 +1,9 @@
1
- import{c as j,f as Y,l as q,ad as F,i as U,R as u,g as $,j as e,Y as x,A as O}from"./index-BrhBTT14.js";import{u as y}from"./useMutation-DqfuSW7Q.js";import{S as _}from"./switch-DpBsrlqh.js";import{c as v}from"./chat-Ck3hlrgT.js";import{f as Q,D as W}from"./latexPlainText-DI8YEXVe.js";import{u as B,a as H,r as K,b}from"./openrouter-DzllS15k.js";import{E as L}from"./external-link-uK7nAEgd.js";import"./index-WJQaPd7m.js";import"./useQuery-GhY2LXSI.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 z=j("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
7
  * @license lucide-react v0.462.0 - ISC
8
  *
9
  * This source code is licensed under the ISC license.
@@ -13,4 +13,4 @@ import{c as j,f as Y,l as q,ad as F,i as U,R as u,g as $,j as e,Y as x,A as O}fr
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 G=j("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),X="https://openrouter.ai/settings/keys";function Z(t,o){if(t instanceof O){if(typeof t.detail=="string")return t.detail;if(typeof t.detail=="object"&&t.detail!==null&&"message"in t.detail&&typeof t.detail.message=="string")return t.detail.message}return t instanceof Error&&!t.message.startsWith("API request failed:")?t.message:o}const le=()=>{const{user:t,isLoading:o}=Y(),{preferences:S,setHideClosedSourceEvals:P,canPersist:M}=q(),{theme:A,setTheme:T}=F(),I=A??"system",r=U(),[f,l]=u.useState(""),[k,c]=u.useState(""),[d,N]=u.useState(""),h=$(),R=B(r&&!!t),D=H(r&&!!t),n=R.data,i=D.data,a=n?K(n.resets_at):null,m=(s,g)=>{l(Z(s,g)),c(s instanceof O?s.code??"":"")},p=y({mutationFn:s=>v.connectOpenRouterCredential(s),onSuccess:s=>{h.setQueryData(b,s),N(""),l(""),c("")},onError:s=>m(s,"Could not connect the OpenRouter key.")}),w=y({mutationFn:s=>v.setOpenRouterFallback(s),onSuccess:s=>{h.setQueryData(b,s),l(""),c("")},onError:s=>m(s,"Could not change paid fallback.")}),C=y({mutationFn:()=>v.disconnectOpenRouterCredential(),onSuccess:()=>{h.setQueryData(b,{connected:!1,verified_at:null,fallback_enabled:!1}),l(""),c("")},onError:s=>m(s,"Could not disconnect the OpenRouter key.")});return u.useEffect(()=>(document.title=Q("Settings"),()=>{document.title=W}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:t.role??"community member"}),"."," ",t.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",t.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),o&&!t?e.jsx("div",{className:"settings-billing-loading",role:"status","aria-live":"polite",children:"Checking account…"}):t?e.jsx("div",{className:"settings-provider-grid",children:e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(i==null?void 0:i.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),n?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",a==null?void 0:a.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",a==null?void 0:a.utc,")"]})]})]}),e.jsx("strong",{children:n.available?`${n.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${n.remaining_percent}% remaining; resets ${a==null?void 0:a.local}; ${a==null?void 0:a.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n.remaining_percent,children:e.jsx("span",{style:{width:`${n.remaining_percent}%`}})}),!n.available&&e.jsxs("p",{className:"settings-limit-note",children:[n.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${n.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:R.isError||n?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),i!=null&&i.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",i.verified_at?` · Last verified ${new Date(i.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(_,{checked:i.fallback_enabled,disabled:w.isPending,onCheckedChange:s=>w.mutate(!!s)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:C.isPending,onClick:()=>C.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:X,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(L,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),d.trim()&&p.mutate(d.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:d,onChange:s=>N(s.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!d.trim()||p.isPending,children:p.isPending?"Verifying…":"Connect key"})})]}),f&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:k==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":f}),k==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(x,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]})}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to use the Papers With Code-funded OpenRouter allowance for research chat."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 100 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:z},{value:"light",label:"Light",description:"Always use light mode",icon:G},{value:"dark",label:"Dark",description:"Always use dark mode",icon:V}].map(s=>{const g=s.icon,E=I===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${E?"is-selected":""}`,"aria-pressed":E,onClick:()=>T(s.value),children:[e.jsx(g,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(_,{id:"hide-closed-source-evals",checked:S.hide_closed_source_evals,onCheckedChange:s=>{P(!!s)}})]}),!o&&!M&&!t&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]})]})};export{le as default};
 
1
+ import{d as j,y as q,f as F,ai as Y,i as U,z as u,g as $,j as e,S as x,A as O}from"./index-D_-UZEuL.js";import{u as y}from"./useMutation-P0Dg96Vh.js";import{S as _}from"./switch-giaX-T5P.js";import{c as v}from"./chat-7zW8PrrA.js";import{f as Q,D as W}from"./latexPlainText-DI8YEXVe.js";import{u as B,a as H,r as K,b}from"./openrouter-DNgcWuY9.js";import{E as z}from"./external-link-Dm5dHWqK.js";import"./index-DlwDDz8H.js";import"./useQuery-BZo4MZ3s.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 L=j("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
7
  * @license lucide-react v0.462.0 - ISC
8
  *
9
  * This source code is licensed under the ISC license.
 
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 G=j("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),X="https://openrouter.ai/settings/keys";function Z(t,o){if(t instanceof O){if(typeof t.detail=="string")return t.detail;if(typeof t.detail=="object"&&t.detail!==null&&"message"in t.detail&&typeof t.detail.message=="string")return t.detail.message}return t instanceof Error&&!t.message.startsWith("API request failed:")?t.message:o}const le=()=>{const{user:t,isLoading:o}=q(),{preferences:S,setHideClosedSourceEvals:P,canPersist:M}=F(),{theme:A,setTheme:T}=Y(),I=A??"system",r=U(),[f,l]=u.useState(""),[k,c]=u.useState(""),[d,N]=u.useState(""),h=$(),R=B(r&&!!t),D=H(r&&!!t),n=R.data,i=D.data,a=n?K(n.resets_at):null,m=(s,g)=>{l(Z(s,g)),c(s instanceof O?s.code??"":"")},p=y({mutationFn:s=>v.connectOpenRouterCredential(s),onSuccess:s=>{h.setQueryData(b,s),N(""),l(""),c("")},onError:s=>m(s,"Could not connect the OpenRouter key.")}),w=y({mutationFn:s=>v.setOpenRouterFallback(s),onSuccess:s=>{h.setQueryData(b,s),l(""),c("")},onError:s=>m(s,"Could not change paid fallback.")}),C=y({mutationFn:()=>v.disconnectOpenRouterCredential(),onSuccess:()=>{h.setQueryData(b,{connected:!1,verified_at:null,fallback_enabled:!1}),l(""),c("")},onError:s=>m(s,"Could not disconnect the OpenRouter key.")});return u.useEffect(()=>(document.title=Q("Settings"),()=>{document.title=W}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:t.role??"community member"}),"."," ",t.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",t.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),o&&!t?e.jsx("div",{className:"settings-billing-loading",role:"status","aria-live":"polite",children:"Checking account…"}):t?e.jsx("div",{className:"settings-provider-grid",children:e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(i==null?void 0:i.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),n?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",a==null?void 0:a.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",a==null?void 0:a.utc,")"]})]})]}),e.jsx("strong",{children:n.available?`${n.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${n.remaining_percent}% remaining; resets ${a==null?void 0:a.local}; ${a==null?void 0:a.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n.remaining_percent,children:e.jsx("span",{style:{width:`${n.remaining_percent}%`}})}),!n.available&&e.jsxs("p",{className:"settings-limit-note",children:[n.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${n.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:R.isError||n?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),i!=null&&i.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",i.verified_at?` · Last verified ${new Date(i.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(_,{checked:i.fallback_enabled,disabled:w.isPending,onCheckedChange:s=>w.mutate(!!s)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:C.isPending,onClick:()=>C.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:X,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(z,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),d.trim()&&p.mutate(d.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:d,onChange:s=>N(s.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!d.trim()||p.isPending,children:p.isPending?"Verifying…":"Connect key"})})]}),f&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:k==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":f}),k==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(x,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]})}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to use the Papers With Code-funded OpenRouter allowance for research chat."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 100 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:L},{value:"light",label:"Light",description:"Always use light mode",icon:G},{value:"dark",label:"Dark",description:"Always use dark mode",icon:V}].map(s=>{const g=s.icon,E=I===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${E?"is-selected":""}`,"aria-pressed":E,onClick:()=>T(s.value),children:[e.jsx(g,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(_,{id:"hide-closed-source-evals",checked:S.hide_closed_source_evals,onCheckedChange:s=>{P(!!s)}})]}),!o&&!M&&!t&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]})]})};export{le as default};
assets/{SharedChatView-CZGxCKbv.js → SharedChatView-gssSniE9.js} RENAMED
@@ -1 +1 @@
1
- import{e as x,u as f,r as u,j as e,b as g}from"./index-BrhBTT14.js";import{u as j}from"./useQuery-GhY2LXSI.js";import{C as v,U as b,A as y}from"./ChatMessage-CKuWDpNc.js";import{z as p,f as S,B as N,q as k,E as w}from"./chatSessions-Dx6Tu-Jq.js";import"./katex.min-BSBacQyE.js";import"./hover-card-BcKGA4Et.js";import"./github-BtTCuUR0.js";import"./github-XgFsJJRC.js";import"./PaperPreviewLink-BCdZ9yj3.js";import"./index-BLqBUiom.js";import"./papers-DBaPliAp.js";import"./chat-Ck3hlrgT.js";import"./file-text-DROKoLCd.js";import"./chevron-down-CKySK_lE.js";const C=({detail:c})=>{const[i,h]=u.useState(()=>N(c)),s=u.useMemo(()=>{const r={};for(const a of i)for(const t of a.blocks??[])if(t.kind==="tool")for(const n of t.results??[])r[n.route_id]=n;return r},[i]),l=(r,a)=>{h(t=>t.map(n=>{var o;return n.id!==r?n:{...n,blocks:(o=n.blocks)==null?void 0:o.map((d,m)=>m===a&&(d.kind==="reasoning"||d.kind==="tool")?{...d,open:!d.open}:d)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(r=>r.role==="user"?e.jsx(b,{id:r.id,text:r.text??"",paperMentions:r.paperMentions??[]},r.id):e.jsx(y,{msg:r,papers:s,onToggleBlock:l},r.id))})},G=()=>{const{shareId:c=""}=x(),i=f(),h=g(),s=j({queryKey:["shared-chat",c],queryFn:()=>w(c),retry:(a,t)=>!(t instanceof p&&t.status===404)&&a<1});u.useEffect(()=>{const a=document.title,t=document.head.querySelector('meta[name="robots"]'),n=t==null?void 0:t.content,o=t??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",t||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=a,t?t.content=n??"":o.remove()}},[]);const l=a=>{k(a,void 0,{autoSend:!1}),i("/chat")},r=s.error instanceof p&&s.error.status===404;return s.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):r?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."})]}):s.isError||!s.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 s.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(C,{detail:s.data},s.data.updated_at),s.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",s.data.model_label]}),s.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),s.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai/",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]})]}),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."]}),e.jsx(v,{onSend:a=>l(a.text),placeholder:"Ask a new research question…"})]})]})]})};export{G as default};
 
1
+ import{c as x,u as f,r as u,j as e,b as g}from"./index-D_-UZEuL.js";import{u as j}from"./useQuery-BZo4MZ3s.js";import{C as v,U as b,A as y}from"./ChatMessage-DwVcq3Ve.js";import{C as p,d as S,p as N,q as k,g as C}from"./chatSessions-CPPX7pkh.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DiJQFgx9.js";import"./github-DQuIliTJ.js";import"./github-iFSl-B6V.js";import"./PaperPreviewLink-B25cD-_k.js";import"./index-vCOH2DKd.js";import"./papers-DHqjKX7p.js";import"./chat-7zW8PrrA.js";import"./file-text--vrXMvWb.js";import"./chevron-down-DI19XsBw.js";const w=({detail:c})=>{const[i,h]=u.useState(()=>N(c)),s=u.useMemo(()=>{const r={};for(const a of i)for(const t of a.blocks??[])if(t.kind==="tool")for(const n of t.results??[])r[n.route_id]=n;return r},[i]),l=(r,a)=>{h(t=>t.map(n=>{var o;return n.id!==r?n:{...n,blocks:(o=n.blocks)==null?void 0:o.map((d,m)=>m===a&&(d.kind==="reasoning"||d.kind==="tool")?{...d,open:!d.open}:d)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(r=>r.role==="user"?e.jsx(b,{id:r.id,text:r.text??"",paperMentions:r.paperMentions??[]},r.id):e.jsx(y,{msg:r,papers:s,onToggleBlock:l},r.id))})},H=()=>{const{shareId:c=""}=x(),i=f(),h=g(),s=j({queryKey:["shared-chat",c],queryFn:()=>C(c),retry:(a,t)=>!(t instanceof p&&t.status===404)&&a<1});u.useEffect(()=>{const a=document.title,t=document.head.querySelector('meta[name="robots"]'),n=t==null?void 0:t.content,o=t??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",t||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=a,t?t.content=n??"":o.remove()}},[]);const l=a=>{k(a,void 0,{autoSend:!1}),i("/chat")},r=s.error instanceof p&&s.error.status===404;return s.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):r?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."})]}):s.isError||!s.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 s.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(w,{detail:s.data},s.data.updated_at),s.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",s.data.model_label]}),s.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),s.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai/",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]})]}),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."]}),e.jsx(v,{onSend:a=>l(a.text),placeholder:"Ask a new research question…"})]})]})]})};export{H as default};
assets/{SignInToEditDialog-Dcu4wTOX.js → SignInToEditDialog-DZLQNGaN.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as ne,r as a,j as e,V as ve,v as be,W as fe,d as je,X as ye,C as Ne,Y as we}from"./index-BrhBTT14.js";import{B as L}from"./button-CusGeqPB.js";import{I as d,T as Ie}from"./textarea-D6mDqvzM.js";import{D as oe,a as le,b as ce,c as de,d as me,e as Se}from"./dialog-BhRZv4T5.js";import{u as _e}from"./useMutation-DqfuSW7Q.js";import{s as v,p as b}from"./submissions-C1hG3qlt.js";import{L as De}from"./loader-circle-BqZ1qbXL.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{c as ne,r as a,j as e,V as ve,v as be,W as fe,d as je,X as ye,C as Ne,Y a
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 Ye=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Ee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=Ee.reduce((n,o)=>{const l=ve(`Primitive.${o}`),s=a.forwardRef((i,f)=>{const{asChild:g,...j}=i,p=g?l:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...j,ref:f})});return s.displayName=`Primitive.${o}`,{...n,[o]:s}},{}),Pe="Label",ue=a.forwardRef((n,o)=>e.jsx(ke.label,{...n,ref:o,onMouseDown:l=>{var i;l.target.closest("button, input, select, textarea")||((i=n.onMouseDown)==null||i.call(n,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));ue.displayName=Pe;var ge=ue;const Me=fe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),m=a.forwardRef(({className:n,...o},l)=>e.jsx(ge,{ref:l,className:be(Me(),n),...o}));m.displayName=ge.displayName;const Le=200,Ae=2e3,Fe=300,Re=500,re=1e3,Be=2*1024*1024,ie=["image/jpeg","image/png","image/webp","image/gif"],Te={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Ge={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function ze({open:n,onOpenChange:o,paperId:l,kind:s}){const[i,f]=a.useState(""),[g,j]=a.useState(""),[p,A]=a.useState(""),[F,R]=a.useState(""),[B,T]=a.useState(""),[G,H]=a.useState(""),[w,U]=a.useState(""),[x,I]=a.useState(null),[S,V]=a.useState(""),[_,X]=a.useState(""),[$,O]=a.useState(""),[D,K]=a.useState(""),[C,Y]=a.useState(""),[E,z]=a.useState(""),[k,J]=a.useState(""),[P,W]=a.useState(""),[q,Q]=a.useState("higher_is_better"),[Z,h]=a.useState(""),y=a.useRef(null),{toast:ee}=je(),N=s,he=s==="task"||s==="method";a.useEffect(()=>{n||(f(""),j(""),A(""),R(""),T(""),H(""),U(""),I(null),V(""),X(""),O(""),K(""),Y(""),z(""),J(""),W(""),Q("higher_is_better"),h(""))},[n]);const te=t=>{if(!t)return;if(h(""),!ie.includes(t.type)){h("Choose a JPEG, PNG, WebP, or GIF image.");return}if(t.size>Be){h("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){h("Could not read that image.");return}I({file_name:t.name,mime_type:t.type,data_url:r.result})},r.onerror=()=>h("Could not read that image."),r.readAsDataURL(t)},pe=t=>{t.preventDefault(),te(t.dataTransfer.files[0])},M=_e({mutationFn:async()=>{const t=l?parseInt(l):null,r=g.trim()||void 0;switch(s){case"task":return v.submit(b(t,"new_task",{name:i.trim(),description:r,image:x??void 0,image_credit:S.trim()||void 0,keywords:$.trim()||void 0,parent_id:D?Number(D):void 0,area_id:C?Number(C):void 0}));case"method":return v.submit(b(t,"new_method",{name:i.trim(),description:r,image:x??void 0,image_credit:S.trim()||void 0,source_url:_.trim()||void 0}));case"benchmark":return v.submit(b(t,"new_benchmark",{name:i.trim(),description:g.trim(),task_ids:E.split(",").map(u=>Number(u.trim())).filter(u=>Number.isInteger(u)&&u>0)}));case"metric":return v.submit(b(t,"new_metric",{name:i.trim(),description:g.trim(),direction:q==="lower_is_better"?"lower_is_better":"higher_is_better",task_id:Number(k),dataset_id:Number(P)}));case"conference":return v.submit(b(t,"new_conference",{name:i.trim(),description:r,year:Number(p),start_date:F||void 0,end_date:B||void 0,venue:G.trim()||void 0,url:w.trim()}))}},onSuccess:()=>{ee({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${N} shortly.`}),o(!1)},onError:t=>{var se,ae;const r=t;let u=r.message||`Failed to submit your ${N} suggestion.`;if(r.response)try{const c=JSON.parse(r.response);typeof(c==null?void 0:c.detail)=="string"?u=c.detail:(se=c==null?void 0:c.detail)!=null&&se.message?u=`${c.detail.message} See ${c.detail.help||"/rate-limits"} for help.`:Array.isArray(c==null?void 0:c.detail)&&((ae=c.detail[0])!=null&&ae.msg)&&(u=c.detail[0].msg)}catch{u=r.response}ee({title:"Could not submit suggestion",description:u,variant:"destructive"})}}),xe=i.trim().length>0&&(s==="task"||s==="method"&&!!_.trim()||s==="conference"&&!!p&&!!w.trim()||s==="benchmark"&&!!E.trim()&&!!g.trim()||s==="metric"&&!!k&&!!P&&!!g.trim());return e.jsx(oe,{open:n,onOpenChange:o,children:e.jsxs(le,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(ce,{children:[e.jsxs(de,{children:["Suggest a new ",N]}),e.jsxs(me,{children:["Propose a ",N," that isn't in the list yet. An admin will review your suggestion before it's added."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-name",children:"Name"}),e.jsx(d,{id:"suggest-name",value:i,maxLength:Le,placeholder:Te[s],onChange:t=>f(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(m,{htmlFor:"suggest-description",children:["Description",s==="task"||s==="method"||s==="conference"?" (optional)":""]}),e.jsx(Ie,{id:"suggest-description",value:g,maxLength:Ae,placeholder:Ge[s],onChange:t=>j(t.target.value)})]}),s==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(d,{id:"suggest-keywords",value:$,onChange:t=>O(t.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{type:"number",min:"1",value:D,onChange:t=>K(t.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(d,{type:"number",min:"1",value:C,onChange:t=>Y(t.target.value),placeholder:"Area ID (optional)"})]})]}),s==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-task-ids",children:"Intended task IDs"}),e.jsx(d,{id:"suggest-task-ids",value:E,onChange:t=>z(t.target.value),placeholder:"e.g. 9, 14"})]}),s==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(m,{children:"Intended leaderboard"}),e.jsxs("select",{className:"w-full rounded-md border bg-background p-2",value:q,onChange:t=>Q(t.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{type:"number",min:"1",value:k,onChange:t=>J(t.target.value),placeholder:"Task ID"}),e.jsx(d,{type:"number",min:"1",value:P,onChange:t=>W(t.target.value),placeholder:"Benchmark ID"})]})]}),he&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{children:"Image (optional)"}),e.jsx("input",{ref:y,className:"sr-only",type:"file",accept:ie.join(","),onChange:t=>{var r;return te((r=t.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(L,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{I(null),y.current&&(y.current.value="")},children:[e.jsx(ye,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var t;return(t=y.current)==null?void 0:t.click()},onDragOver:t=>t.preventDefault(),onDrop:pe,children:[e.jsx(Ce,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),Z&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:Z})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(d,{id:"suggest-image-source",value:S,maxLength:re,placeholder:"Creator, publication, or source URL",onChange:t=>V(t.target.value)})]}),s==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(d,{id:"suggest-method-source",value:_,maxLength:re,placeholder:"https://arxiv.org/abs/...",onChange:t=>X(t.target.value)})]})]}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(d,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:p,placeholder:"2026",onChange:t=>A(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(m,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(d,{id:"suggest-start-date",type:"date",value:F,onChange:t=>R(t.target.value)})]}),e.jsxs("div",{children:[e.jsx(m,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(d,{id:"suggest-end-date",type:"date",value:B,onChange:t=>T(t.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(d,{id:"suggest-venue",value:G,maxLength:Fe,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:t=>H(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(d,{id:"suggest-url",type:"url",inputMode:"url",value:w,maxLength:Re,placeholder:"https://example.org/conference",onChange:t=>U(t.target.value)})]})]})]}),e.jsxs(Se,{children:[e.jsx(L,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(L,{onClick:()=>M.mutate(),disabled:M.isPending||!xe,children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ne,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function Je({open:n,onOpenChange:o,sectionLabel:l,returnTo:s,taxonomySuggestion:i=!1}){return e.jsx(oe,{open:n,onOpenChange:o,children:e.jsxs(le,{className:"max-w-md",children:[e.jsxs(ce,{children:[e.jsxs(de,{children:["Sign in to ",i?"suggest":"edit"," ",l]}),e.jsx(me,{children:i?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(we,{returnTo:s})})]})})}export{m as L,Ye as P,ze as S,Je as a};
 
1
+ import{d as ne,r as a,j as e,a1 as ve,q as be,a2 as fe,e as je,X as ye,C as Ne,S as we}from"./index-D_-UZEuL.js";import{B as L}from"./button-Cc8PFtC1.js";import{I as d,T as Se}from"./textarea-DlQmtN_E.js";import{D as oe,a as le,b as ce,c as de,d as me,e as Ie}from"./dialog-ChaQ5z93.js";import{u as _e}from"./useMutation-P0Dg96Vh.js";import{s as v,p as b}from"./submissions-BpzsA2lc.js";import{L as De}from"./loader-circle-D1SscQUT.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
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 ze=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Ee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=Ee.reduce((n,o)=>{const l=ve(`Primitive.${o}`),s=a.forwardRef((i,f)=>{const{asChild:g,...j}=i,p=g?l:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...j,ref:f})});return s.displayName=`Primitive.${o}`,{...n,[o]:s}},{}),Pe="Label",ue=a.forwardRef((n,o)=>e.jsx(ke.label,{...n,ref:o,onMouseDown:l=>{var i;l.target.closest("button, input, select, textarea")||((i=n.onMouseDown)==null||i.call(n,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));ue.displayName=Pe;var ge=ue;const Me=fe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),m=a.forwardRef(({className:n,...o},l)=>e.jsx(ge,{ref:l,className:be(Me(),n),...o}));m.displayName=ge.displayName;const Le=200,Ae=2e3,Fe=300,Re=500,re=1e3,Be=2*1024*1024,ie=["image/jpeg","image/png","image/webp","image/gif"],Te={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Ge={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function Je({open:n,onOpenChange:o,paperId:l,kind:s}){const[i,f]=a.useState(""),[g,j]=a.useState(""),[p,A]=a.useState(""),[F,R]=a.useState(""),[B,T]=a.useState(""),[G,H]=a.useState(""),[w,U]=a.useState(""),[x,S]=a.useState(null),[I,V]=a.useState(""),[_,X]=a.useState(""),[$,O]=a.useState(""),[D,K]=a.useState(""),[C,z]=a.useState(""),[E,J]=a.useState(""),[k,Y]=a.useState(""),[P,W]=a.useState(""),[q,Q]=a.useState("higher_is_better"),[Z,h]=a.useState(""),y=a.useRef(null),{toast:ee}=je(),N=s,he=s==="task"||s==="method";a.useEffect(()=>{n||(f(""),j(""),A(""),R(""),T(""),H(""),U(""),S(null),V(""),X(""),O(""),K(""),z(""),J(""),Y(""),W(""),Q("higher_is_better"),h(""))},[n]);const te=t=>{if(!t)return;if(h(""),!ie.includes(t.type)){h("Choose a JPEG, PNG, WebP, or GIF image.");return}if(t.size>Be){h("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){h("Could not read that image.");return}S({file_name:t.name,mime_type:t.type,data_url:r.result})},r.onerror=()=>h("Could not read that image."),r.readAsDataURL(t)},pe=t=>{t.preventDefault(),te(t.dataTransfer.files[0])},M=_e({mutationFn:async()=>{const t=l?parseInt(l):null,r=g.trim()||void 0;switch(s){case"task":return v.submit(b(t,"new_task",{name:i.trim(),description:r,image:x??void 0,image_credit:I.trim()||void 0,keywords:$.trim()||void 0,parent_id:D?Number(D):void 0,area_id:C?Number(C):void 0}));case"method":return v.submit(b(t,"new_method",{name:i.trim(),description:r,image:x??void 0,image_credit:I.trim()||void 0,source_url:_.trim()||void 0}));case"benchmark":return v.submit(b(t,"new_benchmark",{name:i.trim(),description:g.trim(),task_ids:E.split(",").map(u=>Number(u.trim())).filter(u=>Number.isInteger(u)&&u>0)}));case"metric":return v.submit(b(t,"new_metric",{name:i.trim(),description:g.trim(),direction:q==="lower_is_better"?"lower_is_better":"higher_is_better",task_id:Number(k),dataset_id:Number(P)}));case"conference":return v.submit(b(t,"new_conference",{name:i.trim(),description:r,year:Number(p),start_date:F||void 0,end_date:B||void 0,venue:G.trim()||void 0,url:w.trim()}))}},onSuccess:()=>{ee({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${N} shortly.`}),o(!1)},onError:t=>{var se,ae;const r=t;let u=r.message||`Failed to submit your ${N} suggestion.`;if(r.response)try{const c=JSON.parse(r.response);typeof(c==null?void 0:c.detail)=="string"?u=c.detail:(se=c==null?void 0:c.detail)!=null&&se.message?u=`${c.detail.message} See ${c.detail.help||"/rate-limits"} for help.`:Array.isArray(c==null?void 0:c.detail)&&((ae=c.detail[0])!=null&&ae.msg)&&(u=c.detail[0].msg)}catch{u=r.response}ee({title:"Could not submit suggestion",description:u,variant:"destructive"})}}),xe=i.trim().length>0&&(s==="task"||s==="method"&&!!_.trim()||s==="conference"&&!!p&&!!w.trim()||s==="benchmark"&&!!E.trim()&&!!g.trim()||s==="metric"&&!!k&&!!P&&!!g.trim());return e.jsx(oe,{open:n,onOpenChange:o,children:e.jsxs(le,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(ce,{children:[e.jsxs(de,{children:["Suggest a new ",N]}),e.jsxs(me,{children:["Propose a ",N," that isn't in the list yet. An admin will review your suggestion before it's added."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-name",children:"Name"}),e.jsx(d,{id:"suggest-name",value:i,maxLength:Le,placeholder:Te[s],onChange:t=>f(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(m,{htmlFor:"suggest-description",children:["Description",s==="task"||s==="method"||s==="conference"?" (optional)":""]}),e.jsx(Se,{id:"suggest-description",value:g,maxLength:Ae,placeholder:Ge[s],onChange:t=>j(t.target.value)})]}),s==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(d,{id:"suggest-keywords",value:$,onChange:t=>O(t.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{type:"number",min:"1",value:D,onChange:t=>K(t.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(d,{type:"number",min:"1",value:C,onChange:t=>z(t.target.value),placeholder:"Area ID (optional)"})]})]}),s==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-task-ids",children:"Intended task IDs"}),e.jsx(d,{id:"suggest-task-ids",value:E,onChange:t=>J(t.target.value),placeholder:"e.g. 9, 14"})]}),s==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(m,{children:"Intended leaderboard"}),e.jsxs("select",{className:"w-full rounded-md border bg-background p-2",value:q,onChange:t=>Q(t.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{type:"number",min:"1",value:k,onChange:t=>Y(t.target.value),placeholder:"Task ID"}),e.jsx(d,{type:"number",min:"1",value:P,onChange:t=>W(t.target.value),placeholder:"Benchmark ID"})]})]}),he&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{children:"Image (optional)"}),e.jsx("input",{ref:y,className:"sr-only",type:"file",accept:ie.join(","),onChange:t=>{var r;return te((r=t.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(L,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{S(null),y.current&&(y.current.value="")},children:[e.jsx(ye,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var t;return(t=y.current)==null?void 0:t.click()},onDragOver:t=>t.preventDefault(),onDrop:pe,children:[e.jsx(Ce,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),Z&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:Z})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(d,{id:"suggest-image-source",value:I,maxLength:re,placeholder:"Creator, publication, or source URL",onChange:t=>V(t.target.value)})]}),s==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(d,{id:"suggest-method-source",value:_,maxLength:re,placeholder:"https://arxiv.org/abs/...",onChange:t=>X(t.target.value)})]})]}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(d,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:p,placeholder:"2026",onChange:t=>A(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(m,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(d,{id:"suggest-start-date",type:"date",value:F,onChange:t=>R(t.target.value)})]}),e.jsxs("div",{children:[e.jsx(m,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(d,{id:"suggest-end-date",type:"date",value:B,onChange:t=>T(t.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(d,{id:"suggest-venue",value:G,maxLength:Fe,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:t=>H(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(d,{id:"suggest-url",type:"url",inputMode:"url",value:w,maxLength:Re,placeholder:"https://example.org/conference",onChange:t=>U(t.target.value)})]})]})]}),e.jsxs(Ie,{children:[e.jsx(L,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(L,{onClick:()=>M.mutate(),disabled:M.isPending||!xe,children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ne,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function Ye({open:n,onOpenChange:o,sectionLabel:l,returnTo:s,taxonomySuggestion:i=!1}){return e.jsx(oe,{open:n,onOpenChange:o,children:e.jsxs(le,{className:"max-w-md",children:[e.jsxs(ce,{children:[e.jsxs(de,{children:["Sign in to ",i?"suggest":"edit"," ",l]}),e.jsx(me,{children:i?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(we,{returnTo:s})})]})})}export{m as L,ze as P,Je as S,Ye as a};
assets/{StagingAccessRequestView-CAvxF8g0.js → StagingAccessRequestView-BS5zzPgR.js} RENAMED
@@ -1 +1 @@
1
- import{f as m,R as a,j as e,Y as g,aF as p}from"./index-BrhBTT14.js";import{C as j}from"./circle-check-DVQOUjVS.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default};
 
1
+ import{y as m,z as a,j as e,S as g,aK as p}from"./index-D_-UZEuL.js";import{C as j}from"./circle-check-BpugpgkG.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default};
assets/{SubmissionsDashboard-Fm_NO7Rs.js → SubmissionsDashboard-DxR4REQK.js} RENAMED
@@ -1,6 +1,6 @@
1
- var be=s=>{throw TypeError(s)};var ee=(s,t,i)=>t.has(s)||be("Cannot "+i);var f=(s,t,i)=>(ee(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(ee(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),R=(s,t,i)=>(ee(s,t,"access private method"),i);import{ai as Ce,aj as te,ak as Re,al as Oe,g as Ne,r as $,am as Me,c as Ae,j as e,N as Te,R as w,v as q,f as qe,d as ke,an as Fe,ao as Ie,ap as Qe}from"./index-BrhBTT14.js";import{Q as we,b as Le,c as Ue,e as De,d as $e,f as ze,s as xe,g as Be,h as He,u as ie}from"./useQuery-GhY2LXSI.js";import{u as ge}from"./useMutation-DqfuSW7Q.js";import{c as I}from"./catalog-CkpmYxEk.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{p as Je}from"./papers-DBaPliAp.js";import{s as B}from"./submissions-C1hG3qlt.js";import{R as Ke,S as Pe,C as Ge}from"./shield-alert-BkQ9lngS.js";import{L as H}from"./loader-circle-BqZ1qbXL.js";import{C as We}from"./circle-check-DVQOUjVS.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function Ye(s,t,i){const n=s.slice(0);return n[t]=i,n}var L,S,U,Q,E,T,J,K,P,G,N,ne,re,Se,ae,oe,le,_e,Ve=(_e=class extends Ce{constructor(t,i,n){super();C(this,N);C(this,L);C(this,S);C(this,U);C(this,Q);C(this,E);C(this,T);C(this,J);C(this,K);C(this,P);C(this,G,[]);k(this,L,t),k(this,Q,n),k(this,U,[]),k(this,E,[]),k(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,E).forEach(t=>{t.subscribe(i=>{R(this,N,oe).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,E).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,U,t),k(this,Q,i),te.batch(()=>{const n=f(this,E),a=R(this,N,ae).call(this,f(this,U));a.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const l=a.map(r=>r.observer),o=l.map(r=>r.getCurrentResult()),d=n.length!==l.length,p=l.some((r,m)=>r!==n[m]),b=d||p,j=b?!0:o.some((r,m)=>{const c=f(this,S)[m];return!c||!Re(r,c)});!b&&!j||(b&&(k(this,G,a),k(this,E,l)),k(this,S,o),this.hasListeners()&&(b&&(je(n,l).forEach(r=>{r.destroy()}),je(l,n).forEach(r=>{r.subscribe(m=>{R(this,N,oe).call(this,r,m)})})),R(this,N,le).call(this)))})}getCurrentResult(){return f(this,S)}getQueries(){return f(this,E).map(t=>t.getCurrentQuery())}getObservers(){return f(this,E)}getOptimisticResult(t,i){const n=R(this,N,ae).call(this,t),a=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>R(this,N,re).call(this,o??a,i,l),()=>R(this,N,ne).call(this,a,n)]}},L=new WeakMap,S=new WeakMap,U=new WeakMap,Q=new WeakMap,E=new WeakMap,T=new WeakMap,J=new WeakMap,K=new WeakMap,P=new WeakMap,G=new WeakMap,N=new WeakSet,ne=function(t,i){return i.map((n,a)=>{const l=t[a];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},re=function(t,i,n){if(i){const a=f(this,P),l=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((o,d)=>o!==a[d]));return(!f(this,T)||f(this,S)!==f(this,K)||l||i!==f(this,J))&&(k(this,J,i),k(this,K,f(this,S)),n!==void 0&&k(this,P,n),k(this,T,Oe(f(this,T),i(t)))),f(this,T)}return t},Se=function(){var t;return((t=f(this,Q))==null?void 0:t.combine)!==void 0&&f(this,E).some((i,n)=>{var a;return i.options.suspense&&((a=f(this,S)[n])==null?void 0:a.data)===void 0})},ae=function(t){const i=new Map;f(this,E).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const n=[];return t.forEach(a=>{var p;const l=f(this,L).defaultQueryOptions(a),d=((p=i.get(l.queryHash))==null?void 0:p.shift())??new we(f(this,L),l);n.push({defaultedQueryOptions:l,observer:d})}),n},oe=function(t,i){const n=f(this,E).indexOf(t);n!==-1&&(k(this,S,Ye(f(this,S),n,i)),R(this,N,le).call(this))},le=function(){var t;if(this.hasListeners()){const i=R(this,N,ne).call(this,f(this,S),f(this,G)),n=R(this,N,Se).call(this),a=f(this,T),l=n?a:R(this,N,re).call(this,i,(t=f(this,Q))==null?void 0:t.combine);(n||a!==l)&&te.batch(()=>{this.listeners.forEach(o=>{o(f(this,S))})})}},_e);function V({queries:s,...t},i){const n=Ne(),a=Le(),l=Ue(),o=$.useMemo(()=>s.map(u=>{const v=n.defaultQueryOptions(u);return v._optimisticResults=a?"isRestoring":"optimistic",v}),[s,n,a]);o.forEach(u=>{De(u);const v=n.getQueryCache().get(u.queryHash);$e(u,l,v)}),ze(l);const[d]=$.useState(()=>new Ve(n,o,t)),[p,b,j]=d.getOptimisticResult(o,t.combine),r=!a&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(u=>r?d.subscribe(te.batchCalls(u)):Me,[d,r]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=p.some((u,v)=>xe(o[v],u))?p.flatMap((u,v)=>{const g=o[v];if(g&&xe(g,u)){const F=new we(n,g);return Be(g,F,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const h=p.find((u,v)=>{const g=o[v];return g&&He({result:u,errorResetBoundary:l,throwOnError:g.throwOnError,query:n.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(h!=null&&h.error)throw h.error;return b(j())}/**
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 ve=Ae("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);function Xe({currentPayload:s,proposedPayload:t}){const[i,n]=w.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>n(a=>!a),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(ce,{title:"Current payload",value:s??{}}),e.jsx(ce,{title:"Proposed payload",value:t})]})]})}function ce({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function de({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n,knownNames:a}){const l=w.useMemo(()=>Array.from(new Set([...s.map(c=>c.id),...t])).sort((c,h)=>c-h),[s,t]),o=V({queries:n?l.map(c=>({queryKey:[i,String(c)],queryFn:()=>n(String(c)),staleTime:5*60*1e3})):[]}),d=w.useMemo(()=>{const c=new Map;return s.forEach(h=>c.set(h.id,h.name)),a==null||a.forEach((h,u)=>c.set(u,h)),o.forEach(h=>{const u=h.data;if(!u)return;const v=Number(u.id);Number.isFinite(v)&&c.set(v,u.name)}),c},[s,o,a]),p=new Set(s.map(c=>c.id)),b=new Set(t),j=l.filter(c=>p.has(c)&&!b.has(c)),r=l.filter(c=>!p.has(c)&&b.has(c)),m=(c,h)=>{const u=h==="current"&&j.includes(c),v=h==="proposed"&&r.includes(c);return e.jsx("span",{className:q("submission-diff-pill",u&&"removed",v&&"added"),children:d.get(c)??`#${c}`},c)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Currently tagged",children:s.length>0?s.map(c=>m(c.id,"current")):e.jsx(_,{children:"No current tags"})}),e.jsx(y,{title:"Will be tagged",children:t.length>0?t.map(c=>m(c,"proposed")):e.jsx(_,{children:"No proposed tags"})})]})}function Ze({currentItems:s,proposedIds:t}){var l;const i=ie({queryKey:["organizations","submission-diff"],queryFn:()=>I.organizations(),staleTime:3e5}),n=new Map(s.map(o=>[o.id,o.name]));(l=i.data)==null||l.results.forEach(o=>{const d=Number(o.id);Number.isFinite(d)&&n.set(d,o.name)});const a=s.map(o=>({...o,name:n.get(o.id)??o.name}));return e.jsx(de,{currentItems:a,proposedIds:t,queryPrefix:"organization",knownNames:n})}function ue({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(o=>[o.url,o])),a=new Map(i.map(o=>[o.url,o])),l=Array.from(new Set([...n.keys(),...a.keys()])).sort();return l.length===0?e.jsxs(_,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:l.map(o=>{var m;const d=n.get(o),p=a.get(o),b=!d&&p,j=d&&!p,r=d&&p&&d.is_official!==p.is_official;return e.jsx("div",{className:q("submission-url-row",b&&"added",j&&"removed",r&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:D(o)??void 0,target:"_blank",rel:"noopener noreferrer",className:q("submission-url-link",j&&"removed"),children:o}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),j&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),r&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(d.is_official)," ","->"," ",String(p.is_official)]}),((m=p??d)==null?void 0:m.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},o)})})}function es({currentPayload:s,proposedPayload:t}){const i=w.useMemo(()=>(s==null?void 0:s.evaluations)??[],[s]),n=t.operations,a=w.useMemo(()=>{const r=new Set;return i.forEach(m=>{m.task_id&&r.add(Number(m.task_id))}),n.forEach(m=>{const c=m.data;c!=null&&c.task_id&&r.add(Number(c.task_id))}),Array.from(r).filter(m=>Number.isFinite(m))},[i,n]),l=w.useMemo(()=>{const r=new Set;return i.forEach(m=>{m.dataset_id&&r.add(Number(m.dataset_id))}),n.forEach(m=>{const c=m.data;c!=null&&c.dataset_id&&r.add(Number(c.dataset_id))}),Array.from(r).filter(m=>Number.isFinite(m))},[i,n]),o=V({queries:a.map(r=>({queryKey:["task",String(r)],queryFn:()=>I.getTask(String(r)),staleTime:5*60*1e3}))}),d=V({queries:l.map(r=>({queryKey:["dataset",String(r)],queryFn:()=>I.getDataset(String(r)),staleTime:5*60*1e3}))}),p=w.useMemo(()=>{const r=new Map;return o.forEach(m=>{const c=m.data;if(!c)return;const h=Number(c.id);Number.isFinite(h)&&r.set(h,c.name)}),r},[o]),b=w.useMemo(()=>{const r=new Map;return d.forEach(m=>{const c=m.data;if(!c)return;const h=Number(c.id);Number.isFinite(h)&&r.set(h,c.name)}),r},[d]),j=new Map(i.filter(r=>r.id!=null).map(r=>[Number(r.id),r]));return n.length===0?e.jsx(_,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((r,m)=>{const c=r.evaluation_id?j.get(r.evaluation_id):void 0,u=(r.op==="update"?{...c,...r.data}:r.data??c)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:q("submission-pill status",r.op==="create"&&"approved",r.op==="update"&&"changed",r.op==="delete"&&"rejected"),children:r.op??"unknown"}),r.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",r.evaluation_id]})]}),r.op&&["create","update","delete"].includes(r.op)?e.jsx(ss,{evaluation:u,taskNames:p,datasetNames:b}):e.jsx(ce,{title:"Unsupported operation",value:r})]},`${r.op}-${r.evaluation_id??m}`)})})}function ss({evaluation:s,taskNames:t,datasetNames:i}){const n=s.task_id?Number(s.task_id):void 0,a=s.dataset_id?Number(s.dataset_id):void 0,l=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(A,{label:"Task",value:n?t.get(n)??`#${n}`:null}),e.jsx(A,{label:"Dataset",value:a?i.get(a)??`#${a}`:null}),e.jsx(A,{label:"Model",value:s.model_name||null}),e.jsx(A,{label:"Harness",value:s.harness||null}),e.jsx(A,{label:"Best rank",value:s.best_rank??null}),e.jsx(A,{label:"Parameters",value:s.num_parameters??null}),e.jsx(A,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(A,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(l).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(l).map(([o,d])=>e.jsxs("span",{className:"submission-metric-pill",children:[o,": ",String(d)]},o))}):e.jsx(_,{children:"No metrics"})]})]})}function A({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ts({currentPayload:s,proposedPayload:t}){const i=s==null?void 0:s.source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(_,{children:"No current URL"})}),e.jsx(y,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:D(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(_,{children:"No proposed URL"})})]})}function is({proposedPayload:s}){const{title:t,source_url:i,abstract:n="",date_published:a,authors:l}=s;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(_,{children:"No title provided"})}),e.jsx(y,{title:"Publication date",children:a||e.jsx(_,{children:"No publication date provided"})}),e.jsx(y,{title:"Authors",children:l.length>0?l.map((o,d)=>e.jsx("span",{className:"submission-diff-pill added",children:o},`${o}-${d}`)):e.jsx(_,{children:"No authors provided"})}),e.jsx(y,{title:"Source URL",children:i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(_,{children:"No source URL provided"})}),e.jsx(y,{title:"Abstract",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(_,{children:"No abstract provided"})})]})}function z({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",a=typeof t.year=="number"?t.year:null,l=typeof t.start_date=="string"?t.start_date:"",o=typeof t.end_date=="string"?t.end_date:"",d=typeof t.venue=="string"?t.venue:"",p=typeof t.url=="string"?t.url:"",b=t.image??{},j=typeof b.data_url=="string"&&b.data_url.startsWith("data:image/")?b.data_url:"",r=typeof b.url=="string"?Te(b.url)??"":j,m=typeof b.file_name=="string"?b.file_name:"Suggested image",c=typeof t.image_credit=="string"?t.image_credit:"",h=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(_,{children:"No name provided"})}),e.jsx(y,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(_,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Image",children:r?e.jsx("img",{src:r,alt:m,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(_,{children:"No image provided"})}),e.jsx(y,{title:"Image source",children:c||e.jsx(_,{children:"No image source provided"})})]}),s==="task"&&e.jsx(y,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(y,{title:"Intended task IDs",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(y,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(y,{title:"Source",children:h?h.startsWith("http://")||h.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:D(h)??void 0,target:"_blank",rel:"noopener noreferrer",children:h}):e.jsx("span",{className:"submission-field-value",children:h}):e.jsx(_,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Edition and dates",children:a?`${a}${l?` · ${l}${o?` – ${o}`:""}`:""}`:e.jsx(_,{children:"No edition provided"})}),e.jsx(y,{title:"Venue",children:d||e.jsx(_,{children:"No venue provided"})}),e.jsx(y,{title:"URL",children:p?e.jsx("a",{className:"submission-url-link",href:D(p)??void 0,target:"_blank",rel:"noopener noreferrer",children:p}):e.jsx(_,{children:"No URL provided"})})]})]})}function y({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function _({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ns({currentPayload:s,proposedPayload:t}){const i=s,n=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:n.map(({key:a,label:l})=>{const o=(i==null?void 0:i[a])??[],d=t[a];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:l}),e.jsx(ue,{label:l.toLowerCase(),currentItems:o.map(p=>({url:p,is_official:!1})),proposedItems:d.map(p=>({url:p,is_official:!1}))})]},a)})})}function rs(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function as({edit:s}){var i,n,a,l,o;let t;switch(s.edit_type){case"tasks":t=e.jsx(de,{currentItems:((i=s.current_payload)==null?void 0:i.tasks)??[],proposedIds:s.proposed_payload.task_ids,queryPrefix:"task",fetchEntity:I.getTask.bind(I)});break;case"methods":t=e.jsx(de,{currentItems:((n=s.current_payload)==null?void 0:n.methods)??[],proposedIds:s.proposed_payload.method_ids,queryPrefix:"method",fetchEntity:I.getMethod.bind(I)});break;case"organizations":t=e.jsx(Ze,{currentItems:((a=s.current_payload)==null?void 0:a.organizations)??[],proposedIds:s.proposed_payload.organization_ids});break;case"repositories":t=e.jsx(ue,{label:"repositories",currentItems:((l=s.current_payload)==null?void 0:l.repositories)??[],proposedItems:s.proposed_payload.repositories});break;case"project_pages":t=e.jsx(ue,{label:"project pages",currentItems:((o=s.current_payload)==null?void 0:o.project_pages)??[],proposedItems:s.proposed_payload.project_pages});break;case"evaluations":t=e.jsx(es,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"source_url":t=e.jsx(ts,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"hf_artifacts":t=e.jsx(ns,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"new_task":t=e.jsx(z,{kind:"task",proposedPayload:s.proposed_payload});break;case"new_method":t=e.jsx(z,{kind:"method",proposedPayload:s.proposed_payload});break;case"new_benchmark":t=e.jsx(z,{kind:"benchmark",proposedPayload:s.proposed_payload});break;case"new_metric":t=e.jsx(z,{kind:"metric",proposedPayload:s.proposed_payload});break;case"new_conference":t=e.jsx(z,{kind:"conference",proposedPayload:s.proposed_payload});break;case"new_external_paper":t=e.jsx(is,{proposedPayload:s.proposed_payload});break;default:rs(s)}return e.jsxs("div",{className:"submission-diff-body",children:[t,e.jsx(Xe,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const se=25,os=["pending","approved","rejected","all"],ls=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference","new_external_paper"],me=["pending","approved","rejected"];function cs(s){return s.slice(0,2).toUpperCase()}function Y(s){return s.replace(/_/g," ")}function ds(s){return s==="new_external_paper"?"external paper":Y(s)}const us={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};function ye(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const i=Date.now()-t.getTime(),n=Math.floor(i/6e4),a=Math.floor(i/36e5),l=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:a<24?`${a}h ago`:l<14?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function X(s,t){var n;const i=s;if(i.response)try{const a=JSON.parse(i.response);if(typeof(a==null?void 0:a.detail)=="string")return a.detail;if(Array.isArray(a==null?void 0:a.detail)&&((n=a.detail[0])!=null&&n.msg))return a.detail[0].msg}catch{return i.response}return i.message||t}function ms(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function ps(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function hs(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function fs(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return B.list({status:s,edit_type:n,limit:i,offset:0});const a=await Promise.all(me.map(l=>B.list({status:l,edit_type:n,limit:i,offset:0})));return{count:a.reduce((l,o)=>l+o.count,0),results:hs(a.flatMap(l=>l.results)).slice(0,i)}}function bs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(Pe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function xs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function gs({submission:s,paper:t}){const i=Ne(),{toast:n}=ke(),a=s.paper_id,l=a===null,o=us[s.edit_type]??{title:"Taxonomy directory",subtitle:"Directory suggestion"},d=l?null:ps(t,a),p=l?o.title:(t==null?void 0:t.title)||`Paper #${a}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,j=s.status==="pending",r=w.useCallback(g=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),i.invalidateQueries({queryKey:["pendingPaperEdit",g.id]}),g.paper_id!=null&&(i.invalidateQueries({queryKey:["paper",String(g.paper_id)]}),i.invalidateQueries({queryKey:["paper-summary",String(g.paper_id)]})),t!=null&&t.arxiv_id&&i.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),g.edit_type==="evaluations"&&g.paper_id!=null&&i.invalidateQueries({queryKey:["evaluations","paper",String(g.paper_id)]})},[t==null?void 0:t.arxiv_id,i]),m=ge({mutationFn:()=>B.approve(s.id),onSuccess:g=>{r(g),n({title:"Submission approved",description:`Applied ${Y(s.edit_type)} changes for ${p}.`})},onError:g=>{n({title:"Could not approve submission",description:X(g,"Approval failed. Please try again."),variant:"destructive"})}}),c=ge({mutationFn:()=>B.reject(s.id),onSuccess:g=>{r(g),n({title:"Submission rejected",description:`Rejected ${Y(s.edit_type)} changes for ${p}.`})},onError:g=>{n({title:"Could not reject submission",description:X(g,"Rejection failed. Please try again."),variant:"destructive"})}}),h=m.isPending,u=c.isPending,v=h||u;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}):e.jsx("div",{className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?o.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:ye(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:Y(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:q("submission-pill status",ms(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(Fe,{className:"h-6 w-6",children:[e.jsx(Ie,{src:b,alt:s.hf_username}),e.jsx(Qe,{className:"text-[10px]",children:cs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(as,{edit:s})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),s.review_evidence&&e.jsxs("details",{className:"submission-diff",open:!0,children:[e.jsx("summary",{children:"Codex review artifact"}),e.jsx("pre",{children:JSON.stringify(s.review_evidence,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:j?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>c.mutate(),disabled:v,className:"submission-action-btn reject",children:[u?e.jsx(H,{className:"spin",size:14}):e.jsx(Ge,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>m.mutate(),disabled:v,className:"submission-action-btn approve",children:[h?e.jsx(H,{className:"spin",size:14}):e.jsx(We,{size:14}),"Approve"]})]})}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${ye(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),s.user_review_reason&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function Os(){var pe,he,fe;const{user:s,isLoading:t}=qe(),{toast:i}=ke(),[n,a]=w.useState("pending"),[l,o]=w.useState("all"),[d,p]=w.useState(se),b=!!(s!=null&&s.is_admin);w.useEffect(()=>{p(se)},[n,l]);const j=ie({queryKey:["pendingPaperEdits","counts",l],queryFn:async()=>{const x=l==="all"?void 0:l,O=await Promise.all(me.map(M=>B.list({status:M,edit_type:x,limit:1,offset:0})));return Object.fromEntries(O.map((M,W)=>[me[W],M.count]))},enabled:b,staleTime:30*1e3}),r=ie({queryKey:["pendingPaperEdits",{status:n,editType:l,visibleLimit:d}],queryFn:()=>fs(n,l,d),enabled:b,retry:!1}),m=w.useMemo(()=>{var x;return Array.from(new Set((((x=r.data)==null?void 0:x.results)??[]).map(O=>O.paper_id).filter(O=>O!=null))).sort((O,M)=>O-M)},[(pe=r.data)==null?void 0:pe.results]),c=V({queries:m.map(x=>({queryKey:["paper-summary",String(x)],queryFn:()=>Je.get(String(x),!1),enabled:b,staleTime:5*60*1e3}))}),h=w.useMemo(()=>{const x=new Map;return c.forEach(O=>{const M=O.data;if(!M)return;const W=Number(M.id);Number.isFinite(W)&&x.set(W,M)}),x},[c]);if(w.useEffect(()=>{r.error&&i({title:"Could not load submissions",description:X(r.error,"Failed to load pending paper edits."),variant:"destructive"})},[r.error,i]),t)return e.jsx(xs,{});if(!b)return e.jsx(bs,{});const u=j.data,v=u?u.pending+u.approved+u.rejected:void 0,g={pending:u==null?void 0:u.pending,approved:u==null?void 0:u.approved,rejected:u==null?void 0:u.rejected,all:v},F=((he=r.data)==null?void 0:he.results)??[],Z=((fe=r.data)==null?void 0:fe.count)??0,Ee=F.length<Z;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{j.refetch(),r.refetch()},disabled:r.isFetching||j.isFetching,children:[e.jsx(Ke,{className:q((r.isFetching||j.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:os.map(x=>e.jsxs("button",{type:"button",className:q("period-btn",n===x&&"active"),onClick:()=>a(x),children:[x,g[x]!=null&&e.jsx("span",{className:"submission-count",children:g[x]})]},x))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:ls.map(x=>e.jsx("button",{type:"button",className:q("sort-btn",l===x&&"active"),onClick:()=>o(x),children:ds(x)},x))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:r.isFetching?"refreshing":`${Z} submissions`})})})}),r.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):r.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(ve,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:X(r.error,"The submissions response was invalid.")})]}):F.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ve,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:F.map(x=>e.jsx(gs,{submission:x,paper:x.paper_id==null?void 0:h.get(x.paper_id)},x.id))}),F.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",F.length," of ",Z," submissions"]}),Ee&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>p(x=>x+se),disabled:r.isFetching,children:[r.isFetching&&e.jsx(H,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Os as default};
 
1
+ var be=s=>{throw TypeError(s)};var ee=(s,t,i)=>t.has(s)||be("Cannot "+i);var f=(s,t,i)=>(ee(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,r)=>(ee(s,t,"write to private field"),r?r.call(s,i):t.set(s,i),i),R=(s,t,i)=>(ee(s,t,"access private method"),i);import{an as Ce,ao as te,ap as Re,aq as Oe,g as Ne,r as $,ar as Me,d as qe,j as e,M as Ae,z as w,q as T,y as Te,e as ke,as as Fe,at as Ie,au as Qe}from"./index-D_-UZEuL.js";import{Q as we,b as Le,c as Ue,e as De,d as $e,f as ze,s as xe,g as Be,h as He,u as ie}from"./useQuery-BZo4MZ3s.js";import{u as ge}from"./useMutation-P0Dg96Vh.js";import{c as I}from"./catalog-CjU2vAfw.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{p as Je}from"./papers-DHqjKX7p.js";import{s as B}from"./submissions-BpzsA2lc.js";import{R as Ke,S as Pe,C as Ge}from"./shield-alert-Dix0M7Y-.js";import{L as H}from"./loader-circle-D1SscQUT.js";import{C as We}from"./circle-check-BpugpgkG.js";function je(s,t){const i=new Set(t);return s.filter(r=>!i.has(r))}function Ye(s,t,i){const r=s.slice(0);return r[t]=i,r}var L,S,U,Q,E,A,J,K,P,G,N,re,ne,Se,ae,oe,le,_e,Ve=(_e=class extends Ce{constructor(t,i,r){super();C(this,N);C(this,L);C(this,S);C(this,U);C(this,Q);C(this,E);C(this,A);C(this,J);C(this,K);C(this,P);C(this,G,[]);k(this,L,t),k(this,Q,r),k(this,U,[]),k(this,E,[]),k(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,E).forEach(t=>{t.subscribe(i=>{R(this,N,oe).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,E).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,U,t),k(this,Q,i),te.batch(()=>{const r=f(this,E),a=R(this,N,ae).call(this,f(this,U));a.forEach(n=>n.observer.setOptions(n.defaultedQueryOptions));const l=a.map(n=>n.observer),o=l.map(n=>n.getCurrentResult()),d=r.length!==l.length,p=l.some((n,m)=>n!==r[m]),b=d||p,j=b?!0:o.some((n,m)=>{const c=f(this,S)[m];return!c||!Re(n,c)});!b&&!j||(b&&(k(this,G,a),k(this,E,l)),k(this,S,o),this.hasListeners()&&(b&&(je(r,l).forEach(n=>{n.destroy()}),je(l,r).forEach(n=>{n.subscribe(m=>{R(this,N,oe).call(this,n,m)})})),R(this,N,le).call(this)))})}getCurrentResult(){return f(this,S)}getQueries(){return f(this,E).map(t=>t.getCurrentQuery())}getObservers(){return f(this,E)}getOptimisticResult(t,i){const r=R(this,N,ae).call(this,t),a=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=r.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>R(this,N,ne).call(this,o??a,i,l),()=>R(this,N,re).call(this,a,r)]}},L=new WeakMap,S=new WeakMap,U=new WeakMap,Q=new WeakMap,E=new WeakMap,A=new WeakMap,J=new WeakMap,K=new WeakMap,P=new WeakMap,G=new WeakMap,N=new WeakSet,re=function(t,i){return i.map((r,a)=>{const l=t[a];return r.defaultedQueryOptions.notifyOnChangeProps?l:r.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},ne=function(t,i,r){if(i){const a=f(this,P),l=r!==void 0&&a!==void 0&&(a.length!==r.length||r.some((o,d)=>o!==a[d]));return(!f(this,A)||f(this,S)!==f(this,K)||l||i!==f(this,J))&&(k(this,J,i),k(this,K,f(this,S)),r!==void 0&&k(this,P,r),k(this,A,Oe(f(this,A),i(t)))),f(this,A)}return t},Se=function(){var t;return((t=f(this,Q))==null?void 0:t.combine)!==void 0&&f(this,E).some((i,r)=>{var a;return i.options.suspense&&((a=f(this,S)[r])==null?void 0:a.data)===void 0})},ae=function(t){const i=new Map;f(this,E).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const r=[];return t.forEach(a=>{var p;const l=f(this,L).defaultQueryOptions(a),d=((p=i.get(l.queryHash))==null?void 0:p.shift())??new we(f(this,L),l);r.push({defaultedQueryOptions:l,observer:d})}),r},oe=function(t,i){const r=f(this,E).indexOf(t);r!==-1&&(k(this,S,Ye(f(this,S),r,i)),R(this,N,le).call(this))},le=function(){var t;if(this.hasListeners()){const i=R(this,N,re).call(this,f(this,S),f(this,G)),r=R(this,N,Se).call(this),a=f(this,A),l=r?a:R(this,N,ne).call(this,i,(t=f(this,Q))==null?void 0:t.combine);(r||a!==l)&&te.batch(()=>{this.listeners.forEach(o=>{o(f(this,S))})})}},_e);function V({queries:s,...t},i){const r=Ne(),a=Le(),l=Ue(),o=$.useMemo(()=>s.map(u=>{const v=r.defaultQueryOptions(u);return v._optimisticResults=a?"isRestoring":"optimistic",v}),[s,r,a]);o.forEach(u=>{De(u);const v=r.getQueryCache().get(u.queryHash);$e(u,l,v)}),ze(l);const[d]=$.useState(()=>new Ve(r,o,t)),[p,b,j]=d.getOptimisticResult(o,t.combine),n=!a&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(u=>n?d.subscribe(te.batchCalls(u)):Me,[d,n]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=p.some((u,v)=>xe(o[v],u))?p.flatMap((u,v)=>{const g=o[v];if(g&&xe(g,u)){const F=new we(r,g);return Be(g,F,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const h=p.find((u,v)=>{const g=o[v];return g&&He({result:u,errorResetBoundary:l,throwOnError:g.throwOnError,query:r.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(h!=null&&h.error)throw h.error;return b(j())}/**
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 ve=qe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);function Xe({currentPayload:s,proposedPayload:t}){const[i,r]=w.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>r(a=>!a),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(ce,{title:"Current payload",value:s??{}}),e.jsx(ce,{title:"Proposed payload",value:t})]})]})}function ce({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function de({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:r,knownNames:a}){const l=w.useMemo(()=>Array.from(new Set([...s.map(c=>c.id),...t])).sort((c,h)=>c-h),[s,t]),o=V({queries:r?l.map(c=>({queryKey:[i,String(c)],queryFn:()=>r(String(c)),staleTime:5*60*1e3})):[]}),d=w.useMemo(()=>{const c=new Map;return s.forEach(h=>c.set(h.id,h.name)),a==null||a.forEach((h,u)=>c.set(u,h)),o.forEach(h=>{const u=h.data;if(!u)return;const v=Number(u.id);Number.isFinite(v)&&c.set(v,u.name)}),c},[s,o,a]),p=new Set(s.map(c=>c.id)),b=new Set(t),j=l.filter(c=>p.has(c)&&!b.has(c)),n=l.filter(c=>!p.has(c)&&b.has(c)),m=(c,h)=>{const u=h==="current"&&j.includes(c),v=h==="proposed"&&n.includes(c);return e.jsx("span",{className:T("submission-diff-pill",u&&"removed",v&&"added"),children:d.get(c)??`#${c}`},c)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Currently tagged",children:s.length>0?s.map(c=>m(c.id,"current")):e.jsx(_,{children:"No current tags"})}),e.jsx(y,{title:"Will be tagged",children:t.length>0?t.map(c=>m(c,"proposed")):e.jsx(_,{children:"No proposed tags"})})]})}function Ze({currentItems:s,proposedIds:t}){var l;const i=ie({queryKey:["organizations","submission-diff"],queryFn:()=>I.organizations(),staleTime:3e5}),r=new Map(s.map(o=>[o.id,o.name]));(l=i.data)==null||l.results.forEach(o=>{const d=Number(o.id);Number.isFinite(d)&&r.set(d,o.name)});const a=s.map(o=>({...o,name:r.get(o.id)??o.name}));return e.jsx(de,{currentItems:a,proposedIds:t,queryPrefix:"organization",knownNames:r})}function ue({label:s,currentItems:t,proposedItems:i}){const r=new Map(t.map(o=>[o.url,o])),a=new Map(i.map(o=>[o.url,o])),l=Array.from(new Set([...r.keys(),...a.keys()])).sort();return l.length===0?e.jsxs(_,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:l.map(o=>{var m;const d=r.get(o),p=a.get(o),b=!d&&p,j=d&&!p,n=d&&p&&d.is_official!==p.is_official;return e.jsx("div",{className:T("submission-url-row",b&&"added",j&&"removed",n&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:D(o)??void 0,target:"_blank",rel:"noopener noreferrer",className:T("submission-url-link",j&&"removed"),children:o}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),j&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),n&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(d.is_official)," ","->"," ",String(p.is_official)]}),((m=p??d)==null?void 0:m.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},o)})})}function es({currentPayload:s,proposedPayload:t}){const i=w.useMemo(()=>(s==null?void 0:s.evaluations)??[],[s]),r=t.operations,a=w.useMemo(()=>{const n=new Set;return i.forEach(m=>{m.task_id&&n.add(Number(m.task_id))}),r.forEach(m=>{const c=m.data;c!=null&&c.task_id&&n.add(Number(c.task_id))}),Array.from(n).filter(m=>Number.isFinite(m))},[i,r]),l=w.useMemo(()=>{const n=new Set;return i.forEach(m=>{m.dataset_id&&n.add(Number(m.dataset_id))}),r.forEach(m=>{const c=m.data;c!=null&&c.dataset_id&&n.add(Number(c.dataset_id))}),Array.from(n).filter(m=>Number.isFinite(m))},[i,r]),o=V({queries:a.map(n=>({queryKey:["task",String(n)],queryFn:()=>I.getTask(String(n)),staleTime:5*60*1e3}))}),d=V({queries:l.map(n=>({queryKey:["dataset",String(n)],queryFn:()=>I.getDataset(String(n)),staleTime:5*60*1e3}))}),p=w.useMemo(()=>{const n=new Map;return o.forEach(m=>{const c=m.data;if(!c)return;const h=Number(c.id);Number.isFinite(h)&&n.set(h,c.name)}),n},[o]),b=w.useMemo(()=>{const n=new Map;return d.forEach(m=>{const c=m.data;if(!c)return;const h=Number(c.id);Number.isFinite(h)&&n.set(h,c.name)}),n},[d]),j=new Map(i.filter(n=>n.id!=null).map(n=>[Number(n.id),n]));return r.length===0?e.jsx(_,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:r.map((n,m)=>{const c=n.evaluation_id?j.get(n.evaluation_id):void 0,u=(n.op==="update"?{...c,...n.data}:n.data??c)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:T("submission-pill status",n.op==="create"&&"approved",n.op==="update"&&"changed",n.op==="delete"&&"rejected"),children:n.op??"unknown"}),n.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",n.evaluation_id]})]}),n.op&&["create","update","delete"].includes(n.op)?e.jsx(ss,{evaluation:u,taskNames:p,datasetNames:b}):e.jsx(ce,{title:"Unsupported operation",value:n})]},`${n.op}-${n.evaluation_id??m}`)})})}function ss({evaluation:s,taskNames:t,datasetNames:i}){const r=s.task_id?Number(s.task_id):void 0,a=s.dataset_id?Number(s.dataset_id):void 0,l=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(q,{label:"Task",value:r?t.get(r)??`#${r}`:null}),e.jsx(q,{label:"Dataset",value:a?i.get(a)??`#${a}`:null}),e.jsx(q,{label:"Model",value:s.model_name||null}),e.jsx(q,{label:"Harness",value:s.harness||null}),e.jsx(q,{label:"Best rank",value:s.best_rank??null}),e.jsx(q,{label:"Parameters",value:s.num_parameters??null}),e.jsx(q,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(q,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(l).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(l).map(([o,d])=>e.jsxs("span",{className:"submission-metric-pill",children:[o,": ",String(d)]},o))}):e.jsx(_,{children:"No metrics"})]})]})}function q({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ts({currentPayload:s,proposedPayload:t}){const i=s==null?void 0:s.source_url,r=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(_,{children:"No current URL"})}),e.jsx(y,{title:"Proposed source URL",children:typeof r=="string"&&r?e.jsx("a",{className:"submission-url-link",href:D(r)??void 0,target:"_blank",rel:"noopener noreferrer",children:r}):e.jsx(_,{children:"No proposed URL"})})]})}function is({proposedPayload:s}){const{title:t,source_url:i,abstract:r="",date_published:a,authors:l}=s;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(_,{children:"No title provided"})}),e.jsx(y,{title:"Publication date",children:a||e.jsx(_,{children:"No publication date provided"})}),e.jsx(y,{title:"Authors",children:l.length>0?l.map((o,d)=>e.jsx("span",{className:"submission-diff-pill added",children:o},`${o}-${d}`)):e.jsx(_,{children:"No authors provided"})}),e.jsx(y,{title:"Source URL",children:i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(_,{children:"No source URL provided"})}),e.jsx(y,{title:"Abstract",children:r?e.jsx("span",{className:"submission-field-value",children:r}):e.jsx(_,{children:"No abstract provided"})})]})}function z({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",r=typeof t.description=="string"?t.description:"",a=typeof t.year=="number"?t.year:null,l=typeof t.start_date=="string"?t.start_date:"",o=typeof t.end_date=="string"?t.end_date:"",d=typeof t.venue=="string"?t.venue:"",p=typeof t.url=="string"?t.url:"",b=t.image??{},j=typeof b.data_url=="string"&&b.data_url.startsWith("data:image/")?b.data_url:"",n=typeof b.url=="string"?Ae(b.url)??"":j,m=typeof b.file_name=="string"?b.file_name:"Suggested image",c=typeof t.image_credit=="string"?t.image_credit:"",h=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(_,{children:"No name provided"})}),e.jsx(y,{title:"Description",children:r?e.jsx("span",{className:"submission-field-value",children:r}):e.jsx(_,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Image",children:n?e.jsx("img",{src:n,alt:m,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(_,{children:"No image provided"})}),e.jsx(y,{title:"Image source",children:c||e.jsx(_,{children:"No image source provided"})})]}),s==="task"&&e.jsx(y,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(y,{title:"Intended task IDs",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(y,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(y,{title:"Source",children:h?h.startsWith("http://")||h.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:D(h)??void 0,target:"_blank",rel:"noopener noreferrer",children:h}):e.jsx("span",{className:"submission-field-value",children:h}):e.jsx(_,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Edition and dates",children:a?`${a}${l?` · ${l}${o?` – ${o}`:""}`:""}`:e.jsx(_,{children:"No edition provided"})}),e.jsx(y,{title:"Venue",children:d||e.jsx(_,{children:"No venue provided"})}),e.jsx(y,{title:"URL",children:p?e.jsx("a",{className:"submission-url-link",href:D(p)??void 0,target:"_blank",rel:"noopener noreferrer",children:p}):e.jsx(_,{children:"No URL provided"})})]})]})}function y({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function _({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function rs({currentPayload:s,proposedPayload:t}){const i=s,r=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:r.map(({key:a,label:l})=>{const o=(i==null?void 0:i[a])??[],d=t[a];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:l}),e.jsx(ue,{label:l.toLowerCase(),currentItems:o.map(p=>({url:p,is_official:!1})),proposedItems:d.map(p=>({url:p,is_official:!1}))})]},a)})})}function ns(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function as({edit:s}){var i,r,a,l,o;let t;switch(s.edit_type){case"tasks":t=e.jsx(de,{currentItems:((i=s.current_payload)==null?void 0:i.tasks)??[],proposedIds:s.proposed_payload.task_ids,queryPrefix:"task",fetchEntity:I.getTask.bind(I)});break;case"methods":t=e.jsx(de,{currentItems:((r=s.current_payload)==null?void 0:r.methods)??[],proposedIds:s.proposed_payload.method_ids,queryPrefix:"method",fetchEntity:I.getMethod.bind(I)});break;case"organizations":t=e.jsx(Ze,{currentItems:((a=s.current_payload)==null?void 0:a.organizations)??[],proposedIds:s.proposed_payload.organization_ids});break;case"repositories":t=e.jsx(ue,{label:"repositories",currentItems:((l=s.current_payload)==null?void 0:l.repositories)??[],proposedItems:s.proposed_payload.repositories});break;case"project_pages":t=e.jsx(ue,{label:"project pages",currentItems:((o=s.current_payload)==null?void 0:o.project_pages)??[],proposedItems:s.proposed_payload.project_pages});break;case"evaluations":t=e.jsx(es,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"source_url":t=e.jsx(ts,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"hf_artifacts":t=e.jsx(rs,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"new_task":t=e.jsx(z,{kind:"task",proposedPayload:s.proposed_payload});break;case"new_method":t=e.jsx(z,{kind:"method",proposedPayload:s.proposed_payload});break;case"new_benchmark":t=e.jsx(z,{kind:"benchmark",proposedPayload:s.proposed_payload});break;case"new_metric":t=e.jsx(z,{kind:"metric",proposedPayload:s.proposed_payload});break;case"new_conference":t=e.jsx(z,{kind:"conference",proposedPayload:s.proposed_payload});break;case"new_external_paper":t=e.jsx(is,{proposedPayload:s.proposed_payload});break;default:ns(s)}return e.jsxs("div",{className:"submission-diff-body",children:[t,e.jsx(Xe,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const se=25,os=["pending","approved","rejected","all"],ls=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference","new_external_paper"],me=["pending","approved","rejected"];function cs(s){return s.slice(0,2).toUpperCase()}function Y(s){return s.replace(/_/g," ")}function ds(s){return s==="new_external_paper"?"external paper":Y(s)}const us={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};function ye(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const i=Date.now()-t.getTime(),r=Math.floor(i/6e4),a=Math.floor(i/36e5),l=Math.floor(i/864e5);return r<1?"just now":r<60?`${r}m ago`:a<24?`${a}h ago`:l<14?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function X(s,t){var r;const i=s;if(i.response)try{const a=JSON.parse(i.response);if(typeof(a==null?void 0:a.detail)=="string")return a.detail;if(Array.isArray(a==null?void 0:a.detail)&&((r=a.detail[0])!=null&&r.msg))return a.detail[0].msg}catch{return i.response}return i.message||t}function ms(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function ps(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function hs(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function fs(s,t,i){const r=t==="all"?void 0:t;if(s!=="all")return B.list({status:s,edit_type:r,limit:i,offset:0});const a=await Promise.all(me.map(l=>B.list({status:l,edit_type:r,limit:i,offset:0})));return{count:a.reduce((l,o)=>l+o.count,0),results:hs(a.flatMap(l=>l.results)).slice(0,i)}}function bs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(Pe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function xs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function gs({submission:s,paper:t}){const i=Ne(),{toast:r}=ke(),a=s.paper_id,l=a===null,o=us[s.edit_type]??{title:"Taxonomy directory",subtitle:"Directory suggestion"},d=l?null:ps(t,a),p=l?o.title:(t==null?void 0:t.title)||`Paper #${a}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,j=s.status==="pending",n=w.useCallback(g=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),i.invalidateQueries({queryKey:["pendingPaperEdit",g.id]}),g.paper_id!=null&&(i.invalidateQueries({queryKey:["paper",String(g.paper_id)]}),i.invalidateQueries({queryKey:["paper-summary",String(g.paper_id)]})),t!=null&&t.arxiv_id&&i.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),g.edit_type==="evaluations"&&g.paper_id!=null&&i.invalidateQueries({queryKey:["evaluations","paper",String(g.paper_id)]})},[t==null?void 0:t.arxiv_id,i]),m=ge({mutationFn:()=>B.approve(s.id),onSuccess:g=>{n(g),r({title:"Submission approved",description:`Applied ${Y(s.edit_type)} changes for ${p}.`})},onError:g=>{r({title:"Could not approve submission",description:X(g,"Approval failed. Please try again."),variant:"destructive"})}}),c=ge({mutationFn:()=>B.reject(s.id),onSuccess:g=>{n(g),r({title:"Submission rejected",description:`Rejected ${Y(s.edit_type)} changes for ${p}.`})},onError:g=>{r({title:"Could not reject submission",description:X(g,"Rejection failed. Please try again."),variant:"destructive"})}}),h=m.isPending,u=c.isPending,v=h||u;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}):e.jsx("div",{className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?o.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:ye(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:Y(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:T("submission-pill status",ms(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(Fe,{className:"h-6 w-6",children:[e.jsx(Ie,{src:b,alt:s.hf_username}),e.jsx(Qe,{className:"text-[10px]",children:cs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(as,{edit:s})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),s.review_evidence&&e.jsxs("details",{className:"submission-diff",open:!0,children:[e.jsx("summary",{children:"Codex review artifact"}),e.jsx("pre",{children:JSON.stringify(s.review_evidence,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:j?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>c.mutate(),disabled:v,className:"submission-action-btn reject",children:[u?e.jsx(H,{className:"spin",size:14}):e.jsx(Ge,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>m.mutate(),disabled:v,className:"submission-action-btn approve",children:[h?e.jsx(H,{className:"spin",size:14}):e.jsx(We,{size:14}),"Approve"]})]})}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${ye(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),s.user_review_reason&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function Os(){var pe,he,fe;const{user:s,isLoading:t}=Te(),{toast:i}=ke(),[r,a]=w.useState("pending"),[l,o]=w.useState("all"),[d,p]=w.useState(se),b=!!(s!=null&&s.is_admin);w.useEffect(()=>{p(se)},[r,l]);const j=ie({queryKey:["pendingPaperEdits","counts",l],queryFn:async()=>{const x=l==="all"?void 0:l,O=await Promise.all(me.map(M=>B.list({status:M,edit_type:x,limit:1,offset:0})));return Object.fromEntries(O.map((M,W)=>[me[W],M.count]))},enabled:b,staleTime:30*1e3}),n=ie({queryKey:["pendingPaperEdits",{status:r,editType:l,visibleLimit:d}],queryFn:()=>fs(r,l,d),enabled:b,retry:!1}),m=w.useMemo(()=>{var x;return Array.from(new Set((((x=n.data)==null?void 0:x.results)??[]).map(O=>O.paper_id).filter(O=>O!=null))).sort((O,M)=>O-M)},[(pe=n.data)==null?void 0:pe.results]),c=V({queries:m.map(x=>({queryKey:["paper-summary",String(x)],queryFn:()=>Je.get(String(x),!1),enabled:b,staleTime:5*60*1e3}))}),h=w.useMemo(()=>{const x=new Map;return c.forEach(O=>{const M=O.data;if(!M)return;const W=Number(M.id);Number.isFinite(W)&&x.set(W,M)}),x},[c]);if(w.useEffect(()=>{n.error&&i({title:"Could not load submissions",description:X(n.error,"Failed to load pending paper edits."),variant:"destructive"})},[n.error,i]),t)return e.jsx(xs,{});if(!b)return e.jsx(bs,{});const u=j.data,v=u?u.pending+u.approved+u.rejected:void 0,g={pending:u==null?void 0:u.pending,approved:u==null?void 0:u.approved,rejected:u==null?void 0:u.rejected,all:v},F=((he=n.data)==null?void 0:he.results)??[],Z=((fe=n.data)==null?void 0:fe.count)??0,Ee=F.length<Z;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{j.refetch(),n.refetch()},disabled:n.isFetching||j.isFetching,children:[e.jsx(Ke,{className:T((n.isFetching||j.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:os.map(x=>e.jsxs("button",{type:"button",className:T("period-btn",r===x&&"active"),onClick:()=>a(x),children:[x,g[x]!=null&&e.jsx("span",{className:"submission-count",children:g[x]})]},x))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:ls.map(x=>e.jsx("button",{type:"button",className:T("sort-btn",l===x&&"active"),onClick:()=>o(x),children:ds(x)},x))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:n.isFetching?"refreshing":`${Z} submissions`})})})}),n.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):n.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(ve,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:X(n.error,"The submissions response was invalid.")})]}):F.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ve,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:F.map(x=>e.jsx(gs,{submission:x,paper:x.paper_id==null?void 0:h.get(x.paper_id)},x.id))}),F.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",F.length," of ",Z," submissions"]}),Ee&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>p(x=>x+se),disabled:n.isFetching,children:[n.isFetching&&e.jsx(H,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Os as default};
assets/{SubmitView-Bq6nl10o.js → SubmitView-Bt-NFHA_.js} RENAMED
@@ -1 +1 @@
1
- import{u as P,g as k,d as C,f as E,R as d,j as e,D as L}from"./index-BrhBTT14.js";import{u as z}from"./useMutation-DqfuSW7Q.js";import{A as F,a as X}from"./alert-c1n3ZtEC.js";import{B as _}from"./button-CusGeqPB.js";import{I as g,T as q}from"./textarea-D6mDqvzM.js";import{p as N}from"./papers-DBaPliAp.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(m=>m.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const Y=()=>{const n=P(),i=k(),{toast:a}=C(),{user:s,isLoading:o}=E(),[l,p]=d.useState(""),[u,m]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[b,w]=d.useState(""),[I,y]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),m(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const h=A(l),R=h==="external",c=z({mutationFn:t=>N.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(J(t))}}),T=t=>{if(t.preventDefault(),y(null),h==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:b}));const D=L("/api/v1/auth/hf/login");window.location.assign(`${D}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:b});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,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(g,{id:"submit-input",value:l,onChange:t=>p(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:h==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":h==="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."})]}),R&&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(g,{id:"submit-title",value:u,onChange:t=>m(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(q,{id:"submit-abstract",value:f,onChange:t=>S(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(g,{id:"submit-authors",value:x,onChange:t=>j(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(g,{id:"submit-date",type:"date",value:b,onChange:t=>w(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."})]})]}),I&&e.jsx(F,{variant:"destructive",children:e.jsx(X,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Y as default};
 
1
+ import{u as D,g as k,e as C,y as E,z as d,j as e,x as z}from"./index-D_-UZEuL.js";import{u as L}from"./useMutation-P0Dg96Vh.js";import{A as F,a as X}from"./alert-B2j1kc2o.js";import{B as _}from"./button-Cc8PFtC1.js";import{I as g,T as q}from"./textarea-DlQmtN_E.js";import{p as N}from"./papers-DHqjKX7p.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(m=>m.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const Y=()=>{const n=D(),i=k(),{toast:a}=C(),{user:s,isLoading:o}=E(),[l,p]=d.useState(""),[u,m]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[y,w]=d.useState(""),[I,b]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),m(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const h=A(l),R=h==="external",c=L({mutationFn:t=>N.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{b(J(t))}}),T=t=>{if(t.preventDefault(),b(null),h==="empty"){b("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:y}));const P=z("/api/v1/auth/hf/login");window.location.assign(`${P}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:y});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,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(g,{id:"submit-input",value:l,onChange:t=>p(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:h==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":h==="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."})]}),R&&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(g,{id:"submit-title",value:u,onChange:t=>m(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(q,{id:"submit-abstract",value:f,onChange:t=>S(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(g,{id:"submit-authors",value:x,onChange:t=>j(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(g,{id:"submit-date",type:"date",value:y,onChange:t=>w(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."})]})]}),I&&e.jsx(F,{variant:"destructive",children:e.jsx(X,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Y as default};
assets/{TagBrowseView-B6A9Mvnz.js → TagBrowseView-Dw0_Dir3.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as be,r as h,o as Z,j as e,m as F,O as je,q as _e,P as Xe,t as ve,p as Ne,Q as es,R as _,S as ss,x as as,v as J,L as A,e as ts,u as ns,a as rs,l as os,N as cs}from"./index-BrhBTT14.js";import{u as ge}from"./useQuery-GhY2LXSI.js";import{P as is,M as ls}from"./components-74u_bIKK.js";import{B as ds}from"./BenchmarkTrendSparkline-5roKNW3d.js";import{u as ms,P as ps}from"./useIntersectionObserver-Lj6hnXj6.js";import{M as Q}from"./MarkdownText-CNM4Jz9h.js";import{c as fe}from"./catalog-CkpmYxEk.js";import{s as hs}from"./slug-BpH-Nkvz.js";import{d as D,t as us}from"./transform-Duf4Shfn.js";import{b as xs}from"./usePapers-C1lfz0oo.js";import{S as q}from"./skeleton-DHdzoBmM.js";import{A as gs,a as fs}from"./alert-c1n3ZtEC.js";import{C as bs}from"./chevron-down-CKySK_lE.js";import{G as js}from"./github-XgFsJJRC.js";import"./LatexTitle-BJSVMlZ1.js";import"./katex.min-BSBacQyE.js";import"./papers-DBaPliAp.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-BCdZ9yj3.js";import"./index-BLqBUiom.js";import"./hover-card-BcKGA4Et.js";import"./useInfiniteQuery-bETtM5yS.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{c as be,r as h,o as Z,j as e,m as F,O as je,q as _e,P as Xe,t as ve,p as
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 vs=be("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);var K="Collapsible",[Ns,ke]=ve(K),[ks,X]=Ns(K),we=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:c,onOpenChange:m,...u}=a,[g,f]=Z({prop:r,defaultProp:i??!1,onChange:m,caller:K});return e.jsx(ks,{scope:n,disabled:c,contentId:je(),open:g,onOpenToggle:h.useCallback(()=>f(j=>!j),[f]),children:e.jsx(F.div,{"data-state":se(g),"data-disabled":c?"":void 0,...u,ref:o})})});we.displayName=K;var Ce="CollapsibleTrigger",ye=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,...r}=a,i=X(Ce,n);return e.jsx(F.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":se(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:o,onClick:_e(a.onClick,i.onOpenToggle)})});ye.displayName=Ce;var ee="CollapsibleContent",Ae=h.forwardRef((a,o)=>{const{forceMount:n,...r}=a,i=X(ee,a.__scopeCollapsible);return e.jsx(Xe,{present:n||i.open,children:({present:c})=>e.jsx(ws,{...r,ref:o,present:c})})});Ae.displayName=ee;var ws=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,present:r,children:i,...c}=a,m=X(ee,n),[u,g]=h.useState(r),f=h.useRef(null),j=Ne(o,f),v=h.useRef(0),R=v.current,S=h.useRef(0),T=S.current,k=m.open||u,N=h.useRef(k),d=h.useRef(void 0);return h.useEffect(()=>{const p=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(p)},[]),es(()=>{const p=f.current;if(p){d.current=d.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const w=p.getBoundingClientRect();v.current=w.height,S.current=w.width,N.current||(p.style.transitionDuration=d.current.transitionDuration,p.style.animationName=d.current.animationName),g(r)}},[m.open,r]),e.jsx(F.div,{"data-state":se(m.open),"data-disabled":m.disabled?"":void 0,id:m.contentId,hidden:!k,...c,ref:j,style:{"--radix-collapsible-content-height":R?`${R}px`:void 0,"--radix-collapsible-content-width":T?`${T}px`:void 0,...a.style},children:k&&i})});function se(a){return a?"open":"closed"}var Cs=we,ys=ye,As=Ae,C="Accordion",Ss=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ae,Ps,Rs]=ss(C),[z]=ve(C,[Rs,ke]),te=ke(),Se=_.forwardRef((a,o)=>{const{type:n,...r}=a,i=r,c=r;return e.jsx(ae.Provider,{scope:a.__scopeAccordion,children:n==="multiple"?e.jsx(Ms,{...c,ref:o}):e.jsx(Ts,{...i,ref:o})})});Se.displayName=C;var[Pe,Is]=z(C),[Re,Es]=z(C,{collapsible:!1}),Ts=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:c=!1,...m}=a,[u,g]=Z({prop:n,defaultProp:r??"",onChange:i,caller:C});return e.jsx(Pe,{scope:a.__scopeAccordion,value:_.useMemo(()=>u?[u]:[],[u]),onItemOpen:g,onItemClose:_.useCallback(()=>c&&g(""),[c,g]),children:e.jsx(Re,{scope:a.__scopeAccordion,collapsible:c,children:e.jsx(Ie,{...m,ref:o})})})}),Ms=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...c}=a,[m,u]=Z({prop:n,defaultProp:r??[],onChange:i,caller:C}),g=_.useCallback(j=>u((v=[])=>[...v,j]),[u]),f=_.useCallback(j=>u((v=[])=>v.filter(R=>R!==j)),[u]);return e.jsx(Pe,{scope:a.__scopeAccordion,value:m,onItemOpen:g,onItemClose:f,children:e.jsx(Re,{scope:a.__scopeAccordion,collapsible:!0,children:e.jsx(Ie,{...c,ref:o})})})}),[$s,G]=z(C),Ie=_.forwardRef((a,o)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:c="vertical",...m}=a,u=_.useRef(null),g=Ne(u,o),f=Ps(n),v=as(i)==="ltr",R=_e(a.onKeyDown,S=>{var L;if(!Ss.includes(S.key))return;const T=S.target,k=f().filter(M=>{var x;return!((x=M.ref.current)!=null&&x.disabled)}),N=k.findIndex(M=>M.ref.current===T),d=k.length;if(N===-1)return;S.preventDefault();let p=N;const w=0,I=d-1,b=()=>{p=N+1,p>I&&(p=w)},E=()=>{p=N-1,p<w&&(p=I)};switch(S.key){case"Home":p=w;break;case"End":p=I;break;case"ArrowRight":c==="horizontal"&&(v?b():E());break;case"ArrowDown":c==="vertical"&&b();break;case"ArrowLeft":c==="horizontal"&&(v?E():b());break;case"ArrowUp":c==="vertical"&&E();break}const B=p%d;(L=k[B].ref.current)==null||L.focus()});return e.jsx($s,{scope:n,disabled:r,direction:i,orientation:c,children:e.jsx(ae.Slot,{scope:n,children:e.jsx(F.div,{...m,"data-orientation":c,ref:g,onKeyDown:r?void 0:R})})})}),U="AccordionItem",[Os,ne]=z(U),Ee=_.forwardRef((a,o)=>{const{__scopeAccordion:n,value:r,...i}=a,c=G(U,n),m=Is(U,n),u=te(n),g=je(),f=r&&m.value.includes(r)||!1,j=c.disabled||a.disabled;return e.jsx(Os,{scope:n,open:f,disabled:j,triggerId:g,children:e.jsx(Cs,{"data-orientation":c.orientation,"data-state":De(f),...u,...i,ref:o,disabled:j,open:f,onOpenChange:v=>{v?m.onItemOpen(r):m.onItemClose(r)}})})});Ee.displayName=U;var Te="AccordionHeader",Me=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Te,n);return e.jsx(F.h3,{"data-orientation":i.orientation,"data-state":De(c.open),"data-disabled":c.disabled?"":void 0,...r,ref:o})});Me.displayName=Te;var Y="AccordionTrigger",$e=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Y,n),m=Es(Y,n),u=te(n);return e.jsx(ae.ItemSlot,{scope:n,children:e.jsx(ys,{"aria-disabled":c.open&&!m.collapsible||void 0,"data-orientation":i.orientation,id:c.triggerId,...u,...r,ref:o})})});$e.displayName=Y;var Oe="AccordionContent",Be=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Oe,n),m=te(n);return e.jsx(As,{role:"region","aria-labelledby":c.triggerId,"data-orientation":i.orientation,...m,...r,ref:o,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...a.style}})});Be.displayName=Oe;function De(a){return a?"open":"closed"}var Bs=Se,Ds=Ee,Fs=Me,Fe=$e,Le=Be;const Ls=Bs,He=h.forwardRef(({className:a,...o},n)=>e.jsx(Ds,{ref:n,className:J("border-b",a),...o}));He.displayName="AccordionItem";const Ve=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Fs,{className:"flex",children:e.jsxs(Fe,{ref:r,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[o,e.jsx(bs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Ve.displayName=Fe.displayName;const qe=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Le,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:J("pb-4 pt-0",a),children:o})}));qe.displayName=Le.displayName;const Hs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Vs=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",W=3,qs=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Us=({frameworks:a})=>a.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),a.map(o=>e.jsxs(A,{to:`/papers?framework=${encodeURIComponent(o.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:o.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",qs(o.num_stars)]})]},o.framework_id))]}),Ks=({task:a,area:o,parents:n})=>e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/tasks",children:"Tasks"}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:`/tasks#area-${hs(o.name)}`,children:o.name})]}),[...n].reverse().map(r=>e.jsxs(_.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:`/tasks/${r.slug||r.id}`,children:D(r.name,r.slug)})]},r.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:D(a.name,a.slug)})]}),zs=a=>[...a].sort((o,n)=>{const r=o.slug==="classic-language-modeling",i=n.slug==="classic-language-modeling";return r!==i?r?1:-1:0}),xa=()=>{var le,de,me,pe,he,ue,xe;const{taskSlug:a}=ts(),o=ns(),[n,r]=rs(),i=Vs(n.get("order_by")),c=n.get("has_code")==="true",m=n.get("has_hf_artifacts")==="true",u=s=>{const t=new URLSearchParams(n);t.set("order_by",s),r(t)},g=s=>{const t=new URLSearchParams(n);s?t.set("has_code","true"):t.delete("has_code"),r(t)},f=s=>{const t=new URLSearchParams(n);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},[j,v]=h.useState(!1),[R,S]=h.useState(()=>new Set),{preferences:T}=os(),k=(s,t)=>{const l=s||"";return t?`/benchmark/${l}?task=${encodeURIComponent(t)}`:`/benchmark/${l}`},N=T.hide_closed_source_evals?!0:void 0,d=ge({queryKey:["task-page",a,N],queryFn:()=>fe.taskPage(a,{is_open:N}),enabled:!!a,staleTime:10*60*1e3});h.useEffect(()=>{var l;const s=(l=d.data)==null?void 0:l.task.slug;if(!a||!s||s===a)return;const t=n.toString();o(`/tasks/${s}${t?`?${t}`:""}`,{replace:!0})},[o,(le=d.data)==null?void 0:le.task.slug,n,a]);const p=ge({queryKey:["task-benchmark-trends",a,N],queryFn:()=>fe.trendingBenchmarks(a,{limit:100,min_recent_papers:0,is_open:N}),enabled:!!a,staleTime:10*60*1e3}),w=h.useMemo(()=>{var s;return zs(((s=d.data)==null?void 0:s.children)||[])},[d.data]),I=h.useMemo(()=>{var t;const s=new Map;return(((t=d.data)==null?void 0:t.subtask_benchmarks)||[]).forEach(l=>{s.set(l.subtask_id,l.benchmarks||[])}),s},[d.data]),b=xs({taskId:((me=(de=d.data)==null?void 0:de.task)==null?void 0:me.id)||"",page_size:20,order_by:i,order_dir:"desc",include_resources:!0,has_code:c,has_hf_artifacts:m,enabled:!!((he=(pe=d.data)==null?void 0:pe.task)!=null&&he.id)}),E=h.useMemo(()=>{var t;return(((t=b.data)==null?void 0:t.pages.flatMap(l=>l.results))||[]).map(us)},[b.data]),B=h.useMemo(()=>{var t;const s={};return(t=b.data)==null||t.pages.forEach(l=>l.results.forEach(O=>(O.methods||[]).forEach(P=>{const y=P.slug||P.id;s[y]||(s[y]={id:P.id,name:P.name,slug:P.slug||"",count:0}),s[y].count++}))),Object.values(s).sort((l,O)=>O.count-l.count).slice(0,8)},[b.data]),{targetRef:L,isIntersecting:M}=ms({rootMargin:"200px"});if(h.useEffect(()=>{M&&b.hasNextPage&&!b.isFetchingNextPage&&b.fetchNextPage()},[M,b.hasNextPage,b.isFetchingNextPage]),d.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(q,{className:"h-12 w-1/2 mb-4"}),e.jsx(q,{className:"h-6 w-1/3 mb-8"}),e.jsx(q,{className:"h-64 w-full"})]});if(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(gs,{variant:"destructive",children:e.jsx(fs,{children:"Task not found."})})});const x=d.data.task,Ue=d.data.parents||[],H=D(x.name,x.slug),re=(d.data.sisters||[]).filter(s=>s.id!==x.id),Ke=d.data.recommended_frameworks||[],V=d.data.benchmarks||[],ze=new Map(V.map(s=>[s.id,s])),Ge=new Set(V.map(s=>s.id)),oe=(((ue=p.data)==null?void 0:ue.results)||[]).filter(s=>Ge.has(s.id)).map(s=>{const t=ze.get(s.id);return{...s,best_model_name:(t==null?void 0:t.best_model_name)??s.best_model_name,best_paper_route:t==null?void 0:t.best_paper_route,best_paper_title:t==null?void 0:t.best_paper_title,best_code_url:t==null?void 0:t.best_code_url}}),$=oe.length?oe:V.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),ce=((xe=p.data)==null?void 0:xe.recent_days)||90,Qe=w.some(s=>(I.get(s.id)||[]).length>0),We=w.length>0,ie=$.length>0,Ye=(()=>{const s=new Set;return V.forEach(t=>s.add(t.id)),I.forEach(t=>t.forEach(l=>s.add(l.id))),s.size})(),Ze=s=>{S(t=>{const l=new Set(t);return l.has(s)?l.delete(s):l.add(s),l})};return e.jsxs("div",{className:"page",children:[e.jsx(Ks,{task:x,area:d.data.area,parents:Ue}),e.jsxs("div",{className:x.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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:H}),x.description&&e.jsx(Q,{className:"task-explainer",text:x.description}),x.research_trends&&x.research_trends.length>0&&e.jsx(Ls,{className:"task-research-trends",type:"single",collapsible:!0,children:e.jsxs(He,{className:"task-research-trends-item",value:"key-trends",children:[e.jsx(Ve,{className:"task-research-trends-trigger",children:e.jsx("span",{className:"task-research-trends-title",children:"Key trends"})}),e.jsx(qe,{className:"task-research-trends-content",children:e.jsx("ul",{children:x.research_trends.map((s,t)=>e.jsx("li",{children:e.jsx(Q,{text:s})},t))})})]})}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(x.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:Ye}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[B.length,"+"]}),"METHODS USED"]})]}),e.jsx(Us,{frameworks:Ke})]}),x.image_url&&e.jsxs("figure",{className:`task-figure-card${x.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:cs(x.image_url)??void 0,alt:`${H} schematic`,onError:s=>{var t,l;(l=(t=s.currentTarget.parentElement)==null?void 0:t.parentElement)==null||l.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",H,x.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Q,{className:"task-image-credit",text:x.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[ie&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[ce,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",$.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),(j?$:$.slice(0,5)).map(s=>e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ds,{history:s.history,benchmarkName:s.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:s.recent_paper_count})," ",s.recent_paper_count===1?"paper":"papers"," /"," ",ce,"d"]}),s.rate_change==null?s.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${s.rate_change>=1?"is-up":"is-down"}`,children:[s.rate_change>=1?"↑":"↓"," ",s.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(A,{className:"bench-row-name",to:k(s.slug||s.id,a),children:s.name}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:s.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:s.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(vs,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:s.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:s.best_paper_route&&s.best_paper_title?e.jsx(A,{to:`/paper/${encodeURIComponent(s.best_paper_route)}`,children:s.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:s.best_code_url?e.jsx("a",{href:s.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${s.best_paper_title||s.best_model_name}`,children:e.jsx(js,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(A,{to:k(s.slug||s.id,a),"aria-label":`Compare ${s.best_model_name||"the best model"} with all results on ${s.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(_s,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s.id))]}),$.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(s=>!s),children:j?"− show top 5":`+ show ${$.length-5} more benchmarks`})]}),We&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:ie?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:Qe?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",w.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:w.map(s=>{const t=I.get(s.id)||[],l=R.has(s.id),O=l?t:t.slice(0,W),P=t.length-W;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:D(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:t.length>0?`[${t.length} benchmark${t.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),O.length>0?O.map((y,Je)=>e.jsxs("div",{className:"bench-row",onClick:()=>o(k(y.slug||y.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(Je+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:y.name}),e.jsx("div",{className:"bench-row-sub",children:y.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:y.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},y.id)):e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),P>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Ze(s.id),children:l?`− show top ${W}`:`+ show ${P} more benchmark${P===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(x.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Hs.map(([s,t])=>e.jsx("button",{className:`sort-btn ${i===s?"active":""}`,onClick:()=>u(s),children:t},s))}),e.jsx(ps,{hasCode:c,hasHfArtifacts:m,onHasCodeChange:g,onHasHfArtifactsChange:f})]}),e.jsxs("div",{className:"results-count",children:[E.length," loaded in ",e.jsx("span",{children:H})]})]}),b.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,t)=>e.jsx(q,{className:"h-40 w-full"},t))}):E.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:E.map((s,t)=>e.jsx(is,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),b.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[re.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),re.slice(0,8).map(s=>e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:D(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),B.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),B.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(ls,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Us as RecommendedFrameworkLinks,Ks as TaskBreadcrumb,xa as default};
 
1
+ import{d as be,r as h,k as Z,j as e,h as F,Y as je,m as _e,P as Xe,p as ve,l as Ne,Z as es,z as _,$ as ss,t as as,q as J,L as A,c as ts,u as ns,a as rs,f as os,M as cs}from"./index-D_-UZEuL.js";import{u as ge}from"./useQuery-BZo4MZ3s.js";import{P as is,M as ls}from"./components-CmC5jqhM.js";import{B as ds}from"./BenchmarkTrendSparkline-XIo_GVud.js";import{u as ms,P as ps}from"./useIntersectionObserver-Cq9n7uOQ.js";import{M as Q}from"./MarkdownText-QvkQ9FeM.js";import{c as fe}from"./catalog-CjU2vAfw.js";import{s as hs}from"./slug-BpH-Nkvz.js";import{d as D,t as us}from"./transform-CUuA-koJ.js";import{b as xs}from"./usePapers-BCHtBW8G.js";import{S as q}from"./skeleton-CCZ1iXls.js";import{A as gs,a as fs}from"./alert-B2j1kc2o.js";import{C as bs}from"./chevron-down-DI19XsBw.js";import{G as js}from"./github-iFSl-B6V.js";import"./LatexTitle-B7GPgo8C.js";import"./katex.min-BSBacQyE.js";import"./papers-DHqjKX7p.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-B25cD-_k.js";import"./index-vCOH2DKd.js";import"./hover-card-DiJQFgx9.js";import"./useInfiniteQuery-CFUEkcEs.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
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 vs=be("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);var z="Collapsible",[Ns,ke]=ve(z),[ks,X]=Ns(z),we=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:c,onOpenChange:m,...u}=a,[g,f]=Z({prop:r,defaultProp:i??!1,onChange:m,caller:z});return e.jsx(ks,{scope:n,disabled:c,contentId:je(),open:g,onOpenToggle:h.useCallback(()=>f(j=>!j),[f]),children:e.jsx(F.div,{"data-state":se(g),"data-disabled":c?"":void 0,...u,ref:o})})});we.displayName=z;var Ce="CollapsibleTrigger",ye=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,...r}=a,i=X(Ce,n);return e.jsx(F.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":se(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:o,onClick:_e(a.onClick,i.onOpenToggle)})});ye.displayName=Ce;var ee="CollapsibleContent",Ae=h.forwardRef((a,o)=>{const{forceMount:n,...r}=a,i=X(ee,a.__scopeCollapsible);return e.jsx(Xe,{present:n||i.open,children:({present:c})=>e.jsx(ws,{...r,ref:o,present:c})})});Ae.displayName=ee;var ws=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,present:r,children:i,...c}=a,m=X(ee,n),[u,g]=h.useState(r),f=h.useRef(null),j=Ne(o,f),v=h.useRef(0),R=v.current,S=h.useRef(0),T=S.current,k=m.open||u,N=h.useRef(k),d=h.useRef(void 0);return h.useEffect(()=>{const p=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(p)},[]),es(()=>{const p=f.current;if(p){d.current=d.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const w=p.getBoundingClientRect();v.current=w.height,S.current=w.width,N.current||(p.style.transitionDuration=d.current.transitionDuration,p.style.animationName=d.current.animationName),g(r)}},[m.open,r]),e.jsx(F.div,{"data-state":se(m.open),"data-disabled":m.disabled?"":void 0,id:m.contentId,hidden:!k,...c,ref:j,style:{"--radix-collapsible-content-height":R?`${R}px`:void 0,"--radix-collapsible-content-width":T?`${T}px`:void 0,...a.style},children:k&&i})});function se(a){return a?"open":"closed"}var Cs=we,ys=ye,As=Ae,C="Accordion",Ss=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ae,Ps,Rs]=ss(C),[K]=ve(C,[Rs,ke]),te=ke(),Se=_.forwardRef((a,o)=>{const{type:n,...r}=a,i=r,c=r;return e.jsx(ae.Provider,{scope:a.__scopeAccordion,children:n==="multiple"?e.jsx(Ms,{...c,ref:o}):e.jsx(Ts,{...i,ref:o})})});Se.displayName=C;var[Pe,Is]=K(C),[Re,Es]=K(C,{collapsible:!1}),Ts=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:c=!1,...m}=a,[u,g]=Z({prop:n,defaultProp:r??"",onChange:i,caller:C});return e.jsx(Pe,{scope:a.__scopeAccordion,value:_.useMemo(()=>u?[u]:[],[u]),onItemOpen:g,onItemClose:_.useCallback(()=>c&&g(""),[c,g]),children:e.jsx(Re,{scope:a.__scopeAccordion,collapsible:c,children:e.jsx(Ie,{...m,ref:o})})})}),Ms=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...c}=a,[m,u]=Z({prop:n,defaultProp:r??[],onChange:i,caller:C}),g=_.useCallback(j=>u((v=[])=>[...v,j]),[u]),f=_.useCallback(j=>u((v=[])=>v.filter(R=>R!==j)),[u]);return e.jsx(Pe,{scope:a.__scopeAccordion,value:m,onItemOpen:g,onItemClose:f,children:e.jsx(Re,{scope:a.__scopeAccordion,collapsible:!0,children:e.jsx(Ie,{...c,ref:o})})})}),[$s,G]=K(C),Ie=_.forwardRef((a,o)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:c="vertical",...m}=a,u=_.useRef(null),g=Ne(u,o),f=Ps(n),v=as(i)==="ltr",R=_e(a.onKeyDown,S=>{var L;if(!Ss.includes(S.key))return;const T=S.target,k=f().filter(M=>{var x;return!((x=M.ref.current)!=null&&x.disabled)}),N=k.findIndex(M=>M.ref.current===T),d=k.length;if(N===-1)return;S.preventDefault();let p=N;const w=0,I=d-1,b=()=>{p=N+1,p>I&&(p=w)},E=()=>{p=N-1,p<w&&(p=I)};switch(S.key){case"Home":p=w;break;case"End":p=I;break;case"ArrowRight":c==="horizontal"&&(v?b():E());break;case"ArrowDown":c==="vertical"&&b();break;case"ArrowLeft":c==="horizontal"&&(v?E():b());break;case"ArrowUp":c==="vertical"&&E();break}const B=p%d;(L=k[B].ref.current)==null||L.focus()});return e.jsx($s,{scope:n,disabled:r,direction:i,orientation:c,children:e.jsx(ae.Slot,{scope:n,children:e.jsx(F.div,{...m,"data-orientation":c,ref:g,onKeyDown:r?void 0:R})})})}),U="AccordionItem",[Os,ne]=K(U),Ee=_.forwardRef((a,o)=>{const{__scopeAccordion:n,value:r,...i}=a,c=G(U,n),m=Is(U,n),u=te(n),g=je(),f=r&&m.value.includes(r)||!1,j=c.disabled||a.disabled;return e.jsx(Os,{scope:n,open:f,disabled:j,triggerId:g,children:e.jsx(Cs,{"data-orientation":c.orientation,"data-state":De(f),...u,...i,ref:o,disabled:j,open:f,onOpenChange:v=>{v?m.onItemOpen(r):m.onItemClose(r)}})})});Ee.displayName=U;var Te="AccordionHeader",Me=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Te,n);return e.jsx(F.h3,{"data-orientation":i.orientation,"data-state":De(c.open),"data-disabled":c.disabled?"":void 0,...r,ref:o})});Me.displayName=Te;var Y="AccordionTrigger",$e=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Y,n),m=Es(Y,n),u=te(n);return e.jsx(ae.ItemSlot,{scope:n,children:e.jsx(ys,{"aria-disabled":c.open&&!m.collapsible||void 0,"data-orientation":i.orientation,id:c.triggerId,...u,...r,ref:o})})});$e.displayName=Y;var Oe="AccordionContent",Be=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Oe,n),m=te(n);return e.jsx(As,{role:"region","aria-labelledby":c.triggerId,"data-orientation":i.orientation,...m,...r,ref:o,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...a.style}})});Be.displayName=Oe;function De(a){return a?"open":"closed"}var Bs=Se,Ds=Ee,Fs=Me,Fe=$e,Le=Be;const Ls=Bs,He=h.forwardRef(({className:a,...o},n)=>e.jsx(Ds,{ref:n,className:J("border-b",a),...o}));He.displayName="AccordionItem";const Ve=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Fs,{className:"flex",children:e.jsxs(Fe,{ref:r,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[o,e.jsx(bs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Ve.displayName=Fe.displayName;const qe=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Le,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:J("pb-4 pt-0",a),children:o})}));qe.displayName=Le.displayName;const Hs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Vs=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",W=3,qs=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Us=({frameworks:a})=>a.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),a.map(o=>e.jsxs(A,{to:`/papers?framework=${encodeURIComponent(o.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:o.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",qs(o.num_stars)]})]},o.framework_id))]}),zs=({task:a,area:o,parents:n})=>e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/tasks",children:"Tasks"}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:`/tasks#area-${hs(o.name)}`,children:o.name})]}),[...n].reverse().map(r=>e.jsxs(_.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:`/tasks/${r.slug||r.id}`,children:D(r.name,r.slug)})]},r.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:D(a.name,a.slug)})]}),Ks=a=>[...a].sort((o,n)=>{const r=o.slug==="classic-language-modeling",i=n.slug==="classic-language-modeling";return r!==i?r?1:-1:0}),xa=()=>{var le,de,me,pe,he,ue,xe;const{taskSlug:a}=ts(),o=ns(),[n,r]=rs(),i=Vs(n.get("order_by")),c=n.get("has_code")==="true",m=n.get("has_hf_artifacts")==="true",u=s=>{const t=new URLSearchParams(n);t.set("order_by",s),r(t)},g=s=>{const t=new URLSearchParams(n);s?t.set("has_code","true"):t.delete("has_code"),r(t)},f=s=>{const t=new URLSearchParams(n);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},[j,v]=h.useState(!1),[R,S]=h.useState(()=>new Set),{preferences:T}=os(),k=(s,t)=>{const l=s||"";return t?`/benchmark/${l}?task=${encodeURIComponent(t)}`:`/benchmark/${l}`},N=T.hide_closed_source_evals?!0:void 0,d=ge({queryKey:["task-page",a,N],queryFn:()=>fe.taskPage(a,{is_open:N}),enabled:!!a,staleTime:10*60*1e3});h.useEffect(()=>{var l;const s=(l=d.data)==null?void 0:l.task.slug;if(!a||!s||s===a)return;const t=n.toString();o(`/tasks/${s}${t?`?${t}`:""}`,{replace:!0})},[o,(le=d.data)==null?void 0:le.task.slug,n,a]);const p=ge({queryKey:["task-benchmark-trends",a,N],queryFn:()=>fe.trendingBenchmarks(a,{limit:100,min_recent_papers:0,is_open:N}),enabled:!!a,staleTime:10*60*1e3}),w=h.useMemo(()=>{var s;return Ks(((s=d.data)==null?void 0:s.children)||[])},[d.data]),I=h.useMemo(()=>{var t;const s=new Map;return(((t=d.data)==null?void 0:t.subtask_benchmarks)||[]).forEach(l=>{s.set(l.subtask_id,l.benchmarks||[])}),s},[d.data]),b=xs({taskId:((me=(de=d.data)==null?void 0:de.task)==null?void 0:me.id)||"",page_size:20,order_by:i,order_dir:"desc",include_resources:!0,has_code:c,has_hf_artifacts:m,enabled:!!((he=(pe=d.data)==null?void 0:pe.task)!=null&&he.id)}),E=h.useMemo(()=>{var t;return(((t=b.data)==null?void 0:t.pages.flatMap(l=>l.results))||[]).map(us)},[b.data]),B=h.useMemo(()=>{var t;const s={};return(t=b.data)==null||t.pages.forEach(l=>l.results.forEach(O=>(O.methods||[]).forEach(P=>{const y=P.slug||P.id;s[y]||(s[y]={id:P.id,name:P.name,slug:P.slug||"",count:0}),s[y].count++}))),Object.values(s).sort((l,O)=>O.count-l.count).slice(0,8)},[b.data]),{targetRef:L,isIntersecting:M}=ms({rootMargin:"200px"});if(h.useEffect(()=>{M&&b.hasNextPage&&!b.isFetchingNextPage&&b.fetchNextPage()},[M,b.hasNextPage,b.isFetchingNextPage]),d.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(q,{className:"h-12 w-1/2 mb-4"}),e.jsx(q,{className:"h-6 w-1/3 mb-8"}),e.jsx(q,{className:"h-64 w-full"})]});if(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(gs,{variant:"destructive",children:e.jsx(fs,{children:"Task not found."})})});const x=d.data.task,Ue=d.data.parents||[],H=D(x.name,x.slug),re=(d.data.sisters||[]).filter(s=>s.id!==x.id),ze=d.data.recommended_frameworks||[],V=d.data.benchmarks||[],Ke=new Map(V.map(s=>[s.id,s])),Ge=new Set(V.map(s=>s.id)),oe=(((ue=p.data)==null?void 0:ue.results)||[]).filter(s=>Ge.has(s.id)).map(s=>{const t=Ke.get(s.id);return{...s,best_model_name:(t==null?void 0:t.best_model_name)??s.best_model_name,best_paper_route:t==null?void 0:t.best_paper_route,best_paper_title:t==null?void 0:t.best_paper_title,best_code_url:t==null?void 0:t.best_code_url}}),$=oe.length?oe:V.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),ce=((xe=p.data)==null?void 0:xe.recent_days)||90,Qe=w.some(s=>(I.get(s.id)||[]).length>0),We=w.length>0,ie=$.length>0,Ye=(()=>{const s=new Set;return V.forEach(t=>s.add(t.id)),I.forEach(t=>t.forEach(l=>s.add(l.id))),s.size})(),Ze=s=>{S(t=>{const l=new Set(t);return l.has(s)?l.delete(s):l.add(s),l})};return e.jsxs("div",{className:"page",children:[e.jsx(zs,{task:x,area:d.data.area,parents:Ue}),e.jsxs("div",{className:x.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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:H}),x.description&&e.jsx(Q,{className:"task-explainer",text:x.description}),x.research_trends&&x.research_trends.length>0&&e.jsx(Ls,{className:"task-research-trends",type:"single",collapsible:!0,children:e.jsxs(He,{className:"task-research-trends-item",value:"key-trends",children:[e.jsx(Ve,{className:"task-research-trends-trigger",children:e.jsx("span",{className:"task-research-trends-title",children:"Key trends"})}),e.jsx(qe,{className:"task-research-trends-content",children:e.jsx("ul",{children:x.research_trends.map((s,t)=>e.jsx("li",{children:e.jsx(Q,{text:s})},t))})})]})}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(x.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:Ye}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[B.length,"+"]}),"METHODS USED"]})]}),e.jsx(Us,{frameworks:ze})]}),x.image_url&&e.jsxs("figure",{className:`task-figure-card${x.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:cs(x.image_url)??void 0,alt:`${H} schematic`,onError:s=>{var t,l;(l=(t=s.currentTarget.parentElement)==null?void 0:t.parentElement)==null||l.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",H,x.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Q,{className:"task-image-credit",text:x.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[ie&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[ce,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",$.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),(j?$:$.slice(0,5)).map(s=>e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ds,{history:s.history,benchmarkName:s.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:s.recent_paper_count})," ",s.recent_paper_count===1?"paper":"papers"," /"," ",ce,"d"]}),s.rate_change==null?s.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${s.rate_change>=1?"is-up":"is-down"}`,children:[s.rate_change>=1?"↑":"↓"," ",s.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(A,{className:"bench-row-name",to:k(s.slug||s.id,a),children:s.name}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:s.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:s.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(vs,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:s.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:s.best_paper_route&&s.best_paper_title?e.jsx(A,{to:`/paper/${encodeURIComponent(s.best_paper_route)}`,children:s.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:s.best_code_url?e.jsx("a",{href:s.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${s.best_paper_title||s.best_model_name}`,children:e.jsx(js,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(A,{to:k(s.slug||s.id,a),"aria-label":`Compare ${s.best_model_name||"the best model"} with all results on ${s.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(_s,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s.id))]}),$.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(s=>!s),children:j?"− show top 5":`+ show ${$.length-5} more benchmarks`})]}),We&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:ie?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:Qe?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",w.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:w.map(s=>{const t=I.get(s.id)||[],l=R.has(s.id),O=l?t:t.slice(0,W),P=t.length-W;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:D(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:t.length>0?`[${t.length} benchmark${t.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),O.length>0?O.map((y,Je)=>e.jsxs("div",{className:"bench-row",onClick:()=>o(k(y.slug||y.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(Je+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:y.name}),e.jsx("div",{className:"bench-row-sub",children:y.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:y.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},y.id)):e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),P>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Ze(s.id),children:l?`− show top ${W}`:`+ show ${P} more benchmark${P===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(x.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Hs.map(([s,t])=>e.jsx("button",{className:`sort-btn ${i===s?"active":""}`,onClick:()=>u(s),children:t},s))}),e.jsx(ps,{hasCode:c,hasHfArtifacts:m,onHasCodeChange:g,onHasHfArtifactsChange:f})]}),e.jsxs("div",{className:"results-count",children:[E.length," loaded in ",e.jsx("span",{children:H})]})]}),b.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,t)=>e.jsx(q,{className:"h-40 w-full"},t))}):E.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:E.map((s,t)=>e.jsx(is,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),b.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[re.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),re.slice(0,8).map(s=>e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:D(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),B.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),B.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(ls,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Us as RecommendedFrameworkLinks,zs as TaskBreadcrumb,xa as default};
assets/{TagsIndexView-DZXTETvq.js → TagsIndexView-Zr6z-Y-4.js} RENAMED
@@ -1 +1 @@
1
- import{r as m,j as s,L as p}from"./index-BrhBTT14.js";import{u as h}from"./useQuery-GhY2LXSI.js";import{c as g}from"./catalog-CkpmYxEk.js";import{c as x,h as f,d as u}from"./transform-Duf4Shfn.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as d}from"./skeleton-DHdzoBmM.js";import{A as y,a as k}from"./alert-c1n3ZtEC.js";import{T as v}from"./TaxonomySuggestionTile-BkE17zPJ.js";import"./SignInToEditDialog-Dcu4wTOX.js";import"./button-CusGeqPB.js";import"./textarea-D6mDqvzM.js";import"./dialog-BhRZv4T5.js";import"./useMutation-DqfuSW7Q.js";import"./submissions-C1hG3qlt.js";import"./loader-circle-BqZ1qbXL.js";const N=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",I=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>e[N(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=m.useMemo(()=>o.reduce((e,a)=>e+a.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(y,{variant:"destructive",children:s.jsx(k,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,a)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>s.jsx(d,{className:"h-24"},t))})]},a))}):o.map(e=>{const a=e.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return s.jsxs("section",{id:`area-${j(e.name)}`,style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[a.map(t=>{const i=t.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)}),s.jsx(v,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{I as default};
 
1
+ import{r as m,j as s,L as p}from"./index-D_-UZEuL.js";import{u as h}from"./useQuery-BZo4MZ3s.js";import{c as g}from"./catalog-CjU2vAfw.js";import{c as x,h as f,d as u}from"./transform-CUuA-koJ.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as d}from"./skeleton-CCZ1iXls.js";import{A as y,a as k}from"./alert-B2j1kc2o.js";import{T as v}from"./TaxonomySuggestionTile-DgDd6ghr.js";import"./SignInToEditDialog-DZLQNGaN.js";import"./button-Cc8PFtC1.js";import"./textarea-DlQmtN_E.js";import"./dialog-ChaQ5z93.js";import"./useMutation-P0Dg96Vh.js";import"./submissions-BpzsA2lc.js";import"./loader-circle-D1SscQUT.js";const N=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",I=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>e[N(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=m.useMemo(()=>o.reduce((e,a)=>e+a.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(y,{variant:"destructive",children:s.jsx(k,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,a)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>s.jsx(d,{className:"h-24"},t))})]},a))}):o.map(e=>{const a=e.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return s.jsxs("section",{id:`area-${j(e.name)}`,style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[a.map(t=>{const i=t.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)}),s.jsx(v,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{I as default};
assets/{TaxonomySuggestionTile-BkE17zPJ.js → TaxonomySuggestionTile-DgDd6ghr.js} RENAMED
@@ -1 +1 @@
1
- import{f as u,r as o,j as e}from"./index-BrhBTT14.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-Dcu4wTOX.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{y as u,r as o,j as e}from"./index-D_-UZEuL.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-DZLQNGaN.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-BvtNL0dp.js DELETED
@@ -1 +0,0 @@
1
- import{U as I,R as X,j as e}from"./index-BrhBTT14.js";import{u as G}from"./useQuery-GhY2LXSI.js";import{A as J,a as E}from"./alert-c1n3ZtEC.js";import{S as P}from"./skeleton-DHdzoBmM.js";class Q{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const V=new Q(I),m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},Y=()=>V.trends(),f=980,j=400,x=62,R=26,g=30,K=58,u=f-x-R,A=j-g-K,v=g+A,U=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s<t.length-1;s+=1){const l=t[s-1]??t[s],c=t[s],o=t[s+1],a=t[s+2]??o,y=c[0]+(o[0]-l[0])/6,i=c[1]+(o[1]-l[1])/6,b=o[0]-(a[0]-c[0])/6,d=o[1]-(a[1]-c[1])/6;r+=` C ${y} ${i} ${b} ${d} ${o[0]} ${o[1]}`}return r},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"},L=({id:t,data:r,color:s,yTicks:l,yLabel:c,xLabel:o})=>{const[a,y]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+A*(1-n/b);if(i===0)return null;const B=r.map((n,h)=>[d(h),p(n.percent)]),F=U(B),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},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(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-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:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,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:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-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+A/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:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[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(r[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:s,display:"inline-block"}}),r[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:r.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)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={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},re=()=>{const t=G({queryKey:["research-trends"],queryFn:Y,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(J,{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:M,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(L,{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:M,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(L,{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:C,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:C,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{re as default};
 
 
assets/TrendsView-Gyl495vi.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{a0 as I,z as X,j as e}from"./index-D_-UZEuL.js";import{u as G}from"./useQuery-BZo4MZ3s.js";import{A as J,a as E}from"./alert-B2j1kc2o.js";import{S as P}from"./skeleton-CCZ1iXls.js";class Q{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const V=new Q(I),m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},Y=()=>V.trends(),f=980,j=400,x=62,B=26,g=30,K=58,u=f-x-B,A=j-g-K,v=g+A,Z=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s<t.length-1;s+=1){const l=t[s-1]??t[s],c=t[s],o=t[s+1],a=t[s+2]??o,y=c[0]+(o[0]-l[0])/6,i=c[1]+(o[1]-l[1])/6,b=o[0]-(a[0]-c[0])/6,d=o[1]-(a[1]-c[1])/6;r+=` C ${y} ${i} ${b} ${d} ${o[0]} ${o[1]}`}return r},z={fontFamily:"var(--mono)",fontSize:12,fill:"var(--ink-faint)"},W={fontFamily:"var(--mono)",fontSize:11,fontWeight:600,letterSpacing:"0.14em",fill:"var(--ink-faint)",textTransform:"uppercase"},L=({id:t,data:r,color:s,yTicks:l,yLabel:c,xLabel:o})=>{const[a,y]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=Z(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},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(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-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:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:z,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:z,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:W,children:o}),e.jsx("text",{transform:`translate(16 ${g+A/2}) rotate(-90)`,textAnchor:"middle",style:W,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[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(r[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:s,display:"inline-block"}}),r[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:r.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)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={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},re=()=>{const t=G({queryKey:["research-trends"],queryFn:Y,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(J,{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:M,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(L,{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:M,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(L,{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:C,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:C,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{re as default};
assets/{UserProfileView-CRGhrhTR.js → UserProfileView-flvwm70w.js} RENAMED
@@ -1 +1 @@
1
- import{ag as i,A as n,e as o,j as e,at as d}from"./index-BrhBTT14.js";import{u as l}from"./useQuery-GhY2LXSI.js";import{C as c}from"./OrganizationContributionGraph-0Wm7L2tv.js";import"./skeleton-DHdzoBmM.js";import"./catalog-CkpmYxEk.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},f=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(c,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default};
 
1
+ import{al as i,A as n,c as o,j as e,ay as d}from"./index-D_-UZEuL.js";import{u as l}from"./useQuery-BZo4MZ3s.js";import{C as c}from"./OrganizationContributionGraph-BroNa3f8.js";import"./skeleton-CCZ1iXls.js";import"./catalog-CjU2vAfw.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},f=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(c,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default};
assets/__vite-browser-external-BIHI7g3E.js ADDED
@@ -0,0 +1 @@
 
 
1
+ const e={};export{e as default};
assets/alert-B2j1kc2o.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{r as a,j as s,q as l,a2 as i}from"./index-D_-UZEuL.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};