Spaces:
Running
Running
Sync paperswithcode.co frontend
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- assets/{AiDeadlinesView-lL8L7LsK.js → AiDeadlinesView-Ck5tHepw.js} +2 -2
- assets/AuthorDetailView-BOk0OQvW.js +1 -0
- assets/AuthorDetailView-Dd79awoH.js +0 -1
- assets/{BenchmarkDetailView-0LYBbhHf.js → BenchmarkDetailView-BJy5bfdc.js} +2 -2
- assets/{BenchmarkTrendSparkline-CQAF3-gO.js → BenchmarkTrendSparkline-oxhkZj1F.js} +1 -1
- assets/{ChatMessage-1oGkBBMo.js → ChatMessage-DoWa4hRO.js} +1 -1
- assets/{ChatView-BlJPrYkl.js → ChatView-CjQ5x7JL.js} +2 -2
- assets/ConferenceDetailView-DpykNgzJ.js +1 -0
- assets/ConferenceDetailView-XO1Uuoz9.js +0 -1
- assets/ConferenceTaskView-BXB7Bl8c.js +1 -0
- assets/ConferenceTaskView-DrlJZb2a.js +0 -1
- assets/ConferencesIndexView-B7z069Mo.js +0 -1
- assets/ConferencesIndexView-BqcudkGR.js +1 -0
- assets/ContributionsPage-BnW2_Wpc.js +1 -0
- assets/CronDashboard-D2jbvH3D.js +0 -66
- assets/CronDashboard-vvBpWdzK.js +66 -0
- assets/{ExternalSourceEvalBadge-CgpOekCN.js → ExternalSourceEvalBadge-DyWbMNlx.js} +1 -1
- assets/FeedView-CjMgiRfQ.js +0 -1
- assets/FeedView-DKcTVApQ.js +1 -0
- assets/FrameworksIndexView-7hnBIs3s.js +1 -0
- assets/FrameworksIndexView-BxbTwJZt.js +0 -1
- assets/{LatexTitle-nKm6G6V5.js → LatexTitle-BWD9oOWn.js} +1 -1
- assets/{MarkdownText-BuawND0S.js → MarkdownText-g9v8ocG0.js} +1 -1
- assets/MethodDetailView-Bo-Srxo6.js +0 -1
- assets/MethodDetailView-dJffY-jK.js +1 -0
- assets/{MethodsIndexView-C-fwph8R.js → MethodsIndexView-DZ9FMSze.js} +2 -2
- assets/{NotFound-Ce0_Y2Nt.js → NotFound-CWr2aUkR.js} +1 -1
- assets/OrganizationDetailView-BsmKK6Ux.js +1 -0
- assets/OrganizationDetailView-CrUNAiga.js +0 -1
- assets/{OrganizationPaperFeed-DwiJGjIb.js → OrganizationPaperFeed-QOOCyRuu.js} +1 -1
- assets/OrganizationTaskView-D3sFrcnl.js +1 -0
- assets/OrganizationTaskView-DL7qJ2OX.js +0 -1
- assets/OrganizationsIndexView-D07k7lxt.js +0 -1
- assets/OrganizationsIndexView-Dh2CQVzb.js +1 -0
- assets/PaperDetailView-7Sd0agQy.js +0 -0
- assets/PaperDetailView-D-AGd5B3.js +0 -29
- assets/{PaperFeedFilters-DWsoFzku.js → PaperFeedFilters-4l2Zc9pi.js} +1 -1
- assets/{PaperPreviewLink-BhsnwX7g.js → PaperPreviewLink-Do8kbf9Q.js} +4 -4
- assets/PapersListView-CKAjjigR.js +0 -1
- assets/PapersListView-CTiQmFtQ.js +1 -0
- assets/SavedPapersView-EyfoA2kZ.js +0 -1
- assets/SavedPapersView-XNrr6YrB.js +1 -0
- assets/SearchOverlay-B4YuOVax.js +1 -0
- assets/SearchOverlay-Bnp7d4cA.js +0 -1
- assets/{SettingsView-DMMnsurz.js → SettingsView-DU7bq-S9.js} +2 -2
- assets/SharedChatView-BE2a2xSa.js +0 -1
- assets/SharedChatView-CULmFPKQ.js +1 -0
- assets/{SignInToEditDialog-BoeWau__.js → SignInToEditDialog-D5M5vIDC.js} +1 -1
- assets/{SubmissionsDashboard-DmsnloPS.js → SubmissionsDashboard-XlWQ5g59.js} +2 -2
- assets/{SubmitView-Bt8gksJA.js → SubmitView-DPve1BBN.js} +1 -1
assets/{AiDeadlinesView-lL8L7LsK.js → AiDeadlinesView-Ck5tHepw.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
import{r as x,j as t,b as E}from"./index-
|
| 2 |
`)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),Z=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`;window.open(s,"_blank","noopener,noreferrer")},ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
|
| 3 |
-
`),g=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(g),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},te=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?I(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),g=e?z(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,p=s?new Date(s.deadline_at).getTime():null;return t.jsx(V,{open:a,onOpenChange:n,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(Y,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[g&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:g})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),p!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(p,r)},children:J(p,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,m)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,u=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(u?null:y,r)},children:X(y,r)})]},`${d.type??"deadline"}-${m}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},M=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ne=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),g=s?new Date(s.deadline_at).getTime():null,c=_(i?g:null,a),p=z(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:g!=null?Q(g,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[p&&t.jsx("span",{children:p}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(m=>{const y=n.has(m);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(m)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(m)},m)})})]})},ce=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,g]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),p=A({queryKey:["conference-deadlines"],queryFn:()=>E.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(u=>{const h=new Set(u);return h.has(l)?h.delete(l):h.add(l),h})},m=x.useMemo(()=>{var u;const l=new Map;return(u=p.data)==null||u.results.forEach(h=>{D(h).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((h,j)=>j[1]-h[1]).map(([h])=>h)},[p.data]),y=x.useMemo(()=>{var j;const u=(((j=p.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),h=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,w)=>{const v=h(f),N=h(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[p.data,e,n,o,c]);return p.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(O,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(M,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(M,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),m.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[m.map(l=>{const u=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:p.isLoading?"…":`${y.length} conferences`})}),p.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,u)=>t.jsx(U,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ne,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:g},l.id))}),t.jsx(te,{conf:s,open:s!==null,onOpenChange:l=>{l||g(null)}})]})};export{ce as default};
|
|
|
|
| 1 |
+
import{r as x,j as t,b as E}from"./index-ClYrAl8a.js";import{u as A}from"./useQuery-Drr20jTc.js";import{S as B}from"./switch-DyXkTRJe.js";import{S as U}from"./skeleton-C5gy1_r-.js";import{A as W,a as O}from"./alert-2CUZfv8i.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-zw8tnspo.js";import"./useBaseQuery-DlkwakD5.js";import"./index-CxV-iX7n.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),H=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(H).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),z=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},I=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>I(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=I(e);return a.length?a[a.length-1]:null},Q=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},X=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=z(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(`
|
| 2 |
`)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),Z=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`;window.open(s,"_blank","noopener,noreferrer")},ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
|
| 3 |
+
`),g=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(g),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},te=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?I(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),g=e?z(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,p=s?new Date(s.deadline_at).getTime():null;return t.jsx(V,{open:a,onOpenChange:n,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(Y,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[g&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:g})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),p!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(p,r)},children:J(p,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,m)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,u=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(u?null:y,r)},children:X(y,r)})]},`${d.type??"deadline"}-${m}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},M=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ne=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),g=s?new Date(s.deadline_at).getTime():null,c=_(i?g:null,a),p=z(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:g!=null?Q(g,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[p&&t.jsx("span",{children:p}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(m=>{const y=n.has(m);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(m)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(m)},m)})})]})},me=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,g]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),p=A({queryKey:["conference-deadlines"],queryFn:()=>E.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(u=>{const h=new Set(u);return h.has(l)?h.delete(l):h.add(l),h})},m=x.useMemo(()=>{var u;const l=new Map;return(u=p.data)==null||u.results.forEach(h=>{D(h).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((h,j)=>j[1]-h[1]).map(([h])=>h)},[p.data]),y=x.useMemo(()=>{var j;const u=(((j=p.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),h=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,w)=>{const v=h(f),N=h(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[p.data,e,n,o,c]);return p.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(O,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(M,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(M,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),m.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[m.map(l=>{const u=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:p.isLoading?"…":`${y.length} conferences`})}),p.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,u)=>t.jsx(U,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ne,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:g},l.id))}),t.jsx(te,{conf:s,open:s!==null,onOpenChange:l=>{l||g(null)}})]})};export{me as default};
|
assets/AuthorDetailView-BOk0OQvW.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as m,j as e,L as g,b as h}from"./index-ClYrAl8a.js";import{u as d}from"./useQuery-Drr20jTc.js";import{S as c}from"./skeleton-C5gy1_r-.js";import x from"./NotFound-CWr2aUkR.js";import"./useBaseQuery-DlkwakD5.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default};
|
assets/AuthorDetailView-Dd79awoH.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as m,j as e,L as g,b as h}from"./index-aFSBl9QY.js";import{u as d}from"./useQuery-BTZGCW5c.js";import{S as c}from"./skeleton-i1TSOWrq.js";import x from"./NotFound-Ce0_Y2Nt.js";const N=()=>{var l,n,i,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((l=r.error)==null?void 0:l.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((n=r.data)==null?void 0:n.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((i=r.data)==null?void 0:i.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{N as default};
|
|
|
|
|
|
assets/{BenchmarkDetailView-0LYBbhHf.js → BenchmarkDetailView-BJy5bfdc.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
import{e as vt,u as jt,S as _t,r as w,j as n,L as me,Z as ne,g as kt,a as St,b as ee}from"./index-aFSBl9QY.js";import{u as te}from"./useQuery-BTZGCW5c.js";import{S as xe}from"./skeleton-i1TSOWrq.js";import{S as Je}from"./switch-BF9mzYof.js";import{A as Ct,a as Et}from"./alert-u8e1tjxL.js";import{L as ye}from"./LatexTitle-nKm6G6V5.js";import{I as Nt}from"./components-3ObcZwMF.js";import{C as Rt,E as Tt}from"./ExternalSourceEvalBadge-CgpOekCN.js";import{B as $t}from"./BenchmarkTrendSparkline-CQAF3-gO.js";import"./index-DLKGWB-W.js";import"./katex.min-BSBacQyE.js";import"./transform-DQ9X1I92.js";import"./hover-card-BZrFUFNS.js";function Mt(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 Ft=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let re=null;function dt(e={}){return re||(e.includeStyleProperties?(re=e.includeStyleProperties,re):(re=q(window.getComputedStyle(document.documentElement)),re))}function we(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Lt(e){const t=we(e,"border-left-width"),r=we(e,"border-right-width");return e.clientWidth+t+r}function It(e){const t=we(e,"border-top-width"),r=we(e,"border-bottom-width");return e.clientHeight+t+r}function ut(e,t={}){const r=t.width||Lt(e),s=t.height||It(e);return{width:r,height:s}}function Pt(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const D=16384;function At(e){(e.width>D||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Dt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c<a;c+=1)i[c]=s.charCodeAt(c);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ve(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Bt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ht(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),Bt(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Vt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ot(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Ut(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Vt(r):Ot(r,s);return document.createTextNode(`${a}{${i}}`)}function Ze(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Ft();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Ut(c,r,a,s)),t.appendChild(l)}function Wt(e,t,r){Ze(e,t,":before",r),Ze(e,t,":after",r)}const et="application/font-woff",tt="image/jpeg",qt={woff:et,woff2:et,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:tt,jpeg:tt,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 $e(e){const t=zt(e).toLowerCase();return qt[t]||""}function Gt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Kt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ce={};function Qt(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=Qt(e,t,r.includeQueryParams);if(Ce[s]!=null)return Ce[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Gt(l)));a=Kt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ce[s]=a,a}async function Xt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function Yt(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function Jt(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zt(e,t){return P(e,HTMLCanvasElement)?Xt(e):P(e,HTMLVideoElement)?Yt(e,t):P(e,HTMLIFrameElement)?Jt(e,t):e.cloneNode(ht(e))}const er=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function tr(e,t,r){var s,a;if(ht(t))return t;let i=[];return er(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function rr(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function sr(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function nr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function ar(e,t,r){return P(t,Element)&&(rr(e,t,r),Wt(e,t,r),sr(e,t),nr(e,t)),t}async function ir(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const l=r[i].getAttribute("xlink:href");if(l){const u=e.querySelector(l),p=document.querySelector(l);!u&&p&&!s[l]&&(s[l]=await je(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",c=document.createElementNS(i,"svg");c.setAttribute("xmlns",i),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const l=document.createElementNS(i,"defs");c.appendChild(l);for(let u=0;u<a.length;u++)l.appendChild(a[u]);e.appendChild(c)}return e}async function je(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>Zt(s,t)).then(s=>tr(e,s,t)).then(s=>ar(e,s,t)).then(s=>ir(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,cr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function or(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function dr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function ur(e,t,r,s,a){try{const i=r?Mt(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(or(t),`$1${l}$3`)}catch{}return e}function mr(e,{preferredFontFormat:t}){return t?e.replace(lr,r=>{for(;;){const[s,,a]=cr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=mr(e,r);return dr(s).reduce((i,c)=>i.then(l=>ur(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function hr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function fr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function pr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await hr(e,t),await fr(e,t),await pr(e,t))}function gr(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 rt={};async function st(e){let t=rt[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},rt[e]=t,t}async function nt(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function at(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function xr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=st(u).then(f=>nt(f,t)).then(f=>at(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(st(a.href).then(l=>nt(l,t)).then(l=>at(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function br(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function yr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await xr(r,t);return br(s)}function bt(e){return e.trim().replace(/["']/g,"")}function wr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function vr(e,t){const r=await yr(e,t),s=wr(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(`
|
| 2 |
-
`)}async function jr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await vr(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}=ut(e,t),a=await je(e,t,!0);return await jr(a,t),await xt(a,t),gr(a,t),await Ht(a,r,s)}async function kr(e,t={}){const{width:r,height:s}=ut(e,t),a=await _r(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Pt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||At(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Sr(e,t={}){const r=await kr(e,t);return await Dt(r)}const Te="#ffffff";function Cr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Er(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Cr():t}async function Nr(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 Sr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Er(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}function Rr(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}const Tr=5;function $r(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}function it(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 Mr(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 c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Fr=({points:e,metric:t})=>{const r=St(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>it(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(it(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o<N.length;o++){const m=N[o-1],k=N[o],v=(m.x+k.x)/2;O+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const H=5.4,fe=8,J=9,A=o=>{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return M<l?(M=l,C=l+v,V="start"):C>i-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;o<N.length-1;o++){const m=A(N[o]);m&&(m.left<_e+fe||b&&m.right>b.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Mr(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;B<l&&(B=l),B+C>i-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Lr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Ir(e){const t=new Map;for(const r of e){const s=Lr(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 ct(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function lt(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Pr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.value<i:f.value>i;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const ot=({targetRef:e,label:t})=>{const{toast:r}=kt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await Nr(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx(Nt,{name:"copy",size:11}),l]})},Xr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=vt(),[t]=jt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=_t(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Rr(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Ir(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Tr),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Pr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:lt(d,b)-lt(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>ct(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||$r(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx($t,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ot,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Fr,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ot,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=ct(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Rt,{}),(h.external??h.is_external)&&n.jsx(Tt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Xr as default};
|
|
|
|
| 1 |
+
import{e as vt,u as jt,T as _t,r as w,j as n,L as me,_ as ne,g as kt,a as St,b as ee}from"./index-ClYrAl8a.js";import{u as te}from"./useQuery-Drr20jTc.js";import{S as xe}from"./skeleton-C5gy1_r-.js";import{S as Je}from"./switch-DyXkTRJe.js";import{A as Ct,a as Et}from"./alert-2CUZfv8i.js";import{L as ye}from"./LatexTitle-BWD9oOWn.js";import{I as Nt}from"./components-C_OCzHXF.js";import{C as Rt,E as Tt}from"./ExternalSourceEvalBadge-DyWbMNlx.js";import{B as $t}from"./BenchmarkTrendSparkline-oxhkZj1F.js";import"./useBaseQuery-DlkwakD5.js";import"./index-CxV-iX7n.js";import"./katex.min-BSBacQyE.js";import"./transform-BxrCkLtR.js";import"./hover-card-BDewF190.js";function Mt(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 Ft=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let re=null;function dt(e={}){return re||(e.includeStyleProperties?(re=e.includeStyleProperties,re):(re=q(window.getComputedStyle(document.documentElement)),re))}function we(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Lt(e){const t=we(e,"border-left-width"),r=we(e,"border-right-width");return e.clientWidth+t+r}function It(e){const t=we(e,"border-top-width"),r=we(e,"border-bottom-width");return e.clientHeight+t+r}function ut(e,t={}){const r=t.width||Lt(e),s=t.height||It(e);return{width:r,height:s}}function Pt(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const D=16384;function At(e){(e.width>D||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Dt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c<a;c+=1)i[c]=s.charCodeAt(c);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ve(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Bt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ht(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),Bt(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Vt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ot(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Ut(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Vt(r):Ot(r,s);return document.createTextNode(`${a}{${i}}`)}function Ze(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Ft();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Ut(c,r,a,s)),t.appendChild(l)}function Wt(e,t,r){Ze(e,t,":before",r),Ze(e,t,":after",r)}const et="application/font-woff",tt="image/jpeg",qt={woff:et,woff2:et,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:tt,jpeg:tt,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 $e(e){const t=zt(e).toLowerCase();return qt[t]||""}function Gt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Kt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ce={};function Qt(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=Qt(e,t,r.includeQueryParams);if(Ce[s]!=null)return Ce[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Gt(l)));a=Kt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ce[s]=a,a}async function Xt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function Yt(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function Jt(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zt(e,t){return P(e,HTMLCanvasElement)?Xt(e):P(e,HTMLVideoElement)?Yt(e,t):P(e,HTMLIFrameElement)?Jt(e,t):e.cloneNode(ht(e))}const er=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function tr(e,t,r){var s,a;if(ht(t))return t;let i=[];return er(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function rr(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function sr(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function nr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function ar(e,t,r){return P(t,Element)&&(rr(e,t,r),Wt(e,t,r),sr(e,t),nr(e,t)),t}async function ir(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const l=r[i].getAttribute("xlink:href");if(l){const u=e.querySelector(l),p=document.querySelector(l);!u&&p&&!s[l]&&(s[l]=await je(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",c=document.createElementNS(i,"svg");c.setAttribute("xmlns",i),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const l=document.createElementNS(i,"defs");c.appendChild(l);for(let u=0;u<a.length;u++)l.appendChild(a[u]);e.appendChild(c)}return e}async function je(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>Zt(s,t)).then(s=>tr(e,s,t)).then(s=>ar(e,s,t)).then(s=>ir(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,cr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function or(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function dr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function ur(e,t,r,s,a){try{const i=r?Mt(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(or(t),`$1${l}$3`)}catch{}return e}function mr(e,{preferredFontFormat:t}){return t?e.replace(lr,r=>{for(;;){const[s,,a]=cr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=mr(e,r);return dr(s).reduce((i,c)=>i.then(l=>ur(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function hr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function fr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function pr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await hr(e,t),await fr(e,t),await pr(e,t))}function gr(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 rt={};async function st(e){let t=rt[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},rt[e]=t,t}async function nt(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function at(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function xr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=st(u).then(f=>nt(f,t)).then(f=>at(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(st(a.href).then(l=>nt(l,t)).then(l=>at(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function br(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function yr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await xr(r,t);return br(s)}function bt(e){return e.trim().replace(/["']/g,"")}function wr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function vr(e,t){const r=await yr(e,t),s=wr(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(`
|
| 2 |
+
`)}async function jr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await vr(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}=ut(e,t),a=await je(e,t,!0);return await jr(a,t),await xt(a,t),gr(a,t),await Ht(a,r,s)}async function kr(e,t={}){const{width:r,height:s}=ut(e,t),a=await _r(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Pt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||At(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Sr(e,t={}){const r=await kr(e,t);return await Dt(r)}const Te="#ffffff";function Cr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Er(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Cr():t}async function Nr(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 Sr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Er(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}function Rr(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}const Tr=5;function $r(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}function it(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 Mr(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 c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Fr=({points:e,metric:t})=>{const r=St(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>it(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(it(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o<N.length;o++){const m=N[o-1],k=N[o],v=(m.x+k.x)/2;O+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const H=5.4,fe=8,J=9,A=o=>{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return M<l?(M=l,C=l+v,V="start"):C>i-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;o<N.length-1;o++){const m=A(N[o]);m&&(m.left<_e+fe||b&&m.right>b.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Mr(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;B<l&&(B=l),B+C>i-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Lr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Ir(e){const t=new Map;for(const r of e){const s=Lr(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 ct(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function lt(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Pr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.value<i:f.value>i;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const ot=({targetRef:e,label:t})=>{const{toast:r}=kt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await Nr(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx(Nt,{name:"copy",size:11}),l]})},Yr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=vt(),[t]=jt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=_t(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Rr(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Ir(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Tr),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Pr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:lt(d,b)-lt(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>ct(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||$r(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx($t,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ot,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Fr,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ot,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=ct(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Rt,{}),(h.external??h.is_external)&&n.jsx(Tt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Yr as default};
|
assets/{BenchmarkTrendSparkline-CQAF3-gO.js → BenchmarkTrendSparkline-oxhkZj1F.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as C,j as t}from"./index-
|
|
|
|
| 1 |
+
import{r as C,j as t}from"./index-ClYrAl8a.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-1oGkBBMo.js → ChatMessage-DoWa4hRO.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as E,r as g,j as t,R as f}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as E,r as g,j as t,R as f}from"./index-ClYrAl8a.js";import{M as b,S as v,A as T,m as P,n as _,o as S}from"./chatSessions-MtbDAqMr.js";import"./katex.min-BSBacQyE.js";import{P as k,r as M,a as R}from"./PaperPreviewLink-Do8kbf9Q.js";import{M as C,r as L,d as U}from"./index-DmFk7249.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ChatView-BlJPrYkl.js → ChatView-CjQ5x7JL.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as ze,d as Ye,r as o,e as Xe,a as Je,u as Qe,f as Ze,g as et,j as n}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
@@ -13,4 +13,4 @@ import{c as ze,d as Ye,r as o,e as Xe,a as Je,u as Qe,f as Ze,g as et,j as n}fro
|
|
| 13 |
|
| 14 |
`))!==-1;){const C=R.slice(0,w);R=R.slice(w+2);const g=C.split(`
|
| 15 |
`).filter(D=>D.startsWith("data:")).map(D=>D.slice(5).trimStart()).join(`
|
| 16 |
-
`);!g||g==="[DONE]"||(yield JSON.parse(g))}}}finally{N.releaseLock()}}function vt(c){const[d,m]=o.useState([]),[N,u]=o.useState(!1),[R,T]=o.useState(""),b=o.useRef(!1),w=o.useRef(null),C=o.useRef([]),g=o.useRef(c),D=o.useRef(""),S=o.useRef(""),O=o.useRef(0),_=o.useRef(0),Y=o.useRef(c.sessionId),se=o.useRef(c.sessionId);se.current!==c.sessionId&&(se.current=c.sessionId,Y.current!==c.sessionId&&(_.current+=1)),g.current=c,C.current=d,o.useEffect(()=>()=>{var a;return(a=w.current)==null?void 0:a.abort()},[]),o.useEffect(()=>{b.current||(Y.current=c.sessionId)},[c.sessionId]);const ne=o.useMemo(()=>{const a={};for(const r of d)for(const l of r.blocks??[])if(l.kind==="tool")for(const i of l.results??[])a[i.route_id]=i;return a},[d]),G=()=>`m${++O.current}_${Date.now().toString(36)}`,A=a=>m(r=>{if(!r.length)return r;const l=r.slice();return l[l.length-1]=a(l[l.length-1]),l}),ae=a=>A(r=>({...r,blocks:[...r.blocks??[],a]})),P=(a,r)=>A(l=>({...l,blocks:(l.blocks??[]).map((i,p,h)=>a(i,p,h)?r(i):i)})),F=a=>(r,l,i)=>r.kind===a&&i.findLastIndex(p=>p.kind===a)===l,re=a=>{switch(a.type){case"stream_start":a.session_id&&(Y.current=a.session_id,g.current.onSessionId(a.session_id));break;case"sandbox_start":case"sandbox_ready":break;case"session_title_start":S.current="";break;case"session_title_delta":S.current+=a.text,g.current.onTitle(S.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":S.current=a.title,g.current.onTitle(a.title);break;case"reasoning_start":ae({kind:"reasoning",text:"",active:!0,open:!0});break;case"reasoning_delta":P(F("reasoning"),r=>r.kind==="reasoning"?{...r,text:r.text+a.text}:r);break;case"reasoning_end":P(F("reasoning"),r=>r.kind==="reasoning"?{...r,active:!1,open:!1}:r);break;case"tool_call":ae({kind:"tool",id:a.id,name:a.name,args:a.args,status:"running",open:!1});break;case"tool_result":P(r=>r.kind==="tool"&&r.id===a.id,r=>r.kind==="tool"?a.status?{...r,schema_version:2,status:a.status,took_ms:a.took_ms,content:a.content,metadata:a.metadata,open:a.status!=="success"}:{...r,status:"done",hits:a.hits,took_ms:a.took_ms,results:a.results}:r);break;case"answer_delta":A(r=>{const l=r.blocks??[],i=l.at(-1);return(i==null?void 0:i.kind)==="answer"&&!i.done?{...r,blocks:[...l.slice(0,-1),{...i,text:i.text+a.text}]}:{...r,blocks:[...l,{kind:"answer",text:a.text,done:!1}]}});break;case"done":A(r=>({...r,streaming:!1,followups:a.followups,finishReason:a.finish_reason,citations:a.citations,blocks:(r.blocks??[]).map(l=>l.kind==="answer"?{...l,done:!0}:l)}));break;case"error":A(r=>({...r,streaming:!1,error:a.message}));break}},q=async(a,r)=>{const l=await me(a),i=Fe(l);return _.current!==r?null:(m(i),C.current=i,i)},K=(a,r,l,i)=>{const p=++_.current;b.current=!0;const h=new AbortController;return w.current=h,D.current=a,Y.current=r.session_id,T(""),m(l),u(!0),(async()=>{let E=!1,x=!1,L=!1;try{for await(const y of bt(r,{signal:h.signal}))y.type==="stream_start"&&(E=!0),(y.type==="done"||y.type==="error")&&(x=!0,L=y.type==="error"),h.signal.aborted||re(y)}catch(y){L=!0,h.signal.aborted||re({type:"error",message:y instanceof Error?y.message:"The assistant stream failed."})}finally{if(w.current===h&&(b.current=!1,u(!1),!h.signal.aborted)){const y=Y.current;if(i&&!E)m(i.snapshot),C.current=i.snapshot,T("Couldn’t resend this message. Your original conversation was restored.");else if(y){i&&!i.first&&(L||!x)&&(m(i.snapshot),C.current=i.snapshot);try{const k=await q(y,p);k&&i&&!i.first&&k.some(M=>M.id===i.targetId)&&T("Couldn’t resend this message. Your original conversation was restored.")}catch{_.current===p&&A(k=>k.streaming?{...k,streaming:!1}:k)}}else A(k=>k.streaming?{...k,streaming:!1}:k);g.current.onSettled(y)}}})(),!0},U=o.useCallback(a=>{const r=a.trim();if(!r||r.length>8e3||b.current)return!1;const l=C.current,i=[...l].reverse().find(y=>y.role==="user"),p=i!=null&&i.status&&i.status!=="complete"&&i.revision?{replace_message_id:i.id,prior_revision:i.revision}:null,h={id:G(),role:"user",text:r},E={id:G(),role:"assistant",streaming:!0,blocks:[]},x=p&&i?l.findLastIndex(y=>y.id===i.id):-1,L=x<0?[...l,h,E]:[...l.slice(0,x),h,E];return K(r,{message:r,session_id:g.current.sessionId,client_message_id:crypto.randomUUID(),...!g.current.sessionId&&g.current.initialModel?{initial_model:g.current.initialModel}:{},...p??{}},L)},[]),J=o.useCallback((a,r)=>{const l=r.trim();if(!l||l.length>8e3||b.current)return!1;const i=C.current.slice(),p=i.findIndex(M=>M.id===a&&M.role==="user");if(p<0)return!1;const h=i[p],E=i.findIndex(M=>M.role==="user"),x=p===E;if(!x&&(!g.current.sessionId||!h.revision))return!1;const L={id:h.id,role:"user",text:l,revision:x?void 0:h.revision+1,status:"generating"},y={id:G(),role:"assistant",streaming:!0,blocks:[]},k=x?[L,y]:[...i.slice(0,p),L,y];return K(l,{message:l,session_id:x?null:g.current.sessionId,client_message_id:crypto.randomUUID(),...x&&g.current.initialModel?{initial_model:g.current.initialModel}:{},...x?{}:{replace_message_id:h.id,prior_revision:h.revision}},k,{targetId:h.id,snapshot:i,first:x})},[]),Q=o.useCallback(()=>{if(!w.current)return;w.current.abort(),w.current=null,b.current=!1,u(!1),m(l=>{const i=l.at(-1);if((i==null?void 0:i.role)!=="assistant")return l;const p=(i.blocks??[]).flatMap(h=>h.kind==="tool"&&h.status==="running"?[]:h.kind==="reasoning"&&h.active?[]:h.kind==="answer"?[{...h,done:!0}]:[h]);return[...l.slice(0,-1),{...i,blocks:p,streaming:!1,finishReason:"stopped"}]}),g.current.onInterrupted(D.current);const a=Y.current,r=++_.current;window.setTimeout(()=>{a&&_.current===r?q(a,r).catch(()=>{}).finally(()=>g.current.onSettled(a)):a||g.current.onSettled(null)},450)},[]),V=o.useCallback((a,r)=>m(l=>l.map(i=>{var p;return i.id!==a?i:{...i,blocks:(p=i.blocks)==null?void 0:p.map((h,E)=>E===r&&(h.kind==="reasoning"||h.kind==="tool")?{...h,open:!h.open}:h)}})),[]),ie=o.useCallback(()=>{var a;_.current+=1,(a=w.current)==null||a.abort(),w.current=null,b.current=!1,Y.current=null,m([]),u(!1),T("")},[]),$=o.useCallback(a=>{var r;_.current+=1,(r=w.current)==null||r.abort(),w.current=null,b.current=!1,m(a),u(!1),T("")},[]);return{messages:d,busy:N,papers:ne,sessionError:R,send:U,editAndResend:J,stop:Q,toggleBlock:V,reset:ie,load:$}}const xt=["What's the state of the art for real-time object detection?","Recommend recent papers on retrieval-augmented generation","Which open LLMs are best for on-device inference?"],Lt=()=>{var Oe,_e,ke;const{sessionId:c}=Xe(),d=Je(),[m,N]=Qe(),{user:u,isLoading:R}=Ze(),{toast:T}=et(),[b,w]=o.useState([]),[C,g]=o.useState(!1),[D,S]=o.useState(""),[O,_]=o.useState(()=>c?{id:c,status:"loading"}:null),[Y,se]=o.useState(0),ne=o.useRef(nt()),G=o.useRef(m.get("model")||((Oe=ne.current)==null?void 0:Oe.model)),[A,ae]=o.useState(at),[P,F]=o.useState(G.current||rt),[re,q]=o.useState(""),[K,U]=o.useState(""),[J,Q]=o.useState(()=>{var e,s;return((e=m.get("q"))==null?void 0:e.trim())||((s=ne.current)==null?void 0:s.prompt)||""}),V=o.useRef(!1),[ie,$]=o.useState(null),[a,r]=o.useState(null),[l,i]=o.useState(""),[p,h]=o.useState(null),[E,x]=o.useState(()=>typeof window>"u"||window.innerWidth>900),[L,y]=o.useState(!1),[k,M]=o.useState(""),fe=o.useRef(new Set),pe=o.useRef(!1),ge=o.useRef(c),Z=o.useRef(null);ge.current=c;const z=o.useCallback(async()=>{if(!u)return;const e=!pe.current;e&&g(!0);try{w(await ot()),pe.current=!0,S("")}catch(s){S(s instanceof Error?s.message:"Could not load chats")}finally{e&&g(!1)}},[u]),f=vt({sessionId:c??null,initialModel:P,onSessionId:e=>{Z.current=e,_({id:e,status:"loaded"}),d(`/chat/${e}`,{replace:!0})},onTitle:e=>{c&&!fe.current.has(c)&&(q(e),w(s=>s.map(t=>t.id===c?{...t,title:e}:t)))},onSettled:()=>{z()},onInterrupted:e=>{U(e)}});f.load;const ye=f.send;o.useEffect(()=>{f.busy&&$(null)},[f.busy]);const ee=o.useCallback(e=>{if(!u){sessionStorage.setItem(Se,e),sessionStorage.setItem(Ce,P),sessionStorage.setItem(Ee,"1"),window.location.href=Ye(`/api/v1/auth/hf/login?return_to=${encodeURIComponent("/chat")}`);return}ye(e)&&(it(),U(""))},[P,ye,u]);o.useEffect(()=>{if(R||!u)return;const e=sessionStorage.getItem(Ce);e&&F(e),z(),ct().then(v=>{if(ae(v.items),!ge.current){const j=G.current||e;F(j&&v.items.some($e=>$e.id===j)?j:v.default_model)}});const s=sessionStorage.getItem(Se),t=sessionStorage.getItem(Ee)==="1";s&&(t?Q(s):U(s))},[R,z,u]),o.useEffect(()=>{if(!c){Z.current!==null&&(Z.current=null,f.reset()),_(null);return}if(Z.current===c||(_(s=>(s==null?void 0:s.id)===c&&s.status==="loading"?s:{id:c,status:"loading"}),R||!u||f.busy))return;let e=!1;return S(""),me(c).then(s=>{e||(f.load(Fe(s)),F(s.selected_model),q(s.title),Z.current=c,_({id:c,status:"loaded"}))}).catch(s=>{if(e)return;const t=s instanceof Error?s.message:"Chat not found";f.reset(),S(t),_({id:c,status:"error",error:t})}),()=>{e=!0}},[R,c,u,f.busy,Y]),o.useEffect(()=>{var v;const e=(v=m.get("q"))==null?void 0:v.trim();if(!e)return;V.current=!1;const s=m.get("model");s&&F(s),Q(e);const t=new URLSearchParams(m);t.delete("q"),t.delete("model"),N(t,{replace:!0})},[m,N]),o.useEffect(()=>{if(R||f.busy||!J||V.current)return;const e=window.setTimeout(()=>{if(V.current)return;V.current=!0;const s=J;Q(""),ee(s)},0);return()=>window.clearTimeout(e)},[R,f.busy,J,ee]),o.useEffect(()=>{const e=()=>{!u||f.busy||z()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[f.busy,z,u]),o.useEffect(()=>{if(!p)return;const e=()=>h(null),s=t=>{t.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",s),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",s)}},[p]);const be=()=>{f.reset(),U(""),q(""),d("/chat")},we=async e=>{const s=l.trim();if(s)try{const t=await Ie(e,{title:s});fe.current.add(e),e===c&&q(t.title),w(v=>v.map(j=>j.id===e?t:j)),r(null)}catch(t){S(t instanceof Error?t.message:"Rename failed")}},Be=async e=>{const s=e===c&&f.busy;if(window.confirm(s?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){s&&f.stop();try{if(s){const t=Date.now()+3e3;for(;(await me(e)).is_busy;){if(Date.now()>=t)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(j=>window.setTimeout(j,150))}}await ht(e),e===c&&be(),await z()}catch(t){S(t instanceof Error?t.message:"Delete failed")}}},ve=async e=>{const s=P;if(F(e),!!c)try{const t=await Ie(c,{selected_model:e});w(v=>v.map(j=>j.id===c?{...j,selected_model:t.selected_model}:j)),S("")}catch(t){F(s),S(t instanceof Error?t.message:"Model change failed")}},qe=async()=>{var e;if(!(!c||f.busy||L)){y(!0);try{const s=await mt(c),t=new URL(s.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(t),T({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{M(t)}}catch(s){const t=s instanceof Error?s.message:"Could not share this conversation";S(t),T({variant:"destructive",title:"Share failed",description:t})}finally{y(!1)}}},[He,Ge]=o.useState(60);o.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const s=()=>Ge(e.offsetHeight);s();const t=new ResizeObserver(s);return t.observe(e),()=>t.disconnect()},[]);const ce=o.useRef(null),oe=o.useRef(null),te=o.useRef(null);o.useEffect(()=>{f.busy||(te.current=null)},[f.busy]);const Ke=(e,s)=>{var t;oe.current=((t=ce.current)==null?void 0:t.scrollTop)??null,f.toggleBlock(e,s)};o.useLayoutEffect(()=>{const e=ce.current;if(e){if(oe.current!==null){e.scrollTop=oe.current,oe.current=null;return}if(te.current){const s=Array.from(e.querySelectorAll("[data-message-id]")).find(t=>t.dataset.messageId===te.current);if(s){const t=e.getBoundingClientRect(),v=s.getBoundingClientRect();e.scrollTop+=v.top-t.top-24;return}}e.scrollTop=e.scrollHeight}},[f.messages]);const X=b.find(e=>e.id===c),xe=f.messages.filter(e=>e.role==="user"),le=(_e=xe[0])==null?void 0:_e.id,Ve=(ke=xe.at(-1))==null?void 0:ke.id,de=f.messages.length===0,ue=(O==null?void 0:O.id)===c,he=!!(c&&(R||u&&(!ue||(O==null?void 0:O.status)==="loading"))),Re=ue&&(O==null?void 0:O.status)==="error"?O.error:void 0;return n.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${He}px)`},children:[n.jsxs("aside",{className:`chat-sidebar${E?"":" chat-sidebar-closed"}`,children:[n.jsxs("div",{className:"chat-sidebar-top",children:[n.jsxs("button",{type:"button",className:"chat-new-chat",onClick:be,children:[n.jsx(lt,{})," New chat"]}),n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>x(!1),title:"Collapse sidebar",children:n.jsx(Le,{})})]}),n.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[C&&n.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!C&&D&&n.jsx("div",{className:"chat-sessions-empty",children:D}),!C&&!D&&b.length===0&&n.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),dt(b).map(e=>n.jsxs("div",{className:"chat-session-group",children:[n.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(s=>n.jsxs("div",{className:`chat-session${s.id===c?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>d(`/chat/${s.id}`),onKeyDown:t=>{if(t.key==="Enter"&&d(`/chat/${s.id}`),t.key==="F2"&&(r(s.id),i(s.title)),t.key==="ContextMenu"||t.shiftKey&&t.key==="F10"){t.preventDefault();const v=t.currentTarget.getBoundingClientRect();h({id:s.id,x:v.right-150,y:v.bottom})}},onContextMenu:t=>{t.preventDefault(),h({id:s.id,x:t.clientX,y:t.clientY})},children:[a===s.id?n.jsx("input",{className:"chat-session-title-input",value:l,autoFocus:!0,maxLength:80,onClick:t=>t.stopPropagation(),onChange:t=>i(t.target.value),onBlur:()=>void we(s.id),onKeyDown:t=>{t.stopPropagation(),t.key==="Enter"&&we(s.id),t.key==="Escape"&&r(null)}}):n.jsx("span",{className:"chat-session-title",children:s.title}),n.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:t=>{t.stopPropagation();const v=t.currentTarget.getBoundingClientRect();h({id:s.id,x:v.right-150,y:v.bottom})},children:"⋯"}),n.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:t=>{t.stopPropagation(),Be(s.id)},children:n.jsx(ut,{})})]},s.id))]},e.label))]}),p&&n.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:p.x,top:p.y},onClick:e=>e.stopPropagation(),children:n.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=b.find(s=>s.id===p.id);e&&(r(e.id),i(e.title)),h(null)},children:"Rename chat"})})]}),n.jsxs("section",{className:"chat-main",children:[n.jsxs("div",{className:"chat-topbar",children:[!E&&n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>x(!0),title:"Open sidebar",children:n.jsx(Le,{})}),n.jsx("span",{className:"chat-topbar-title",children:he?(X==null?void 0:X.title)||"":re||(X==null?void 0:X.title)||(de?"":"New chat")}),c&&ue&&(O==null?void 0:O.status)==="loaded"&&!de&&n.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void qe(),disabled:f.busy||L||he,"aria-label":"Share conversation",children:[L?n.jsx(je,{}):n.jsx(ft,{"aria-hidden":"true"}),n.jsx("span",{children:"Share"})]})]}),he?n.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[n.jsx(je,{}),n.jsx("span",{children:"Loading conversation…"})]}):Re?n.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[n.jsx("p",{children:Re}),n.jsx("button",{type:"button",onClick:()=>{_({id:c,status:"loading"}),se(e=>e+1)},children:"Try again"})]}):de?n.jsx("div",{className:"chat-empty",children:n.jsxs("div",{className:"chat-empty-inner",children:[n.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),n.jsxs("h1",{className:"chat-empty-title",children:["Ask ",n.jsx("em",{children:"Papers With Code"})]}),n.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),n.jsx(Te,{onSend:ee,busy:f.busy,onStop:f.stop,autoFocus:!0,draft:K,onDraftChange:U,models:A,selectedModel:P,onModelChange:e=>void ve(e)}),n.jsx("div",{className:"chat-examples",children:xt.map(e=>n.jsx("button",{type:"button",className:"chat-example",onClick:()=>ee(e),children:e},e))})]})}):n.jsxs(n.Fragment,{children:[f.sessionError&&n.jsx("div",{className:"chat-session-error",role:"alert",children:f.sessionError}),n.jsx("div",{className:"chat-conversation",ref:ce,children:n.jsx("div",{className:"chat-conversation-inner",children:f.messages.map(e=>e.role==="user"?n.jsx(tt,{id:e.id,text:e.text??"",isInitial:e.id===le,editingAllowed:!f.busy&&!!e.revision,editing:ie===e.id,editNotice:e.id===le?"Sending will start a new chat.":e.id===Ve?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>$(e.id),onCancel:()=>$(null),onResend:s=>{e.id!==le&&(te.current=e.id);const t=f.editAndResend(e.id,s);return t?$(null):te.current=null,t}},e.id):n.jsx(st,{msg:e,papers:f.papers,onToggleBlock:Ke},e.id))})}),n.jsx("div",{className:"chat-composer-wrap",children:n.jsxs("div",{className:"chat-composer-inner",children:[n.jsx(Te,{onSend:ee,busy:f.busy,onStop:f.stop,placeholder:K?"Edit and send again…":"Ask a follow-up…",draft:K,onDraftChange:U,models:A,selectedModel:P,onModelChange:e=>void ve(e)}),n.jsx("div",{className:"chat-composer-foot",children:We()?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",n.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),n.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):n.jsx(n.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),k&&n.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>M(""),children:n.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[n.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),n.jsx("p",{children:"It could not be copied automatically. Copy this link manually:"}),n.jsx("input",{readOnly:!0,value:k,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),n.jsx("button",{type:"button",onClick:()=>M(""),children:"Close"})]})})]})};export{Lt as default};
|
|
|
|
| 1 |
+
import{c as ze,d as Ye,r as o,e as Xe,a as Je,u as Qe,f as Ze,g as et,j as n}from"./index-ClYrAl8a.js";import{C as Te,U as tt,A as st}from"./ChatMessage-DoWa4hRO.js";import{g as me,t as Fe,r as nt,F as at,D as rt,l as ot,C as Se,a as Ce,b as Ee,c as it,d as ct,P as lt,e as Le,f as dt,T as ut,S as je,u as Ie,h as ht,i as mt}from"./chatSessions-MtbDAqMr.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Do8kbf9Q.js";import"./index-DmFk7249.js";import"./useQuery-Drr20jTc.js";import"./useBaseQuery-DlkwakD5.js";import"./hover-card-BDewF190.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 13 |
|
| 14 |
`))!==-1;){const C=R.slice(0,w);R=R.slice(w+2);const g=C.split(`
|
| 15 |
`).filter(D=>D.startsWith("data:")).map(D=>D.slice(5).trimStart()).join(`
|
| 16 |
+
`);!g||g==="[DONE]"||(yield JSON.parse(g))}}}finally{N.releaseLock()}}function vt(c){const[d,m]=o.useState([]),[N,u]=o.useState(!1),[R,T]=o.useState(""),b=o.useRef(!1),w=o.useRef(null),C=o.useRef([]),g=o.useRef(c),D=o.useRef(""),S=o.useRef(""),O=o.useRef(0),_=o.useRef(0),Y=o.useRef(c.sessionId),se=o.useRef(c.sessionId);se.current!==c.sessionId&&(se.current=c.sessionId,Y.current!==c.sessionId&&(_.current+=1)),g.current=c,C.current=d,o.useEffect(()=>()=>{var a;return(a=w.current)==null?void 0:a.abort()},[]),o.useEffect(()=>{b.current||(Y.current=c.sessionId)},[c.sessionId]);const ne=o.useMemo(()=>{const a={};for(const r of d)for(const l of r.blocks??[])if(l.kind==="tool")for(const i of l.results??[])a[i.route_id]=i;return a},[d]),G=()=>`m${++O.current}_${Date.now().toString(36)}`,A=a=>m(r=>{if(!r.length)return r;const l=r.slice();return l[l.length-1]=a(l[l.length-1]),l}),ae=a=>A(r=>({...r,blocks:[...r.blocks??[],a]})),P=(a,r)=>A(l=>({...l,blocks:(l.blocks??[]).map((i,p,h)=>a(i,p,h)?r(i):i)})),F=a=>(r,l,i)=>r.kind===a&&i.findLastIndex(p=>p.kind===a)===l,re=a=>{switch(a.type){case"stream_start":a.session_id&&(Y.current=a.session_id,g.current.onSessionId(a.session_id));break;case"sandbox_start":case"sandbox_ready":break;case"session_title_start":S.current="";break;case"session_title_delta":S.current+=a.text,g.current.onTitle(S.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":S.current=a.title,g.current.onTitle(a.title);break;case"reasoning_start":ae({kind:"reasoning",text:"",active:!0,open:!0});break;case"reasoning_delta":P(F("reasoning"),r=>r.kind==="reasoning"?{...r,text:r.text+a.text}:r);break;case"reasoning_end":P(F("reasoning"),r=>r.kind==="reasoning"?{...r,active:!1,open:!1}:r);break;case"tool_call":ae({kind:"tool",id:a.id,name:a.name,args:a.args,status:"running",open:!1});break;case"tool_result":P(r=>r.kind==="tool"&&r.id===a.id,r=>r.kind==="tool"?a.status?{...r,schema_version:2,status:a.status,took_ms:a.took_ms,content:a.content,metadata:a.metadata,open:a.status!=="success"}:{...r,status:"done",hits:a.hits,took_ms:a.took_ms,results:a.results}:r);break;case"answer_delta":A(r=>{const l=r.blocks??[],i=l.at(-1);return(i==null?void 0:i.kind)==="answer"&&!i.done?{...r,blocks:[...l.slice(0,-1),{...i,text:i.text+a.text}]}:{...r,blocks:[...l,{kind:"answer",text:a.text,done:!1}]}});break;case"done":A(r=>({...r,streaming:!1,followups:a.followups,finishReason:a.finish_reason,citations:a.citations,blocks:(r.blocks??[]).map(l=>l.kind==="answer"?{...l,done:!0}:l)}));break;case"error":A(r=>({...r,streaming:!1,error:a.message}));break}},q=async(a,r)=>{const l=await me(a),i=Fe(l);return _.current!==r?null:(m(i),C.current=i,i)},K=(a,r,l,i)=>{const p=++_.current;b.current=!0;const h=new AbortController;return w.current=h,D.current=a,Y.current=r.session_id,T(""),m(l),u(!0),(async()=>{let E=!1,x=!1,L=!1;try{for await(const y of bt(r,{signal:h.signal}))y.type==="stream_start"&&(E=!0),(y.type==="done"||y.type==="error")&&(x=!0,L=y.type==="error"),h.signal.aborted||re(y)}catch(y){L=!0,h.signal.aborted||re({type:"error",message:y instanceof Error?y.message:"The assistant stream failed."})}finally{if(w.current===h&&(b.current=!1,u(!1),!h.signal.aborted)){const y=Y.current;if(i&&!E)m(i.snapshot),C.current=i.snapshot,T("Couldn’t resend this message. Your original conversation was restored.");else if(y){i&&!i.first&&(L||!x)&&(m(i.snapshot),C.current=i.snapshot);try{const k=await q(y,p);k&&i&&!i.first&&k.some(M=>M.id===i.targetId)&&T("Couldn’t resend this message. Your original conversation was restored.")}catch{_.current===p&&A(k=>k.streaming?{...k,streaming:!1}:k)}}else A(k=>k.streaming?{...k,streaming:!1}:k);g.current.onSettled(y)}}})(),!0},U=o.useCallback(a=>{const r=a.trim();if(!r||r.length>8e3||b.current)return!1;const l=C.current,i=[...l].reverse().find(y=>y.role==="user"),p=i!=null&&i.status&&i.status!=="complete"&&i.revision?{replace_message_id:i.id,prior_revision:i.revision}:null,h={id:G(),role:"user",text:r},E={id:G(),role:"assistant",streaming:!0,blocks:[]},x=p&&i?l.findLastIndex(y=>y.id===i.id):-1,L=x<0?[...l,h,E]:[...l.slice(0,x),h,E];return K(r,{message:r,session_id:g.current.sessionId,client_message_id:crypto.randomUUID(),...!g.current.sessionId&&g.current.initialModel?{initial_model:g.current.initialModel}:{},...p??{}},L)},[]),J=o.useCallback((a,r)=>{const l=r.trim();if(!l||l.length>8e3||b.current)return!1;const i=C.current.slice(),p=i.findIndex(M=>M.id===a&&M.role==="user");if(p<0)return!1;const h=i[p],E=i.findIndex(M=>M.role==="user"),x=p===E;if(!x&&(!g.current.sessionId||!h.revision))return!1;const L={id:h.id,role:"user",text:l,revision:x?void 0:h.revision+1,status:"generating"},y={id:G(),role:"assistant",streaming:!0,blocks:[]},k=x?[L,y]:[...i.slice(0,p),L,y];return K(l,{message:l,session_id:x?null:g.current.sessionId,client_message_id:crypto.randomUUID(),...x&&g.current.initialModel?{initial_model:g.current.initialModel}:{},...x?{}:{replace_message_id:h.id,prior_revision:h.revision}},k,{targetId:h.id,snapshot:i,first:x})},[]),Q=o.useCallback(()=>{if(!w.current)return;w.current.abort(),w.current=null,b.current=!1,u(!1),m(l=>{const i=l.at(-1);if((i==null?void 0:i.role)!=="assistant")return l;const p=(i.blocks??[]).flatMap(h=>h.kind==="tool"&&h.status==="running"?[]:h.kind==="reasoning"&&h.active?[]:h.kind==="answer"?[{...h,done:!0}]:[h]);return[...l.slice(0,-1),{...i,blocks:p,streaming:!1,finishReason:"stopped"}]}),g.current.onInterrupted(D.current);const a=Y.current,r=++_.current;window.setTimeout(()=>{a&&_.current===r?q(a,r).catch(()=>{}).finally(()=>g.current.onSettled(a)):a||g.current.onSettled(null)},450)},[]),V=o.useCallback((a,r)=>m(l=>l.map(i=>{var p;return i.id!==a?i:{...i,blocks:(p=i.blocks)==null?void 0:p.map((h,E)=>E===r&&(h.kind==="reasoning"||h.kind==="tool")?{...h,open:!h.open}:h)}})),[]),ie=o.useCallback(()=>{var a;_.current+=1,(a=w.current)==null||a.abort(),w.current=null,b.current=!1,Y.current=null,m([]),u(!1),T("")},[]),$=o.useCallback(a=>{var r;_.current+=1,(r=w.current)==null||r.abort(),w.current=null,b.current=!1,m(a),u(!1),T("")},[]);return{messages:d,busy:N,papers:ne,sessionError:R,send:U,editAndResend:J,stop:Q,toggleBlock:V,reset:ie,load:$}}const xt=["What's the state of the art for real-time object detection?","Recommend recent papers on retrieval-augmented generation","Which open LLMs are best for on-device inference?"],jt=()=>{var Oe,_e,ke;const{sessionId:c}=Xe(),d=Je(),[m,N]=Qe(),{user:u,isLoading:R}=Ze(),{toast:T}=et(),[b,w]=o.useState([]),[C,g]=o.useState(!1),[D,S]=o.useState(""),[O,_]=o.useState(()=>c?{id:c,status:"loading"}:null),[Y,se]=o.useState(0),ne=o.useRef(nt()),G=o.useRef(m.get("model")||((Oe=ne.current)==null?void 0:Oe.model)),[A,ae]=o.useState(at),[P,F]=o.useState(G.current||rt),[re,q]=o.useState(""),[K,U]=o.useState(""),[J,Q]=o.useState(()=>{var e,s;return((e=m.get("q"))==null?void 0:e.trim())||((s=ne.current)==null?void 0:s.prompt)||""}),V=o.useRef(!1),[ie,$]=o.useState(null),[a,r]=o.useState(null),[l,i]=o.useState(""),[p,h]=o.useState(null),[E,x]=o.useState(()=>typeof window>"u"||window.innerWidth>900),[L,y]=o.useState(!1),[k,M]=o.useState(""),fe=o.useRef(new Set),pe=o.useRef(!1),ge=o.useRef(c),Z=o.useRef(null);ge.current=c;const z=o.useCallback(async()=>{if(!u)return;const e=!pe.current;e&&g(!0);try{w(await ot()),pe.current=!0,S("")}catch(s){S(s instanceof Error?s.message:"Could not load chats")}finally{e&&g(!1)}},[u]),f=vt({sessionId:c??null,initialModel:P,onSessionId:e=>{Z.current=e,_({id:e,status:"loaded"}),d(`/chat/${e}`,{replace:!0})},onTitle:e=>{c&&!fe.current.has(c)&&(q(e),w(s=>s.map(t=>t.id===c?{...t,title:e}:t)))},onSettled:()=>{z()},onInterrupted:e=>{U(e)}});f.load;const ye=f.send;o.useEffect(()=>{f.busy&&$(null)},[f.busy]);const ee=o.useCallback(e=>{if(!u){sessionStorage.setItem(Se,e),sessionStorage.setItem(Ce,P),sessionStorage.setItem(Ee,"1"),window.location.href=Ye(`/api/v1/auth/hf/login?return_to=${encodeURIComponent("/chat")}`);return}ye(e)&&(it(),U(""))},[P,ye,u]);o.useEffect(()=>{if(R||!u)return;const e=sessionStorage.getItem(Ce);e&&F(e),z(),ct().then(v=>{if(ae(v.items),!ge.current){const j=G.current||e;F(j&&v.items.some($e=>$e.id===j)?j:v.default_model)}});const s=sessionStorage.getItem(Se),t=sessionStorage.getItem(Ee)==="1";s&&(t?Q(s):U(s))},[R,z,u]),o.useEffect(()=>{if(!c){Z.current!==null&&(Z.current=null,f.reset()),_(null);return}if(Z.current===c||(_(s=>(s==null?void 0:s.id)===c&&s.status==="loading"?s:{id:c,status:"loading"}),R||!u||f.busy))return;let e=!1;return S(""),me(c).then(s=>{e||(f.load(Fe(s)),F(s.selected_model),q(s.title),Z.current=c,_({id:c,status:"loaded"}))}).catch(s=>{if(e)return;const t=s instanceof Error?s.message:"Chat not found";f.reset(),S(t),_({id:c,status:"error",error:t})}),()=>{e=!0}},[R,c,u,f.busy,Y]),o.useEffect(()=>{var v;const e=(v=m.get("q"))==null?void 0:v.trim();if(!e)return;V.current=!1;const s=m.get("model");s&&F(s),Q(e);const t=new URLSearchParams(m);t.delete("q"),t.delete("model"),N(t,{replace:!0})},[m,N]),o.useEffect(()=>{if(R||f.busy||!J||V.current)return;const e=window.setTimeout(()=>{if(V.current)return;V.current=!0;const s=J;Q(""),ee(s)},0);return()=>window.clearTimeout(e)},[R,f.busy,J,ee]),o.useEffect(()=>{const e=()=>{!u||f.busy||z()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[f.busy,z,u]),o.useEffect(()=>{if(!p)return;const e=()=>h(null),s=t=>{t.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",s),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",s)}},[p]);const be=()=>{f.reset(),U(""),q(""),d("/chat")},we=async e=>{const s=l.trim();if(s)try{const t=await Ie(e,{title:s});fe.current.add(e),e===c&&q(t.title),w(v=>v.map(j=>j.id===e?t:j)),r(null)}catch(t){S(t instanceof Error?t.message:"Rename failed")}},Be=async e=>{const s=e===c&&f.busy;if(window.confirm(s?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){s&&f.stop();try{if(s){const t=Date.now()+3e3;for(;(await me(e)).is_busy;){if(Date.now()>=t)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(j=>window.setTimeout(j,150))}}await ht(e),e===c&&be(),await z()}catch(t){S(t instanceof Error?t.message:"Delete failed")}}},ve=async e=>{const s=P;if(F(e),!!c)try{const t=await Ie(c,{selected_model:e});w(v=>v.map(j=>j.id===c?{...j,selected_model:t.selected_model}:j)),S("")}catch(t){F(s),S(t instanceof Error?t.message:"Model change failed")}},qe=async()=>{var e;if(!(!c||f.busy||L)){y(!0);try{const s=await mt(c),t=new URL(s.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(t),T({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{M(t)}}catch(s){const t=s instanceof Error?s.message:"Could not share this conversation";S(t),T({variant:"destructive",title:"Share failed",description:t})}finally{y(!1)}}},[He,Ge]=o.useState(60);o.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const s=()=>Ge(e.offsetHeight);s();const t=new ResizeObserver(s);return t.observe(e),()=>t.disconnect()},[]);const ce=o.useRef(null),oe=o.useRef(null),te=o.useRef(null);o.useEffect(()=>{f.busy||(te.current=null)},[f.busy]);const Ke=(e,s)=>{var t;oe.current=((t=ce.current)==null?void 0:t.scrollTop)??null,f.toggleBlock(e,s)};o.useLayoutEffect(()=>{const e=ce.current;if(e){if(oe.current!==null){e.scrollTop=oe.current,oe.current=null;return}if(te.current){const s=Array.from(e.querySelectorAll("[data-message-id]")).find(t=>t.dataset.messageId===te.current);if(s){const t=e.getBoundingClientRect(),v=s.getBoundingClientRect();e.scrollTop+=v.top-t.top-24;return}}e.scrollTop=e.scrollHeight}},[f.messages]);const X=b.find(e=>e.id===c),xe=f.messages.filter(e=>e.role==="user"),le=(_e=xe[0])==null?void 0:_e.id,Ve=(ke=xe.at(-1))==null?void 0:ke.id,de=f.messages.length===0,ue=(O==null?void 0:O.id)===c,he=!!(c&&(R||u&&(!ue||(O==null?void 0:O.status)==="loading"))),Re=ue&&(O==null?void 0:O.status)==="error"?O.error:void 0;return n.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${He}px)`},children:[n.jsxs("aside",{className:`chat-sidebar${E?"":" chat-sidebar-closed"}`,children:[n.jsxs("div",{className:"chat-sidebar-top",children:[n.jsxs("button",{type:"button",className:"chat-new-chat",onClick:be,children:[n.jsx(lt,{})," New chat"]}),n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>x(!1),title:"Collapse sidebar",children:n.jsx(Le,{})})]}),n.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[C&&n.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!C&&D&&n.jsx("div",{className:"chat-sessions-empty",children:D}),!C&&!D&&b.length===0&&n.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),dt(b).map(e=>n.jsxs("div",{className:"chat-session-group",children:[n.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(s=>n.jsxs("div",{className:`chat-session${s.id===c?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>d(`/chat/${s.id}`),onKeyDown:t=>{if(t.key==="Enter"&&d(`/chat/${s.id}`),t.key==="F2"&&(r(s.id),i(s.title)),t.key==="ContextMenu"||t.shiftKey&&t.key==="F10"){t.preventDefault();const v=t.currentTarget.getBoundingClientRect();h({id:s.id,x:v.right-150,y:v.bottom})}},onContextMenu:t=>{t.preventDefault(),h({id:s.id,x:t.clientX,y:t.clientY})},children:[a===s.id?n.jsx("input",{className:"chat-session-title-input",value:l,autoFocus:!0,maxLength:80,onClick:t=>t.stopPropagation(),onChange:t=>i(t.target.value),onBlur:()=>void we(s.id),onKeyDown:t=>{t.stopPropagation(),t.key==="Enter"&&we(s.id),t.key==="Escape"&&r(null)}}):n.jsx("span",{className:"chat-session-title",children:s.title}),n.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:t=>{t.stopPropagation();const v=t.currentTarget.getBoundingClientRect();h({id:s.id,x:v.right-150,y:v.bottom})},children:"⋯"}),n.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:t=>{t.stopPropagation(),Be(s.id)},children:n.jsx(ut,{})})]},s.id))]},e.label))]}),p&&n.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:p.x,top:p.y},onClick:e=>e.stopPropagation(),children:n.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=b.find(s=>s.id===p.id);e&&(r(e.id),i(e.title)),h(null)},children:"Rename chat"})})]}),n.jsxs("section",{className:"chat-main",children:[n.jsxs("div",{className:"chat-topbar",children:[!E&&n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>x(!0),title:"Open sidebar",children:n.jsx(Le,{})}),n.jsx("span",{className:"chat-topbar-title",children:he?(X==null?void 0:X.title)||"":re||(X==null?void 0:X.title)||(de?"":"New chat")}),c&&ue&&(O==null?void 0:O.status)==="loaded"&&!de&&n.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void qe(),disabled:f.busy||L||he,"aria-label":"Share conversation",children:[L?n.jsx(je,{}):n.jsx(ft,{"aria-hidden":"true"}),n.jsx("span",{children:"Share"})]})]}),he?n.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[n.jsx(je,{}),n.jsx("span",{children:"Loading conversation…"})]}):Re?n.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[n.jsx("p",{children:Re}),n.jsx("button",{type:"button",onClick:()=>{_({id:c,status:"loading"}),se(e=>e+1)},children:"Try again"})]}):de?n.jsx("div",{className:"chat-empty",children:n.jsxs("div",{className:"chat-empty-inner",children:[n.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),n.jsxs("h1",{className:"chat-empty-title",children:["Ask ",n.jsx("em",{children:"Papers With Code"})]}),n.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),n.jsx(Te,{onSend:ee,busy:f.busy,onStop:f.stop,autoFocus:!0,draft:K,onDraftChange:U,models:A,selectedModel:P,onModelChange:e=>void ve(e)}),n.jsx("div",{className:"chat-examples",children:xt.map(e=>n.jsx("button",{type:"button",className:"chat-example",onClick:()=>ee(e),children:e},e))})]})}):n.jsxs(n.Fragment,{children:[f.sessionError&&n.jsx("div",{className:"chat-session-error",role:"alert",children:f.sessionError}),n.jsx("div",{className:"chat-conversation",ref:ce,children:n.jsx("div",{className:"chat-conversation-inner",children:f.messages.map(e=>e.role==="user"?n.jsx(tt,{id:e.id,text:e.text??"",isInitial:e.id===le,editingAllowed:!f.busy&&!!e.revision,editing:ie===e.id,editNotice:e.id===le?"Sending will start a new chat.":e.id===Ve?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>$(e.id),onCancel:()=>$(null),onResend:s=>{e.id!==le&&(te.current=e.id);const t=f.editAndResend(e.id,s);return t?$(null):te.current=null,t}},e.id):n.jsx(st,{msg:e,papers:f.papers,onToggleBlock:Ke},e.id))})}),n.jsx("div",{className:"chat-composer-wrap",children:n.jsxs("div",{className:"chat-composer-inner",children:[n.jsx(Te,{onSend:ee,busy:f.busy,onStop:f.stop,placeholder:K?"Edit and send again…":"Ask a follow-up…",draft:K,onDraftChange:U,models:A,selectedModel:P,onModelChange:e=>void ve(e)}),n.jsx("div",{className:"chat-composer-foot",children:We()?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",n.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),n.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):n.jsx(n.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),k&&n.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>M(""),children:n.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[n.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),n.jsx("p",{children:"It could not be copied automatically. Copy this link manually:"}),n.jsx("input",{readOnly:!0,value:k,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),n.jsx("button",{type:"button",onClick:()=>M(""),children:"Close"})]})})]})};export{jt as default};
|
assets/ConferenceDetailView-DpykNgzJ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as L,r as D,j as e,L as p,b as C}from"./index-ClYrAl8a.js";import{u as T}from"./useQuery-Drr20jTc.js";import{M as F}from"./MarkdownText-g9v8ocG0.js";import{e as B,h as A,d as E}from"./transform-BxrCkLtR.js";import{S as f}from"./skeleton-C5gy1_r-.js";import{A as P,a as z}from"./alert-2CUZfv8i.js";import"./useBaseQuery-DlkwakD5.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Do8kbf9Q.js";import"./index-DmFk7249.js";import"./hover-card-BDewF190.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},J=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{J as default};
|
assets/ConferenceDetailView-XO1Uuoz9.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as L,r as D,j as e,L as p,b as C}from"./index-aFSBl9QY.js";import{u as T}from"./useQuery-BTZGCW5c.js";import{M as F}from"./MarkdownText-BuawND0S.js";import{e as B,h as A,d as E}from"./transform-DQ9X1I92.js";import{S as f}from"./skeleton-i1TSOWrq.js";import{A as P,a as z}from"./alert-u8e1tjxL.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BhsnwX7g.js";import"./index-B-Qd56lo.js";import"./hover-card-BZrFUFNS.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},G=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{G as default};
|
|
|
|
|
|
assets/ConferenceTaskView-BXB7Bl8c.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as $,u as D,r as f,j as e,L as b,R as W,b as M}from"./index-ClYrAl8a.js";import{u as z}from"./useQuery-Drr20jTc.js";import{P as G}from"./components-C_OCzHXF.js";import{P as J}from"./PaperFeedFilters-4l2Zc9pi.js";import{M as h}from"./MarkdownText-g9v8ocG0.js";import{t as X,d as Y}from"./transform-BxrCkLtR.js";import{c as Z}from"./usePapers-DmFNFSTF.js";import{u as ee}from"./useIntersectionObserver-Dnf5-OL3.js";import{S as se}from"./skeleton-C5gy1_r-.js";import{A as ae,a as te}from"./alert-2CUZfv8i.js";import"./useBaseQuery-DlkwakD5.js";import"./LatexTitle-BWD9oOWn.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Do8kbf9Q.js";import"./index-DmFk7249.js";import"./hover-card-BDewF190.js";import"./useInfiniteQuery-CT7QSfbE.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=Z({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=ee({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(X),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Y(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(J,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{be as default};
|
assets/ConferenceTaskView-DrlJZb2a.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as $,u as D,r as f,j as e,L as b,R as W,b as M}from"./index-aFSBl9QY.js";import{u as z}from"./useQuery-BTZGCW5c.js";import{P as G}from"./components-3ObcZwMF.js";import{P as J}from"./PaperFeedFilters-DWsoFzku.js";import{M as h}from"./MarkdownText-BuawND0S.js";import{t as X,d as Y}from"./transform-DQ9X1I92.js";import{c as Z}from"./usePapers-DE5W7ST-.js";import{u as ee}from"./useIntersectionObserver-CoKzzCGv.js";import{S as se}from"./skeleton-i1TSOWrq.js";import{A as ae,a as te}from"./alert-u8e1tjxL.js";import"./LatexTitle-nKm6G6V5.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BhsnwX7g.js";import"./index-B-Qd56lo.js";import"./hover-card-BZrFUFNS.js";import"./useInfiniteQuery-BZImI1cv.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ve=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=Z({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=ee({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(X),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Y(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(J,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ve as default};
|
|
|
|
|
|
assets/ConferencesIndexView-B7z069Mo.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as p,j as e,L as d,b as u}from"./index-aFSBl9QY.js";import{u as h}from"./useQuery-BTZGCW5c.js";import{S as m}from"./skeleton-i1TSOWrq.js";import{A as f,a as g}from"./alert-u8e1tjxL.js";import{T as x}from"./TaxonomySuggestionTile-Du2G8VJC.js";import"./SignInToEditDialog-BoeWau__.js";import"./button-qsrhZiTx.js";import"./textarea-twqgdYKh.js";import"./dialog-BUBOrXx4.js";import"./useMutation-5-p9zSWo.js";import"./loader-circle-BpTSq772.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},y=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},B=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=p.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=v(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(y)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((s,i)=>e.jsx(m,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.reduce((l,o)=>l+(o.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{B as default};
|
|
|
|
|
|
assets/ConferencesIndexView-BqcudkGR.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as p,j as e,L as d,b as u}from"./index-ClYrAl8a.js";import{u as h}from"./useQuery-Drr20jTc.js";import{S as m}from"./skeleton-C5gy1_r-.js";import{A as f,a as g}from"./alert-2CUZfv8i.js";import{T as x}from"./TaxonomySuggestionTile-9YotnIt8.js";import"./useBaseQuery-DlkwakD5.js";import"./SignInToEditDialog-D5M5vIDC.js";import"./button-5hN1cjku.js";import"./textarea-CiVGOMsF.js";import"./dialog-zw8tnspo.js";import"./useMutation-DivT1EgA.js";import"./loader-circle-DQ1xuEZx.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},y=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=p.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=v(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(y)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((s,i)=>e.jsx(m,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.reduce((l,o)=>l+(o.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default};
|
assets/ContributionsPage-BnW2_Wpc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{f as o,j as t,b as n}from"./index-ClYrAl8a.js";import{u as c}from"./useInfiniteQuery-CT7QSfbE.js";import{B as d}from"./button-5hN1cjku.js";import"./useBaseQuery-DlkwakD5.js";const h=()=>{var r;const{user:s}=o(),a=c({queryKey:["contributions",s==null?void 0:s.username],queryFn:({pageParam:e})=>n.getMyContributions(e),initialPageParam:void 0,getNextPageParam:e=>e.next_cursor??void 0,enabled:!!(s!=null&&s.can_contribute)}),i=((r=a.data)==null?void 0:r.pages.flatMap(e=>e.events))??[];return s!=null&&s.can_contribute?t.jsxs("div",{className:"page max-w-5xl mx-auto px-4 py-8",children:[t.jsx("h1",{className:"text-3xl font-bold",children:"My contributions"}),t.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Private history for catalog changes made through your contributor account."}),a.isLoading&&t.jsx("p",{className:"mt-8",children:"Loading contributions…"}),a.error&&t.jsx("p",{className:"mt-8 text-destructive",children:"Could not load contribution history."}),t.jsxs("div",{className:"mt-6 space-y-3",children:[i.map(e=>t.jsxs("article",{className:"rounded-md border p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("strong",{children:[e.operation," ",e.entity_type]}),t.jsx("time",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),t.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e.entity_id," · ",e.id]}),t.jsxs("details",{className:"mt-3 text-xs",children:[t.jsx("summary",{children:"Before / after"}),t.jsx("pre",{className:"mt-2 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:e.before,after:e.after},null,2)})]})]},e.id)),a.data&&i.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No direct edits yet."}),a.hasNextPage&&t.jsx(d,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older contributions"})]})]}):t.jsxs("div",{className:"page",children:[t.jsx("h1",{children:"Contributions"}),t.jsx("p",{children:"This history is available to project contributors and admins."})]})};export{h as default};
|
assets/CronDashboard-D2jbvH3D.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
| 1 |
-
import{c as p,r as o,j as e,q as x,J as _e,l as ke,k as A,$ as Ce,K as Te,M as Re,n as D,P as Se,p as Me,N as Q,L as Fe,f as Le,b as B}from"./index-aFSBl9QY.js";import{u as I}from"./useQuery-BTZGCW5c.js";import{B as y,D as z,f as Ae}from"./codexAddEvals-DfA_vXlK.js";import{B as U}from"./button-qsrhZiTx.js";import{C as Je}from"./chevron-down-Dl7qGEdC.js";import{C as M,a as P,R as V,S as De}from"./shield-alert-BQFZjysw.js";import{L as R}from"./loader-circle-BpTSq772.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 F=p("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
| 7 |
-
* @license lucide-react v0.462.0 - ISC
|
| 8 |
-
*
|
| 9 |
-
* This source code is licensed under the ISC license.
|
| 10 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
-
*/const Ie=p("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
| 12 |
-
* @license lucide-react v0.462.0 - ISC
|
| 13 |
-
*
|
| 14 |
-
* This source code is licensed under the ISC license.
|
| 15 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 16 |
-
*/const $e=p("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
| 17 |
-
* @license lucide-react v0.462.0 - ISC
|
| 18 |
-
*
|
| 19 |
-
* This source code is licensed under the ISC license.
|
| 20 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 21 |
-
*/const Ee=p("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
| 22 |
-
* @license lucide-react v0.462.0 - ISC
|
| 23 |
-
*
|
| 24 |
-
* This source code is licensed under the ISC license.
|
| 25 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 26 |
-
*/const He=p("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
| 27 |
-
* @license lucide-react v0.462.0 - ISC
|
| 28 |
-
*
|
| 29 |
-
* This source code is licensed under the ISC license.
|
| 30 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 31 |
-
*/const Pe=p("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
|
| 32 |
-
* @license lucide-react v0.462.0 - ISC
|
| 33 |
-
*
|
| 34 |
-
* This source code is licensed under the ISC license.
|
| 35 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 36 |
-
*/const qe=p("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
| 37 |
-
* @license lucide-react v0.462.0 - ISC
|
| 38 |
-
*
|
| 39 |
-
* This source code is licensed under the ISC license.
|
| 40 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 41 |
-
*/const X=p("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
| 42 |
-
* @license lucide-react v0.462.0 - ISC
|
| 43 |
-
*
|
| 44 |
-
* This source code is licensed under the ISC license.
|
| 45 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 46 |
-
*/const Z=p("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
| 47 |
-
* @license lucide-react v0.462.0 - ISC
|
| 48 |
-
*
|
| 49 |
-
* This source code is licensed under the ISC license.
|
| 50 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 51 |
-
*/const G=p("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
| 52 |
-
* @license lucide-react v0.462.0 - ISC
|
| 53 |
-
*
|
| 54 |
-
* This source code is licensed under the ISC license.
|
| 55 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 56 |
-
*/const Oe=p("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/**
|
| 57 |
-
* @license lucide-react v0.462.0 - ISC
|
| 58 |
-
*
|
| 59 |
-
* This source code is licensed under the ISC license.
|
| 60 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 61 |
-
*/const Be=p("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
| 62 |
-
* @license lucide-react v0.462.0 - ISC
|
| 63 |
-
*
|
| 64 |
-
* This source code is licensed under the ISC license.
|
| 65 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 66 |
-
*/const ze=p("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),j=o.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:x("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));j.displayName="Card";const _=o.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:x("flex flex-col space-y-1.5 p-6",s),...a}));_.displayName="CardHeader";const k=o.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:x("text-2xl font-semibold leading-none tracking-tight",s),...a}));k.displayName="CardTitle";const L=o.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:x("text-sm text-muted-foreground",s),...a}));L.displayName="CardDescription";const N=o.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:x("p-6 pt-0",s),...a}));N.displayName="CardContent";const Ue=o.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:x("flex items-center p-6 pt-0",s),...a}));Ue.displayName="CardFooter";var J="Tabs",[Ve]=Me(J,[Q]),Y=Q(),[Ge,q]=Ve(J),ee=o.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:l,defaultValue:d,orientation:c="horizontal",dir:t,activationMode:h="automatic",...g}=s,m=_e(t),[u,f]=ke({prop:n,onChange:l,defaultProp:d??"",caller:J});return e.jsx(Ge,{scope:r,baseId:Ce(),value:u,onValueChange:f,orientation:c,dir:m,activationMode:h,children:e.jsx(A.div,{dir:m,"data-orientation":c,...g,ref:a})})});ee.displayName=J;var se="TabsList",ae=o.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...l}=s,d=q(se,r),c=Y(r);return e.jsx(Te,{asChild:!0,...c,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(A.div,{role:"tablist","aria-orientation":d.orientation,...l,ref:a})})});ae.displayName=se;var re="TabsTrigger",te=o.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:l=!1,...d}=s,c=q(re,r),t=Y(r),h=ce(c.baseId,n),g=le(c.baseId,n),m=n===c.value;return e.jsx(Re,{asChild:!0,...t,focusable:!l,active:m,children:e.jsx(A.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":g,"data-state":m?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:h,...d,ref:a,onMouseDown:D(s.onMouseDown,u=>{!l&&u.button===0&&u.ctrlKey===!1?c.onValueChange(n):u.preventDefault()}),onKeyDown:D(s.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&c.onValueChange(n)}),onFocus:D(s.onFocus,()=>{const u=c.activationMode!=="manual";!m&&!l&&u&&c.onValueChange(n)})})})});te.displayName=re;var ne="TabsContent",ie=o.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:l,children:d,...c}=s,t=q(ne,r),h=ce(t.baseId,n),g=le(t.baseId,n),m=n===t.value,u=o.useRef(m);return o.useEffect(()=>{const f=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(f)},[]),e.jsx(Se,{present:l||m,children:({present:f})=>e.jsx(A.div,{"data-state":m?"active":"inactive","data-orientation":t.orientation,role:"tabpanel","aria-labelledby":h,hidden:!f,id:g,tabIndex:0,...c,ref:a,style:{...s.style,animationDuration:u.current?"0s":void 0},children:f&&d})})});ie.displayName=ne;function ce(s,a){return`${s}-trigger-${a}`}function le(s,a){return`${s}-content-${a}`}var We=ee,oe=ae,de=te,me=ie;const Ke=We,xe=o.forwardRef(({className:s,...a},r)=>e.jsx(oe,{ref:r,className:x("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));xe.displayName=oe.displayName;const $=o.forwardRef(({className:s,...a},r)=>e.jsx(de,{ref:r,className:x("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}));$.displayName=de.displayName;const E=o.forwardRef(({className:s,...a},r)=>e.jsx(me,{ref:r,className:x("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));E.displayName=me.displayName;function b(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),l=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:l<24?`${l}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function he(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function ue(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function pe(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const Qe={healthy:P,degraded:ze,broken:M,running:R,stuck:M,unknown:Ee};function Xe({status:s,isRunning:a}){const r=a?"running":s,n=Qe[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function W({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,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:pe(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof l=="number"?l.toLocaleString():l})]},n))})]})}function Ze({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(F,{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",ue(s)],...s.updated_at?[["Updated",b(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(y,{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(y,{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 Ye(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function es({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(y,{variant:"outline",className:Ye(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(Z,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",b(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 ",b(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",he(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ss({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(Oe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:pe(n)}),e.jsx("div",{className:"text-lg font-semibold",children:l.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(es,{job:n},n.id))})]})]})}function as({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:l=!1,paperMarkdownJobsError:d=null}){const c=!!(s.work_metrics&&Object.keys(s.work_metrics).length),t=!!(s.db_metrics&&Object.keys(s.db_metrics).length),h=s.job_name==="paper_markdown_backfill",g=c||t||!!s.workflow_status||h;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(Xe,{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(y,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(y,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),g&&(a?e.jsx($e,{className:"h-4 w-4 cron-muted"}):e.jsx(Je,{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(X,{}),"Log: ",b(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(z,{}),"DB: ",b(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Be,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(F,{}),"Duration: ",he(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(Ie,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(G,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(F,{}),"Actions: ",ue(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(y,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&g&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&c&&e.jsx(W,{icon:G,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&t&&e.jsx(W,{icon:z,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(Ze,{workflow:s.workflow_status}),h&&e.jsx(ss,{monitor:n,loading:l,error:d})]})})]})}const ge=o.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:x("w-full caption-bottom text-sm",s),...a})}));ge.displayName="Table";const fe=o.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:x("[&_tr]:border-b",s),...a}));fe.displayName="TableHeader";const je=o.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:x("[&_tr:last-child]:border-0",s),...a}));je.displayName="TableBody";const rs=o.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:x("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));rs.displayName="TableFooter";const H=o.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:x("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));H.displayName="TableRow";const C=o.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:x("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));C.displayName="TableHead";const T=o.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:x("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));T.displayName="TableCell";const ts=o.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:x("mt-4 text-sm text-muted-foreground",s),...a}));ts.displayName="TableCaption";const ns={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},is={"add-evals":"Add evals","enrich-paper":"Enrich paper"},cs={queued:qe,dispatching:R,running:He,completed:P,failed:M,canceled:Pe};function ls({status:s}){const a=cs[s];return e.jsxs(y,{variant:"outline",className:ns[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function os(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 ds({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:l,error:d}=I({queryKey:["codexPaperJobs",a],queryFn:()=>Ae(100),refetchInterval:s?1e4:!1,retry:!1}),c=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(j,{className:"mb-8",children:[e.jsx(_,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(k,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(L,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),l&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(N,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&c!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),c===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(t=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:t}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[t]})]},t)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(ge,{children:[e.jsx(fe,{children:e.jsxs(H,{children:[e.jsx(C,{children:"Status"}),e.jsx(C,{children:"Paper"}),e.jsx(C,{children:"Action"}),e.jsx(C,{children:"Requested"}),e.jsx(C,{children:"Execution"})]})}),e.jsx(je,{children:r.jobs.map(t=>{const h=os(t);return e.jsxs(H,{children:[e.jsx(T,{className:"align-top",children:e.jsx(ls,{status:t.status})}),e.jsxs(T,{className:"min-w-[260px] align-top",children:[e.jsx(Fe,{to:`/paper/${encodeURIComponent(t.paper_route)}`,className:"font-medium hover:underline",children:t.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",t.paper_id]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[is[t.kind],t.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(P,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:b(t.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",t.requested_by]})]}),e.jsxs(T,{className:"max-w-[360px] align-top",children:[t.hf_job_url?e.jsxs("a",{href:t.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Z,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),h&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${t.error?"text-red-700":"cron-muted"}`,title:h,children:h})]})]},t.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",b(r.timestamp)]})]})]})]})}const K={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},vs=()=>{const[s,a]=o.useState(!0),[r,n]=o.useState(0),[l,d]=o.useState(new Set),{user:c}=Le(),{data:t,isLoading:h,isFetching:g,error:m,refetch:u}=I({queryKey:["cronStatus",c==null?void 0:c.username],queryFn:()=>B.getCronStatus(),enabled:!!(c!=null&&c.is_admin),refetchInterval:s?3e4:!1,retry:!1}),f=I({queryKey:["paperMarkdownJobs",c==null?void 0:c.username],queryFn:()=>B.getPaperMarkdownJobs(),enabled:!!(c!=null&&c.is_admin),refetchInterval:s?3e4:!1,retry:!1}),Ne=(m&&typeof m=="object"&&"status"in m?m.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":m instanceof Error?m.message:void 0,ve=i=>{d(v=>{const w=new Set(v);return w.has(i)?w.delete(i):w.add(i),w})},ye=(t==null?void 0:t.jobs.filter(i=>i.critical))??[],S=((t==null?void 0:t.jobs.filter(i=>!i.critical))??[]).reduce((i,v)=>(i[v.category]||(i[v.category]=[]),i[v.category].push(v),i),{}),be=Object.keys(S).sort((i,v)=>{const w=["hourly","daily","weekly"];return w.indexOf(i)-w.indexOf(v)}),O=i=>e.jsx(as,{job:i,expanded:l.has(i.job_name),onToggle:()=>ve(i.job_name),paperMarkdownJobs:i.job_name==="paper_markdown_backfill"?f.data:void 0,paperMarkdownJobsLoading:i.job_name==="paper_markdown_backfill"?f.isLoading:!1,paperMarkdownJobsError:i.job_name==="paper_markdown_backfill"?f.error:null},i.job_name),we=()=>{n(i=>i+1),u(),f.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(F,{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(U,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(U,{variant:"outline",size:"sm",onClick:we,disabled:g,children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(j,{className:"mb-6",children:e.jsx(N,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",c==null?void 0:c.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(Ke,{defaultValue:"critical-jobs",children:[e.jsxs(xe,{className:"grid w-full grid-cols-2 sm:w-auto",children:[e.jsx($,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx($,{value:"codex-paper-jobs",children:"Codex Paper Jobs"})]}),e.jsxs(E,{value:"critical-jobs",className:"mt-6",children:[h&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),m&&e.jsx(j,{className:"cron-status--broken",children:e.jsx(N,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{className:"h-5 w-5"}),e.jsx("p",{children:Ne??"Failed to load CRON jobs status. Please try again."})]})})}),t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(i=>e.jsxs(j,{children:[e.jsx(_,{className:"pb-2",children:e.jsx(k,{className:"text-sm font-medium cron-muted capitalize",children:i})}),e.jsx(N,{children:e.jsx("div",{className:"text-2xl font-bold",children:t.summary[i]})})]},i))}),t.summary.critical_issues.length>0&&e.jsxs(j,{className:"mb-6 cron-status--broken",children:[e.jsx(_,{children:e.jsxs(k,{className:"flex items-center gap-2",children:[e.jsx(De,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(N,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:t.summary.critical_issues.map(i=>e.jsx("li",{children:i},i))})})]}),e.jsxs(j,{className:"mb-8",children:[e.jsx(_,{children:e.jsx(k,{className:"text-base",children:"What to check next"})}),e.jsxs(N,{children:[e.jsx("p",{className:"text-sm cron-muted",children:t.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(X,{className:"h-4 w-4"}),"Last updated: ",b(t.timestamp)," · Health score:"," ",t.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(j,{className:"mb-8",children:[e.jsxs(_,{children:[e.jsx(k,{className:"text-xl",children:"Critical jobs"}),e.jsx(L,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(N,{className:"space-y-4",children:ye.map(O)})]}),e.jsx("div",{className:"space-y-6",children:be.map(i=>e.jsxs(j,{children:[e.jsx(_,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(k,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(y,{className:K[i]??K.hourly,children:i}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(L,{children:[S[i].length," job",S[i].length!==1?"s":""]})]})}),e.jsx(N,{className:"space-y-4",children:S[i].map(O)})]},i))})]})]}),e.jsx(E,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(ds,{autoRefresh:s,refreshToken:r})})]})]})})};export{vs as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/CronDashboard-vvBpWdzK.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{c as p,r as m,j as e,q as u,K as ke,l as Ce,k as I,a0 as Te,M as Re,N as Se,n as E,P as Me,p as Fe,O as X,L as Le,s as Ae,b as S,f as Pe}from"./index-ClYrAl8a.js";import{u as $}from"./useQuery-Drr20jTc.js";import{B as w,D as U,f as qe}from"./codexAddEvals-WlVl1MzA.js";import{B as M}from"./button-5hN1cjku.js";import{C as De}from"./chevron-down-BIpSRgmX.js";import{C as P,a as O,R as V,S as Ie}from"./shield-alert-CFEEyNo0.js";import{L as R}from"./loader-circle-DQ1xuEZx.js";import{u as K}from"./useMutation-DivT1EgA.js";import{u as Je}from"./useInfiniteQuery-CT7QSfbE.js";import"./useBaseQuery-DlkwakD5.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 q=p("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
| 7 |
+
* @license lucide-react v0.462.0 - ISC
|
| 8 |
+
*
|
| 9 |
+
* This source code is licensed under the ISC license.
|
| 10 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
+
*/const Ee=p("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
| 12 |
+
* @license lucide-react v0.462.0 - ISC
|
| 13 |
+
*
|
| 14 |
+
* This source code is licensed under the ISC license.
|
| 15 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 16 |
+
*/const $e=p("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
| 17 |
+
* @license lucide-react v0.462.0 - ISC
|
| 18 |
+
*
|
| 19 |
+
* This source code is licensed under the ISC license.
|
| 20 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 21 |
+
*/const He=p("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
| 22 |
+
* @license lucide-react v0.462.0 - ISC
|
| 23 |
+
*
|
| 24 |
+
* This source code is licensed under the ISC license.
|
| 25 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 26 |
+
*/const Oe=p("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
| 27 |
+
* @license lucide-react v0.462.0 - ISC
|
| 28 |
+
*
|
| 29 |
+
* This source code is licensed under the ISC license.
|
| 30 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 31 |
+
*/const ze=p("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
|
| 32 |
+
* @license lucide-react v0.462.0 - ISC
|
| 33 |
+
*
|
| 34 |
+
* This source code is licensed under the ISC license.
|
| 35 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 36 |
+
*/const Be=p("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
| 37 |
+
* @license lucide-react v0.462.0 - ISC
|
| 38 |
+
*
|
| 39 |
+
* This source code is licensed under the ISC license.
|
| 40 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 41 |
+
*/const Z=p("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
| 42 |
+
* @license lucide-react v0.462.0 - ISC
|
| 43 |
+
*
|
| 44 |
+
* This source code is licensed under the ISC license.
|
| 45 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 46 |
+
*/const Y=p("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
| 47 |
+
* @license lucide-react v0.462.0 - ISC
|
| 48 |
+
*
|
| 49 |
+
* This source code is licensed under the ISC license.
|
| 50 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 51 |
+
*/const G=p("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
| 52 |
+
* @license lucide-react v0.462.0 - ISC
|
| 53 |
+
*
|
| 54 |
+
* This source code is licensed under the ISC license.
|
| 55 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 56 |
+
*/const Ue=p("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/**
|
| 57 |
+
* @license lucide-react v0.462.0 - ISC
|
| 58 |
+
*
|
| 59 |
+
* This source code is licensed under the ISC license.
|
| 60 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 61 |
+
*/const Ve=p("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
| 62 |
+
* @license lucide-react v0.462.0 - ISC
|
| 63 |
+
*
|
| 64 |
+
* This source code is licensed under the ISC license.
|
| 65 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 66 |
+
*/const Ke=p("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),j=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));j.displayName="Card";const y=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex flex-col space-y-1.5 p-6",s),...a}));y.displayName="CardHeader";const b=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:u("text-2xl font-semibold leading-none tracking-tight",s),...a}));b.displayName="CardTitle";const D=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:u("text-sm text-muted-foreground",s),...a}));D.displayName="CardDescription";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("p-6 pt-0",s),...a}));N.displayName="CardContent";const Ge=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:u("flex items-center p-6 pt-0",s),...a}));Ge.displayName="CardFooter";var J="Tabs",[We]=Fe(J,[X]),ee=X(),[Qe,z]=We(J),se=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:t,activationMode:c="automatic",...g}=s,x=ke(t),[h,f]=Ce({prop:n,onChange:o,defaultProp:d??"",caller:J});return e.jsx(Qe,{scope:r,baseId:Te(),value:h,onValueChange:f,orientation:i,dir:x,activationMode:c,children:e.jsx(I.div,{dir:x,"data-orientation":i,...g,ref:a})})});se.displayName=J;var ae="TabsList",re=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...o}=s,d=z(ae,r),i=ee(r);return e.jsx(Re,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(I.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});re.displayName=ae;var te="TabsTrigger",ne=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...d}=s,i=z(te,r),t=ee(r),c=le(i.baseId,n),g=oe(i.baseId,n),x=n===i.value;return e.jsx(Se,{asChild:!0,...t,focusable:!o,active:x,children:e.jsx(I.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":g,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...d,ref:a,onMouseDown:E(s.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?i.onValueChange(n):h.preventDefault()}),onKeyDown:E(s.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(n)}),onFocus:E(s.onFocus,()=>{const h=i.activationMode!=="manual";!x&&!o&&h&&i.onValueChange(n)})})})});ne.displayName=te;var ie="TabsContent",ce=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:o,children:d,...i}=s,t=z(ie,r),c=le(t.baseId,n),g=oe(t.baseId,n),x=n===t.value,h=m.useRef(x);return m.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),e.jsx(Me,{present:o||x,children:({present:f})=>e.jsx(I.div,{"data-state":x?"active":"inactive","data-orientation":t.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:g,tabIndex:0,...i,ref:a,style:{...s.style,animationDuration:h.current?"0s":void 0},children:f&&d})})});ce.displayName=ie;function le(s,a){return`${s}-trigger-${a}`}function oe(s,a){return`${s}-content-${a}`}var Xe=se,de=re,me=ne,xe=ce;const Ze=Xe,ue=m.forwardRef(({className:s,...a},r)=>e.jsx(de,{ref:r,className:u("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));ue.displayName=de.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx(me,{ref:r,className:u("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));L.displayName=me.displayName;const A=m.forwardRef(({className:s,...a},r)=>e.jsx(xe,{ref:r,className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));A.displayName=xe.displayName;function _(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),o=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function he(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function pe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function ge(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const Ye={healthy:O,degraded:Ke,broken:P,running:R,stuck:P,unknown:He};function es({status:s,isRunning:a}){const r=a?"running":s,n=Ye[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function W({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},n))})]})}function ss({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(q,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",pe(s)],...s.updated_at?[["Updated",_(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(w,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(w,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function as(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function rs({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"outline",className:as(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(Y,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",_(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",_(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",he(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ts({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ue,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:ge(n)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(rs,{job:n},n.id))})]})]})}function ns({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:o=!1,paperMarkdownJobsError:d=null}){const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),t=!!(s.db_metrics&&Object.keys(s.db_metrics).length),c=s.job_name==="paper_markdown_backfill",g=i||t||!!s.workflow_status||c;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(es,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(w,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(w,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),g&&(a?e.jsx($e,{className:"h-4 w-4 cron-muted"}):e.jsx(De,{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(Z,{}),"Log: ",_(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(U,{}),"DB: ",_(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ve,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(q,{}),"Duration: ",he(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(Ee,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(G,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(q,{}),"Actions: ",pe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(w,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&g&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&i&&e.jsx(W,{icon:G,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&t&&e.jsx(W,{icon:U,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(ss,{workflow:s.workflow_status}),c&&e.jsx(ts,{monitor:n,loading:o,error:d})]})})]})}const fe=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:u("w-full caption-bottom text-sm",s),...a})}));fe.displayName="Table";const je=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:u("[&_tr]:border-b",s),...a}));je.displayName="TableHeader";const Ne=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:u("[&_tr:last-child]:border-0",s),...a}));Ne.displayName="TableBody";const is=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));is.displayName="TableFooter";const H=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:u("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));H.displayName="TableRow";const C=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));C.displayName="TableHead";const T=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));T.displayName="TableCell";const cs=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:u("mt-4 text-sm text-muted-foreground",s),...a}));cs.displayName="TableCaption";const ls={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},os={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ds={queued:Be,dispatching:R,running:Oe,completed:O,failed:P,canceled:ze};function ms({status:s}){const a=ds[s];return e.jsxs(w,{variant:"outline",className:ls[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function xs(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function us({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:o,error:d}=$({queryKey:["codexPaperJobs",a],queryFn:()=>qe(100),refetchInterval:s?1e4:!1,retry:!1}),i=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(j,{className:"mb-8",children:[e.jsx(y,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(D,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(N,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&i!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),i===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(t=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:t}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[t]})]},t)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(fe,{children:[e.jsx(je,{children:e.jsxs(H,{children:[e.jsx(C,{children:"Status"}),e.jsx(C,{children:"Paper"}),e.jsx(C,{children:"Action"}),e.jsx(C,{children:"Requested"}),e.jsx(C,{children:"Execution"})]})}),e.jsx(Ne,{children:r.jobs.map(t=>{const c=xs(t);return e.jsxs(H,{children:[e.jsx(T,{className:"align-top",children:e.jsx(ms,{status:t.status})}),e.jsxs(T,{className:"min-w-[260px] align-top",children:[e.jsx(Le,{to:`/paper/${encodeURIComponent(t.paper_route)}`,className:"font-medium hover:underline",children:t.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",t.paper_id]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[os[t.kind],t.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(O,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(T,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:_(t.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",t.requested_by]})]}),e.jsxs(T,{className:"max-w-[360px] align-top",children:[t.hf_job_url?e.jsxs("a",{href:t.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Y,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),c&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${t.error?"text-red-700":"cron-muted"}`,title:c,children:c})]})]},t.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",_(r.timestamp)]})]})]})]})}const hs=()=>{var d,i,t;const s=Ae(),a=Je({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>S.getCatalogAudit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(c=>c.events))??[],n=K({mutationFn:()=>S.acknowledgeCatalogAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=K({mutationFn:c=>S.rollbackCatalogEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(j,{children:[e.jsxs(y,{className:"flex-row items-center justify-between",children:[e.jsx(b,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((t=(i=a.data)==null?void 0:i.pages[0])==null?void 0:t.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(N,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:c.before,after:c.after},null,2)})]}),!c.rollback_of_event_id&&e.jsx(M,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>o.mutate(c.id),disabled:o.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(M,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},Q={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},Ts=()=>{const[s,a]=m.useState(!0),[r,n]=m.useState(0),[o,d]=m.useState(new Set),{user:i}=Pe(),{data:t,isLoading:c,isFetching:g,error:x,refetch:h}=$({queryKey:["cronStatus",i==null?void 0:i.username],queryFn:()=>S.getCronStatus(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),f=$({queryKey:["paperMarkdownJobs",i==null?void 0:i.username],queryFn:()=>S.getPaperMarkdownJobs(),enabled:!!(i!=null&&i.is_admin),refetchInterval:s?3e4:!1,retry:!1}),ve=(x&&typeof x=="object"&&"status"in x?x.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":x instanceof Error?x.message:void 0,ye=l=>{d(v=>{const k=new Set(v);return k.has(l)?k.delete(l):k.add(l),k})},be=(t==null?void 0:t.jobs.filter(l=>l.critical))??[],F=((t==null?void 0:t.jobs.filter(l=>!l.critical))??[]).reduce((l,v)=>(l[v.category]||(l[v.category]=[]),l[v.category].push(v),l),{}),we=Object.keys(F).sort((l,v)=>{const k=["hourly","daily","weekly"];return k.indexOf(l)-k.indexOf(v)}),B=l=>e.jsx(ns,{job:l,expanded:o.has(l.job_name),onToggle:()=>ye(l.job_name),paperMarkdownJobs:l.job_name==="paper_markdown_backfill"?f.data:void 0,paperMarkdownJobsLoading:l.job_name==="paper_markdown_backfill"?f.isLoading:!1,paperMarkdownJobsError:l.job_name==="paper_markdown_backfill"?f.error:null},l.job_name),_e=()=>{n(l=>l+1),h(),f.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(q,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(M,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:_e,disabled:g,children:[e.jsx(V,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(j,{className:"mb-6",children:e.jsx(N,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",i==null?void 0:i.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(Ze,{defaultValue:"critical-jobs",children:[e.jsxs(ue,{className:"grid w-full grid-cols-3 sm:w-auto",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"})]}),e.jsxs(A,{value:"critical-jobs",className:"mt-6",children:[c&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),x&&e.jsx(j,{className:"cron-status--broken",children:e.jsx(N,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{className:"h-5 w-5"}),e.jsx("p",{children:ve??"Failed to load CRON jobs status. Please try again."})]})})}),t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(l=>e.jsxs(j,{children:[e.jsx(y,{className:"pb-2",children:e.jsx(b,{className:"text-sm font-medium cron-muted capitalize",children:l})}),e.jsx(N,{children:e.jsx("div",{className:"text-2xl font-bold",children:t.summary[l]})})]},l))}),t.summary.critical_issues.length>0&&e.jsxs(j,{className:"mb-6 cron-status--broken",children:[e.jsx(y,{children:e.jsxs(b,{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(N,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:t.summary.critical_issues.map(l=>e.jsx("li",{children:l},l))})})]}),e.jsxs(j,{className:"mb-8",children:[e.jsx(y,{children:e.jsx(b,{className:"text-base",children:"What to check next"})}),e.jsxs(N,{children:[e.jsx("p",{className:"text-sm cron-muted",children:t.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4"}),"Last updated: ",_(t.timestamp)," · Health score:"," ",t.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(j,{className:"mb-8",children:[e.jsxs(y,{children:[e.jsx(b,{className:"text-xl",children:"Critical jobs"}),e.jsx(D,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(N,{className:"space-y-4",children:be.map(B)})]}),e.jsx("div",{className:"space-y-6",children:we.map(l=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(b,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:Q[l]??Q.hourly,children:l}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(D,{children:[F[l].length," job",F[l].length!==1?"s":""]})]})}),e.jsx(N,{className:"space-y-4",children:F[l].map(B)})]},l))})]})]}),e.jsx(A,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(us,{autoRefresh:s,refreshToken:r})}),e.jsx(A,{value:"catalog-audit",className:"mt-6",children:e.jsx(hs,{})})]})]})})};export{Ts as default};
|
assets/{ExternalSourceEvalBadge-CgpOekCN.js → ExternalSourceEvalBadge-DyWbMNlx.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,L as l}from"./index-
|
|
|
|
| 1 |
+
import{j as e,L as l}from"./index-ClYrAl8a.js";import{H as t,a as n,b as o}from"./hover-card-BDewF190.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E};
|
assets/FeedView-CjMgiRfQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as D,r as l,j as e,L as f,i as E,a as O,b as T}from"./index-aFSBl9QY.js";import{P as R}from"./components-3ObcZwMF.js";import{P as H}from"./PaperFeedFilters-DWsoFzku.js";import{D as I,M as q,F as U,A as $,q as K}from"./chatSessions-Da7pRgeZ.js";import{t as B,d as k}from"./transform-DQ9X1I92.js";import{u as W}from"./usePapers-DE5W7ST-.js";import{u as z}from"./useIntersectionObserver-CoKzzCGv.js";import{P as Q}from"./usePeriodFilter-_Bz0lW7o.js";import{S as o}from"./skeleton-i1TSOWrq.js";import{A as V,a as X}from"./alert-u8e1tjxL.js";import{u as P}from"./useQuery-BTZGCW5c.js";import"./LatexTitle-nKm6G6V5.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-BZImI1cv.js";const G=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],J={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},Y={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},Z=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",ee=t=>t==="today"||t==="week"||t==="month"||t==="all_time"?t:"all_time",se=()=>{const t=O(),[i,m]=l.useState(""),[c,h]=l.useState(I),d=l.useRef(null);l.useEffect(()=>{const r=d.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[i]);const p=()=>{const r=i.trim();r&&(K(r,c),t("/chat"))};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:d,rows:1,value:i,placeholder:"Ask the assistant about papers, tasks, methods, or benchmarks…",onChange:r=>m(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),p())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(q,{models:U,selectedModel:c,onModelChange:h}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${i.trim()?" chat-send-on":""}`,onClick:p,disabled:!i.trim(),"aria-label":"Ask the assistant",children:e.jsx($,{})})]})]})},ue=()=>{var N,b,y,_,v;const[t,i]=D(),m=Z(t.get("order_by")),c=ee(t.get("time")),h=t.get("has_code")==="true",d=t.get("has_hf_artifacts")==="true",p=Y[c],r=s=>{const a=new URLSearchParams(t);a.set("order_by",s),i(a)},w=s=>{const a=new URLSearchParams(t);a.set("time",J[s]),i(a)},A=s=>{const a=new URLSearchParams(t);s?a.set("has_code","true"):a.delete("has_code"),i(a)},C=s=>{const a=new URLSearchParams(t);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),i(a)},u=P({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),x=P({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),n=W({page_size:30,order_by:m,order_dir:"desc",time:c,include_resources:!0,has_code:h,has_hf_artifacts:d}),g=l.useMemo(()=>{var a;return(((a=n.data)==null?void 0:a.pages.flatMap(M=>M.results))||[]).map(B)},[n.data]),{targetRef:L,isIntersecting:j}=z({rootMargin:"400px"});l.useEffect(()=>{j&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[j,n.hasNextPage,n.isFetchingNextPage]);const S=n.isLoading,F=n.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"}),u.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(o,{className:"h-5 w-full"},a))}),(N=u.data)==null?void 0:N.map(s=>e.jsxs(f,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(f,{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(o,{className:"h-5 w-full"},a))}),((y=(b=x.data)==null?void 0:b.results)==null?void 0:y.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(v=(_=x.data)==null?void 0:_.results)==null?void 0:v.map(s=>e.jsxs(f,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[E()&&e.jsx(se,{}),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:G.map(([s,a])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>r(s),children:a},s))}),e.jsx(H,{hasCode:h,hasHfArtifacts:d,onHasCodeChange:A,onHasHfArtifactsChange:C})]}),e.jsx("div",{className:"sort-options sort-options-time",children:Q.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${p===s?"active":""}`,onClick:()=>w(s),children:s},s))})]}),F&&e.jsx(V,{variant:"destructive",className:"mb-4",children:e.jsx(X,{children:"Failed to load papers. Please try again."})}),S?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(o,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(o,{className:"h-6 w-3/4"}),e.jsx(o,{className:"h-4 w-1/2"}),e.jsx(o,{className:"h-12 w-full"})]})]},a))}):g.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:g.map((s,a)=>e.jsx(R,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{ue as default};
|
|
|
|
|
|
assets/FeedView-DKcTVApQ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as D,r as l,j as e,L as f,i as E,a as O,b as T}from"./index-ClYrAl8a.js";import{P as R}from"./components-C_OCzHXF.js";import{P as H}from"./PaperFeedFilters-4l2Zc9pi.js";import{D as I,M as q,F as U,A as $,q as K}from"./chatSessions-MtbDAqMr.js";import{t as B,d as k}from"./transform-BxrCkLtR.js";import{u as W}from"./usePapers-DmFNFSTF.js";import{u as z}from"./useIntersectionObserver-Dnf5-OL3.js";import{P as Q}from"./usePeriodFilter-BHhVcedk.js";import{S as o}from"./skeleton-C5gy1_r-.js";import{A as V,a as X}from"./alert-2CUZfv8i.js";import{u as P}from"./useQuery-Drr20jTc.js";import"./LatexTitle-BWD9oOWn.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CT7QSfbE.js";import"./useBaseQuery-DlkwakD5.js";const G=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],J={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},Y={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},Z=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",ee=t=>t==="today"||t==="week"||t==="month"||t==="all_time"?t:"all_time",se=()=>{const t=O(),[i,m]=l.useState(""),[c,h]=l.useState(I),d=l.useRef(null);l.useEffect(()=>{const r=d.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[i]);const p=()=>{const r=i.trim();r&&(K(r,c),t("/chat"))};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:d,rows:1,value:i,placeholder:"Ask the assistant about papers, tasks, methods, or benchmarks…",onChange:r=>m(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),p())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(q,{models:U,selectedModel:c,onModelChange:h}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${i.trim()?" chat-send-on":""}`,onClick:p,disabled:!i.trim(),"aria-label":"Ask the assistant",children:e.jsx($,{})})]})]})},ge=()=>{var N,b,y,_,v;const[t,i]=D(),m=Z(t.get("order_by")),c=ee(t.get("time")),h=t.get("has_code")==="true",d=t.get("has_hf_artifacts")==="true",p=Y[c],r=s=>{const a=new URLSearchParams(t);a.set("order_by",s),i(a)},w=s=>{const a=new URLSearchParams(t);a.set("time",J[s]),i(a)},A=s=>{const a=new URLSearchParams(t);s?a.set("has_code","true"):a.delete("has_code"),i(a)},C=s=>{const a=new URLSearchParams(t);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),i(a)},u=P({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),x=P({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),n=W({page_size:30,order_by:m,order_dir:"desc",time:c,include_resources:!0,has_code:h,has_hf_artifacts:d}),g=l.useMemo(()=>{var a;return(((a=n.data)==null?void 0:a.pages.flatMap(M=>M.results))||[]).map(B)},[n.data]),{targetRef:L,isIntersecting:j}=z({rootMargin:"400px"});l.useEffect(()=>{j&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[j,n.hasNextPage,n.isFetchingNextPage]);const S=n.isLoading,F=n.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"}),u.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(o,{className:"h-5 w-full"},a))}),(N=u.data)==null?void 0:N.map(s=>e.jsxs(f,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(f,{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(o,{className:"h-5 w-full"},a))}),((y=(b=x.data)==null?void 0:b.results)==null?void 0:y.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(v=(_=x.data)==null?void 0:_.results)==null?void 0:v.map(s=>e.jsxs(f,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[E()&&e.jsx(se,{}),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:G.map(([s,a])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>r(s),children:a},s))}),e.jsx(H,{hasCode:h,hasHfArtifacts:d,onHasCodeChange:A,onHasHfArtifactsChange:C})]}),e.jsx("div",{className:"sort-options sort-options-time",children:Q.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${p===s?"active":""}`,onClick:()=>w(s),children:s},s))})]}),F&&e.jsx(V,{variant:"destructive",className:"mb-4",children:e.jsx(X,{children:"Failed to load papers. Please try again."})}),S?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(o,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(o,{className:"h-6 w-3/4"}),e.jsx(o,{className:"h-4 w-1/2"}),e.jsx(o,{className:"h-12 w-full"})]})]},a))}):g.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:g.map((s,a)=>e.jsx(R,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{ge as default};
|
assets/FrameworksIndexView-7hnBIs3s.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{R as c,j as e,L as d,b as m}from"./index-ClYrAl8a.js";import{u as h}from"./useQuery-Drr20jTc.js";import{I as g}from"./components-C_OCzHXF.js";import{e as p,h as u}from"./transform-BxrCkLtR.js";import"./useBaseQuery-DlkwakD5.js";import"./LatexTitle-BWD9oOWn.js";import"./katex.min-BSBacQyE.js";const f={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},x={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},j={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},v={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},k={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},w=({platform:r})=>{const i=p(u(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:i.bg,color:i.text},children:f[r]})},_=({framework:r})=>e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card",children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(i=>e.jsx(w,{platform:i},i))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(d,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Paper"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(g,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]}),B=()=>{var l;const r=h({queryKey:["framework-catalog"],queryFn:()=>m.getFrameworkCatalog()}),i=((l=r.data)==null?void 0:l.domains)??[],o=i.reduce((a,s)=>a+s.categories.reduce((n,t)=>n+t.frameworks.length,0),0);return c.useEffect(()=>{var s;const a=window.location.hash.slice(1);a&&((s=document.getElementById(a))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),i.map(a=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:x,children:[e.jsxs("div",{children:[e.jsx("h2",{style:j,children:a.name}),e.jsx("div",{style:v,children:a.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.categories.length," ",a.categories.length===1?"category":"categories"," ·"," ",a.categories.reduce((s,n)=>s+n.frameworks.length,0)," frameworks"]})]}),a.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:k,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(n=>e.jsx(_,{framework:n},n.slug))})]},s.slug))]},a.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[o," frameworks across ",i.length," ",i.length===1?"domain":"domains",". More areas coming soon."]})]})};export{B as default};
|
assets/FrameworksIndexView-BxbTwJZt.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{R as c,j as e,L as d,b as m}from"./index-aFSBl9QY.js";import{u as h}from"./useQuery-BTZGCW5c.js";import{I as g}from"./components-3ObcZwMF.js";import{e as p,h as u}from"./transform-DQ9X1I92.js";import"./LatexTitle-nKm6G6V5.js";import"./katex.min-BSBacQyE.js";const f={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},x={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},j={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},v={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},k={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},w=({platform:r})=>{const i=p(u(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:i.bg,color:i.text},children:f[r]})},_=({framework:r})=>e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card",children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(i=>e.jsx(w,{platform:i},i))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(d,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Paper"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(g,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]}),z=()=>{var l;const r=h({queryKey:["framework-catalog"],queryFn:()=>m.getFrameworkCatalog()}),i=((l=r.data)==null?void 0:l.domains)??[],o=i.reduce((a,s)=>a+s.categories.reduce((n,t)=>n+t.frameworks.length,0),0);return c.useEffect(()=>{var s;const a=window.location.hash.slice(1);a&&((s=document.getElementById(a))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),i.map(a=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:x,children:[e.jsxs("div",{children:[e.jsx("h2",{style:j,children:a.name}),e.jsx("div",{style:v,children:a.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.categories.length," ",a.categories.length===1?"category":"categories"," ·"," ",a.categories.reduce((s,n)=>s+n.frameworks.length,0)," frameworks"]})]}),a.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:k,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(n=>e.jsx(_,{framework:n},n.slug))})]},s.slug))]},a.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[o," frameworks across ",i.length," ",i.length===1?"domain":"domains",". More areas coming soon."]})]})};export{z as default};
|
|
|
|
|
|
assets/{LatexTitle-nKm6G6V5.js → LatexTitle-BWD9oOWn.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as o,r as g}from"./index-
|
|
|
|
| 1 |
+
import{j as o,r as g}from"./index-ClYrAl8a.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-BuawND0S.js → MarkdownText-g9v8ocG0.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{S as l,j as s,L as u}from"./index-ClYrAl8a.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-Do8kbf9Q.js";import{M as d,r as w}from"./index-DmFk7249.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M};
|
assets/MethodDetailView-Bo-Srxo6.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{j as e,r as E,e as W,u as V,L as R,b as v,ai as Z}from"./index-aFSBl9QY.js";import{u as A}from"./useQuery-BTZGCW5c.js";import{u as X}from"./useInfiniteQuery-BZImI1cv.js";import{M as Y,P as J}from"./components-3ObcZwMF.js";import{P as ee}from"./PaperFeedFilters-DWsoFzku.js";import{M as H}from"./MarkdownText-BuawND0S.js";import{s as te}from"./slug-BpH-Nkvz.js";import{t as se}from"./transform-DQ9X1I92.js";import{u as ae}from"./useIntersectionObserver-CoKzzCGv.js";import{S as M}from"./skeleton-i1TSOWrq.js";import{A as ie,a as re}from"./alert-u8e1tjxL.js";import"./LatexTitle-nKm6G6V5.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BhsnwX7g.js";import"./index-B-Qd56lo.js";import"./hover-card-BZrFUFNS.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},p=({x:s,y:a,w:i,h:r,fill:f,stroke:j,label:g,fontSize:c=10,multiline:y})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:a,width:i,height:r,rx:"3",ry:"3",fill:f,stroke:j,strokeWidth:"1"}),y?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:s+i/2,y:a+r/2-2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[0]}),e.jsx("text",{x:s+i/2,y:a+r/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[1]})]}):e.jsx("text",{x:s+i/2,y:a+r/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:g})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(p,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(p,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(p,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(p,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(p,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(p,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(p,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(p,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const a=30+s*75,i=60-s*8,r=240-s*30;return e.jsx("g",{children:e.jsx("rect",{x:a,y:(420-r)/2,width:i,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][s],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][s],strokeWidth:"1"})},s)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:50,y:i,width:r,height:f,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${s}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:210,y:i,width:r,height:f,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${s}`)}),[0,1,2,3].map(s=>{const a=60+s*80+(50-s*6)/2,i=50+(100-s*12);return e.jsx("path",{d:`M${i} ${a} L210 ${a}`,stroke:t.faint,strokeDasharray:"4 3"},`s${s}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),le=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(s=>[0,1,2].map(a=>e.jsx("rect",{x:20+a*40,y:40+s*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][s*3+a],stroke:t.faint},`${s}-${a}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(p,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(p,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(s=>{const a=25+s*56,i=(5-s)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:a,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-i*.1} 0.04 250)`,stroke:t.faint}),i<.4&&e.jsx("circle",{cx:a+25,cy:115,r:12-i*16,fill:t.orange,opacity:1-i*1.5})]},s)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),oe=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),de.map(([s,a],i)=>{const r=92+i*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),a?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:a}):null]},s)})]}),xe={attention:G,"self-attention":G,cnn:ne,"u-net":q,unet:q,vit:le,diffusion:O,ddpm:O,gan:oe,vae:ce,"agent-skills":he},me=({method:s})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(p,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(p,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(p,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),fe=({method:s})=>{const a=(s.slug||"").toLowerCase(),i=xe[a];if(i)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(i,{})});if(s.image_url){const r=a==="transformer"||a==="gpt-4"||a==="gpt-4o"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${r}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(me,{method:s})})},L=720,C=138,u={top:8,right:10,bottom:25,left:36},U=56,pe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=s=>pe.format(new Date(`${s}T00:00:00Z`)),ue=(s,a)=>{if(s===0)return new Set;const i=s>48?12:s>36?6:s>18?3:2,r=Math.max(1,Math.ceil(U/a)),f=Math.max(i,r),j=s-1,g=new Set([0,j]);for(let c=f;c<j;c+=f)(j-c)*a>=U&&g.add(c);return g},K=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const a=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${a}`},je=({history:s,methodName:a})=>{const[i,r]=E.useState(null),f=Math.max(1,...s.map(n=>n.paper_count)),j=L-u.left-u.right,g=C-u.top-u.bottom,c=s.length?j/s.length:j,y=Math.max(2,c*.68),d=ue(s.length,c),z=Array.from(new Set([0,Math.ceil(f/2),f])),x=i==null?null:s[i],S=x?K(x):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${L} ${C}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),z.map(n=>{const m=u.top+g-n/f*g;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:L-u.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:m+3,textAnchor:"end",children:n})]},n)}),s.map((n,m)=>{const k=n.paper_count/f*g,b=n.paper_count>0?Math.max(1,k):0,F=u.left+c*m+(c-y)/2,l=u.top+g-b,_=i===m,N=m===s.length-1,w=K(n);return e.jsxs("g",{className:`method-usage-bar${_?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(n.start_date)}: ${n.paper_count} ${n.paper_count===1?"paper":"papers"}${w?`. ${w}`:""}`,onMouseEnter:()=>r(m),onMouseLeave:()=>r(null),onFocus:()=>r(m),onBlur:()=>r(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+c*m,y:u.top,width:c,height:g}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:l,width:y,height:b,rx:"1.5"})]},n.start_date)}),s.map((n,m)=>d.has(m)?e.jsx("text",{className:"method-usage-x-label",x:u.left+c*(m+.5),y:C-11,textAnchor:"middle",children:s.length>48?ge.format(new Date(`${n.start_date}T00:00:00Z`)):B(n.start_date)},n.start_date):null)]}),x&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(x.start_date)}),e.jsxs("span",{children:[x.paper_count," ",x.paper_count===1?"paper":"papers",i===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(x.catalog_share??0).toFixed(2),"% of"," ",(x.catalog_paper_count??0).toLocaleString()," catalog papers"]}),S&&e.jsx("span",{children:S})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Q={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},$e=()=>{var N,w,$,P,T,I;const{methodSlug:s}=W(),[a,i]=V(),[r,f]=E.useState("trending"),j=a.get("has_code")==="true",g=a.get("has_hf_artifacts")==="true",c=o=>{const h=new URLSearchParams(a);o?h.set("has_code","true"):h.delete("has_code"),i(h)},y=o=>{const h=new URLSearchParams(a);o?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),i(h)},d=A({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),z=A({queryKey:["areas-all"],queryFn:()=>v.getAreas({page_size:50,ordering:"name"}),enabled:!!((N=d.data)!=null&&N.area_id),staleTime:10*60*1e3}),x=A({queryKey:["method-trend",s],queryFn:()=>v.getMethodTrend(s),enabled:!!s&&!!d.data,staleTime:10*60*1e3}),S=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",n=X({queryKey:["method-papers-infinite",s,S,j,g],queryFn:({pageParam:o=1})=>v.getMethodPapers(s,{page:o,page_size:20,order_by:S,order_dir:"desc",include_resources:!0,has_code:j,has_hf_artifacts:g}),getNextPageParam:o=>o.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Z}),m=A({queryKey:["related-methods",(w=d.data)==null?void 0:w.slug,($=d.data)==null?void 0:$.area_id,(P=d.data)==null?void 0:P.id],queryFn:async()=>{const o=Q[d.data.slug];return o?Promise.all(o.map(D=>v.getMethod(D))):(await v.getMethods({area_id:d.data.area_id,exclude_id:d.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!d.data&&(!!Q[d.data.slug]||!!d.data.area_id),staleTime:10*60*1e3}),k=E.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(D=>D.results))||[]).map(se)},[n.data]),{targetRef:b,isIntersecting:F}=ae({rootMargin:"200px"});if(E.useEffect(()=>{F&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[F,n.hasNextPage,n.isFetchingNextPage]),d.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(re,{children:"Method not found."})})});const l=d.data,_=(T=z.data)==null?void 0:T.results.find(o=>o.id===l.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(R,{to:"/methods",children:"Methods"}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(R,{to:`/methods#area-${te(_.name)}`,children:_.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:l.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${l.slug==="grokking"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:l.name}),l.full_name&&l.full_name!==l.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:l.full_name}),l.description&&e.jsx(H,{className:"method-description",text:l.description}),l.source_url&&l.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:l.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:l.source_title}),l.introduced_year&&e.jsx("span",{className:"method-source-meta",children:l.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(l.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[x.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]})]}),l.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:l.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(je,{history:x.data.history,methodName:l.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(fe,{method:l}),l.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:l.image_credit})})]})]}),(((I=m.data)==null?void 0:I.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(o=>e.jsx(Y,{method:{slug:o.slug,name:o.name}},o.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([o,h])=>e.jsx("button",{className:`sort-btn ${r===o?"active":""}`,onClick:()=>f(o),children:h},o))}),e.jsx(ee,{hasCode:j,hasHfArtifacts:g,onHasCodeChange:c,onHasHfArtifactsChange:y})]}),e.jsxs("div",{className:"results-count",children:[k.length," papers mentioning ",l.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((o,h)=>e.jsx(M,{className:"h-40 w-full"},h))}):k.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:k.map((o,h)=>e.jsx(J,{paper:o,rank:h+1},o.id))}),e.jsx("div",{ref:b,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{$e as default};
|
|
|
|
|
|
assets/MethodDetailView-dJffY-jK.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{j as e,r as E,e as W,u as V,L as R,b as v,aj as Z}from"./index-ClYrAl8a.js";import{u as A}from"./useQuery-Drr20jTc.js";import{u as X}from"./useInfiniteQuery-CT7QSfbE.js";import{M as Y,P as J}from"./components-C_OCzHXF.js";import{P as ee}from"./PaperFeedFilters-4l2Zc9pi.js";import{M as H}from"./MarkdownText-g9v8ocG0.js";import{s as te}from"./slug-BpH-Nkvz.js";import{t as se}from"./transform-BxrCkLtR.js";import{u as ae}from"./useIntersectionObserver-Dnf5-OL3.js";import{S as M}from"./skeleton-C5gy1_r-.js";import{A as ie,a as re}from"./alert-2CUZfv8i.js";import"./useBaseQuery-DlkwakD5.js";import"./LatexTitle-BWD9oOWn.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Do8kbf9Q.js";import"./index-DmFk7249.js";import"./hover-card-BDewF190.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},p=({x:s,y:a,w:i,h:r,fill:f,stroke:j,label:g,fontSize:c=10,multiline:y})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:a,width:i,height:r,rx:"3",ry:"3",fill:f,stroke:j,strokeWidth:"1"}),y?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:s+i/2,y:a+r/2-2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[0]}),e.jsx("text",{x:s+i/2,y:a+r/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[1]})]}):e.jsx("text",{x:s+i/2,y:a+r/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:g})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(p,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(p,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(p,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(p,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(p,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(p,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(p,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(p,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const a=30+s*75,i=60-s*8,r=240-s*30;return e.jsx("g",{children:e.jsx("rect",{x:a,y:(420-r)/2,width:i,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][s],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][s],strokeWidth:"1"})},s)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:50,y:i,width:r,height:f,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${s}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:210,y:i,width:r,height:f,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${s}`)}),[0,1,2,3].map(s=>{const a=60+s*80+(50-s*6)/2,i=50+(100-s*12);return e.jsx("path",{d:`M${i} ${a} L210 ${a}`,stroke:t.faint,strokeDasharray:"4 3"},`s${s}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),le=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(s=>[0,1,2].map(a=>e.jsx("rect",{x:20+a*40,y:40+s*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][s*3+a],stroke:t.faint},`${s}-${a}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(p,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(p,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(p,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(s=>{const a=25+s*56,i=(5-s)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:a,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-i*.1} 0.04 250)`,stroke:t.faint}),i<.4&&e.jsx("circle",{cx:a+25,cy:115,r:12-i*16,fill:t.orange,opacity:1-i*1.5})]},s)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),oe=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),de.map(([s,a],i)=>{const r=92+i*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),a?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:a}):null]},s)})]}),xe={attention:G,"self-attention":G,cnn:ne,"u-net":q,unet:q,vit:le,diffusion:O,ddpm:O,gan:oe,vae:ce,"agent-skills":he},me=({method:s})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(p,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(p,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(p,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),fe=({method:s})=>{const a=(s.slug||"").toLowerCase(),i=xe[a];if(i)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(i,{})});if(s.image_url){const r=a==="transformer"||a==="gpt-4"||a==="gpt-4o"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${r}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(me,{method:s})})},L=720,C=138,u={top:8,right:10,bottom:25,left:36},U=56,pe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=s=>pe.format(new Date(`${s}T00:00:00Z`)),ue=(s,a)=>{if(s===0)return new Set;const i=s>48?12:s>36?6:s>18?3:2,r=Math.max(1,Math.ceil(U/a)),f=Math.max(i,r),j=s-1,g=new Set([0,j]);for(let c=f;c<j;c+=f)(j-c)*a>=U&&g.add(c);return g},K=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const a=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${a}`},je=({history:s,methodName:a})=>{const[i,r]=E.useState(null),f=Math.max(1,...s.map(n=>n.paper_count)),j=L-u.left-u.right,g=C-u.top-u.bottom,c=s.length?j/s.length:j,y=Math.max(2,c*.68),d=ue(s.length,c),z=Array.from(new Set([0,Math.ceil(f/2),f])),x=i==null?null:s[i],S=x?K(x):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${L} ${C}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),z.map(n=>{const m=u.top+g-n/f*g;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:L-u.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:m+3,textAnchor:"end",children:n})]},n)}),s.map((n,m)=>{const k=n.paper_count/f*g,b=n.paper_count>0?Math.max(1,k):0,F=u.left+c*m+(c-y)/2,l=u.top+g-b,_=i===m,N=m===s.length-1,w=K(n);return e.jsxs("g",{className:`method-usage-bar${_?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(n.start_date)}: ${n.paper_count} ${n.paper_count===1?"paper":"papers"}${w?`. ${w}`:""}`,onMouseEnter:()=>r(m),onMouseLeave:()=>r(null),onFocus:()=>r(m),onBlur:()=>r(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+c*m,y:u.top,width:c,height:g}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:l,width:y,height:b,rx:"1.5"})]},n.start_date)}),s.map((n,m)=>d.has(m)?e.jsx("text",{className:"method-usage-x-label",x:u.left+c*(m+.5),y:C-11,textAnchor:"middle",children:s.length>48?ge.format(new Date(`${n.start_date}T00:00:00Z`)):B(n.start_date)},n.start_date):null)]}),x&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(x.start_date)}),e.jsxs("span",{children:[x.paper_count," ",x.paper_count===1?"paper":"papers",i===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(x.catalog_share??0).toFixed(2),"% of"," ",(x.catalog_paper_count??0).toLocaleString()," catalog papers"]}),S&&e.jsx("span",{children:S})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Q={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Pe=()=>{var N,w,$,P,T,I;const{methodSlug:s}=W(),[a,i]=V(),[r,f]=E.useState("trending"),j=a.get("has_code")==="true",g=a.get("has_hf_artifacts")==="true",c=o=>{const h=new URLSearchParams(a);o?h.set("has_code","true"):h.delete("has_code"),i(h)},y=o=>{const h=new URLSearchParams(a);o?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),i(h)},d=A({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),z=A({queryKey:["areas-all"],queryFn:()=>v.getAreas({page_size:50,ordering:"name"}),enabled:!!((N=d.data)!=null&&N.area_id),staleTime:10*60*1e3}),x=A({queryKey:["method-trend",s],queryFn:()=>v.getMethodTrend(s),enabled:!!s&&!!d.data,staleTime:10*60*1e3}),S=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",n=X({queryKey:["method-papers-infinite",s,S,j,g],queryFn:({pageParam:o=1})=>v.getMethodPapers(s,{page:o,page_size:20,order_by:S,order_dir:"desc",include_resources:!0,has_code:j,has_hf_artifacts:g}),getNextPageParam:o=>o.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Z}),m=A({queryKey:["related-methods",(w=d.data)==null?void 0:w.slug,($=d.data)==null?void 0:$.area_id,(P=d.data)==null?void 0:P.id],queryFn:async()=>{const o=Q[d.data.slug];return o?Promise.all(o.map(D=>v.getMethod(D))):(await v.getMethods({area_id:d.data.area_id,exclude_id:d.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!d.data&&(!!Q[d.data.slug]||!!d.data.area_id),staleTime:10*60*1e3}),k=E.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(D=>D.results))||[]).map(se)},[n.data]),{targetRef:b,isIntersecting:F}=ae({rootMargin:"200px"});if(E.useEffect(()=>{F&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[F,n.hasNextPage,n.isFetchingNextPage]),d.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(re,{children:"Method not found."})})});const l=d.data,_=(T=z.data)==null?void 0:T.results.find(o=>o.id===l.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(R,{to:"/methods",children:"Methods"}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(R,{to:`/methods#area-${te(_.name)}`,children:_.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:l.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${l.slug==="grokking"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:l.name}),l.full_name&&l.full_name!==l.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:l.full_name}),l.description&&e.jsx(H,{className:"method-description",text:l.description}),l.source_url&&l.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:l.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:l.source_title}),l.introduced_year&&e.jsx("span",{className:"method-source-meta",children:l.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(l.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[x.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]})]}),l.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:l.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(je,{history:x.data.history,methodName:l.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(fe,{method:l}),l.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:l.image_credit})})]})]}),(((I=m.data)==null?void 0:I.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(o=>e.jsx(Y,{method:{slug:o.slug,name:o.name}},o.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([o,h])=>e.jsx("button",{className:`sort-btn ${r===o?"active":""}`,onClick:()=>f(o),children:h},o))}),e.jsx(ee,{hasCode:j,hasHfArtifacts:g,onHasCodeChange:c,onHasHfArtifactsChange:y})]}),e.jsxs("div",{className:"results-count",children:[k.length," papers mentioning ",l.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((o,h)=>e.jsx(M,{className:"h-40 w-full"},h))}):k.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:k.map((o,h)=>e.jsx(J,{paper:o,rank:h+1},o.id))}),e.jsx("div",{ref:b,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Pe as default};
|
assets/{MethodsIndexView-C-fwph8R.js → MethodsIndexView-DZ9FMSze.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
import{c as g,r as d,j as e,L as j,b as m}from"./index-
|
| 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=g("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]),
|
|
|
|
| 1 |
+
import{c as g,r as d,j as e,L as j,b as m}from"./index-ClYrAl8a.js";import{u as h}from"./useQuery-Drr20jTc.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-C5gy1_r-.js";import{A as y,a as v}from"./alert-2CUZfv8i.js";import{T as _}from"./TaxonomySuggestionTile-9YotnIt8.js";import"./useBaseQuery-DlkwakD5.js";import"./SignInToEditDialog-D5M5vIDC.js";import"./button-5hN1cjku.js";import"./textarea-CiVGOMsF.js";import"./dialog-zw8tnspo.js";import"./useMutation-DivT1EgA.js";import"./loader-circle-DQ1xuEZx.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=g("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]),B=()=>{var l,c;const i=h({queryKey:["areas-all"],queryFn:()=>m.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=h({queryKey:["methods-all"],queryFn:async()=>(await m.getMethods({page:1,page_size:500,ordering:"-trend_score",include_trends:!0})).results,staleTime:10*60*1e3}),o=d.useMemo(()=>{if(!n.data||!i.data)return null;const t={};return n.data.forEach(r=>{const a=r.area_id??"_unassigned";(t[a]||(t[a]=[])).push(r)}),Object.values(t).forEach(r=>r.sort((a,s)=>(s.trend_score||0)-(a.trend_score||0)||(s.paper_count||0)-(a.paper_count||0)||a.name.localeCompare(s.name))),t},[n.data,i.data]),u=d.useMemo(()=>{const t=(n.data||[]).filter(a=>(a.trend_score||0)>0).sort((a,s)=>(s.trend_score||0)-(a.trend_score||0)),r=Math.ceil(t.length*.25);return new Set(t.slice(0,r).map(a=>a.id))},[n.data]);return d.useEffect(()=>{var t;!i.data||!n.data||!window.location.hash||(t=document.getElementById(window.location.hash.slice(1)))==null||t.scrollIntoView({block:"start"})},[i.data,n.data]),i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(y,{variant:"destructive",children:e.jsx(v,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research. Trend scores show papers using each method per 30 days, measured over the latest 90 days; the flame marks the top quartile."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((t,r)=>e.jsxs("div",{children:[e.jsx(p,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((a,s)=>e.jsx(p,{className:"h-20"},s))})]},r))}):(c=(l=i.data)==null?void 0:l.results)==null?void 0:c.map(t=>{const r=(o==null?void 0:o[t.id])||[];if(r.length===0)return null;const a=r.reduce((s,x)=>s+(x.paper_count||0),0);return e.jsxs("section",{id:`area-${f(t.name)}`,style:{marginBottom:48,scrollMarginTop:80},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:t.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," methods · ",a.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[r.map(s=>e.jsxs(j,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:[s.name,u.has(s.id)&&e.jsx(N,{className:"method-trending-icon",size:15,"aria-label":"Top quartile by recent method mentions"})]}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),(s.trend_score??0)>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{className:"method-trend-score",children:[(s.trend_score??0).toFixed(1),"/mo"]})]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id)),e.jsx(_,{kind:"method"})]})]},t.id)})]})};export{B as default};
|
assets/{NotFound-Ce0_Y2Nt.js → NotFound-CWr2aUkR.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{aJ as o,r as a,j as t,L as s}from"./index-ClYrAl8a.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
|
assets/OrganizationDetailView-BsmKK6Ux.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as t,j as r}from"./index-ClYrAl8a.js";import{O as i}from"./OrganizationPaperFeed-QOOCyRuu.js";import m from"./NotFound-CWr2aUkR.js";import"./useQuery-Drr20jTc.js";import"./useBaseQuery-DlkwakD5.js";import"./components-C_OCzHXF.js";import"./LatexTitle-BWD9oOWn.js";import"./katex.min-BSBacQyE.js";import"./transform-BxrCkLtR.js";import"./MarkdownText-g9v8ocG0.js";import"./PaperPreviewLink-Do8kbf9Q.js";import"./index-DmFk7249.js";import"./hover-card-BDewF190.js";import"./PaperFeedFilters-4l2Zc9pi.js";import"./alert-2CUZfv8i.js";import"./searchable-select-54P5CJaa.js";import"./button-5hN1cjku.js";import"./dialog-zw8tnspo.js";import"./loader-circle-DQ1xuEZx.js";import"./skeleton-C5gy1_r-.js";import"./useIntersectionObserver-Dnf5-OL3.js";import"./usePapers-DmFNFSTF.js";import"./useInfiniteQuery-CT7QSfbE.js";const V=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{V as default};
|
assets/OrganizationDetailView-CrUNAiga.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as t,j as r}from"./index-aFSBl9QY.js";import{O as i}from"./OrganizationPaperFeed-DwiJGjIb.js";import m from"./NotFound-Ce0_Y2Nt.js";import"./useQuery-BTZGCW5c.js";import"./components-3ObcZwMF.js";import"./LatexTitle-nKm6G6V5.js";import"./katex.min-BSBacQyE.js";import"./transform-DQ9X1I92.js";import"./MarkdownText-BuawND0S.js";import"./PaperPreviewLink-BhsnwX7g.js";import"./index-B-Qd56lo.js";import"./hover-card-BZrFUFNS.js";import"./PaperFeedFilters-DWsoFzku.js";import"./alert-u8e1tjxL.js";import"./searchable-select-Coy8mZ-R.js";import"./button-qsrhZiTx.js";import"./dialog-BUBOrXx4.js";import"./loader-circle-BpTSq772.js";import"./skeleton-i1TSOWrq.js";import"./useIntersectionObserver-CoKzzCGv.js";import"./usePapers-DE5W7ST-.js";import"./useInfiniteQuery-BZImI1cv.js";const R=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{R as default};
|
|
|
|
|
|
assets/{OrganizationPaperFeed-DwiJGjIb.js → OrganizationPaperFeed-QOOCyRuu.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as M,u as H,r as d,j as e,L as k,b as R}from"./index-
|
|
|
|
| 1 |
+
import{a as M,u as H,r as d,j as e,L as k,b as R}from"./index-ClYrAl8a.js";import{u as E}from"./useQuery-Drr20jTc.js";import{P as q}from"./components-C_OCzHXF.js";import{M as B}from"./MarkdownText-g9v8ocG0.js";import{P as U}from"./PaperFeedFilters-4l2Zc9pi.js";import{A as W,a as Q}from"./alert-2CUZfv8i.js";import{a as G}from"./searchable-select-54P5CJaa.js";import{S as w}from"./skeleton-C5gy1_r-.js";import{u as K}from"./useIntersectionObserver-Dnf5-OL3.js";import{d as D}from"./usePapers-DmFNFSTF.js";import{d as O,t as Z}from"./transform-BxrCkLtR.js";import J from"./NotFound-CWr2aUkR.js";const V=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],X=n=>n==="date_published"||n==="citation_count"?n:"trending",de=({organizationSlug:n,taskSlug:p})=>{var b,N,y,v,P,L,F;const A=M(),[o,h]=H(),[C,m]=d.useState(!1),u=X(o.get("order_by")),g=o.get("has_code")==="true",f=o.get("has_hf_artifacts")==="true",c=E({queryKey:["organization-areas-with-tasks",n],queryFn:()=>R.getOrganizationAreasWithTasks(n),staleTime:10*60*1e3}),l=D({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:$,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&l.hasNextPage&&!l.isFetchingNextPage&&l.fetchNextPage()},[x,l.hasNextPage,l.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const _=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:O(t.name,t.slug)})))},[c.data]),i=_.find(a=>a.slug===p),j=d.useMemo(()=>{var a;return(((a=l.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(Z))},[l.data]),s=(b=c.data)==null?void 0:b.organization,T=((y=(N=l.data)==null?void 0:N.pages[0])==null?void 0:y.count)??0;if(((v=c.error)==null?void 0:v.status)===404||((P=l.error)==null?void 0:P.status)===404)return e.jsx(J,{});if(c.error||l.error)return e.jsx("div",{className:"page",children:e.jsx(W,{variant:"destructive",children:e.jsx(Q,{children:"Failed to load organization papers. Please try again."})})});const S=a=>{const r=a.trim().toLocaleLowerCase();return _.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"}`}))},I=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=o.toString();A({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(k,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(k,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),i&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:O(i.name,i.slug)})]})]}),e.jsxs("header",{style:{marginTop:24,marginBottom:36},children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title",style:{display:"flex",gap:14,alignItems:"center"},children:[s!=null&&s.logo_url&&!C?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,style:{objectFit:"contain"},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(w,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((L=s.paper_count)==null?void 0:L.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",{style:{display:"flex",gap:12,flexWrap:"wrap",marginTop:12},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 ↗"})]})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(G,{value:p??"__all__",onChange:I,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:i?{value:i.slug,label:i.label,description:`${i.paper_count.toLocaleString()} ${i.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((F=s==null?void 0:s.paper_count)==null?void 0:F.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:V.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(o);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(U,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(o);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(o);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[T.toLocaleString()," papers"]})]}),l.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx(w,{className:"h-40 w-full"},r))}):j.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:j.map((a,r)=>e.jsx(q,{paper:a,rank:r+1},a.id))}),e.jsx("div",{ref:$,style:{height:1}}),l.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{de as O};
|
assets/OrganizationTaskView-D3sFrcnl.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as i,j as t}from"./index-ClYrAl8a.js";import{O as m}from"./OrganizationPaperFeed-QOOCyRuu.js";import p from"./NotFound-CWr2aUkR.js";import"./useQuery-Drr20jTc.js";import"./useBaseQuery-DlkwakD5.js";import"./components-C_OCzHXF.js";import"./LatexTitle-BWD9oOWn.js";import"./katex.min-BSBacQyE.js";import"./transform-BxrCkLtR.js";import"./MarkdownText-g9v8ocG0.js";import"./PaperPreviewLink-Do8kbf9Q.js";import"./index-DmFk7249.js";import"./hover-card-BDewF190.js";import"./PaperFeedFilters-4l2Zc9pi.js";import"./alert-2CUZfv8i.js";import"./searchable-select-54P5CJaa.js";import"./button-5hN1cjku.js";import"./dialog-zw8tnspo.js";import"./loader-circle-DQ1xuEZx.js";import"./skeleton-C5gy1_r-.js";import"./useIntersectionObserver-Dnf5-OL3.js";import"./usePapers-DmFNFSTF.js";import"./useInfiniteQuery-CT7QSfbE.js";const V=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{V as default};
|
assets/OrganizationTaskView-DL7qJ2OX.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as i,j as t}from"./index-aFSBl9QY.js";import{O as m}from"./OrganizationPaperFeed-DwiJGjIb.js";import p from"./NotFound-Ce0_Y2Nt.js";import"./useQuery-BTZGCW5c.js";import"./components-3ObcZwMF.js";import"./LatexTitle-nKm6G6V5.js";import"./katex.min-BSBacQyE.js";import"./transform-DQ9X1I92.js";import"./MarkdownText-BuawND0S.js";import"./PaperPreviewLink-BhsnwX7g.js";import"./index-B-Qd56lo.js";import"./hover-card-BZrFUFNS.js";import"./PaperFeedFilters-DWsoFzku.js";import"./alert-u8e1tjxL.js";import"./searchable-select-Coy8mZ-R.js";import"./button-qsrhZiTx.js";import"./dialog-BUBOrXx4.js";import"./loader-circle-BpTSq772.js";import"./skeleton-i1TSOWrq.js";import"./useIntersectionObserver-CoKzzCGv.js";import"./usePapers-DE5W7ST-.js";import"./useInfiniteQuery-BZImI1cv.js";const T=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{T as default};
|
|
|
|
|
|
assets/OrganizationsIndexView-D07k7lxt.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u,r as g,j as e,L as x,b as j}from"./index-aFSBl9QY.js";import{u as y}from"./useQuery-BTZGCW5c.js";import{A as f,a as _}from"./alert-u8e1tjxL.js";import{S as N}from"./skeleton-i1TSOWrq.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)})})},z=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",l=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=l.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,o)=>(o.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(o.name)||r.slug.localeCompare(o.slug)):t==="name"?[...a].sort((r,o)=>r.name.localeCompare(o.name)||r.slug.localeCompare(o.slug)):a},[l.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=l.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))})]}),l.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):l.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>l.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{z as default};
|
|
|
|
|
|
assets/OrganizationsIndexView-Dh2CQVzb.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u,r as g,j as e,L as x,b as j}from"./index-ClYrAl8a.js";import{u as y}from"./useQuery-Drr20jTc.js";import{A as f,a as _}from"./alert-2CUZfv8i.js";import{S as N}from"./skeleton-C5gy1_r-.js";import"./useBaseQuery-DlkwakD5.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},q=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{q as default};
|
assets/PaperDetailView-7Sd0agQy.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/PaperDetailView-D-AGd5B3.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
| 1 |
-
import{c as bt,h as sa,r as d,j as e,P as ls,k as xe,l as cs,m as Te,n as Fe,o as ds,p as jt,C as ge,q as Ve,s as be,g as ce,X as us,t as Ne,v as aa,w as ms,x as ra,y as na,z as ia,A as oa,B as la,D as Wt,E as ca,F as da,G as ua,H as ma,f as We,R as vt,b as Xe,I as hs,d as ps,J as ha,K as pa,M as fa,N as fs,O as xa,e as ga,Q as ba,a as ja,S as va,L as oe,T as ya,U as ka,V as _a,W as wa,Y as Na,Z as Ca,_ as Ea}from"./index-aFSBl9QY.js";import{u as re}from"./useQuery-BTZGCW5c.js";import{I as X,S as Sa,a as Pa,T as Ia,M as Ra}from"./components-3ObcZwMF.js";import{C as $a,E as Aa}from"./ExternalSourceEvalBadge-CgpOekCN.js";import{L as Ke,a as Fa}from"./LatexTitle-nKm6G6V5.js";import{c as Ta}from"./transform-DQ9X1I92.js";import{f as La,D as Ua}from"./latexPlainText-ChVkH0gY.js";import{a as Ma}from"./usePapers-DE5W7ST-.js";import{S as Re}from"./skeleton-i1TSOWrq.js";import{A as Da,a as Ba}from"./alert-u8e1tjxL.js";import{B as q}from"./button-qsrhZiTx.js";import{u as xs}from"./index-DLKGWB-W.js";import{I as Y}from"./textarea-twqgdYKh.js";import{D as de,a as ue,b as me,c as he,d as pe,e as fe}from"./dialog-BUBOrXx4.js";import{u as je}from"./useMutation-5-p9zSWo.js";import{S as yt,P as kt,L as ae,a as Ha}from"./SignInToEditDialog-BoeWau__.js";import{S as Je,a as Yt}from"./searchable-select-Coy8mZ-R.js";import{L as ne}from"./loader-circle-BpTSq772.js";import{B as gs,D as qa,c as Ka,g as za,s as Oa,a as Ga,b as Qa,d as Va,i as Xa,e as Ja}from"./codexAddEvals-DfA_vXlK.js";import{G as Zt}from"./github-DHcKImcC.js";import{M as Wa,r as Ya}from"./index-B-Qd56lo.js";import"./hover-card-BZrFUFNS.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-BZImI1cv.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 es=bt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
| 7 |
-
* @license lucide-react v0.462.0 - ISC
|
| 8 |
-
*
|
| 9 |
-
* This source code is licensed under the ISC license.
|
| 10 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
-
*/const bs=bt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
| 12 |
-
* @license lucide-react v0.462.0 - ISC
|
| 13 |
-
*
|
| 14 |
-
* This source code is licensed under the ISC license.
|
| 15 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 16 |
-
*/const _t=bt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function Za(s){return(s??[]).filter(a=>!!(a.dataset_slug&&a.task_slug))}function er(s,a,r="https://paperswithcode.co"){return a.map(c=>{const i=encodeURIComponent(c.evaluation_id),o=`${r}/api/v1/papers/${encodeURIComponent(s)}/leaderboard-badge.svg?eval=${i}&live=1`,l=new URLSearchParams({task:c.task_slug,eval:c.evaluation_id}),h=`${r}/benchmark/${encodeURIComponent(c.dataset_slug)}?${l.toString()}`;return`[](${h})`}).join(`
|
| 17 |
-
`)}function tr(s,a=!0){return re({queryKey:["evaluations","paper",s],queryFn:()=>{if(!s)throw new Error("Paper ID is required");return sa(s)},enabled:a&&!!s,staleTime:0,refetchOnMount:"always"})}const js=s=>s.replace(/v\d+$/,""),sr={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},ot=(s,a)=>{const r=(s[a]||[]).length;return r<100?{count:r,isLimited:!1}:{count:r,isLimited:!0}},lt=(s,a)=>{const r=s[a];return Array.isArray(r)?r.map(c=>{if(typeof c=="string")return c;if(c&&typeof c=="object"){const i=c;return i.id||i.repoId||null}return null}).filter(c=>!!c).map(c=>`${sr[a]}${c}`):[]},ar=async s=>{try{return(await fetch(`https://huggingface.co/api/papers/${js(s)}`)).ok}catch{return!1}},rr=async s=>{const a=js(s),[r,c]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${a}/repos`).then(async h=>h.ok?h.json():(console.warn(`Failed to fetch repos for arXiv:${a}, status: ${h.status}`),null)).catch(h=>(console.warn(`Failed to fetch repos for arXiv:${a}:`,h),null)),ar(a)]);if(!r)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:c};const i=ot(r,"models"),o=ot(r,"datasets"),l=ot(r,"spaces");return{models:i.count,datasets:o.count,spaces:l.count,modelUrls:lt(r,"models"),datasetUrls:lt(r,"datasets"),spaceUrls:lt(r,"spaces"),isLimited:i.isLimited||o.isLimited||l.isLimited,paperExists:c}},nr=s=>re({queryKey:["huggingface-repos",s],queryFn:()=>rr(s),enabled:!!s,staleTime:10*60*1e3,retry:1});function ir(){const[s,a]=d.useState(!1),[r,c]=d.useState(!1),[i,o]=d.useState(!1),[l,h]=d.useState(!1),[t,v]=d.useState(!1),[k,_]=d.useState(!1);return{isEditingTasks:s,openTasksDialog:()=>a(!0),closeTasksDialog:()=>a(!1),setIsEditingTasks:a,isEditingMethods:r,openMethodsDialog:()=>c(!0),closeMethodsDialog:()=>c(!1),setIsEditingMethods:c,isEditingRepositories:i,openRepositoriesDialog:()=>o(!0),closeRepositoriesDialog:()=>o(!1),setIsEditingRepositories:o,isEditingProjectPages:l,openProjectPagesDialog:()=>h(!0),closeProjectPagesDialog:()=>h(!1),setIsEditingProjectPages:h,isEditingEvaluations:t,openEvaluationsDialog:()=>v(!0),closeEvaluationsDialog:()=>v(!1),setIsEditingEvaluations:v,isEditingSourceUrl:k,openSourceUrlDialog:()=>_(!0),closeSourceUrlDialog:()=>_(!1),setIsEditingSourceUrl:_}}var Ye="Checkbox",[or]=jt(Ye),[lr,wt]=or(Ye);function cr(s){const{__scopeCheckbox:a,checked:r,children:c,defaultChecked:i,disabled:o,form:l,name:h,onCheckedChange:t,required:v,value:k="on",internal_do_not_use_render:_}=s,[A,w]=cs({prop:r,defaultProp:i??!1,onChange:t,caller:Ye}),[u,S]=d.useState(null),[L,M]=d.useState(null),F=d.useRef(!1),N=u?!!l||!!u.closest("form"):!0,T={checked:A,disabled:o,setChecked:w,control:u,setControl:S,name:h,form:l,value:k,hasConsumerStoppedPropagationRef:F,required:v,defaultChecked:le(i)?!1:i,isFormControl:N,bubbleInput:L,setBubbleInput:M};return e.jsx(lr,{scope:a,...T,children:dr(_)?_(T):c})}var vs="CheckboxTrigger",ys=d.forwardRef(({__scopeCheckbox:s,onKeyDown:a,onClick:r,...c},i)=>{const{control:o,value:l,disabled:h,checked:t,required:v,setControl:k,setChecked:_,hasConsumerStoppedPropagationRef:A,isFormControl:w,bubbleInput:u}=wt(vs,s),S=Te(i,k),L=d.useRef(t);return d.useEffect(()=>{const M=o==null?void 0:o.form;if(M){const F=()=>_(L.current);return M.addEventListener("reset",F),()=>M.removeEventListener("reset",F)}},[o,_]),e.jsx(xe.button,{type:"button",role:"checkbox","aria-checked":le(t)?"mixed":t,"aria-required":v,"data-state":Cs(t),"data-disabled":h?"":void 0,disabled:h,value:l,...c,ref:S,onKeyDown:Fe(a,M=>{M.key==="Enter"&&M.preventDefault()}),onClick:Fe(r,M=>{_(F=>le(F)?!0:!F),u&&w&&(A.current=M.isPropagationStopped(),A.current||M.stopPropagation())})})});ys.displayName=vs;var Nt=d.forwardRef((s,a)=>{const{__scopeCheckbox:r,name:c,checked:i,defaultChecked:o,required:l,disabled:h,value:t,onCheckedChange:v,form:k,..._}=s;return e.jsx(cr,{__scopeCheckbox:r,checked:i,defaultChecked:o,disabled:h,required:l,onCheckedChange:v,name:c,form:k,value:t,internal_do_not_use_render:({isFormControl:A})=>e.jsxs(e.Fragment,{children:[e.jsx(ys,{..._,ref:a,__scopeCheckbox:r}),A&&e.jsx(Ns,{__scopeCheckbox:r})]})})});Nt.displayName=Ye;var ks="CheckboxIndicator",_s=d.forwardRef((s,a)=>{const{__scopeCheckbox:r,forceMount:c,...i}=s,o=wt(ks,r);return e.jsx(ls,{present:c||le(o.checked)||o.checked===!0,children:e.jsx(xe.span,{"data-state":Cs(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:a,style:{pointerEvents:"none",...s.style}})})});_s.displayName=ks;var ws="CheckboxBubbleInput",Ns=d.forwardRef(({__scopeCheckbox:s,...a},r)=>{const{control:c,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:l,required:h,disabled:t,name:v,value:k,form:_,bubbleInput:A,setBubbleInput:w}=wt(ws,s),u=Te(r,w),S=xs(o),L=ds(c);d.useEffect(()=>{const F=A;if(!F)return;const N=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(N,"checked").set,m=!i.current;if(S!==o&&R){const x=new Event("click",{bubbles:m});F.indeterminate=le(o),R.call(F,le(o)?!1:o),F.dispatchEvent(x)}},[A,S,o,i]);const M=d.useRef(le(o)?!1:o);return e.jsx(xe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??M.current,required:h,disabled:t,name:v,value:k,form:_,...a,tabIndex:-1,ref:u,style:{...a.style,...L,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ns.displayName=ws;function dr(s){return typeof s=="function"}function le(s){return s==="indeterminate"}function Cs(s){return le(s)?"indeterminate":s?"checked":"unchecked"}const Ze=d.forwardRef(({className:s,style:a,...r},c)=>e.jsx(Nt,{ref:c,className:Ve("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),style:{border:"1px solid #000",...a},...r,children:e.jsx(_s,{className:Ve("flex items-center justify-center text-current"),children:e.jsx(ge,{className:"h-4 w-4"})})}));Ze.displayName=Nt.displayName;function ur(s,a,r){if(!s)return s;const c=i=>i.paper_id!==a||i.paper_title===r?i:{...i,paper_title:r};if(Array.isArray(s)){const i=s.map(c);return i.some((l,h)=>l!==s[h])?i:s}if(Array.isArray(s.results)){const i=s.results.map(c);return i.some((l,h)=>l!==s.results[h])?{...s,results:i}:s}return s}function Le(s,a,r){new Set([...r,a.id,a.arxiv_id].filter(l=>!!l)).forEach(l=>{s.setQueryData(["paper",l],a),s.setQueryData(["paper-arxiv",l],a)}),s.invalidateQueries({queryKey:["papers"],refetchType:"none"}),s.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),s.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const i=String(a.id),o=l=>ur(l,i,a.title);s.setQueriesData({queryKey:["evaluations"]},o),s.setQueriesData({queryKey:["dataset-evals"]},o),s.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),s.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}function Ce({isAuthor:s=!1}){return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:s?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}const mr=250,hr=100;function pr({open:s,onOpenChange:a,paperId:r,arxivId:c,initialTaskIds:i,initialTasks:o,onSuccess:l,submitMode:h="direct",isAuthor:t=!1}){const[v,k]=d.useState(i),[_,A]=d.useState(!1),[w,u]=d.useState(""),[S,L]=d.useState(""),[M,F]=d.useState(new Map),N=be(),{toast:T}=ce(),R=d.useRef(!1);d.useEffect(()=>{if(!s){R.current=!1;return}if(R.current)return;R.current=!0,k(i),u(""),L("");const f=new Map;(o||[]).forEach(P=>{const $=parseInt(P.id);Number.isNaN($)||f.set($,P)}),F(f)},[s,i,o]),d.useEffect(()=>{const f=window.setTimeout(()=>{L(w.trim())},mr);return()=>window.clearTimeout(f)},[w]);const{data:m,isFetching:x}=re({queryKey:["tasks-search",S],queryFn:()=>ms({page_size:hr,...S?{q:S}:{}}),enabled:s});d.useEffect(()=>{var f;(f=m==null?void 0:m.results)!=null&&f.length&&F(P=>{const $=new Map(P);return m.results.forEach(I=>{const C=parseInt(I.id);Number.isNaN(C)||$.set(C,I)}),$})},[m]);const U=d.useMemo(()=>{const f=(m==null?void 0:m.results)||[],P=new Set,$=[];return v.forEach(I=>{if(P.has(I))return;const C=M.get(I);C&&($.push(C),P.add(I))}),f.forEach(I=>{const C=parseInt(I.id);Number.isNaN(C)||P.has(C)||($.push(I),P.add(C))}),$},[m,v,M]),D=je({mutationFn:async({paperId:f,taskIds:P})=>h==="pending"?(await Ne({paper_id:parseInt(f),edit_type:"tasks",proposed_payload:{task_ids:P}}),null):aa(f,P),onMutate:async({taskIds:f})=>{if(h==="pending")return{snapshots:[]};const P=f.map(C=>M.get(C)).filter(C=>!!C).map(C=>({id:C.id,name:C.name,slug:C.slug})).sort((C,J)=>C.name.localeCompare(J.name)),$=Array.from(new Set([r,c].filter(C=>!!C)));await Promise.all($.flatMap(C=>[N.cancelQueries({queryKey:["paper",C]}),N.cancelQueries({queryKey:["paper-arxiv",C]})]));const I=[];return $.forEach(C=>{["paper","paper-arxiv"].forEach(J=>{const p=[J,C],b=N.getQueryData(p);I.push({key:p,data:b}),b&&N.setQueryData(p,{...b,tasks:P})})}),T({title:"Tasks updated",description:`Saved ${f.length} task${f.length===1?"":"s"} for this paper.`}),l==null||l(),a(!1),{snapshots:I}},onSuccess:f=>{if(h==="pending"){T({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),l==null||l(),a(!1);return}f&&Le(N,f,[r,c])},onError:(f,P,$)=>{var J,p;(J=$==null?void 0:$.snapshots)==null||J.forEach(({key:b,data:E})=>{N.setQueryData(b,E)});const I=f;let C=I.message||(h==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(I.response)try{const b=JSON.parse(I.response);typeof(b==null?void 0:b.detail)=="string"?C=b.detail:Array.isArray(b==null?void 0:b.detail)&&((p=b.detail[0])!=null&&p.msg)&&(C=b.detail[0].msg)}catch{C=I.response}T({title:h==="pending"?"Could not submit edit":"Could not save tasks",description:C,variant:"destructive"})}}),H=()=>{D.mutate({paperId:r,taskIds:v})},z=d.useMemo(()=>{if(v.length!==i.length)return!0;const f=new Set(i);return v.some(P=>!f.has(P))},[v,i]),G=(f,P)=>{k($=>P?$.includes(f)?$:[...$,f]:$.filter(I=>I!==f))},Z=()=>u("");return e.jsxs(de,{open:s,onOpenChange:a,children:[e.jsxs(ue,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(me,{children:[e.jsx(he,{children:"Edit Paper Tasks"}),e.jsx(pe,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),h==="pending"&&e.jsx(Ce,{isAuthor:t}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Je,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(Y,{type:"text",placeholder:"Search tasks...",value:w,onChange:f=>u(f.target.value),className:"pl-9 pr-9"}),w&&e.jsx("button",{type:"button",onClick:Z,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(us,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:U.length>0?e.jsx("div",{className:"space-y-2",children:U.map(f=>{const P=parseInt(f.id),$=v.includes(P);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ze,{id:`task-${f.id}`,checked:$,onCheckedChange:I=>G(P,I===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${f.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[f.name,f.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[f.description.substring(0,100),f.description.length>100?"...":""]})]})]},f.id)})}):x?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Je,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:S?`No tasks found matching "${S}"`:"No tasks available"})]})}),e.jsxs(fe,{children:[e.jsx(q,{variant:"ghost",className:"sm:mr-auto",onClick:()=>A(!0),children:"Suggest a new task"}),e.jsx(q,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(q,{onClick:H,disabled:D.isPending||!z,children:D.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),h==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"w-4 h-4 mr-2"}),h==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(yt,{open:_,onOpenChange:A,paperId:r,kind:"task"})]})}const fr=250,xr=100;function gr({open:s,onOpenChange:a,paperId:r,arxivId:c,initialMethodIds:i,initialMethods:o,onSuccess:l,submitMode:h="direct",isAuthor:t=!1}){const[v,k]=d.useState(i),[_,A]=d.useState(!1),[w,u]=d.useState(""),[S,L]=d.useState(""),[M,F]=d.useState(new Map),N=be(),{toast:T}=ce(),R=d.useRef(!1);d.useEffect(()=>{if(!s){R.current=!1;return}if(R.current)return;R.current=!0,k(i),u(""),L("");const f=new Map;(o||[]).forEach(P=>{const $=parseInt(P.id);Number.isNaN($)||f.set($,P)}),F(f)},[s,i,o]),d.useEffect(()=>{const f=window.setTimeout(()=>{L(w.trim())},fr);return()=>window.clearTimeout(f)},[w]);const{data:m,isFetching:x}=re({queryKey:["methods-search",S],queryFn:()=>na({page_size:xr,...S?{q:S}:{}}),enabled:s});d.useEffect(()=>{var f;(f=m==null?void 0:m.results)!=null&&f.length&&F(P=>{const $=new Map(P);return m.results.forEach(I=>{const C=parseInt(I.id);Number.isNaN(C)||$.set(C,I)}),$})},[m]);const U=d.useMemo(()=>{const f=(m==null?void 0:m.results)||[],P=new Set,$=[];return v.forEach(I=>{if(P.has(I))return;const C=M.get(I);C&&($.push(C),P.add(I))}),f.forEach(I=>{const C=parseInt(I.id);Number.isNaN(C)||P.has(C)||($.push(I),P.add(C))}),$},[m,v,M]),D=je({mutationFn:async({paperId:f,methodIds:P})=>h==="pending"?(await Ne({paper_id:parseInt(f),edit_type:"methods",proposed_payload:{method_ids:P}}),null):ra(f,P),onSuccess:f=>{if(h==="pending"){T({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),l==null||l(),a(!1);return}f&&Le(N,f,[r,c]),T({title:"Methods updated",description:`Saved ${v.length} method${v.length===1?"":"s"} for this paper.`}),l==null||l(),a(!1)},onError:f=>{var I;const P=f;let $=P.message||(h==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(P.response)try{const C=JSON.parse(P.response);typeof(C==null?void 0:C.detail)=="string"?$=C.detail:Array.isArray(C==null?void 0:C.detail)&&((I=C.detail[0])!=null&&I.msg)&&($=C.detail[0].msg)}catch{$=P.response}T({title:h==="pending"?"Could not submit edit":"Could not save methods",description:$,variant:"destructive"})}}),H=()=>{D.mutate({paperId:r,methodIds:v})},z=d.useMemo(()=>{if(v.length!==i.length)return!0;const f=new Set(i);return v.some(P=>!f.has(P))},[v,i]),G=(f,P)=>{k($=>P?$.includes(f)?$:[...$,f]:$.filter(I=>I!==f))},Z=()=>u("");return e.jsxs(de,{open:s,onOpenChange:a,children:[e.jsxs(ue,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(me,{children:[e.jsx(he,{children:"Edit Paper Methods"}),e.jsx(pe,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),h==="pending"&&e.jsx(Ce,{isAuthor:t}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Je,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(Y,{type:"text",placeholder:"Search methods...",value:w,onChange:f=>u(f.target.value),className:"pl-9 pr-9"}),w&&e.jsx("button",{type:"button",onClick:Z,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(us,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:U.length>0?e.jsx("div",{className:"space-y-2",children:U.map(f=>{const P=parseInt(f.id),$=v.includes(P);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ze,{id:`method-${f.id}`,checked:$,onCheckedChange:I=>G(P,I===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${f.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[f.name,f.full_name&&f.full_name!==f.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:f.full_name}),f.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[f.description.substring(0,100),f.description.length>100?"...":""]})]})]},f.id)})}):x?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Je,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:S?`No methods found matching "${S}"`:"No methods available"})]})}),e.jsxs(fe,{children:[e.jsx(q,{variant:"ghost",className:"sm:mr-auto",onClick:()=>A(!0),children:"Suggest a new method"}),e.jsx(q,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(q,{onClick:H,disabled:D.isPending||!z,children:D.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),h==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"w-4 h-4 mr-2"}),h==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(yt,{open:_,onOpenChange:A,paperId:r,kind:"method"})]})}function Ae(s){const a=s.trim();if(!a)return null;let r=a;!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`https://${r}`);try{const c=new URL(r);if(c.hostname.toLowerCase()!=="github.com")return null;const i=c.pathname.split("/").filter(Boolean);if(i.length<2)return null;const o=i[0].toLowerCase();let l=i[1].toLowerCase();return l.endsWith(".git")&&(l=l.slice(0,-4)),`https://github.com/${o}/${l}`}catch{return null}}function ts(s,a){const r=Ae(s),c=Ae(a);return r&&c?r===c:s.trim()===a.trim()}function br({open:s,onOpenChange:a,paperId:r,arxivId:c,initialRepositories:i,onSuccess:o,submitMode:l="direct",isAuthor:h=!1}){const[t,v]=d.useState(i),[k,_]=d.useState(""),A=be(),{toast:w}=ce(),u=d.useRef(!1);d.useEffect(()=>{if(!s){u.current=!1;return}u.current||(u.current=!0,v(i),_(""))},[s,i]);const S=je({mutationFn:async({paperId:x,repositories:U})=>l==="pending"?(await Ne({paper_id:parseInt(x),edit_type:"repositories",proposed_payload:{repositories:U}}),null):ia(x,U),onSuccess:x=>{if(l==="pending"){w({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),o==null||o(),a(!1),_("");return}x&&Le(A,x,[r,c]),o==null||o(),a(!1),_("")},onError:x=>{var H;const U=x;let D=U.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(U.response)try{const z=JSON.parse(U.response);typeof(z==null?void 0:z.detail)=="string"?D=z.detail:Array.isArray(z==null?void 0:z.detail)&&((H=z.detail[0])!=null&&H.msg)&&(D=z.detail[0].msg)}catch{D=U.response}w({title:l==="pending"?"Could not submit edit":"Could not save repositories",description:D,variant:"destructive"})}}),L=x=>{const U=[];for(const D of x){const H=U.find(z=>ts(z.url,D.url));if(H)H.is_official=H.is_official||D.is_official;else{const z=Ae(D.url);U.push({url:z??D.url.trim(),is_official:D.is_official})}}return U},M=()=>{const x=k.trim(),U=x?[...t,{url:x,is_official:!1}]:t;return x&&t.some(D=>ts(D.url,x))?(alert("This repository URL is already added"),null):L(U)},F=()=>{const x=M();x!==null&&x.length!==t.length&&(v(x),_(""))},N=x=>{v(t.filter(U=>U.url!==x))},T=x=>{v(t.map(U=>U.url===x?{...U,is_official:!U.is_official}:U))},R=()=>{const x=M();x!==null&&S.mutate({paperId:r,repositories:x})},m=d.useMemo(()=>{const x=k.trim(),U=x?[...t,{url:x,is_official:!1}]:t;if(U.length!==i.length)return!0;const D=L(i),H=L(U);if(H.length!==D.length)return!0;const z=new Map(D.map(G=>[Ae(G.url)??G.url.trim(),!!G.is_official]));return H.some(G=>{const Z=Ae(G.url)??G.url.trim(),f=z.get(Z);return f===void 0||f!==!!G.is_official})},[t,k,i]);return e.jsx(de,{open:s,onOpenChange:a,children:e.jsxs(ue,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(me,{children:[e.jsx(he,{children:"Edit Paper Repositories"}),e.jsx(pe,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),l==="pending"&&e.jsx(Ce,{isAuthor:h}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(Y,{type:"url",placeholder:"https://github.com/owner/repo",value:k,onChange:x=>_(x.target.value),onKeyPress:x=>{x.key==="Enter"&&(x.preventDefault(),F())},className:"flex-1"}),e.jsxs(q,{onClick:F,size:"sm",disabled:!k.trim(),children:[e.jsx(kt,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:t.length>0?e.jsx("div",{className:"space-y-2",children:t.map((x,U)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Zt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:x.url}),x.is_official&&e.jsx(gs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(q,{variant:x.is_official?"default":"outline",size:"sm",onClick:()=>T(x.url),className:"h-8 px-2 text-xs",title:x.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(bs,{className:`w-3.5 h-3.5 mr-1 ${x.is_official?"fill-current":""}`}),x.is_official?"Official":"Mark official"]}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>N(x.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(_t,{className:"w-4 h-4"})})]})]},U))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Zt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(fe,{children:[e.jsx(q,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(q,{onClick:R,disabled:S.isPending||!m,children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function jr({open:s,onOpenChange:a,paperId:r,arxivId:c,initialProjectPages:i,onSuccess:o,submitMode:l="direct",isAuthor:h=!1}){const[t,v]=d.useState(i),[k,_]=d.useState(""),A=be(),{toast:w}=ce(),u=d.useRef(!1);d.useEffect(()=>{if(!s){u.current=!1;return}u.current||(u.current=!0,v(i),_(""))},[s,i]);const S=je({mutationFn:async({paperId:m,projectPages:x})=>l==="pending"?(await Ne({paper_id:parseInt(m),edit_type:"project_pages",proposed_payload:{project_pages:x}}),null):oa(m,x),onSuccess:m=>{if(l==="pending"){w({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),o==null||o(),a(!1),_("");return}m&&Le(A,m,[r,c]),o==null||o(),a(!1),_("")},onError:m=>{var D;const x=m;let U=x.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(x.response)try{const H=JSON.parse(x.response);typeof(H==null?void 0:H.detail)=="string"?U=H.detail:Array.isArray(H==null?void 0:H.detail)&&((D=H.detail[0])!=null&&D.msg)&&(U=H.detail[0].msg)}catch{U=x.response}w({title:l==="pending"?"Could not submit edit":"Could not save project pages",description:U,variant:"destructive"})}}),L=()=>{const m=k.trim();return m?t.some(x=>x.url===m)?(alert("This project page URL is already added"),null):[...t,{url:m,is_official:!1}]:t},M=()=>{const m=L();m!==null&&m.length!==t.length&&(v(m),_(""))},F=m=>{v(t.filter(x=>x.url!==m))},N=m=>{v(t.map(x=>x.url===m?{...x,is_official:!x.is_official}:x))},T=()=>{const m=L();m!==null&&S.mutate({paperId:r,projectPages:m})},R=d.useMemo(()=>{const m=k.trim(),x=m?[...t,{url:m,is_official:!1}]:t;if(x.length!==i.length)return!0;const U=new Map(i.map(D=>[D.url.trim(),!!D.is_official]));return x.some(D=>{const H=U.get(D.url.trim());return H===void 0||H!==!!D.is_official})},[t,k,i]);return e.jsx(de,{open:s,onOpenChange:a,children:e.jsxs(ue,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(me,{children:[e.jsx(he,{children:"Edit Paper Project Pages"}),e.jsx(pe,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),l==="pending"&&e.jsx(Ce,{isAuthor:h}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(Y,{type:"url",placeholder:"https://example.com/project",value:k,onChange:m=>_(m.target.value),onKeyPress:m=>{m.key==="Enter"&&(m.preventDefault(),M())},className:"flex-1"}),e.jsxs(q,{onClick:M,size:"sm",disabled:!k.trim(),children:[e.jsx(kt,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:t.length>0?e.jsx("div",{className:"space-y-2",children:t.map((m,x)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(es,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:m.url}),m.is_official&&e.jsx(gs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(q,{variant:m.is_official?"default":"outline",size:"sm",onClick:()=>N(m.url),className:"h-8 px-2 text-xs",title:m.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(bs,{className:`w-3.5 h-3.5 mr-1 ${m.is_official?"fill-current":""}`}),m.is_official?"Official":"Mark official"]}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>F(m.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(_t,{className:"w-4 h-4"})})]})]},x))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(es,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(fe,{children:[e.jsx(q,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(q,{onClick:T,disabled:S.isPending||!R,children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function vr({open:s,onOpenChange:a,paperId:r,arxivId:c,initialUrl:i,onSuccess:o,submitMode:l="direct",isAuthor:h=!1}){const[t,v]=d.useState(i),k=be(),{toast:_}=ce(),A=d.useRef(!1);d.useEffect(()=>{if(!s){A.current=!1;return}A.current||(A.current=!0,v(i))},[s,i]);const w=je({mutationFn:async({paperId:F,sourceUrl:N})=>l==="pending"?(await Ne({paper_id:parseInt(F),edit_type:"source_url",proposed_payload:{source_url:N}}),null):la(F,N),onSuccess:F=>{if(l==="pending"){_({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),o==null||o(),a(!1);return}F&&Le(k,F,[r,c]),o==null||o(),a(!1)},onError:F=>{var R;const N=F;let T=N.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(N.response)try{const m=JSON.parse(N.response);typeof(m==null?void 0:m.detail)=="string"?T=m.detail:Array.isArray(m==null?void 0:m.detail)&&((R=m.detail[0])!=null&&R.msg)&&(T=m.detail[0].msg)}catch{T=N.response}_({title:l==="pending"?"Could not submit edit":"Could not save source URL",description:T,variant:"destructive"})}}),u=t.trim(),S=/^https?:\/\//i.test(u),L=u!==(i||"").trim(),M=()=>{S&&w.mutate({paperId:r,sourceUrl:u})};return e.jsx(de,{open:s,onOpenChange:a,children:e.jsxs(ue,{className:"max-w-2xl",children:[e.jsxs(me,{children:[e.jsx(he,{children:"Edit Source URL"}),e.jsxs(pe,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),l==="pending"&&e.jsx(Ce,{isAuthor:h}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(Y,{type:"url",placeholder:"https://example.com/paper",value:t,onChange:F=>v(F.target.value),onKeyPress:F=>{F.key==="Enter"&&S&&L&&(F.preventDefault(),M())}}),!S&&u.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(fe,{children:[e.jsx(q,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(q,{onClick:M,disabled:w.isPending||!S||!L,children:w.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const ct=100;function yr(s){return(s??[]).some(a=>a.slug==="coding-agents"||a.name.trim().toLowerCase()==="coding agents")}function ss(s){const a=parseInt(s.task_id,10),r=parseInt(s.dataset_id,10);return!(!Number.isFinite(a)||!Number.isFinite(r)||!s.metric_name.trim()||!s.metric_value.trim())}function kr(s){return s.map(a=>{const r=a.best_metric||Object.keys(a.metrics)[0],c=a.metrics[r];return{id:a.id,task_id:a.task_id,dataset_id:a.dataset_id,model_name:a.model_name||"",harness:a.harness||"",metric_name:r||"",metric_value:String(c||""),best_rank:a.best_rank?String(a.best_rank):"",num_parameters:a.num_parameters!=null?String(a.num_parameters):"",hf_model_url:a.hf_model_url||"",is_open:a.is_open!==!1,operation:"unchanged"}})}function _r(s){const a=new Map;return s.forEach(r=>{r.task_id&&r.task_name&&a.set(r.task_id,{id:r.task_id,name:r.task_name,slug:r.task_slug,level:0})}),a}function wr(s){const a=new Map;return s.forEach(r=>{r.dataset_id&&r.dataset_name&&a.set(r.dataset_id,{id:r.dataset_id,name:r.dataset_name,slug:r.dataset_slug})}),a}function as(s,a){return`${s}:${a}`}function ze(s){const a=s.trim();if(a==="")return null;const r=Number(a);return!Number.isFinite(r)||r<0?null:Math.trunc(r)}function Oe(s){const a=s.trim();return a===""?null:a}function Nr({open:s,onOpenChange:a,paperId:r,arxivId:c,initialEvaluations:i,paperTasks:o,onSuccess:l,submitMode:h="direct",isAuthor:t=!1}){const v=yr(o),[k,_]=d.useState([]),[A,w]=d.useState(null),[u,S]=d.useState(new Map),[L,M]=d.useState(new Map),F=be(),{toast:N}=ce(),T=d.useRef(!1),R=d.useRef(!1);d.useEffect(()=>{if(!s){T.current=!1,R.current=!1;return}T.current||R.current||i.length!==0&&(T.current=!0,_(kr(i)),S(_r(i)),M(wr(i)))},[s,i]);const m=d.useMemo(()=>Array.from(new Set(k.map(p=>p.task_id).filter(p=>p&&p!==""))),[k]),x=d.useMemo(()=>{const p=new Set;return k.forEach(b=>{b.task_id&&b.dataset_id&&p.add(as(b.task_id,b.dataset_id))}),Array.from(p)},[k]),U=re({queryKey:["datasets-by-tasks-for-eval-edit",m,s],queryFn:async()=>{const p={};return await Promise.all(m.map(async b=>{try{const E=await Wt({task_id:parseInt(b),page_size:ct});p[b]=E.results}catch(E){console.error(`Error fetching datasets for task ${b}:`,E),p[b]=[]}})),p},enabled:s&&m.length>0});d.useEffect(()=>{U.data&&M(p=>{const b=new Map(p);return Object.values(U.data).forEach(E=>{E.forEach(g=>{b.set(g.id,g)})}),b})},[U.data]);const D=re({queryKey:["leaderboard-metrics-for-eval-edit",x,s],queryFn:async()=>{const p={};return await Promise.all(x.map(async b=>{const[E,g]=b.split(":");try{p[b]=await ma(g,E)}catch(j){console.error(`Error fetching metrics for leaderboard ${b}:`,j),p[b]=[]}})),p},enabled:s&&x.length>0}),H=async p=>{const b=await ms({page_size:ct,...p?{q:p}:{}});return S(E=>{const g=new Map(E);return b.results.forEach(j=>g.set(j.id,j)),g}),b.results.map(E=>{var g;return{value:E.id,label:E.name,description:(g=E.description)==null?void 0:g.slice(0,100)}})},z=p=>async b=>{const E=await Wt({task_id:parseInt(p),page_size:ct,...b?{q:b}:{}});return M(g=>{const j=new Map(g);return E.results.forEach(K=>j.set(K.id,K)),j}),E.results.map(g=>({value:g.id,label:g.name,description:g.full_name}))},G=(p,b)=>{if(!p||!b)return!1;const E=L.get(b);return!!(E!=null&&E.supports_harness)},Z=(p,b,E)=>{var K;if(!p||!b)return[];const j=(((K=D.data)==null?void 0:K[as(p,b)])||[]).map(B=>({value:B.metric_name,label:B.metric_name,description:B.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return E&&!j.some(B=>B.value===E)&&j.unshift({value:E,label:`${E} (legacy)`,description:void 0}),j},f=je({mutationFn:async({paperId:p,evaluations:b})=>{if(h==="pending"){const g=[];for(const j of b){if(j.operation==="delete"&&j.id){g.push({op:"delete",evaluation_id:parseInt(j.id)});continue}const K=G(j.task_id,j.dataset_id);if(j.operation==="create"){if(!ss(j))continue;const B=ze(j.num_parameters),ee={task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),metrics:{[j.metric_name]:j.metric_value},best_metric:j.metric_name},Ue=Oe(j.hf_model_url);j.model_name&&(ee.model_name=j.model_name),K&&j.harness&&(ee.harness=j.harness),j.best_rank&&(ee.best_rank=parseInt(j.best_rank)),B!=null&&(ee.num_parameters=B),Ue!=null&&(ee.hf_model_url=Ue),ee.is_open=j.is_open,g.push({op:"create",data:ee})}else if(j.operation==="update"&&j.id){const B={task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),model_name:j.model_name||void 0,harness:K&&j.harness||null,metrics:{[j.metric_name]:j.metric_value},best_metric:j.metric_name,best_rank:j.best_rank?parseInt(j.best_rank):void 0,num_parameters:ze(j.num_parameters),hf_model_url:Oe(j.hf_model_url),is_open:j.is_open};g.push({op:"update",evaluation_id:parseInt(j.id),data:B})}}return g.length===0?{submitted:!1}:(await Ne({paper_id:parseInt(p),edit_type:"evaluations",proposed_payload:{operations:g}}),{submitted:!0})}let E=!1;for(const g of b)if(g.operation==="delete"&&g.id){E=!0;try{await ca(g.id)}catch(j){if((typeof j=="object"&&j!==null&&"status"in j?j.status:void 0)!==404)throw j;console.log(`Evaluation ${g.id} already deleted or not found`)}}else if(g.operation==="create"){if(!ss(g))continue;E=!0;const j=G(g.task_id,g.dataset_id),K=ze(g.num_parameters);await da({paper_id:parseInt(p),task_id:parseInt(g.task_id),dataset_id:parseInt(g.dataset_id),model_name:g.model_name||void 0,harness:j&&g.harness||void 0,metrics:{[g.metric_name]:g.metric_value},best_metric:g.metric_name,best_rank:g.best_rank?parseInt(g.best_rank):void 0,num_parameters:K??void 0,hf_model_url:Oe(g.hf_model_url)??void 0,is_open:g.is_open})}else if(g.operation==="update"&&g.id){E=!0;const j=G(g.task_id,g.dataset_id);await ua(g.id,{task_id:parseInt(g.task_id),dataset_id:parseInt(g.dataset_id),model_name:g.model_name||void 0,harness:j&&g.harness||null,metrics:{[g.metric_name]:g.metric_value},best_metric:g.metric_name,best_rank:g.best_rank?parseInt(g.best_rank):void 0,num_parameters:ze(g.num_parameters),hf_model_url:Oe(g.hf_model_url),is_open:g.is_open})}return{submitted:E}},onSuccess:p=>{if(h==="pending"){p!=null&&p.submitted?N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):N({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),l==null||l(),a(!1);return}F.invalidateQueries({queryKey:["paper-arxiv",c]}),F.invalidateQueries({queryKey:["evaluations","paper",r]}),l==null||l(),a(!1)},onError:p=>{var g;const b=p;let E=b.message||(h==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(b.response)try{const j=JSON.parse(b.response);typeof(j==null?void 0:j.detail)=="string"?E=j.detail:Array.isArray(j==null?void 0:j.detail)&&((g=j.detail[0])!=null&&g.msg)&&(E=j.detail[0].msg)}catch{E=b.response}N({title:h==="pending"?"Could not submit edit":"Could not save evaluations",description:E,variant:"destructive"})}}),P=()=>{R.current=!0,_([...k,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},$=p=>{R.current=!0,k[p].id?_(k.map((E,g)=>g===p?{...E,operation:"delete"}:E)):_(k.filter((E,g)=>g!==p))},I=(p,b,E)=>{R.current=!0,_(k.map((g,j)=>{if(j!==p)return g;const K={...g,[b]:E};return b==="task_id"&&(K.dataset_id="",K.metric_name="",K.harness=""),b==="dataset_id"&&(K.metric_name="",E&&!G(K.task_id,E)&&(K.harness="")),g.operation==="unchanged"&&(K.operation="update"),K}))},C=(p,b)=>{R.current=!0,_(k.map((E,g)=>{if(g!==p)return E;const j={...E,is_open:b};return E.operation==="unchanged"&&(j.operation="update"),j}))},J=()=>{const p=k.filter(b=>b.operation!=="delete"||b.id);f.mutate({paperId:r,evaluations:p})};return e.jsxs(de,{open:s,onOpenChange:a,children:[e.jsxs(ue,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(me,{children:[e.jsx(he,{children:"Edit Evaluation Results"}),e.jsx(pe,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),h==="pending"&&e.jsx(Ce,{isAuthor:t}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[k.filter(p=>p.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:`text-left py-2 px-2 font-medium text-sm ${v?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),v&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:k.map((p,b)=>{if(p.operation==="delete")return null;const E=u.get(p.task_id),g=L.get(p.dataset_id),j=Z(p.task_id,p.dataset_id,p.metric_name),K=!!(p.task_id&&p.dataset_id)&&D.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(Yt,{value:p.task_id,onChange:B=>I(b,"task_id",B),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:E?{value:E.id,label:E.name}:null,queryKey:["eval-edit-task-search"],queryFn:H,enabled:s})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Yt,{value:p.dataset_id,onChange:B=>I(b,"dataset_id",B),placeholder:p.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:p.task_id?"No datasets found for this task.":"Select a task first.",disabled:!p.task_id,selectedOption:g?{value:g.id,label:g.name}:null,queryKey:["eval-edit-dataset-search",p.task_id],queryFn:z(p.task_id),enabled:s&&!!p.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Y,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:p.model_name,onChange:B=>I(b,"model_name",B.target.value)})}),v&&e.jsx("td",{className:"py-2 px-2",children:G(p.task_id,p.dataset_id)?e.jsx(Y,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:p.harness,onChange:B=>I(b,"harness",B.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!p.task_id||!p.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):K?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(ne,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):j.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:p.metric_name,onChange:B=>I(b,"metric_name",B.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),j.map(B=>e.jsx("option",{value:B.value,children:B.label},B.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Y,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:p.metric_value,onChange:B=>I(b,"metric_value",B.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Y,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:p.num_parameters,onChange:B=>I(b,"num_parameters",B.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Y,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:p.hf_model_url,onChange:B=>I(b,"hf_model_url",B.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:p.is_open,onChange:B=>C(b,B.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>$(b),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(_t,{className:"w-4 h-4"})})})]},b)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(qa,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(q,{variant:"outline",size:"sm",onClick:P,className:"flex items-center space-x-2",children:[e.jsx(kt,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(fe,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(q,{variant:"ghost",onClick:()=>w("benchmark"),children:"Suggest a new benchmark"}),e.jsx(q,{variant:"ghost",onClick:()=>w("metric"),children:"Suggest a new metric"})]}),e.jsx(q,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(q,{onClick:J,disabled:f.isPending,children:f.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),h==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"w-4 h-4 mr-2"}),h==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(yt,{open:A!==null,onOpenChange:p=>{p||w(null)},paperId:r,kind:A??"benchmark"})]})}const we=["my-bookmark-ids"];function Cr(){var c,i;const{user:s}=We(),a=re({queryKey:we,queryFn:()=>Xe.getMyBookmarkIds(),enabled:!!s,staleTime:60*1e3,refetchOnWindowFocus:!1}),r=vt.useMemo(()=>{var o;return new Set(((o=a.data)==null?void 0:o.paper_ids)??[])},[(c=a.data)==null?void 0:c.paper_ids]);return{ids:((i=a.data)==null?void 0:i.paper_ids)??[],idSet:r,isLoading:a.isLoading,isError:a.isError}}function Er(){const{user:s}=We(),a=be(),r=je({mutationFn:async({paperId:i,isBookmarked:o})=>{o?await Xe.removeBookmark(i):await Xe.addBookmark(i)},onMutate:async({paperId:i,isBookmarked:o})=>{await a.cancelQueries({queryKey:we});const l=a.getQueryData(we),h=typeof i=="string"?Number(i):i,t=(l==null?void 0:l.paper_ids)??[],v=o?t.filter(k=>k!==h):[h,...t.filter(k=>k!==h)];return a.setQueryData(we,{paper_ids:v}),{previous:l}},onError:(i,o,l)=>{l!=null&&l.previous&&a.setQueryData(we,l.previous)},onSettled:()=>{a.invalidateQueries({queryKey:we}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:vt.useCallback((i,o)=>{if(!s){if(hs())return;const l=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=ps(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(l)}`);return}r.mutate({paperId:i,isBookmarked:o})},[r,s]),isPending:r.isPending}}const Sr=({paperId:s})=>{const{user:a}=We(),{idSet:r}=Cr(),{toggle:c,isPending:i}=Er();if(hs())return null;const o=Number(s),l=!!a&&r.has(o),h=()=>{Number.isFinite(o)&&c(o,l)},t=a&&l?"Saved":"Save",v=a?l?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${l?" is-saved":""}`,onClick:h,disabled:i,"aria-pressed":l,"aria-label":v,title:v,children:[e.jsx(X,{name:"bookmark",size:12}),t]})};function Ge({children:s,showEdit:a=!1,onEdit:r,editAriaLabel:c}){return a?e.jsxs("span",{className:"action-btn-composite",children:[s,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:r,"aria-label":c,children:"edit"})]}):s}const Pr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:s=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",s,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals",start:Va,get:Qa,cancel:Ga},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:s=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",s,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper",start:Oa,get:za,cancel:Ka}};function Ir({report:s}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(Wa,{remarkPlugins:[Ya],components:{a:({children:a,...r})=>e.jsx("a",{...r,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:a}),p:({children:a})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:a}),ul:({children:a})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:a}),ol:({children:a})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:a}),h1:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),h2:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),h3:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),code:({children:a})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:a}),pre:({children:a})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:a})},children:s})})}function Es({kind:s,paperId:a,paperTitle:r,triggerClassName:c,onComplete:i}){const o=Pr[s],[l,h]=d.useState(!1),[t,v]=d.useState(null),[k,_]=d.useState(!1),[A,w]=d.useState(null),u=d.useRef(null),S=(t==null?void 0:t.status)==="queued"||(t==null?void 0:t.status)==="dispatching"||(t==null?void 0:t.status)==="running",L=t==null?void 0:t.id;d.useEffect(()=>{if(!S||!L)return;let T=!1;const R=window.setInterval(async()=>{try{const m=await o.get(L);T||(v(m),w(null))}catch(m){T||w(m instanceof Error?m.message:"Could not check job status.")}},2e3);return()=>{T=!0,window.clearInterval(R)}},[S,o,L]),d.useEffect(()=>{(t==null?void 0:t.status)!=="completed"||u.current===t.id||(u.current=t.id,i())},[t,i]);const M=async()=>{_(!0),w(null);try{v(await o.start(a))}catch(T){w(T instanceof Error?T.message:"Could not start Codex.")}finally{_(!1)}},F=()=>{v(null),w(null),u.current=null},N=async()=>{if(t){w(null);try{v(await o.cancel(t.id))}catch(T){w(T instanceof Error?T.message:"Could not cancel Codex.")}}};return e.jsxs(de,{open:l,onOpenChange:h,children:[e.jsx("button",{type:"button",className:c,onClick:()=>h(!0),children:S?o.running:(t==null?void 0:t.status)==="completed"?o.complete:o.trigger}),e.jsxs(ue,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(me,{className:"min-w-0",children:[e.jsx(he,{children:o.title}),e.jsx(pe,{children:o.description(r)})]}),t?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",t.status]}),t.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:t.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),S&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[t.status==="queued"?"This job is queued and will start after the current Codex job finishes.":o.progress," ","This can take several minutes; you can close this window and return."]}),t.report&&e.jsx(Ir,{report:t.report}),t.error&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:t.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:o.notice}),A&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:A}),e.jsxs(fe,{children:[e.jsx(q,{variant:"outline",onClick:()=>h(!1),children:S?"Close":"Cancel"}),S&&e.jsx(q,{variant:"outline",onClick:()=>void N(),children:"Cancel job"}),!t&&e.jsx(q,{onClick:M,disabled:k,children:k?"Starting…":o.action}),t&&!S&&e.jsx(q,{variant:"outline",onClick:F,children:"Run again"})]})]})]})}function Rr(s){return e.jsx(Es,{...s,kind:"add-evals",triggerClassName:"edit-link"})}function $r(s){return e.jsx(Es,{...s,kind:"enrich-paper",triggerClassName:"action-btn"})}var Ct="Radio",[Ar,Ss]=jt(Ct),[Fr,Tr]=Ar(Ct),Ps=d.forwardRef((s,a)=>{const{__scopeRadio:r,name:c,checked:i=!1,required:o,disabled:l,value:h="on",onCheck:t,form:v,...k}=s,[_,A]=d.useState(null),w=Te(a,L=>A(L)),u=d.useRef(!1),S=_?v||!!_.closest("form"):!0;return e.jsxs(Fr,{scope:r,checked:i,disabled:l,children:[e.jsx(xe.button,{type:"button",role:"radio","aria-checked":i,"data-state":As(i),"data-disabled":l?"":void 0,disabled:l,value:h,...k,ref:w,onClick:Fe(s.onClick,L=>{i||t==null||t(),S&&(u.current=L.isPropagationStopped(),u.current||L.stopPropagation())})}),S&&e.jsx($s,{control:_,bubbles:!u.current,name:c,value:h,checked:i,required:o,disabled:l,form:v,style:{transform:"translateX(-100%)"}})]})});Ps.displayName=Ct;var Is="RadioIndicator",Rs=d.forwardRef((s,a)=>{const{__scopeRadio:r,forceMount:c,...i}=s,o=Tr(Is,r);return e.jsx(ls,{present:c||o.checked,children:e.jsx(xe.span,{"data-state":As(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:a})})});Rs.displayName=Is;var Lr="RadioBubbleInput",$s=d.forwardRef(({__scopeRadio:s,control:a,checked:r,bubbles:c=!0,...i},o)=>{const l=d.useRef(null),h=Te(l,o),t=xs(r),v=ds(a);return d.useEffect(()=>{const k=l.current;if(!k)return;const _=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(_,"checked").set;if(t!==r&&w){const u=new Event("click",{bubbles:c});w.call(k,r),k.dispatchEvent(u)}},[t,r,c]),e.jsx(xe.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:h,style:{...i.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$s.displayName=Lr;function As(s){return s?"checked":"unchecked"}var Ur=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],et="RadioGroup",[Mr]=jt(et,[fs,Ss]),Fs=fs(),Ts=Ss(),[Dr,Br]=Mr(et),Ls=d.forwardRef((s,a)=>{const{__scopeRadioGroup:r,name:c,defaultValue:i,value:o,required:l=!1,disabled:h=!1,orientation:t,dir:v,loop:k=!0,onValueChange:_,...A}=s,w=Fs(r),u=ha(v),[S,L]=cs({prop:o,defaultProp:i??null,onChange:_,caller:et});return e.jsx(Dr,{scope:r,name:c,required:l,disabled:h,value:S,onValueChange:L,children:e.jsx(pa,{asChild:!0,...w,orientation:t,dir:u,loop:k,children:e.jsx(xe.div,{role:"radiogroup","aria-required":l,"aria-orientation":t,"data-disabled":h?"":void 0,dir:u,...A,ref:a})})})});Ls.displayName=et;var Us="RadioGroupItem",Ms=d.forwardRef((s,a)=>{const{__scopeRadioGroup:r,disabled:c,...i}=s,o=Br(Us,r),l=o.disabled||c,h=Fs(r),t=Ts(r),v=d.useRef(null),k=Te(a,v),_=o.value===i.value,A=d.useRef(!1);return d.useEffect(()=>{const w=S=>{Ur.includes(S.key)&&(A.current=!0)},u=()=>A.current=!1;return document.addEventListener("keydown",w),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",w),document.removeEventListener("keyup",u)}},[]),e.jsx(fa,{asChild:!0,...h,focusable:!l,active:_,children:e.jsx(Ps,{disabled:l,required:o.required,checked:_,...t,...i,name:o.name,ref:k,onCheck:()=>o.onValueChange(i.value),onKeyDown:Fe(w=>{w.key==="Enter"&&w.preventDefault()}),onFocus:Fe(i.onFocus,()=>{var w;A.current&&((w=v.current)==null||w.click())})})})});Ms.displayName=Us;var Hr="RadioGroupIndicator",Ds=d.forwardRef((s,a)=>{const{__scopeRadioGroup:r,...c}=s,i=Ts(r);return e.jsx(Rs,{...i,...c,ref:a})});Ds.displayName=Hr;var Bs=Ls,Hs=Ms,qr=Ds;const xt=d.forwardRef(({className:s,...a},r)=>e.jsx(Bs,{className:Ve("grid gap-2",s),...a,ref:r}));xt.displayName=Bs.displayName;const $e=d.forwardRef(({className:s,...a},r)=>e.jsx(Hs,{ref:r,className:Ve("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:e.jsx(qr,{className:"flex items-center justify-center",children:e.jsx(xa,{className:"h-2.5 w-2.5 fill-current text-current"})})}));$e.displayName=Hs.displayName;const Kr={model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},gt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function dt(s){return"'"+s.replace(/'/g,`'"'"'`)+"'"}function ut(s,a){try{const r=new URL(s);if(r.hostname!=="huggingface.co")return null;const c=r.pathname.split("/").filter(Boolean),i=a==="model"?[]:[`${a}s`];if(i.length&&c[0]!==i[0])return null;const o=c.slice(i.length,i.length+2);if(o.length!==2||o.some(t=>!gt.test(t)))return null;const l=o.join("/"),h=a==="model"?"":`${a}s/`;return{id:`${a}:${l}`,kind:a,label:l,url:`https://huggingface.co/${h}${l}`,source:`hf://${h}${l}/`,destination:`${a}s/${l}/`}}catch{return null}}function zr(s){try{const a=new URL(s);if(a.hostname!=="github.com"&&a.hostname!=="www.github.com")return null;const r=a.pathname.split("/").filter(Boolean);if(r.length<2)return null;const c=r[0],i=r[1].replace(/\.git$/,"");if(!gt.test(c)||!gt.test(i))return null;const o=`${c}/${i}`;return{id:`github:${o}`,kind:"github",label:o,url:`https://github.com/${o}`,source:`https://github.com/${o}.git`,destination:`github/${o}/`}}catch{return null}}function Or({githubUrls:s,hfModelUrls:a,hfDatasetUrls:r,hfSpaceUrls:c}){const i=[...a.map(l=>ut(l,"model")),...r.map(l=>ut(l,"dataset")),...c.map(l=>ut(l,"space")),...s.map(zr)],o=new Set;return i.filter(l=>!l||o.has(l.id)?!1:(o.add(l.id),!0))}function Gr(s,a,r){const c=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${dt(s.trim())}`];r.create&&c.push(`hf buckets create "$HF_BUCKET" --exist-ok${r.isPrivate?" --private":""}`);for(const o of a.filter(l=>l.kind!=="github"))c.push(`hf cp ${dt(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const i=a.filter(o=>o.kind==="github");if(i.length){c.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of i){const l=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;c.push(`git clone --depth 1 -- ${dt(o.source)} "${l}"`,`hf sync "${l}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return c.join(`
|
| 18 |
-
`)}function Qr(s){return`${(s.split(/[:|–—]/,1)[0]||s).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function Vr(s){const{toast:a}=ce(),r=d.useMemo(()=>Or(s),[s.githubUrls,s.hfDatasetUrls,s.hfModelUrls,s.hfSpaceUrls]),[c,i]=d.useState(!1),[o,l]=d.useState("new"),[h,t]=d.useState(""),[v,k]=d.useState("public"),[_,A]=d.useState(()=>new Set(r.map(N=>N.id))),w=r.filter(N=>_.has(N.id)),u=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/.test(h.trim()),S=Gr(h,w,{create:o==="new",isPrivate:v==="private"}),L=(N,T)=>{A(R=>{const m=new Set(R);return T?m.add(N):m.delete(N),m})},M=async()=>{try{await navigator.clipboard.writeText(S),a({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},F=()=>{A(new Set(r.map(N=>N.id))),!h&&s.suggestedBucketId&&t(s.suggestedBucketId),i(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:F,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:r.length?`${r.length} linked artifact${r.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(de,{open:c,onOpenChange:i,children:e.jsxs(ue,{className:"max-h-[90vh] max-w-2xl overflow-y-auto",children:[e.jsxs(me,{children:[e.jsxs(he,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(pe,{children:"Keep your own copy of this paper's linked code and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories are cloned into the same destination."})]}),r.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Choose your destination"}),e.jsxs(xt,{value:o,onValueChange:N=>l(N),className:"grid grid-cols-2 gap-2",children:[e.jsxs(ae,{className:"bucket-choice",children:[e.jsx($e,{value:"new"}),"New bucket"]}),e.jsxs(ae,{className:"bucket-choice",children:[e.jsx($e,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(Y,{id:"bucket-id",value:h,onChange:N=>t(N.target.value),placeholder:s.suggestedBucketId||"username/paper-artifacts","aria-invalid":h.length>0&&!u}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Bucket visibility"}),e.jsxs(xt,{value:v,onValueChange:N=>k(N),className:"flex gap-5",children:[e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx($e,{value:"public"}),"Public"]}),e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx($e,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Artifacts"}),e.jsx("div",{className:"bucket-artifact-list",children:r.map(N=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(Ze,{id:`bucket-artifact-${N.id}`,checked:_.has(N.id),onCheckedChange:T=>L(N.id,T===!0)}),e.jsxs(ae,{htmlFor:`bucket-artifact-${N.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:Kr[N.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:N.label})]}),e.jsxs("a",{href:N.url,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:[N.kind==="github"?"Open":"Web copy",e.jsx(X,{name:"external",size:10})]})]},N.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"“Web copy” opens the artifact's native Hugging Face page, where its Copy to bucket button is also available."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-copy-commands",children:"Copy workflow"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands",children:u?S:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."}),e.jsxs(fe,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(q,{type:"button",onClick:M,disabled:!u||w.length===0,children:[e.jsx(X,{name:"copy",size:12}),"Copy commands"]})]})]})})]})}const Xr={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","source-url":"source URL"},Qe=360,mt=3,Jr=3,Wr=["tldr","abstract","tasks","methods","results"];function Yr(s){if(!s)return{section:null,resultsTaskSlug:null};const[a,r]=s.split("?",2);if(!Wr.includes(a))return{section:null,resultsTaskSlug:null};const c=a;return c!=="results"||!r?{section:c,resultsTaskSlug:null}:{section:c,resultsTaskSlug:new URLSearchParams(r).get("task")}}function rs(s){return`results-task-${s}`}function Zr(s){return`#results?task=${encodeURIComponent(s)}`}function Ie({id:s,label:a,accent:r}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:s,children:[e.jsx("span",{children:e.jsx("a",{href:`#${s}`,className:"section-anchor-link",children:a})}),r]})}function ns(s){if(!s)return"—";try{return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function is(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function os(s,a){try{const r=new URL(s),i=r.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return i?i.replace(/[-_]+/g," "):r.hostname.replace(/^www\./,"")}catch{return a}}const Sn=()=>{var qt,Kt,zt,Ot,Gt,Qt,Vt,Xt,Jt;const{arxivId:s}=ga(),a=s?ba(s):"",r=ja(),{toast:c}=ce(),{user:i}=We(),o=(i==null?void 0:i.is_admin)??!1,l=!!i,h=!0,{data:t,isLoading:v,error:k,refetch:_}=Ma(a||"",!!a),[A,w]=d.useState(!1);d.useEffect(()=>{if(!s||s===a)return;const n=window.location.search+window.location.hash;r(`/paper/${a}${n}`,{replace:!0})},[a,r,s]),d.useEffect(()=>{if(t!=null&&t.title)return document.title=La(t.title),()=>{document.title=Ua}},[t==null?void 0:t.title]),d.useEffect(()=>{if(w(!1),!(t!=null&&t.id))return;const n=window.setTimeout(()=>w(!0),0);return()=>window.clearTimeout(n)},[t==null?void 0:t.id]);const{data:u,isLoading:S}=nr(A?t==null?void 0:t.arxiv_id:void 0),{data:L,isLoading:M,refetch:F}=tr(t==null?void 0:t.id,A&&!!(t!=null&&t.id)),{preferences:N}=va(),T=d.useMemo(()=>!L||!N.hide_closed_source_evals?L:L.filter(n=>n.is_open!==!1),[L,N.hide_closed_source_evals]),R=d.useMemo(()=>({models:(t==null?void 0:t.hf_models)??[],datasets:(t==null?void 0:t.hf_datasets)??[],spaces:(t==null?void 0:t.hf_spaces)??[]}),[t==null?void 0:t.hf_models,t==null?void 0:t.hf_datasets,t==null?void 0:t.hf_spaces]),m=d.useMemo(()=>{const n=(y,O,Q)=>{const se=new Set,V=[];for(const W of[...y,...O??[]])if(!se.has(W)&&(se.add(W),V.push({href:W,label:os(W,Q)}),V.length>=Jr))break;return V};return{models:n(R.models,u==null?void 0:u.modelUrls,"Model"),datasets:n(R.datasets,u==null?void 0:u.datasetUrls,"Dataset"),spaces:n(R.spaces,u==null?void 0:u.spaceUrls,"Space")}},[R.models,R.datasets,R.spaces,u==null?void 0:u.modelUrls,u==null?void 0:u.datasetUrls,u==null?void 0:u.spaceUrls]),x=d.useMemo(()=>{if(!T)return[];const n=new Map;for(const y of T){const O=y.task_id,Q=n.get(O);Q?Q.rows.push(y):n.set(O,{taskId:O,taskName:y.task_name||"—",taskSlug:y.task_slug,rows:[y]})}return Array.from(n.values())},[T]),U=d.useMemo(()=>x.map(n=>n.taskSlug??"").join("|"),[x]),D=re({queryKey:["paper-versions",t==null?void 0:t.arxiv_id],queryFn:async()=>{const n=t.arxiv_id.replace(/v\d+$/,""),y=await fetch(ps(`/api/v1/papers/arxiv/${n}/versions`));return y.ok?await y.json():[]},enabled:A&&!!(t!=null&&t.arxiv_id),staleTime:10*60*1e3}),H=re({queryKey:["related-papers",t==null?void 0:t.id],queryFn:()=>Xe.getRelatedPapers(t.arxiv_id||t.id,4),enabled:A&&!!(t!=null&&t.id),staleTime:10*60*1e3}),[z,G]=d.useState(!1),[Z,f]=d.useState(!1),[P,$]=d.useState(!1),I=d.useRef(!1);d.useEffect(()=>{I.current=!1},[a]),d.useEffect(()=>{let n=0;const y=(Q=!1,se=!1)=>{const{section:V,resultsTaskSlug:W}=Yr(window.location.hash.slice(1));if(!V||!t||V==="tldr"&&!t.tldr||V==="results"&&(!A||M)||!Q&&I.current)return;let _e=null;if(V==="results"&&W){if(_e=document.getElementById(rs(W)),!_e){if(x.find(ta=>ta.taskSlug===W))return;_e=document.getElementById("results")}}else _e=document.getElementById(V);if(!_e)return;const ea=_e;n=window.requestAnimationFrame(()=>{I.current=!0,ea.scrollIntoView({block:"start",behavior:se?"smooth":"auto"})})};y();const O=()=>{I.current=!1,y(!0,!0)};return window.addEventListener("hashchange",O),()=>{window.removeEventListener("hashchange",O),n&&window.cancelAnimationFrame(n)}},[t,t==null?void 0:t.tldr,A,M,U,x]);const{isEditingTasks:C,setIsEditingTasks:J,isEditingMethods:p,setIsEditingMethods:b,isEditingRepositories:E,setIsEditingRepositories:g,isEditingProjectPages:j,setIsEditingProjectPages:K,isEditingEvaluations:B,setIsEditingEvaluations:ee,isEditingSourceUrl:Ue,setIsEditingSourceUrl:Et}=ir(),[tt,St]=d.useState(null),ve=d.useMemo(()=>{if(!i||!(t!=null&&t.author_links))return!1;const n=i.username.toLowerCase();return t.author_links.some(y=>!!y.hf_username&&y.hf_username.toLowerCase()===n)},[i,t==null?void 0:t.author_links]),ye=o?"direct":"pending",te=n=>{if(!l){St(n);return}switch(n){case"tasks":J(!0);return;case"methods":b(!0);return;case"results":ee(!0);return;case"repositories":g(!0);return;case"project-pages":K(!0);return;case"source-url":Et(!0);return}},[Pt,st]=d.useState("idle"),[It,Rt]=d.useState(null),[$t,At]=d.useState(null),qs=async()=>{if(a){st("indexing"),Rt(null),At(null);try{await Ea(a),c({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>_(),1200),st("idle")}catch(n){const y=n;let O=y.message||"Failed to index paper";if(y.response)try{O=JSON.parse(y.response).detail||O}catch{O=y.response}Rt(O),(y.status===429||y.status===503)&&At("Try again later after arXiv has lifted the temporary limit."),st("idle")}}},{citationDisplay:Ks,citationCopy:Ft}=d.useMemo(()=>{if(!t)return{citationDisplay:"",citationCopy:""};const n=`${t.title.slice(0,60)}${t.title.length>60?"…":""}`,y=`${t.authors[0]||""}${t.authors.length>1?" et al.":""}`,O=t.authors.join(" and "),Q=(t.published||"").slice(0,4)||"—",se=(V,W)=>t.arxiv_id?`@article{${t.arxiv_id.replace(".","")},
|
| 19 |
-
title={{${V}}},
|
| 20 |
-
author=${W},
|
| 21 |
-
year={{${Q}}},
|
| 22 |
-
eprint={{${t.arxiv_id}}},
|
| 23 |
-
archivePrefix={{arXiv}}
|
| 24 |
-
}`:`@misc{paper${t.id},
|
| 25 |
-
title={{${V}}},
|
| 26 |
-
author=${W},
|
| 27 |
-
year={{${Q}}},
|
| 28 |
-
url={{${t.source_url||t.url_abs||""}}}
|
| 29 |
-
}`;return{citationDisplay:se(n,`{{${y}}}`),citationCopy:se(t.title,`{${O}}`)}},[t]),Tt=d.useMemo(()=>Za(t==null?void 0:t.leaderboard_ranks),[t==null?void 0:t.leaderboard_ranks]),[zs,Lt]=d.useState(!1),Os=async()=>{if(Ft)try{await navigator.clipboard.writeText(Ft),Lt(!0),c({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Lt(!1),1500)}catch{c({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},Gs=async()=>{if(!t)return;const n=t.arxiv_id||t.id,y=er(n,Tt);if(y)try{await navigator.clipboard.writeText(y),c({title:"PwC badges copied",description:"Each badge links to its highlighted leaderboard row."})}catch{c({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(v)return e.jsxs("div",{className:"page",children:[e.jsx(Re,{className:"h-12 w-3/4 mb-4"}),e.jsx(Re,{className:"h-6 w-1/3 mb-8"}),e.jsx(Re,{className:"h-64 w-full"})]});if(k||!t)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(oe,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",a]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",a]})," in the database. You can index it from arXiv right now."]}),It&&e.jsx(Da,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(Ba,{children:[e.jsx("div",{children:It}),$t&&e.jsx("div",{className:"mt-2",children:$t})]})}),e.jsxs("div",{className:"action-row",children:[o&&e.jsxs("button",{className:"action-btn",onClick:qs,disabled:Pt==="indexing",children:[e.jsx(X,{name:"sparkle",size:12}),Pt==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(q,{variant:"outline",onClick:()=>r("/papers"),children:"Browse Papers"})]})]});const Ut=D.data||[],Ee=Ta(t.repositories),ie=[...t.repositories??[]].sort((n,y)=>{const O=n.is_official?1:0,Q=y.is_official?1:0;return O!==Q?Q-O:(y.num_stars||0)-(n.num_stars||0)}),Qs=P?ie:ie.slice(0,mt),at={models:[...new Set([...R.models,...(u==null?void 0:u.modelUrls)??[]])],datasets:[...new Set([...R.datasets,...(u==null?void 0:u.datasetUrls)??[]])],spaces:[...new Set([...R.spaces,...(u==null?void 0:u.spaceUrls)??[]])]},rt=((qt=t.arxiv_id)==null?void 0:qt.replace(/v\d+$/,""))??null,nt=t.arxiv_id?{isLoading:S,paperHref:`https://huggingface.co/papers/${rt}`,rows:[{label:"Models",href:pt(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,R.models),count:ft(R.models,u==null?void 0:u.modelUrls,u==null?void 0:u.models),isLimited:u==null?void 0:u.isLimited,links:m.models},{label:"Datasets",href:pt(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,R.datasets),count:ft(R.datasets,u==null?void 0:u.datasetUrls,u==null?void 0:u.datasets),isLimited:u==null?void 0:u.isLimited,links:m.datasets},{label:"Spaces",href:pt(`https://huggingface.co/papers/${rt}`,R.spaces),count:ft(R.spaces,u==null?void 0:u.spaceUrls,u==null?void 0:u.spaces),isLimited:u==null?void 0:u.isLimited,links:m.spaces}],footer:`Cite arxiv.org/abs/${rt} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:ht(R.models),count:R.models.length,links:m.models},{label:"Datasets",href:ht(R.datasets),count:R.datasets.length,links:m.datasets},{label:"Spaces",href:ht(R.spaces),count:R.spaces.length,links:m.spaces}],footer:null},Mt=t.tldr||null,Dt=t.num_pages||null,ke=t.abstract||"",Vs=ke.length>Qe?ke.slice(0,Qe)+"…":ke,Xs=z||ke.length<=Qe?ke:Vs,Me=(t.methods||[]).filter(n=>n.source_paper_id===t.id),De=t.introduced_benchmarks||[],Se=t.introduced_frameworks||[],Js=Me.length>0||De.length>0||Se.length>0,Bt=t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",Ws=t.source==="external"?"Source page":"arXiv page",Pe=((Kt=t.project_pages)==null?void 0:Kt.filter(n=>n.url))??[],Ys=(()=>{const n=[];return Me.length>0&&n.push(Me.length===1?"this method":"these methods"),De.length>0&&n.push(De.length===1?"this benchmark":"these benchmarks"),Se.length>0&&n.push(Se.length===1?"this framework":"these frameworks"),n.length===0?"":n.length===1?n[0]:n.join(" and ")})(),Be=t.predecessor_papers||[],He=t.successor_papers||[],Zs=Be.length>0||He.length>0,qe=12,it=t.authors.map((n,y)=>{var O,Q,se,V;return{name:n,id:((Q=(O=t.author_links)==null?void 0:O[y])==null?void 0:Q.id)??null,hf_username:((V=(se=t.author_links)==null?void 0:se[y])==null?void 0:V.hf_username)??null}}),Ht=Z||it.length<=qe?it:it.slice(0,qe);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(oe,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:Bt})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsx("h1",{className:"detail-title",children:e.jsx(Ke,{title:t.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:Bt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",ns(t.published)]}),Dt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Dt," pages"]})]}),t.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[t.citation_count.toLocaleString()," citations"]})]}),(t.proceeding||t.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),t.conference_slug?e.jsx("a",{href:`/conferences/${t.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(t.proceeding||t.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:t.proceeding.replace(/\s+\d{1,2}$/,"")})]}),Ut.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:t.version,onChange:n=>{const y=n.target.value;t.arxiv_id&&r(`/paper/${t.arxiv_id.replace(/v\d+$/,"")}${y?`?version=${y}`:""}`)},children:Ut.map(n=>e.jsxs("option",{value:n.version,children:[n.version," — ",ns(n.published)]},n.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Ht.map((n,y)=>e.jsxs(vt.Fragment,{children:[n.id?e.jsx(oe,{to:`/authors/${n.id}`,children:n.name}):n.hf_username?e.jsx("a",{href:`https://huggingface.co/${n.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${n.hf_username} on Hugging Face`,children:n.name}):e.jsx("a",{children:n.name}),y<Ht.length-1?", ":""]},y)),t.authors.length>qe&&e.jsx("button",{className:"show-more-authors",onClick:()=>f(n=>!n),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:Z?"show fewer":`+${t.authors.length-qe} more`})]}),e.jsxs("div",{className:"action-row",children:[t.url_pdf&&e.jsxs("a",{className:"action-btn",href:t.url_pdf,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(X,{name:"pdf",size:12})," View PDF"]}),t.url_abs&&e.jsx(Ge,{showEdit:t.source==="external"&&h,onEdit:()=>te("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:t.source==="external"&&h?"action-btn-segment action-btn-main":"action-btn",href:t.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(X,{name:"external",size:12})," ",Ws]})}),nt.paperHref&&(u==null?void 0:u.paperExists)&&e.jsxs("a",{className:"bm-action-btn",href:nt.paperHref,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Hugging Face",children:["View on ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})]}),Ee.githubUrl&&e.jsx(Ge,{showEdit:h,onEdit:()=>te("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Ee.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(X,{name:"github",size:12})," Code",Ee.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",is(Ee.github)," ★"]})]})}),Ee.githubUrl?null:e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>te("repositories"),title:"Add GitHub repository",children:[e.jsx(X,{name:"github",size:12})," Add code"]}),Pe.length===1?e.jsx(Ge,{showEdit:h,onEdit:()=>te("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Pe[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(X,{name:"globe",size:12})," Project page"]})}):null,Pe.length>1?e.jsx(Ge,{showEdit:h,onEdit:()=>te("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(ya,{children:[e.jsx(ka,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(X,{name:"globe",size:12})," Project page"]})}),e.jsx(_a,{align:"start",className:"project-page-menu",children:Pe.map((n,y)=>e.jsx(wa,{asChild:!0,children:e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",children:os(n.url,`Project page ${y+1}`)})},n.url))})]})}):null,Pe.length===0&&l?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>te("project-pages"),title:"Add project page",children:[e.jsx(X,{name:"globe",size:12})," Add project page"]}):null,t.conference_url_abs&&e.jsxs("a",{className:"action-btn",href:t.conference_url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(X,{name:"external",size:12})," Conference"]}),(t.organizations||[]).map(n=>e.jsxs(oe,{to:`/orgs/${n.slug}`,className:"action-btn",title:n.name,"aria-label":n.name,children:[n.logo_url&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:16,width:16,borderRadius:3,overflow:"hidden"},children:e.jsx("img",{src:n.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:y=>{y.currentTarget.style.display="none"}})}),n.name]},n.id)),o&&Xa()&&e.jsx($r,{paperId:t.id,paperTitle:t.title,onComplete:()=>void _()}),e.jsx(Sr,{paperId:t.id})]}),t.leaderboard_ranks&&t.leaderboard_ranks.length>0&&e.jsx(Sa,{wrap:!0,paperHref:`/paper/${t.arxiv_id||t.id}`,ranks:t.leaderboard_ranks.filter(n=>n.best_rank>=1&&n.best_rank<=3).map(n=>({name:n.dataset_name,slug:n.dataset_slug||null,rank:n.best_rank}))})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Pa,{paperId:t.arxiv_id||t.id,title:t.title,thumbnailUrl:Na(t.thumbnail_url),priority:!0})})]}),Js&&e.jsxs("div",{className:`introduced-banner${Se.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Me.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/methods/${n.slug||n.id}`),children:[n.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${n.id}`)),De.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/benchmark/${n.slug||n.id}`),children:[n.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${n.id}`)),Se.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/frameworks#framework-${n.slug}`),children:[n.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${n.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Ys,"."]})]}),Zs&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[He.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:He.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:He.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>r(`/paper/${n.route_identifier}`),children:[e.jsx(Ke,{title:n.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${n.id}`))})]}),Be.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Be.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Be.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>r(`/paper/${n.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Ke,{title:n.title})]},`predecessor-${n.id}`))})]})]}),Mt&&e.jsxs(e.Fragment,{children:[e.jsx(Ie,{id:"tldr",label:"TL;DR · AI-generated"}),e.jsx("div",{className:"tldr-box",children:Mt})]}),e.jsx(Ie,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Fa,{text:Xs})}),ke.length>Qe&&e.jsx("div",{className:"read-full",onClick:()=>G(n=>!n),children:z?"− collapse abstract":"+ read full abstract"}),e.jsx(Ie,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((zt=t.tasks)==null?void 0:zt.length)||0," tagged",e.jsx("button",{type:"button",onClick:()=>te("tasks"),className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(t.tasks||[]).map(n=>e.jsx(Ia,{slug:n.slug||"",label:n.name},n.id))}),e.jsx(Ie,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((Ot=t.methods)==null?void 0:Ot.length)||0," used",e.jsx("button",{type:"button",onClick:()=>te("methods"),className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(t.methods||[]).map(n=>e.jsx(Ra,{method:n},n.id))}),e.jsx(Ie,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[(T==null?void 0:T.length)||0," benchmarks",Tt.length>0&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:Gs,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(X,{name:"copy",size:10})," Copy PwC badge"]}),o&&Ja()&&e.jsx(Rr,{paperId:t.id,paperTitle:t.title,onComplete:()=>void F()}),e.jsx("button",{type:"button",onClick:()=>te("results"),className:"edit-link",children:"edit"})]})}),M?e.jsx(Re,{className:"h-32 w-full"}):x.length>0?x.map(n=>e.jsxs("div",{className:n.taskSlug?"paper-section-anchor":void 0,id:n.taskSlug?rs(n.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:n.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(oe,{to:`/tasks/${n.taskSlug}`,children:n.taskName}),e.jsx("a",{href:Zr(n.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${n.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):n.taskName}),e.jsxs("span",{className:"accent",children:[n.rows.length," ",n.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:n.rows.map(y=>{var O;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:y.dataset_slug?e.jsx(oe,{to:`/benchmark/${y.dataset_slug}`,children:y.dataset_name||"—"}):y.dataset_name||"—"}),e.jsxs("td",{className:"model",title:y.model_name||void 0,children:[y.hf_model_url?e.jsx("a",{href:y.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${y.model_name||"model"} on Hugging Face`,children:y.model_name||"—"}):y.model_name||"—",y.is_open===!1&&e.jsx($a,{}),(y.external??y.is_external)&&e.jsx(Aa,{sourceUrl:y.source_url||y.external_source_url||y.result_url})]}),e.jsx("td",{className:"metric",children:y.best_metric}),e.jsx("td",{className:"value",children:Ca((O=y.metrics)==null?void 0:O[y.best_metric||""])}),e.jsx("td",{className:"rank",children:y.best_rank!=null?`#${y.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:y.dataset_slug&&e.jsx(oe,{to:`/benchmark/${y.dataset_slug}?${[y.task_slug?`task=${encodeURIComponent(y.task_slug)}`:"",`eval=${encodeURIComponent(y.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},y.id)})})]})]},n.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[ie.length," repo",ie.length===1?"":"s",e.jsx("button",{type:"button",onClick:()=>te("repositories"),className:"edit-link",children:"edit"})]})]}),Qs.map(n=>e.jsxs("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(X,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[n.owner,"/",n.name]}),n.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",is(n.num_stars)]})]},n.id)),ie.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),ie.length>mt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>$(n=>!n),children:P?"− show top 3":`+ show ${ie.length-mt} more repos`})]}),e.jsx(en,{viewer:nt}),e.jsx(Vr,{githubUrls:ie.map(n=>n.url),hfModelUrls:at.models,hfDatasetUrls:at.datasets,hfSpaceUrls:at.spaces,suggestedBucketId:i?`${i.username}/${Qr(t.title)}`:void 0}),H.isLoading&&e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}),!H.isLoading&&(((Gt=H.data)==null?void 0:Gt.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),H.data.map(n=>e.jsxs(oe,{to:`/paper/${n.arxiv_id||n.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Ke,{title:n.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:n.arxiv_id?`arXiv:${n.arxiv_id}`:"External resource"}),n.citation_count!=null&&e.jsxs("span",{children:[n.citation_count.toLocaleString()," cites"]})]})]},n.id))]}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:Os,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(X,{name:"copy",size:11}),zs?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:Ks})]})]})]}),e.jsx(pr,{open:C,onOpenChange:J,paperId:t.id,arxivId:a,initialTaskIds:((Qt=t.tasks)==null?void 0:Qt.map(n=>parseInt(n.id)))||[],initialTasks:t.tasks||[],submitMode:ye,isAuthor:ve}),e.jsx(gr,{open:p,onOpenChange:b,paperId:t.id,arxivId:a,initialMethodIds:((Vt=t.methods)==null?void 0:Vt.map(n=>parseInt(n.id)))||[],initialMethods:t.methods||[],submitMode:ye,isAuthor:ve}),e.jsx(br,{open:E,onOpenChange:g,paperId:t.id,arxivId:a,initialRepositories:((Xt=t.repositories)==null?void 0:Xt.map(n=>({url:n.url,is_official:n.is_official||!1})))||[],submitMode:ye,isAuthor:ve}),e.jsx(jr,{open:j,onOpenChange:K,paperId:t.id,arxivId:a,initialProjectPages:((Jt=t.project_pages)==null?void 0:Jt.map(n=>({url:n.url,is_official:n.is_official||!1})))||[],submitMode:ye,isAuthor:ve}),e.jsx(Nr,{open:B,onOpenChange:ee,paperId:t.id,arxivId:a,initialEvaluations:L||[],paperTasks:t.tasks||[],submitMode:ye,isAuthor:ve}),e.jsx(vr,{open:Ue,onOpenChange:Et,paperId:t.id,arxivId:a,initialUrl:t.source_url??t.url_abs??"",submitMode:ye,isAuthor:ve}),e.jsx(Ha,{open:tt!==null,onOpenChange:n=>{n||St(null)},sectionLabel:tt?Xr[tt]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})},en=({viewer:s})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"})}),s.isLoading?e.jsx(Re,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(tn,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]}),tn=({label:s,href:a,count:r,isLimited:c,links:i})=>{const o=((i==null?void 0:i.length)??0)>0,l=r!=null?`${r}${c?"+":""}`:"—",h=r?e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:l}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:l});return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:s}),h]}),o&&e.jsx("div",{className:"hf-artifact-links",children:i.map(t=>e.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",children:t.label},t.href))})]})};function ht(s){return s[0]??"https://huggingface.co"}function pt(s,a){return a[0]??s}function ft(s,a,r){if(r==null&&s.length===0&&!(a!=null&&a.length))return;const c=new Set([...s,...a??[]]);return Math.max(r??0,c.size)}export{Sn as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/{PaperFeedFilters-DWsoFzku.js → PaperFeedFilters-4l2Zc9pi.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e}from"./index-
|
|
|
|
| 1 |
+
import{j as e}from"./index-ClYrAl8a.js";import{I as i}from"./components-C_OCzHXF.js";const n=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),d=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[e.jsx(l,{checked:s,icon:e.jsx(i,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(n,{}),label:"Has artifacts",onChange:o})]})]});export{d as P};
|
assets/{PaperPreviewLink-BhsnwX7g.js → PaperPreviewLink-Do8kbf9Q.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-
|
| 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 gt(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]),Q=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 Qe(e,t){const n=t||{},r="children"in e?e.children:[],i=Q(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(...W(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
|
| 7 |
-
`:Ke(e)?(l=2,a=2):
|
|
|
|
| 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-DmFk7249.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,Z as ce,S as ue,L as he,ak as pe}from"./index-ClYrAl8a.js";import{u as me}from"./useQuery-Drr20jTc.js";import{H as fe,a as de,b as ge}from"./hover-card-BDewF190.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,J,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"),J(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 gt(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",Je,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=Z(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=Z(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(Ze(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 Ze(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 Z(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 Je(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 xt(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,yt=({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=me({queryKey:["paper-preview",l],queryFn:()=>pe(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(fe,{open:a,onOpenChange:d=>{(!d||!ut())&&u(d)},openDelay:150,closeDelay:100,children:[f.jsx(de,{asChild:!0,children:x}),f.jsx(ge,{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{yt as P,gt as a,xt as r};
|
assets/PapersListView-CKAjjigR.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as A,r as i,j as e,L as I,b as T}from"./index-aFSBl9QY.js";import{I as F,P as L}from"./components-3ObcZwMF.js";import{t as C,d as R}from"./transform-DQ9X1I92.js";import{u as k}from"./usePapers-DE5W7ST-.js";import{u as D}from"./useDebounce-DFboj3r2.js";import{u as E,P as O}from"./usePeriodFilter-_Bz0lW7o.js";import{u as B}from"./useIntersectionObserver-CoKzzCGv.js";import{S as c}from"./skeleton-i1TSOWrq.js";import{A as $,a as M}from"./alert-u8e1tjxL.js";import{u as q}from"./useQuery-BTZGCW5c.js";import"./LatexTitle-nKm6G6V5.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-BZImI1cv.js";const z=[["trending","trending"],["new","newest"],["cited","most cited"]],re=()=>{var x,g,j,f;const[d,N]=A(),o=d.get("search")||"",[p,v]=i.useState(o),t=D(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),N(s,{replace:!0})},[t]);const[n,b]=i.useState("new"),{period:P,setPeriod:y,publishedAfter:S}=E("All Time"),a=k({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:S,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(_=>_.results))||[]).map(C)},[a.data]),{targetRef:w,isIntersecting:h}=B({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:O.map(s=>e.jsx("button",{className:`period-btn ${P===s?"active":""}`,onClick:()=>y(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(F,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>v(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(f=m.data)==null?void 0:f.map(s=>e.jsxs(I,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[R(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:z.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>b(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx($,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(L,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:w,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{re as default};
|
|
|
|
|
|
assets/PapersListView-CTiQmFtQ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as A,r as i,j as e,L as I,b as T}from"./index-ClYrAl8a.js";import{I as F,P as L}from"./components-C_OCzHXF.js";import{t as C,d as R}from"./transform-BxrCkLtR.js";import{u as k}from"./usePapers-DmFNFSTF.js";import{u as D}from"./useDebounce-Be1Bh2_D.js";import{u as E,P as O}from"./usePeriodFilter-BHhVcedk.js";import{u as B}from"./useIntersectionObserver-Dnf5-OL3.js";import{S as c}from"./skeleton-C5gy1_r-.js";import{A as $,a as M}from"./alert-2CUZfv8i.js";import{u as q}from"./useQuery-Drr20jTc.js";import"./LatexTitle-BWD9oOWn.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CT7QSfbE.js";import"./useBaseQuery-DlkwakD5.js";const z=[["trending","trending"],["new","newest"],["cited","most cited"]],te=()=>{var x,g,j,f;const[d,N]=A(),o=d.get("search")||"",[p,v]=i.useState(o),t=D(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),N(s,{replace:!0})},[t]);const[n,b]=i.useState("new"),{period:P,setPeriod:y,publishedAfter:S}=E("All Time"),a=k({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:S,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(_=>_.results))||[]).map(C)},[a.data]),{targetRef:w,isIntersecting:h}=B({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:O.map(s=>e.jsx("button",{className:`period-btn ${P===s?"active":""}`,onClick:()=>y(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(F,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>v(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(f=m.data)==null?void 0:f.map(s=>e.jsxs(I,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[R(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:z.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>b(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx($,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(L,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:w,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{te as default};
|
assets/SavedPapersView-EyfoA2kZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{f as o,j as s,a4 as m,L as p,b as h}from"./index-aFSBl9QY.js";import{u as x}from"./useQuery-BTZGCW5c.js";import{T as u,P as j}from"./components-3ObcZwMF.js";import{S as r}from"./skeleton-i1TSOWrq.js";import{A as v,a as N}from"./alert-u8e1tjxL.js";import{t as g}from"./transform-DQ9X1I92.js";import"./LatexTitle-nKm6G6V5.js";import"./katex.min-BSBacQyE.js";const L=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{L as default};
|
|
|
|
|
|
assets/SavedPapersView-XNrr6YrB.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{f as o,j as s,a5 as m,L as p,b as h}from"./index-ClYrAl8a.js";import{u as x}from"./useQuery-Drr20jTc.js";import{T as u,P as j}from"./components-C_OCzHXF.js";import{S as r}from"./skeleton-C5gy1_r-.js";import{A as v,a as N}from"./alert-2CUZfv8i.js";import{t as g}from"./transform-BxrCkLtR.js";import"./useBaseQuery-DlkwakD5.js";import"./LatexTitle-BWD9oOWn.js";import"./katex.min-BSBacQyE.js";const C=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{C as default};
|
assets/SearchOverlay-B4YuOVax.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as C,a as L,R as T,i as $,j as s,b as m}from"./index-ClYrAl8a.js";import{u as p}from"./useQuery-Drr20jTc.js";import{L as A}from"./LatexTitle-BWD9oOWn.js";import{u as D}from"./useDebounce-Be1Bh2_D.js";import{e as z,h as M,d as B}from"./transform-BxrCkLtR.js";import"./useBaseQuery-DlkwakD5.js";import"./katex.min-BSBacQyE.js";const I=10,J=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{J as default};
|
assets/SearchOverlay-Bnp7d4cA.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as C,a as L,R as T,i as $,j as s,b as m}from"./index-aFSBl9QY.js";import{u as p}from"./useQuery-BTZGCW5c.js";import{L as A}from"./LatexTitle-nKm6G6V5.js";import{u as D}from"./useDebounce-DFboj3r2.js";import{e as z,h as M,d as B}from"./transform-DQ9X1I92.js";import"./katex.min-BSBacQyE.js";const I=10,H=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{H as default};
|
|
|
|
|
|
assets/{SettingsView-DMMnsurz.js → SettingsView-DU7bq-S9.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as t,f as m,
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
@@ -13,4 +13,4 @@ import{c as t,f as m,S as u,ao as p,R as x,j as e,a4 as y}from"./index-aFSBl9QY.
|
|
| 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 N=t("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"}]]),
|
|
|
|
| 1 |
+
import{c as t,f as m,T as u,an as p,R as x,j as e,a5 as y}from"./index-ClYrAl8a.js";import{S as j}from"./switch-DyXkTRJe.js";import{f as g,D as v}from"./latexPlainText-ChVkH0gY.js";import"./index-CxV-iX7n.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* 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 N=t("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"}]]),T=()=>{const{user:i}=m(),{preferences:n,setHideClosedSourceEvals:c,canPersist:l}=u(),{theme:o,setTheme:r}=p(),d=o??"system";return x.useEffect(()=>(document.title=g("Settings"),()=>{document.title=v}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:k},{value:"light",label:"Light",description:"Always use light mode",icon:N},{value:"dark",label:"Dark",description:"Always use dark mode",icon:f}].map(s=>{const h=s.icon,a=d===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${a?"is-selected":""}`,"aria-pressed":a,onClick:()=>r(s.value),children:[e.jsx(h,{"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(j,{id:"hide-closed-source-evals",checked:n.hide_closed_source_evals,onCheckedChange:s=>{c(!!s)}})]}),!l&&!i&&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(y,{returnTo:"/settings"})})]})]})]})};export{T as default};
|
assets/SharedChatView-BE2a2xSa.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as f,a as x,r as l,j as e}from"./index-aFSBl9QY.js";import{u as j}from"./useQuery-BTZGCW5c.js";import{C as v,U as g,A as y}from"./ChatMessage-1oGkBBMo.js";import{j as p,S,p as k,q as C,k as b}from"./chatSessions-Da7pRgeZ.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BhsnwX7g.js";import"./index-B-Qd56lo.js";import"./hover-card-BZrFUFNS.js";const q=({detail:c})=>{const[o,r]=l.useState(()=>k(c)),d=l.useMemo(()=>{const t={};for(const s of o)for(const n of s.blocks??[])if(n.kind==="tool")for(const a of n.results??[])t[a.route_id]=a;return t},[o]),h=(t,s)=>{r(n=>n.map(a=>{var u;return a.id!==t?a:{...a,blocks:(u=a.blocks)==null?void 0:u.map((i,m)=>m===s&&(i.kind==="reasoning"||i.kind==="tool")?{...i,open:!i.open}:i)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:o.map(t=>t.role==="user"?e.jsx(g,{id:t.id,text:t.text??""},t.id):e.jsx(y,{msg:t,papers:d,onToggleBlock:h},t.id))})},B=()=>{const{shareId:c=""}=f(),o=x(),r=j({queryKey:["shared-chat",c],queryFn:()=>b(c),retry:(t,s)=>!(s instanceof p&&s.status===404)&&t<1});l.useEffect(()=>{const t=document.title,s=document.head.querySelector('meta[name="robots"]'),n=s==null?void 0:s.content,a=s??document.createElement("meta");return a.name="robots",a.content="noindex,nofollow",s||document.head.appendChild(a),document.title="Shared conversation",()=>{document.title=t,s?s.content=n??"":a.remove()}},[]);const d=t=>{C(t),o("/chat")},h=r.error instanceof p&&r.error.status===404;return r.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):h?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."})]}):r.isError||!r.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 r.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsx("div",{className:"shared-chat-heading",children:"Shared conversation"}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(q,{detail:r.data},r.data.updated_at),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),e.jsx(v,{onSend:d,placeholder:"Ask a new research question…"})]})]})]})};export{B as default};
|
|
|
|
|
|
assets/SharedChatView-CULmFPKQ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as f,a as x,r as l,j as e}from"./index-ClYrAl8a.js";import{u as j}from"./useQuery-Drr20jTc.js";import{C as v,U as g,A as y}from"./ChatMessage-DoWa4hRO.js";import{j as p,S,p as k,q as C,k as b}from"./chatSessions-MtbDAqMr.js";import"./useBaseQuery-DlkwakD5.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Do8kbf9Q.js";import"./index-DmFk7249.js";import"./hover-card-BDewF190.js";const q=({detail:c})=>{const[o,r]=l.useState(()=>k(c)),d=l.useMemo(()=>{const t={};for(const s of o)for(const n of s.blocks??[])if(n.kind==="tool")for(const a of n.results??[])t[a.route_id]=a;return t},[o]),h=(t,s)=>{r(n=>n.map(a=>{var u;return a.id!==t?a:{...a,blocks:(u=a.blocks)==null?void 0:u.map((i,m)=>m===s&&(i.kind==="reasoning"||i.kind==="tool")?{...i,open:!i.open}:i)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:o.map(t=>t.role==="user"?e.jsx(g,{id:t.id,text:t.text??""},t.id):e.jsx(y,{msg:t,papers:d,onToggleBlock:h},t.id))})},F=()=>{const{shareId:c=""}=f(),o=x(),r=j({queryKey:["shared-chat",c],queryFn:()=>b(c),retry:(t,s)=>!(s instanceof p&&s.status===404)&&t<1});l.useEffect(()=>{const t=document.title,s=document.head.querySelector('meta[name="robots"]'),n=s==null?void 0:s.content,a=s??document.createElement("meta");return a.name="robots",a.content="noindex,nofollow",s||document.head.appendChild(a),document.title="Shared conversation",()=>{document.title=t,s?s.content=n??"":a.remove()}},[]);const d=t=>{C(t),o("/chat")},h=r.error instanceof p&&r.error.status===404;return r.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):h?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."})]}):r.isError||!r.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 r.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsx("div",{className:"shared-chat-heading",children:"Shared conversation"}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(q,{detail:r.data},r.data.updated_at),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),e.jsx(v,{onSend:d,placeholder:"Ask a new research question…"})]})]})]})};export{F as default};
|
assets/{SignInToEditDialog-BoeWau__.js → SignInToEditDialog-D5M5vIDC.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as X,r as i,j as e,
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as X,r as i,j as e,a3 as W,q,a4 as Q,g as Z,t as ee,X as te,C as se,a5 as ae}from"./index-ClYrAl8a.js";import{B as D}from"./button-5hN1cjku.js";import{I as h,T as re}from"./textarea-CiVGOMsF.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-zw8tnspo.js";import{u as oe}from"./useMutation-DivT1EgA.js";import{L as ie}from"./loader-circle-DQ1xuEZx.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{SubmissionsDashboard-DmsnloPS.js → SubmissionsDashboard-XlWQ5g59.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
var fe=s=>{throw TypeError(s)};var
|
| 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 ns=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"}]]),M=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},xe=s=>Array.isArray(s)?s.map(t=>{const i=M(t),n=Number(i.id);return Number.isFinite(n)?{id:n,name:typeof i.name=="string"?i.name:`#${n}`,slug:typeof i.slug=="string"?i.slug:void 0}:null}).filter(t=>!!t):[],ve=s=>Array.isArray(s)?s.map(Number).filter(t=>Number.isFinite(t)):[],W=s=>Array.isArray(s)?s.map(t=>{const i=M(t);return typeof i.url!="string"?null:{url:i.url,is_official:!!i.is_official}}).filter(t=>!!t):[],rs=s=>Array.isArray(s)?s.map(t=>M(t)):[],as=s=>Array.isArray(s)?s.map(t=>M(t)):[],os=s=>s.replace(/_/g," ");function cs({currentPayload:s,proposedPayload:t}){const[i,n]=N.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>n(r=>!r),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(oe,{title:"Current payload",value:s??{}}),e.jsx(oe,{title:"Proposed payload",value:t})]})]})}function oe({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 Ne({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n}){const r=N.useMemo(()=>Array.from(new Set([...s.map(o=>o.id),...t])).sort((o,u)=>o-u),[s,t]),c=V({queries:r.map(o=>({queryKey:[i,String(o)],queryFn:()=>n(String(o)),staleTime:5*60*1e3}))}),l=N.useMemo(()=>{const o=new Map;return s.forEach(u=>o.set(u.id,u.name)),c.forEach(u=>{const j=u.data;if(!j)return;const h=Number(j.id);Number.isFinite(h)&&o.set(h,j.name)}),o},[s,c]),d=new Set(s.map(o=>o.id)),m=new Set(t),b=r.filter(o=>d.has(o)&&!m.has(o)),x=r.filter(o=>!d.has(o)&&m.has(o)),a=(o,u)=>{const j=u==="current"&&b.includes(o),h=u==="proposed"&&x.includes(o);return e.jsx("span",{className:q("submission-diff-pill",j&&"removed",h&&"added"),children:l.get(o)??`#${o}`},o)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Currently tagged",children:s.length>0?s.map(o=>a(o.id,"current")):e.jsx(k,{children:"No current tags"})}),e.jsx(R,{title:"Will be tagged",children:t.length>0?t.map(o=>a(o,"proposed")):e.jsx(k,{children:"No proposed tags"})})]})}function ce({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(l=>[l.url,l])),r=new Map(i.map(l=>[l.url,l])),c=Array.from(new Set([...n.keys(),...r.keys()])).sort();return c.length===0?e.jsxs(k,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:c.map(l=>{var o;const d=n.get(l),m=r.get(l),b=!d&&m,x=d&&!m,a=d&&m&&d.is_official!==m.is_official;return e.jsx("div",{className:q("submission-url-row",b&&"added",x&&"removed",a&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:q("submission-url-link",x&&"removed"),children:l}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),x&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),a&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(d.is_official)," ","->"," ",String(m.is_official)]}),((o=m??d)==null?void 0:o.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},l)})})}function ls({currentPayload:s,proposedPayload:t}){const i=rs(M(s).evaluations),n=as(t.operations),r=N.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.task_id&&a.add(Number(o.task_id))}),n.forEach(o=>{const u=o.data;u!=null&&u.task_id&&a.add(Number(u.task_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),c=N.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.dataset_id&&a.add(Number(o.dataset_id))}),n.forEach(o=>{const u=o.data;u!=null&&u.dataset_id&&a.add(Number(u.dataset_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),l=V({queries:r.map(a=>({queryKey:["task",String(a)],queryFn:()=>Se(String(a)),staleTime:5*60*1e3}))}),d=V({queries:c.map(a=>({queryKey:["dataset",String(a)],queryFn:()=>Ie(String(a)),staleTime:5*60*1e3}))}),m=N.useMemo(()=>{const a=new Map;return l.forEach(o=>{const u=o.data;if(!u)return;const j=Number(u.id);Number.isFinite(j)&&a.set(j,u.name)}),a},[l]),b=N.useMemo(()=>{const a=new Map;return d.forEach(o=>{const u=o.data;if(!u)return;const j=Number(u.id);Number.isFinite(j)&&a.set(j,u.name)}),a},[d]),x=new Map(i.filter(a=>a.id!=null).map(a=>[Number(a.id),a]));return n.length===0?e.jsx(k,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((a,o)=>{const u=a.evaluation_id?x.get(a.evaluation_id):void 0,h=(a.op==="update"?{...u,...a.data}:a.data??u)??{};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",a.op==="create"&&"approved",a.op==="update"&&"changed",a.op==="delete"&&"rejected"),children:a.op??"unknown"}),a.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",a.evaluation_id]})]}),a.op&&["create","update","delete"].includes(a.op)?e.jsx(ds,{evaluation:h,taskNames:m,datasetNames:b}):e.jsx(oe,{title:"Unsupported operation",value:a})]},`${a.op}-${a.evaluation_id??o}`)})})}function ds({evaluation:s,taskNames:t,datasetNames:i}){const n=s.task_id?Number(s.task_id):void 0,r=s.dataset_id?Number(s.dataset_id):void 0,c=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(F,{label:"Task",value:n?t.get(n)??`#${n}`:null}),e.jsx(F,{label:"Dataset",value:r?i.get(r)??`#${r}`:null}),e.jsx(F,{label:"Model",value:s.model_name||null}),e.jsx(F,{label:"Harness",value:s.harness||null}),e.jsx(F,{label:"Best rank",value:s.best_rank??null}),e.jsx(F,{label:"Parameters",value:s.num_parameters??null}),e.jsx(F,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(F,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(c).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(c).map(([l,d])=>e.jsxs("span",{className:"submission-metric-pill",children:[l,": ",String(d)]},l))}):e.jsx(k,{children:"No metrics"})]})]})}function F({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 us({currentPayload:s,proposedPayload:t}){const i=M(s).source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:i,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(k,{children:"No current URL"})}),e.jsx(R,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(k,{children:"No proposed URL"})})]})}function T({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",r=typeof t.dates=="string"?t.dates:"",c=typeof t.venue=="string"?t.venue:"",l=typeof t.url=="string"?t.url:"",d=M(t.image),m=typeof d.data_url=="string"&&d.data_url.startsWith("data:image/")?d.data_url:"",b=typeof d.url=="string"?Ue(d.url)??"":m,x=typeof d.file_name=="string"?d.file_name:"Suggested image",a=typeof t.image_credit=="string"?t.image_credit:"",o=typeof t.source=="string"?t.source:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(k,{children:"No name provided"})}),e.jsx(R,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(k,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"Image",children:b?e.jsx("img",{src:b,alt:x,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(k,{children:"No image provided"})}),e.jsx(R,{title:"Image source",children:a||e.jsx(k,{children:"No image source provided"})})]}),s==="method"&&e.jsx(R,{title:"Source",children:o?o.startsWith("http://")||o.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:o,target:"_blank",rel:"noopener noreferrer",children:o}):e.jsx("span",{className:"submission-field-value",children:o}):e.jsx(k,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"Dates",children:r||e.jsx(k,{children:"No dates provided"})}),e.jsx(R,{title:"Venue",children:c||e.jsx(k,{children:"No venue provided"})}),e.jsx(R,{title:"URL",children:l?e.jsx("a",{className:"submission-url-link",href:l,target:"_blank",rel:"noopener noreferrer",children:l}):e.jsx(k,{children:"No URL provided"})})]})]})}function R({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 k({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ms({currentPayload:s,proposedPayload:t}){const i=M(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:r,label:c})=>{const l=Array.isArray(i[r])?i[r].filter(m=>typeof m=="string"):[],d=Array.isArray(t[r])?t[r].filter(m=>typeof m=="string"):[];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:c}),e.jsx(ce,{label:c.toLowerCase(),currentItems:l.map(m=>({url:m,is_official:!1})),proposedItems:d.map(m=>({url:m,is_official:!1}))})]},r)})})}function hs({editType:s,currentPayload:t,proposedPayload:i}){const n=M(t);let r;return s==="tasks"?r=e.jsx(Ne,{currentItems:xe(n.tasks),proposedIds:ve(i.task_ids),queryPrefix:"task",fetchEntity:Se}):s==="methods"?r=e.jsx(Ne,{currentItems:xe(n.methods),proposedIds:ve(i.method_ids),queryPrefix:"method",fetchEntity:qe}):s==="repositories"?r=e.jsx(ce,{label:"repositories",currentItems:W(n.repositories),proposedItems:W(i.repositories)}):s==="project_pages"?r=e.jsx(ce,{label:"project pages",currentItems:W(n.project_pages),proposedItems:W(i.project_pages)}):s==="evaluations"?r=e.jsx(ls,{currentPayload:t,proposedPayload:i}):s==="source_url"?r=e.jsx(us,{currentPayload:t,proposedPayload:i}):s==="hf_artifacts"?r=e.jsx(ms,{currentPayload:t,proposedPayload:i}):s==="new_task"?r=e.jsx(T,{kind:"task",proposedPayload:i}):s==="new_method"?r=e.jsx(T,{kind:"method",proposedPayload:i}):s==="new_benchmark"?r=e.jsx(T,{kind:"benchmark",proposedPayload:i}):s==="new_metric"?r=e.jsx(T,{kind:"metric",proposedPayload:i}):s==="new_conference"?r=e.jsx(T,{kind:"conference",proposedPayload:i}):r=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",os(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[r,e.jsx(cs,{currentPayload:t,proposedPayload:i})]})}const Z=25,fs=["pending","approved","rejected","all"],ps=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference"],le=["pending","approved","rejected"];function gs(s){return s.slice(0,2).toUpperCase()}function Y(s){return s.replace(/_/g," ")}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),r=Math.floor(i/36e5),c=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:r<24?`${r}h ago`:c<14?`${c}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function de(s,t){var n;const i=s;if(i.response)try{const r=JSON.parse(i.response);if(typeof(r==null?void 0:r.detail)=="string")return r.detail;if(Array.isArray(r==null?void 0:r.detail)&&((n=r.detail[0])!=null&&n.msg))return r.detail[0].msg}catch{return i.response}return i.message||t}function bs(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function js(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function xs(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function vs(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return se({status:s,edit_type:n,limit:i,offset:0});const r=await Promise.all(le.map(c=>se({status:c,edit_type:n,limit:i,offset:0})));return{count:r.reduce((c,l)=>c+l.count,0),results:xs(r.flatMap(c=>c.results)).slice(0,i)}}function Ns(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(Ze,{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 ys(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(B,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function _s({submission:s,paper:t}){const[i,n]=N.useState(s.admin_note??""),r=ke(),{toast:c}=we(),l=s.paper_id==null,d=l?null:js(t,s.paper_id),m=l?"Taxonomy directory":(t==null?void 0:t.title)||`Paper #${s.paper_id}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,x=s.status==="pending";N.useEffect(()=>{n(s.admin_note??"")},[s.admin_note,s.id]);const a=N.useCallback(f=>{r.invalidateQueries({queryKey:["pendingPaperEdits"]}),r.invalidateQueries({queryKey:["pendingPaperEdit",f.id]}),f.paper_id!=null&&(r.invalidateQueries({queryKey:["paper",String(f.paper_id)]}),r.invalidateQueries({queryKey:["paper-summary",String(f.paper_id)]})),t!=null&&t.arxiv_id&&r.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),f.edit_type==="evaluations"&&f.paper_id!=null&&r.invalidateQueries({queryKey:["evaluations","paper",String(f.paper_id)]})},[t==null?void 0:t.arxiv_id,r]),o=be({mutationFn:()=>ze(s.id,{admin_note:i.trim()||void 0}),onSuccess:f=>{a(f),c({title:"Submission approved",description:`Applied ${Y(s.edit_type)} changes for ${m}.`})},onError:f=>{c({title:"Could not approve submission",description:de(f,"Approval failed. Please try again."),variant:"destructive"})}}),u=be({mutationFn:()=>He(s.id,{admin_note:i.trim()||void 0}),onSuccess:f=>{a(f),c({title:"Submission rejected",description:`Rejected ${Y(s.edit_type)} changes for ${m}.`})},onError:f=>{c({title:"Could not reject submission",description:de(f,"Rejection failed. Please try again."),variant:"destructive"})}}),j=o.isPending,h=u.isPending,y=j||h;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:m}):e.jsx("div",{className:"submission-title",children:m}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?"Directory suggestion":`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",bs(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($e,{className:"h-6 w-6",children:[e.jsx(Te,{src:b,alt:s.hf_username}),e.jsx(Be,{className:"text-[10px]",children:gs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(hs,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:x?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:i,onChange:f=>n(f.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:y}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>u.mutate(),disabled:y,className:"submission-action-btn reject",children:[h?e.jsx(B,{className:"spin",size:14}):e.jsx(es,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>o.mutate(),disabled:y,className:"submission-action-btn approve",children:[j?e.jsx(B,{className:"spin",size:14}):e.jsx(ss,{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})]})]})})]})}function As(){var ue,me,he;const{user:s,isLoading:t}=De(),{toast:i}=we(),[n,r]=N.useState("pending"),[c,l]=N.useState("all"),[d,m]=N.useState(Z),b=!!(s!=null&&s.is_admin);N.useEffect(()=>{m(Z)},[n,c]);const x=ge({queryKey:["pendingPaperEdits","counts",c],queryFn:async()=>{const g=c==="all"?void 0:c,A=await Promise.all(le.map(O=>se({status:O,edit_type:g,limit:1,offset:0})));return Object.fromEntries(A.map((O,J)=>[le[J],O.count]))},enabled:b,staleTime:30*1e3}),a=ge({queryKey:["pendingPaperEdits",{status:n,editType:c,visibleLimit:d}],queryFn:()=>vs(n,c,d),enabled:b,retry:!1}),o=N.useMemo(()=>{var g;return Array.from(new Set((((g=a.data)==null?void 0:g.results)??[]).map(A=>A.paper_id).filter(A=>A!=null))).sort((A,O)=>A-O)},[(ue=a.data)==null?void 0:ue.results]),u=V({queries:o.map(g=>({queryKey:["paper-summary",String(g)],queryFn:()=>Le(String(g),!1),enabled:b,staleTime:5*60*1e3}))}),j=N.useMemo(()=>{const g=new Map;return u.forEach(A=>{const O=A.data;if(!O)return;const J=Number(O.id);Number.isFinite(J)&&g.set(J,O)}),g},[u]);if(N.useEffect(()=>{a.error&&i({title:"Could not load submissions",description:de(a.error,"Failed to load pending paper edits."),variant:"destructive"})},[a.error,i]),t)return e.jsx(ys,{});if(!b)return e.jsx(Ns,{});const h=x.data,y=h?h.pending+h.approved+h.rejected:void 0,f={pending:h==null?void 0:h.pending,approved:h==null?void 0:h.approved,rejected:h==null?void 0:h.rejected,all:y},I=((me=a.data)==null?void 0:me.results)??[],G=((he=a.data)==null?void 0:he.count)??0,Re=I.length<G;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:()=>{x.refetch(),a.refetch()},disabled:a.isFetching||x.isFetching,children:[e.jsx(Xe,{className:q((a.isFetching||x.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:fs.map(g=>e.jsxs("button",{type:"button",className:q("period-btn",n===g&&"active"),onClick:()=>r(g),children:[g,f[g]!=null&&e.jsx("span",{className:"submission-count",children:f[g]})]},g))})]}),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:ps.map(g=>e.jsx("button",{type:"button",className:q("sort-btn",c===g&&"active"),onClick:()=>l(g),children:Y(g)},g))})]})]}),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:a.isFetching?"refreshing":`${G} submissions`})})})}),a.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(B,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):I.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ns,{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:I.map(g=>e.jsx(_s,{submission:g,paper:g.paper_id==null?void 0:j.get(g.paper_id)},g.id))}),I.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",I.length," of ",G," submissions"]}),Re&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(g=>g+Z),disabled:a.isFetching,children:[a.isFetching&&e.jsx(B,{className:"spin",size:14}),"Load more"]})]})]})]})}export{As as default};
|
|
|
|
| 1 |
+
var fe=s=>{throw TypeError(s)};var G=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(G(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(G(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(G(s,t,"access private method"),i);import{ap as Ae,aq as ee,ar as Oe,as as Me,s as ke,r as $,at as qe,c as Fe,j as e,au as Se,av as Qe,R as N,q as Q,aw as Ie,Z as Ue,f as Le,g as we,ak as De,ax as $e,ay as Te,az as Be,aA as ze,aB as He,aC as se}from"./index-ClYrAl8a.js";import{Q as Ee,u as Ke,a as Pe,e as Je,b as We,c as Ve,s as pe,f as Ye,g as Ze}from"./useBaseQuery-DlkwakD5.js";import{u as ge}from"./useQuery-Drr20jTc.js";import{u as be}from"./useMutation-DivT1EgA.js";import{R as Ge,S as Xe,C as es,a as ss}from"./shield-alert-CFEEyNo0.js";import{L as B}from"./loader-circle-DQ1xuEZx.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var L,S,D,U,w,F,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,L);E(this,S);E(this,D);E(this,U);E(this,w);E(this,F);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,L,t),_(this,U,n),_(this,D,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,D,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,D));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},L=new WeakMap,S=new WeakMap,D=new WeakMap,U=new WeakMap,w=new WeakMap,F=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,F)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,F,Me(p(this,F),i(t)))),p(this,F)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,L).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,L),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,F),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function Y({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ve(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):qe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ye(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ze({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
| 5 |
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
+
*/const ns=Fe("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"}]]),M=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},xe=s=>Array.isArray(s)?s.map(t=>{const i=M(t),n=Number(i.id);return Number.isFinite(n)?{id:n,name:typeof i.name=="string"?i.name:`#${n}`,slug:typeof i.slug=="string"?i.slug:void 0}:null}).filter(t=>!!t):[],ve=s=>Array.isArray(s)?s.map(Number).filter(t=>Number.isFinite(t)):[],W=s=>Array.isArray(s)?s.map(t=>{const i=M(t);return typeof i.url!="string"?null:{url:i.url,is_official:!!i.is_official}}).filter(t=>!!t):[],rs=s=>Array.isArray(s)?s.map(t=>M(t)):[],as=s=>Array.isArray(s)?s.map(t=>M(t)):[],os=s=>s.replace(/_/g," ");function cs({currentPayload:s,proposedPayload:t}){const[i,n]=N.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>n(r=>!r),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(oe,{title:"Current payload",value:s??{}}),e.jsx(oe,{title:"Proposed payload",value:t})]})]})}function oe({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 Ne({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n}){const r=N.useMemo(()=>Array.from(new Set([...s.map(o=>o.id),...t])).sort((o,u)=>o-u),[s,t]),c=Y({queries:r.map(o=>({queryKey:[i,String(o)],queryFn:()=>n(String(o)),staleTime:5*60*1e3}))}),l=N.useMemo(()=>{const o=new Map;return s.forEach(u=>o.set(u.id,u.name)),c.forEach(u=>{const j=u.data;if(!j)return;const h=Number(j.id);Number.isFinite(h)&&o.set(h,j.name)}),o},[s,c]),d=new Set(s.map(o=>o.id)),m=new Set(t),b=r.filter(o=>d.has(o)&&!m.has(o)),x=r.filter(o=>!d.has(o)&&m.has(o)),a=(o,u)=>{const j=u==="current"&&b.includes(o),h=u==="proposed"&&x.includes(o);return e.jsx("span",{className:Q("submission-diff-pill",j&&"removed",h&&"added"),children:l.get(o)??`#${o}`},o)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Currently tagged",children:s.length>0?s.map(o=>a(o.id,"current")):e.jsx(k,{children:"No current tags"})}),e.jsx(R,{title:"Will be tagged",children:t.length>0?t.map(o=>a(o,"proposed")):e.jsx(k,{children:"No proposed tags"})})]})}function ce({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(l=>[l.url,l])),r=new Map(i.map(l=>[l.url,l])),c=Array.from(new Set([...n.keys(),...r.keys()])).sort();return c.length===0?e.jsxs(k,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:c.map(l=>{var o;const d=n.get(l),m=r.get(l),b=!d&&m,x=d&&!m,a=d&&m&&d.is_official!==m.is_official;return e.jsx("div",{className:Q("submission-url-row",b&&"added",x&&"removed",a&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:Q("submission-url-link",x&&"removed"),children:l}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),x&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),a&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(d.is_official)," ","->"," ",String(m.is_official)]}),((o=m??d)==null?void 0:o.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},l)})})}function ls({currentPayload:s,proposedPayload:t}){const i=rs(M(s).evaluations),n=as(t.operations),r=N.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.task_id&&a.add(Number(o.task_id))}),n.forEach(o=>{const u=o.data;u!=null&&u.task_id&&a.add(Number(u.task_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),c=N.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.dataset_id&&a.add(Number(o.dataset_id))}),n.forEach(o=>{const u=o.data;u!=null&&u.dataset_id&&a.add(Number(u.dataset_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),l=Y({queries:r.map(a=>({queryKey:["task",String(a)],queryFn:()=>Se(String(a)),staleTime:5*60*1e3}))}),d=Y({queries:c.map(a=>({queryKey:["dataset",String(a)],queryFn:()=>Ie(String(a)),staleTime:5*60*1e3}))}),m=N.useMemo(()=>{const a=new Map;return l.forEach(o=>{const u=o.data;if(!u)return;const j=Number(u.id);Number.isFinite(j)&&a.set(j,u.name)}),a},[l]),b=N.useMemo(()=>{const a=new Map;return d.forEach(o=>{const u=o.data;if(!u)return;const j=Number(u.id);Number.isFinite(j)&&a.set(j,u.name)}),a},[d]),x=new Map(i.filter(a=>a.id!=null).map(a=>[Number(a.id),a]));return n.length===0?e.jsx(k,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((a,o)=>{const u=a.evaluation_id?x.get(a.evaluation_id):void 0,h=(a.op==="update"?{...u,...a.data}:a.data??u)??{};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",a.op==="create"&&"approved",a.op==="update"&&"changed",a.op==="delete"&&"rejected"),children:a.op??"unknown"}),a.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",a.evaluation_id]})]}),a.op&&["create","update","delete"].includes(a.op)?e.jsx(ds,{evaluation:h,taskNames:m,datasetNames:b}):e.jsx(oe,{title:"Unsupported operation",value:a})]},`${a.op}-${a.evaluation_id??o}`)})})}function ds({evaluation:s,taskNames:t,datasetNames:i}){const n=s.task_id?Number(s.task_id):void 0,r=s.dataset_id?Number(s.dataset_id):void 0,c=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(q,{label:"Task",value:n?t.get(n)??`#${n}`:null}),e.jsx(q,{label:"Dataset",value:r?i.get(r)??`#${r}`: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(c).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(c).map(([l,d])=>e.jsxs("span",{className:"submission-metric-pill",children:[l,": ",String(d)]},l))}):e.jsx(k,{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 us({currentPayload:s,proposedPayload:t}){const i=M(s).source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:i,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(k,{children:"No current URL"})}),e.jsx(R,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(k,{children:"No proposed URL"})})]})}function T({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",r=typeof t.dates=="string"?t.dates:"",c=typeof t.venue=="string"?t.venue:"",l=typeof t.url=="string"?t.url:"",d=M(t.image),m=typeof d.data_url=="string"&&d.data_url.startsWith("data:image/")?d.data_url:"",b=typeof d.url=="string"?Ue(d.url)??"":m,x=typeof d.file_name=="string"?d.file_name:"Suggested image",a=typeof t.image_credit=="string"?t.image_credit:"",o=typeof t.source=="string"?t.source:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(k,{children:"No name provided"})}),e.jsx(R,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(k,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"Image",children:b?e.jsx("img",{src:b,alt:x,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(k,{children:"No image provided"})}),e.jsx(R,{title:"Image source",children:a||e.jsx(k,{children:"No image source provided"})})]}),s==="method"&&e.jsx(R,{title:"Source",children:o?o.startsWith("http://")||o.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:o,target:"_blank",rel:"noopener noreferrer",children:o}):e.jsx("span",{className:"submission-field-value",children:o}):e.jsx(k,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"Dates",children:r||e.jsx(k,{children:"No dates provided"})}),e.jsx(R,{title:"Venue",children:c||e.jsx(k,{children:"No venue provided"})}),e.jsx(R,{title:"URL",children:l?e.jsx("a",{className:"submission-url-link",href:l,target:"_blank",rel:"noopener noreferrer",children:l}):e.jsx(k,{children:"No URL provided"})})]})]})}function R({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 k({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ms({currentPayload:s,proposedPayload:t}){const i=M(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:r,label:c})=>{const l=Array.isArray(i[r])?i[r].filter(m=>typeof m=="string"):[],d=Array.isArray(t[r])?t[r].filter(m=>typeof m=="string"):[];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:c}),e.jsx(ce,{label:c.toLowerCase(),currentItems:l.map(m=>({url:m,is_official:!1})),proposedItems:d.map(m=>({url:m,is_official:!1}))})]},r)})})}function hs({editType:s,currentPayload:t,proposedPayload:i}){const n=M(t);let r;return s==="tasks"?r=e.jsx(Ne,{currentItems:xe(n.tasks),proposedIds:ve(i.task_ids),queryPrefix:"task",fetchEntity:Se}):s==="methods"?r=e.jsx(Ne,{currentItems:xe(n.methods),proposedIds:ve(i.method_ids),queryPrefix:"method",fetchEntity:Qe}):s==="repositories"?r=e.jsx(ce,{label:"repositories",currentItems:W(n.repositories),proposedItems:W(i.repositories)}):s==="project_pages"?r=e.jsx(ce,{label:"project pages",currentItems:W(n.project_pages),proposedItems:W(i.project_pages)}):s==="evaluations"?r=e.jsx(ls,{currentPayload:t,proposedPayload:i}):s==="source_url"?r=e.jsx(us,{currentPayload:t,proposedPayload:i}):s==="hf_artifacts"?r=e.jsx(ms,{currentPayload:t,proposedPayload:i}):s==="new_task"?r=e.jsx(T,{kind:"task",proposedPayload:i}):s==="new_method"?r=e.jsx(T,{kind:"method",proposedPayload:i}):s==="new_benchmark"?r=e.jsx(T,{kind:"benchmark",proposedPayload:i}):s==="new_metric"?r=e.jsx(T,{kind:"metric",proposedPayload:i}):s==="new_conference"?r=e.jsx(T,{kind:"conference",proposedPayload:i}):r=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",os(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[r,e.jsx(cs,{currentPayload:t,proposedPayload:i})]})}const X=25,fs=["pending","approved","rejected","all"],ps=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference"],le=["pending","approved","rejected"];function gs(s){return s.slice(0,2).toUpperCase()}function V(s){return s.replace(/_/g," ")}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),r=Math.floor(i/36e5),c=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:r<24?`${r}h ago`:c<14?`${c}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function de(s,t){var n;const i=s;if(i.response)try{const r=JSON.parse(i.response);if(typeof(r==null?void 0:r.detail)=="string")return r.detail;if(Array.isArray(r==null?void 0:r.detail)&&((n=r.detail[0])!=null&&n.msg))return r.detail[0].msg}catch{return i.response}return i.message||t}function bs(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function js(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function xs(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function vs(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return se({status:s,edit_type:n,limit:i,offset:0});const r=await Promise.all(le.map(c=>se({status:c,edit_type:n,limit:i,offset:0})));return{count:r.reduce((c,l)=>c+l.count,0),results:xs(r.flatMap(c=>c.results)).slice(0,i)}}function Ns(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(Xe,{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 ys(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(B,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function _s({submission:s,paper:t}){const[i,n]=N.useState(s.admin_note??""),r=ke(),{toast:c}=we(),l=s.paper_id==null,d=l?null:js(t,s.paper_id),m=l?"Taxonomy directory":(t==null?void 0:t.title)||`Paper #${s.paper_id}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,x=s.status==="pending";N.useEffect(()=>{n(s.admin_note??"")},[s.admin_note,s.id]);const a=N.useCallback(f=>{r.invalidateQueries({queryKey:["pendingPaperEdits"]}),r.invalidateQueries({queryKey:["pendingPaperEdit",f.id]}),f.paper_id!=null&&(r.invalidateQueries({queryKey:["paper",String(f.paper_id)]}),r.invalidateQueries({queryKey:["paper-summary",String(f.paper_id)]})),t!=null&&t.arxiv_id&&r.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),f.edit_type==="evaluations"&&f.paper_id!=null&&r.invalidateQueries({queryKey:["evaluations","paper",String(f.paper_id)]})},[t==null?void 0:t.arxiv_id,r]),o=be({mutationFn:()=>ze(s.id,{admin_note:i.trim()||void 0}),onSuccess:f=>{a(f),c({title:"Submission approved",description:`Applied ${V(s.edit_type)} changes for ${m}.`})},onError:f=>{c({title:"Could not approve submission",description:de(f,"Approval failed. Please try again."),variant:"destructive"})}}),u=be({mutationFn:()=>He(s.id,{admin_note:i.trim()||void 0}),onSuccess:f=>{a(f),c({title:"Submission rejected",description:`Rejected ${V(s.edit_type)} changes for ${m}.`})},onError:f=>{c({title:"Could not reject submission",description:de(f,"Rejection failed. Please try again."),variant:"destructive"})}}),j=o.isPending,h=u.isPending,y=j||h;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:m}):e.jsx("div",{className:"submission-title",children:m}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?"Directory suggestion":`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:V(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:Q("submission-pill status",bs(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($e,{className:"h-6 w-6",children:[e.jsx(Te,{src:b,alt:s.hf_username}),e.jsx(Be,{className:"text-[10px]",children:gs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(hs,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:x?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:i,onChange:f=>n(f.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:y}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>u.mutate(),disabled:y,className:"submission-action-btn reject",children:[h?e.jsx(B,{className:"spin",size:14}):e.jsx(es,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>o.mutate(),disabled:y,className:"submission-action-btn approve",children:[j?e.jsx(B,{className:"spin",size:14}):e.jsx(ss,{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})]})]})})]})}function Os(){var ue,me,he;const{user:s,isLoading:t}=Le(),{toast:i}=we(),[n,r]=N.useState("pending"),[c,l]=N.useState("all"),[d,m]=N.useState(X),b=!!(s!=null&&s.is_admin);N.useEffect(()=>{m(X)},[n,c]);const x=ge({queryKey:["pendingPaperEdits","counts",c],queryFn:async()=>{const g=c==="all"?void 0:c,A=await Promise.all(le.map(O=>se({status:O,edit_type:g,limit:1,offset:0})));return Object.fromEntries(A.map((O,J)=>[le[J],O.count]))},enabled:b,staleTime:30*1e3}),a=ge({queryKey:["pendingPaperEdits",{status:n,editType:c,visibleLimit:d}],queryFn:()=>vs(n,c,d),enabled:b,retry:!1}),o=N.useMemo(()=>{var g;return Array.from(new Set((((g=a.data)==null?void 0:g.results)??[]).map(A=>A.paper_id).filter(A=>A!=null))).sort((A,O)=>A-O)},[(ue=a.data)==null?void 0:ue.results]),u=Y({queries:o.map(g=>({queryKey:["paper-summary",String(g)],queryFn:()=>De(String(g),!1),enabled:b,staleTime:5*60*1e3}))}),j=N.useMemo(()=>{const g=new Map;return u.forEach(A=>{const O=A.data;if(!O)return;const J=Number(O.id);Number.isFinite(J)&&g.set(J,O)}),g},[u]);if(N.useEffect(()=>{a.error&&i({title:"Could not load submissions",description:de(a.error,"Failed to load pending paper edits."),variant:"destructive"})},[a.error,i]),t)return e.jsx(ys,{});if(!b)return e.jsx(Ns,{});const h=x.data,y=h?h.pending+h.approved+h.rejected:void 0,f={pending:h==null?void 0:h.pending,approved:h==null?void 0:h.approved,rejected:h==null?void 0:h.rejected,all:y},I=((me=a.data)==null?void 0:me.results)??[],Z=((he=a.data)==null?void 0:he.count)??0,Re=I.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:()=>{x.refetch(),a.refetch()},disabled:a.isFetching||x.isFetching,children:[e.jsx(Ge,{className:Q((a.isFetching||x.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:fs.map(g=>e.jsxs("button",{type:"button",className:Q("period-btn",n===g&&"active"),onClick:()=>r(g),children:[g,f[g]!=null&&e.jsx("span",{className:"submission-count",children:f[g]})]},g))})]}),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:ps.map(g=>e.jsx("button",{type:"button",className:Q("sort-btn",c===g&&"active"),onClick:()=>l(g),children:V(g)},g))})]})]}),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:a.isFetching?"refreshing":`${Z} submissions`})})})}),a.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(B,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):I.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ns,{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:I.map(g=>e.jsx(_s,{submission:g,paper:g.paper_id==null?void 0:j.get(g.paper_id)},g.id))}),I.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",I.length," of ",Z," submissions"]}),Re&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(g=>g+X),disabled:a.isFetching,children:[a.isFetching&&e.jsx(B,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Os as default};
|
assets/{SubmitView-Bt8gksJA.js → SubmitView-DPve1BBN.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as R,s as T,g as _,R as n,j as e,
|
|
|
|
| 1 |
+
import{a as R,s as T,g as _,R as n,j as e,ao as D}from"./index-ClYrAl8a.js";import{u as k}from"./useMutation-DivT1EgA.js";import{A as w,a as C}from"./alert-2CUZfv8i.js";import{B as j}from"./button-5hN1cjku.js";import{I as h,T as z}from"./textarea-CiVGOMsF.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(g=>g.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,g]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,x]=n.useState(null),u=S(d),v=u==="external",c=k({mutationFn:t=>D(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{x(q(t))}}),P=t=>{if(t.preventDefault(),x(null),u==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:P,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:d,onChange:t=>s(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),v&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:l,onChange:t=>p(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(z,{id:"submit-abstract",value:o,onChange:t=>g(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:f,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default};
|