Spaces:
Running
Running
Sync paperswithcode.co frontend
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +2 -0
- assets/{AiDeadlinesView-DK2uvcz2.js → AiDeadlinesView-BVqyK_Mv.js} +1 -1
- assets/BenchmarkDetailView-7rgsFTuP.js +0 -2
- assets/BenchmarkDetailView-N3ucOfX1.js +2 -0
- assets/ClosedSourceEvalBadge-BjrimQbP.js +1 -0
- assets/ClosedSourceEvalBadge-drWiTHYQ.js +0 -1
- assets/{ConferenceDetailView-CDP-HF34.js → ConferenceDetailView-SPyKy7dS.js} +1 -1
- assets/{ConferenceTaskView-B_-EGfGK.js → ConferenceTaskView-yT-uFLih.js} +1 -1
- assets/{ConferencesIndexView-D5iEQ6eX.js → ConferencesIndexView-BuCJOh2P.js} +1 -1
- assets/{CronDashboard-Cn-U_X_P.js → CronDashboard-CbRwUMmP.js} +2 -2
- assets/FeedView-DMj2BLlQ.js +1 -0
- assets/FeedView-DwVPIvQN.js +0 -1
- assets/{LatexTitle-ZrlO0rs7.js → LatexTitle-C8-B6cG1.js} +1 -1
- assets/{MarkdownText-trAzkiVz.js → MarkdownText-BjEj6m-s.js} +0 -0
- assets/{MethodDetailView-oq0vHvu5.js → MethodDetailView-BHLd4UDP.js} +1 -1
- assets/{MethodsIndexView-CrTfP50j.js → MethodsIndexView-iTAgeehL.js} +1 -1
- assets/{NotFound-3lyVNVYr.js → NotFound-igMRmZl4.js} +1 -1
- assets/{OrganizationDetailView-CApb_ZqB.js → OrganizationDetailView-op1ankbX.js} +1 -1
- assets/{OrganizationTaskView-YBSKDYqe.js → OrganizationTaskView-EdzsJOxD.js} +1 -1
- assets/{OrganizationsIndexView-mPCmASS0.js → OrganizationsIndexView-BkO64H_8.js} +1 -1
- assets/PaperDetailView-D3EhNQS9.js +0 -47
- assets/PaperDetailView-P0uTYMJC.js +47 -0
- assets/{PapersListView-b_LgTzEk.js → PapersListView-CXIlDPqL.js} +1 -1
- assets/{SavedPapersView-CJCobMQf.js → SavedPapersView-CD0L6-uT.js} +1 -1
- assets/SearchOverlay-D8nJ8vYB.js +1 -0
- assets/SearchOverlay-D_x7sv0Q.js +0 -1
- assets/{SettingsView-DDUVofcg.js → SettingsView-0y6Kyvn3.js} +1 -1
- assets/SubmissionsDashboard-CBSTFtkY.js +0 -11
- assets/SubmissionsDashboard-XyPUwAgi.js +11 -0
- assets/SubmitView-CVFI-m88.js +1 -0
- assets/SubmitView-DBn6RIiN.js +0 -1
- assets/TagBrowseView-Da16Rn5_.js +0 -1
- assets/TagBrowseView-m_DfgrJy.js +11 -0
- assets/{TagsIndexView-BrKZEoUv.js → TagsIndexView-DNU0YwA-.js} +1 -1
- assets/alert-0Kui0gCY.js +1 -0
- assets/alert-Ayuop_ag.js +0 -1
- assets/{badge-CCpokg9G.js → badge-DZWw7QDg.js} +1 -1
- assets/components-D244J_Aj.js +0 -1
- assets/components-J9e6gtqw.js +1 -0
- assets/{dialog-DzRXUQ09.js → dialog-D8hTxZ4f.js} +2 -2
- assets/{index-DOEjZKdL.css → index-BwwIoFDx.css} +0 -0
- assets/{index-D3-tYEe-.js → index-M24Hywem.js} +0 -0
- assets/{index-BsV_WMf3.js → index-t6Oi9XIP.js} +1 -1
- assets/input-C7eEyU6x.js +0 -1
- assets/input-CpJZsE-m.js +1 -0
- assets/{loader-circle-BKVFOFo9.js → loader-circle-2lEq4cac.js} +1 -1
- assets/{refresh-cw-gCrkdl6j.js → refresh-cw-CcmPDWxW.js} +1 -1
- assets/{skeleton-D0cyB03X.js → skeleton-DCGdUtqq.js} +1 -1
- assets/{switch-9KW_DGK2.js → switch-B1cyrnry.js} +1 -1
- assets/textarea-DnPbxyAL.js +1 -0
.gitattributes
CHANGED
|
@@ -36,3 +36,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 36 |
images/conferences/cvpr-2026.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
images/methods/vggt.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
images/tasks/image-super-resolution.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 36 |
images/conferences/cvpr-2026.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
images/methods/vggt.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
images/tasks/image-super-resolution.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
images/methods/fast-conformer.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
images/methods/tdt.png filter=lfs diff=lfs merge=lfs -text
|
assets/{AiDeadlinesView-DK2uvcz2.js → AiDeadlinesView-BVqyK_Mv.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
import{r as x,j as t,a 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,a as E}from"./index-M24Hywem.js";import{u as A}from"./useQuery-C6YLWBWB.js";import{S as B}from"./switch-B1cyrnry.js";import{S as U}from"./skeleton-DCGdUtqq.js";import{A as W,a as O}from"./alert-0Kui0gCY.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-D8hTxZ4f.js";import"./index-t6Oi9XIP.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),H=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(H).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),z=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},I=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>I(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=I(e);return a.length?a[a.length-1]:null},Q=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},X=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=z(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(`
|
| 2 |
`)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),Z=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`;window.open(s,"_blank","noopener,noreferrer")},ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
|
| 3 |
`),g=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(g),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},te=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?I(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),g=e?z(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,p=s?new Date(s.deadline_at).getTime():null;return t.jsx(V,{open:a,onOpenChange:n,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(Y,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[g&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:g})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),p!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(p,r)},children:J(p,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,m)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,u=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(u?null:y,r)},children:X(y,r)})]},`${d.type??"deadline"}-${m}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},M=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ne=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),g=s?new Date(s.deadline_at).getTime():null,c=_(i?g:null,a),p=z(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:g!=null?Q(g,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[p&&t.jsx("span",{children:p}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(m=>{const y=n.has(m);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(m)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(m)},m)})})]})},ce=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,g]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),p=A({queryKey:["conference-deadlines"],queryFn:()=>E.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(u=>{const h=new Set(u);return h.has(l)?h.delete(l):h.add(l),h})},m=x.useMemo(()=>{var u;const l=new Map;return(u=p.data)==null||u.results.forEach(h=>{D(h).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((h,j)=>j[1]-h[1]).map(([h])=>h)},[p.data]),y=x.useMemo(()=>{var j;const u=(((j=p.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),h=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,w)=>{const v=h(f),N=h(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[p.data,e,n,o,c]);return p.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(O,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(M,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(M,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),m.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[m.map(l=>{const u=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:p.isLoading?"…":`${y.length} conferences`})}),p.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,u)=>t.jsx(U,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ne,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:g},l.id))}),t.jsx(te,{conf:s,open:s!==null,onOpenChange:l=>{l||g(null)}})]})};export{ce as default};
|
assets/BenchmarkDetailView-7rgsFTuP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{Z as st,u as at,a0 as it,r as _,j as s,L as Z,a6 as q,m as ct,$ as lt,a as ee}from"./index-D3-tYEe-.js";import{u as te}from"./useQuery-C6S8Ozku.js";import{S as he}from"./skeleton-D0cyB03X.js";import{A as ot,a as ut}from"./alert-Ayuop_ag.js";import{L as ce}from"./LatexTitle-ZrlO0rs7.js";import{I as dt}from"./components-D244J_Aj.js";import{C as mt}from"./ClosedSourceEvalBadge-drWiTHYQ.js";import"./katex.min-BSBacQyE.js";import"./transform-nNAikYlJ.js";function ht(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),t&&(n.href=t),i.href=e,i.href}const ft=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function P(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let O=null;function Ge(e={}){return O||(e.includeStyleProperties?(O=e.includeStyleProperties,O):(O=P(window.getComputedStyle(document.documentElement)),O))}function le(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function pt(e){const t=le(e,"border-left-width"),r=le(e,"border-right-width");return e.clientWidth+t+r}function gt(e){const t=le(e,"border-top-width"),r=le(e,"border-bottom-width");return e.clientHeight+t+r}function Qe(e,t={}){const r=t.width||pt(e),n=t.height||gt(e);return{width:r,height:n}}function yt(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const F=16384;function xt(e){(e.width>F||e.height>F)&&(e.width>F&&e.height>F?e.width>e.height?(e.height*=F/e.width,e.width=F):(e.width*=F/e.height,e.height=F):e.width>F?(e.height*=F/e.width,e.width=F):(e.width*=F/e.height,e.height=F))}function bt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const n=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),i=n.length,a=new Uint8Array(i);for(let c=0;c<i;c+=1)a[c]=n.charCodeAt(c);r(new Blob([a],{type:t.type?t.type:"image/png"}))})}function oe(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function wt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function vt(e,t,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),wt(i)}const M=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||M(r,t)};function jt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function St(e,t){return Ge(t).map(r=>{const n=e.getPropertyValue(r),i=e.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function kt(e,t,r,n){const i=`.${e}:${t}`,a=r.cssText?jt(r):St(r,n);return document.createTextNode(`${i}{${a}}`)}function Ie(e,t,r,n){const i=window.getComputedStyle(e,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const c=ft();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(kt(c,r,i,n)),t.appendChild(l)}function _t(e,t,r){Ie(e,t,":before",r),Ie(e,t,":after",r)}const Pe="application/font-woff",De="image/jpeg",Ct={woff:Pe,woff2:Pe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:De,jpeg:De,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Et(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function be(e){const t=Et(e).toLowerCase();return Ct[t]||""}function Rt(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function $t(e,t){return`data:${t};base64,${e}`}async function Xe(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((a,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{a(r({res:n,result:l.result}))}catch(d){c(d)}},l.readAsDataURL(i)})}const fe={};function Tt(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function we(e,t,r){const n=Tt(e,t,r.includeQueryParams);if(fe[n]!=null)return fe[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Xe(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Rt(l)));i=$t(a,t)}catch(a){i=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;a&&(c=typeof a=="string"?a:a.message),c&&console.warn(c)}return fe[n]=i,i}async function Mt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):oe(t)}async function Ft(e,t){if(e.currentSrc){const a=document.createElement("canvas"),c=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,c==null||c.drawImage(e,0,0,a.width,a.height);const l=a.toDataURL();return oe(l)}const r=e.poster,n=be(r),i=await we(r,n,t);return oe(i)}async function Lt(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await ue(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Nt(e,t){return M(e,HTMLCanvasElement)?Mt(e):M(e,HTMLVideoElement)?Ft(e,t):M(e,HTMLIFrameElement)?Lt(e,t):e.cloneNode(Je(e))}const At=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Je=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function It(e,t,r){var n,i;if(Je(t))return t;let a=[];return At(e)&&e.assignedNodes?a=P(e.assignedNodes()):M(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?a=P(e.contentDocument.body.childNodes):a=P(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||M(e,HTMLVideoElement)||await a.reduce((c,l)=>c.then(()=>ue(l,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function Pt(e,t,r){const n=t.style;if(!n)return;const i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):Ge(r).forEach(a=>{let c=i.getPropertyValue(a);a==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),M(e,HTMLIFrameElement)&&a==="display"&&c==="inline"&&(c="block"),a==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),n.setProperty(a,c,i.getPropertyPriority(a))})}function Dt(e,t){M(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),M(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Bt(e,t){if(M(e,HTMLSelectElement)){const r=t,n=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Ht(e,t,r){return M(t,Element)&&(Pt(e,t,r),_t(e,t,r),Dt(e,t),Bt(e,t)),t}async function Vt(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let a=0;a<r.length;a++){const l=r[a].getAttribute("xlink:href");if(l){const d=e.querySelector(l),y=document.querySelector(l);!d&&y&&!n[l]&&(n[l]=await ue(y,t,!0))}}const i=Object.values(n);if(i.length){const a="http://www.w3.org/1999/xhtml",c=document.createElementNS(a,"svg");c.setAttribute("xmlns",a),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const l=document.createElementNS(a,"defs");c.appendChild(l);for(let d=0;d<i.length;d++)l.appendChild(i[d]);e.appendChild(c)}return e}async function ue(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>Nt(n,t)).then(n=>It(e,n,t)).then(n=>Ht(e,n,t)).then(n=>Vt(n,t))}const Ye=/url\((['"]?)([^'"]+?)\1\)/g,Ut=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Ot=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Wt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function qt(e){const t=[];return e.replace(Ye,(r,n,i)=>(t.push(i),r)),t.filter(r=>!xe(r))}async function zt(e,t,r,n,i){try{const a=r?ht(t,r):t,c=be(t);let l;return i||(l=await we(a,c,n)),e.replace(Wt(t),`$1${l}$3`)}catch{}return e}function Kt(e,{preferredFontFormat:t}){return t?e.replace(Ot,r=>{for(;;){const[n,,i]=Ut.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function Ze(e){return e.search(Ye)!==-1}async function et(e,t,r){if(!Ze(e))return e;const n=Kt(e,r);return qt(n).reduce((a,c)=>a.then(l=>zt(l,c,t,r)),Promise.resolve(n))}async function W(e,t,r){var n;const i=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(i){const a=await et(i,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function Gt(e,t){await W("background",e,t)||await W("background-image",e,t),await W("mask",e,t)||await W("-webkit-mask",e,t)||await W("mask-image",e,t)||await W("-webkit-mask-image",e,t)}async function Qt(e,t){const r=M(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(M(e,SVGImageElement)&&!xe(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,i=await we(n,be(n),t);await new Promise((a,c)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...d)=>{try{a(t.onImageErrorHandler(...d))}catch(y){c(y)}}:c;const l=e;l.decode&&(l.decode=a),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function Xt(e,t){const n=P(e.childNodes).map(i=>tt(i,t));await Promise.all(n).then(()=>e)}async function tt(e,t){M(e,Element)&&(await Gt(e,t),await Qt(e,t),await Xt(e,t))}function Jt(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),e}const Be={};async function He(e){let t=Be[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Be[e]=t,t}async function Ve(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(n,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),Xe(l,t.fetchRequestInit,({result:d})=>(r=r.replace(c,`url(${d})`),[c,d]))});return Promise.all(a).then(()=>r)}function Ue(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=i.exec(n);if(d===null)break;t.push(d[0])}n=n.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let d=a.exec(n);if(d===null){if(d=l.exec(n),d===null)break;a.lastIndex=l.lastIndex}else l.lastIndex=a.lastIndex;t.push(d[0])}return t}async function Yt(e,t){const r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{P(i.cssRules||[]).forEach((a,c)=>{if(a.type===CSSRule.IMPORT_RULE){let l=c+1;const d=a.href,y=He(d).then(m=>Ve(m,t)).then(m=>Ue(m).forEach(p=>{try{i.insertRule(p,p.startsWith("@import")?l+=1:i.cssRules.length)}catch(j){console.error("Error inserting rule from remote css",{rule:p,error:j})}})).catch(m=>{console.error("Error loading remote css",m.toString())});n.push(y)}})}catch(a){const c=e.find(l=>l.href==null)||document.styleSheets[0];i.href!=null&&n.push(He(i.href).then(l=>Ve(l,t)).then(l=>Ue(l).forEach(d=>{c.insertRule(d,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(e.forEach(i=>{if("cssRules"in i)try{P(i.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),r))}function Zt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ze(t.style.getPropertyValue("src")))}async function er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=P(e.ownerDocument.styleSheets),n=await Yt(r,t);return Zt(n)}function rt(e){return e.trim().replace(/["']/g,"")}function tr(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{t.add(rt(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function rr(e,t){const r=await er(e,t),n=tr(e);return(await Promise.all(r.filter(a=>n.has(rt(a.style.fontFamily))).map(a=>{const c=a.parentStyleSheet?a.parentStyleSheet.href:null;return et(a.cssText,c,t)}))).join(`
|
| 2 |
-
`)}async function nr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await rr(e,t);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function sr(e,t={}){const{width:r,height:n}=Qe(e,t),i=await ue(e,t,!0);return await nr(i,t),await tt(i,t),Jt(i,t),await vt(i,r,n)}async function ar(e,t={}){const{width:r,height:n}=Qe(e,t),i=await sr(e,t),a=await oe(i),c=document.createElement("canvas"),l=c.getContext("2d"),d=t.pixelRatio||yt(),y=t.canvasWidth||r,m=t.canvasHeight||n;return c.width=y*d,c.height=m*d,t.skipAutoScale||xt(c),c.style.width=`${y}`,c.style.height=`${m}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(a,0,0,c.width,c.height),c}async function ir(e,t={}){const r=await ar(e,t);return await bt(r)}const Oe="#ffffff";function cr(e){if(typeof window>"u")return Oe;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Oe:t}async function lr(e){var r,n;if(typeof window>"u"||!((n=(r=window.navigator)==null?void 0:r.clipboard)!=null&&n.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await ir(e,{pixelRatio:2,cacheBust:!0,backgroundColor:cr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const pe=5;function or(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const n=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(n==null?void 0:n[1])??null}function ie(e,t){return e?s.jsx(ce,{title:e}):t||"—"}function We(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ye(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function ur(e,t){if(e===t){const{year:d,month:y}=ye(e);return[{timestamp:new Date(d,y,1).getTime(),key:`${d}-${y}`,label:`${ge[y]} ${d}`}]}const r=ye(e),n=ye(t);if(r.year===n.year){const d=n.month-r.month+1;let y=1;const m=12;d>m&&(y=Math.ceil(d/m));const p=[];for(let j=r.month;j<=n.month;j+=y)p.push({timestamp:new Date(r.year,j,1).getTime(),key:`${r.year}-${j}`,label:d<=3?`${ge[j]} ${r.year}`:ge[j]});return p}const i=n.year-r.year+1;let a=1;const c=12;i>c&&(a=Math.ceil(i/c));const l=[];for(let d=r.year;d<=n.year;d+=a)l.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return l}const dr=({points:e,metric:t})=>{const r=lt(),[n,i]=_.useState(null),a=880,c=320,l=60,d=30,y=24,m=50,p=e.map(o=>o.value),j=Math.min(...p),ne=Math.max(...p)-j||1,L=a-l-d,D=c-y-m,z=e.map(o=>We(o.date)),T=Math.min(...z),K=Math.max(...z),V=K-T||1,C=o=>T===K?l+L/2:l+(o-T)/V*L,U=e.map((o,h)=>{const E=C(We(o.date)),R=(o.value-j)/ne,b=y+D*(1-R);return{x:E,y:b,data:o,idx:h}}),x=U.filter(o=>o.data.isSota);let G="";if(x.length>=2){G=`M${x[0].x},${x[0].y}`;for(let o=1;o<x.length;o++){const h=x[o-1],E=x[o],R=(h.x+E.x)/2;G+=` C${R},${h.y} ${R},${E.y} ${E.x},${E.y}`}}const B=ur(T,K),Q=5,X=o=>i(h=>h===o?null:h),se=o=>{o&&r(`/paper/${o}`)},J=(o,h)=>{const R=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${q(o.data.value)} on ${o.data.dateLabel}`,b=!!o.data.paperRouteId;return s.jsxs("g",{children:[h,s.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:b?"pointer":"default",outline:"none"},tabIndex:0,role:b?"link":"img","aria-label":R,onMouseEnter:()=>i(o.idx),onMouseLeave:()=>X(o.idx),onFocus:()=>i(o.idx),onBlur:()=>X(o.idx),onClick:()=>se(o.data.paperRouteId),onKeyDown:w=>{b&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),se(o.data.paperRouteId))},children:s.jsx("title",{children:R})})]},o.idx)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${a} ${c}`,style:{display:"block"},children:[s.jsx("text",{x:l-38,y:y+D/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${y+D/2})`,children:t}),Array.from({length:Q}).map((o,h)=>{const E=h/(Q-1),R=y+D*(1-E),b=j+ne*E;return s.jsxs("g",{children:[s.jsx("line",{x1:l,y1:R,x2:a-d,y2:R,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:l-10,y:R+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:q(b)})]},h)}),B.map(o=>{const h=C(o.timestamp);return s.jsx("text",{x:h,y:c-m+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),U.filter(o=>!o.data.isSota).map(o=>{const h=n===o.idx;return J(o,s.jsx("circle",{cx:o.x,cy:o.y,r:h?4:2.5,fill:"var(--ink-faint)",opacity:h?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),G&&s.jsx("path",{d:G,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),x.map(o=>{const h=n===o.idx;return J(o,s.jsx("circle",{cx:o.x,cy:o.y,r:h?6:4.5,fill:h?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),n!==null&&U[n]&&(()=>{const o=U[n],h=o.data.modelName||o.data.paperTitle||"Unknown model",E=h.length>40?h.slice(0,39)+"…":h,R=`${q(o.data.value)} · ${o.data.dateLabel}`,w=Math.max(140,Math.min(320,Math.max(E.length,R.length)*6.6+24)),N=46;let $=o.x-w/2;$<l&&($=l),$+w>a-d&&($=a-d-w);const Y=o.y-N-14>=y?o.y-N-12:o.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:$,y:Y,width:w,height:N,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),s.jsx("text",{x:$+12,y:Y+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:E}),s.jsx("text",{x:$+12,y:Y+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:R})]})})()]})};function re(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function mr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function hr(e){const t=new Map;for(const r of e){const n=mr(r),i=t.get(n);if(!i){t.set(n,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}i.metrics={...i.metrics,...r.metrics||{}},i.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(i.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function qe(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ze(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function fr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const n=e.map(m=>{var I;const p=re((I=m.metrics)==null?void 0:I[t]),j=m.paper_published_date||"";return{eval:m,value:p,date:j}}).filter(m=>m.value!==null&&!!m.date).sort((m,p)=>m.date.localeCompare(p.date)),i=[];let a=null;for(const m of n){const p=a==null?!0:r==="↓"?m.value<a:m.value>a;p&&(a=m.value),i.push({value:m.value,date:m.date,dateLabel:m.date.slice(0,7),modelName:m.eval.model_name||"",paperTitle:m.eval.paper_title||"",paperRouteId:m.eval.paper_arxiv_id||m.eval.paper_id||null,isSota:p})}const l=e.map(m=>{var p;return{eval:m,value:re((p=m.metrics)==null?void 0:p[t])}}).filter(m=>m.value!==null).sort((m,p)=>r==="↓"?m.value-p.value:p.value-m.value)[0],d=(l==null?void 0:l.value)??0,y=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:i,sota:d,sotaModel:y}}const Ke=({targetRef:e,label:t})=>{const{toast:r}=ct(),[n,i]=_.useState("idle"),a=_.useRef(null);_.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]);const c=_.useCallback(async()=>{const d=e.current;if(d){i("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(y=>window.requestAnimationFrame(()=>y()));try{await lr(d),i("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>i("idle"),1500)}catch(y){i("idle"),r({title:"Copy failed",description:y instanceof Error&&y.message?y.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),l=n==="copied"?"Copied":n==="copying"?"Copying…":"Copy image";return s.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:n==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[s.jsx(dt,{name:"copy",size:11}),l]})},kr=()=>{var ve,je,Se,ke,_e,Ce,Ee,Re,$e,Te;const{datasetSlug:e}=st(),[t]=at(),r=t.get("task")||void 0,n=t.get("eval")||void 0,{preferences:i}=it(),[a,c]=_.useState(void 0),l=_.useRef(null),d=_.useRef(!1),y=_.useRef(null),m=_.useRef(null),p=te({queryKey:["dataset",e,"with-paper"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0}),enabled:!!e,staleTime:10*60*1e3}),j=te({queryKey:["dataset-evals",(ve=p.data)==null?void 0:ve.id],queryFn:()=>ee.getEvaluationsByDataset(p.data.id),enabled:!!((je=p.data)!=null&&je.id),staleTime:5*60*1e3}),I=te({queryKey:["dataset-tasks",(Se=p.data)==null?void 0:Se.id],queryFn:()=>ee.getDatasetTasks(p.data.id),enabled:!!((ke=p.data)!=null&&ke.id),staleTime:10*60*1e3}),ne=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=_.useMemo(()=>{const u=I.data||[];if(u.length===0)return null;if(r){const f=u.find(S=>S.slug===r);if(f)return f.id}if(u.length===1)return u[0].id;const g=j.data||[];if(g.length>0){const f=new Map;for(const v of g)f.set(v.task_id,(f.get(v.task_id)||0)+1);let S=null,k=-1;for(const v of u){const A=f.get(v.id)||0;A>k&&(k=A,S=v.id)}if(S)return S}return u[0].id},[I.data,j.data,r]),D=te({queryKey:["leaderboard-metrics",(_e=p.data)==null?void 0:_e.id,L],queryFn:()=>ee.getLeaderboardMetrics(p.data.id,L),enabled:!!((Ce=p.data)!=null&&Ce.id)&&!!L,staleTime:10*60*1e3}),z=_.useMemo(()=>{let u=j.data||[];return i.hide_closed_source_evals&&(u=u.filter(g=>g.is_open!==!1)),L?u.filter(g=>g.task_id===L):u},[j.data,L,i.hide_closed_source_evals]),T=_.useMemo(()=>hr(z),[z]),K=_.useMemo(()=>{const u=new Set;return T.forEach(g=>{g.best_metric&&u.add(g.best_metric),Object.keys(g.metrics||{}).forEach(f=>u.add(f))}),Array.from(u)},[T]),V=_.useMemo(()=>(D.data||[]).map(u=>u.metric_name),[D.data]),C=V.length?V:K,U=_.useMemo(()=>{var S;if(T.length===0)return C[0]||"";const u=new Map;for(const k of T)for(const v of Object.keys(k.metrics||{}))V.length&&!C.includes(v)||u.set(v,(u.get(v)||0)+1);let g=null,f=0;for(const[k,v]of u)v>f&&(f=v,g=k);return g||C[0]||((S=T[0])==null?void 0:S.best_metric)||""},[T,C,V]),x=a||U,B=(((Re=(Ee=ne.data)==null?void 0:Ee.directions)==null?void 0:Re[x])||"higher_is_better")==="lower_is_better"?"↓":"↑",Q=_.useMemo(()=>{if(C.length===0)return x?[x]:[];if(C.length<=pe)return C;const u=[],g=x&&C.includes(x),f=g?pe-1:pe;let S=0;for(const k of C)k!==x&&(S>=f||(u.push(k),S++));if(g){const k=C.findIndex(A=>A===x),v=C.slice(0,k).filter(A=>u.includes(A)).length;u.splice(v,0,x)}return u},[C,x]),{points:X,sota:se,sotaModel:J}=_.useMemo(()=>fr(T,x,B),[T,x,B]);_.useEffect(()=>{if(d.current||!n||!j.data||j.data.length===0)return;const u=l.current;u&&(d.current=!0,u.scrollIntoView({behavior:"smooth",block:"start"}))},[n,j.data]);const o=_.useMemo(()=>{const u=I.data||[];return L?u.find(g=>g.id===L)||u[0]||null:u[0]||null},[I.data,L]);if(p.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(he,{className:"h-12 w-1/2 mb-6"}),s.jsx(he,{className:"h-64 w-full"})]});if(p.error||!p.data)return s.jsx("div",{className:"page",children:s.jsx(ot,{variant:"destructive",children:s.jsx(ut,{children:"Benchmark not found."})})});const h=p.data,E=T.slice().sort((u,g)=>{var k,v;const f=re((k=u.metrics)==null?void 0:k[x]),S=re((v=g.metrics)==null?void 0:v[x]);return f!==null&&S!==null?B==="↓"?f-S:S-f:f!==null?-1:S!==null?1:ze(u,x)-ze(g,x)}),R=!!h.supports_harness,b=n&&E.find(u=>qe(u,n))||null,w=h.introducing_paper??void 0,N=(w==null?void 0:w.arxiv_id)||(w==null?void 0:w.id)||or(h.paper_url),$=(w==null?void 0:w.title)||h.introducing_paper_title||null,H=(($e=w==null?void 0:w.published)==null?void 0:$e.slice(0,4))||h.introduced_year||null,Y=!!N||!!h.paper_url||!!$,nt=w!=null&&w.arxiv_id||(Te=h.paper_url)!=null&&Te.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${N}`:`Paper ${N}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(Z,{to:"/tasks",children:"Tasks"}),o&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(Z,{to:`/tasks/${o.slug||o.id}`,children:o.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:h.name})]}),s.jsx("h1",{className:"bm-title",children:h.name}),s.jsxs("div",{className:"bm-subtitle",style:{display:"flex",alignItems:"center",gap:16,flexWrap:"wrap"},children:[s.jsxs("span",{children:[x&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:x}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),J?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:q(se)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:J})]}):s.jsxs("span",{children:[E.length," evaluations"]})]}),h.hf_url&&s.jsxs("a",{className:"bm-action-btn",href:h.hf_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),h.description&&s.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:h.description}),Y&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),N?s.jsxs(Z,{to:`/paper/${N}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:$?s.jsx(ce,{title:$}):nt}),H&&s.jsx("span",{className:"method-source-meta",children:H})]}):h.paper_url?s.jsxs("a",{href:h.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:$?s.jsx(ce,{title:$}):h.paper_url}),H&&s.jsx("span",{className:"method-source-meta",children:H})]}):s.jsxs("div",{className:"method-source-link is-static",children:[s.jsx("span",{className:"method-source-title",children:$?s.jsx(ce,{title:$}):null}),H&&s.jsx("span",{className:"method-source-meta",children:H})]})]}),X.filter(u=>u.isSota).length>=2&&s.jsxs("div",{className:"bm-card",ref:y,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:h.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),s.jsxs("div",{className:"bm-card-actions",children:[C.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:x,onChange:u=>c(u.target.value),children:C.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(Ke,{targetRef:y,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(dr,{points:X,metric:x})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),b&&(()=>{var k,v;const u=b.paper_arxiv_id||b.paper_id,g=b.paper_title||(b.paper_arxiv_id?`arXiv:${b.paper_arxiv_id}`:null),f=b.best_metric&&((k=b.metrics)==null?void 0:k[b.best_metric])!==void 0?b.best_metric:x,S=(v=b.metrics)==null?void 0:v[f];return s.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[s.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),s.jsxs("div",{className:"bm-highlight-text",children:[s.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),s.jsxs("span",{className:"bm-highlight-paper",children:[b.model_name||g||"—",b.harness?` · ${b.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&f?s.jsxs(s.Fragment,{children:[f,": ",q(S),g?" · ":""]}):null,u?s.jsx(Z,{to:`/paper/${u}`,children:ie(b.paper_title,g)}):ie(b.paper_title,g)]})]})]})})(),s.jsxs("div",{className:"bm-card",ref:m,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:h.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),s.jsxs("div",{className:"bm-card-actions",children:[C.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:x,onChange:u=>c(u.target.value),children:C.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(Ke,{targetRef:m,label:"leaderboard"})]})]}),j.isLoading?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((u,g)=>s.jsx(he,{className:"h-10 w-full mb-2"},g))}):E.length===0?s.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):s.jsxs("table",{className:"bm-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"col-rank",children:"Rank"}),s.jsx("th",{className:"col-model",children:"Model"}),R&&s.jsx("th",{className:"col-harness",children:"Harness"}),Q.map(u=>{const g=u===x;return s.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?B==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>c(u),"aria-pressed":g,title:`Sort by ${u}`,children:[u,g?` ${B}`:""]})},u)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let u=null,g=0;return E.map((f,S)=>{var Fe,Le;const k=re((Fe=f.metrics)==null?void 0:Fe[x]);let v=null;k!==null&&((u===null||k!==u)&&(g=S+1,u=k),v=g);const A=f.paper_arxiv_id||f.paper_id,Me=f.paper_title||(f.paper_arxiv_id?`arXiv:${f.paper_arxiv_id}`:null),de=qe(f,n);return s.jsxs("tr",{ref:de?l:void 0,className:de?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:v??"—"}),s.jsxs("td",{className:"col-model",children:[de&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),f.model_name||"—",f.is_open===!1&&s.jsx(mt,{})]}),R&&s.jsx("td",{className:"col-harness",children:f.harness||"—"}),Q.map(me=>{var Ae;const Ne=me===x,ae=(Ae=f.metrics)==null?void 0:Ae[me];return s.jsx("td",{className:`col-value${Ne?" is-active":""}${Ne&&v===1?" is-best":""}`,children:ae!=null&&ae!==""?q(ae):"—"},me)}),s.jsx("td",{className:"col-paper",children:A?s.jsx(Z,{to:`/paper/${A}`,children:ie(f.paper_title,Me)}):ie(f.paper_title,Me)}),s.jsx("td",{className:"col-year",children:((Le=f.paper_published_date)==null?void 0:Le.slice(0,4))||"—"})]},f.id)})})()})]})]})]})})};export{kr as default};
|
|
|
|
|
|
|
|
|
assets/BenchmarkDetailView-N3ucOfX1.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{_ as lt,u as ct,a1 as ot,r as C,j as s,L as Z,a7 as X,n as ut,a0 as dt,a as ee}from"./index-M24Hywem.js";import{u as te}from"./useQuery-C6YLWBWB.js";import{S as fe}from"./skeleton-DCGdUtqq.js";import{S as Pe}from"./switch-B1cyrnry.js";import{A as mt,a as ht}from"./alert-0Kui0gCY.js";import{L as le}from"./LatexTitle-C8-B6cG1.js";import{I as ft}from"./components-J9e6gtqw.js";import{C as pt}from"./ClosedSourceEvalBadge-BjrimQbP.js";import"./index-t6Oi9XIP.js";import"./katex.min-BSBacQyE.js";import"./transform-DVq_2bw1.js";function gt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(a),t&&(n.href=t),a.href=e,a.href}const yt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function V(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let G=null;function Xe(e={}){return G||(e.includeStyleProperties?(G=e.includeStyleProperties,G):(G=V(window.getComputedStyle(document.documentElement)),G))}function ce(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function xt(e){const t=ce(e,"border-left-width"),r=ce(e,"border-right-width");return e.clientWidth+t+r}function bt(e){const t=ce(e,"border-top-width"),r=ce(e,"border-bottom-width");return e.clientHeight+t+r}function Je(e,t={}){const r=t.width||xt(e),n=t.height||bt(e);return{width:r,height:n}}function wt(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const F=16384;function vt(e){(e.width>F||e.height>F)&&(e.width>F&&e.height>F?e.width>e.height?(e.height*=F/e.width,e.width=F):(e.width*=F/e.height,e.height=F):e.width>F?(e.height*=F/e.width,e.width=F):(e.width*=F/e.height,e.height=F))}function jt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const n=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=n.length,i=new Uint8Array(a);for(let l=0;l<a;l+=1)i[l]=n.charCodeAt(l);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function oe(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function St(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function kt(e,t,r){const n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),i=document.createElementNS(n,"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),St(a)}const M=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||M(r,t)};function _t(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ct(e,t){return Xe(t).map(r=>{const n=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${n}${a?" !important":""};`}).join(" ")}function Et(e,t,r,n){const a=`.${e}:${t}`,i=r.cssText?_t(r):Ct(r,n);return document.createTextNode(`${a}{${i}}`)}function De(e,t,r,n){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const l=yt();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Et(l,r,a,n)),t.appendChild(c)}function Rt(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const Be="application/font-woff",He="image/jpeg",$t={woff:Be,woff2:Be,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:He,jpeg:He,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Tt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function we(e){const t=Tt(e).toLowerCase();return $t[t]||""}function Mt(e){return e.split(/,/)[1]}function be(e){return e.search(/^(data:)/)!==-1}function Nt(e,t){return`data:${t};base64,${e}`}async function Ye(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const a=await n.blob();return new Promise((i,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:n,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(a)})}const pe={};function Ft(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function ve(e,t,r){const n=Ft(e,t,r.includeQueryParams);if(pe[n]!=null)return pe[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await Ye(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),Mt(c)));a=Nt(i,t)}catch(i){a=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return pe[n]=a,a}async function Lt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):oe(t)}async function At(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const c=i.toDataURL();return oe(c)}const r=e.poster,n=we(r),a=await ve(r,n,t);return oe(a)}async function It(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await ue(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Pt(e,t){return M(e,HTMLCanvasElement)?Lt(e):M(e,HTMLVideoElement)?At(e,t):M(e,HTMLIFrameElement)?It(e,t):e.cloneNode(Ze(e))}const Dt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Bt(e,t,r){var n,a;if(Ze(t))return t;let i=[];return Dt(e)&&e.assignedNodes?i=V(e.assignedNodes()):M(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?i=V(e.contentDocument.body.childNodes):i=V(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||M(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>ue(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function Ht(e,t,r){const n=t.style;if(!n)return;const a=window.getComputedStyle(e);a.cssText?(n.cssText=a.cssText,n.transformOrigin=a.transformOrigin):Xe(r).forEach(i=>{let l=a.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),M(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),n.setProperty(i,l,a.getPropertyPriority(i))})}function Vt(e,t){M(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),M(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Ut(e,t){if(M(e,HTMLSelectElement)){const r=t,n=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));n&&n.setAttribute("selected","")}}function Ot(e,t,r){return M(t,Element)&&(Ht(e,t,r),Rt(e,t,r),Vt(e,t),Ut(e,t)),t}async function Wt(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let i=0;i<r.length;i++){const c=r[i].getAttribute("xlink:href");if(c){const d=e.querySelector(c),p=document.querySelector(c);!d&&p&&!n[c]&&(n[c]=await ue(p,t,!0))}}const a=Object.values(n);if(a.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const c=document.createElementNS(i,"defs");l.appendChild(c);for(let d=0;d<a.length;d++)c.appendChild(a[d]);e.appendChild(l)}return e}async function ue(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>Pt(n,t)).then(n=>Bt(e,n,t)).then(n=>Ot(e,n,t)).then(n=>Wt(n,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,qt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,zt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Kt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Gt(e){const t=[];return e.replace(et,(r,n,a)=>(t.push(a),r)),t.filter(r=>!be(r))}async function Qt(e,t,r,n,a){try{const i=r?gt(t,r):t,l=we(t);let c;return a||(c=await ve(i,l,n)),e.replace(Kt(t),`$1${c}$3`)}catch{}return e}function Xt(e,{preferredFontFormat:t}){return t?e.replace(zt,r=>{for(;;){const[n,,a]=qt.exec(r)||[];if(!a)return"";if(a===t)return`src: ${n};`}}):e}function tt(e){return e.search(et)!==-1}async function rt(e,t,r){if(!tt(e))return e;const n=Xt(e,r);return Gt(n).reduce((i,l)=>i.then(c=>Qt(c,l,t,r)),Promise.resolve(n))}async function Q(e,t,r){var n;const a=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(a){const i=await rt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function Jt(e,t){await Q("background",e,t)||await Q("background-image",e,t),await Q("mask",e,t)||await Q("-webkit-mask",e,t)||await Q("mask-image",e,t)||await Q("-webkit-mask-image",e,t)}async function Yt(e,t){const r=M(e,HTMLImageElement);if(!(r&&!be(e.src))&&!(M(e,SVGImageElement)&&!be(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,a=await ve(n,we(n),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(p){l(p)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function Zt(e,t){const n=V(e.childNodes).map(a=>nt(a,t));await Promise.all(n).then(()=>e)}async function nt(e,t){M(e,Element)&&(await Jt(e,t),await Yt(e,t),await Zt(e,t))}function er(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(a=>{r[a]=n[a]}),e}const Ve={};async function Ue(e){let t=Ve[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Ve[e]=t,t}async function Oe(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(n,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),Ye(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function We(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=a.exec(n);if(d===null)break;t.push(d[0])}n=n.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let d=i.exec(n);if(d===null){if(d=c.exec(n),d===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(d[0])}return t}async function tr(e,t){const r=[],n=[];return e.forEach(a=>{if("cssRules"in a)try{V(a.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const d=i.href,p=Ue(d).then(m=>Oe(m,t)).then(m=>We(m).forEach(w=>{try{a.insertRule(w,w.startsWith("@import")?c+=1:a.cssRules.length)}catch(y){console.error("Error inserting rule from remote css",{rule:w,error:y})}})).catch(m=>{console.error("Error loading remote css",m.toString())});n.push(p)}})}catch(i){const l=e.find(c=>c.href==null)||document.styleSheets[0];a.href!=null&&n.push(Ue(a.href).then(c=>Oe(c,t)).then(c=>We(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(n).then(()=>(e.forEach(a=>{if("cssRules"in a)try{V(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function rr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function nr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=V(e.ownerDocument.styleSheets),n=await tr(r,t);return rr(n)}function st(e){return e.trim().replace(/["']/g,"")}function sr(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(i=>{t.add(st(i))}),Array.from(n.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function ar(e,t){const r=await nr(e,t),n=sr(e);return(await Promise.all(r.filter(i=>n.has(st(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return rt(i.cssText,l,t)}))).join(`
|
| 2 |
+
`)}async function ir(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await ar(e,t);if(r){const n=document.createElement("style"),a=document.createTextNode(r);n.appendChild(a),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function lr(e,t={}){const{width:r,height:n}=Je(e,t),a=await ue(e,t,!0);return await ir(a,t),await nt(a,t),er(a,t),await kt(a,r,n)}async function cr(e,t={}){const{width:r,height:n}=Je(e,t),a=await lr(e,t),i=await oe(a),l=document.createElement("canvas"),c=l.getContext("2d"),d=t.pixelRatio||wt(),p=t.canvasWidth||r,m=t.canvasHeight||n;return l.width=p*d,l.height=m*d,t.skipAutoScale||vt(l),l.style.width=`${p}`,l.style.height=`${m}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function or(e,t={}){const r=await cr(e,t);return await jt(r)}const qe="#ffffff";function ur(e){if(typeof window>"u")return qe;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?qe:t}async function dr(e){var r,n;if(typeof window>"u"||!((n=(r=window.navigator)==null?void 0:r.clipboard)!=null&&n.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await or(e,{pixelRatio:2,cacheBust:!0,backgroundColor:ur(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ge=5;function mr(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const n=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(n==null?void 0:n[1])??null}function ie(e,t){return e?s.jsx(le,{title:e}):t||"—"}function ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const ye=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function hr(e,t){if(e===t){const{year:d,month:p}=xe(e);return[{timestamp:new Date(d,p,1).getTime(),key:`${d}-${p}`,label:`${ye[p]} ${d}`}]}const r=xe(e),n=xe(t);if(r.year===n.year){const d=n.month-r.month+1;let p=1;const m=12;d>m&&(p=Math.ceil(d/m));const w=[];for(let y=r.month;y<=n.month;y+=p)w.push({timestamp:new Date(r.year,y,1).getTime(),key:`${r.year}-${y}`,label:d<=3?`${ye[y]} ${r.year}`:ye[y]});return w}const a=n.year-r.year+1;let i=1;const l=12;a>l&&(i=Math.ceil(a/l));const c=[];for(let d=r.year;d<=n.year;d+=i)c.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return c}const fr=({points:e,metric:t})=>{const r=dt(),[n,a]=C.useState(null),i=880,l=320,c=60,d=30,p=24,m=50,w=e.map(u=>u.value),y=Math.min(...w),U=Math.max(...w)-y||1,ne=i-c-d,T=l-p-m,L=e.map(u=>ze(u.date)),O=Math.min(...L),W=Math.max(...L),A=W-O||1,se=u=>O===W?c+ne/2:c+(u-O)/A*ne,D=e.map((u,x)=>{const R=se(ze(u.date)),g=(u.value-y)/U,N=p+T*(1-g);return{x:R,y:N,data:u,idx:x}}),v=D.filter(u=>u.data.isSota);let q="";if(v.length>=2){q=`M${v[0].x},${v[0].y}`;for(let u=1;u<v.length;u++){const x=v[u-1],R=v[u],g=(x.x+R.x)/2;q+=` C${g},${x.y} ${g},${R.y} ${R.x},${R.y}`}}const b=hr(O,W),de=5,H=u=>a(x=>x===u?null:x),J=u=>{u&&r(`/paper/${u}`)},Y=(u,x)=>{const g=`${u.data.modelName||u.data.paperTitle||"Unknown model"}: ${X(u.data.value)} on ${u.data.dateLabel}`,N=!!u.data.paperRouteId;return s.jsxs("g",{children:[x,s.jsx("circle",{cx:u.x,cy:u.y,r:"10",fill:"transparent",style:{cursor:N?"pointer":"default",outline:"none"},tabIndex:0,role:N?"link":"img","aria-label":g,onMouseEnter:()=>a(u.idx),onMouseLeave:()=>H(u.idx),onFocus:()=>a(u.idx),onBlur:()=>H(u.idx),onClick:()=>J(u.data.paperRouteId),onKeyDown:I=>{N&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),J(u.data.paperRouteId))},children:s.jsx("title",{children:g})})]},u.idx)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[s.jsx("text",{x:c-38,y:p+T/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${p+T/2})`,children:t}),Array.from({length:de}).map((u,x)=>{const R=x/(de-1),g=p+T*(1-R),N=y+U*R;return s.jsxs("g",{children:[s.jsx("line",{x1:c,y1:g,x2:i-d,y2:g,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:c-10,y:g+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:X(N)})]},x)}),b.map(u=>{const x=se(u.timestamp);return s.jsx("text",{x,y:l-m+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:u.label},u.key)}),D.filter(u=>!u.data.isSota).map(u=>{const x=n===u.idx;return Y(u,s.jsx("circle",{cx:u.x,cy:u.y,r:x?4:2.5,fill:"var(--ink-faint)",opacity:x?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),q&&s.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),v.map(u=>{const x=n===u.idx;return Y(u,s.jsx("circle",{cx:u.x,cy:u.y,r:x?6:4.5,fill:x?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),n!==null&&D[n]&&(()=>{const u=D[n],x=u.data.modelName||u.data.paperTitle||"Unknown model",R=x.length>40?x.slice(0,39)+"…":x,g=`${X(u.data.value)} · ${u.data.dateLabel}`,I=Math.max(140,Math.min(320,Math.max(R.length,g.length)*6.6+24)),E=46;let S=u.x-I/2;S<c&&(S=c),S+I>i-d&&(S=i-d-I);const P=u.y-E-14>=p?u.y-E-12:u.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:S,y:P,width:I,height:E,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),s.jsx("text",{x:S+12,y:P+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:R}),s.jsx("text",{x:S+12,y:P+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:g})]})})()]})};function re(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function pr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function gr(e){const t=new Map;for(const r of e){const n=pr(r),a=t.get(n);if(!a){t.set(n,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}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 Ke(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function Ge(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function yr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const n=e.map(m=>{var $;const w=re(($=m.metrics)==null?void 0:$[t]),y=m.paper_published_date||"";return{eval:m,value:w,date:y}}).filter(m=>m.value!==null&&!!m.date).sort((m,w)=>m.date.localeCompare(w.date)),a=[];let i=null;for(const m of n){const w=i==null?!0:r==="↓"?m.value<i:m.value>i;w&&(i=m.value),a.push({value:m.value,date:m.date,dateLabel:m.date.slice(0,7),modelName:m.eval.model_name||"",paperTitle:m.eval.paper_title||"",paperRouteId:m.eval.paper_arxiv_id||m.eval.paper_id||null,isSota:w})}const c=e.map(m=>{var w;return{eval:m,value:re((w=m.metrics)==null?void 0:w[t])}}).filter(m=>m.value!==null).sort((m,w)=>r==="↓"?m.value-w.value:w.value-m.value)[0],d=(c==null?void 0:c.value)??0,p=(c==null?void 0:c.eval.model_name)||(c==null?void 0:c.eval.paper_title)||"";return{points:a,sota:d,sotaModel:p}}const Qe=({targetRef:e,label:t})=>{const{toast:r}=ut(),[n,a]=C.useState("idle"),i=C.useRef(null);C.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=C.useCallback(async()=>{const d=e.current;if(d){a("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await dr(d),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{d.classList.remove("is-capturing")}}},[e,t,r]),c=n==="copied"?"Copied":n==="copying"?"Copying…":"Copy image";return s.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:n==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[s.jsx(ft,{name:"copy",size:11}),c]})},$r=()=>{var je,Se,ke,_e,Ce,Ee,Re,$e,Te,Me;const{datasetSlug:e}=lt(),[t]=ct(),r=t.get("task")||void 0,n=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=ot(),[l,c]=C.useState(void 0),d=C.useRef(null),p=C.useRef(!1),m=C.useRef(null),w=C.useRef(null),y=te({queryKey:["dataset",e,"with-paper"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0}),enabled:!!e,staleTime:10*60*1e3}),$=te({queryKey:["dataset-evals",(je=y.data)==null?void 0:je.id],queryFn:()=>ee.getEvaluationsByDataset(y.data.id),enabled:!!((Se=y.data)!=null&&Se.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(ke=y.data)==null?void 0:ke.id],queryFn:()=>ee.getDatasetTasks(y.data.id),enabled:!!((_e=y.data)!=null&&_e.id),staleTime:10*60*1e3}),ne=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),T=C.useMemo(()=>{var o;return!n||!((o=$.data)!=null&&o.length)?null:$.data.find(f=>f.id===n)||null},[n,$.data]),L=C.useMemo(()=>{const o=U.data||[];if(o.length===0)return null;if(T!=null&&T.task_id&&o.some(h=>h.id===T.task_id))return T.task_id;if(r){const h=o.find(k=>k.slug===r);if(h)return h.id}if(o.length===1)return o[0].id;const f=$.data||[];if(f.length>0){const h=new Map;for(const j of f)h.set(j.task_id,(h.get(j.task_id)||0)+1);let k=null,_=-1;for(const j of o){const B=h.get(j.id)||0;B>_&&(_=B,k=j.id)}if(k)return k}return o[0].id},[U.data,$.data,r,T]),O=te({queryKey:["leaderboard-metrics",(Ce=y.data)==null?void 0:Ce.id,L],queryFn:()=>ee.getLeaderboardMetrics(y.data.id,L),enabled:!!((Ee=y.data)!=null&&Ee.id)&&!!L,staleTime:10*60*1e3}),W=C.useMemo(()=>{let o=$.data||[];return a.hide_closed_source_evals&&(o=o.filter(f=>f.is_open!==!1)),L?o.filter(f=>f.task_id===L):o},[$.data,L,a.hide_closed_source_evals]),A=C.useMemo(()=>gr(W),[W]),se=C.useMemo(()=>{const o=new Set;return A.forEach(f=>{f.best_metric&&o.add(f.best_metric),Object.keys(f.metrics||{}).forEach(h=>o.add(h))}),Array.from(o)},[A]),D=C.useMemo(()=>(O.data||[]).map(o=>o.metric_name),[O.data]),v=D.length?D:se,q=C.useMemo(()=>{var k;if(A.length===0)return v[0]||"";const o=new Map;for(const _ of A)for(const j of Object.keys(_.metrics||{}))D.length&&!v.includes(j)||o.set(j,(o.get(j)||0)+1);let f=null,h=0;for(const[_,j]of o)j>h&&(h=j,f=_);return f||v[0]||((k=A[0])==null?void 0:k.best_metric)||""},[A,v,D]),b=l||(T==null?void 0:T.best_metric)||q,H=((($e=(Re=ne.data)==null?void 0:Re.directions)==null?void 0:$e[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",J=C.useMemo(()=>{if(v.length===0)return b?[b]:[];if(v.length<=ge)return v;const o=[],f=b&&v.includes(b),h=f?ge-1:ge;let k=0;for(const _ of v)_!==b&&(k>=h||(o.push(_),k++));if(f){const _=v.findIndex(B=>B===b),j=v.slice(0,_).filter(B=>o.includes(B)).length;o.splice(j,0,b)}return o},[v,b]),{points:Y,sota:u,sotaModel:x}=C.useMemo(()=>yr(A,b,H),[A,b,H]);C.useEffect(()=>{if(p.current||!n||!$.data||$.data.length===0)return;const o=d.current;o&&(p.current=!0,o.scrollIntoView({behavior:"smooth",block:"start"}))},[n,$.data]);const R=C.useMemo(()=>{const o=U.data||[];return L?o.find(f=>f.id===L)||o[0]||null:o[0]||null},[U.data,L]);if(y.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(fe,{className:"h-12 w-1/2 mb-6"}),s.jsx(fe,{className:"h-64 w-full"})]});if(y.error||!y.data)return s.jsx("div",{className:"page",children:s.jsx(mt,{variant:"destructive",children:s.jsx(ht,{children:"Benchmark not found."})})});const g=y.data,N=A.slice().sort((o,f)=>{var _,j;const h=re((_=o.metrics)==null?void 0:_[b]),k=re((j=f.metrics)==null?void 0:j[b]);return h!==null&&k!==null?H==="↓"?h-k:k-h:h!==null?-1:k!==null?1:Ge(o,b)-Ge(f,b)}),I=!!g.supports_harness,E=n&&N.find(o=>Ke(o,n))||null,S=g.introducing_paper??void 0,z=(S==null?void 0:S.arxiv_id)||(S==null?void 0:S.id)||mr(g.paper_url),P=(S==null?void 0:S.title)||g.introducing_paper_title||null,K=((Te=S==null?void 0:S.published)==null?void 0:Te.slice(0,4))||g.introduced_year||null,at=!!z||!!g.paper_url||!!P,it=S!=null&&S.arxiv_id||(Me=g.paper_url)!=null&&Me.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${z}`:`Paper ${z}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(Z,{to:"/tasks",children:"Tasks"}),R&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(Z,{to:`/tasks/${R.slug||R.id}`,children:R.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:g.name})]}),s.jsx("h1",{className:"bm-title",children:g.name}),s.jsxs("div",{className:"bm-subtitle",style:{display:"flex",alignItems:"center",gap:16,flexWrap:"wrap"},children:[s.jsxs("span",{children:[b&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:b}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),x?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:X(u)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:x})]}):s.jsxs("span",{children:[N.length," evaluations"]})]}),g.hf_url&&s.jsxs("a",{className:"bm-action-btn",href:g.hf_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),g.description&&s.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:g.description}),at&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),z?s.jsxs(Z,{to:`/paper/${z}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:P?s.jsx(le,{title:P}):it}),K&&s.jsx("span",{className:"method-source-meta",children:K})]}):g.paper_url?s.jsxs("a",{href:g.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:P?s.jsx(le,{title:P}):g.paper_url}),K&&s.jsx("span",{className:"method-source-meta",children:K})]}):s.jsxs("div",{className:"method-source-link is-static",children:[s.jsx("span",{className:"method-source-title",children:P?s.jsx(le,{title:P}):null}),K&&s.jsx("span",{className:"method-source-meta",children:K})]})]}),Y.filter(o=>o.isSota).length>=2&&s.jsxs("div",{className:"bm-card",ref:m,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:g.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),s.jsxs("div",{className:"bm-card-actions",children:[v.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:b,onChange:o=>c(o.target.value),children:v.map(o=>s.jsx("option",{value:o,children:o},o))})]}),s.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[s.jsx(Pe,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:o=>{i(!o)},"aria-label":"Show closed-source models"}),s.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),s.jsx(Qe,{targetRef:m,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(fr,{points:Y,metric:b})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),E&&(()=>{var _,j;const o=E.paper_arxiv_id||E.paper_id,f=E.paper_title||(E.paper_arxiv_id?`arXiv:${E.paper_arxiv_id}`:null),h=E.best_metric&&((_=E.metrics)==null?void 0:_[E.best_metric])!==void 0?E.best_metric:b,k=(j=E.metrics)==null?void 0:j[h];return s.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[s.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),s.jsxs("div",{className:"bm-highlight-text",children:[s.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),s.jsxs("span",{className:"bm-highlight-paper",children:[E.model_name||f||"—",E.harness?` · ${E.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[k!==void 0&&h?s.jsxs(s.Fragment,{children:[h,": ",X(k),f?" · ":""]}):null,o?s.jsx(Z,{to:`/paper/${o}`,children:ie(E.paper_title,f)}):ie(E.paper_title,f)]})]})]})})(),s.jsxs("div",{className:"bm-card",ref:w,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:g.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),s.jsxs("div",{className:"bm-card-actions",children:[v.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:b,onChange:o=>c(o.target.value),children:v.map(o=>s.jsx("option",{value:o,children:o},o))})]}),s.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[s.jsx(Pe,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:o=>{i(!o)},"aria-label":"Show closed-source models"}),s.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),s.jsx(Qe,{targetRef:w,label:"leaderboard"})]})]}),$.isLoading?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((o,f)=>s.jsx(fe,{className:"h-10 w-full mb-2"},f))}):N.length===0?s.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):s.jsx("div",{className:"bm-table-scroll",children:s.jsxs("table",{className:"bm-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"col-rank",children:"Rank"}),s.jsx("th",{className:"col-model",children:"Model"}),I&&s.jsx("th",{className:"col-harness",children:"Harness"}),J.map(o=>{const f=o===b;return s.jsx("th",{className:`col-value ${f?"is-active":""}`,"aria-sort":f?H==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>c(o),"aria-pressed":f,title:`Sort by ${o}`,children:[o,f?` ${H}`:""]})},o)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let o=null,f=0;return N.map((h,k)=>{var Fe,Le;const _=re((Fe=h.metrics)==null?void 0:Fe[b]);let j=null;_!==null&&((o===null||_!==o)&&(f=k+1,o=_),j=f);const B=h.paper_arxiv_id||h.paper_id,Ne=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),me=Ke(h,n);return s.jsxs("tr",{ref:me?d:void 0,className:me?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:j??"—"}),s.jsxs("td",{className:"col-model",children:[me&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.model_name||"—",h.is_open===!1&&s.jsx(pt,{})]}),I&&s.jsx("td",{className:"col-harness",children:h.harness||"—"}),J.map(he=>{var Ie;const Ae=he===b,ae=(Ie=h.metrics)==null?void 0:Ie[he];return s.jsx("td",{className:`col-value${Ae?" is-active":""}${Ae&&j===1?" is-best":""}`,children:ae!=null&&ae!==""?X(ae):"—"},he)}),s.jsx("td",{className:"col-paper",children:B?s.jsx(Z,{to:`/paper/${B}`,children:ie(h.paper_title,Ne)}):ie(h.paper_title,Ne)}),s.jsx("td",{className:"col-year",children:((Le=h.paper_published_date)==null?void 0:Le.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{$r as default};
|
assets/ClosedSourceEvalBadge-BjrimQbP.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as a,d as F,j as n,R as I,B as U,b as B,f as d,D as y,P as H,E as $,i as W,e as z,J as K,K as G,M as J,k as V,L as Y}from"./index-M24Hywem.js";var E,R="HoverCard",[N]=W(R,[y]),w=y(),[q,S]=N(R),O=e=>{const{__scopeHoverCard:t,children:r,open:i,defaultOpen:s,onOpenChange:c,openDelay:f=700,closeDelay:v=300}=e,l=w(t),C=a.useRef(0),u=a.useRef(0),h=a.useRef(!1),p=a.useRef(!1),[m,o]=F({prop:i,defaultProp:s??!1,onChange:c,caller:R}),x=a.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>o(!0),f)},[f,o]),g=a.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>o(!1),v))},[v,o]),M=a.useCallback(()=>o(!1),[o]);return a.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),n.jsx(q,{scope:t,open:m,onOpenChange:o,onOpen:x,onClose:g,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:n.jsx(I,{...l,children:r})})};O.displayName=R;var D="HoverCardTrigger",_=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,...i}=e,s=S(D,r),c=w(r);return n.jsx(U,{asChild:!0,...c,children:n.jsx(B.a,{"data-state":s.open?"open":"closed",...i,ref:t,onPointerEnter:d(e.onPointerEnter,b(s.onOpen)),onPointerLeave:d(e.onPointerLeave,b(s.onClose)),onFocus:d(e.onFocus,s.onOpen),onBlur:d(e.onBlur,s.onClose),onTouchStart:d(e.onTouchStart,f=>f.preventDefault())})})});_.displayName=D;var T="HoverCardPortal",[Q,X]=N(T,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:t,forceMount:r,children:i,container:s}=e,c=S(T,t);return n.jsx(Q,{scope:t,forceMount:r,children:n.jsx(H,{present:r||c.open,children:n.jsx($,{asChild:!0,container:s,children:i})})})};j.displayName=T;var P="HoverCardContent",A=a.forwardRef((e,t)=>{const r=X(P,e.__scopeHoverCard),{forceMount:i=r.forceMount,...s}=e,c=S(P,e.__scopeHoverCard);return n.jsx(H,{present:i||c.open,children:n.jsx(Z,{"data-state":c.open?"open":"closed",...s,onPointerEnter:d(e.onPointerEnter,b(c.onOpen)),onPointerLeave:d(e.onPointerLeave,b(c.onClose)),ref:t})})});A.displayName=P;var Z=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:f,...v}=e,l=S(P,r),C=w(r),u=a.useRef(null),h=z(t,u),[p,m]=a.useState(!1);return a.useEffect(()=>{if(p){const o=document.body;return E=o.style.userSelect||o.style.webkitUserSelect,o.style.userSelect="none",o.style.webkitUserSelect="none",()=>{o.style.userSelect=E,o.style.webkitUserSelect=E}}},[p]),a.useEffect(()=>{if(u.current){const o=()=>{m(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var g;((g=document.getSelection())==null?void 0:g.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",o),()=>{document.removeEventListener("pointerup",o),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),a.useEffect(()=>{u.current&&te(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),n.jsx(K,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d(c,o=>{o.preventDefault()}),onDismiss:l.onDismiss,children:n.jsx(G,{...C,...v,onPointerDown:d(v.onPointerDown,o=>{o.currentTarget.contains(o.target)&&m(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),ee="HoverCardArrow",oe=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,...i}=e,s=w(r);return n.jsx(J,{...s,...i,ref:t})});oe.displayName=ee;function b(e){return t=>t.pointerType==="touch"?void 0:e()}function te(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)t.push(r.currentNode);return t}var re=O,ne=_,ae=j,L=A;const se=re,ie=ne,k=a.forwardRef(({className:e,align:t="center",sideOffset:r=4,...i},s)=>n.jsx(ae,{children:n.jsx(L,{ref:s,align:t,sideOffset:r,className:V("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}));k.displayName=L.displayName;const le=()=>n.jsxs(se,{openDelay:120,closeDelay:120,children:[n.jsx(ie,{asChild:!0,children:n.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),n.jsxs(k,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",n.jsx(Y,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});export{le as C};
|
assets/ClosedSourceEvalBadge-drWiTHYQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as a,d as F,j as n,R as I,A as U,b as B,f as d,z as H,P as y,B as $,i as z,e as W,H as G,I as K,J,k as V,L as Y}from"./index-D3-tYEe-.js";var E,R="HoverCard",[N]=z(R,[H]),w=H(),[q,S]=N(R),O=e=>{const{__scopeHoverCard:t,children:r,open:i,defaultOpen:s,onOpenChange:c,openDelay:f=700,closeDelay:v=300}=e,l=w(t),C=a.useRef(0),u=a.useRef(0),h=a.useRef(!1),p=a.useRef(!1),[m,o]=F({prop:i,defaultProp:s??!1,onChange:c,caller:R}),x=a.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>o(!0),f)},[f,o]),g=a.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>o(!1),v))},[v,o]),M=a.useCallback(()=>o(!1),[o]);return a.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),n.jsx(q,{scope:t,open:m,onOpenChange:o,onOpen:x,onClose:g,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:n.jsx(I,{...l,children:r})})};O.displayName=R;var _="HoverCardTrigger",j=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,...i}=e,s=S(_,r),c=w(r);return n.jsx(U,{asChild:!0,...c,children:n.jsx(B.a,{"data-state":s.open?"open":"closed",...i,ref:t,onPointerEnter:d(e.onPointerEnter,b(s.onOpen)),onPointerLeave:d(e.onPointerLeave,b(s.onClose)),onFocus:d(e.onFocus,s.onOpen),onBlur:d(e.onBlur,s.onClose),onTouchStart:d(e.onTouchStart,f=>f.preventDefault())})})});j.displayName=_;var T="HoverCardPortal",[Q,X]=N(T,{forceMount:void 0}),D=e=>{const{__scopeHoverCard:t,forceMount:r,children:i,container:s}=e,c=S(T,t);return n.jsx(Q,{scope:t,forceMount:r,children:n.jsx(y,{present:r||c.open,children:n.jsx($,{asChild:!0,container:s,children:i})})})};D.displayName=T;var P="HoverCardContent",A=a.forwardRef((e,t)=>{const r=X(P,e.__scopeHoverCard),{forceMount:i=r.forceMount,...s}=e,c=S(P,e.__scopeHoverCard);return n.jsx(y,{present:i||c.open,children:n.jsx(Z,{"data-state":c.open?"open":"closed",...s,onPointerEnter:d(e.onPointerEnter,b(c.onOpen)),onPointerLeave:d(e.onPointerLeave,b(c.onClose)),ref:t})})});A.displayName=P;var Z=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:f,...v}=e,l=S(P,r),C=w(r),u=a.useRef(null),h=W(t,u),[p,m]=a.useState(!1);return a.useEffect(()=>{if(p){const o=document.body;return E=o.style.userSelect||o.style.webkitUserSelect,o.style.userSelect="none",o.style.webkitUserSelect="none",()=>{o.style.userSelect=E,o.style.webkitUserSelect=E}}},[p]),a.useEffect(()=>{if(u.current){const o=()=>{m(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var g;((g=document.getSelection())==null?void 0:g.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",o),()=>{document.removeEventListener("pointerup",o),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),a.useEffect(()=>{u.current&&te(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),n.jsx(G,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d(c,o=>{o.preventDefault()}),onDismiss:l.onDismiss,children:n.jsx(K,{...C,...v,onPointerDown:d(v.onPointerDown,o=>{o.currentTarget.contains(o.target)&&m(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),ee="HoverCardArrow",oe=a.forwardRef((e,t)=>{const{__scopeHoverCard:r,...i}=e,s=w(r);return n.jsx(J,{...s,...i,ref:t})});oe.displayName=ee;function b(e){return t=>t.pointerType==="touch"?void 0:e()}function te(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)t.push(r.currentNode);return t}var re=O,ne=j,ae=D,L=A;const se=re,ie=ne,k=a.forwardRef(({className:e,align:t="center",sideOffset:r=4,...i},s)=>n.jsx(ae,{children:n.jsx(L,{ref:s,align:t,sideOffset:r,className:V("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}));k.displayName=L.displayName;const le=()=>n.jsxs(se,{openDelay:120,closeDelay:120,children:[n.jsx(ie,{asChild:!0,children:n.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),n.jsxs(k,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",n.jsx(Y,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});export{le as C};
|
|
|
|
|
|
assets/{ConferenceDetailView-CDP-HF34.js → ConferenceDetailView-SPyKy7dS.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{_ as L,r as D,j as e,L as p,a as C}from"./index-M24Hywem.js";import{u as T}from"./useQuery-C6YLWBWB.js";import{M as F}from"./MarkdownText-BjEj6m-s.js";import{e as B,h as A,d as E}from"./transform-DVq_2bw1.js";import{S as f}from"./skeleton-DCGdUtqq.js";import{A as P,a as z}from"./alert-0Kui0gCY.js";import"./katex.min-BSBacQyE.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},H=()=>{var k,S,_,b,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((_=t.data)==null?void 0:_.oral_paper_count)??0,g=((b=t.data)==null?void 0:b.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{H as default};
|
assets/{ConferenceTaskView-B_-EGfGK.js → ConferenceTaskView-yT-uFLih.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{_ as H,u as K,r as h,j as e,L as P,W as V,a as L}from"./index-M24Hywem.js";import{u as E}from"./useQuery-C6YLWBWB.js";import{P as $}from"./components-J9e6gtqw.js";import{M as u}from"./MarkdownText-BjEj6m-s.js";import{t as W,d as D}from"./transform-DVq_2bw1.js";import{c as U}from"./usePapers-DAX-IssB.js";import{u as G}from"./useIntersectionObserver-Bk74NMqD.js";import{S as J}from"./skeleton-DCGdUtqq.js";import{A as X,a as Y}from"./alert-0Kui0gCY.js";import"./LatexTitle-C8-B6cG1.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-D8U4M_OT.js";const Z=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ge=()=>{var w,F,R,T,A,B;const{confSlug:a,taskSlug:r}=H(),[v,M]=K(),y=ee(v.get("order_by")),q=n=>{const s=new URLSearchParams(v);s.set("order_by",n),M(s)},b=r==="all",x=r==="oral",f=r==="spotlight",d=r==="outstanding",c=r==="best-paper-finalists",_=d||c,l=b||x||f||d||c,z=l?void 0:r,I=x?"oral":f?"spotlight":d?"outstanding":c?"best_paper_finalist":void 0,p=E({queryKey:["conference",a],queryFn:()=>L.getConference(a),enabled:!!a,staleTime:10*60*1e3}),g=E({queryKey:["task",r],queryFn:()=>L.getTask(r),enabled:!!r&&!l,staleTime:10*60*1e3}),i=U({conferenceSlug:a||"",taskSlug:z,presentation:I,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,enabled:!!a}),{targetRef:Q,isIntersecting:S}=G({rootMargin:"200px"});h.useEffect(()=>{S&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[S,i.hasNextPage,i.isFetchingNextPage]),h.useEffect(()=>{window.scrollTo(0,0)},[a,r]);const j=h.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),N=h.useMemo(()=>j.map(W),[j]),m=b?"All papers":x?"Oral papers":f?"Spotlight papers":d?"Outstanding papers":c?"Best paper finalists":D(((w=g.data)==null?void 0:w.name)||r||"",((F=g.data)==null?void 0:F.slug)||r),k=((T=(R=i.data)==null?void 0:R.pages[0])==null?void 0:T.count)??((A=p.data)==null?void 0:A.paper_count)??0,t=g.data;return p.error||g.error||i.error?e.jsx("div",{className:"page",children:e.jsx(X,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(P,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(P,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(P,{to:`/conferences/${a}`,children:((B=p.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:m})]}),e.jsxs("div",{className:!l&&(t!=null&&t.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:l?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:m}),d&&e.jsx(u,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),c&&a==="cvpr-2026"&&e.jsx(u,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!l&&(t==null?void 0:t.description)&&e.jsx(u,{className:"task-explainer",text:t.description}),p.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:k.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:p.data.name})]})]}),!l&&(t==null?void 0:t.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:t.image_url,alt:`${m} schematic`,onError:n=>{var s,o;(o=(s=n.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",m,t.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(u,{className:"task-image-credit",text:t.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:_?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",k.toLocaleString(),"]"]})]})]}),!_&&e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:Z.map(([n,s])=>e.jsx("button",{className:`sort-btn ${y===n?"active":""}`,onClick:()=>q(n),children:s},n))}),e.jsxs("div",{className:"results-count",children:[N.length," loaded in ",e.jsx("span",{children:m})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((n,s)=>e.jsx(J,{className:"h-40 w-full"},s))}):N.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((n,s)=>{var O;const o=(O=j[s])==null?void 0:O.conference_award,C=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!c?"Best Paper Finalist":null;return e.jsxs(V.Fragment,{children:[C&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:C}),e.jsx($,{paper:n,rank:s+1})]},n.id)})}),e.jsx("div",{ref:Q,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ge as default};
|
assets/{ConferencesIndexView-D5iEQ6eX.js → ConferencesIndexView-BuCJOh2P.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as m,j as e,L as u,a as p}from"./index-
|
|
|
|
| 1 |
+
import{r as m,j as e,L as u,a as p}from"./index-M24Hywem.js";import{u as h}from"./useQuery-C6YLWBWB.js";import{S as d}from"./skeleton-DCGdUtqq.js";import{A as g,a as f}from"./alert-0Kui0gCY.js";const x=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=n?new Date(`${n}T00:00:00`):null,a=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${a(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${a(t)} – ${a(s)}, ${i}`:`${a(t)}, ${i}`},j=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},v=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},y={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},S=()=>{const r=h({queryKey:["conferences"],queryFn:()=>p.getConferences(),staleTime:6e5}),n=m.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(a=>{const i=j(a);(t[i]||(t[i]=[])).push(a)}),Object.values(t).forEach(a=>a.sort(v)),Object.keys(t).map(Number).sort((a,i)=>i-a).map(a=>({year:a,conferences:t[a]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(f,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(d,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((a,i)=>e.jsx(d,{className:"h-32"},i))})]},s))}):n==null?void 0:n.map(({year:t,conferences:s})=>{const a=s.reduce((l,o)=>l+(o.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:y,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",a.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:s.map(l=>{const o=x(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(u,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)})})]},t)})]})};export{S as default};
|
assets/{CronDashboard-Cn-U_X_P.js → CronDashboard-CbRwUMmP.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as p,r as l,j as e,k as w,
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
@@ -38,4 +38,4 @@ import{c as p,r as l,j as e,k as w,U as V,ag as Z,ah as G,Y as ee}from"./index-D
|
|
| 38 |
*
|
| 39 |
* This source code is licensed under the ISC license.
|
| 40 |
* See the LICENSE file in the root directory of this source tree.
|
| 41 |
-
*/const oe=p("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),o=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));o.displayName="Card";const j=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex flex-col space-y-1.5 p-6",s),...a}));j.displayName="CardHeader";const y=l.forwardRef(({className:s,...a},n)=>e.jsx("h3",{ref:n,className:w("text-2xl font-semibold leading-none tracking-tight",s),...a}));y.displayName="CardTitle";const P=l.forwardRef(({className:s,...a},n)=>e.jsx("p",{ref:n,className:w("text-sm text-muted-foreground",s),...a}));P.displayName="CardDescription";const d=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("p-6 pt-0",s),...a}));d.displayName="CardContent";const de=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex items-center p-6 pt-0",s),...a}));de.displayName="CardFooter";const me=async s=>{const a=s?{"X-Admin-Token":s}:{},n=await fetch(ee("/api/v1/cron/status"),{headers:a,credentials:"include"});if(n.status===401)throw new Error("Unauthorized. Sign in with Hugging Face or paste a valid admin token.");if(!n.ok)throw new Error("Failed to fetch cron status");return n.json()},q=()=>G(),xe=({status:s,isRunning:a})=>{if(a)return e.jsx(M,{className:"h-5 w-5 text-blue-500 animate-spin"});switch(s){case"success":return e.jsx(L,{className:"h-5 w-5 text-green-500"});case"success_no_work":return e.jsx(L,{className:"h-5 w-5 text-yellow-500"});case"failed":return e.jsx(B,{className:"h-5 w-5 text-red-500"});case"running":return e.jsx(M,{className:"h-5 w-5 text-blue-500 animate-spin"});default:return e.jsx(le,{className:"h-5 w-5 text-gray-400"})}},he=({status:s,isRunning:a})=>{if(a)return e.jsx(N,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300",children:"Running"});switch(s){case"success":return e.jsx(N,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300",children:"Success"});case"success_no_work":return e.jsx(N,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-300",children:"Success (No Work)"});case"failed":return e.jsx(N,{variant:"outline",className:"bg-red-50 text-red-700 border-red-300",children:"Failed"});default:return e.jsx(N,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-300",children:"Unknown"})}},ue=s=>s.replace(/_/g," ").split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),I=s=>{if(!s)return"Never";try{const a=new Date(s),m=new Date().getTime()-a.getTime(),i=Math.floor(m/6e4),f=Math.floor(m/36e5),h=Math.floor(m/864e5);return i<1?"Just now":i<60?`${i}m ago`:f<24?`${f}h ago`:h<7?`${h}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},ge=s=>{if(!s)return"Not scheduled";try{const a=new Date(s),n=new Date,m=a.getTime()-n.getTime(),i=Math.floor(m/6e4),f=Math.floor(m/36e5),h=Math.floor(m/864e5);return m<0?"Overdue":i<1?"Just now":i<60?`in ${i}m`:f<24?`in ${f}h`:h<7?`in ${h}d`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},fe=s=>s?s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`:"N/A",pe={hourly:"bg-blue-100 text-blue-800 border-blue-200",daily:"bg-purple-100 text-purple-800 border-purple-200",weekly:"bg-orange-100 text-orange-800 border-orange-200",monthly:"bg-pink-100 text-pink-800 border-pink-200"},ke=()=>{const[s,a]=l.useState(!0),[n,m]=l.useState(new Set),[i,f]=l.useState(()=>q()),[h,A]=l.useState(()=>q()),[_,D]=l.useState(!1),{user:u}=V(),S=!!(u!=null&&u.is_admin);l.useEffect(()=>{Z(i)},[i]),l.useEffect(()=>{if(!_)return;const r=window.setTimeout(()=>D(!1),2e3);return()=>window.clearTimeout(r)},[_]);const W=()=>{f(h.trim()),D(!0)},H=()=>{A(""),f("")},g=S||i.trim().length>0,{data:c,isLoading:X,isFetching:$,error:T,refetch:Y}=se({queryKey:["cronStatus",S?`hf:${u==null?void 0:u.username}`:i],queryFn:()=>me(i.trim()),enabled:g,refetchInterval:g&&s?3e4:!1,retry:!1}),v=T instanceof Error?T.message:void 0,E=r=>{m(t=>{const x=new Set(t);return x.has(r)?x.delete(r):x.add(r),x})},k=(c==null?void 0:c.jobs.reduce((r,t)=>(r[t.category]||(r[t.category]=[]),r[t.category].push(t),r),{}))||{},O=Object.keys(k).sort((r,t)=>{const x=["hourly","daily","weekly","monthly"];return x.indexOf(r)-x.indexOf(t)}),K=r=>r>=80?"text-green-600":r>=60?"text-yellow-600":"text-red-600";return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold text-gray-900 flex items-center gap-3",children:[e.jsx(R,{className:"h-8 w-8 text-blue-600"}),"CRON Job Dashboard"]}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Monitor and manage automated tasks"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>a(!s),disabled:!g,className:`${s?"border-blue-500 text-blue-600":""} ${g?"":"opacity-60 cursor-not-allowed"}`,children:[e.jsx(z,{className:`h-4 w-4 mr-2 ${s&&g?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>Y(),disabled:!g||$,children:[e.jsx(z,{className:`h-4 w-4 mr-2 ${$?"animate-spin":""}`}),"Refresh"]})]})]})}),S?e.jsx(o,{className:"mb-6",children:e.jsx(d,{className:"pt-6",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",u==null?void 0:u.username]}),". Your admin permissions are derived from the ",e.jsx("code",{className:"font-mono",children:"PWC_ADMIN_HF_USERNAMES"})," ","allowlist; CRON metrics will refresh automatically."]})})}):e.jsx(o,{className:"mb-6",children:e.jsxs(d,{className:"pt-6 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-800",children:"Admin token"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Sign in with Hugging Face from the header for the easiest path. Otherwise, paste your admin token here. The token is stored locally in this browser and sent with requests as the ",e.jsx("code",{className:"font-mono",children:"X-Admin-Token"})," header."]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 w-full md:w-auto",children:[e.jsx(ae,{type:"password",placeholder:"Enter admin token",value:h,onChange:r=>A(r.target.value),className:"sm:w-64"}),e.jsx(b,{size:"sm",onClick:W,disabled:!h.trim(),children:"Apply token"}),i&&e.jsx(b,{variant:"ghost",size:"sm",onClick:H,children:"Clear"})]})]}),_&&e.jsx("p",{className:"text-xs text-green-600",children:"Token saved. Future requests will automatically include it."}),e.jsx("p",{className:`text-xs ${g?"text-gray-500":"text-blue-700"}`,children:g?"Token stored locally in this browser. Clear it when you are finished on shared devices.":"Enter your admin token above (or sign in with Hugging Face) to enable CRON job monitoring."})]})}),X&&g&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(M,{className:"h-8 w-8 animate-spin text-blue-500"}),e.jsx("span",{className:"ml-3 text-gray-600",children:"Loading CRON jobs status..."})]}),T&&e.jsx(o,{className:"border-red-200 bg-red-50",children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col gap-3 text-red-800",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"h-5 w-5"}),e.jsx("p",{children:v??"Failed to load CRON jobs status. Please try again."})]}),(v==null?void 0:v.toLowerCase().includes("unauthorized"))&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:H,children:"Clear saved token"}),e.jsx("span",{className:"text-sm text-red-700",children:"Re-enter your admin token to continue."})]})]})})}),c&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 mb-8",children:[e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Total Jobs"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold",children:c.summary.total_jobs})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Successful"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:c.summary.success})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Failed"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-red-600",children:c.summary.failed})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Running"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:c.summary.running})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Health Score"})}),e.jsx(d,{children:e.jsxs("div",{className:`text-2xl font-bold ${K(c.summary.health_score)}`,children:[c.summary.health_score.toFixed(0),"%"]})})]})]}),e.jsxs("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-2",children:[e.jsx(J,{className:"h-4 w-4"}),"Last updated: ",I(c.timestamp)]}),e.jsx("div",{className:"space-y-6",children:O.map(r=>e.jsxs(o,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(N,{className:pe[r],children:r}),e.jsxs("span",{className:"text-gray-700",children:[r," Jobs"]})]}),e.jsxs(P,{children:[k[r].length," job",k[r].length!==1?"s":""]})]})}),e.jsx(d,{children:e.jsx("div",{className:"space-y-4",children:k[r].map(t=>{const x=n.has(t.job_name),U=t.work_metrics&&Object.keys(t.work_metrics).length>0;return e.jsxs("div",{className:"border rounded-lg overflow-hidden transition-all",children:[e.jsx("div",{className:"p-4 hover:bg-gray-50 transition-colors cursor-pointer",onClick:()=>E(t.job_name),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx(xe,{status:t.status,isRunning:t.is_running}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:ue(t.job_name)}),U&&e.jsx("button",{className:"text-gray-400 hover:text-gray-600 transition-colors",onClick:C=>{C.stopPropagation(),E(t.job_name)},children:x?e.jsx(ie,{className:"h-4 w-4"}):e.jsx(ne,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(J,{className:"h-4 w-4"}),e.jsxs("span",{children:["Last: ",I(t.last_run)]})]}),t.duration!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsxs("span",{children:["Duration: ",fe(t.duration)]})]}),t.schedule&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"h-4 w-4"}),e.jsx("span",{className:"font-mono text-xs",children:t.schedule})]}),t.next_run&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsxs("span",{children:["Next: ",ge(t.next_run)]})]})]}),t.work_summary&&e.jsxs("div",{className:"mt-2 text-sm text-gray-600 bg-gray-100 rounded px-2 py-1 flex items-center gap-1",children:[e.jsx(ce,{className:"h-3 w-3"}),e.jsx("span",{children:t.work_summary})]}),t.error&&e.jsxs("div",{className:"mt-2 text-sm text-red-600 bg-red-50 rounded px-2 py-1",children:[e.jsx("span",{className:"font-semibold",children:"Error: "}),t.error]})]})]}),e.jsx(he,{status:t.status,isRunning:t.is_running})]})}),x&&U&&e.jsxs("div",{className:"border-t bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(te,{className:"h-4 w-4 text-gray-600"}),e.jsx("h4",{className:"font-semibold text-gray-700",children:"Work Metrics"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Object.entries(t.work_metrics).map(([C,F])=>e.jsxs("div",{className:"bg-white rounded border border-gray-200 p-3",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-1",children:C.replace(/_/g," ").replace(/\b\w/g,Q=>Q.toUpperCase())}),e.jsx("div",{className:"text-lg font-semibold text-gray-900",children:typeof F=="number"?F.toLocaleString():F})]},C))})]})]},t.job_name)})})})]},r))}),O.length===0&&e.jsx(o,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center text-gray-500 py-12",children:[e.jsx(R,{className:"h-12 w-12 mx-auto mb-4 text-gray-400"}),e.jsx("p",{children:"No CRON jobs found"})]})})})]})]})})};export{ke as default};
|
|
|
|
| 1 |
+
import{c as p,r as l,j as e,k as w,V as Q,ag as Y,ah as G,Z as ee}from"./index-M24Hywem.js";import{u as se}from"./useQuery-C6YLWBWB.js";import{B as N,D as te}from"./badge-DZWw7QDg.js";import{B as b,I as ae}from"./input-CpJZsE-m.js";import{R as L,C as B,a as U}from"./refresh-cw-CcmPDWxW.js";import{L as M}from"./loader-circle-2lEq4cac.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 38 |
*
|
| 39 |
* This source code is licensed under the ISC license.
|
| 40 |
* See the LICENSE file in the root directory of this source tree.
|
| 41 |
+
*/const oe=p("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),o=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));o.displayName="Card";const j=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex flex-col space-y-1.5 p-6",s),...a}));j.displayName="CardHeader";const y=l.forwardRef(({className:s,...a},n)=>e.jsx("h3",{ref:n,className:w("text-2xl font-semibold leading-none tracking-tight",s),...a}));y.displayName="CardTitle";const P=l.forwardRef(({className:s,...a},n)=>e.jsx("p",{ref:n,className:w("text-sm text-muted-foreground",s),...a}));P.displayName="CardDescription";const d=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("p-6 pt-0",s),...a}));d.displayName="CardContent";const de=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex items-center p-6 pt-0",s),...a}));de.displayName="CardFooter";const me=async s=>{const a=s?{"X-Admin-Token":s}:{},n=await fetch(ee("/api/v1/cron/status"),{headers:a,credentials:"include"});if(n.status===401)throw new Error("Unauthorized. Sign in with Hugging Face or paste a valid admin token.");if(!n.ok)throw new Error("Failed to fetch cron status");return n.json()},q=()=>G(),xe=({status:s,isRunning:a})=>{if(a)return e.jsx(M,{className:"h-5 w-5 text-blue-500 animate-spin"});switch(s){case"success":return e.jsx(U,{className:"h-5 w-5 text-green-500"});case"success_no_work":return e.jsx(U,{className:"h-5 w-5 text-yellow-500"});case"failed":return e.jsx(B,{className:"h-5 w-5 text-red-500"});case"running":return e.jsx(M,{className:"h-5 w-5 text-blue-500 animate-spin"});default:return e.jsx(le,{className:"h-5 w-5 text-gray-400"})}},he=({status:s,isRunning:a})=>{if(a)return e.jsx(N,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300",children:"Running"});switch(s){case"success":return e.jsx(N,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300",children:"Success"});case"success_no_work":return e.jsx(N,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-300",children:"Success (No Work)"});case"failed":return e.jsx(N,{variant:"outline",className:"bg-red-50 text-red-700 border-red-300",children:"Failed"});default:return e.jsx(N,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-300",children:"Unknown"})}},ue=s=>s.replace(/_/g," ").split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),I=s=>{if(!s)return"Never";try{const a=new Date(s),m=new Date().getTime()-a.getTime(),i=Math.floor(m/6e4),f=Math.floor(m/36e5),h=Math.floor(m/864e5);return i<1?"Just now":i<60?`${i}m ago`:f<24?`${f}h ago`:h<7?`${h}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},ge=s=>{if(!s)return"Not scheduled";try{const a=new Date(s),n=new Date,m=a.getTime()-n.getTime(),i=Math.floor(m/6e4),f=Math.floor(m/36e5),h=Math.floor(m/864e5);return m<0?"Overdue":i<1?"Just now":i<60?`in ${i}m`:f<24?`in ${f}h`:h<7?`in ${h}d`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},fe=s=>s?s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`:"N/A",pe={hourly:"bg-blue-100 text-blue-800 border-blue-200",daily:"bg-purple-100 text-purple-800 border-purple-200",weekly:"bg-orange-100 text-orange-800 border-orange-200",monthly:"bg-pink-100 text-pink-800 border-pink-200"},ke=()=>{const[s,a]=l.useState(!0),[n,m]=l.useState(new Set),[i,f]=l.useState(()=>q()),[h,A]=l.useState(()=>q()),[_,D]=l.useState(!1),{user:u}=Q(),S=!!(u!=null&&u.is_admin);l.useEffect(()=>{Y(i)},[i]),l.useEffect(()=>{if(!_)return;const r=window.setTimeout(()=>D(!1),2e3);return()=>window.clearTimeout(r)},[_]);const W=()=>{f(h.trim()),D(!0)},H=()=>{A(""),f("")},g=S||i.trim().length>0,{data:c,isLoading:X,isFetching:$,error:T,refetch:V}=se({queryKey:["cronStatus",S?`hf:${u==null?void 0:u.username}`:i],queryFn:()=>me(i.trim()),enabled:g,refetchInterval:g&&s?3e4:!1,retry:!1}),v=T instanceof Error?T.message:void 0,E=r=>{m(t=>{const x=new Set(t);return x.has(r)?x.delete(r):x.add(r),x})},k=(c==null?void 0:c.jobs.reduce((r,t)=>(r[t.category]||(r[t.category]=[]),r[t.category].push(t),r),{}))||{},O=Object.keys(k).sort((r,t)=>{const x=["hourly","daily","weekly","monthly"];return x.indexOf(r)-x.indexOf(t)}),Z=r=>r>=80?"text-green-600":r>=60?"text-yellow-600":"text-red-600";return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold text-gray-900 flex items-center gap-3",children:[e.jsx(R,{className:"h-8 w-8 text-blue-600"}),"CRON Job Dashboard"]}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Monitor and manage automated tasks"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>a(!s),disabled:!g,className:`${s?"border-blue-500 text-blue-600":""} ${g?"":"opacity-60 cursor-not-allowed"}`,children:[e.jsx(L,{className:`h-4 w-4 mr-2 ${s&&g?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>V(),disabled:!g||$,children:[e.jsx(L,{className:`h-4 w-4 mr-2 ${$?"animate-spin":""}`}),"Refresh"]})]})]})}),S?e.jsx(o,{className:"mb-6",children:e.jsx(d,{className:"pt-6",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",u==null?void 0:u.username]}),". Your admin permissions are derived from the ",e.jsx("code",{className:"font-mono",children:"PWC_ADMIN_HF_USERNAMES"})," ","allowlist; CRON metrics will refresh automatically."]})})}):e.jsx(o,{className:"mb-6",children:e.jsxs(d,{className:"pt-6 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-800",children:"Admin token"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Sign in with Hugging Face from the header for the easiest path. Otherwise, paste your admin token here. The token is stored locally in this browser and sent with requests as the ",e.jsx("code",{className:"font-mono",children:"X-Admin-Token"})," header."]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 w-full md:w-auto",children:[e.jsx(ae,{type:"password",placeholder:"Enter admin token",value:h,onChange:r=>A(r.target.value),className:"sm:w-64"}),e.jsx(b,{size:"sm",onClick:W,disabled:!h.trim(),children:"Apply token"}),i&&e.jsx(b,{variant:"ghost",size:"sm",onClick:H,children:"Clear"})]})]}),_&&e.jsx("p",{className:"text-xs text-green-600",children:"Token saved. Future requests will automatically include it."}),e.jsx("p",{className:`text-xs ${g?"text-gray-500":"text-blue-700"}`,children:g?"Token stored locally in this browser. Clear it when you are finished on shared devices.":"Enter your admin token above (or sign in with Hugging Face) to enable CRON job monitoring."})]})}),X&&g&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(M,{className:"h-8 w-8 animate-spin text-blue-500"}),e.jsx("span",{className:"ml-3 text-gray-600",children:"Loading CRON jobs status..."})]}),T&&e.jsx(o,{className:"border-red-200 bg-red-50",children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col gap-3 text-red-800",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"h-5 w-5"}),e.jsx("p",{children:v??"Failed to load CRON jobs status. Please try again."})]}),(v==null?void 0:v.toLowerCase().includes("unauthorized"))&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:H,children:"Clear saved token"}),e.jsx("span",{className:"text-sm text-red-700",children:"Re-enter your admin token to continue."})]})]})})}),c&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 mb-8",children:[e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Total Jobs"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold",children:c.summary.total_jobs})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Successful"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:c.summary.success})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Failed"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-red-600",children:c.summary.failed})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Running"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:c.summary.running})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Health Score"})}),e.jsx(d,{children:e.jsxs("div",{className:`text-2xl font-bold ${Z(c.summary.health_score)}`,children:[c.summary.health_score.toFixed(0),"%"]})})]})]}),e.jsxs("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-2",children:[e.jsx(J,{className:"h-4 w-4"}),"Last updated: ",I(c.timestamp)]}),e.jsx("div",{className:"space-y-6",children:O.map(r=>e.jsxs(o,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(N,{className:pe[r],children:r}),e.jsxs("span",{className:"text-gray-700",children:[r," Jobs"]})]}),e.jsxs(P,{children:[k[r].length," job",k[r].length!==1?"s":""]})]})}),e.jsx(d,{children:e.jsx("div",{className:"space-y-4",children:k[r].map(t=>{const x=n.has(t.job_name),z=t.work_metrics&&Object.keys(t.work_metrics).length>0;return e.jsxs("div",{className:"border rounded-lg overflow-hidden transition-all",children:[e.jsx("div",{className:"p-4 hover:bg-gray-50 transition-colors cursor-pointer",onClick:()=>E(t.job_name),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx(xe,{status:t.status,isRunning:t.is_running}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:ue(t.job_name)}),z&&e.jsx("button",{className:"text-gray-400 hover:text-gray-600 transition-colors",onClick:C=>{C.stopPropagation(),E(t.job_name)},children:x?e.jsx(ie,{className:"h-4 w-4"}):e.jsx(ne,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(J,{className:"h-4 w-4"}),e.jsxs("span",{children:["Last: ",I(t.last_run)]})]}),t.duration!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsxs("span",{children:["Duration: ",fe(t.duration)]})]}),t.schedule&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"h-4 w-4"}),e.jsx("span",{className:"font-mono text-xs",children:t.schedule})]}),t.next_run&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsxs("span",{children:["Next: ",ge(t.next_run)]})]})]}),t.work_summary&&e.jsxs("div",{className:"mt-2 text-sm text-gray-600 bg-gray-100 rounded px-2 py-1 flex items-center gap-1",children:[e.jsx(ce,{className:"h-3 w-3"}),e.jsx("span",{children:t.work_summary})]}),t.error&&e.jsxs("div",{className:"mt-2 text-sm text-red-600 bg-red-50 rounded px-2 py-1",children:[e.jsx("span",{className:"font-semibold",children:"Error: "}),t.error]})]})]}),e.jsx(he,{status:t.status,isRunning:t.is_running})]})}),x&&z&&e.jsxs("div",{className:"border-t bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(te,{className:"h-4 w-4 text-gray-600"}),e.jsx("h4",{className:"font-semibold text-gray-700",children:"Work Metrics"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Object.entries(t.work_metrics).map(([C,F])=>e.jsxs("div",{className:"bg-white rounded border border-gray-200 p-3",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-1",children:C.replace(/_/g," ").replace(/\b\w/g,K=>K.toUpperCase())}),e.jsx("div",{className:"text-lg font-semibold text-gray-900",children:typeof F=="number"?F.toLocaleString():F})]},C))})]})]},t.job_name)})})})]},r))}),O.length===0&&e.jsx(o,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center text-gray-500 py-12",children:[e.jsx(R,{className:"h-12 w-12 mx-auto mb-4 text-gray-400"}),e.jsx("p",{children:"No CRON jobs found"})]})})})]})]})})};export{ke as default};
|
assets/FeedView-DMj2BLlQ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as S,r as N,j as e,L as d,a as y}from"./index-M24Hywem.js";import{P as I}from"./components-J9e6gtqw.js";import{t as L,d as b}from"./transform-DVq_2bw1.js";import{u as R}from"./usePapers-DAX-IssB.js";import{u as A}from"./useIntersectionObserver-Bk74NMqD.js";import{P as D}from"./usePeriodFilter-D4iAjivb.js";import{S as t}from"./skeleton-DCGdUtqq.js";import{A as E,a as M}from"./alert-0Kui0gCY.js";import{u as T}from"./useQuery-C6YLWBWB.js";import"./LatexTitle-C8-B6cG1.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-D8U4M_OT.js";const C=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],W={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},q={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},$=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",B=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",se=()=>{var x,g,u,j,f;const[i,o]=S(),c=$(i.get("order_by")),m=B(i.get("time")),v=q[m],_=s=>{const a=new URLSearchParams(i);a.set("order_by",s),o(a)},w=s=>{const a=new URLSearchParams(i);a.set("time",W[s]),o(a)},h=T({queryKey:["top-tasks-sidebar"],queryFn:()=>y.getTopTasks({limit:8}),staleTime:10*60*1e3}),n=T({queryKey:["trending-tasks-sidebar"],queryFn:()=>y.getTrendingTasks({limit:8}),staleTime:10*60*1e3}),r=R({page_size:30,order_by:c,order_dir:"desc",time:m,include_resources:!0}),l=N.useMemo(()=>{var a;return(((a=r.data)==null?void 0:a.pages.flatMap(O=>O.results))||[]).map(L)},[r.data]),{targetRef:P,isIntersecting:p}=A({rootMargin:"400px"});N.useEffect(()=>{p&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[p,r.hasNextPage,r.isFetchingNextPage]);const k=r.isLoading,F=r.error;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]}),e.jsx("div",{style:{display:"flex",gap:16,alignItems:"center",flexWrap:"wrap"},children:e.jsx("div",{className:"period-switch",children:D.map(s=>e.jsx("button",{className:`period-btn ${v===s?"active":""}`,onClick:()=>w(s),children:s},s))})})]}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),h.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(t,{className:"h-5 w-full"},a))}),(x=h.data)==null?void 0:x.map(s=>e.jsxs(d,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[b(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(d,{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"}),n.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(t,{className:"h-5 w-full"},a))}),((u=(g=n.data)==null?void 0:g.results)==null?void 0:u.length)===0&&!n.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(f=(j=n.data)==null?void 0:j.results)==null?void 0:f.map(s=>e.jsxs(d,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[b(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:C.map(([s,a])=>e.jsx("button",{className:`sort-btn ${c===s?"active":""}`,onClick:()=>_(s),children:a},s))}),e.jsxs("div",{className:"results-count",children:[l.length," papers"]})]}),F&&e.jsx(E,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),k?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(t,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(t,{className:"h-6 w-3/4"}),e.jsx(t,{className:"h-4 w-1/2"}),e.jsx(t,{className:"h-12 w-full"})]})]},a))}):l.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:l.map((s,a)=>e.jsx(I,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:P,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{se as default};
|
assets/FeedView-DwVPIvQN.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as S,r as y,j as e,L as m,a as T}from"./index-D3-tYEe-.js";import{P as I}from"./components-D244J_Aj.js";import{t as L,a as E,d as _}from"./transform-nNAikYlJ.js";import{u as R,a as D}from"./usePapers-C3rZB7Pt.js";import{u as M}from"./useIntersectionObserver-SHZ4yqtO.js";import{P as C}from"./usePeriodFilter-BzXQM3-U.js";import{S as n}from"./skeleton-D0cyB03X.js";import{A as W,a as q}from"./alert-Ayuop_ag.js";import{u as b}from"./useQuery-C6S8Ozku.js";import"./LatexTitle-ZrlO0rs7.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DEoip3HO.js";const $=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],B={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},z={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},K={today:1,week:7,month:30,all_time:365},U=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",X=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",te=()=>{var x,u,j,f,N;const[i,h]=S(),r=U(i.get("order_by")),o=X(i.get("time")),v=z[o],P=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},w=s=>{const a=new URLSearchParams(i);a.set("time",B[s]),h(a)},p=b({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=b({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8}),staleTime:10*60*1e3}),t=R({page_size:30,order_by:r,order_dir:"desc",time:o,include_resources:!0,enabled:r!=="trending"}),d=D({limit:30,max_age_days:K[o],enabled:r==="trending"}),c=y.useMemo(()=>{var a;return r==="trending"?(d.data||[]).map(L):(((a=t.data)==null?void 0:a.pages.flatMap(O=>O.results))||[]).map(E)},[r,t.data,d.data]),{targetRef:k,isIntersecting:g}=M({rootMargin:"400px"});y.useEffect(()=>{r!=="trending"&&g&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[r,g,t.hasNextPage,t.isFetchingNextPage]);const F=r==="trending"?d.isLoading:t.isLoading,A=r==="trending"?d.error:t.error;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]}),e.jsx("div",{style:{display:"flex",gap:16,alignItems:"center",flexWrap:"wrap"},children:e.jsx("div",{className:"period-switch",children:C.map(s=>e.jsx("button",{className:`period-btn ${v===s?"active":""}`,onClick:()=>w(s),children:s},s))})})]}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),p.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),(x=p.data)==null?void 0:x.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(m,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),l.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),((j=(u=l.data)==null?void 0:u.results)==null?void 0:j.length)===0&&!l.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(N=(f=l.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:$.map(([s,a])=>e.jsx("button",{className:`sort-btn ${r===s?"active":""}`,onClick:()=>P(s),children:a},s))}),e.jsxs("div",{className:"results-count",children:[c.length," papers"]})]}),A&&e.jsx(W,{variant:"destructive",className:"mb-4",children:e.jsx(q,{children:"Failed to load papers. Please try again."})}),F?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(n,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(n,{className:"h-6 w-3/4"}),e.jsx(n,{className:"h-4 w-1/2"}),e.jsx(n,{className:"h-12 w-full"})]})]},a))}):c.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:c.map((s,a)=>e.jsx(I,{paper:s,rank:a+1},s.id))}),r!=="trending"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:k,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{te as default};
|
|
|
|
|
|
assets/{LatexTitle-ZrlO0rs7.js → LatexTitle-C8-B6cG1.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as o,r as g}from"./index-
|
|
|
|
| 1 |
+
import{j as o,r as g}from"./index-M24Hywem.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-trAzkiVz.js → MarkdownText-BjEj6m-s.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{MethodDetailView-oq0vHvu5.js → MethodDetailView-BHLd4UDP.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,Z as E,r as y,L as M,a as g,a9 as D}from"./index-D3-tYEe-.js";import{u as F}from"./useQuery-C6S8Ozku.js";import{u as B}from"./useInfiniteQuery-DEoip3HO.js";import{M as L,P as C}from"./components-D244J_Aj.js";import{M as b}from"./MarkdownText-trAzkiVz.js";import{a as P}from"./transform-nNAikYlJ.js";import{u as T}from"./useIntersectionObserver-SHZ4yqtO.js";import{S as u}from"./skeleton-D0cyB03X.js";import{A as I,a as R}from"./alert-Ayuop_ag.js";import"./LatexTitle-ZrlO0rs7.js";import"./katex.min-BSBacQyE.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},o=({x:i,y:s,w:r,h:l,fill:x,stroke:d,label:m,fontSize:h=10,multiline:f})=>e.jsxs("g",{children:[e.jsx("rect",{x:i,y:s,width:r,height:l,rx:"3",ry:"3",fill:x,stroke:d,strokeWidth:"1"}),f?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:i+r/2,y:s+l/2-2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[0]}),e.jsx("text",{x:i+r/2,y:s+l/2+h-1,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[1]})]}):e.jsx("text",{x:i+r/2,y:s+l/2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:m})]}),N=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(o,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(o,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(o,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(o,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(o,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(o,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(o,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(o,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),$=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const s=30+i*75,r=60-i*8,l=240-i*30;return e.jsx("g",{children:e.jsx("rect",{x:s,y:(420-l)/2,width:r,height:l,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][i],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][i],strokeWidth:"1"})},i)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),A=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const r=60+i*80,l=100-i*12,x=50-i*6;return e.jsx("rect",{x:50,y:r,width:l,height:x,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${i}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(i=>{const r=60+i*80,l=100-i*12,x=50-i*6;return e.jsx("rect",{x:210,y:r,width:l,height:x,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${i}`)}),[0,1,2,3].map(i=>{const s=60+i*80+(50-i*6)/2,r=50+(100-i*12);return e.jsx("path",{d:`M${r} ${s} L210 ${s}`,stroke:t.faint,strokeDasharray:"4 3"},`s${i}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(i=>[0,1,2].map(s=>e.jsx("rect",{x:20+s*40,y:40+i*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][i*3+s],stroke:t.faint},`${i}-${s}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(o,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(o,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(o,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(o,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),_=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(i=>{const s=25+i*56,r=(5-i)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:s,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-r*.1} 0.04 250)`,stroke:t.faint}),r<.4&&e.jsx("circle",{cx:s+25,cy:115,r:12-r*16,fill:t.orange,opacity:1-r*1.5})]},i)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),K=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],Q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),K.map(([i,s],r)=>{const l=92+r*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:i}),s?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:s}):null]},i)})]}),V={attention:N,"self-attention":N,cnn:$,"u-net":A,unet:A,vit:O,diffusion:_,ddpm:_,gan:G,vae:q,"agent-skills":Q},W=({method:i})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:i.name||"method"}),e.jsx(o,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(o,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:i.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(o,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),U=({method:i})=>{const s=(i.slug||"").toLowerCase(),r=V[s];if(r)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(r,{})});if(i.image_url){const l=s==="transformer"||s==="gpt-4"||s==="gpt-4o"?" method-figure-svg--compact":s==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:i.image_url,alt:`${i.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(W,{method:i})})},H=[["trending","trending"],["new","newest"],["cited","most cited"]],z={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},ae=()=>{var k,S,v,w;const{methodSlug:i}=E(),[s,r]=y.useState("trending"),l=F({queryKey:["method",i],queryFn:()=>g.getMethod(i),enabled:!!i,staleTime:10*60*1e3}),x=s==="trending"?"trending":s==="cited"?"citation_count":"date_published",d=B({queryKey:["method-papers-infinite",i,x],queryFn:({pageParam:a=1})=>g.getMethodPapers(i,{page:a,page_size:20,order_by:x,order_dir:"desc",include_resources:!0}),getNextPageParam:a=>a.next_page,initialPageParam:1,enabled:!!i,staleTime:5*60*1e3,placeholderData:D}),m=F({queryKey:["related-methods",(k=l.data)==null?void 0:k.slug,(S=l.data)==null?void 0:S.area_id,(v=l.data)==null?void 0:v.id],queryFn:async()=>{const a=z[l.data.slug];return a?Promise.all(a.map(p=>g.getMethod(p))):(await g.getMethods({area_id:l.data.area_id,exclude_id:l.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!l.data&&(!!z[l.data.slug]||!!l.data.area_id),staleTime:10*60*1e3}),h=y.useMemo(()=>{var c;return(((c=d.data)==null?void 0:c.pages.flatMap(p=>p.results))||[]).map(P)},[d.data]),{targetRef:f,isIntersecting:j}=T({rootMargin:"200px"});if(y.useEffect(()=>{j&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[j,d.hasNextPage,d.isFetchingNextPage]),l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(u,{className:"h-12 w-1/2 mb-4"}),e.jsx(u,{className:"h-64 w-full"})]});if(l.error||!l.data)return e.jsx("div",{className:"page",children:e.jsx(I,{variant:"destructive",children:e.jsx(R,{children:"Method not found."})})});const n=l.data;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(M,{to:"/methods",children:"Methods"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:n.name})]}),e.jsxs("div",{className:"tag-hero method-hero-grid",children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:n.name}),n.full_name&&n.full_name!==n.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:n.full_name}),n.description&&e.jsx(b,{className:"method-description",text:n.description}),n.source_url&&n.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:n.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:n.source_title}),n.introduced_year&&e.jsx("span",{className:"method-source-meta",children:n.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers using"}),e.jsx("span",{className:"value",children:(n.paper_count??0).toLocaleString()})]}),n.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:n.introduced_year})]})]})]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(U,{method:n}),n.image_credit&&e.jsx("figcaption",{children:e.jsx(b,{className:"method-image-credit",text:n.image_credit})})]})]}),(((w=m.data)==null?void 0:w.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(a=>e.jsx(L,{method:{slug:a.slug,name:a.name}},a.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:H.map(([a,c])=>e.jsx("button",{className:`sort-btn ${s===a?"active":""}`,onClick:()=>r(a),children:c},a))}),e.jsxs("div",{className:"results-count",children:[h.length," papers using ",n.name]})]}),d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,c)=>e.jsx(u,{className:"h-40 w-full"},c))}):h.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:h.map((a,c)=>e.jsx(C,{paper:a,rank:c+1},a.id))}),e.jsx("div",{ref:f,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ae as default};
|
|
|
|
| 1 |
+
import{j as e,_ as E,r as y,L as M,a as g,aa as D}from"./index-M24Hywem.js";import{u as F}from"./useQuery-C6YLWBWB.js";import{u as B}from"./useInfiniteQuery-D8U4M_OT.js";import{M as L,P as C}from"./components-J9e6gtqw.js";import{M as b}from"./MarkdownText-BjEj6m-s.js";import{t as P}from"./transform-DVq_2bw1.js";import{u as T}from"./useIntersectionObserver-Bk74NMqD.js";import{S as u}from"./skeleton-DCGdUtqq.js";import{A as I,a as R}from"./alert-0Kui0gCY.js";import"./LatexTitle-C8-B6cG1.js";import"./katex.min-BSBacQyE.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},o=({x:i,y:s,w:r,h:l,fill:x,stroke:d,label:m,fontSize:h=10,multiline:f})=>e.jsxs("g",{children:[e.jsx("rect",{x:i,y:s,width:r,height:l,rx:"3",ry:"3",fill:x,stroke:d,strokeWidth:"1"}),f?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:i+r/2,y:s+l/2-2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[0]}),e.jsx("text",{x:i+r/2,y:s+l/2+h-1,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[1]})]}):e.jsx("text",{x:i+r/2,y:s+l/2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:m})]}),N=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(o,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(o,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(o,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(o,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(o,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(o,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(o,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(o,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),$=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const s=30+i*75,r=60-i*8,l=240-i*30;return e.jsx("g",{children:e.jsx("rect",{x:s,y:(420-l)/2,width:r,height:l,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][i],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][i],strokeWidth:"1"})},i)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),A=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const r=60+i*80,l=100-i*12,x=50-i*6;return e.jsx("rect",{x:50,y:r,width:l,height:x,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${i}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(i=>{const r=60+i*80,l=100-i*12,x=50-i*6;return e.jsx("rect",{x:210,y:r,width:l,height:x,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${i}`)}),[0,1,2,3].map(i=>{const s=60+i*80+(50-i*6)/2,r=50+(100-i*12);return e.jsx("path",{d:`M${r} ${s} L210 ${s}`,stroke:t.faint,strokeDasharray:"4 3"},`s${i}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(i=>[0,1,2].map(s=>e.jsx("rect",{x:20+s*40,y:40+i*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][i*3+s],stroke:t.faint},`${i}-${s}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(o,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(o,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(o,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(o,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),_=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(i=>{const s=25+i*56,r=(5-i)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:s,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-r*.1} 0.04 250)`,stroke:t.faint}),r<.4&&e.jsx("circle",{cx:s+25,cy:115,r:12-r*16,fill:t.orange,opacity:1-r*1.5})]},i)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),K=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],Q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),K.map(([i,s],r)=>{const l=92+r*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:i}),s?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:s}):null]},i)})]}),V={attention:N,"self-attention":N,cnn:$,"u-net":A,unet:A,vit:O,diffusion:_,ddpm:_,gan:G,vae:q,"agent-skills":Q},W=({method:i})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:i.name||"method"}),e.jsx(o,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(o,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:i.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(o,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),U=({method:i})=>{const s=(i.slug||"").toLowerCase(),r=V[s];if(r)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(r,{})});if(i.image_url){const l=s==="transformer"||s==="gpt-4"||s==="gpt-4o"?" method-figure-svg--compact":s==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:i.image_url,alt:`${i.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(W,{method:i})})},H=[["trending","trending"],["new","newest"],["cited","most cited"]],z={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},ae=()=>{var k,S,v,w;const{methodSlug:i}=E(),[s,r]=y.useState("trending"),l=F({queryKey:["method",i],queryFn:()=>g.getMethod(i),enabled:!!i,staleTime:10*60*1e3}),x=s==="trending"?"trending":s==="cited"?"citation_count":"date_published",d=B({queryKey:["method-papers-infinite",i,x],queryFn:({pageParam:a=1})=>g.getMethodPapers(i,{page:a,page_size:20,order_by:x,order_dir:"desc",include_resources:!0}),getNextPageParam:a=>a.next_page,initialPageParam:1,enabled:!!i,staleTime:5*60*1e3,placeholderData:D}),m=F({queryKey:["related-methods",(k=l.data)==null?void 0:k.slug,(S=l.data)==null?void 0:S.area_id,(v=l.data)==null?void 0:v.id],queryFn:async()=>{const a=z[l.data.slug];return a?Promise.all(a.map(p=>g.getMethod(p))):(await g.getMethods({area_id:l.data.area_id,exclude_id:l.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!l.data&&(!!z[l.data.slug]||!!l.data.area_id),staleTime:10*60*1e3}),h=y.useMemo(()=>{var c;return(((c=d.data)==null?void 0:c.pages.flatMap(p=>p.results))||[]).map(P)},[d.data]),{targetRef:f,isIntersecting:j}=T({rootMargin:"200px"});if(y.useEffect(()=>{j&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[j,d.hasNextPage,d.isFetchingNextPage]),l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(u,{className:"h-12 w-1/2 mb-4"}),e.jsx(u,{className:"h-64 w-full"})]});if(l.error||!l.data)return e.jsx("div",{className:"page",children:e.jsx(I,{variant:"destructive",children:e.jsx(R,{children:"Method not found."})})});const n=l.data;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(M,{to:"/methods",children:"Methods"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:n.name})]}),e.jsxs("div",{className:"tag-hero method-hero-grid",children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:n.name}),n.full_name&&n.full_name!==n.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:n.full_name}),n.description&&e.jsx(b,{className:"method-description",text:n.description}),n.source_url&&n.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:n.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:n.source_title}),n.introduced_year&&e.jsx("span",{className:"method-source-meta",children:n.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers using"}),e.jsx("span",{className:"value",children:(n.paper_count??0).toLocaleString()})]}),n.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:n.introduced_year})]})]})]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(U,{method:n}),n.image_credit&&e.jsx("figcaption",{children:e.jsx(b,{className:"method-image-credit",text:n.image_credit})})]})]}),(((w=m.data)==null?void 0:w.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(a=>e.jsx(L,{method:{slug:a.slug,name:a.name}},a.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:H.map(([a,c])=>e.jsx("button",{className:`sort-btn ${s===a?"active":""}`,onClick:()=>r(a),children:c},a))}),e.jsxs("div",{className:"results-count",children:[h.length," papers using ",n.name]})]}),d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,c)=>e.jsx(u,{className:"h-40 w-full"},c))}):h.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:h.map((a,c)=>e.jsx(C,{paper:a,rank:c+1},a.id))}),e.jsx("div",{ref:f,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ae as default};
|
assets/{MethodsIndexView-CrTfP50j.js → MethodsIndexView-iTAgeehL.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as u,j as e,L as x,a as c}from"./index-
|
|
|
|
| 1 |
+
import{r as u,j as e,L as x,a as c}from"./index-M24Hywem.js";import{u as h}from"./useQuery-C6YLWBWB.js";import{S as m}from"./skeleton-DCGdUtqq.js";import{A as g,a as j}from"./alert-0Kui0gCY.js";const N=()=>{var o,d;const i=h({queryKey:["areas-all"],queryFn:()=>c.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=h({queryKey:["methods-all"],queryFn:async()=>(await c.getMethods({page:1,page_size:500,ordering:"-paper_count"})).results,staleTime:10*60*1e3}),l=u.useMemo(()=>{if(!n.data||!i.data)return null;const a={};return n.data.forEach(r=>{const t=r.area_id??"_unassigned";(a[t]||(a[t]=[])).push(r)}),Object.values(a).forEach(r=>r.sort((t,s)=>(s.paper_count||0)-(t.paper_count||0))),a},[n.data,i.data]);return i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(j,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research, with the papers that use them."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((a,r)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((t,s)=>e.jsx(m,{className:"h-20"},s))})]},r))}):(d=(o=i.data)==null?void 0:o.results)==null?void 0:d.map(a=>{const r=(l==null?void 0:l[a.id])||[];if(r.length===0)return null;const t=r.reduce((s,p)=>s+(p.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:a.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," methods · ",t.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(s=>e.jsxs(x,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsx("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:s.name}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id))})]},a.id)})]})};export{N as default};
|
assets/{NotFound-3lyVNVYr.js → NotFound-igMRmZl4.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{aB as o,r as a,j as t,L as s}from"./index-
|
|
|
|
| 1 |
+
import{aB as o,r as a,j as t,L as s}from"./index-M24Hywem.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
|
assets/{OrganizationDetailView-CApb_ZqB.js → OrganizationDetailView-op1ankbX.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{_ as j,r as y,j as e,L as f,a as v}from"./index-M24Hywem.js";import{u as b}from"./useQuery-C6YLWBWB.js";import{M as k}from"./MarkdownText-BjEj6m-s.js";import{e as N,h as S,d as _}from"./transform-DVq_2bw1.js";import{S as p}from"./skeleton-DCGdUtqq.js";import{A as w,a as F}from"./alert-0Kui0gCY.js";import A from"./NotFound-igMRmZl4.js";import"./katex.min-BSBacQyE.js";const B=n=>(n==null?void 0:n.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",$=()=>{var g,x;const{orgSlug:n}=j(),i=b({queryKey:["organization-areas-with-tasks",n],queryFn:()=>v.getOrganizationAreasWithTasks(n),enabled:!!n,staleTime:10*60*1e3}),m=y.useMemo(()=>{if(!i.data)return[];const t={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>t[B(o)]??999;return[...i.data.results].sort((o,a)=>{const l=r(o.name),d=r(a.name);return l!==d?l-d:o.name.localeCompare(a.name)})},[i.data]),s=(g=i.data)==null?void 0:g.organization,c=((x=i.data)==null?void 0:x.total_paper_count)??0,h=m.reduce((t,r)=>t+r.tasks.length,0);if(i.error)return i.error.status===404?e.jsx(A,{}):e.jsx("div",{className:"page",children:e.jsx(w,{variant:"destructive",children:e.jsx(F,{children:"Failed to load organization. Please try again."})})});const u=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title",style:{display:"flex",alignItems:"center",gap:12},children:[(s==null?void 0:s.logo_url)&&e.jsx("img",{src:s.logo_url,alt:"",style:{height:"0.9em",width:"auto",borderRadius:4,objectFit:"contain"},onError:t=>{t.currentTarget.style.display="none"}}),u??e.jsx(p,{className:"h-10 w-64 inline-block"})]}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsxs("span",{children:[c.toLocaleString()," papers"]}),(s==null?void 0:s.website_url)&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.website_url.replace(/^https?:\/\//,"").replace(/\/$/,"")}),(s==null?void 0:s.github_url)&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.github_url.replace(/^https?:\/\//,"").replace(/\/$/,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(k,{className:"method-description",text:s.description})]}),!i.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All papers attributed to this organization."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:e.jsxs(f,{to:`/${n}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]})})]}),i.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((t,r)=>e.jsxs("div",{children:[e.jsx(p,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,a)=>e.jsx(p,{className:"h-24"},a))})]},r))}):m.map(t=>{const r=t.tasks;if(r.length===0)return null;const o=r.reduce((a,l)=>a+(l.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:t.name}),t.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:t.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(a=>{const l=a.slug||"",d=N(S(l));return e.jsxs(f,{to:`/${n}/${l}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:d.dot}}),_(a.name,l)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)})})]},t.id)}),h>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[h," tasks across ",m.filter(t=>t.tasks.length>0).length," areas."]})]})};export{$ as default};
|
assets/{OrganizationTaskView-YBSKDYqe.js → OrganizationTaskView-EdzsJOxD.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{_ as w,u as R,r as m,j as e,L as p,a as b}from"./index-M24Hywem.js";import{u as k}from"./useQuery-C6YLWBWB.js";import{P as B}from"./components-J9e6gtqw.js";import{t as E,d as L}from"./transform-DVq_2bw1.js";import{d as q}from"./usePapers-DAX-IssB.js";import{u as C}from"./useIntersectionObserver-Bk74NMqD.js";import{S as I}from"./skeleton-DCGdUtqq.js";import{A as Q,a as K}from"./alert-0Kui0gCY.js";import M from"./NotFound-igMRmZl4.js";import"./LatexTitle-C8-B6cG1.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-D8U4M_OT.js";const $=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],D=s=>s==="trending"||s==="date_published"||s==="citation_count"?s:"trending",re=()=>{var j,f,N,y,P,v,S;const{orgSlug:s,taskSlug:n}=w(),[g,_]=R(),h=D(g.get("order_by")),z=t=>{const r=new URLSearchParams(g);r.set("order_by",t),_(r)},o=n==="all",O=o?void 0:n,i=k({queryKey:["organization",s],queryFn:()=>b.getOrganization(s),enabled:!!s,staleTime:10*60*1e3}),c=k({queryKey:["task",n],queryFn:()=>b.getTask(n),enabled:!!n&&!o,staleTime:10*60*1e3}),a=q({organizationSlug:s||"",taskSlug:O,page_size:12,order_by:h,order_dir:"desc",include_resources:!0,enabled:!!s}),{targetRef:T,isIntersecting:u}=C({rootMargin:"200px"});m.useEffect(()=>{u&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[u,a.hasNextPage,a.isFetchingNextPage]),m.useEffect(()=>{window.scrollTo(0,0)},[s,n]);const l=m.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(F=>F.results.map(E))},[a.data]),d=o?"All papers":L(((j=c.data)==null?void 0:j.name)||n||"",((f=c.data)==null?void 0:f.slug)||n),x=((y=(N=a.data)==null?void 0:N.pages[0])==null?void 0:y.count)??((P=i.data)==null?void 0:P.paper_count)??0,A=((v=i.data)==null?void 0:v.name)??s;return i.error||c.error||a.error?((S=i.error)==null?void 0:S.status)===404?e.jsx(M,{}):e.jsx("div",{className:"page",children:e.jsx(Q,{variant:"destructive",children:e.jsx(K,{children:"Failed to load organization papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(p,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(p,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx(p,{to:`/${s}`,children:A}),e.jsx("span",{children:" / "}),e.jsx("span",{children:d})]}),e.jsxs("div",{style:{marginTop:16,marginBottom:28},children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:o?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:d}),i.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:x.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:i.data.name})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:"Organization papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",x.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:$.map(([t,r])=>e.jsx("button",{className:`sort-btn ${h===t?"active":""}`,onClick:()=>z(t),children:r},t))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded in ",e.jsx("span",{children:d})]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,r)=>e.jsx(I,{className:"h-40 w-full"},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((t,r)=>e.jsx(B,{paper:t,rank:r+1},t.id))}),e.jsx("div",{ref:T,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{re as default};
|
assets/{OrganizationsIndexView-mPCmASS0.js → OrganizationsIndexView-BkO64H_8.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,L as l,a as o}from"./index-
|
|
|
|
| 1 |
+
import{j as e,L as l,a as o}from"./index-M24Hywem.js";import{u as d}from"./useQuery-C6YLWBWB.js";import{S as c}from"./skeleton-DCGdUtqq.js";import{A as m,a as h}from"./alert-0Kui0gCY.js";const g={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},f=()=>{var n;const t=d({queryKey:["organizations"],queryFn:()=>o.getOrganizations(),staleTime:6e5});if(t.error)return e.jsx("div",{className:"page",children:e.jsx(m,{variant:"destructive",children:e.jsx(h,{children:"Failed to load organizations. Please try again."})})});const i=((n=t.data)==null?void 0:n.results)??[],r=i.reduce((a,s)=>a+(s.paper_count??0),0);return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research papers grouped by the labs and companies behind them."})]})}),t.isLoading?e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((a,s)=>e.jsx(c,{className:"h-24"},s))}):e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:g,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Organizations"})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.length," ",i.length===1?"organization":"organizations"," ·"," ",r.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:i.map(a=>e.jsxs(l,{to:`/${a.slug}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",style:{display:"flex",alignItems:"center",gap:10},children:[a.logo_url&&e.jsx("img",{src:a.logo_url,alt:"",width:24,height:24,style:{borderRadius:4,objectFit:"contain",flexShrink:0},onError:s=>{s.currentTarget.style.display="none"}}),a.name]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id))})]})]})};export{f as default};
|
assets/PaperDetailView-D3EhNQS9.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
| 1 |
-
import{c as Ee,g as pa,r as i,j as e,P as yt,b as Y,d as ms,e as tt,f as ke,h as ha,i as ps,C as le,k as re,l as ue,m as me,X as hs,s as Se,n as fa,o as fs,p as xa,q as ga,t as va,v as ja,w as ba,x as $e,R as ya,y as Ne,A as xs,z as gs,B as _a,D as wa,E as ka,F as Na,G as Ca,H as Ea,I as Sa,J as Pa,K as ts,M as Ra,N as Aa,O as Ia,Q as Fa,S as Ta,T as $a,U as st,V as _t,a as et,W as vs,Y as js,Z as La,_ as Da,$ as Ma,a0 as Ua,L as _e,a1 as qa,a2 as Ha,a3 as Ba,a4 as Oa,a5 as Ka,a6 as za,a7 as Qa}from"./index-D3-tYEe-.js";import{u as oe}from"./useQuery-C6S8Ozku.js";import{I as ee,a as Va,T as Ga,M as Wa}from"./components-D244J_Aj.js";import{C as Xa}from"./ClosedSourceEvalBadge-drWiTHYQ.js";import{L as Xe,a as Ja}from"./LatexTitle-ZrlO0rs7.js";import{e as Ya}from"./transform-nNAikYlJ.js";import{f as Za,D as er}from"./latexPlainText-ChVkH0gY.js";import{b as tr}from"./usePapers-C3rZB7Pt.js";import{S as He}from"./skeleton-D0cyB03X.js";import{A as sr,a as ar}from"./alert-Ayuop_ag.js";import{I as ie,B as V}from"./input-C7eEyU6x.js";import{u as rr}from"./index-BsV_WMf3.js";import{D as pe,a as he,b as fe,c as xe,d as ge,e as Pe,R as nr,P as ir,O as or,C as lr}from"./dialog-DzRXUQ09.js";import{u as ve}from"./useMutation-DDsKa144.js";import{L as ne}from"./loader-circle-BKVFOFo9.js";import{B as bs,D as cr}from"./badge-CCpokg9G.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DEoip3HO.js";/**
|
| 2 |
-
* @license lucide-react v0.462.0 - ISC
|
| 3 |
-
*
|
| 4 |
-
* This source code is licensed under the ISC license.
|
| 5 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
-
*/const dr=Ee("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
| 7 |
-
* @license lucide-react v0.462.0 - ISC
|
| 8 |
-
*
|
| 9 |
-
* This source code is licensed under the ISC license.
|
| 10 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
-
*/const ss=Ee("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
|
| 12 |
-
* @license lucide-react v0.462.0 - ISC
|
| 13 |
-
*
|
| 14 |
-
* This source code is licensed under the ISC license.
|
| 15 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 16 |
-
*/const as=Ee("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
| 17 |
-
* @license lucide-react v0.462.0 - ISC
|
| 18 |
-
*
|
| 19 |
-
* This source code is licensed under the ISC license.
|
| 20 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 21 |
-
*/const at=Ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
| 22 |
-
* @license lucide-react v0.462.0 - ISC
|
| 23 |
-
*
|
| 24 |
-
* This source code is licensed under the ISC license.
|
| 25 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 26 |
-
*/const Be=Ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
| 27 |
-
* @license lucide-react v0.462.0 - ISC
|
| 28 |
-
*
|
| 29 |
-
* This source code is licensed under the ISC license.
|
| 30 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 31 |
-
*/const ys=Ee("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
| 32 |
-
* @license lucide-react v0.462.0 - ISC
|
| 33 |
-
*
|
| 34 |
-
* This source code is licensed under the ISC license.
|
| 35 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 36 |
-
*/const rt=Ee("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function ur(t,a=!0){return oe({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return pa(t)},enabled:a&&!!t,staleTime:0,refetchOnMount:"always"})}const dt=async(t,a)=>{try{const r=await fetch(`https://huggingface.co/api/arxiv/${a}/repos`);if(!r.ok)return console.warn(`Failed to fetch repos for arXiv:${a}, status: ${r.status}`),{count:0,isLimited:!1};const n=((await r.json())[t]||[]).length;return console.log(`${t} count for arXiv:${a}: ${n}`),n<100?{count:n,isLimited:!1}:{count:n,isLimited:!0}}catch(r){return console.warn(`Failed to fetch ${t} count for arXiv:${a}:`,r),{count:0,isLimited:!1}}},mr=async t=>{const[a,r,u]=await Promise.all([dt("models",t),dt("datasets",t),dt("spaces",t)]);return{models:a.count,datasets:r.count,spaces:u.count,isLimited:a.isLimited||r.isLimited||u.isLimited}},pr=t=>oe({queryKey:["huggingface-repos",t],queryFn:()=>mr(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function hr(){const[t,a]=i.useState(!1),[r,u]=i.useState(!1),[n,l]=i.useState(!1),[o,p]=i.useState(!1),[s,f]=i.useState(!1),[_,v]=i.useState(!1),[E,k]=i.useState(!1);return{isEditingTasks:t,openTasksDialog:()=>a(!0),closeTasksDialog:()=>a(!1),setIsEditingTasks:a,isEditingMethods:r,openMethodsDialog:()=>u(!0),closeMethodsDialog:()=>u(!1),setIsEditingMethods:u,isEditingRepositories:n,openRepositoriesDialog:()=>l(!0),closeRepositoriesDialog:()=>l(!1),setIsEditingRepositories:l,isEditingProjectPages:o,openProjectPagesDialog:()=>p(!0),closeProjectPagesDialog:()=>p(!1),setIsEditingProjectPages:p,isEditingEvaluations:s,openEvaluationsDialog:()=>f(!0),closeEvaluationsDialog:()=>f(!1),setIsEditingEvaluations:f,isEditingSourceUrl:_,openSourceUrlDialog:()=>v(!0),closeSourceUrlDialog:()=>v(!1),setIsEditingSourceUrl:v,isEditingHfArtifacts:E,openHfArtifactsDialog:()=>k(!0),closeHfArtifactsDialog:()=>k(!1),setIsEditingHfArtifacts:k}}var nt="Checkbox",[fr]=ps(nt),[xr,wt]=fr(nt);function gr(t){const{__scopeCheckbox:a,checked:r,children:u,defaultChecked:n,disabled:l,form:o,name:p,onCheckedChange:s,required:f,value:_="on",internal_do_not_use_render:v}=t,[E,k]=ms({prop:r,defaultProp:n??!1,onChange:s,caller:nt}),[N,q]=i.useState(null),[M,A]=i.useState(null),F=i.useRef(!1),U=N?!!o||!!N.closest("form"):!0,P={checked:E,disabled:l,setChecked:k,control:N,setControl:q,name:p,form:o,value:_,hasConsumerStoppedPropagationRef:F,required:f,defaultChecked:ce(n)?!1:n,isFormControl:U,bubbleInput:M,setBubbleInput:A};return e.jsx(xr,{scope:a,...P,children:vr(v)?v(P):u})}var _s="CheckboxTrigger",ws=i.forwardRef(({__scopeCheckbox:t,onKeyDown:a,onClick:r,...u},n)=>{const{control:l,value:o,disabled:p,checked:s,required:f,setControl:_,setChecked:v,hasConsumerStoppedPropagationRef:E,isFormControl:k,bubbleInput:N}=wt(_s,t),q=tt(n,_),M=i.useRef(s);return i.useEffect(()=>{const A=l==null?void 0:l.form;if(A){const F=()=>v(M.current);return A.addEventListener("reset",F),()=>A.removeEventListener("reset",F)}},[l,v]),e.jsx(Y.button,{type:"button",role:"checkbox","aria-checked":ce(s)?"mixed":s,"aria-required":f,"data-state":Ss(s),"data-disabled":p?"":void 0,disabled:p,value:o,...u,ref:q,onKeyDown:ke(a,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:ke(r,A=>{v(F=>ce(F)?!0:!F),N&&k&&(E.current=A.isPropagationStopped(),E.current||A.stopPropagation())})})});ws.displayName=_s;var kt=i.forwardRef((t,a)=>{const{__scopeCheckbox:r,name:u,checked:n,defaultChecked:l,required:o,disabled:p,value:s,onCheckedChange:f,form:_,...v}=t;return e.jsx(gr,{__scopeCheckbox:r,checked:n,defaultChecked:l,disabled:p,required:o,onCheckedChange:f,name:u,form:_,value:s,internal_do_not_use_render:({isFormControl:E})=>e.jsxs(e.Fragment,{children:[e.jsx(ws,{...v,ref:a,__scopeCheckbox:r}),E&&e.jsx(Es,{__scopeCheckbox:r})]})})});kt.displayName=nt;var ks="CheckboxIndicator",Ns=i.forwardRef((t,a)=>{const{__scopeCheckbox:r,forceMount:u,...n}=t,l=wt(ks,r);return e.jsx(yt,{present:u||ce(l.checked)||l.checked===!0,children:e.jsx(Y.span,{"data-state":Ss(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:a,style:{pointerEvents:"none",...t.style}})})});Ns.displayName=ks;var Cs="CheckboxBubbleInput",Es=i.forwardRef(({__scopeCheckbox:t,...a},r)=>{const{control:u,hasConsumerStoppedPropagationRef:n,checked:l,defaultChecked:o,required:p,disabled:s,name:f,value:_,form:v,bubbleInput:E,setBubbleInput:k}=wt(Cs,t),N=tt(r,k),q=rr(l),M=ha(u);i.useEffect(()=>{const F=E;if(!F)return;const U=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(U,"checked").set,c=!n.current;if(q!==l&&j){const x=new Event("click",{bubbles:c});F.indeterminate=ce(l),j.call(F,ce(l)?!1:l),F.dispatchEvent(x)}},[E,q,l,n]);const A=i.useRef(ce(l)?!1:l);return e.jsx(Y.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??A.current,required:p,disabled:s,name:f,value:_,form:v,...a,tabIndex:-1,ref:N,style:{...a.style,...M,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Es.displayName=Cs;function vr(t){return typeof t=="function"}function ce(t){return t==="indeterminate"}function Ss(t){return ce(t)?"indeterminate":t?"checked":"unchecked"}const Nt=i.forwardRef(({className:t,style:a,...r},u)=>e.jsx(kt,{ref:u,className:re("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...a},...r,children:e.jsx(Ns,{className:re("flex items-center justify-center text-current"),children:e.jsx(le,{className:"h-4 w-4"})})}));Nt.displayName=kt.displayName;function jr(t,a,r){if(!t)return t;const u=n=>n.paper_id!==a||n.paper_title===r?n:{...n,paper_title:r};if(Array.isArray(t)){const n=t.map(u);return n.some((o,p)=>o!==t[p])?n:t}if(Array.isArray(t.results)){const n=t.results.map(u);return n.some((o,p)=>o!==t.results[p])?{...t,results:n}:t}return t}function De(t,a,r){new Set([...r,a.id,a.arxiv_id].filter(o=>!!o)).forEach(o=>{t.setQueryData(["paper",o],a),t.setQueryData(["paper-arxiv",o],a)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const n=String(a.id),l=o=>jr(o,n,a.title);t.setQueriesData({queryKey:["evaluations"]},l),t.setQueriesData({queryKey:["dataset-evals"]},l),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}function Re({isAuthor:t=!1}){return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:t?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}const br=250,yr=100;function _r({open:t,onOpenChange:a,paperId:r,arxivId:u,initialTaskIds:n,initialTasks:l,onSuccess:o,submitMode:p="direct",isAuthor:s=!1}){const[f,_]=i.useState(n),[v,E]=i.useState(""),[k,N]=i.useState(""),[q,M]=i.useState(new Map),A=ue(),{toast:F}=me(),U=i.useRef(!1);i.useEffect(()=>{if(!t){U.current=!1;return}if(U.current)return;U.current=!0,_(n),E(""),N("");const b=new Map;(l||[]).forEach(S=>{const R=parseInt(S.id);Number.isNaN(R)||b.set(R,S)}),M(b)},[t,n,l]),i.useEffect(()=>{const b=window.setTimeout(()=>{N(v.trim())},br);return()=>window.clearTimeout(b)},[v]);const{data:P,isFetching:j}=oe({queryKey:["tasks-search",k],queryFn:()=>fs({page_size:yr,visible_only:!0,...k?{q:k}:{}}),enabled:t});i.useEffect(()=>{var b;(b=P==null?void 0:P.results)!=null&&b.length&&M(S=>{const R=new Map(S);return P.results.forEach(L=>{const m=parseInt(L.id);Number.isNaN(m)||R.set(m,L)}),R})},[P]);const c=i.useMemo(()=>{const b=(P==null?void 0:P.results)||[],S=new Set,R=[];return f.forEach(L=>{if(S.has(L))return;const m=q.get(L);m&&(R.push(m),S.add(L))}),b.forEach(L=>{const m=parseInt(L.id);Number.isNaN(m)||S.has(m)||(R.push(L),S.add(m))}),R},[P,f,q]),x=ve({mutationFn:async({paperId:b,taskIds:S})=>p==="pending"?(await Se({paper_id:parseInt(b),edit_type:"tasks",proposed_payload:{task_ids:S}}),null):fa(b,S),onMutate:async({taskIds:b})=>{if(p==="pending")return{snapshots:[]};const S=b.map(m=>q.get(m)).filter(m=>!!m).map(m=>({id:m.id,name:m.name,slug:m.slug})).sort((m,w)=>m.name.localeCompare(w.name)),R=Array.from(new Set([r,u].filter(m=>!!m)));await Promise.all(R.flatMap(m=>[A.cancelQueries({queryKey:["paper",m]}),A.cancelQueries({queryKey:["paper-arxiv",m]})]));const L=[];return R.forEach(m=>{["paper","paper-arxiv"].forEach(w=>{const C=[w,m],g=A.getQueryData(C);L.push({key:C,data:g}),g&&A.setQueryData(C,{...g,tasks:S})})}),F({title:"Tasks updated",description:`Saved ${b.length} task${b.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1),{snapshots:L}},onSuccess:b=>{if(p==="pending"){F({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),o==null||o(),a(!1);return}b&&De(A,b,[r,u])},onError:(b,S,R)=>{var w,C;(w=R==null?void 0:R.snapshots)==null||w.forEach(({key:g,data:y})=>{A.setQueryData(g,y)});const L=b;let m=L.message||(p==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(L.response)try{const g=JSON.parse(L.response);typeof(g==null?void 0:g.detail)=="string"?m=g.detail:Array.isArray(g==null?void 0:g.detail)&&((C=g.detail[0])!=null&&C.msg)&&(m=g.detail[0].msg)}catch{m=L.response}F({title:p==="pending"?"Could not submit edit":"Could not save tasks",description:m,variant:"destructive"})}}),D=()=>{x.mutate({paperId:r,taskIds:f})},H=i.useMemo(()=>{if(f.length!==n.length)return!0;const b=new Set(n);return f.some(S=>!b.has(S))},[f,n]),B=(b,S)=>{_(R=>S?R.includes(b)?R:[...R,b]:R.filter(L=>L!==b))},te=()=>E("");return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Paper Tasks"}),e.jsx(ge,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),p==="pending"&&e.jsx(Re,{isAuthor:s}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Be,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ie,{type:"text",placeholder:"Search tasks...",value:v,onChange:b=>E(b.target.value),className:"pl-9 pr-9"}),v&&e.jsx("button",{type:"button",onClick:te,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(hs,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:c.length>0?e.jsx("div",{className:"space-y-2",children:c.map(b=>{const S=parseInt(b.id),R=f.includes(S);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Nt,{id:`task-${b.id}`,checked:R,onCheckedChange:L=>B(S,L===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${b.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[b.name,b.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[b.description.substring(0,100),b.description.length>100?"...":""]})]})]},b.id)})}):j?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Be,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:k?`No tasks found matching "${k}"`:"No tasks available"})]})}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:D,disabled:x.isPending||!H,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),p==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),p==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const wr=250,kr=100;function Nr({open:t,onOpenChange:a,paperId:r,arxivId:u,initialMethodIds:n,initialMethods:l,onSuccess:o,submitMode:p="direct",isAuthor:s=!1}){const[f,_]=i.useState(n),[v,E]=i.useState(""),[k,N]=i.useState(""),[q,M]=i.useState(new Map),A=ue(),{toast:F}=me(),U=i.useRef(!1);i.useEffect(()=>{if(!t){U.current=!1;return}if(U.current)return;U.current=!0,_(n),E(""),N("");const b=new Map;(l||[]).forEach(S=>{const R=parseInt(S.id);Number.isNaN(R)||b.set(R,S)}),M(b)},[t,n,l]),i.useEffect(()=>{const b=window.setTimeout(()=>{N(v.trim())},wr);return()=>window.clearTimeout(b)},[v]);const{data:P,isFetching:j}=oe({queryKey:["methods-search",k],queryFn:()=>ga({page_size:kr,...k?{q:k}:{}}),enabled:t});i.useEffect(()=>{var b;(b=P==null?void 0:P.results)!=null&&b.length&&M(S=>{const R=new Map(S);return P.results.forEach(L=>{const m=parseInt(L.id);Number.isNaN(m)||R.set(m,L)}),R})},[P]);const c=i.useMemo(()=>{const b=(P==null?void 0:P.results)||[],S=new Set,R=[];return f.forEach(L=>{if(S.has(L))return;const m=q.get(L);m&&(R.push(m),S.add(L))}),b.forEach(L=>{const m=parseInt(L.id);Number.isNaN(m)||S.has(m)||(R.push(L),S.add(m))}),R},[P,f,q]),x=ve({mutationFn:async({paperId:b,methodIds:S})=>p==="pending"?(await Se({paper_id:parseInt(b),edit_type:"methods",proposed_payload:{method_ids:S}}),null):xa(b,S),onSuccess:b=>{if(p==="pending"){F({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),o==null||o(),a(!1);return}b&&De(A,b,[r,u]),F({title:"Methods updated",description:`Saved ${f.length} method${f.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1)},onError:b=>{var L;const S=b;let R=S.message||(p==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(S.response)try{const m=JSON.parse(S.response);typeof(m==null?void 0:m.detail)=="string"?R=m.detail:Array.isArray(m==null?void 0:m.detail)&&((L=m.detail[0])!=null&&L.msg)&&(R=m.detail[0].msg)}catch{R=S.response}F({title:p==="pending"?"Could not submit edit":"Could not save methods",description:R,variant:"destructive"})}}),D=()=>{x.mutate({paperId:r,methodIds:f})},H=i.useMemo(()=>{if(f.length!==n.length)return!0;const b=new Set(n);return f.some(S=>!b.has(S))},[f,n]),B=(b,S)=>{_(R=>S?R.includes(b)?R:[...R,b]:R.filter(L=>L!==b))},te=()=>E("");return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Paper Methods"}),e.jsx(ge,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),p==="pending"&&e.jsx(Re,{isAuthor:s}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Be,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ie,{type:"text",placeholder:"Search methods...",value:v,onChange:b=>E(b.target.value),className:"pl-9 pr-9"}),v&&e.jsx("button",{type:"button",onClick:te,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(hs,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:c.length>0?e.jsx("div",{className:"space-y-2",children:c.map(b=>{const S=parseInt(b.id),R=f.includes(S);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Nt,{id:`method-${b.id}`,checked:R,onCheckedChange:L=>B(S,L===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${b.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[b.name,b.full_name&&b.full_name!==b.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:b.full_name}),b.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[b.description.substring(0,100),b.description.length>100?"...":""]})]})]},b.id)})}):j?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Be,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:k?`No methods found matching "${k}"`:"No methods available"})]})}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:D,disabled:x.isPending||!H,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),p==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),p==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Cr({open:t,onOpenChange:a,paperId:r,arxivId:u,initialRepositories:n,onSuccess:l,submitMode:o="direct",isAuthor:p=!1}){const[s,f]=i.useState(n),[_,v]=i.useState(""),E=ue(),{toast:k}=me(),N=i.useRef(!1);i.useEffect(()=>{if(!t){N.current=!1;return}N.current||(N.current=!0,f(n),v(""))},[t,n]);const q=ve({mutationFn:async({paperId:c,repositories:x})=>o==="pending"?(await Se({paper_id:parseInt(c),edit_type:"repositories",proposed_payload:{repositories:x}}),null):va(c,x),onSuccess:c=>{if(o==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),l==null||l(),a(!1),v("");return}c&&De(E,c,[r,u]),l==null||l(),a(!1),v("")},onError:c=>{var H;const x=c;let D=x.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(x.response)try{const B=JSON.parse(x.response);typeof(B==null?void 0:B.detail)=="string"?D=B.detail:Array.isArray(B==null?void 0:B.detail)&&((H=B.detail[0])!=null&&H.msg)&&(D=B.detail[0].msg)}catch{D=x.response}k({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:D,variant:"destructive"})}}),M=()=>{const c=_.trim();return c?s.some(x=>x.url===c)?(alert("This repository URL is already added"),null):[...s,{url:c,is_official:!1}]:s},A=()=>{const c=M();c!==null&&c.length!==s.length&&(f(c),v(""))},F=c=>{f(s.filter(x=>x.url!==c))},U=c=>{f(s.map(x=>x.url===c?{...x,is_official:!x.is_official}:x))},P=()=>{const c=M();c!==null&&q.mutate({paperId:r,repositories:c})},j=i.useMemo(()=>{const c=_.trim(),x=c?[...s,{url:c,is_official:!1}]:s;if(x.length!==n.length)return!0;const D=new Map(n.map(H=>[H.url.trim(),!!H.is_official]));return x.some(H=>{const B=D.get(H.url.trim());return B===void 0||B!==!!H.is_official})},[s,_,n]);return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Paper Repositories"}),e.jsx(ge,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(Re,{isAuthor:p}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(ie,{type:"url",placeholder:"https://github.com/owner/repo",value:_,onChange:c=>v(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),A())},className:"flex-1"}),e.jsxs(V,{onClick:A,size:"sm",disabled:!_.trim(),children:[e.jsx(at,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:s.length>0?e.jsx("div",{className:"space-y-2",children:s.map((c,x)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(ss,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:c.url}),c.is_official&&e.jsx(bs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(V,{variant:c.is_official?"default":"outline",size:"sm",onClick:()=>U(c.url),className:"h-8 px-2 text-xs",title:c.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ys,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>F(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(rt,{className:"w-4 h-4"})})]})]},x))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ss,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:P,disabled:q.isPending||!j,children:q.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Er({open:t,onOpenChange:a,paperId:r,arxivId:u,initialProjectPages:n,onSuccess:l,submitMode:o="direct",isAuthor:p=!1}){const[s,f]=i.useState(n),[_,v]=i.useState(""),E=ue(),{toast:k}=me(),N=i.useRef(!1);i.useEffect(()=>{if(!t){N.current=!1;return}N.current||(N.current=!0,f(n),v(""))},[t,n]);const q=ve({mutationFn:async({paperId:c,projectPages:x})=>o==="pending"?(await Se({paper_id:parseInt(c),edit_type:"project_pages",proposed_payload:{project_pages:x}}),null):ja(c,x),onSuccess:c=>{if(o==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),l==null||l(),a(!1),v("");return}c&&De(E,c,[r,u]),l==null||l(),a(!1),v("")},onError:c=>{var H;const x=c;let D=x.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(x.response)try{const B=JSON.parse(x.response);typeof(B==null?void 0:B.detail)=="string"?D=B.detail:Array.isArray(B==null?void 0:B.detail)&&((H=B.detail[0])!=null&&H.msg)&&(D=B.detail[0].msg)}catch{D=x.response}k({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:D,variant:"destructive"})}}),M=()=>{const c=_.trim();return c?s.some(x=>x.url===c)?(alert("This project page URL is already added"),null):[...s,{url:c,is_official:!1}]:s},A=()=>{const c=M();c!==null&&c.length!==s.length&&(f(c),v(""))},F=c=>{f(s.filter(x=>x.url!==c))},U=c=>{f(s.map(x=>x.url===c?{...x,is_official:!x.is_official}:x))},P=()=>{const c=M();c!==null&&q.mutate({paperId:r,projectPages:c})},j=i.useMemo(()=>{const c=_.trim(),x=c?[...s,{url:c,is_official:!1}]:s;if(x.length!==n.length)return!0;const D=new Map(n.map(H=>[H.url.trim(),!!H.is_official]));return x.some(H=>{const B=D.get(H.url.trim());return B===void 0||B!==!!H.is_official})},[s,_,n]);return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Paper Project Pages"}),e.jsx(ge,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(Re,{isAuthor:p}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(ie,{type:"url",placeholder:"https://example.com/project",value:_,onChange:c=>v(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),A())},className:"flex-1"}),e.jsxs(V,{onClick:A,size:"sm",disabled:!_.trim(),children:[e.jsx(at,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:s.length>0?e.jsx("div",{className:"space-y-2",children:s.map((c,x)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(as,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:c.url}),c.is_official&&e.jsx(bs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(V,{variant:c.is_official?"default":"outline",size:"sm",onClick:()=>U(c.url),className:"h-8 px-2 text-xs",title:c.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ys,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>F(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(rt,{className:"w-4 h-4"})})]})]},x))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(as,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:P,disabled:q.isPending||!j,children:q.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Sr({open:t,onOpenChange:a,paperId:r,arxivId:u,initialUrl:n,onSuccess:l,submitMode:o="direct",isAuthor:p=!1}){const[s,f]=i.useState(n),_=ue(),{toast:v}=me(),E=i.useRef(!1);i.useEffect(()=>{if(!t){E.current=!1;return}E.current||(E.current=!0,f(n))},[t,n]);const k=ve({mutationFn:async({paperId:F,sourceUrl:U})=>o==="pending"?(await Se({paper_id:parseInt(F),edit_type:"source_url",proposed_payload:{source_url:U}}),null):ba(F,U),onSuccess:F=>{if(o==="pending"){v({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),l==null||l(),a(!1);return}F&&De(_,F,[r,u]),l==null||l(),a(!1)},onError:F=>{var j;const U=F;let P=U.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(U.response)try{const c=JSON.parse(U.response);typeof(c==null?void 0:c.detail)=="string"?P=c.detail:Array.isArray(c==null?void 0:c.detail)&&((j=c.detail[0])!=null&&j.msg)&&(P=c.detail[0].msg)}catch{P=U.response}v({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:P,variant:"destructive"})}}),N=s.trim(),q=/^https?:\/\//i.test(N),M=N!==(n||"").trim(),A=()=>{q&&k.mutate({paperId:r,sourceUrl:N})};return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Source URL"}),e.jsxs(ge,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(Re,{isAuthor:p}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(ie,{type:"url",placeholder:"https://example.com/paper",value:s,onChange:F=>f(F.target.value),onKeyPress:F=>{F.key==="Enter"&&q&&M&&(F.preventDefault(),A())}}),!q&&N.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:A,disabled:k.isPending||!q||!M,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Pr(t){const a=Rr(t),r=i.forwardRef((u,n)=>{const{children:l,...o}=u,p=i.Children.toArray(l),s=p.find(Ir);if(s){const f=s.props.children,_=p.map(v=>v===s?i.Children.count(f)>1?i.Children.only(null):i.isValidElement(f)?f.props.children:null:v);return e.jsx(a,{...o,ref:n,children:i.isValidElement(f)?i.cloneElement(f,void 0,_):null})}return e.jsx(a,{...o,ref:n,children:l})});return r.displayName=`${t}.Slot`,r}function Rr(t){const a=i.forwardRef((r,u)=>{const{children:n,...l}=r;if(i.isValidElement(n)){const o=Tr(n),p=Fr(l,n.props);return n.type!==i.Fragment&&(p.ref=u?$e(u,o):o),i.cloneElement(n,p)}return i.Children.count(n)>1?i.Children.only(null):null});return a.displayName=`${t}.SlotClone`,a}var Ar=Symbol("radix.slottable");function Ir(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Ar}function Fr(t,a){const r={...a};for(const u in a){const n=t[u],l=a[u];/^on[A-Z]/.test(u)?n&&l?r[u]=(...p)=>{const s=l(...p);return n(...p),s}:n&&(r[u]=n):u==="style"?r[u]={...n,...l}:u==="className"&&(r[u]=[n,l].filter(Boolean).join(" "))}return{...t,...r}}function Tr(t){var u,n;let a=(u=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:u.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?t.ref:(a=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var it="Popover",[Ps]=ps(it,[gs]),Oe=gs(),[$r,je]=Ps(it),Rs=t=>{const{__scopePopover:a,children:r,open:u,defaultOpen:n,onOpenChange:l,modal:o=!1}=t,p=Oe(a),s=i.useRef(null),[f,_]=i.useState(!1),[v,E]=ms({prop:u,defaultProp:n??!1,onChange:l,caller:it});return e.jsx(ya,{...p,children:e.jsx($r,{scope:a,contentId:Ne(),triggerRef:s,open:v,onOpenChange:E,onOpenToggle:i.useCallback(()=>E(k=>!k),[E]),hasCustomAnchor:f,onCustomAnchorAdd:i.useCallback(()=>_(!0),[]),onCustomAnchorRemove:i.useCallback(()=>_(!1),[]),modal:o,children:r})})};Rs.displayName=it;var As="PopoverAnchor",Lr=i.forwardRef((t,a)=>{const{__scopePopover:r,...u}=t,n=je(As,r),l=Oe(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(o(),()=>p()),[o,p]),e.jsx(xs,{...l,...u,ref:a})});Lr.displayName=As;var Is="PopoverTrigger",Fs=i.forwardRef((t,a)=>{const{__scopePopover:r,...u}=t,n=je(Is,r),l=Oe(r),o=tt(a,n.triggerRef),p=e.jsx(Y.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Ms(n.open),...u,ref:o,onClick:ke(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:e.jsx(xs,{asChild:!0,...l,children:p})});Fs.displayName=Is;var Ct="PopoverPortal",[Dr,Mr]=Ps(Ct,{forceMount:void 0}),Ts=t=>{const{__scopePopover:a,forceMount:r,children:u,container:n}=t,l=je(Ct,a);return e.jsx(Dr,{scope:a,forceMount:r,children:e.jsx(yt,{present:r||l.open,children:e.jsx(_a,{asChild:!0,container:n,children:u})})})};Ts.displayName=Ct;var Le="PopoverContent",$s=i.forwardRef((t,a)=>{const r=Mr(Le,t.__scopePopover),{forceMount:u=r.forceMount,...n}=t,l=je(Le,t.__scopePopover);return e.jsx(yt,{present:u||l.open,children:l.modal?e.jsx(qr,{...n,ref:a}):e.jsx(Hr,{...n,ref:a})})});$s.displayName=Le;var Ur=Pr("PopoverContent.RemoveScroll"),qr=i.forwardRef((t,a)=>{const r=je(Le,t.__scopePopover),u=i.useRef(null),n=tt(a,u),l=i.useRef(!1);return i.useEffect(()=>{const o=u.current;if(o)return wa(o)},[]),e.jsx(ka,{as:Ur,allowPinchZoom:!0,children:e.jsx(Ls,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(t.onCloseAutoFocus,o=>{var p;o.preventDefault(),l.current||(p=r.triggerRef.current)==null||p.focus()}),onPointerDownOutside:ke(t.onPointerDownOutside,o=>{const p=o.detail.originalEvent,s=p.button===0&&p.ctrlKey===!0,f=p.button===2||s;l.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:ke(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Hr=i.forwardRef((t,a)=>{const r=je(Le,t.__scopePopover),u=i.useRef(!1),n=i.useRef(!1);return e.jsx(Ls,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var o,p;(o=t.onCloseAutoFocus)==null||o.call(t,l),l.defaultPrevented||(u.current||(p=r.triggerRef.current)==null||p.focus(),l.preventDefault()),u.current=!1,n.current=!1},onInteractOutside:l=>{var s,f;(s=t.onInteractOutside)==null||s.call(t,l),l.defaultPrevented||(u.current=!0,l.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const o=l.target;((f=r.triggerRef.current)==null?void 0:f.contains(o))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&n.current&&l.preventDefault()}})}),Ls=i.forwardRef((t,a)=>{const{__scopePopover:r,trapFocus:u,onOpenAutoFocus:n,onCloseAutoFocus:l,disableOutsidePointerEvents:o,onEscapeKeyDown:p,onPointerDownOutside:s,onFocusOutside:f,onInteractOutside:_,...v}=t,E=je(Le,r),k=Oe(r);return Na(),e.jsx(Ca,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:n,onUnmountAutoFocus:l,children:e.jsx(Ea,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:_,onEscapeKeyDown:p,onPointerDownOutside:s,onFocusOutside:f,onDismiss:()=>E.onOpenChange(!1),children:e.jsx(Sa,{"data-state":Ms(E.open),role:"dialog",id:E.contentId,...k,...v,ref:a,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ds="PopoverClose",Br=i.forwardRef((t,a)=>{const{__scopePopover:r,...u}=t,n=je(Ds,r);return e.jsx(Y.button,{type:"button",...u,ref:a,onClick:ke(t.onClick,()=>n.onOpenChange(!1))})});Br.displayName=Ds;var Or="PopoverArrow",Kr=i.forwardRef((t,a)=>{const{__scopePopover:r,...u}=t,n=Oe(r);return e.jsx(Pa,{...n,...u,ref:a})});Kr.displayName=Or;function Ms(t){return t?"open":"closed"}var zr=Rs,Qr=Fs,Vr=Ts,Us=$s;const Gr=zr,Wr=Qr,qs=i.forwardRef(({className:t,align:a="center",sideOffset:r=4,...u},n)=>e.jsx(Vr,{children:e.jsx(Us,{ref:n,align:a,sideOffset:r,className:re("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...u})}));qs.displayName=Us.displayName;var rs=1,Xr=.9,Jr=.8,Yr=.17,ut=.1,mt=.999,Zr=.9999,en=.99,tn=/[\\\/_+.#"@\[\(\{&]/,sn=/[\\\/_+.#"@\[\(\{&]/g,an=/[\s-]/,Hs=/[\s-]/g;function jt(t,a,r,u,n,l,o){if(l===a.length)return n===t.length?rs:en;var p=`${n},${l}`;if(o[p]!==void 0)return o[p];for(var s=u.charAt(l),f=r.indexOf(s,n),_=0,v,E,k,N;f>=0;)v=jt(t,a,r,u,f+1,l+1,o),v>_&&(f===n?v*=rs:tn.test(t.charAt(f-1))?(v*=Jr,k=t.slice(n,f-1).match(sn),k&&n>0&&(v*=Math.pow(mt,k.length))):an.test(t.charAt(f-1))?(v*=Xr,N=t.slice(n,f-1).match(Hs),N&&n>0&&(v*=Math.pow(mt,N.length))):(v*=Yr,n>0&&(v*=Math.pow(mt,f-n))),t.charAt(f)!==a.charAt(l)&&(v*=Zr)),(v<ut&&r.charAt(f-1)===u.charAt(l+1)||u.charAt(l+1)===u.charAt(l)&&r.charAt(f-1)!==u.charAt(l))&&(E=jt(t,a,r,u,f+1,l+2,o),E*ut>v&&(v=E*ut)),v>_&&(_=v),f=r.indexOf(s,f+1);return o[p]=_,_}function ns(t){return t.toLowerCase().replace(Hs," ")}function rn(t,a,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,jt(t,a,ns(t),ns(a),0,0,{})}var qe='[cmdk-group=""]',pt='[cmdk-group-items=""]',nn='[cmdk-group-heading=""]',Bs='[cmdk-item=""]',is=`${Bs}:not([aria-disabled="true"])`,bt="cmdk-item-select",Ie="data-value",on=(t,a,r)=>rn(t,a,r),Os=i.createContext(void 0),Ke=()=>i.useContext(Os),Ks=i.createContext(void 0),Et=()=>i.useContext(Ks),zs=i.createContext(void 0),Qs=i.forwardRef((t,a)=>{let r=Fe(()=>{var h,$;return{search:"",value:($=(h=t.value)!=null?h:t.defaultValue)!=null?$:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=Fe(()=>new Set),n=Fe(()=>new Map),l=Fe(()=>new Map),o=Fe(()=>new Set),p=Vs(t),{label:s,children:f,value:_,onValueChange:v,filter:E,shouldFilter:k,loop:N,disablePointerSelection:q=!1,vimBindings:M=!0,...A}=t,F=Ne(),U=Ne(),P=Ne(),j=i.useRef(null),c=vn();Ce(()=>{if(_!==void 0){let h=_.trim();r.current.value=h,x.emit()}},[_]),Ce(()=>{c(6,S)},[]);let x=i.useMemo(()=>({subscribe:h=>(o.current.add(h),()=>o.current.delete(h)),snapshot:()=>r.current,setState:(h,$,O)=>{var I,K,Q,X;if(!Object.is(r.current[h],$)){if(r.current[h]=$,h==="search")b(),B(),c(1,te);else if(h==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let W=document.getElementById(P);W?W.focus():(I=document.getElementById(F))==null||I.focus()}if(c(7,()=>{var W;r.current.selectedItemId=(W=R())==null?void 0:W.id,x.emit()}),O||c(5,S),((K=p.current)==null?void 0:K.value)!==void 0){let W=$??"";(X=(Q=p.current).onValueChange)==null||X.call(Q,W);return}}x.emit()}},emit:()=>{o.current.forEach(h=>h())}}),[]),D=i.useMemo(()=>({value:(h,$,O)=>{var I;$!==((I=l.current.get(h))==null?void 0:I.value)&&(l.current.set(h,{value:$,keywords:O}),r.current.filtered.items.set(h,H($,O)),c(2,()=>{B(),x.emit()}))},item:(h,$)=>(u.current.add(h),$&&(n.current.has($)?n.current.get($).add(h):n.current.set($,new Set([h]))),c(3,()=>{b(),B(),r.current.value||te(),x.emit()}),()=>{l.current.delete(h),u.current.delete(h),r.current.filtered.items.delete(h);let O=R();c(4,()=>{b(),(O==null?void 0:O.getAttribute("id"))===h&&te(),x.emit()})}),group:h=>(n.current.has(h)||n.current.set(h,new Set),()=>{l.current.delete(h),n.current.delete(h)}),filter:()=>p.current.shouldFilter,label:s||t["aria-label"],getDisablePointerSelection:()=>p.current.disablePointerSelection,listId:F,inputId:P,labelId:U,listInnerRef:j}),[]);function H(h,$){var O,I;let K=(I=(O=p.current)==null?void 0:O.filter)!=null?I:on;return h?K(h,r.current.search,$):0}function B(){if(!r.current.search||p.current.shouldFilter===!1)return;let h=r.current.filtered.items,$=[];r.current.filtered.groups.forEach(I=>{let K=n.current.get(I),Q=0;K.forEach(X=>{let W=h.get(X);Q=Math.max(W,Q)}),$.push([I,Q])});let O=j.current;L().sort((I,K)=>{var Q,X;let W=I.getAttribute("id"),Z=K.getAttribute("id");return((Q=h.get(Z))!=null?Q:0)-((X=h.get(W))!=null?X:0)}).forEach(I=>{let K=I.closest(pt);K?K.appendChild(I.parentElement===K?I:I.closest(`${pt} > *`)):O.appendChild(I.parentElement===O?I:I.closest(`${pt} > *`))}),$.sort((I,K)=>K[1]-I[1]).forEach(I=>{var K;let Q=(K=j.current)==null?void 0:K.querySelector(`${qe}[${Ie}="${encodeURIComponent(I[0])}"]`);Q==null||Q.parentElement.appendChild(Q)})}function te(){let h=L().find(O=>O.getAttribute("aria-disabled")!=="true"),$=h==null?void 0:h.getAttribute(Ie);x.setState("value",$||void 0)}function b(){var h,$,O,I;if(!r.current.search||p.current.shouldFilter===!1){r.current.filtered.count=u.current.size;return}r.current.filtered.groups=new Set;let K=0;for(let Q of u.current){let X=($=(h=l.current.get(Q))==null?void 0:h.value)!=null?$:"",W=(I=(O=l.current.get(Q))==null?void 0:O.keywords)!=null?I:[],Z=H(X,W);r.current.filtered.items.set(Q,Z),Z>0&&K++}for(let[Q,X]of n.current)for(let W of X)if(r.current.filtered.items.get(W)>0){r.current.filtered.groups.add(Q);break}r.current.filtered.count=K}function S(){var h,$,O;let I=R();I&&(((h=I.parentElement)==null?void 0:h.firstChild)===I&&((O=($=I.closest(qe))==null?void 0:$.querySelector(nn))==null||O.scrollIntoView({block:"nearest"})),I.scrollIntoView({block:"nearest"}))}function R(){var h;return(h=j.current)==null?void 0:h.querySelector(`${Bs}[aria-selected="true"]`)}function L(){var h;return Array.from(((h=j.current)==null?void 0:h.querySelectorAll(is))||[])}function m(h){let $=L()[h];$&&x.setState("value",$.getAttribute(Ie))}function w(h){var $;let O=R(),I=L(),K=I.findIndex(X=>X===O),Q=I[K+h];($=p.current)!=null&&$.loop&&(Q=K+h<0?I[I.length-1]:K+h===I.length?I[0]:I[K+h]),Q&&x.setState("value",Q.getAttribute(Ie))}function C(h){let $=R(),O=$==null?void 0:$.closest(qe),I;for(;O&&!I;)O=h>0?xn(O,qe):gn(O,qe),I=O==null?void 0:O.querySelector(is);I?x.setState("value",I.getAttribute(Ie)):w(h)}let g=()=>m(L().length-1),y=h=>{h.preventDefault(),h.metaKey?g():h.altKey?C(1):w(1)},z=h=>{h.preventDefault(),h.metaKey?m(0):h.altKey?C(-1):w(-1)};return i.createElement(Y.div,{ref:a,tabIndex:-1,...A,"cmdk-root":"",onKeyDown:h=>{var $;($=A.onKeyDown)==null||$.call(A,h);let O=h.nativeEvent.isComposing||h.keyCode===229;if(!(h.defaultPrevented||O))switch(h.key){case"n":case"j":{M&&h.ctrlKey&&y(h);break}case"ArrowDown":{y(h);break}case"p":case"k":{M&&h.ctrlKey&&z(h);break}case"ArrowUp":{z(h);break}case"Home":{h.preventDefault(),m(0);break}case"End":{h.preventDefault(),g();break}case"Enter":{h.preventDefault();let I=R();if(I){let K=new Event(bt);I.dispatchEvent(K)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:bn},s),ot(t,h=>i.createElement(Ks.Provider,{value:x},i.createElement(Os.Provider,{value:D},h))))}),ln=i.forwardRef((t,a)=>{var r,u;let n=Ne(),l=i.useRef(null),o=i.useContext(zs),p=Ke(),s=Vs(t),f=(u=(r=s.current)==null?void 0:r.forceMount)!=null?u:o==null?void 0:o.forceMount;Ce(()=>{if(!f)return p.item(n,o==null?void 0:o.id)},[f]);let _=Gs(n,l,[t.value,t.children,l],t.keywords),v=Et(),E=de(c=>c.value&&c.value===_.current),k=de(c=>f||p.filter()===!1?!0:c.search?c.filtered.items.get(n)>0:!0);i.useEffect(()=>{let c=l.current;if(!(!c||t.disabled))return c.addEventListener(bt,N),()=>c.removeEventListener(bt,N)},[k,t.onSelect,t.disabled]);function N(){var c,x;q(),(x=(c=s.current).onSelect)==null||x.call(c,_.current)}function q(){v.setState("value",_.current,!0)}if(!k)return null;let{disabled:M,value:A,onSelect:F,forceMount:U,keywords:P,...j}=t;return i.createElement(Y.div,{ref:$e(l,a),...j,id:n,"cmdk-item":"",role:"option","aria-disabled":!!M,"aria-selected":!!E,"data-disabled":!!M,"data-selected":!!E,onPointerMove:M||p.getDisablePointerSelection()?void 0:q,onClick:M?void 0:N},t.children)}),cn=i.forwardRef((t,a)=>{let{heading:r,children:u,forceMount:n,...l}=t,o=Ne(),p=i.useRef(null),s=i.useRef(null),f=Ne(),_=Ke(),v=de(k=>n||_.filter()===!1?!0:k.search?k.filtered.groups.has(o):!0);Ce(()=>_.group(o),[]),Gs(o,p,[t.value,t.heading,s]);let E=i.useMemo(()=>({id:o,forceMount:n}),[n]);return i.createElement(Y.div,{ref:$e(p,a),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&i.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:f},r),ot(t,k=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?f:void 0},i.createElement(zs.Provider,{value:E},k))))}),dn=i.forwardRef((t,a)=>{let{alwaysRender:r,...u}=t,n=i.useRef(null),l=de(o=>!o.search);return!r&&!l?null:i.createElement(Y.div,{ref:$e(n,a),...u,"cmdk-separator":"",role:"separator"})}),un=i.forwardRef((t,a)=>{let{onValueChange:r,...u}=t,n=t.value!=null,l=Et(),o=de(f=>f.search),p=de(f=>f.selectedItemId),s=Ke();return i.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),i.createElement(Y.input,{ref:a,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":p,id:s.inputId,type:"text",value:n?t.value:o,onChange:f=>{n||l.setState("search",f.target.value),r==null||r(f.target.value)}})}),mn=i.forwardRef((t,a)=>{let{children:r,label:u="Suggestions",...n}=t,l=i.useRef(null),o=i.useRef(null),p=de(f=>f.selectedItemId),s=Ke();return i.useEffect(()=>{if(o.current&&l.current){let f=o.current,_=l.current,v,E=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let k=f.offsetHeight;_.style.setProperty("--cmdk-list-height",k.toFixed(1)+"px")})});return E.observe(f),()=>{cancelAnimationFrame(v),E.unobserve(f)}}},[]),i.createElement(Y.div,{ref:$e(l,a),...n,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":p,"aria-label":u,id:s.listId},ot(t,f=>i.createElement("div",{ref:$e(o,s.listInnerRef),"cmdk-list-sizer":""},f)))}),pn=i.forwardRef((t,a)=>{let{open:r,onOpenChange:u,overlayClassName:n,contentClassName:l,container:o,...p}=t;return i.createElement(nr,{open:r,onOpenChange:u},i.createElement(ir,{container:o},i.createElement(or,{"cmdk-overlay":"",className:n}),i.createElement(lr,{"aria-label":t.label,"cmdk-dialog":"",className:l},i.createElement(Qs,{ref:a,...p}))))}),hn=i.forwardRef((t,a)=>de(r=>r.filtered.count===0)?i.createElement(Y.div,{ref:a,...t,"cmdk-empty":"",role:"presentation"}):null),fn=i.forwardRef((t,a)=>{let{progress:r,children:u,label:n="Loading...",...l}=t;return i.createElement(Y.div,{ref:a,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},ot(t,o=>i.createElement("div",{"aria-hidden":!0},o)))}),J=Object.assign(Qs,{List:mn,Item:ln,Input:un,Group:cn,Separator:dn,Dialog:pn,Empty:hn,Loading:fn});function xn(t,a){let r=t.nextElementSibling;for(;r;){if(r.matches(a))return r;r=r.nextElementSibling}}function gn(t,a){let r=t.previousElementSibling;for(;r;){if(r.matches(a))return r;r=r.previousElementSibling}}function Vs(t){let a=i.useRef(t);return Ce(()=>{a.current=t}),a}var Ce=typeof window>"u"?i.useEffect:i.useLayoutEffect;function Fe(t){let a=i.useRef();return a.current===void 0&&(a.current=t()),a}function de(t){let a=Et(),r=()=>t(a.snapshot());return i.useSyncExternalStore(a.subscribe,r,r)}function Gs(t,a,r,u=[]){let n=i.useRef(),l=Ke();return Ce(()=>{var o;let p=(()=>{var f;for(let _ of r){if(typeof _=="string")return _.trim();if(typeof _=="object"&&"current"in _)return _.current?(f=_.current.textContent)==null?void 0:f.trim():n.current}})(),s=u.map(f=>f.trim());l.value(t,p,s),(o=a.current)==null||o.setAttribute(Ie,p),n.current=p}),n}var vn=()=>{let[t,a]=i.useState(),r=Fe(()=>new Map);return Ce(()=>{r.current.forEach(u=>u()),r.current=new Map},[t]),(u,n)=>{r.current.set(u,n),a({})}};function jn(t){let a=t.type;return typeof a=="function"?a(t.props):"render"in a?a.render(t.props):t}function ot({asChild:t,children:a},r){return t&&i.isValidElement(a)?i.cloneElement(jn(a),{ref:a.ref},r(a.props.children)):r(a)}var bn={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ws=i.forwardRef(({className:t,...a},r)=>e.jsx(J,{ref:r,className:re("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...a}));Ws.displayName=J.displayName;const Xs=i.forwardRef(({className:t,...a},r)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Be,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(J.Input,{ref:r,className:re("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...a})]}));Xs.displayName=J.Input.displayName;const Js=i.forwardRef(({className:t,...a},r)=>e.jsx(J.List,{ref:r,className:re("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...a}));Js.displayName=J.List.displayName;const Ys=i.forwardRef((t,a)=>e.jsx(J.Empty,{ref:a,className:"py-6 text-center text-sm",...t}));Ys.displayName=J.Empty.displayName;const Zs=i.forwardRef(({className:t,...a},r)=>e.jsx(J.Group,{ref:r,className:re("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...a}));Zs.displayName=J.Group.displayName;const yn=i.forwardRef(({className:t,...a},r)=>e.jsx(J.Separator,{ref:r,className:re("-mx-1 h-px bg-border",t),...a}));yn.displayName=J.Separator.displayName;const ea=i.forwardRef(({className:t,...a},r)=>e.jsx(J.Item,{ref:r,className:re("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...a}));ea.displayName=J.Item.displayName;const _n=250;function os({value:t,onChange:a,placeholder:r="Select...",searchPlaceholder:u="Search...",emptyMessage:n="No results found.",disabled:l=!1,selectedOption:o,queryKey:p,queryFn:s,enabled:f=!0,className:_}){const[v,E]=i.useState(!1),[k,N]=i.useState(""),[q,M]=i.useState("");i.useEffect(()=>{const j=window.setTimeout(()=>{M(k.trim())},_n);return()=>window.clearTimeout(j)},[k]),i.useEffect(()=>{v||(N(""),M(""))},[v]);const{data:A=[],isFetching:F}=oe({queryKey:[...p,q],queryFn:()=>s(q),enabled:f&&v}),U=i.useMemo(()=>!t||A.some(j=>j.value===t)?A:(o==null?void 0:o.value)===t?[o,...A]:A,[A,o,t]),P=i.useMemo(()=>{if(!t)return r;const j=U.find(c=>c.value===t)??((o==null?void 0:o.value)===t?o:null);return(j==null?void 0:j.label)??r},[U,r,o,t]);return e.jsxs(Gr,{open:v,onOpenChange:E,modal:!0,children:[e.jsx(Wr,{asChild:!0,children:e.jsxs(V,{type:"button",variant:"outline",role:"combobox","aria-expanded":v,disabled:l,className:re("h-8 w-full justify-between px-2 text-sm font-normal",!t&&"text-muted-foreground",_),children:[e.jsx("span",{className:"truncate",children:P}),e.jsx(dr,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(qs,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:j=>j.stopPropagation(),children:e.jsxs(Ws,{shouldFilter:!1,className:"h-full",children:[e.jsx(Xs,{placeholder:u,value:k,onValueChange:N}),e.jsx(Js,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:F?e.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[e.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):U.length===0?e.jsx(Ys,{children:n}):e.jsx(Zs,{children:U.map(j=>e.jsxs(ea,{value:j.value,onSelect:()=>{a(j.value),E(!1)},children:[e.jsx(le,{className:re("mr-2 h-4 w-4",t===j.value?"opacity-100":"opacity-0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate",children:j.label}),j.description?e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:j.description}):null]})]},j.value))})})]})})]})}const ht=100;function wn(t){return t.map(a=>{const r=a.best_metric||Object.keys(a.metrics)[0],u=a.metrics[r];return{id:a.id,task_id:a.task_id,dataset_id:a.dataset_id,model_name:a.model_name||"",harness:a.harness||"",metric_name:r||"",metric_value:String(u||""),best_rank:a.best_rank?String(a.best_rank):"",num_parameters:a.num_parameters!=null?String(a.num_parameters):"",is_open:a.is_open!==!1,operation:"unchanged"}})}function kn(t){const a=new Map;return t.forEach(r=>{r.task_id&&r.task_name&&a.set(r.task_id,{id:r.task_id,name:r.task_name,slug:r.task_slug,level:0})}),a}function Nn(t){const a=new Map;return t.forEach(r=>{r.dataset_id&&r.dataset_name&&a.set(r.dataset_id,{id:r.dataset_id,name:r.dataset_name,slug:r.dataset_slug})}),a}function ls(t,a){return`${t}:${a}`}function Je(t){const a=t.trim();if(a==="")return null;const r=Number(a);return!Number.isFinite(r)||r<0?null:Math.trunc(r)}function Cn({open:t,onOpenChange:a,paperId:r,arxivId:u,initialEvaluations:n,onSuccess:l,submitMode:o="direct",isAuthor:p=!1}){const[s,f]=i.useState([]),[_,v]=i.useState(new Map),[E,k]=i.useState(new Map),N=ue(),{toast:q}=me(),M=i.useRef(!1),A=i.useRef(!1);i.useEffect(()=>{if(!t){M.current=!1,A.current=!1;return}M.current||A.current||n.length!==0&&(M.current=!0,f(wn(n)),v(kn(n)),k(Nn(n)))},[t,n]);const F=i.useMemo(()=>Array.from(new Set(s.map(m=>m.task_id).filter(m=>m&&m!==""))),[s]),U=i.useMemo(()=>{const m=new Set;return s.forEach(w=>{w.task_id&&w.dataset_id&&m.add(ls(w.task_id,w.dataset_id))}),Array.from(m)},[s]),P=oe({queryKey:["datasets-by-tasks-for-eval-edit",F,t],queryFn:async()=>{const m={};return await Promise.all(F.map(async w=>{try{const C=await ts({task_id:parseInt(w),page_size:ht});m[w]=C.results}catch(C){console.error(`Error fetching datasets for task ${w}:`,C),m[w]=[]}})),m},enabled:t&&F.length>0});i.useEffect(()=>{P.data&&k(m=>{const w=new Map(m);return Object.values(P.data).forEach(C=>{C.forEach(g=>{w.set(g.id,g)})}),w})},[P.data]);const j=oe({queryKey:["leaderboard-metrics-for-eval-edit",U,t],queryFn:async()=>{const m={};return await Promise.all(U.map(async w=>{const[C,g]=w.split(":");try{m[w]=await Fa(g,C)}catch(y){console.error(`Error fetching metrics for leaderboard ${w}:`,y),m[w]=[]}})),m},enabled:t&&U.length>0}),c=async m=>{const w=await fs({page_size:ht,visible_only:!0,...m?{q:m}:{}});return v(C=>{const g=new Map(C);return w.results.forEach(y=>g.set(y.id,y)),g}),w.results.map(C=>{var g;return{value:C.id,label:C.name,description:(g=C.description)==null?void 0:g.slice(0,100)}})},x=m=>async w=>{const C=await ts({task_id:parseInt(m),page_size:ht,...w?{q:w}:{}});return k(g=>{const y=new Map(g);return C.results.forEach(z=>y.set(z.id,z)),y}),C.results.map(g=>({value:g.id,label:g.name,description:g.full_name}))},D=(m,w)=>{if(!m||!w)return!1;const C=E.get(w);return!!(C!=null&&C.supports_harness)},H=(m,w,C)=>{var z;if(!m||!w)return[];const y=(((z=j.data)==null?void 0:z[ls(m,w)])||[]).map(h=>({value:h.metric_name,label:h.metric_name,description:h.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return C&&!y.some(h=>h.value===C)&&y.unshift({value:C,label:`${C} (legacy)`,description:void 0}),y},B=ve({mutationFn:async({paperId:m,evaluations:w})=>{if(o==="pending"){const g=[];for(const y of w){if(y.operation==="delete"&&y.id){g.push({op:"delete",evaluation_id:parseInt(y.id)});continue}const z=D(y.task_id,y.dataset_id);if(y.operation==="create"){const h=Je(y.num_parameters),$={task_id:parseInt(y.task_id),dataset_id:parseInt(y.dataset_id),metrics:{[y.metric_name]:y.metric_value},best_metric:y.metric_name};y.model_name&&($.model_name=y.model_name),z&&y.harness&&($.harness=y.harness),y.best_rank&&($.best_rank=parseInt(y.best_rank)),h!=null&&($.num_parameters=h),$.is_open=y.is_open,g.push({op:"create",data:$})}else if(y.operation==="update"&&y.id){const h={task_id:parseInt(y.task_id),dataset_id:parseInt(y.dataset_id),model_name:y.model_name||void 0,harness:z&&y.harness||null,metrics:{[y.metric_name]:y.metric_value},best_metric:y.metric_name,best_rank:y.best_rank?parseInt(y.best_rank):void 0,num_parameters:Je(y.num_parameters),is_open:y.is_open};g.push({op:"update",evaluation_id:parseInt(y.id),data:h})}}return g.length===0?{submitted:!1}:(await Se({paper_id:parseInt(m),edit_type:"evaluations",proposed_payload:{operations:g}}),{submitted:!0})}let C=!1;for(const g of w)if(g.operation==="delete"&&g.id){C=!0;try{await Ra(g.id)}catch(y){if((typeof y=="object"&&y!==null&&"status"in y?y.status:void 0)!==404)throw y;console.log(`Evaluation ${g.id} already deleted or not found`)}}else if(g.operation==="create"){C=!0;const y=D(g.task_id,g.dataset_id),z=Je(g.num_parameters);await Aa({paper_id:parseInt(m),task_id:parseInt(g.task_id),dataset_id:parseInt(g.dataset_id),model_name:g.model_name||void 0,harness:y&&g.harness||void 0,metrics:{[g.metric_name]:g.metric_value},best_metric:g.metric_name,best_rank:g.best_rank?parseInt(g.best_rank):void 0,num_parameters:z??void 0,is_open:g.is_open})}else if(g.operation==="update"&&g.id){C=!0;const y=D(g.task_id,g.dataset_id);await Ia(g.id,{task_id:parseInt(g.task_id),dataset_id:parseInt(g.dataset_id),model_name:g.model_name||void 0,harness:y&&g.harness||null,metrics:{[g.metric_name]:g.metric_value},best_metric:g.metric_name,best_rank:g.best_rank?parseInt(g.best_rank):void 0,num_parameters:Je(g.num_parameters),is_open:g.is_open})}return{submitted:C}},onSuccess:m=>{if(o==="pending"){m!=null&&m.submitted?q({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):q({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),l==null||l(),a(!1);return}N.invalidateQueries({queryKey:["paper-arxiv",u]}),N.invalidateQueries({queryKey:["evaluations","paper",r]}),l==null||l(),a(!1)},onError:m=>{var g;const w=m;let C=w.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(w.response)try{const y=JSON.parse(w.response);typeof(y==null?void 0:y.detail)=="string"?C=y.detail:Array.isArray(y==null?void 0:y.detail)&&((g=y.detail[0])!=null&&g.msg)&&(C=y.detail[0].msg)}catch{C=w.response}q({title:o==="pending"?"Could not submit edit":"Could not save evaluations",description:C,variant:"destructive"})}}),te=()=>{A.current=!0,f([...s,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",is_open:!0,operation:"create"}])},b=m=>{A.current=!0,s[m].id?f(s.map((C,g)=>g===m?{...C,operation:"delete"}:C)):f(s.filter((C,g)=>g!==m))},S=(m,w,C)=>{A.current=!0,f(s.map((g,y)=>{if(y!==m)return g;const z={...g,[w]:C};return w==="task_id"&&(z.dataset_id="",z.metric_name="",z.harness=""),w==="dataset_id"&&(z.metric_name="",C&&!D(z.task_id,C)&&(z.harness="")),g.operation==="unchanged"&&(z.operation="update"),z}))},R=(m,w)=>{A.current=!0,f(s.map((C,g)=>{if(g!==m)return C;const y={...C,is_open:w};return C.operation==="unchanged"&&(y.operation="update"),y}))},L=()=>{const m=s.filter(w=>w.operation!=="delete"||w.id);B.mutate({paperId:r,evaluations:m})};return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Evaluation Results"}),e.jsx(ge,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),o==="pending"&&e.jsx(Re,{isAuthor:p}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[s.filter(m=>m.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Model"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:s.map((m,w)=>{if(m.operation==="delete")return null;const C=_.get(m.task_id),g=E.get(m.dataset_id),y=H(m.task_id,m.dataset_id,m.metric_name),z=!!(m.task_id&&m.dataset_id)&&j.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(os,{value:m.task_id,onChange:h=>S(w,"task_id",h),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:C?{value:C.id,label:C.name}:null,queryKey:["eval-edit-task-search"],queryFn:c,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(os,{value:m.dataset_id,onChange:h=>S(w,"dataset_id",h),placeholder:m.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:m.task_id?"No datasets found for this task.":"Select a task first.",disabled:!m.task_id,selectedOption:g?{value:g.id,label:g.name}:null,queryKey:["eval-edit-dataset-search",m.task_id],queryFn:x(m.task_id),enabled:t&&!!m.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ie,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:m.model_name,onChange:h=>S(w,"model_name",h.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:D(m.task_id,m.dataset_id)?e.jsx(ie,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:m.harness,onChange:h=>S(w,"harness",h.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!m.task_id||!m.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):z?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(ne,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):y.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:m.metric_name,onChange:h=>S(w,"metric_name",h.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),y.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ie,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:m.metric_value,onChange:h=>S(w,"metric_value",h.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ie,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:m.num_parameters,onChange:h=>S(w,"num_parameters",h.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:m.is_open,onChange:h=>R(w,h.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>b(w),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(rt,{className:"w-4 h-4"})})})]},w)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(cr,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(V,{variant:"outline",size:"sm",onClick:te,className:"flex items-center space-x-2",children:[e.jsx(at,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:L,disabled:B.isPending,children:B.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const ft=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function cs(t){return t.map(a=>a.trim()).filter(Boolean)}function xt(t,a){const r=cs(t).sort(),u=cs(a).sort();return r.length!==u.length?!1:r.every((n,l)=>n===u[l])}function En(t,a){return xt(t.hf_models,a.hf_models)&&xt(t.hf_datasets,a.hf_datasets)&&xt(t.hf_spaces,a.hf_spaces)}function Sn({open:t,onOpenChange:a,paperId:r,arxivId:u,initialArtifacts:n,onSuccess:l,submitMode:o="direct",isAuthor:p=!1}){const[s,f]=i.useState(n),[_,v]=i.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),E=ue(),{toast:k}=me(),N=i.useRef(!1);i.useEffect(()=>{if(!t){N.current=!1;return}N.current||(N.current=!0,f(n),v({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,n]);const q=ve({mutationFn:async({paperId:j,artifacts:c})=>o==="pending"?(await Se({paper_id:parseInt(j),edit_type:"hf_artifacts",proposed_payload:c}),null):Ta(j,c),onSuccess:j=>{if(o==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),l==null||l(),a(!1),v({hf_models:"",hf_datasets:"",hf_spaces:""});return}j&&De(E,j,[r,u]),l==null||l(),a(!1),v({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:j=>{var D;const c=j;let x=c.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");if(c.response)try{const H=JSON.parse(c.response);typeof(H==null?void 0:H.detail)=="string"?x=H.detail:Array.isArray(H==null?void 0:H.detail)&&((D=H.detail[0])!=null&&D.msg)&&(x=H.detail[0].msg)}catch{x=c.response}k({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:x,variant:"destructive"})}}),M=()=>{const j={hf_models:[...s.hf_models],hf_datasets:[...s.hf_datasets],hf_spaces:[...s.hf_spaces]};for(const{key:c}of ft){const x=_[c].trim();if(x){if(j[c].some(D=>D.trim()===x))return alert(`This ${c.replace("hf_","")} URL is already added`),null;j[c]=[...j[c],x]}}return j},A=j=>{const c=_[j].trim();if(c){if(s[j].some(x=>x.trim()===c)){alert(`This ${j.replace("hf_","")} URL is already added`);return}f(x=>({...x,[j]:[...x[j],c]})),v(x=>({...x,[j]:""}))}},F=(j,c)=>{f(x=>({...x,[j]:x[j].filter(D=>D!==c)}))},U=()=>{const j=M();j!==null&&q.mutate({paperId:r,artifacts:j})},P=i.useMemo(()=>{const j={hf_models:[...s.hf_models],hf_datasets:[...s.hf_datasets],hf_spaces:[...s.hf_spaces]};for(const{key:c}of ft){const x=_[c].trim();if(x){if(j[c].some(D=>D.trim()===x))return!1;j[c]=[...j[c],x]}}return!En(j,n)},[s,_,n]);return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(fe,{children:[e.jsx(xe,{children:"Edit Hugging Face Artifacts"}),e.jsx(ge,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(Re,{isAuthor:p}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:ft.map(({key:j,label:c,placeholder:x})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:c}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(ie,{type:"url",placeholder:x,value:_[j],onChange:D=>v(H=>({...H,[j]:D.target.value})),onKeyPress:D=>{D.key==="Enter"&&(D.preventDefault(),A(j))},className:"flex-1"}),e.jsxs(V,{onClick:()=>A(j),size:"sm",disabled:!_[j].trim(),children:[e.jsx(at,{className:"w-4 h-4 mr-1"}),"Add"]})]}),s[j].length>0?e.jsx("div",{className:"space-y-2",children:s[j].map(D=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:D}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>F(j,D),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${c.toLowerCase()} URL`,children:e.jsx(rt,{className:"w-4 h-4"})})]},D))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",c.toLowerCase()," linked yet."]})]},j))}),e.jsxs(Pe,{children:[e.jsx(V,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(V,{onClick:U,disabled:q.isPending||!P,children:q.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Pn({open:t,onOpenChange:a,sectionLabel:r,returnTo:u}){return e.jsx(pe,{open:t,onOpenChange:a,children:e.jsxs(he,{className:"max-w-md",children:[e.jsxs(fe,{children:[e.jsxs(xe,{children:["Sign in to edit ",r]}),e.jsx(ge,{children:"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx($a,{returnTo:u})})]})})}const Te=["my-bookmark-ids"];function Rn(){var u,n;const{user:t}=st(),a=oe({queryKey:Te,queryFn:()=>et.getMyBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),r=_t.useMemo(()=>{var l;return new Set(((l=a.data)==null?void 0:l.paper_ids)??[])},[(u=a.data)==null?void 0:u.paper_ids]);return{ids:((n=a.data)==null?void 0:n.paper_ids)??[],idSet:r,isLoading:a.isLoading,isError:a.isError}}function An(){const{user:t}=st(),a=ue(),r=ve({mutationFn:async({paperId:n,isBookmarked:l})=>{l?await et.removeBookmark(n):await et.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:l})=>{await a.cancelQueries({queryKey:Te});const o=a.getQueryData(Te),p=typeof n=="string"?Number(n):n,s=(o==null?void 0:o.paper_ids)??[],f=l?s.filter(_=>_!==p):[p,...s.filter(_=>_!==p)];return a.setQueryData(Te,{paper_ids:f}),{previous:o}},onError:(n,l,o)=>{o!=null&&o.previous&&a.setQueryData(Te,o.previous)},onSettled:()=>{a.invalidateQueries({queryKey:Te}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:_t.useCallback((n,l)=>{if(!t){if(vs())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=js(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}r.mutate({paperId:n,isBookmarked:l})},[r,t]),isPending:r.isPending}}const In=({paperId:t})=>{const{user:a}=st(),{idSet:r}=Rn(),{toggle:u,isPending:n}=An();if(vs())return null;const l=Number(t),o=!!a&&r.has(l),p=()=>{Number.isFinite(l)&&u(l,o)},s=a&&o?"Saved":"Save",f=a?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:p,disabled:n,"aria-pressed":o,"aria-label":f,title:f,children:[e.jsx(ee,{name:"bookmark",size:12}),s]})};function Ye({children:t,showEdit:a=!1,onEdit:r,editAriaLabel:u}){return a?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:r,"aria-label":u,children:"edit"})]}):t}const Fn={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","source-url":"source URL","hf-artifacts":"Hugging Face artifacts"},Ze=360,gt=3;function ds(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function us(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function we(t,a){try{const r=new URL(t),n=r.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):r.hostname.replace(/^www\./,"")}catch{return a}}const ei=()=>{var qt,Ht,Bt,Ot,Kt,zt,Qt,Vt,Gt,Wt,Xt,Jt;const{arxivId:t}=La(),a=t?Da(t):"",r=Ma(),{toast:u}=me(),{user:n}=st(),l=(n==null?void 0:n.is_admin)??!1,o=!!n,p=!0,{data:s,isLoading:f,error:_,refetch:v}=tr(a||"",!!a),[E,k]=i.useState(!1);i.useEffect(()=>{if(!t||t===a)return;const d=window.location.search+window.location.hash;r(`/paper/${a}${d}`,{replace:!0})},[a,r,t]),i.useEffect(()=>{if(s!=null&&s.title)return document.title=Za(s.title),()=>{document.title=er}},[s==null?void 0:s.title]),i.useEffect(()=>{if(k(!1),!(s!=null&&s.id))return;const d=window.setTimeout(()=>k(!0),0);return()=>window.clearTimeout(d)},[s==null?void 0:s.id]);const{data:N,isLoading:q}=pr(E?s==null?void 0:s.arxiv_id:void 0),{data:M,isLoading:A}=ur(s==null?void 0:s.id,E&&!!(s!=null&&s.id)),{preferences:F}=Ua(),U=i.useMemo(()=>!M||!F.hide_closed_source_evals?M:M.filter(d=>d.is_open!==!1),[M,F.hide_closed_source_evals]),P=i.useMemo(()=>({models:(s==null?void 0:s.hf_models)??[],datasets:(s==null?void 0:s.hf_datasets)??[],spaces:(s==null?void 0:s.hf_spaces)??[]}),[s==null?void 0:s.hf_models,s==null?void 0:s.hf_datasets,s==null?void 0:s.hf_spaces]),j=i.useMemo(()=>{if(!U)return[];const d=new Map;for(const T of U){const G=T.task_id,ae=d.get(G);ae?ae.rows.push(T):d.set(G,{taskId:G,taskName:T.task_name||"—",taskSlug:T.task_slug,rows:[T]})}return Array.from(d.values())},[U]),c=oe({queryKey:["paper-versions",s==null?void 0:s.arxiv_id],queryFn:async()=>{const d=s.arxiv_id.replace(/v\d+$/,""),T=await fetch(js(`/api/v1/papers/arxiv/${d}/versions`));return T.ok?await T.json():[]},enabled:E&&!!(s!=null&&s.arxiv_id),staleTime:10*60*1e3}),x=oe({queryKey:["related-papers",(Ht=(qt=s==null?void 0:s.tasks)==null?void 0:qt[0])==null?void 0:Ht.id],queryFn:()=>et.getTaskPapers(s.tasks[0].id,{page:1,page_size:5,order_by:"citation_count",order_dir:"desc",include_resources:!1}),enabled:E&&!!((Ot=(Bt=s==null?void 0:s.tasks)==null?void 0:Bt[0])!=null&&Ot.id),staleTime:10*60*1e3,select:d=>d.results.filter(T=>T.id!==(s==null?void 0:s.id)).slice(0,4)}),[D,H]=i.useState(!1),[B,te]=i.useState(!1),[b,S]=i.useState(!1),{isEditingTasks:R,setIsEditingTasks:L,isEditingMethods:m,setIsEditingMethods:w,isEditingRepositories:C,setIsEditingRepositories:g,isEditingProjectPages:y,setIsEditingProjectPages:z,isEditingEvaluations:h,setIsEditingEvaluations:$,isEditingSourceUrl:O,setIsEditingSourceUrl:I,isEditingHfArtifacts:K,setIsEditingHfArtifacts:Q}=hr(),[X,W]=i.useState(null),Z=i.useMemo(()=>{if(!n||!(s!=null&&s.author_links))return!1;const d=n.username.toLowerCase();return s.author_links.some(T=>!!T.hf_username&&T.hf_username.toLowerCase()===d)},[n,s==null?void 0:s.author_links]),be=l?"direct":"pending",se=d=>{if(!o){W(d);return}switch(d){case"tasks":L(!0);return;case"methods":w(!0);return;case"results":$(!0);return;case"repositories":g(!0);return;case"project-pages":z(!0);return;case"source-url":I(!0);return;case"hf-artifacts":Q(!0);return}},[St,lt]=i.useState("idle"),[Pt,Rt]=i.useState(null),[At,It]=i.useState(null),ta=async()=>{if(a){lt("indexing"),Rt(null),It(null);try{await Qa(a),u({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>v(),1200),lt("idle")}catch(d){const T=d;let G=T.message||"Failed to index paper";if(T.response)try{G=JSON.parse(T.response).detail||G}catch{G=T.response}Rt(G),(T.status===429||T.status===503)&&It("Try again later after arXiv has lifted the temporary limit."),lt("idle")}}},{citationDisplay:sa,citationCopy:Ft}=i.useMemo(()=>{if(!s)return{citationDisplay:"",citationCopy:""};const d=`${s.title.slice(0,60)}${s.title.length>60?"…":""}`,T=`${s.authors[0]||""}${s.authors.length>1?" et al.":""}`,G=s.authors.join(" and "),ae=(s.published||"").slice(0,4)||"—",Yt=(Zt,es)=>s.arxiv_id?`@article{${s.arxiv_id.replace(".","")},
|
| 37 |
-
title={{${Zt}}},
|
| 38 |
-
author=${es},
|
| 39 |
-
year={{${ae}}},
|
| 40 |
-
eprint={{${s.arxiv_id}}},
|
| 41 |
-
archivePrefix={{arXiv}}
|
| 42 |
-
}`:`@misc{paper${s.id},
|
| 43 |
-
title={{${Zt}}},
|
| 44 |
-
author=${es},
|
| 45 |
-
year={{${ae}}},
|
| 46 |
-
url={{${s.source_url||s.url_abs||""}}}
|
| 47 |
-
}`;return{citationDisplay:Yt(d,`{{${T}}}`),citationCopy:Yt(s.title,`{${G}}`)}},[s]),[aa,Tt]=i.useState(!1),ra=async()=>{if(Ft)try{await navigator.clipboard.writeText(Ft),Tt(!0),u({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Tt(!1),1500)}catch{u({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}};if(f)return e.jsxs("div",{className:"page",children:[e.jsx(He,{className:"h-12 w-3/4 mb-4"}),e.jsx(He,{className:"h-6 w-1/3 mb-8"}),e.jsx(He,{className:"h-64 w-full"})]});if(_||!s)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(_e,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",a]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",a]})," in the database. You can index it from arXiv right now."]}),Pt&&e.jsx(sr,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(ar,{children:[e.jsx("div",{children:Pt}),At&&e.jsx("div",{className:"mt-2",children:At})]})}),e.jsxs("div",{className:"action-row",children:[l&&e.jsxs("button",{className:"action-btn",onClick:ta,disabled:St==="indexing",children:[e.jsx(ee,{name:"sparkle",size:12}),St==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(V,{variant:"outline",onClick:()=>r("/papers"),children:"Browse Papers"})]})]});const $t=c.data||[],Me=Ya(s.repositories),ye=[...s.repositories??[]].sort((d,T)=>{const G=d.is_official?1:0,ae=T.is_official?1:0;return G!==ae?ae-G:(T.num_stars||0)-(d.num_stars||0)}),na=b?ye:ye.slice(0,gt),ia=s.arxiv_id?{isLoading:q,paperHref:`https://huggingface.co/papers/${s.arxiv_id.replace(/v\d+$/,"")}`,rows:[{label:"Models",href:`https://huggingface.co/models?other=arxiv:${s.arxiv_id}`,count:N==null?void 0:N.models,isLimited:N==null?void 0:N.isLimited,links:P.models.map(d=>({href:d,label:we(d,"Model")}))},{label:"Datasets",href:`https://huggingface.co/datasets?other=arxiv:${s.arxiv_id}`,count:N==null?void 0:N.datasets,isLimited:N==null?void 0:N.isLimited,links:P.datasets.map(d=>({href:d,label:we(d,"Dataset")}))},{label:"Spaces",href:`https://huggingface.co/spaces?arxivIds=${s.arxiv_id.replace(/v\d+$/,"")}`,count:N==null?void 0:N.spaces,isLimited:N==null?void 0:N.isLimited,links:P.spaces.map(d=>({href:d,label:we(d,"Space")}))}],footer:`Cite arxiv.org/abs/${s.arxiv_id} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:vt(P.models),count:P.models.length,links:P.models.map(d=>({href:d,label:we(d,"Model")}))},{label:"Datasets",href:vt(P.datasets),count:P.datasets.length,links:P.datasets.map(d=>({href:d,label:we(d,"Dataset")}))},{label:"Spaces",href:vt(P.spaces),count:P.spaces.length,links:P.spaces.map(d=>({href:d,label:we(d,"Space")}))}],footer:null},Lt=s.tldr||null,Dt=s.num_pages||null,Ae=s.abstract||"",oa=Ae.length>Ze?Ae.slice(0,Ze)+"…":Ae,la=D||Ae.length<=Ze?Ae:oa,ze=(s.methods||[]).filter(d=>d.source_paper_id===s.id),Qe=s.introduced_benchmarks||[],ca=ze.length>0||Qe.length>0,Mt=s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource",da=s.source==="external"?"Source page":"arXiv page",Ue=((Kt=s.project_pages)==null?void 0:Kt.filter(d=>d.url))??[],ua=(()=>{const d=[];return ze.length>0&&d.push(ze.length===1?"this method":"these methods"),Qe.length>0&&d.push(Qe.length===1?"this benchmark":"these benchmarks"),d.length===0?"":d.length===1?d[0]:d.join(" and ")})(),Ve=s.predecessor_papers||[],Ge=s.successor_papers||[],ma=Ve.length>0||Ge.length>0,We=12,ct=s.authors.map((d,T)=>{var G,ae;return{name:d,hf_username:((ae=(G=s.author_links)==null?void 0:G[T])==null?void 0:ae.hf_username)??null}}),Ut=B||ct.length<=We?ct:ct.slice(0,We);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(_e,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:Mt})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsx("h1",{className:"detail-title",children:e.jsx(Xe,{title:s.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:Mt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",ds(s.published)]}),Dt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Dt," pages"]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.citation_count.toLocaleString()," citations"]})]}),(s.proceeding||s.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),s.conference_slug?e.jsx("a",{href:`/conferences/${s.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(s.proceeding||s.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:s.proceeding.replace(/\s+\d{1,2}$/,"")})]}),$t.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:s.version,onChange:d=>{const T=d.target.value;s.arxiv_id&&r(`/paper/${s.arxiv_id.replace(/v\d+$/,"")}${T?`?version=${T}`:""}`)},children:$t.map(d=>e.jsxs("option",{value:d.version,children:[d.version," — ",ds(d.published)]},d.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Ut.map((d,T)=>e.jsxs(_t.Fragment,{children:[d.hf_username?e.jsx("a",{href:`https://huggingface.co/${d.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${d.hf_username} on Hugging Face`,children:d.name}):e.jsx("a",{children:d.name}),T<Ut.length-1?", ":""]},T)),s.authors.length>We&&e.jsx("button",{className:"show-more-authors",onClick:()=>te(d=>!d),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:B?"show fewer":`+${s.authors.length-We} more`})]}),e.jsxs("div",{className:"action-row",children:[s.url_pdf&&e.jsxs("a",{className:"action-btn",href:s.url_pdf,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ee,{name:"pdf",size:12})," View PDF"]}),s.url_abs&&e.jsx(Ye,{showEdit:s.source==="external"&&p,onEdit:()=>se("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:s.source==="external"&&p?"action-btn-segment action-btn-main":"action-btn",href:s.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ee,{name:"external",size:12})," ",da]})}),Me.githubUrl&&e.jsx(Ye,{showEdit:p,onEdit:()=>se("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Me.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ee,{name:"github",size:12})," Code",Me.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",us(Me.github)," ★"]})]})}),Me.githubUrl?null:e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>se("repositories"),title:"Add GitHub repository",children:[e.jsx(ee,{name:"github",size:12})," Add code"]}),Ue.length===1?e.jsx(Ye,{showEdit:p,onEdit:()=>se("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Ue[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ee,{name:"globe",size:12})," Project page"]})}):null,Ue.length>1?e.jsx(Ye,{showEdit:p,onEdit:()=>se("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(qa,{children:[e.jsx(Ha,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(ee,{name:"globe",size:12})," Project page"]})}),e.jsx(Ba,{align:"start",className:"project-page-menu",children:Ue.map((d,T)=>e.jsx(Oa,{asChild:!0,children:e.jsx("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",children:we(d.url,`Project page ${T+1}`)})},d.url))})]})}):null,Ue.length===0&&o?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>se("project-pages"),title:"Add project page",children:[e.jsx(ee,{name:"globe",size:12})," Add project page"]}):null,s.conference_url_abs&&e.jsxs("a",{className:"action-btn",href:s.conference_url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ee,{name:"external",size:12})," Conference"]}),(s.organizations||[]).map(d=>e.jsxs(_e,{to:`/${d.slug}`,className:"action-btn",title:d.name,"aria-label":d.name,children:[d.logo_url&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:16,width:16,borderRadius:3,overflow:"hidden"},children:e.jsx("img",{src:d.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:T=>{T.currentTarget.style.display="none"}})}),d.name]},d.id)),e.jsx(In,{paperId:s.id})]})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Va,{paperId:s.arxiv_id||s.id,title:s.title,thumbnailUrl:Ka(s.thumbnail_url),priority:!0})})]}),ca&&e.jsxs("div",{className:"introduced-banner",children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[ze.map(d=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/methods/${d.slug||d.id}`),children:[d.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${d.id}`)),Qe.map(d=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/benchmark/${d.slug||d.id}`),children:[d.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${d.id}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",ua,"."]})]}),ma&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Ge.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ge.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Ge.map(d=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>r(`/paper/${d.route_identifier}`),children:[e.jsx(Xe,{title:d.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${d.id}`))})]}),Ve.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ve.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Ve.map(d=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>r(`/paper/${d.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Xe,{title:d.title})]},`predecessor-${d.id}`))})]})]}),Lt&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"TL;DR · AI-generated"})}),e.jsx("div",{className:"tldr-box",children:Lt})]}),e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"Abstract"})}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Ja,{text:la})}),Ae.length>Ze&&e.jsx("div",{className:"read-full",onClick:()=>H(d=>!d),children:D?"− collapse abstract":"+ read full abstract"}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Tasks"}),e.jsxs("span",{className:"accent",children:[((zt=s.tasks)==null?void 0:zt.length)||0," tagged",e.jsx("button",{type:"button",onClick:()=>se("tasks"),className:"edit-link",children:"edit"})]})]}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(s.tasks||[]).map(d=>e.jsx(Ga,{slug:d.slug||"",label:d.name},d.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Methods"}),e.jsxs("span",{className:"accent",children:[((Qt=s.methods)==null?void 0:Qt.length)||0," used",e.jsx("button",{type:"button",onClick:()=>se("methods"),className:"edit-link",children:"edit"})]})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(s.methods||[]).map(d=>e.jsx(Wa,{method:d},d.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Results"}),e.jsxs("span",{className:"accent",children:[(U==null?void 0:U.length)||0," benchmarks",e.jsx("button",{type:"button",onClick:()=>se("results"),className:"edit-link",children:"edit"})]})]}),A?e.jsx(He,{className:"h-32 w-full"}):j.length>0?j.map(d=>e.jsxs("div",{children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:d.taskSlug?e.jsx(_e,{to:`/tasks/${d.taskSlug}`,children:d.taskName}):d.taskName}),e.jsxs("span",{className:"accent",children:[d.rows.length," ",d.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:d.rows.map(T=>{var G;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:T.dataset_slug?e.jsx(_e,{to:`/benchmark/${T.dataset_slug}`,children:T.dataset_name||"—"}):T.dataset_name||"—"}),e.jsxs("td",{className:"model",title:T.model_name||void 0,children:[T.model_name||"—",T.is_open===!1&&e.jsx(Xa,{})]}),e.jsx("td",{className:"metric",children:T.best_metric}),e.jsx("td",{className:"value",children:za((G=T.metrics)==null?void 0:G[T.best_metric||""])}),e.jsx("td",{className:"compare",children:T.dataset_slug&&e.jsx(_e,{to:`/benchmark/${T.dataset_slug}?eval=${encodeURIComponent(T.id)}`,children:"Compare →"})})]},T.id)})})]})]},d.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[ye.length," repo",ye.length===1?"":"s",e.jsx("button",{type:"button",onClick:()=>se("repositories"),className:"edit-link",children:"edit"})]})]}),na.map(d=>e.jsxs("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(ee,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[d.owner,"/",d.name]}),d.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",us(d.num_stars)]})]},d.id)),ye.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),ye.length>gt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>S(d=>!d),children:b?"− show top 3":`+ show ${ye.length-gt} more repos`})]}),e.jsx(Tn,{viewer:ia,canEdit:p,onEdit:()=>se("hf-artifacts")}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:ra,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(ee,{name:"copy",size:11}),aa?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:sa})]}),(((Vt=x.data)==null?void 0:Vt.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),x.data.map(d=>e.jsxs(_e,{to:`/paper/${d.arxiv_id||d.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Xe,{title:d.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:d.arxiv_id?`arXiv:${d.arxiv_id}`:"External resource"}),d.citation_count!=null&&e.jsxs("span",{children:[d.citation_count.toLocaleString()," cites"]})]})]},d.id))]})]})]}),e.jsx(_r,{open:R,onOpenChange:L,paperId:s.id,arxivId:a,initialTaskIds:((Gt=s.tasks)==null?void 0:Gt.map(d=>parseInt(d.id)))||[],initialTasks:s.tasks||[],submitMode:be,isAuthor:Z}),e.jsx(Nr,{open:m,onOpenChange:w,paperId:s.id,arxivId:a,initialMethodIds:((Wt=s.methods)==null?void 0:Wt.map(d=>parseInt(d.id)))||[],initialMethods:s.methods||[],submitMode:be,isAuthor:Z}),e.jsx(Cr,{open:C,onOpenChange:g,paperId:s.id,arxivId:a,initialRepositories:((Xt=s.repositories)==null?void 0:Xt.map(d=>({url:d.url,is_official:d.is_official||!1})))||[],submitMode:be,isAuthor:Z}),e.jsx(Er,{open:y,onOpenChange:z,paperId:s.id,arxivId:a,initialProjectPages:((Jt=s.project_pages)==null?void 0:Jt.map(d=>({url:d.url,is_official:d.is_official||!1})))||[],submitMode:be,isAuthor:Z}),e.jsx(Cn,{open:h,onOpenChange:$,paperId:s.id,arxivId:a,initialEvaluations:M||[],submitMode:be,isAuthor:Z}),e.jsx(Sr,{open:O,onOpenChange:I,paperId:s.id,arxivId:a,initialUrl:s.source_url??s.url_abs??"",submitMode:be,isAuthor:Z}),e.jsx(Sn,{open:K,onOpenChange:Q,paperId:s.id,arxivId:a,initialArtifacts:{hf_models:s.hf_models??[],hf_datasets:s.hf_datasets??[],hf_spaces:s.hf_spaces??[]},submitMode:be,isAuthor:Z}),e.jsx(Pn,{open:X!==null,onOpenChange:d=>{d||W(null)},sectionLabel:X?Fn[X]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})},Tn=({viewer:t,canEdit:a=!1,onEdit:r})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[t.paperHref?e.jsx("a",{href:t.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),a&&r&&e.jsx("button",{type:"button",onClick:r,className:"edit-link",children:"edit"})]}),t.isLoading?e.jsx(He,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[t.rows.map(u=>e.jsx($n,{...u},u.label)),t.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:t.footer})]})]}),$n=({label:t,href:a,count:r,isLimited:u,links:n})=>{const l=((n==null?void 0:n.length)??0)>0,o=e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:t}),e.jsx("span",{style:{fontWeight:600,color:r?"var(--ink)":"var(--ink-faint)"},children:r!=null?`${r}${u?"+":""}`:"—"})]});return l?e.jsxs("div",{className:"hf-artifact-row",children:[o,e.jsx("div",{className:"hf-artifact-links",children:n.map(p=>e.jsx("a",{href:p.href,target:"_blank",rel:"noopener noreferrer",children:p.label},p.href))})]}):e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-row",children:o})};function vt(t){return t[0]??"https://huggingface.co"}export{ei as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/PaperDetailView-P0uTYMJC.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{c as we,g as fr,r as i,j as e,P as vt,b as ee,d as us,e as et,f as ye,h as xr,i as ms,C as oe,k as se,l as gr,m as vr,n as de,s as Ne,o as Ce,X as ps,p as br,q as hs,t as jr,v as yr,w as _r,x as kr,y as wr,z as Ie,R as Nr,A as _e,B as fs,D as xs,E as Cr,F as Er,G as Sr,H as Pr,I as Rr,J as Ar,K as Ir,M as Fr,N as es,O as $r,Q as Tr,S as Mr,T as Lr,U as Dr,V as tt,W as bt,a as Ze,Y as gs,Z as vs,_ as Ur,$ as Or,a0 as Br,a1 as qr,L as be,a2 as Kr,a3 as Hr,a4 as zr,a5 as Qr,a6 as Vr,a7 as Gr,a8 as Wr}from"./index-M24Hywem.js";import{u as ie}from"./useQuery-C6YLWBWB.js";import{I as te,a as Xr,T as Jr,M as Yr}from"./components-J9e6gtqw.js";import{C as Zr}from"./ClosedSourceEvalBadge-BjrimQbP.js";import{L as We,a as ea}from"./LatexTitle-C8-B6cG1.js";import{c as ta}from"./transform-DVq_2bw1.js";import{f as sa,D as ra}from"./latexPlainText-ChVkH0gY.js";import{a as aa}from"./usePapers-DAX-IssB.js";import{S as De}from"./skeleton-DCGdUtqq.js";import{A as na,a as ia}from"./alert-0Kui0gCY.js";import{I as ne,B as Q}from"./input-CpJZsE-m.js";import{u as oa}from"./index-t6Oi9XIP.js";import{D as ue,a as me,b as pe,c as he,d as fe,e as Ee,R as la,P as ca,O as da,C as ua}from"./dialog-D8hTxZ4f.js";import{u as xe}from"./useMutation-CudKDByg.js";import{T as ma}from"./textarea-DnPbxyAL.js";import{L as ae}from"./loader-circle-2lEq4cac.js";import{B as bs,D as pa}from"./badge-DZWw7QDg.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-D8U4M_OT.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 ha=we("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
| 7 |
+
* @license lucide-react v0.462.0 - ISC
|
| 8 |
+
*
|
| 9 |
+
* This source code is licensed under the ISC license.
|
| 10 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
+
*/const ts=we("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
|
| 12 |
+
* @license lucide-react v0.462.0 - ISC
|
| 13 |
+
*
|
| 14 |
+
* This source code is licensed under the ISC license.
|
| 15 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 16 |
+
*/const ss=we("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
| 17 |
+
* @license lucide-react v0.462.0 - ISC
|
| 18 |
+
*
|
| 19 |
+
* This source code is licensed under the ISC license.
|
| 20 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 21 |
+
*/const jt=we("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
| 22 |
+
* @license lucide-react v0.462.0 - ISC
|
| 23 |
+
*
|
| 24 |
+
* This source code is licensed under the ISC license.
|
| 25 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 26 |
+
*/const Oe=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
| 27 |
+
* @license lucide-react v0.462.0 - ISC
|
| 28 |
+
*
|
| 29 |
+
* This source code is licensed under the ISC license.
|
| 30 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 31 |
+
*/const js=we("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
| 32 |
+
* @license lucide-react v0.462.0 - ISC
|
| 33 |
+
*
|
| 34 |
+
* This source code is licensed under the ISC license.
|
| 35 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 36 |
+
*/const yt=we("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 fa(t,s=!0){return ie({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return fr(t)},enabled:s&&!!t,staleTime:0,refetchOnMount:"always"})}const ys=t=>t.replace(/v\d+$/,""),lt=(t,s)=>{const a=(t[s]||[]).length;return a<100?{count:a,isLimited:!1}:{count:a,isLimited:!0}},xa=async t=>{try{return(await fetch(`https://huggingface.co/api/papers/${ys(t)}`)).ok}catch{return!1}},ga=async t=>{const s=ys(t),[a,d]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${s}/repos`).then(async u=>u.ok?u.json():(console.warn(`Failed to fetch repos for arXiv:${s}, status: ${u.status}`),null)).catch(u=>(console.warn(`Failed to fetch repos for arXiv:${s}:`,u),null)),xa(s)]);if(!a)return{models:0,datasets:0,spaces:0,isLimited:!1,paperExists:d};const n=lt(a,"models"),l=lt(a,"datasets"),o=lt(a,"spaces");return{models:n.count,datasets:l.count,spaces:o.count,isLimited:n.isLimited||l.isLimited||o.isLimited,paperExists:d}},va=t=>ie({queryKey:["huggingface-repos",t],queryFn:()=>ga(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function ba(){const[t,s]=i.useState(!1),[a,d]=i.useState(!1),[n,l]=i.useState(!1),[o,u]=i.useState(!1),[r,h]=i.useState(!1),[k,_]=i.useState(!1);return{isEditingTasks:t,openTasksDialog:()=>s(!0),closeTasksDialog:()=>s(!1),setIsEditingTasks:s,isEditingMethods:a,openMethodsDialog:()=>d(!0),closeMethodsDialog:()=>d(!1),setIsEditingMethods:d,isEditingRepositories:n,openRepositoriesDialog:()=>l(!0),closeRepositoriesDialog:()=>l(!1),setIsEditingRepositories:l,isEditingProjectPages:o,openProjectPagesDialog:()=>u(!0),closeProjectPagesDialog:()=>u(!1),setIsEditingProjectPages:u,isEditingEvaluations:r,openEvaluationsDialog:()=>h(!0),closeEvaluationsDialog:()=>h(!1),setIsEditingEvaluations:h,isEditingSourceUrl:k,openSourceUrlDialog:()=>_(!0),closeSourceUrlDialog:()=>_(!1),setIsEditingSourceUrl:_}}var st="Checkbox",[ja]=ms(st),[ya,_t]=ja(st);function _a(t){const{__scopeCheckbox:s,checked:a,children:d,defaultChecked:n,disabled:l,form:o,name:u,onCheckedChange:r,required:h,value:k="on",internal_do_not_use_render:_}=t,[N,C]=us({prop:a,defaultProp:n??!1,onChange:r,caller:st}),[w,M]=i.useState(null),[P,F]=i.useState(null),$=i.useRef(!1),D=w?!!o||!!w.closest("form"):!0,U={checked:N,disabled:l,setChecked:C,control:w,setControl:M,name:u,form:o,value:k,hasConsumerStoppedPropagationRef:$,required:h,defaultChecked:le(n)?!1:n,isFormControl:D,bubbleInput:P,setBubbleInput:F};return e.jsx(ya,{scope:s,...U,children:ka(_)?_(U):d})}var _s="CheckboxTrigger",ks=i.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:a,...d},n)=>{const{control:l,value:o,disabled:u,checked:r,required:h,setControl:k,setChecked:_,hasConsumerStoppedPropagationRef:N,isFormControl:C,bubbleInput:w}=_t(_s,t),M=et(n,k),P=i.useRef(r);return i.useEffect(()=>{const F=l==null?void 0:l.form;if(F){const $=()=>_(P.current);return F.addEventListener("reset",$),()=>F.removeEventListener("reset",$)}},[l,_]),e.jsx(ee.button,{type:"button",role:"checkbox","aria-checked":le(r)?"mixed":r,"aria-required":h,"data-state":Ss(r),"data-disabled":u?"":void 0,disabled:u,value:o,...d,ref:M,onKeyDown:ye(s,F=>{F.key==="Enter"&&F.preventDefault()}),onClick:ye(a,F=>{_($=>le($)?!0:!$),w&&C&&(N.current=F.isPropagationStopped(),N.current||F.stopPropagation())})})});ks.displayName=_s;var kt=i.forwardRef((t,s)=>{const{__scopeCheckbox:a,name:d,checked:n,defaultChecked:l,required:o,disabled:u,value:r,onCheckedChange:h,form:k,..._}=t;return e.jsx(_a,{__scopeCheckbox:a,checked:n,defaultChecked:l,disabled:u,required:o,onCheckedChange:h,name:d,form:k,value:r,internal_do_not_use_render:({isFormControl:N})=>e.jsxs(e.Fragment,{children:[e.jsx(ks,{..._,ref:s,__scopeCheckbox:a}),N&&e.jsx(Es,{__scopeCheckbox:a})]})})});kt.displayName=st;var ws="CheckboxIndicator",Ns=i.forwardRef((t,s)=>{const{__scopeCheckbox:a,forceMount:d,...n}=t,l=_t(ws,a);return e.jsx(vt,{present:d||le(l.checked)||l.checked===!0,children:e.jsx(ee.span,{"data-state":Ss(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...t.style}})})});Ns.displayName=ws;var Cs="CheckboxBubbleInput",Es=i.forwardRef(({__scopeCheckbox:t,...s},a)=>{const{control:d,hasConsumerStoppedPropagationRef:n,checked:l,defaultChecked:o,required:u,disabled:r,name:h,value:k,form:_,bubbleInput:N,setBubbleInput:C}=_t(Cs,t),w=et(a,C),M=oa(l),P=xr(d);i.useEffect(()=>{const $=N;if(!$)return;const D=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(D,"checked").set,g=!n.current;if(M!==l&&T){const b=new Event("click",{bubbles:g});$.indeterminate=le(l),T.call($,le(l)?!1:l),$.dispatchEvent(b)}},[N,M,l,n]);const F=i.useRef(le(l)?!1:l);return e.jsx(ee.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??F.current,required:u,disabled:r,name:h,value:k,form:_,...s,tabIndex:-1,ref:w,style:{...s.style,...P,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Es.displayName=Cs;function ka(t){return typeof t=="function"}function le(t){return t==="indeterminate"}function Ss(t){return le(t)?"indeterminate":t?"checked":"unchecked"}const wt=i.forwardRef(({className:t,style:s,...a},d)=>e.jsx(kt,{ref:d,className:se("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...a,children:e.jsx(Ns,{className:se("flex items-center justify-center text-current"),children:e.jsx(oe,{className:"h-4 w-4"})})}));wt.displayName=kt.displayName;function wa(t,s,a){if(!t)return t;const d=n=>n.paper_id!==s||n.paper_title===a?n:{...n,paper_title:a};if(Array.isArray(t)){const n=t.map(d);return n.some((o,u)=>o!==t[u])?n:t}if(Array.isArray(t.results)){const n=t.results.map(d);return n.some((o,u)=>o!==t.results[u])?{...t,results:n}:t}return t}function Be(t,s,a){new Set([...a,s.id,s.arxiv_id].filter(o=>!!o)).forEach(o=>{t.setQueryData(["paper",o],s),t.setQueryData(["paper-arxiv",o],s)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const n=String(s.id),l=o=>wa(o,n,s.title);t.setQueriesData({queryKey:["evaluations"]},l),t.setQueriesData({queryKey:["dataset-evals"]},l),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}function $e({isAuthor:t=!1}){return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:t?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}var Na=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ca=Na.reduce((t,s)=>{const a=gr(`Primitive.${s}`),d=i.forwardRef((n,l)=>{const{asChild:o,...u}=n,r=o?a:s;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(r,{...u,ref:l})});return d.displayName=`Primitive.${s}`,{...t,[s]:d}},{}),Ea="Label",Ps=i.forwardRef((t,s)=>e.jsx(Ca.label,{...t,ref:s,onMouseDown:a=>{var n;a.target.closest("button, input, select, textarea")||((n=t.onMouseDown)==null||n.call(t,a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));Ps.displayName=Ea;var Rs=Ps;const Sa=vr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ft=i.forwardRef(({className:t,...s},a)=>e.jsx(Rs,{ref:a,className:se(Sa(),t),...s}));ft.displayName=Rs.displayName;const Pa=200,Ra=2e3;function As({open:t,onOpenChange:s,paperId:a,kind:d}){const[n,l]=i.useState(""),[o,u]=i.useState(""),{toast:r}=de(),h=d==="task"?"task":"method";i.useEffect(()=>{t||(l(""),u(""))},[t]);const k=xe({mutationFn:async()=>Ne({paper_id:parseInt(a),edit_type:d==="task"?"new_task":"new_method",proposed_payload:{name:n.trim(),description:o.trim()}}),onSuccess:()=>{r({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${h} shortly.`}),s(!1)},onError:N=>{var M;const C=N;let w=C.message||`Failed to submit your ${h} suggestion.`;if(C.response)try{const P=JSON.parse(C.response);typeof(P==null?void 0:P.detail)=="string"?w=P.detail:Array.isArray(P==null?void 0:P.detail)&&((M=P.detail[0])!=null&&M.msg)&&(w=P.detail[0].msg)}catch{w=C.response}r({title:"Could not submit suggestion",description:w,variant:"destructive"})}}),_=n.trim().length>0&&o.trim().length>0;return e.jsx(ue,{open:t,onOpenChange:s,children:e.jsxs(me,{className:"max-w-lg",children:[e.jsxs(pe,{children:[e.jsxs(he,{children:["Suggest a new ",h]}),e.jsxs(fe,{children:["Propose a ",h," that isn't in the list yet. An admin will review your suggestion before it's added."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ft,{htmlFor:"suggest-name",children:"Name"}),e.jsx(ne,{id:"suggest-name",value:n,maxLength:Pa,placeholder:d==="task"?"e.g. Long-context Retrieval":"e.g. Rotary Position Embedding",onChange:N=>l(N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ft,{htmlFor:"suggest-description",children:"Description"}),e.jsx(ma,{id:"suggest-description",value:o,maxLength:Ra,placeholder:`Briefly describe this ${h} and what it covers.`,onChange:N=>u(N.target.value)})]})]}),e.jsxs(Ee,{children:[e.jsx(Q,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(Q,{onClick:()=>k.mutate(),disabled:k.isPending||!_,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}const Aa=250,Ia=100;function Fa({open:t,onOpenChange:s,paperId:a,arxivId:d,initialTaskIds:n,initialTasks:l,onSuccess:o,submitMode:u="direct",isAuthor:r=!1}){const[h,k]=i.useState(n),[_,N]=i.useState(!1),[C,w]=i.useState(""),[M,P]=i.useState(""),[F,$]=i.useState(new Map),D=Ce(),{toast:U}=de(),T=i.useRef(!1);i.useEffect(()=>{if(!t){T.current=!1;return}if(T.current)return;T.current=!0,k(n),w(""),P("");const v=new Map;(l||[]).forEach(E=>{const m=parseInt(E.id);Number.isNaN(m)||v.set(m,E)}),$(v)},[t,n,l]),i.useEffect(()=>{const v=window.setTimeout(()=>{P(C.trim())},Aa);return()=>window.clearTimeout(v)},[C]);const{data:g,isFetching:b}=ie({queryKey:["tasks-search",M],queryFn:()=>hs({page_size:Ia,visible_only:!0,...M?{q:M}:{}}),enabled:t});i.useEffect(()=>{var v;(v=g==null?void 0:g.results)!=null&&v.length&&$(E=>{const m=new Map(E);return g.results.forEach(x=>{const f=parseInt(x.id);Number.isNaN(f)||m.set(f,x)}),m})},[g]);const A=i.useMemo(()=>{const v=(g==null?void 0:g.results)||[],E=new Set,m=[];return h.forEach(x=>{if(E.has(x))return;const f=F.get(x);f&&(m.push(f),E.add(x))}),v.forEach(x=>{const f=parseInt(x.id);Number.isNaN(f)||E.has(f)||(m.push(x),E.add(f))}),m},[g,h,F]),O=xe({mutationFn:async({paperId:v,taskIds:E})=>u==="pending"?(await Ne({paper_id:parseInt(v),edit_type:"tasks",proposed_payload:{task_ids:E}}),null):br(v,E),onMutate:async({taskIds:v})=>{if(u==="pending")return{snapshots:[]};const E=v.map(f=>F.get(f)).filter(f=>!!f).map(f=>({id:f.id,name:f.name,slug:f.slug})).sort((f,j)=>f.name.localeCompare(j.name)),m=Array.from(new Set([a,d].filter(f=>!!f)));await Promise.all(m.flatMap(f=>[D.cancelQueries({queryKey:["paper",f]}),D.cancelQueries({queryKey:["paper-arxiv",f]})]));const x=[];return m.forEach(f=>{["paper","paper-arxiv"].forEach(j=>{const y=[j,f],L=D.getQueryData(y);x.push({key:y,data:L}),L&&D.setQueryData(y,{...L,tasks:E})})}),U({title:"Tasks updated",description:`Saved ${v.length} task${v.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1),{snapshots:x}},onSuccess:v=>{if(u==="pending"){U({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),o==null||o(),s(!1);return}v&&Be(D,v,[a,d])},onError:(v,E,m)=>{var j,y;(j=m==null?void 0:m.snapshots)==null||j.forEach(({key:L,data:p})=>{D.setQueryData(L,p)});const x=v;let f=x.message||(u==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(x.response)try{const L=JSON.parse(x.response);typeof(L==null?void 0:L.detail)=="string"?f=L.detail:Array.isArray(L==null?void 0:L.detail)&&((y=L.detail[0])!=null&&y.msg)&&(f=L.detail[0].msg)}catch{f=x.response}U({title:u==="pending"?"Could not submit edit":"Could not save tasks",description:f,variant:"destructive"})}}),B=()=>{O.mutate({paperId:a,taskIds:h})},H=i.useMemo(()=>{if(h.length!==n.length)return!0;const v=new Set(n);return h.some(E=>!v.has(E))},[h,n]),G=(v,E)=>{k(m=>E?m.includes(v)?m:[...m,v]:m.filter(x=>x!==v))},J=()=>w("");return e.jsxs(ue,{open:t,onOpenChange:s,children:[e.jsxs(me,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(pe,{children:[e.jsx(he,{children:"Edit Paper Tasks"}),e.jsx(fe,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),u==="pending"&&e.jsx($e,{isAuthor:r}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Oe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ne,{type:"text",placeholder:"Search tasks...",value:C,onChange:v=>w(v.target.value),className:"pl-9 pr-9"}),C&&e.jsx("button",{type:"button",onClick:J,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(ps,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:A.length>0?e.jsx("div",{className:"space-y-2",children:A.map(v=>{const E=parseInt(v.id),m=h.includes(E);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(wt,{id:`task-${v.id}`,checked:m,onCheckedChange:x=>G(E,x===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${v.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[v.name,v.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[v.description.substring(0,100),v.description.length>100?"...":""]})]})]},v.id)})}):b?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ae,{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(Oe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:M?`No tasks found matching "${M}"`:"No tasks available"})]})}),e.jsxs(Ee,{children:[e.jsx(Q,{variant:"ghost",className:"sm:mr-auto",onClick:()=>N(!0),children:"Suggest a new task"}),e.jsx(Q,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(Q,{onClick:B,disabled:O.isPending||!H,children:O.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-2 animate-spin"}),u==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),u==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(As,{open:_,onOpenChange:N,paperId:a,kind:"task"})]})}const $a=250,Ta=100;function Ma({open:t,onOpenChange:s,paperId:a,arxivId:d,initialMethodIds:n,initialMethods:l,onSuccess:o,submitMode:u="direct",isAuthor:r=!1}){const[h,k]=i.useState(n),[_,N]=i.useState(!1),[C,w]=i.useState(""),[M,P]=i.useState(""),[F,$]=i.useState(new Map),D=Ce(),{toast:U}=de(),T=i.useRef(!1);i.useEffect(()=>{if(!t){T.current=!1;return}if(T.current)return;T.current=!0,k(n),w(""),P("");const v=new Map;(l||[]).forEach(E=>{const m=parseInt(E.id);Number.isNaN(m)||v.set(m,E)}),$(v)},[t,n,l]),i.useEffect(()=>{const v=window.setTimeout(()=>{P(C.trim())},$a);return()=>window.clearTimeout(v)},[C]);const{data:g,isFetching:b}=ie({queryKey:["methods-search",M],queryFn:()=>yr({page_size:Ta,...M?{q:M}:{}}),enabled:t});i.useEffect(()=>{var v;(v=g==null?void 0:g.results)!=null&&v.length&&$(E=>{const m=new Map(E);return g.results.forEach(x=>{const f=parseInt(x.id);Number.isNaN(f)||m.set(f,x)}),m})},[g]);const A=i.useMemo(()=>{const v=(g==null?void 0:g.results)||[],E=new Set,m=[];return h.forEach(x=>{if(E.has(x))return;const f=F.get(x);f&&(m.push(f),E.add(x))}),v.forEach(x=>{const f=parseInt(x.id);Number.isNaN(f)||E.has(f)||(m.push(x),E.add(f))}),m},[g,h,F]),O=xe({mutationFn:async({paperId:v,methodIds:E})=>u==="pending"?(await Ne({paper_id:parseInt(v),edit_type:"methods",proposed_payload:{method_ids:E}}),null):jr(v,E),onSuccess:v=>{if(u==="pending"){U({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),o==null||o(),s(!1);return}v&&Be(D,v,[a,d]),U({title:"Methods updated",description:`Saved ${h.length} method${h.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1)},onError:v=>{var x;const E=v;let m=E.message||(u==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(E.response)try{const f=JSON.parse(E.response);typeof(f==null?void 0:f.detail)=="string"?m=f.detail:Array.isArray(f==null?void 0:f.detail)&&((x=f.detail[0])!=null&&x.msg)&&(m=f.detail[0].msg)}catch{m=E.response}U({title:u==="pending"?"Could not submit edit":"Could not save methods",description:m,variant:"destructive"})}}),B=()=>{O.mutate({paperId:a,methodIds:h})},H=i.useMemo(()=>{if(h.length!==n.length)return!0;const v=new Set(n);return h.some(E=>!v.has(E))},[h,n]),G=(v,E)=>{k(m=>E?m.includes(v)?m:[...m,v]:m.filter(x=>x!==v))},J=()=>w("");return e.jsxs(ue,{open:t,onOpenChange:s,children:[e.jsxs(me,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(pe,{children:[e.jsx(he,{children:"Edit Paper Methods"}),e.jsx(fe,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),u==="pending"&&e.jsx($e,{isAuthor:r}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Oe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ne,{type:"text",placeholder:"Search methods...",value:C,onChange:v=>w(v.target.value),className:"pl-9 pr-9"}),C&&e.jsx("button",{type:"button",onClick:J,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(ps,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:A.length>0?e.jsx("div",{className:"space-y-2",children:A.map(v=>{const E=parseInt(v.id),m=h.includes(E);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(wt,{id:`method-${v.id}`,checked:m,onCheckedChange:x=>G(E,x===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${v.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[v.name,v.full_name&&v.full_name!==v.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:v.full_name}),v.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[v.description.substring(0,100),v.description.length>100?"...":""]})]})]},v.id)})}):b?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ae,{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(Oe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:M?`No methods found matching "${M}"`:"No methods available"})]})}),e.jsxs(Ee,{children:[e.jsx(Q,{variant:"ghost",className:"sm:mr-auto",onClick:()=>N(!0),children:"Suggest a new method"}),e.jsx(Q,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(Q,{onClick:B,disabled:O.isPending||!H,children:O.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-2 animate-spin"}),u==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),u==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(As,{open:_,onOpenChange:N,paperId:a,kind:"method"})]})}function Ue(t){const s=t.trim();if(!s)return null;let a=s;!a.startsWith("http://")&&!a.startsWith("https://")&&(a=`https://${a}`);try{const d=new URL(a);if(d.hostname.toLowerCase()!=="github.com")return null;const n=d.pathname.split("/").filter(Boolean);if(n.length<2)return null;const l=n[0].toLowerCase();let o=n[1].toLowerCase();return o.endsWith(".git")&&(o=o.slice(0,-4)),`https://github.com/${l}/${o}`}catch{return null}}function rs(t,s){const a=Ue(t),d=Ue(s);return a&&d?a===d:t.trim()===s.trim()}function La({open:t,onOpenChange:s,paperId:a,arxivId:d,initialRepositories:n,onSuccess:l,submitMode:o="direct",isAuthor:u=!1}){const[r,h]=i.useState(n),[k,_]=i.useState(""),N=Ce(),{toast:C}=de(),w=i.useRef(!1);i.useEffect(()=>{if(!t){w.current=!1;return}w.current||(w.current=!0,h(n),_(""))},[t,n]);const M=xe({mutationFn:async({paperId:b,repositories:A})=>o==="pending"?(await Ne({paper_id:parseInt(b),edit_type:"repositories",proposed_payload:{repositories:A}}),null):_r(b,A),onSuccess:b=>{if(o==="pending"){C({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),l==null||l(),s(!1),_("");return}b&&Be(N,b,[a,d]),l==null||l(),s(!1),_("")},onError:b=>{var B;const A=b;let O=A.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(A.response)try{const H=JSON.parse(A.response);typeof(H==null?void 0:H.detail)=="string"?O=H.detail:Array.isArray(H==null?void 0:H.detail)&&((B=H.detail[0])!=null&&B.msg)&&(O=H.detail[0].msg)}catch{O=A.response}C({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:O,variant:"destructive"})}}),P=b=>{const A=[];for(const O of b){const B=A.find(H=>rs(H.url,O.url));if(B)B.is_official=B.is_official||O.is_official;else{const H=Ue(O.url);A.push({url:H??O.url.trim(),is_official:O.is_official})}}return A},F=()=>{const b=k.trim(),A=b?[...r,{url:b,is_official:!1}]:r;return b&&r.some(O=>rs(O.url,b))?(alert("This repository URL is already added"),null):P(A)},$=()=>{const b=F();b!==null&&b.length!==r.length&&(h(b),_(""))},D=b=>{h(r.filter(A=>A.url!==b))},U=b=>{h(r.map(A=>A.url===b?{...A,is_official:!A.is_official}:A))},T=()=>{const b=F();b!==null&&M.mutate({paperId:a,repositories:b})},g=i.useMemo(()=>{const b=k.trim(),A=b?[...r,{url:b,is_official:!1}]:r;if(A.length!==n.length)return!0;const O=P(n),B=P(A);if(B.length!==O.length)return!0;const H=new Map(O.map(G=>[Ue(G.url)??G.url.trim(),!!G.is_official]));return B.some(G=>{const J=Ue(G.url)??G.url.trim(),v=H.get(J);return v===void 0||v!==!!G.is_official})},[r,k,n]);return e.jsx(ue,{open:t,onOpenChange:s,children:e.jsxs(me,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(pe,{children:[e.jsx(he,{children:"Edit Paper Repositories"}),e.jsx(fe,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx($e,{isAuthor:u}),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(ne,{type:"url",placeholder:"https://github.com/owner/repo",value:k,onChange:b=>_(b.target.value),onKeyPress:b=>{b.key==="Enter"&&(b.preventDefault(),$())},className:"flex-1"}),e.jsxs(Q,{onClick:$,size:"sm",disabled:!k.trim(),children:[e.jsx(jt,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:r.length>0?e.jsx("div",{className:"space-y-2",children:r.map((b,A)=>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(ts,{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:b.url}),b.is_official&&e.jsx(bs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(Q,{variant:b.is_official?"default":"outline",size:"sm",onClick:()=>U(b.url),className:"h-8 px-2 text-xs",title:b.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(js,{className:`w-3.5 h-3.5 mr-1 ${b.is_official?"fill-current":""}`}),b.is_official?"Official":"Mark official"]}),e.jsx(Q,{variant:"ghost",size:"sm",onClick:()=>D(b.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(yt,{className:"w-4 h-4"})})]})]},A))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ts,{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(Ee,{children:[e.jsx(Q,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(Q,{onClick:T,disabled:M.isPending||!g,children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Da({open:t,onOpenChange:s,paperId:a,arxivId:d,initialProjectPages:n,onSuccess:l,submitMode:o="direct",isAuthor:u=!1}){const[r,h]=i.useState(n),[k,_]=i.useState(""),N=Ce(),{toast:C}=de(),w=i.useRef(!1);i.useEffect(()=>{if(!t){w.current=!1;return}w.current||(w.current=!0,h(n),_(""))},[t,n]);const M=xe({mutationFn:async({paperId:g,projectPages:b})=>o==="pending"?(await Ne({paper_id:parseInt(g),edit_type:"project_pages",proposed_payload:{project_pages:b}}),null):kr(g,b),onSuccess:g=>{if(o==="pending"){C({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),l==null||l(),s(!1),_("");return}g&&Be(N,g,[a,d]),l==null||l(),s(!1),_("")},onError:g=>{var O;const b=g;let A=b.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(b.response)try{const B=JSON.parse(b.response);typeof(B==null?void 0:B.detail)=="string"?A=B.detail:Array.isArray(B==null?void 0:B.detail)&&((O=B.detail[0])!=null&&O.msg)&&(A=B.detail[0].msg)}catch{A=b.response}C({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:A,variant:"destructive"})}}),P=()=>{const g=k.trim();return g?r.some(b=>b.url===g)?(alert("This project page URL is already added"),null):[...r,{url:g,is_official:!1}]:r},F=()=>{const g=P();g!==null&&g.length!==r.length&&(h(g),_(""))},$=g=>{h(r.filter(b=>b.url!==g))},D=g=>{h(r.map(b=>b.url===g?{...b,is_official:!b.is_official}:b))},U=()=>{const g=P();g!==null&&M.mutate({paperId:a,projectPages:g})},T=i.useMemo(()=>{const g=k.trim(),b=g?[...r,{url:g,is_official:!1}]:r;if(b.length!==n.length)return!0;const A=new Map(n.map(O=>[O.url.trim(),!!O.is_official]));return b.some(O=>{const B=A.get(O.url.trim());return B===void 0||B!==!!O.is_official})},[r,k,n]);return e.jsx(ue,{open:t,onOpenChange:s,children:e.jsxs(me,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(pe,{children:[e.jsx(he,{children:"Edit Paper Project Pages"}),e.jsx(fe,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx($e,{isAuthor:u}),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(ne,{type:"url",placeholder:"https://example.com/project",value:k,onChange:g=>_(g.target.value),onKeyPress:g=>{g.key==="Enter"&&(g.preventDefault(),F())},className:"flex-1"}),e.jsxs(Q,{onClick:F,size:"sm",disabled:!k.trim(),children:[e.jsx(jt,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:r.length>0?e.jsx("div",{className:"space-y-2",children:r.map((g,b)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(ss,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:g.url}),g.is_official&&e.jsx(bs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(Q,{variant:g.is_official?"default":"outline",size:"sm",onClick:()=>D(g.url),className:"h-8 px-2 text-xs",title:g.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(js,{className:`w-3.5 h-3.5 mr-1 ${g.is_official?"fill-current":""}`}),g.is_official?"Official":"Mark official"]}),e.jsx(Q,{variant:"ghost",size:"sm",onClick:()=>$(g.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(yt,{className:"w-4 h-4"})})]})]},b))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ss,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(Ee,{children:[e.jsx(Q,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(Q,{onClick:U,disabled:M.isPending||!T,children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Ua({open:t,onOpenChange:s,paperId:a,arxivId:d,initialUrl:n,onSuccess:l,submitMode:o="direct",isAuthor:u=!1}){const[r,h]=i.useState(n),k=Ce(),{toast:_}=de(),N=i.useRef(!1);i.useEffect(()=>{if(!t){N.current=!1;return}N.current||(N.current=!0,h(n))},[t,n]);const C=xe({mutationFn:async({paperId:$,sourceUrl:D})=>o==="pending"?(await Ne({paper_id:parseInt($),edit_type:"source_url",proposed_payload:{source_url:D}}),null):wr($,D),onSuccess:$=>{if(o==="pending"){_({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),l==null||l(),s(!1);return}$&&Be(k,$,[a,d]),l==null||l(),s(!1)},onError:$=>{var T;const D=$;let U=D.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(D.response)try{const g=JSON.parse(D.response);typeof(g==null?void 0:g.detail)=="string"?U=g.detail:Array.isArray(g==null?void 0:g.detail)&&((T=g.detail[0])!=null&&T.msg)&&(U=g.detail[0].msg)}catch{U=D.response}_({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:U,variant:"destructive"})}}),w=r.trim(),M=/^https?:\/\//i.test(w),P=w!==(n||"").trim(),F=()=>{M&&C.mutate({paperId:a,sourceUrl:w})};return e.jsx(ue,{open:t,onOpenChange:s,children:e.jsxs(me,{className:"max-w-2xl",children:[e.jsxs(pe,{children:[e.jsx(he,{children:"Edit Source URL"}),e.jsxs(fe,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx($e,{isAuthor:u}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(ne,{type:"url",placeholder:"https://example.com/paper",value:r,onChange:$=>h($.target.value),onKeyPress:$=>{$.key==="Enter"&&M&&P&&($.preventDefault(),F())}}),!M&&w.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(Ee,{children:[e.jsx(Q,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(Q,{onClick:F,disabled:C.isPending||!M||!P,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Oa(t){const s=Ba(t),a=i.forwardRef((d,n)=>{const{children:l,...o}=d,u=i.Children.toArray(l),r=u.find(Ka);if(r){const h=r.props.children,k=u.map(_=>_===r?i.Children.count(h)>1?i.Children.only(null):i.isValidElement(h)?h.props.children:null:_);return e.jsx(s,{...o,ref:n,children:i.isValidElement(h)?i.cloneElement(h,void 0,k):null})}return e.jsx(s,{...o,ref:n,children:l})});return a.displayName=`${t}.Slot`,a}function Ba(t){const s=i.forwardRef((a,d)=>{const{children:n,...l}=a;if(i.isValidElement(n)){const o=za(n),u=Ha(l,n.props);return n.type!==i.Fragment&&(u.ref=d?Ie(d,o):o),i.cloneElement(n,u)}return i.Children.count(n)>1?i.Children.only(null):null});return s.displayName=`${t}.SlotClone`,s}var qa=Symbol("radix.slottable");function Ka(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===qa}function Ha(t,s){const a={...s};for(const d in s){const n=t[d],l=s[d];/^on[A-Z]/.test(d)?n&&l?a[d]=(...u)=>{const r=l(...u);return n(...u),r}:n&&(a[d]=n):d==="style"?a[d]={...n,...l}:d==="className"&&(a[d]=[n,l].filter(Boolean).join(" "))}return{...t,...a}}function za(t){var d,n;let s=(d=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:d.get,a=s&&"isReactWarning"in s&&s.isReactWarning;return a?t.ref:(s=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,a=s&&"isReactWarning"in s&&s.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}var rt="Popover",[Is]=ms(rt,[xs]),qe=xs(),[Qa,ge]=Is(rt),Fs=t=>{const{__scopePopover:s,children:a,open:d,defaultOpen:n,onOpenChange:l,modal:o=!1}=t,u=qe(s),r=i.useRef(null),[h,k]=i.useState(!1),[_,N]=us({prop:d,defaultProp:n??!1,onChange:l,caller:rt});return e.jsx(Nr,{...u,children:e.jsx(Qa,{scope:s,contentId:_e(),triggerRef:r,open:_,onOpenChange:N,onOpenToggle:i.useCallback(()=>N(C=>!C),[N]),hasCustomAnchor:h,onCustomAnchorAdd:i.useCallback(()=>k(!0),[]),onCustomAnchorRemove:i.useCallback(()=>k(!1),[]),modal:o,children:a})})};Fs.displayName=rt;var $s="PopoverAnchor",Va=i.forwardRef((t,s)=>{const{__scopePopover:a,...d}=t,n=ge($s,a),l=qe(a),{onCustomAnchorAdd:o,onCustomAnchorRemove:u}=n;return i.useEffect(()=>(o(),()=>u()),[o,u]),e.jsx(fs,{...l,...d,ref:s})});Va.displayName=$s;var Ts="PopoverTrigger",Ms=i.forwardRef((t,s)=>{const{__scopePopover:a,...d}=t,n=ge(Ts,a),l=qe(a),o=et(s,n.triggerRef),u=e.jsx(ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Bs(n.open),...d,ref:o,onClick:ye(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?u:e.jsx(fs,{asChild:!0,...l,children:u})});Ms.displayName=Ts;var Nt="PopoverPortal",[Ga,Wa]=Is(Nt,{forceMount:void 0}),Ls=t=>{const{__scopePopover:s,forceMount:a,children:d,container:n}=t,l=ge(Nt,s);return e.jsx(Ga,{scope:s,forceMount:a,children:e.jsx(vt,{present:a||l.open,children:e.jsx(Cr,{asChild:!0,container:n,children:d})})})};Ls.displayName=Nt;var Fe="PopoverContent",Ds=i.forwardRef((t,s)=>{const a=Wa(Fe,t.__scopePopover),{forceMount:d=a.forceMount,...n}=t,l=ge(Fe,t.__scopePopover);return e.jsx(vt,{present:d||l.open,children:l.modal?e.jsx(Ja,{...n,ref:s}):e.jsx(Ya,{...n,ref:s})})});Ds.displayName=Fe;var Xa=Oa("PopoverContent.RemoveScroll"),Ja=i.forwardRef((t,s)=>{const a=ge(Fe,t.__scopePopover),d=i.useRef(null),n=et(s,d),l=i.useRef(!1);return i.useEffect(()=>{const o=d.current;if(o)return Er(o)},[]),e.jsx(Sr,{as:Xa,allowPinchZoom:!0,children:e.jsx(Us,{...t,ref:n,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(t.onCloseAutoFocus,o=>{var u;o.preventDefault(),l.current||(u=a.triggerRef.current)==null||u.focus()}),onPointerDownOutside:ye(t.onPointerDownOutside,o=>{const u=o.detail.originalEvent,r=u.button===0&&u.ctrlKey===!0,h=u.button===2||r;l.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:ye(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ya=i.forwardRef((t,s)=>{const a=ge(Fe,t.__scopePopover),d=i.useRef(!1),n=i.useRef(!1);return e.jsx(Us,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var o,u;(o=t.onCloseAutoFocus)==null||o.call(t,l),l.defaultPrevented||(d.current||(u=a.triggerRef.current)==null||u.focus(),l.preventDefault()),d.current=!1,n.current=!1},onInteractOutside:l=>{var r,h;(r=t.onInteractOutside)==null||r.call(t,l),l.defaultPrevented||(d.current=!0,l.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const o=l.target;((h=a.triggerRef.current)==null?void 0:h.contains(o))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&n.current&&l.preventDefault()}})}),Us=i.forwardRef((t,s)=>{const{__scopePopover:a,trapFocus:d,onOpenAutoFocus:n,onCloseAutoFocus:l,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:r,onFocusOutside:h,onInteractOutside:k,..._}=t,N=ge(Fe,a),C=qe(a);return Pr(),e.jsx(Rr,{asChild:!0,loop:!0,trapped:d,onMountAutoFocus:n,onUnmountAutoFocus:l,children:e.jsx(Ar,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:k,onEscapeKeyDown:u,onPointerDownOutside:r,onFocusOutside:h,onDismiss:()=>N.onOpenChange(!1),children:e.jsx(Ir,{"data-state":Bs(N.open),role:"dialog",id:N.contentId,...C,..._,ref:s,style:{..._.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Os="PopoverClose",Za=i.forwardRef((t,s)=>{const{__scopePopover:a,...d}=t,n=ge(Os,a);return e.jsx(ee.button,{type:"button",...d,ref:s,onClick:ye(t.onClick,()=>n.onOpenChange(!1))})});Za.displayName=Os;var en="PopoverArrow",tn=i.forwardRef((t,s)=>{const{__scopePopover:a,...d}=t,n=qe(a);return e.jsx(Fr,{...n,...d,ref:s})});tn.displayName=en;function Bs(t){return t?"open":"closed"}var sn=Fs,rn=Ms,an=Ls,qs=Ds;const nn=sn,on=rn,Ks=i.forwardRef(({className:t,align:s="center",sideOffset:a=4,...d},n)=>e.jsx(an,{children:e.jsx(qs,{ref:n,align:s,sideOffset:a,className:se("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...d})}));Ks.displayName=qs.displayName;var as=1,ln=.9,cn=.8,dn=.17,ct=.1,dt=.999,un=.9999,mn=.99,pn=/[\\\/_+.#"@\[\(\{&]/,hn=/[\\\/_+.#"@\[\(\{&]/g,fn=/[\s-]/,Hs=/[\s-]/g;function xt(t,s,a,d,n,l,o){if(l===s.length)return n===t.length?as:mn;var u=`${n},${l}`;if(o[u]!==void 0)return o[u];for(var r=d.charAt(l),h=a.indexOf(r,n),k=0,_,N,C,w;h>=0;)_=xt(t,s,a,d,h+1,l+1,o),_>k&&(h===n?_*=as:pn.test(t.charAt(h-1))?(_*=cn,C=t.slice(n,h-1).match(hn),C&&n>0&&(_*=Math.pow(dt,C.length))):fn.test(t.charAt(h-1))?(_*=ln,w=t.slice(n,h-1).match(Hs),w&&n>0&&(_*=Math.pow(dt,w.length))):(_*=dn,n>0&&(_*=Math.pow(dt,h-n))),t.charAt(h)!==s.charAt(l)&&(_*=un)),(_<ct&&a.charAt(h-1)===d.charAt(l+1)||d.charAt(l+1)===d.charAt(l)&&a.charAt(h-1)!==d.charAt(l))&&(N=xt(t,s,a,d,h+1,l+2,o),N*ct>_&&(_=N*ct)),_>k&&(k=_),h=a.indexOf(r,h+1);return o[u]=k,k}function ns(t){return t.toLowerCase().replace(Hs," ")}function xn(t,s,a){return t=a&&a.length>0?`${t+" "+a.join(" ")}`:t,xt(t,s,ns(t),ns(s),0,0,{})}var Le='[cmdk-group=""]',ut='[cmdk-group-items=""]',gn='[cmdk-group-heading=""]',zs='[cmdk-item=""]',is=`${zs}:not([aria-disabled="true"])`,gt="cmdk-item-select",Pe="data-value",vn=(t,s,a)=>xn(t,s,a),Qs=i.createContext(void 0),Ke=()=>i.useContext(Qs),Vs=i.createContext(void 0),Ct=()=>i.useContext(Vs),Gs=i.createContext(void 0),Ws=i.forwardRef((t,s)=>{let a=Re(()=>{var p,I;return{search:"",value:(I=(p=t.value)!=null?p:t.defaultValue)!=null?I:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),d=Re(()=>new Set),n=Re(()=>new Map),l=Re(()=>new Map),o=Re(()=>new Set),u=Xs(t),{label:r,children:h,value:k,onValueChange:_,filter:N,shouldFilter:C,loop:w,disablePointerSelection:M=!1,vimBindings:P=!0,...F}=t,$=_e(),D=_e(),U=_e(),T=i.useRef(null),g=Pn();ke(()=>{if(k!==void 0){let p=k.trim();a.current.value=p,b.emit()}},[k]),ke(()=>{g(6,J)},[]);let b=i.useMemo(()=>({subscribe:p=>(o.current.add(p),()=>o.current.delete(p)),snapshot:()=>a.current,setState:(p,I,q)=>{var R,K,z,W;if(!Object.is(a.current[p],I)){if(a.current[p]=I,p==="search")G(),B(),g(1,H);else if(p==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let V=document.getElementById(U);V?V.focus():(R=document.getElementById($))==null||R.focus()}if(g(7,()=>{var V;a.current.selectedItemId=(V=v())==null?void 0:V.id,b.emit()}),q||g(5,J),((K=u.current)==null?void 0:K.value)!==void 0){let V=I??"";(W=(z=u.current).onValueChange)==null||W.call(z,V);return}}b.emit()}},emit:()=>{o.current.forEach(p=>p())}}),[]),A=i.useMemo(()=>({value:(p,I,q)=>{var R;I!==((R=l.current.get(p))==null?void 0:R.value)&&(l.current.set(p,{value:I,keywords:q}),a.current.filtered.items.set(p,O(I,q)),g(2,()=>{B(),b.emit()}))},item:(p,I)=>(d.current.add(p),I&&(n.current.has(I)?n.current.get(I).add(p):n.current.set(I,new Set([p]))),g(3,()=>{G(),B(),a.current.value||H(),b.emit()}),()=>{l.current.delete(p),d.current.delete(p),a.current.filtered.items.delete(p);let q=v();g(4,()=>{G(),(q==null?void 0:q.getAttribute("id"))===p&&H(),b.emit()})}),group:p=>(n.current.has(p)||n.current.set(p,new Set),()=>{l.current.delete(p),n.current.delete(p)}),filter:()=>u.current.shouldFilter,label:r||t["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:$,inputId:U,labelId:D,listInnerRef:T}),[]);function O(p,I){var q,R;let K=(R=(q=u.current)==null?void 0:q.filter)!=null?R:vn;return p?K(p,a.current.search,I):0}function B(){if(!a.current.search||u.current.shouldFilter===!1)return;let p=a.current.filtered.items,I=[];a.current.filtered.groups.forEach(R=>{let K=n.current.get(R),z=0;K.forEach(W=>{let V=p.get(W);z=Math.max(V,z)}),I.push([R,z])});let q=T.current;E().sort((R,K)=>{var z,W;let V=R.getAttribute("id"),Y=K.getAttribute("id");return((z=p.get(Y))!=null?z:0)-((W=p.get(V))!=null?W:0)}).forEach(R=>{let K=R.closest(ut);K?K.appendChild(R.parentElement===K?R:R.closest(`${ut} > *`)):q.appendChild(R.parentElement===q?R:R.closest(`${ut} > *`))}),I.sort((R,K)=>K[1]-R[1]).forEach(R=>{var K;let z=(K=T.current)==null?void 0:K.querySelector(`${Le}[${Pe}="${encodeURIComponent(R[0])}"]`);z==null||z.parentElement.appendChild(z)})}function H(){let p=E().find(q=>q.getAttribute("aria-disabled")!=="true"),I=p==null?void 0:p.getAttribute(Pe);b.setState("value",I||void 0)}function G(){var p,I,q,R;if(!a.current.search||u.current.shouldFilter===!1){a.current.filtered.count=d.current.size;return}a.current.filtered.groups=new Set;let K=0;for(let z of d.current){let W=(I=(p=l.current.get(z))==null?void 0:p.value)!=null?I:"",V=(R=(q=l.current.get(z))==null?void 0:q.keywords)!=null?R:[],Y=O(W,V);a.current.filtered.items.set(z,Y),Y>0&&K++}for(let[z,W]of n.current)for(let V of W)if(a.current.filtered.items.get(V)>0){a.current.filtered.groups.add(z);break}a.current.filtered.count=K}function J(){var p,I,q;let R=v();R&&(((p=R.parentElement)==null?void 0:p.firstChild)===R&&((q=(I=R.closest(Le))==null?void 0:I.querySelector(gn))==null||q.scrollIntoView({block:"nearest"})),R.scrollIntoView({block:"nearest"}))}function v(){var p;return(p=T.current)==null?void 0:p.querySelector(`${zs}[aria-selected="true"]`)}function E(){var p;return Array.from(((p=T.current)==null?void 0:p.querySelectorAll(is))||[])}function m(p){let I=E()[p];I&&b.setState("value",I.getAttribute(Pe))}function x(p){var I;let q=v(),R=E(),K=R.findIndex(W=>W===q),z=R[K+p];(I=u.current)!=null&&I.loop&&(z=K+p<0?R[R.length-1]:K+p===R.length?R[0]:R[K+p]),z&&b.setState("value",z.getAttribute(Pe))}function f(p){let I=v(),q=I==null?void 0:I.closest(Le),R;for(;q&&!R;)q=p>0?En(q,Le):Sn(q,Le),R=q==null?void 0:q.querySelector(is);R?b.setState("value",R.getAttribute(Pe)):x(p)}let j=()=>m(E().length-1),y=p=>{p.preventDefault(),p.metaKey?j():p.altKey?f(1):x(1)},L=p=>{p.preventDefault(),p.metaKey?m(0):p.altKey?f(-1):x(-1)};return i.createElement(ee.div,{ref:s,tabIndex:-1,...F,"cmdk-root":"",onKeyDown:p=>{var I;(I=F.onKeyDown)==null||I.call(F,p);let q=p.nativeEvent.isComposing||p.keyCode===229;if(!(p.defaultPrevented||q))switch(p.key){case"n":case"j":{P&&p.ctrlKey&&y(p);break}case"ArrowDown":{y(p);break}case"p":case"k":{P&&p.ctrlKey&&L(p);break}case"ArrowUp":{L(p);break}case"Home":{p.preventDefault(),m(0);break}case"End":{p.preventDefault(),j();break}case"Enter":{p.preventDefault();let R=v();if(R){let K=new Event(gt);R.dispatchEvent(K)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:An},r),at(t,p=>i.createElement(Vs.Provider,{value:b},i.createElement(Qs.Provider,{value:A},p))))}),bn=i.forwardRef((t,s)=>{var a,d;let n=_e(),l=i.useRef(null),o=i.useContext(Gs),u=Ke(),r=Xs(t),h=(d=(a=r.current)==null?void 0:a.forceMount)!=null?d:o==null?void 0:o.forceMount;ke(()=>{if(!h)return u.item(n,o==null?void 0:o.id)},[h]);let k=Js(n,l,[t.value,t.children,l],t.keywords),_=Ct(),N=ce(g=>g.value&&g.value===k.current),C=ce(g=>h||u.filter()===!1?!0:g.search?g.filtered.items.get(n)>0:!0);i.useEffect(()=>{let g=l.current;if(!(!g||t.disabled))return g.addEventListener(gt,w),()=>g.removeEventListener(gt,w)},[C,t.onSelect,t.disabled]);function w(){var g,b;M(),(b=(g=r.current).onSelect)==null||b.call(g,k.current)}function M(){_.setState("value",k.current,!0)}if(!C)return null;let{disabled:P,value:F,onSelect:$,forceMount:D,keywords:U,...T}=t;return i.createElement(ee.div,{ref:Ie(l,s),...T,id:n,"cmdk-item":"",role:"option","aria-disabled":!!P,"aria-selected":!!N,"data-disabled":!!P,"data-selected":!!N,onPointerMove:P||u.getDisablePointerSelection()?void 0:M,onClick:P?void 0:w},t.children)}),jn=i.forwardRef((t,s)=>{let{heading:a,children:d,forceMount:n,...l}=t,o=_e(),u=i.useRef(null),r=i.useRef(null),h=_e(),k=Ke(),_=ce(C=>n||k.filter()===!1?!0:C.search?C.filtered.groups.has(o):!0);ke(()=>k.group(o),[]),Js(o,u,[t.value,t.heading,r]);let N=i.useMemo(()=>({id:o,forceMount:n}),[n]);return i.createElement(ee.div,{ref:Ie(u,s),...l,"cmdk-group":"",role:"presentation",hidden:_?void 0:!0},a&&i.createElement("div",{ref:r,"cmdk-group-heading":"","aria-hidden":!0,id:h},a),at(t,C=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?h:void 0},i.createElement(Gs.Provider,{value:N},C))))}),yn=i.forwardRef((t,s)=>{let{alwaysRender:a,...d}=t,n=i.useRef(null),l=ce(o=>!o.search);return!a&&!l?null:i.createElement(ee.div,{ref:Ie(n,s),...d,"cmdk-separator":"",role:"separator"})}),_n=i.forwardRef((t,s)=>{let{onValueChange:a,...d}=t,n=t.value!=null,l=Ct(),o=ce(h=>h.search),u=ce(h=>h.selectedItemId),r=Ke();return i.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),i.createElement(ee.input,{ref:s,...d,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":r.listId,"aria-labelledby":r.labelId,"aria-activedescendant":u,id:r.inputId,type:"text",value:n?t.value:o,onChange:h=>{n||l.setState("search",h.target.value),a==null||a(h.target.value)}})}),kn=i.forwardRef((t,s)=>{let{children:a,label:d="Suggestions",...n}=t,l=i.useRef(null),o=i.useRef(null),u=ce(h=>h.selectedItemId),r=Ke();return i.useEffect(()=>{if(o.current&&l.current){let h=o.current,k=l.current,_,N=new ResizeObserver(()=>{_=requestAnimationFrame(()=>{let C=h.offsetHeight;k.style.setProperty("--cmdk-list-height",C.toFixed(1)+"px")})});return N.observe(h),()=>{cancelAnimationFrame(_),N.unobserve(h)}}},[]),i.createElement(ee.div,{ref:Ie(l,s),...n,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":d,id:r.listId},at(t,h=>i.createElement("div",{ref:Ie(o,r.listInnerRef),"cmdk-list-sizer":""},h)))}),wn=i.forwardRef((t,s)=>{let{open:a,onOpenChange:d,overlayClassName:n,contentClassName:l,container:o,...u}=t;return i.createElement(la,{open:a,onOpenChange:d},i.createElement(ca,{container:o},i.createElement(da,{"cmdk-overlay":"",className:n}),i.createElement(ua,{"aria-label":t.label,"cmdk-dialog":"",className:l},i.createElement(Ws,{ref:s,...u}))))}),Nn=i.forwardRef((t,s)=>ce(a=>a.filtered.count===0)?i.createElement(ee.div,{ref:s,...t,"cmdk-empty":"",role:"presentation"}):null),Cn=i.forwardRef((t,s)=>{let{progress:a,children:d,label:n="Loading...",...l}=t;return i.createElement(ee.div,{ref:s,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},at(t,o=>i.createElement("div",{"aria-hidden":!0},o)))}),Z=Object.assign(Ws,{List:kn,Item:bn,Input:_n,Group:jn,Separator:yn,Dialog:wn,Empty:Nn,Loading:Cn});function En(t,s){let a=t.nextElementSibling;for(;a;){if(a.matches(s))return a;a=a.nextElementSibling}}function Sn(t,s){let a=t.previousElementSibling;for(;a;){if(a.matches(s))return a;a=a.previousElementSibling}}function Xs(t){let s=i.useRef(t);return ke(()=>{s.current=t}),s}var ke=typeof window>"u"?i.useEffect:i.useLayoutEffect;function Re(t){let s=i.useRef();return s.current===void 0&&(s.current=t()),s}function ce(t){let s=Ct(),a=()=>t(s.snapshot());return i.useSyncExternalStore(s.subscribe,a,a)}function Js(t,s,a,d=[]){let n=i.useRef(),l=Ke();return ke(()=>{var o;let u=(()=>{var h;for(let k of a){if(typeof k=="string")return k.trim();if(typeof k=="object"&&"current"in k)return k.current?(h=k.current.textContent)==null?void 0:h.trim():n.current}})(),r=d.map(h=>h.trim());l.value(t,u,r),(o=s.current)==null||o.setAttribute(Pe,u),n.current=u}),n}var Pn=()=>{let[t,s]=i.useState(),a=Re(()=>new Map);return ke(()=>{a.current.forEach(d=>d()),a.current=new Map},[t]),(d,n)=>{a.current.set(d,n),s({})}};function Rn(t){let s=t.type;return typeof s=="function"?s(t.props):"render"in s?s.render(t.props):t}function at({asChild:t,children:s},a){return t&&i.isValidElement(s)?i.cloneElement(Rn(s),{ref:s.ref},a(s.props.children)):a(s)}var An={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ys=i.forwardRef(({className:t,...s},a)=>e.jsx(Z,{ref:a,className:se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...s}));Ys.displayName=Z.displayName;const Zs=i.forwardRef(({className:t,...s},a)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Oe,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Z.Input,{ref:a,className:se("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...s})]}));Zs.displayName=Z.Input.displayName;const er=i.forwardRef(({className:t,...s},a)=>e.jsx(Z.List,{ref:a,className:se("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...s}));er.displayName=Z.List.displayName;const tr=i.forwardRef((t,s)=>e.jsx(Z.Empty,{ref:s,className:"py-6 text-center text-sm",...t}));tr.displayName=Z.Empty.displayName;const sr=i.forwardRef(({className:t,...s},a)=>e.jsx(Z.Group,{ref:a,className:se("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...s}));sr.displayName=Z.Group.displayName;const In=i.forwardRef(({className:t,...s},a)=>e.jsx(Z.Separator,{ref:a,className:se("-mx-1 h-px bg-border",t),...s}));In.displayName=Z.Separator.displayName;const rr=i.forwardRef(({className:t,...s},a)=>e.jsx(Z.Item,{ref:a,className:se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...s}));rr.displayName=Z.Item.displayName;const Fn=250;function os({value:t,onChange:s,placeholder:a="Select...",searchPlaceholder:d="Search...",emptyMessage:n="No results found.",disabled:l=!1,selectedOption:o,queryKey:u,queryFn:r,enabled:h=!0,className:k}){const[_,N]=i.useState(!1),[C,w]=i.useState(""),[M,P]=i.useState("");i.useEffect(()=>{const T=window.setTimeout(()=>{P(C.trim())},Fn);return()=>window.clearTimeout(T)},[C]),i.useEffect(()=>{_||(w(""),P(""))},[_]);const{data:F=[],isFetching:$}=ie({queryKey:[...u,M],queryFn:()=>r(M),enabled:h&&_}),D=i.useMemo(()=>!t||F.some(T=>T.value===t)?F:(o==null?void 0:o.value)===t?[o,...F]:F,[F,o,t]),U=i.useMemo(()=>{if(!t)return a;const T=D.find(g=>g.value===t)??((o==null?void 0:o.value)===t?o:null);return(T==null?void 0:T.label)??a},[D,a,o,t]);return e.jsxs(nn,{open:_,onOpenChange:N,modal:!0,children:[e.jsx(on,{asChild:!0,children:e.jsxs(Q,{type:"button",variant:"outline",role:"combobox","aria-expanded":_,disabled:l,className:se("h-8 w-full justify-between px-2 text-sm font-normal",!t&&"text-muted-foreground",k),children:[e.jsx("span",{className:"truncate",children:U}),e.jsx(ha,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(Ks,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:T=>T.stopPropagation(),children:e.jsxs(Ys,{shouldFilter:!1,className:"h-full",children:[e.jsx(Zs,{placeholder:d,value:C,onValueChange:w}),e.jsx(er,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:$?e.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[e.jsx(ae,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):D.length===0?e.jsx(tr,{children:n}):e.jsx(sr,{children:D.map(T=>e.jsxs(rr,{value:T.value,onSelect:()=>{s(T.value),N(!1)},children:[e.jsx(oe,{className:se("mr-2 h-4 w-4",t===T.value?"opacity-100":"opacity-0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate",children:T.label}),T.description?e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:T.description}):null]})]},T.value))})})]})})]})}const mt=100;function $n(t){return t.map(s=>{const a=s.best_metric||Object.keys(s.metrics)[0],d=s.metrics[a];return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:a||"",metric_value:String(d||""),best_rank:s.best_rank?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",is_open:s.is_open!==!1,operation:"unchanged"}})}function Tn(t){const s=new Map;return t.forEach(a=>{a.task_id&&a.task_name&&s.set(a.task_id,{id:a.task_id,name:a.task_name,slug:a.task_slug,level:0})}),s}function Mn(t){const s=new Map;return t.forEach(a=>{a.dataset_id&&a.dataset_name&&s.set(a.dataset_id,{id:a.dataset_id,name:a.dataset_name,slug:a.dataset_slug})}),s}function ls(t,s){return`${t}:${s}`}function Xe(t){const s=t.trim();if(s==="")return null;const a=Number(s);return!Number.isFinite(a)||a<0?null:Math.trunc(a)}function Ln({open:t,onOpenChange:s,paperId:a,arxivId:d,initialEvaluations:n,onSuccess:l,submitMode:o="direct",isAuthor:u=!1}){const[r,h]=i.useState([]),[k,_]=i.useState(new Map),[N,C]=i.useState(new Map),w=Ce(),{toast:M}=de(),P=i.useRef(!1),F=i.useRef(!1);i.useEffect(()=>{if(!t){P.current=!1,F.current=!1;return}P.current||F.current||n.length!==0&&(P.current=!0,h($n(n)),_(Tn(n)),C(Mn(n)))},[t,n]);const $=i.useMemo(()=>Array.from(new Set(r.map(m=>m.task_id).filter(m=>m&&m!==""))),[r]),D=i.useMemo(()=>{const m=new Set;return r.forEach(x=>{x.task_id&&x.dataset_id&&m.add(ls(x.task_id,x.dataset_id))}),Array.from(m)},[r]),U=ie({queryKey:["datasets-by-tasks-for-eval-edit",$,t],queryFn:async()=>{const m={};return await Promise.all($.map(async x=>{try{const f=await es({task_id:parseInt(x),page_size:mt});m[x]=f.results}catch(f){console.error(`Error fetching datasets for task ${x}:`,f),m[x]=[]}})),m},enabled:t&&$.length>0});i.useEffect(()=>{U.data&&C(m=>{const x=new Map(m);return Object.values(U.data).forEach(f=>{f.forEach(j=>{x.set(j.id,j)})}),x})},[U.data]);const T=ie({queryKey:["leaderboard-metrics-for-eval-edit",D,t],queryFn:async()=>{const m={};return await Promise.all(D.map(async x=>{const[f,j]=x.split(":");try{m[x]=await Lr(j,f)}catch(y){console.error(`Error fetching metrics for leaderboard ${x}:`,y),m[x]=[]}})),m},enabled:t&&D.length>0}),g=async m=>{const x=await hs({page_size:mt,visible_only:!0,...m?{q:m}:{}});return _(f=>{const j=new Map(f);return x.results.forEach(y=>j.set(y.id,y)),j}),x.results.map(f=>{var j;return{value:f.id,label:f.name,description:(j=f.description)==null?void 0:j.slice(0,100)}})},b=m=>async x=>{const f=await es({task_id:parseInt(m),page_size:mt,...x?{q:x}:{}});return C(j=>{const y=new Map(j);return f.results.forEach(L=>y.set(L.id,L)),y}),f.results.map(j=>({value:j.id,label:j.name,description:j.full_name}))},A=(m,x)=>{if(!m||!x)return!1;const f=N.get(x);return!!(f!=null&&f.supports_harness)},O=(m,x,f)=>{var L;if(!m||!x)return[];const y=(((L=T.data)==null?void 0:L[ls(m,x)])||[]).map(p=>({value:p.metric_name,label:p.metric_name,description:p.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return f&&!y.some(p=>p.value===f)&&y.unshift({value:f,label:`${f} (legacy)`,description:void 0}),y},B=xe({mutationFn:async({paperId:m,evaluations:x})=>{if(o==="pending"){const j=[];for(const y of x){if(y.operation==="delete"&&y.id){j.push({op:"delete",evaluation_id:parseInt(y.id)});continue}const L=A(y.task_id,y.dataset_id);if(y.operation==="create"){const p=Xe(y.num_parameters),I={task_id:parseInt(y.task_id),dataset_id:parseInt(y.dataset_id),metrics:{[y.metric_name]:y.metric_value},best_metric:y.metric_name};y.model_name&&(I.model_name=y.model_name),L&&y.harness&&(I.harness=y.harness),y.best_rank&&(I.best_rank=parseInt(y.best_rank)),p!=null&&(I.num_parameters=p),I.is_open=y.is_open,j.push({op:"create",data:I})}else if(y.operation==="update"&&y.id){const p={task_id:parseInt(y.task_id),dataset_id:parseInt(y.dataset_id),model_name:y.model_name||void 0,harness:L&&y.harness||null,metrics:{[y.metric_name]:y.metric_value},best_metric:y.metric_name,best_rank:y.best_rank?parseInt(y.best_rank):void 0,num_parameters:Xe(y.num_parameters),is_open:y.is_open};j.push({op:"update",evaluation_id:parseInt(y.id),data:p})}}return j.length===0?{submitted:!1}:(await Ne({paper_id:parseInt(m),edit_type:"evaluations",proposed_payload:{operations:j}}),{submitted:!0})}let f=!1;for(const j of x)if(j.operation==="delete"&&j.id){f=!0;try{await $r(j.id)}catch(y){if((typeof y=="object"&&y!==null&&"status"in y?y.status:void 0)!==404)throw y;console.log(`Evaluation ${j.id} already deleted or not found`)}}else if(j.operation==="create"){f=!0;const y=A(j.task_id,j.dataset_id),L=Xe(j.num_parameters);await Tr({paper_id:parseInt(m),task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),model_name:j.model_name||void 0,harness:y&&j.harness||void 0,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:L??void 0,is_open:j.is_open})}else if(j.operation==="update"&&j.id){f=!0;const y=A(j.task_id,j.dataset_id);await Mr(j.id,{task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),model_name:j.model_name||void 0,harness:y&&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:Xe(j.num_parameters),is_open:j.is_open})}return{submitted:f}},onSuccess:m=>{if(o==="pending"){m!=null&&m.submitted?M({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):M({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),l==null||l(),s(!1);return}w.invalidateQueries({queryKey:["paper-arxiv",d]}),w.invalidateQueries({queryKey:["evaluations","paper",a]}),l==null||l(),s(!1)},onError:m=>{var j;const x=m;let f=x.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(x.response)try{const y=JSON.parse(x.response);typeof(y==null?void 0:y.detail)=="string"?f=y.detail:Array.isArray(y==null?void 0:y.detail)&&((j=y.detail[0])!=null&&j.msg)&&(f=y.detail[0].msg)}catch{f=x.response}M({title:o==="pending"?"Could not submit edit":"Could not save evaluations",description:f,variant:"destructive"})}}),H=()=>{F.current=!0,h([...r,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",is_open:!0,operation:"create"}])},G=m=>{F.current=!0,r[m].id?h(r.map((f,j)=>j===m?{...f,operation:"delete"}:f)):h(r.filter((f,j)=>j!==m))},J=(m,x,f)=>{F.current=!0,h(r.map((j,y)=>{if(y!==m)return j;const L={...j,[x]:f};return x==="task_id"&&(L.dataset_id="",L.metric_name="",L.harness=""),x==="dataset_id"&&(L.metric_name="",f&&!A(L.task_id,f)&&(L.harness="")),j.operation==="unchanged"&&(L.operation="update"),L}))},v=(m,x)=>{F.current=!0,h(r.map((f,j)=>{if(j!==m)return f;const y={...f,is_open:x};return f.operation==="unchanged"&&(y.operation="update"),y}))},E=()=>{const m=r.filter(x=>x.operation!=="delete"||x.id);B.mutate({paperId:a,evaluations:m})};return e.jsx(ue,{open:t,onOpenChange:s,children:e.jsxs(me,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(pe,{children:[e.jsx(he,{children:"Edit Evaluation Results"}),e.jsx(fe,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),o==="pending"&&e.jsx($e,{isAuthor:u}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[r.filter(m=>m.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Model"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:r.map((m,x)=>{if(m.operation==="delete")return null;const f=k.get(m.task_id),j=N.get(m.dataset_id),y=O(m.task_id,m.dataset_id,m.metric_name),L=!!(m.task_id&&m.dataset_id)&&T.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(os,{value:m.task_id,onChange:p=>J(x,"task_id",p),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:f?{value:f.id,label:f.name}:null,queryKey:["eval-edit-task-search"],queryFn:g,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(os,{value:m.dataset_id,onChange:p=>J(x,"dataset_id",p),placeholder:m.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:m.task_id?"No datasets found for this task.":"Select a task first.",disabled:!m.task_id,selectedOption:j?{value:j.id,label:j.name}:null,queryKey:["eval-edit-dataset-search",m.task_id],queryFn:b(m.task_id),enabled:t&&!!m.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ne,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:m.model_name,onChange:p=>J(x,"model_name",p.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:A(m.task_id,m.dataset_id)?e.jsx(ne,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:m.harness,onChange:p=>J(x,"harness",p.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!m.task_id||!m.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):L?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(ae,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):y.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:m.metric_name,onChange:p=>J(x,"metric_name",p.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),y.map(p=>e.jsx("option",{value:p.value,children:p.label},p.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(ne,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:m.metric_value,onChange:p=>J(x,"metric_value",p.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ne,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:m.num_parameters,onChange:p=>J(x,"num_parameters",p.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:m.is_open,onChange:p=>v(x,p.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:()=>G(x),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(yt,{className:"w-4 h-4"})})})]},x)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(pa,{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:H,className:"flex items-center space-x-2",children:[e.jsx(jt,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(Ee,{children:[e.jsx(Q,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(Q,{onClick:E,disabled:B.isPending,children:B.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Dn({open:t,onOpenChange:s,sectionLabel:a,returnTo:d}){return e.jsx(ue,{open:t,onOpenChange:s,children:e.jsxs(me,{className:"max-w-md",children:[e.jsxs(pe,{children:[e.jsxs(he,{children:["Sign in to edit ",a]}),e.jsx(fe,{children:"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(Dr,{returnTo:d})})]})})}const Ae=["my-bookmark-ids"];function Un(){var d,n;const{user:t}=tt(),s=ie({queryKey:Ae,queryFn:()=>Ze.getMyBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),a=bt.useMemo(()=>{var l;return new Set(((l=s.data)==null?void 0:l.paper_ids)??[])},[(d=s.data)==null?void 0:d.paper_ids]);return{ids:((n=s.data)==null?void 0:n.paper_ids)??[],idSet:a,isLoading:s.isLoading,isError:s.isError}}function On(){const{user:t}=tt(),s=Ce(),a=xe({mutationFn:async({paperId:n,isBookmarked:l})=>{l?await Ze.removeBookmark(n):await Ze.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:l})=>{await s.cancelQueries({queryKey:Ae});const o=s.getQueryData(Ae),u=typeof n=="string"?Number(n):n,r=(o==null?void 0:o.paper_ids)??[],h=l?r.filter(k=>k!==u):[u,...r.filter(k=>k!==u)];return s.setQueryData(Ae,{paper_ids:h}),{previous:o}},onError:(n,l,o)=>{o!=null&&o.previous&&s.setQueryData(Ae,o.previous)},onSettled:()=>{s.invalidateQueries({queryKey:Ae}),s.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:bt.useCallback((n,l)=>{if(!t){if(gs())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=vs(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}a.mutate({paperId:n,isBookmarked:l})},[a,t]),isPending:a.isPending}}const Bn=({paperId:t})=>{const{user:s}=tt(),{idSet:a}=Un(),{toggle:d,isPending:n}=On();if(gs())return null;const l=Number(t),o=!!s&&a.has(l),u=()=>{Number.isFinite(l)&&d(l,o)},r=s&&o?"Saved":"Save",h=s?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:u,disabled:n,"aria-pressed":o,"aria-label":h,title:h,children:[e.jsx(te,{name:"bookmark",size:12}),r]})};function Je({children:t,showEdit:s=!1,onEdit:a,editAriaLabel:d}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:a,"aria-label":d,children:"edit"})]}):t}const qn={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","source-url":"source URL"},Ye=360,pt=3;function cs(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ds(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function je(t,s){try{const a=new URL(t),n=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):a.hostname.replace(/^www\./,"")}catch{return s}}const di=()=>{var Ut,Ot,Bt,qt,Kt,Ht,zt,Qt,Vt,Gt,Wt,Xt;const{arxivId:t}=Ur(),s=t?Or(t):"",a=Br(),{toast:d}=de(),{user:n}=tt(),l=(n==null?void 0:n.is_admin)??!1,o=!!n,u=!0,{data:r,isLoading:h,error:k,refetch:_}=aa(s||"",!!s),[N,C]=i.useState(!1);i.useEffect(()=>{if(!t||t===s)return;const c=window.location.search+window.location.hash;a(`/paper/${s}${c}`,{replace:!0})},[s,a,t]),i.useEffect(()=>{if(r!=null&&r.title)return document.title=sa(r.title),()=>{document.title=ra}},[r==null?void 0:r.title]),i.useEffect(()=>{if(C(!1),!(r!=null&&r.id))return;const c=window.setTimeout(()=>C(!0),0);return()=>window.clearTimeout(c)},[r==null?void 0:r.id]);const{data:w,isLoading:M}=va(N?r==null?void 0:r.arxiv_id:void 0),{data:P,isLoading:F}=fa(r==null?void 0:r.id,N&&!!(r!=null&&r.id)),{preferences:$}=qr(),D=i.useMemo(()=>!P||!$.hide_closed_source_evals?P:P.filter(c=>c.is_open!==!1),[P,$.hide_closed_source_evals]),U=i.useMemo(()=>({models:(r==null?void 0:r.hf_models)??[],datasets:(r==null?void 0:r.hf_datasets)??[],spaces:(r==null?void 0:r.hf_spaces)??[]}),[r==null?void 0:r.hf_models,r==null?void 0:r.hf_datasets,r==null?void 0:r.hf_spaces]),T=i.useMemo(()=>{if(!D)return[];const c=new Map;for(const S of D){const X=S.task_id,re=c.get(X);re?re.rows.push(S):c.set(X,{taskId:X,taskName:S.task_name||"—",taskSlug:S.task_slug,rows:[S]})}return Array.from(c.values())},[D]),g=ie({queryKey:["paper-versions",r==null?void 0:r.arxiv_id],queryFn:async()=>{const c=r.arxiv_id.replace(/v\d+$/,""),S=await fetch(vs(`/api/v1/papers/arxiv/${c}/versions`));return S.ok?await S.json():[]},enabled:N&&!!(r!=null&&r.arxiv_id),staleTime:10*60*1e3}),b=ie({queryKey:["related-papers",(Ot=(Ut=r==null?void 0:r.tasks)==null?void 0:Ut[0])==null?void 0:Ot.id],queryFn:()=>Ze.getTaskPapers(r.tasks[0].id,{page:1,page_size:5,order_by:"citation_count",order_dir:"desc",include_resources:!1}),enabled:N&&!!((qt=(Bt=r==null?void 0:r.tasks)==null?void 0:Bt[0])!=null&&qt.id),staleTime:10*60*1e3,select:c=>c.results.filter(S=>S.id!==(r==null?void 0:r.id)).slice(0,4)}),[A,O]=i.useState(!1),[B,H]=i.useState(!1),[G,J]=i.useState(!1),{isEditingTasks:v,setIsEditingTasks:E,isEditingMethods:m,setIsEditingMethods:x,isEditingRepositories:f,setIsEditingRepositories:j,isEditingProjectPages:y,setIsEditingProjectPages:L,isEditingEvaluations:p,setIsEditingEvaluations:I,isEditingSourceUrl:q,setIsEditingSourceUrl:R}=ba(),[K,z]=i.useState(null),W=i.useMemo(()=>{if(!n||!(r!=null&&r.author_links))return!1;const c=n.username.toLowerCase();return r.author_links.some(S=>!!S.hf_username&&S.hf_username.toLowerCase()===c)},[n,r==null?void 0:r.author_links]),V=l?"direct":"pending",Y=c=>{if(!o){z(c);return}switch(c){case"tasks":E(!0);return;case"methods":x(!0);return;case"results":I(!0);return;case"repositories":j(!0);return;case"project-pages":L(!0);return;case"source-url":R(!0);return}},[Et,nt]=i.useState("idle"),[St,Pt]=i.useState(null),[Rt,At]=i.useState(null),ar=async()=>{if(s){nt("indexing"),Pt(null),At(null);try{await Wr(s),d({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>_(),1200),nt("idle")}catch(c){const S=c;let X=S.message||"Failed to index paper";if(S.response)try{X=JSON.parse(S.response).detail||X}catch{X=S.response}Pt(X),(S.status===429||S.status===503)&&At("Try again later after arXiv has lifted the temporary limit."),nt("idle")}}},{citationDisplay:nr,citationCopy:It}=i.useMemo(()=>{if(!r)return{citationDisplay:"",citationCopy:""};const c=`${r.title.slice(0,60)}${r.title.length>60?"…":""}`,S=`${r.authors[0]||""}${r.authors.length>1?" et al.":""}`,X=r.authors.join(" and "),re=(r.published||"").slice(0,4)||"—",Jt=(Yt,Zt)=>r.arxiv_id?`@article{${r.arxiv_id.replace(".","")},
|
| 37 |
+
title={{${Yt}}},
|
| 38 |
+
author=${Zt},
|
| 39 |
+
year={{${re}}},
|
| 40 |
+
eprint={{${r.arxiv_id}}},
|
| 41 |
+
archivePrefix={{arXiv}}
|
| 42 |
+
}`:`@misc{paper${r.id},
|
| 43 |
+
title={{${Yt}}},
|
| 44 |
+
author=${Zt},
|
| 45 |
+
year={{${re}}},
|
| 46 |
+
url={{${r.source_url||r.url_abs||""}}}
|
| 47 |
+
}`;return{citationDisplay:Jt(c,`{{${S}}}`),citationCopy:Jt(r.title,`{${X}}`)}},[r]),[ir,Ft]=i.useState(!1),or=async()=>{if(It)try{await navigator.clipboard.writeText(It),Ft(!0),d({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Ft(!1),1500)}catch{d({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}};if(h)return e.jsxs("div",{className:"page",children:[e.jsx(De,{className:"h-12 w-3/4 mb-4"}),e.jsx(De,{className:"h-6 w-1/3 mb-8"}),e.jsx(De,{className:"h-64 w-full"})]});if(k||!r)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(be,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",s]})]}),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:",s]})," in the database. You can index it from arXiv right now."]}),St&&e.jsx(na,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(ia,{children:[e.jsx("div",{children:St}),Rt&&e.jsx("div",{className:"mt-2",children:Rt})]})}),e.jsxs("div",{className:"action-row",children:[l&&e.jsxs("button",{className:"action-btn",onClick:ar,disabled:Et==="indexing",children:[e.jsx(te,{name:"sparkle",size:12}),Et==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(Q,{variant:"outline",onClick:()=>a("/papers"),children:"Browse Papers"})]})]});const $t=g.data||[],Te=ta(r.repositories),ve=[...r.repositories??[]].sort((c,S)=>{const X=c.is_official?1:0,re=S.is_official?1:0;return X!==re?re-X:(S.num_stars||0)-(c.num_stars||0)}),lr=G?ve:ve.slice(0,pt),it=r.arxiv_id?{isLoading:M,paperHref:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/,"")}`,rows:[{label:"Models",href:`https://huggingface.co/models?other=arxiv:${r.arxiv_id}`,count:w==null?void 0:w.models,isLimited:w==null?void 0:w.isLimited,links:U.models.map(c=>({href:c,label:je(c,"Model")}))},{label:"Datasets",href:`https://huggingface.co/datasets?other=arxiv:${r.arxiv_id}`,count:w==null?void 0:w.datasets,isLimited:w==null?void 0:w.isLimited,links:U.datasets.map(c=>({href:c,label:je(c,"Dataset")}))},{label:"Spaces",href:`https://huggingface.co/spaces?arxivIds=${r.arxiv_id.replace(/v\d+$/,"")}`,count:w==null?void 0:w.spaces,isLimited:w==null?void 0:w.isLimited,links:U.spaces.map(c=>({href:c,label:je(c,"Space")}))}],footer:`Cite arxiv.org/abs/${r.arxiv_id.replace(/v\d+$/,"")} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:ht(U.models),count:U.models.length,links:U.models.map(c=>({href:c,label:je(c,"Model")}))},{label:"Datasets",href:ht(U.datasets),count:U.datasets.length,links:U.datasets.map(c=>({href:c,label:je(c,"Dataset")}))},{label:"Spaces",href:ht(U.spaces),count:U.spaces.length,links:U.spaces.map(c=>({href:c,label:je(c,"Space")}))}],footer:null},Tt=r.tldr||null,Mt=r.num_pages||null,Se=r.abstract||"",cr=Se.length>Ye?Se.slice(0,Ye)+"…":Se,dr=A||Se.length<=Ye?Se:cr,He=(r.methods||[]).filter(c=>c.source_paper_id===r.id),ze=r.introduced_benchmarks||[],ur=He.length>0||ze.length>0,Lt=r.arxiv_id?`arXiv:${r.arxiv_id}`:"External resource",mr=r.source==="external"?"Source page":"arXiv page",Me=((Kt=r.project_pages)==null?void 0:Kt.filter(c=>c.url))??[],pr=(()=>{const c=[];return He.length>0&&c.push(He.length===1?"this method":"these methods"),ze.length>0&&c.push(ze.length===1?"this benchmark":"these benchmarks"),c.length===0?"":c.length===1?c[0]:c.join(" and ")})(),Qe=r.predecessor_papers||[],Ve=r.successor_papers||[],hr=Qe.length>0||Ve.length>0,Ge=12,ot=r.authors.map((c,S)=>{var X,re;return{name:c,hf_username:((re=(X=r.author_links)==null?void 0:X[S])==null?void 0:re.hf_username)??null}}),Dt=B||ot.length<=Ge?ot:ot.slice(0,Ge);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(be,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:Lt})]}),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(We,{title:r.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:Lt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",cs(r.published)]}),Mt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Mt," pages"]})]}),r.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[r.citation_count.toLocaleString()," citations"]})]}),(r.proceeding||r.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),r.conference_slug?e.jsx("a",{href:`/conferences/${r.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(r.proceeding||r.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:r.proceeding.replace(/\s+\d{1,2}$/,"")})]}),$t.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:r.version,onChange:c=>{const S=c.target.value;r.arxiv_id&&a(`/paper/${r.arxiv_id.replace(/v\d+$/,"")}${S?`?version=${S}`:""}`)},children:$t.map(c=>e.jsxs("option",{value:c.version,children:[c.version," — ",cs(c.published)]},c.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Dt.map((c,S)=>e.jsxs(bt.Fragment,{children:[c.hf_username?e.jsx("a",{href:`https://huggingface.co/${c.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${c.hf_username} on Hugging Face`,children:c.name}):e.jsx("a",{children:c.name}),S<Dt.length-1?", ":""]},S)),r.authors.length>Ge&&e.jsx("button",{className:"show-more-authors",onClick:()=>H(c=>!c),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:B?"show fewer":`+${r.authors.length-Ge} more`})]}),e.jsxs("div",{className:"action-row",children:[r.url_pdf&&e.jsxs("a",{className:"action-btn",href:r.url_pdf,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(te,{name:"pdf",size:12})," View PDF"]}),r.url_abs&&e.jsx(Je,{showEdit:r.source==="external"&&u,onEdit:()=>Y("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:r.source==="external"&&u?"action-btn-segment action-btn-main":"action-btn",href:r.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(te,{name:"external",size:12})," ",mr]})}),it.paperHref&&(w==null?void 0:w.paperExists)&&e.jsxs("a",{className:"bm-action-btn",href:it.paperHref,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Hugging Face",children:["View on ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})]}),Te.githubUrl&&e.jsx(Je,{showEdit:u,onEdit:()=>Y("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Te.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(te,{name:"github",size:12})," Code",Te.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",ds(Te.github)," ★"]})]})}),Te.githubUrl?null:e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>Y("repositories"),title:"Add GitHub repository",children:[e.jsx(te,{name:"github",size:12})," Add code"]}),Me.length===1?e.jsx(Je,{showEdit:u,onEdit:()=>Y("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Me[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(te,{name:"globe",size:12})," Project page"]})}):null,Me.length>1?e.jsx(Je,{showEdit:u,onEdit:()=>Y("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(Kr,{children:[e.jsx(Hr,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(te,{name:"globe",size:12})," Project page"]})}),e.jsx(zr,{align:"start",className:"project-page-menu",children:Me.map((c,S)=>e.jsx(Qr,{asChild:!0,children:e.jsx("a",{href:c.url,target:"_blank",rel:"noopener noreferrer",children:je(c.url,`Project page ${S+1}`)})},c.url))})]})}):null,Me.length===0&&o?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>Y("project-pages"),title:"Add project page",children:[e.jsx(te,{name:"globe",size:12})," Add project page"]}):null,r.conference_url_abs&&e.jsxs("a",{className:"action-btn",href:r.conference_url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(te,{name:"external",size:12})," Conference"]}),(r.organizations||[]).map(c=>e.jsxs(be,{to:`/${c.slug}`,className:"action-btn",title:c.name,"aria-label":c.name,children:[c.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:c.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:S=>{S.currentTarget.style.display="none"}})}),c.name]},c.id)),e.jsx(Bn,{paperId:r.id})]})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Xr,{paperId:r.arxiv_id||r.id,title:r.title,thumbnailUrl:Vr(r.thumbnail_url),priority:!0})})]}),ur&&e.jsxs("div",{className:"introduced-banner",children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[He.map(c=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/methods/${c.slug||c.id}`),children:[c.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${c.id}`)),ze.map(c=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/benchmark/${c.slug||c.id}`),children:[c.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${c.id}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",pr,"."]})]}),hr&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Ve.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ve.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Ve.map(c=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>a(`/paper/${c.route_identifier}`),children:[e.jsx(We,{title:c.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${c.id}`))})]}),Qe.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Qe.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Qe.map(c=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>a(`/paper/${c.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(We,{title:c.title})]},`predecessor-${c.id}`))})]})]}),Tt&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"TL;DR · AI-generated"})}),e.jsx("div",{className:"tldr-box",children:Tt})]}),e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"Abstract"})}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(ea,{text:dr})}),Se.length>Ye&&e.jsx("div",{className:"read-full",onClick:()=>O(c=>!c),children:A?"− collapse abstract":"+ read full abstract"}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Tasks"}),e.jsxs("span",{className:"accent",children:[((Ht=r.tasks)==null?void 0:Ht.length)||0," tagged",e.jsx("button",{type:"button",onClick:()=>Y("tasks"),className:"edit-link",children:"edit"})]})]}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(r.tasks||[]).map(c=>e.jsx(Jr,{slug:c.slug||"",label:c.name},c.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Methods"}),e.jsxs("span",{className:"accent",children:[((zt=r.methods)==null?void 0:zt.length)||0," used",e.jsx("button",{type:"button",onClick:()=>Y("methods"),className:"edit-link",children:"edit"})]})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(r.methods||[]).map(c=>e.jsx(Yr,{method:c},c.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Results"}),e.jsxs("span",{className:"accent",children:[(D==null?void 0:D.length)||0," benchmarks",e.jsx("button",{type:"button",onClick:()=>Y("results"),className:"edit-link",children:"edit"})]})]}),F?e.jsx(De,{className:"h-32 w-full"}):T.length>0?T.map(c=>e.jsxs("div",{children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:c.taskSlug?e.jsx(be,{to:`/tasks/${c.taskSlug}`,children:c.taskName}):c.taskName}),e.jsxs("span",{className:"accent",children:[c.rows.length," ",c.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",{})]})}),e.jsx("tbody",{children:c.rows.map(S=>{var X;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:S.dataset_slug?e.jsx(be,{to:`/benchmark/${S.dataset_slug}`,children:S.dataset_name||"—"}):S.dataset_name||"—"}),e.jsxs("td",{className:"model",title:S.model_name||void 0,children:[S.model_name||"—",S.is_open===!1&&e.jsx(Zr,{})]}),e.jsx("td",{className:"metric",children:S.best_metric}),e.jsx("td",{className:"value",children:Gr((X=S.metrics)==null?void 0:X[S.best_metric||""])}),e.jsx("td",{className:"rank",children:S.best_rank!=null?`#${S.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:S.dataset_slug&&e.jsx(be,{to:`/benchmark/${S.dataset_slug}?${[S.task_slug?`task=${encodeURIComponent(S.task_slug)}`:"",`eval=${encodeURIComponent(S.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},S.id)})})]})]},c.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:[ve.length," repo",ve.length===1?"":"s",e.jsx("button",{type:"button",onClick:()=>Y("repositories"),className:"edit-link",children:"edit"})]})]}),lr.map(c=>e.jsxs("a",{href:c.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(te,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[c.owner,"/",c.name]}),c.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",ds(c.num_stars)]})]},c.id)),ve.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),ve.length>pt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>J(c=>!c),children:G?"− show top 3":`+ show ${ve.length-pt} more repos`})]}),e.jsx(Kn,{viewer:it}),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:or,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(te,{name:"copy",size:11}),ir?"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:nr})]}),(((Qt=b.data)==null?void 0:Qt.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),b.data.map(c=>e.jsxs(be,{to:`/paper/${c.arxiv_id||c.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(We,{title:c.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:c.arxiv_id?`arXiv:${c.arxiv_id}`:"External resource"}),c.citation_count!=null&&e.jsxs("span",{children:[c.citation_count.toLocaleString()," cites"]})]})]},c.id))]})]})]}),e.jsx(Fa,{open:v,onOpenChange:E,paperId:r.id,arxivId:s,initialTaskIds:((Vt=r.tasks)==null?void 0:Vt.map(c=>parseInt(c.id)))||[],initialTasks:r.tasks||[],submitMode:V,isAuthor:W}),e.jsx(Ma,{open:m,onOpenChange:x,paperId:r.id,arxivId:s,initialMethodIds:((Gt=r.methods)==null?void 0:Gt.map(c=>parseInt(c.id)))||[],initialMethods:r.methods||[],submitMode:V,isAuthor:W}),e.jsx(La,{open:f,onOpenChange:j,paperId:r.id,arxivId:s,initialRepositories:((Wt=r.repositories)==null?void 0:Wt.map(c=>({url:c.url,is_official:c.is_official||!1})))||[],submitMode:V,isAuthor:W}),e.jsx(Da,{open:y,onOpenChange:L,paperId:r.id,arxivId:s,initialProjectPages:((Xt=r.project_pages)==null?void 0:Xt.map(c=>({url:c.url,is_official:c.is_official||!1})))||[],submitMode:V,isAuthor:W}),e.jsx(Ln,{open:p,onOpenChange:I,paperId:r.id,arxivId:s,initialEvaluations:P||[],submitMode:V,isAuthor:W}),e.jsx(Ua,{open:q,onOpenChange:R,paperId:r.id,arxivId:s,initialUrl:r.source_url??r.url_abs??"",submitMode:V,isAuthor:W}),e.jsx(Dn,{open:K!==null,onOpenChange:c=>{c||z(null)},sectionLabel:K?qn[K]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})},Kn=({viewer:t})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:t.paperHref?e.jsx("a",{href:t.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"})}),t.isLoading?e.jsx(De,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[t.rows.map(s=>e.jsx(Hn,{...s},s.label)),t.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:t.footer})]})]}),Hn=({label:t,href:s,count:a,isLimited:d,links:n})=>{const l=((n==null?void 0:n.length)??0)>0,o=e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:t}),e.jsx("span",{style:{fontWeight:600,color:a?"var(--ink)":"var(--ink-faint)"},children:a!=null?`${a}${d?"+":""}`:"—"})]});return l?e.jsxs("div",{className:"hf-artifact-row",children:[o,e.jsx("div",{className:"hf-artifact-links",children:n.map(u=>e.jsx("a",{href:u.href,target:"_blank",rel:"noopener noreferrer",children:u.label},u.href))})]}):e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-row",children:o})};function ht(t){return t[0]??"https://huggingface.co"}export{di as default};
|
assets/{PapersListView-b_LgTzEk.js → PapersListView-CXIlDPqL.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as I,r as i,j as e,L as F,a as L}from"./index-
|
|
|
|
| 1 |
+
import{u as I,r as i,j as e,L as F,a as L}from"./index-M24Hywem.js";import{I as T,P as C}from"./components-J9e6gtqw.js";import{t as R,d as k}from"./transform-DVq_2bw1.js";import{u as D}from"./usePapers-DAX-IssB.js";import{u as E}from"./useDebounce-BNA3W9Is.js";import{u as O,P as B}from"./usePeriodFilter-D4iAjivb.js";import{u as $}from"./useIntersectionObserver-Bk74NMqD.js";import{S as c}from"./skeleton-DCGdUtqq.js";import{A as z,a as M}from"./alert-0Kui0gCY.js";import{u as q}from"./useQuery-C6YLWBWB.js";import"./LatexTitle-C8-B6cG1.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-D8U4M_OT.js";const K=[["trending","trending"],["new","newest"],["cited","most cited"]],te=()=>{var x,g,j,f,N;const[d,v]=I(),o=d.get("search")||"",[p,b]=i.useState(o),t=E(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),v(s,{replace:!0})},[t]);const[n,P]=i.useState("new"),{period:y,setPeriod:S,publishedAfter:w}=O("All Time"),a=D({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:w,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>L.getTasks({ordering:"-paper_count",page_size:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(A=>A.results))||[]).map(R)},[a.data]),{targetRef:_,isIntersecting:h}=$({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:B.map(s=>e.jsx("button",{className:`period-btn ${y===s?"active":""}`,onClick:()=>S(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(T,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>b(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(N=(f=m.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(F,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:K.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>P(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx(z,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(C,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:_,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{te as default};
|
assets/{SavedPapersView-CJCobMQf.js → SavedPapersView-CD0L6-uT.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{V as o,j as s,U as m,L as p,a as h}from"./index-M24Hywem.js";import{u as x}from"./useQuery-C6YLWBWB.js";import{T as u,P as j}from"./components-J9e6gtqw.js";import{S as r}from"./skeleton-DCGdUtqq.js";import{A as v,a as N}from"./alert-0Kui0gCY.js";import{t as g}from"./transform-DVq_2bw1.js";import"./LatexTitle-C8-B6cG1.js";import"./katex.min-BSBacQyE.js";const L=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{L as default};
|
assets/SearchOverlay-D8nJ8vYB.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as f,a0 as w,W as E,j as s,a as d}from"./index-M24Hywem.js";import{u}from"./useQuery-C6YLWBWB.js";import{L as Q}from"./LatexTitle-C8-B6cG1.js";import{u as C}from"./useDebounce-BNA3W9Is.js";import{e as L,h as R,d as K}from"./transform-DVq_2bw1.js";import"./katex.min-BSBacQyE.js";const D=({open:t,onClose:r})=>{var y,N,k;const p=f.useRef(null),b=w(),[m,F]=E.useState(""),a=C(m,200);f.useEffect(()=>{var n;if(!t)return;(n=p.current)==null||n.focus();const e=T=>{T.key==="Escape"&&r()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,r]);const g=u({queryKey:["search-papers",a],queryFn:()=>d.searchPapers(a,6),enabled:t&&a.length>=2,staleTime:6e4}),x=u({queryKey:["search-tasks",a],queryFn:()=>d.getTasks({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),j=u({queryKey:["search-methods",a],queryFn:()=>d.getMethods({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),v=u({queryKey:["search-benchmarks",a],queryFn:()=>d.getDatasets({q:a,page_size:6,ordering:"-paper_count"}),enabled:t&&a.length>=2,staleTime:6e4});if(!t)return null;const c=((y=x.data)==null?void 0:y.results)||[],l=((N=j.data)==null?void 0:N.results)||[],i=((k=v.data)==null?void 0:k.results)||[],h=g.data||[],_=g.isFetching||x.isFetching||j.isFetching||v.isFetching,q=c.length||h.length||l.length||i.length,o=e=>{r(),b(e)};return s.jsx("div",{className:"search-overlay",onClick:r,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:p,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:m,onChange:e=>F(e.target.value)}),s.jsxs("div",{className:"search-results",children:[!a&&s.jsx("div",{className:"search-empty",children:"Try “diffusion”, “object detection”, or an arXiv id."}),a&&!_&&!q&&s.jsxs("div",{className:"search-empty",children:['No matches for "',m,'"']}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",c.length]}),c.map(e=>{const n=L(R(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:n.dot}}),s.jsx("span",{className:"name",children:K(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),l.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",l.length]}),l.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),i.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",i.length]}),i.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),h.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · ",h.length]}),h.map(e=>{var n;return s.jsxs("div",{className:"search-result",onClick:()=>o(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(Q,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((n=e.authors)==null?void 0:n[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)})]})]})]})})};export{D as default};
|
assets/SearchOverlay-D_x7sv0Q.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as f,$ as w,V as E,j as s,a as d}from"./index-D3-tYEe-.js";import{u}from"./useQuery-C6S8Ozku.js";import{L as Q}from"./LatexTitle-ZrlO0rs7.js";import{u as C}from"./useDebounce-CkuFydiu.js";import{f as L,h as R,d as $}from"./transform-nNAikYlJ.js";import"./katex.min-BSBacQyE.js";const D=({open:t,onClose:r})=>{var y,N,k;const p=f.useRef(null),b=w(),[m,F]=E.useState(""),a=C(m,200);f.useEffect(()=>{var n;if(!t)return;(n=p.current)==null||n.focus();const e=T=>{T.key==="Escape"&&r()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,r]);const g=u({queryKey:["search-papers",a],queryFn:()=>d.searchPapers(a,6),enabled:t&&a.length>=2,staleTime:6e4}),x=u({queryKey:["search-tasks",a],queryFn:()=>d.getTasks({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),j=u({queryKey:["search-methods",a],queryFn:()=>d.getMethods({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),v=u({queryKey:["search-benchmarks",a],queryFn:()=>d.getDatasets({q:a,page_size:6,ordering:"-paper_count"}),enabled:t&&a.length>=2,staleTime:6e4});if(!t)return null;const c=((y=x.data)==null?void 0:y.results)||[],l=((N=j.data)==null?void 0:N.results)||[],i=((k=v.data)==null?void 0:k.results)||[],h=g.data||[],_=g.isFetching||x.isFetching||j.isFetching||v.isFetching,q=c.length||h.length||l.length||i.length,o=e=>{r(),b(e)};return s.jsx("div",{className:"search-overlay",onClick:r,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:p,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:m,onChange:e=>F(e.target.value)}),s.jsxs("div",{className:"search-results",children:[!a&&s.jsx("div",{className:"search-empty",children:"Try “diffusion”, “object detection”, or an arXiv id."}),a&&!_&&!q&&s.jsxs("div",{className:"search-empty",children:['No matches for "',m,'"']}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",c.length]}),c.map(e=>{const n=L(R(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:n.dot}}),s.jsx("span",{className:"name",children:$(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),l.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",l.length]}),l.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),i.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",i.length]}),i.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),h.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · ",h.length]}),h.map(e=>{var n;return s.jsxs("div",{className:"search-result",onClick:()=>o(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(Q,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((n=e.authors)==null?void 0:n[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)})]})]})]})})};export{D as default};
|
|
|
|
|
|
assets/{SettingsView-DDUVofcg.js → SettingsView-0y6Kyvn3.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{V as r,a1 as o,W as c,j as e,U as l}from"./index-M24Hywem.js";import{S as d}from"./switch-B1cyrnry.js";import{f as h,D as m}from"./latexPlainText-ChVkH0gY.js";import"./index-t6Oi9XIP.js";const j=()=>{const{user:s}=r(),{preferences:t,setHideClosedSourceEvals:a,canPersist:i}=o();return c.useEffect(()=>(document.title=h("Settings"),()=>{document.title=m}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(d,{id:"hide-closed-source-evals",checked:t.hide_closed_source_evals,onCheckedChange:n=>{a(!!n)}})]}),!i&&!s&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(l,{returnTo:"/settings"})})]})]})]})};export{j as default};
|
assets/SubmissionsDashboard-CBSTFtkY.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
import{c as G,j as e,aj as W,ak as ee,V as x,k as v,al as se,U as ie,m as X,am as te,l as ne,an as ae,ao as re,ap as oe,aq as le,ar as ce,as as U}from"./index-D3-tYEe-.js";import{u as F}from"./useQueries-7Jjoe24_.js";import{u as K}from"./useQuery-C6S8Ozku.js";import{u as B}from"./useMutation-DDsKa144.js";import{R as de,C as ue,a as me}from"./refresh-cw-gCrkdl6j.js";import{L as A}from"./loader-circle-BKVFOFo9.js";/**
|
| 2 |
-
* @license lucide-react v0.462.0 - ISC
|
| 3 |
-
*
|
| 4 |
-
* This source code is licensed under the ISC license.
|
| 5 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
-
*/const fe=G("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
|
| 7 |
-
* @license lucide-react v0.462.0 - ISC
|
| 8 |
-
*
|
| 9 |
-
* This source code is licensed under the ISC license.
|
| 10 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
-
*/const pe=G("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),y=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},H=s=>Array.isArray(s)?s.map(i=>{const n=y(i),o=Number(n.id);return Number.isFinite(o)?{id:o,name:typeof n.name=="string"?n.name:`#${o}`,slug:typeof n.slug=="string"?n.slug:void 0}:null}).filter(i=>!!i):[],J=s=>Array.isArray(s)?s.map(Number).filter(i=>Number.isFinite(i)):[],C=s=>Array.isArray(s)?s.map(i=>{const n=y(i);return typeof n.url!="string"?null:{url:n.url,is_official:!!n.is_official}}).filter(i=>!!i):[],he=s=>Array.isArray(s)?s.map(i=>y(i)):[],je=s=>Array.isArray(s)?s.map(i=>y(i)):[],xe=s=>s.replace(/_/g," ");function be({currentPayload:s,proposedPayload:i}){const[n,o]=x.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>o(a=>!a),children:n?"Hide raw JSON":"Show raw JSON"}),n&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(P,{title:"Current payload",value:s??{}}),e.jsx(P,{title:"Proposed payload",value:i})]})]})}function P({title:s,value:i}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(i,null,2)})]})}function V({currentItems:s,proposedIds:i,queryPrefix:n,fetchEntity:o}){const a=x.useMemo(()=>Array.from(new Set([...s.map(r=>r.id),...i])).sort((r,l)=>r-l),[s,i]),c=F({queries:a.map(r=>({queryKey:[n,String(r)],queryFn:()=>o(String(r)),staleTime:5*60*1e3}))}),u=x.useMemo(()=>{const r=new Map;return s.forEach(l=>r.set(l.id,l.name)),c.forEach(l=>{const h=l.data;if(!h)return;const f=Number(h.id);Number.isFinite(f)&&r.set(f,h.name)}),r},[s,c]),p=new Set(s.map(r=>r.id)),m=new Set(i),g=a.filter(r=>p.has(r)&&!m.has(r)),b=a.filter(r=>!p.has(r)&&m.has(r)),t=(r,l)=>{const h=l==="current"&&g.includes(r),f=l==="proposed"&&b.includes(r);return e.jsx("span",{className:v("submission-diff-pill",h&&"removed",f&&"added"),children:u.get(r)??`#${r}`},r)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Currently tagged",children:s.length>0?s.map(r=>t(r.id,"current")):e.jsx(S,{children:"No current tags"})}),e.jsx(R,{title:"Will be tagged",children:i.length>0?i.map(r=>t(r,"proposed")):e.jsx(S,{children:"No proposed tags"})})]})}function T({label:s,currentItems:i,proposedItems:n}){const o=new Map(i.map(u=>[u.url,u])),a=new Map(n.map(u=>[u.url,u])),c=Array.from(new Set([...o.keys(),...a.keys()])).sort();return c.length===0?e.jsxs(S,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:c.map(u=>{var r;const p=o.get(u),m=a.get(u),g=!p&&m,b=p&&!m,t=p&&m&&p.is_official!==m.is_official;return e.jsx("div",{className:v("submission-url-row",g&&"added",b&&"removed",t&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:v("submission-url-link",b&&"removed"),children:u}),g&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),b&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),t&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(p.is_official)," ","->"," ",String(m.is_official)]}),((r=m??p)==null?void 0:r.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},u)})})}function ge({currentPayload:s,proposedPayload:i}){const n=he(y(s).evaluations),o=je(i.operations),a=x.useMemo(()=>{const t=new Set;return n.forEach(r=>{r.task_id&&t.add(Number(r.task_id))}),o.forEach(r=>{const l=r.data;l!=null&&l.task_id&&t.add(Number(l.task_id))}),Array.from(t).filter(r=>Number.isFinite(r))},[n,o]),c=x.useMemo(()=>{const t=new Set;return n.forEach(r=>{r.dataset_id&&t.add(Number(r.dataset_id))}),o.forEach(r=>{const l=r.data;l!=null&&l.dataset_id&&t.add(Number(l.dataset_id))}),Array.from(t).filter(r=>Number.isFinite(r))},[n,o]),u=F({queries:a.map(t=>({queryKey:["task",String(t)],queryFn:()=>W(String(t)),staleTime:5*60*1e3}))}),p=F({queries:c.map(t=>({queryKey:["dataset",String(t)],queryFn:()=>se(String(t)),staleTime:5*60*1e3}))}),m=x.useMemo(()=>{const t=new Map;return u.forEach(r=>{const l=r.data;if(!l)return;const h=Number(l.id);Number.isFinite(h)&&t.set(h,l.name)}),t},[u]),g=x.useMemo(()=>{const t=new Map;return p.forEach(r=>{const l=r.data;if(!l)return;const h=Number(l.id);Number.isFinite(h)&&t.set(h,l.name)}),t},[p]),b=new Map(n.filter(t=>t.id!=null).map(t=>[Number(t.id),t]));return o.length===0?e.jsx(S,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:o.map((t,r)=>{const l=t.evaluation_id?b.get(t.evaluation_id):void 0,f=(t.op==="update"?{...l,...t.data}:t.data??l)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:v("submission-pill status",t.op==="create"&&"approved",t.op==="update"&&"changed",t.op==="delete"&&"rejected"),children:t.op??"unknown"}),t.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",t.evaluation_id]})]}),t.op&&["create","update","delete"].includes(t.op)?e.jsx(Ne,{evaluation:f,taskNames:m,datasetNames:g}):e.jsx(P,{title:"Unsupported operation",value:t})]},`${t.op}-${t.evaluation_id??r}`)})})}function Ne({evaluation:s,taskNames:i,datasetNames:n}){const o=s.task_id?Number(s.task_id):void 0,a=s.dataset_id?Number(s.dataset_id):void 0,c=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(k,{label:"Task",value:o?i.get(o)??`#${o}`:null}),e.jsx(k,{label:"Dataset",value:a?n.get(a)??`#${a}`:null}),e.jsx(k,{label:"Model",value:s.model_name||null}),e.jsx(k,{label:"Harness",value:s.harness||null}),e.jsx(k,{label:"Best rank",value:s.best_rank??null}),e.jsx(k,{label:"Parameters",value:s.num_parameters??null}),e.jsx(k,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(c).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(c).map(([u,p])=>e.jsxs("span",{className:"submission-metric-pill",children:[u,": ",String(p)]},u))}):e.jsx(S,{children:"No metrics"})]})]})}function k({label:s,value:i}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:i??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ve({currentPayload:s,proposedPayload:i}){const n=y(s).source_url,o=i.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Current source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(S,{children:"No current URL"})}),e.jsx(R,{title:"Proposed source URL",children:typeof o=="string"&&o?e.jsx("a",{className:"submission-url-link",href:o,target:"_blank",rel:"noopener noreferrer",children:o}):e.jsx(S,{children:"No proposed URL"})})]})}function R({title:s,children:i}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:i})]})}function S({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ye({currentPayload:s,proposedPayload:i}){const n=y(s),o=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:o.map(({key:a,label:c})=>{const u=Array.isArray(n[a])?n[a].filter(m=>typeof m=="string"):[],p=Array.isArray(i[a])?i[a].filter(m=>typeof m=="string"):[];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:c}),e.jsx(T,{label:c.toLowerCase(),currentItems:u.map(m=>({url:m,is_official:!1})),proposedItems:p.map(m=>({url:m,is_official:!1}))})]},a)})})}function _e({editType:s,currentPayload:i,proposedPayload:n}){const o=y(i);let a;return s==="tasks"?a=e.jsx(V,{currentItems:H(o.tasks),proposedIds:J(n.task_ids),queryPrefix:"task",fetchEntity:W}):s==="methods"?a=e.jsx(V,{currentItems:H(o.methods),proposedIds:J(n.method_ids),queryPrefix:"method",fetchEntity:ee}):s==="repositories"?a=e.jsx(T,{label:"repositories",currentItems:C(o.repositories),proposedItems:C(n.repositories)}):s==="project_pages"?a=e.jsx(T,{label:"project pages",currentItems:C(o.project_pages),proposedItems:C(n.project_pages)}):s==="evaluations"?a=e.jsx(ge,{currentPayload:i,proposedPayload:n}):s==="source_url"?a=e.jsx(ve,{currentPayload:i,proposedPayload:n}):s==="hf_artifacts"?a=e.jsx(ye,{currentPayload:i,proposedPayload:n}):a=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",xe(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[a,e.jsx(be,{currentPayload:i,proposedPayload:n})]})}const I=25,ke=["pending","approved","rejected","all"],Se=["all","tasks","methods","evaluations","repositories","project_pages","source_url"],D=["pending","approved","rejected"];function we(s){return s.slice(0,2).toUpperCase()}function M(s){return s.replace(/_/g," ")}function Y(s){if(!s)return"unknown time";const i=new Date(s);if(Number.isNaN(i.getTime()))return s;const n=Date.now()-i.getTime(),o=Math.floor(n/6e4),a=Math.floor(n/36e5),c=Math.floor(n/864e5);return o<1?"just now":o<60?`${o}m ago`:a<24?`${a}h ago`:c<14?`${c}d ago`:i.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function L(s,i){var o;const n=s;if(n.response)try{const a=JSON.parse(n.response);if(typeof(a==null?void 0:a.detail)=="string")return a.detail;if(Array.isArray(a==null?void 0:a.detail)&&((o=a.detail[0])!=null&&o.msg))return a.detail[0].msg}catch{return n.response}return n.message||i}function Ae(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function Ee(s,i){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(i)}function Ce(s){return[...s].sort((i,n)=>new Date(n.created_at).getTime()-new Date(i.created_at).getTime())}async function Me(s,i,n){const o=i==="all"?void 0:i;if(s!=="all")return U({status:s,edit_type:o,limit:n,offset:0});const a=await Promise.all(D.map(c=>U({status:c,edit_type:o,limit:n,offset:0})));return{count:a.reduce((c,u)=>c+u.count,0),results:Ce(a.flatMap(c=>c.results)).slice(0,n)}}function Fe(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(pe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function Re(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(A,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function qe({submission:s,paper:i}){const[n,o]=x.useState(s.admin_note??""),a=ne(),{toast:c}=X(),u=Ee(i,s.paper_id),p=(i==null?void 0:i.title)||`Paper #${s.paper_id}`,m=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,g=s.status==="pending";x.useEffect(()=>{o(s.admin_note??"")},[s.admin_note,s.id]);const b=x.useCallback(j=>{a.invalidateQueries({queryKey:["pendingPaperEdits"]}),a.invalidateQueries({queryKey:["pendingPaperEdit",j.id]}),a.invalidateQueries({queryKey:["paper",String(j.paper_id)]}),a.invalidateQueries({queryKey:["paper-summary",String(j.paper_id)]}),i!=null&&i.arxiv_id&&a.invalidateQueries({queryKey:["paper-arxiv",i.arxiv_id]}),j.edit_type==="evaluations"&&a.invalidateQueries({queryKey:["evaluations","paper",String(j.paper_id)]})},[i==null?void 0:i.arxiv_id,a]),t=B({mutationFn:()=>le(s.id,{admin_note:n.trim()||void 0}),onSuccess:j=>{b(j),c({title:"Submission approved",description:`Applied ${M(s.edit_type)} changes for ${p}.`})},onError:j=>{c({title:"Could not approve submission",description:L(j,"Approval failed. Please try again."),variant:"destructive"})}}),r=B({mutationFn:()=>ce(s.id,{admin_note:n.trim()||void 0}),onSuccess:j=>{b(j),c({title:"Submission rejected",description:`Rejected ${M(s.edit_type)} changes for ${p}.`})},onError:j=>{c({title:"Could not reject submission",description:L(j,"Rejection failed. Please try again."),variant:"destructive"})}}),l=t.isPending,h=r.isPending,f=l||h;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[e.jsx("a",{href:`/paper/${encodeURIComponent(u)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsxs("span",{children:["Paper #",s.paper_id]}),e.jsx("span",{children:Y(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:M(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:v("submission-pill status",Ae(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(ae,{className:"h-6 w-6",children:[e.jsx(re,{src:m,alt:s.hf_username}),e.jsx(oe,{className:"text-[10px]",children:we(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(_e,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:g?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:n,onChange:j=>o(j.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:f}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>r.mutate(),disabled:f,className:"submission-action-btn reject",children:[h?e.jsx(A,{className:"spin",size:14}):e.jsx(ue,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>t.mutate(),disabled:f,className:"submission-action-btn approve",children:[l?e.jsx(A,{className:"spin",size:14}):e.jsx(me,{size:14}),"Approve"]})]})]}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${Y(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]})]})})]})}function $e(){var Q,O,z;const{user:s,isLoading:i}=ie(),{toast:n}=X(),[o,a]=x.useState("pending"),[c,u]=x.useState("all"),[p,m]=x.useState(I),g=!!(s!=null&&s.is_admin);x.useEffect(()=>{m(I)},[o,c]);const b=K({queryKey:["pendingPaperEdits","counts",c],queryFn:async()=>{const d=c==="all"?void 0:c,_=await Promise.all(D.map(N=>U({status:N,edit_type:d,limit:1,offset:0})));return Object.fromEntries(_.map((N,E)=>[D[E],N.count]))},enabled:g,staleTime:30*1e3}),t=K({queryKey:["pendingPaperEdits",{status:o,editType:c,visibleLimit:p}],queryFn:()=>Me(o,c,p),enabled:g,retry:!1}),r=x.useMemo(()=>{var d;return Array.from(new Set((((d=t.data)==null?void 0:d.results)??[]).map(_=>_.paper_id))).sort((_,N)=>_-N)},[(Q=t.data)==null?void 0:Q.results]),l=F({queries:r.map(d=>({queryKey:["paper-summary",String(d)],queryFn:()=>te(String(d),!1),enabled:g,staleTime:5*60*1e3}))}),h=x.useMemo(()=>{const d=new Map;return l.forEach(_=>{const N=_.data;if(!N)return;const E=Number(N.id);Number.isFinite(E)&&d.set(E,N)}),d},[l]);if(x.useEffect(()=>{t.error&&n({title:"Could not load submissions",description:L(t.error,"Failed to load pending paper edits."),variant:"destructive"})},[t.error,n]),i)return e.jsx(Re,{});if(!g)return e.jsx(Fe,{});const f=b.data,j=f?f.pending+f.approved+f.rejected:void 0,$={pending:f==null?void 0:f.pending,approved:f==null?void 0:f.approved,rejected:f==null?void 0:f.rejected,all:j},w=((O=t.data)==null?void 0:O.results)??[],q=((z=t.data)==null?void 0:z.count)??0,Z=w.length<q;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{b.refetch(),t.refetch()},disabled:t.isFetching||b.isFetching,children:[e.jsx(de,{className:v((t.isFetching||b.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:ke.map(d=>e.jsxs("button",{type:"button",className:v("period-btn",o===d&&"active"),onClick:()=>a(d),children:[d,$[d]!=null&&e.jsx("span",{className:"submission-count",children:$[d]})]},d))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:Se.map(d=>e.jsx("button",{type:"button",className:v("sort-btn",c===d&&"active"),onClick:()=>u(d),children:M(d)},d))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:t.isFetching?"refreshing":`${q} submissions`})})})}),t.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(A,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):w.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(fe,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:w.map(d=>e.jsx(qe,{submission:d,paper:h.get(d.paper_id)},d.id))}),w.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",w.length," of ",q," submissions"]}),Z&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(d=>d+I),disabled:t.isFetching,children:[t.isFetching&&e.jsx(A,{className:"spin",size:14}),"Load more"]})]})]})]})}export{$e as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/SubmissionsDashboard-XyPUwAgi.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var he=s=>{throw TypeError(s)};var W=(s,t,i)=>t.has(s)||he("Cannot "+i);var f=(s,t,i)=>(W(s,t,"read from private field"),i?i.call(s):t.get(s)),w=(s,t,i)=>t.has(s)?he("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),N=(s,t,i,n)=>(W(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),E=(s,t,i)=>(W(s,t,"access private method"),i);import{aj as Me,ak as Z,al as Oe,am as Qe,o as ke,r as P,an as qe,c as Se,j as e,ao as we,ap as Fe,W as y,k as M,aq as Ie,V as Le,n as Ee,ar as Ue,as as De,at as Pe,au as Te,av as $e,aw as Be,ax as ee}from"./index-M24Hywem.js";import{Q as Ce,b as ze,c as He,e as Ke,d as Je,f as Ve,s as fe,g as Ye,h as Ge,u as pe}from"./useQuery-C6YLWBWB.js";import{u as be}from"./useMutation-CudKDByg.js";import{R as We,C as Xe,a as Ze}from"./refresh-cw-CcmPDWxW.js";import{L as T}from"./loader-circle-2lEq4cac.js";function ge(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function es(s,t,i){const n=s.slice(0);return n[t]=i,n}var L,_,U,I,k,A,$,B,z,H,v,se,te,Re,ie,ne,re,_e,ss=(_e=class extends Me{constructor(t,i,n){super();w(this,v);w(this,L);w(this,_);w(this,U);w(this,I);w(this,k);w(this,A);w(this,$);w(this,B);w(this,z);w(this,H,[]);N(this,L,t),N(this,I,n),N(this,U,[]),N(this,k,[]),N(this,_,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,k).forEach(t=>{t.subscribe(i=>{E(this,v,ne).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,k).forEach(t=>{t.destroy()})}setQueries(t,i){N(this,U,t),N(this,I,i),Z.batch(()=>{const n=f(this,k),r=E(this,v,ie).call(this,f(this,U));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const o=r.map(a=>a.observer),l=o.map(a=>a.getCurrentResult()),u=n.length!==o.length,h=o.some((a,c)=>a!==n[c]),j=u||h,x=j?!0:l.some((a,c)=>{const d=f(this,_)[c];return!d||!Oe(a,d)});!j&&!x||(j&&(N(this,H,r),N(this,k,o)),N(this,_,l),this.hasListeners()&&(j&&(ge(n,o).forEach(a=>{a.destroy()}),ge(o,n).forEach(a=>{a.subscribe(c=>{E(this,v,ne).call(this,a,c)})})),E(this,v,re).call(this)))})}getCurrentResult(){return f(this,_)}getQueries(){return f(this,k).map(t=>t.getCurrentQuery())}getObservers(){return f(this,k)}getOptimisticResult(t,i){const n=E(this,v,ie).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),o=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>E(this,v,te).call(this,l??r,i,o),()=>E(this,v,se).call(this,r,n)]}},L=new WeakMap,_=new WeakMap,U=new WeakMap,I=new WeakMap,k=new WeakMap,A=new WeakMap,$=new WeakMap,B=new WeakMap,z=new WeakMap,H=new WeakMap,v=new WeakSet,se=function(t,i){return i.map((n,r)=>{const o=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?o:n.observer.trackResult(o,l=>{i.forEach(u=>{u.observer.trackProp(l)})})})},te=function(t,i,n){if(i){const r=f(this,z),o=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,u)=>l!==r[u]));return(!f(this,A)||f(this,_)!==f(this,B)||o||i!==f(this,$))&&(N(this,$,i),N(this,B,f(this,_)),n!==void 0&&N(this,z,n),N(this,A,Qe(f(this,A),i(t)))),f(this,A)}return t},Re=function(){var t;return((t=f(this,I))==null?void 0:t.combine)!==void 0&&f(this,k).some((i,n)=>{var r;return i.options.suspense&&((r=f(this,_)[n])==null?void 0:r.data)===void 0})},ie=function(t){const i=new Map;f(this,k).forEach(r=>{const o=r.options.queryHash;if(!o)return;const l=i.get(o);l?l.push(r):i.set(o,[r])});const n=[];return t.forEach(r=>{var h;const o=f(this,L).defaultQueryOptions(r),u=((h=i.get(o.queryHash))==null?void 0:h.shift())??new Ce(f(this,L),o);n.push({defaultedQueryOptions:o,observer:u})}),n},ne=function(t,i){const n=f(this,k).indexOf(t);n!==-1&&(N(this,_,es(f(this,_),n,i)),E(this,v,re).call(this))},re=function(){var t;if(this.hasListeners()){const i=E(this,v,se).call(this,f(this,_),f(this,H)),n=E(this,v,Re).call(this),r=f(this,A),o=n?r:E(this,v,te).call(this,i,(t=f(this,I))==null?void 0:t.combine);(n||r!==o)&&Z.batch(()=>{this.listeners.forEach(l=>{l(f(this,_))})})}},_e);function Y({queries:s,...t},i){const n=ke(),r=ze(),o=He(),l=P.useMemo(()=>s.map(m=>{const p=n.defaultQueryOptions(m);return p._optimisticResults=r?"isRestoring":"optimistic",p}),[s,n,r]);l.forEach(m=>{Ke(m);const p=n.getQueryCache().get(m.queryHash);Je(m,o,p)}),Ve(o);const[u]=P.useState(()=>new ss(n,l,t)),[h,j,x]=u.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;P.useSyncExternalStore(P.useCallback(m=>a?u.subscribe(Z.batchCalls(m)):qe,[u,a]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),P.useEffect(()=>{u.setQueries(l,t)},[l,t,u]);const d=h.some((m,p)=>fe(l[p],m))?h.flatMap((m,p)=>{const S=l[p];if(S&&fe(S,m)){const Q=new Ce(n,S);return Ye(S,Q,o)}return[]}):[];if(d.length>0)throw Promise.all(d);const g=h.find((m,p)=>{const S=l[p];return S&&Ge({result:m,errorResetBoundary:o,throwOnError:S.throwOnError,query:n.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(g!=null&&g.error)throw g.error;return j(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 ts=Se("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
|
| 7 |
+
* @license lucide-react v0.462.0 - ISC
|
| 8 |
+
*
|
| 9 |
+
* This source code is licensed under the ISC license.
|
| 10 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
+
*/const is=Se("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),O=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},je=s=>Array.isArray(s)?s.map(t=>{const i=O(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):[],xe=s=>Array.isArray(s)?s.map(Number).filter(t=>Number.isFinite(t)):[],J=s=>Array.isArray(s)?s.map(t=>{const i=O(t);return typeof i.url!="string"?null:{url:i.url,is_official:!!i.is_official}}).filter(t=>!!t):[],ns=s=>Array.isArray(s)?s.map(t=>O(t)):[],rs=s=>Array.isArray(s)?s.map(t=>O(t)):[],as=s=>s.replace(/_/g," ");function os({currentPayload:s,proposedPayload:t}){const[i,n]=y.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(ae,{title:"Current payload",value:s??{}}),e.jsx(ae,{title:"Proposed payload",value:t})]})]})}function ae({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 ve({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n}){const r=y.useMemo(()=>Array.from(new Set([...s.map(c=>c.id),...t])).sort((c,d)=>c-d),[s,t]),o=Y({queries:r.map(c=>({queryKey:[i,String(c)],queryFn:()=>n(String(c)),staleTime:5*60*1e3}))}),l=y.useMemo(()=>{const c=new Map;return s.forEach(d=>c.set(d.id,d.name)),o.forEach(d=>{const g=d.data;if(!g)return;const m=Number(g.id);Number.isFinite(m)&&c.set(m,g.name)}),c},[s,o]),u=new Set(s.map(c=>c.id)),h=new Set(t),j=r.filter(c=>u.has(c)&&!h.has(c)),x=r.filter(c=>!u.has(c)&&h.has(c)),a=(c,d)=>{const g=d==="current"&&j.includes(c),m=d==="proposed"&&x.includes(c);return e.jsx("span",{className:M("submission-diff-pill",g&&"removed",m&&"added"),children:l.get(c)??`#${c}`},c)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(D,{title:"Currently tagged",children:s.length>0?s.map(c=>a(c.id,"current")):e.jsx(R,{children:"No current tags"})}),e.jsx(D,{title:"Will be tagged",children:t.length>0?t.map(c=>a(c,"proposed")):e.jsx(R,{children:"No proposed tags"})})]})}function oe({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])),o=Array.from(new Set([...n.keys(),...r.keys()])).sort();return o.length===0?e.jsxs(R,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:o.map(l=>{var c;const u=n.get(l),h=r.get(l),j=!u&&h,x=u&&!h,a=u&&h&&u.is_official!==h.is_official;return e.jsx("div",{className:M("submission-url-row",j&&"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:M("submission-url-link",x&&"removed"),children:l}),j&&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(u.is_official)," ","->"," ",String(h.is_official)]}),((c=h??u)==null?void 0:c.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},l)})})}function cs({currentPayload:s,proposedPayload:t}){const i=ns(O(s).evaluations),n=rs(t.operations),r=y.useMemo(()=>{const a=new Set;return i.forEach(c=>{c.task_id&&a.add(Number(c.task_id))}),n.forEach(c=>{const d=c.data;d!=null&&d.task_id&&a.add(Number(d.task_id))}),Array.from(a).filter(c=>Number.isFinite(c))},[i,n]),o=y.useMemo(()=>{const a=new Set;return i.forEach(c=>{c.dataset_id&&a.add(Number(c.dataset_id))}),n.forEach(c=>{const d=c.data;d!=null&&d.dataset_id&&a.add(Number(d.dataset_id))}),Array.from(a).filter(c=>Number.isFinite(c))},[i,n]),l=Y({queries:r.map(a=>({queryKey:["task",String(a)],queryFn:()=>we(String(a)),staleTime:5*60*1e3}))}),u=Y({queries:o.map(a=>({queryKey:["dataset",String(a)],queryFn:()=>Ie(String(a)),staleTime:5*60*1e3}))}),h=y.useMemo(()=>{const a=new Map;return l.forEach(c=>{const d=c.data;if(!d)return;const g=Number(d.id);Number.isFinite(g)&&a.set(g,d.name)}),a},[l]),j=y.useMemo(()=>{const a=new Map;return u.forEach(c=>{const d=c.data;if(!d)return;const g=Number(d.id);Number.isFinite(g)&&a.set(g,d.name)}),a},[u]),x=new Map(i.filter(a=>a.id!=null).map(a=>[Number(a.id),a]));return n.length===0?e.jsx(R,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((a,c)=>{const d=a.evaluation_id?x.get(a.evaluation_id):void 0,m=(a.op==="update"?{...d,...a.data}:a.data??d)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:M("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(ls,{evaluation:m,taskNames:h,datasetNames:j}):e.jsx(ae,{title:"Unsupported operation",value:a})]},`${a.op}-${a.evaluation_id??c}`)})})}function ls({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,o=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:"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(o).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(o).map(([l,u])=>e.jsxs("span",{className:"submission-metric-pill",children:[l,": ",String(u)]},l))}):e.jsx(R,{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 ds({currentPayload:s,proposedPayload:t}){const i=O(s).source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(D,{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(R,{children:"No current URL"})}),e.jsx(D,{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(R,{children:"No proposed URL"})})]})}function ye({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(D,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(R,{children:"No name provided"})}),e.jsx(D,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(R,{children:"No description provided"})})]})}function D({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 R({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function us({currentPayload:s,proposedPayload:t}){const i=O(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:o})=>{const l=Array.isArray(i[r])?i[r].filter(h=>typeof h=="string"):[],u=Array.isArray(t[r])?t[r].filter(h=>typeof h=="string"):[];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:o}),e.jsx(oe,{label:o.toLowerCase(),currentItems:l.map(h=>({url:h,is_official:!1})),proposedItems:u.map(h=>({url:h,is_official:!1}))})]},r)})})}function ms({editType:s,currentPayload:t,proposedPayload:i}){const n=O(t);let r;return s==="tasks"?r=e.jsx(ve,{currentItems:je(n.tasks),proposedIds:xe(i.task_ids),queryPrefix:"task",fetchEntity:we}):s==="methods"?r=e.jsx(ve,{currentItems:je(n.methods),proposedIds:xe(i.method_ids),queryPrefix:"method",fetchEntity:Fe}):s==="repositories"?r=e.jsx(oe,{label:"repositories",currentItems:J(n.repositories),proposedItems:J(i.repositories)}):s==="project_pages"?r=e.jsx(oe,{label:"project pages",currentItems:J(n.project_pages),proposedItems:J(i.project_pages)}):s==="evaluations"?r=e.jsx(cs,{currentPayload:t,proposedPayload:i}):s==="source_url"?r=e.jsx(ds,{currentPayload:t,proposedPayload:i}):s==="hf_artifacts"?r=e.jsx(us,{currentPayload:t,proposedPayload:i}):s==="new_task"?r=e.jsx(ye,{kind:"task",proposedPayload:i}):s==="new_method"?r=e.jsx(ye,{kind:"method",proposedPayload:i}):r=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",as(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[r,e.jsx(os,{currentPayload:t,proposedPayload:i})]})}const X=25,hs=["pending","approved","rejected","all"],fs=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method"],ce=["pending","approved","rejected"];function ps(s){return s.slice(0,2).toUpperCase()}function V(s){return s.replace(/_/g," ")}function Ne(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),o=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:r<24?`${r}h ago`:o<14?`${o}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function le(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 gs(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function js(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function xs(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return ee({status:s,edit_type:n,limit:i,offset:0});const r=await Promise.all(ce.map(o=>ee({status:o,edit_type:n,limit:i,offset:0})));return{count:r.reduce((o,l)=>o+l.count,0),results:js(r.flatMap(o=>o.results)).slice(0,i)}}function vs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(is,{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(T,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function Ns({submission:s,paper:t}){const[i,n]=y.useState(s.admin_note??""),r=ke(),{toast:o}=Ee(),l=gs(t,s.paper_id),u=(t==null?void 0:t.title)||`Paper #${s.paper_id}`,h=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,j=s.status==="pending";y.useEffect(()=>{n(s.admin_note??"")},[s.admin_note,s.id]);const x=y.useCallback(p=>{r.invalidateQueries({queryKey:["pendingPaperEdits"]}),r.invalidateQueries({queryKey:["pendingPaperEdit",p.id]}),r.invalidateQueries({queryKey:["paper",String(p.paper_id)]}),r.invalidateQueries({queryKey:["paper-summary",String(p.paper_id)]}),t!=null&&t.arxiv_id&&r.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),p.edit_type==="evaluations"&&r.invalidateQueries({queryKey:["evaluations","paper",String(p.paper_id)]})},[t==null?void 0:t.arxiv_id,r]),a=be({mutationFn:()=>$e(s.id,{admin_note:i.trim()||void 0}),onSuccess:p=>{x(p),o({title:"Submission approved",description:`Applied ${V(s.edit_type)} changes for ${u}.`})},onError:p=>{o({title:"Could not approve submission",description:le(p,"Approval failed. Please try again."),variant:"destructive"})}}),c=be({mutationFn:()=>Be(s.id,{admin_note:i.trim()||void 0}),onSuccess:p=>{x(p),o({title:"Submission rejected",description:`Rejected ${V(s.edit_type)} changes for ${u}.`})},onError:p=>{o({title:"Could not reject submission",description:le(p,"Rejection failed. Please try again."),variant:"destructive"})}}),d=a.isPending,g=c.isPending,m=d||g;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[e.jsx("a",{href:`/paper/${encodeURIComponent(l)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:u}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsxs("span",{children:["Paper #",s.paper_id]}),e.jsx("span",{children:Ne(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:M("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(De,{className:"h-6 w-6",children:[e.jsx(Pe,{src:h,alt:s.hf_username}),e.jsx(Te,{className:"text-[10px]",children:ps(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(ms,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:j?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:i,onChange:p=>n(p.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:m}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>c.mutate(),disabled:m,className:"submission-action-btn reject",children:[g?e.jsx(T,{className:"spin",size:14}):e.jsx(Xe,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>a.mutate(),disabled:m,className:"submission-action-btn approve",children:[d?e.jsx(T,{className:"spin",size:14}):e.jsx(Ze,{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?` ${Ne(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]})]})})]})}function Rs(){var de,ue,me;const{user:s,isLoading:t}=Le(),{toast:i}=Ee(),[n,r]=y.useState("pending"),[o,l]=y.useState("all"),[u,h]=y.useState(X),j=!!(s!=null&&s.is_admin);y.useEffect(()=>{h(X)},[n,o]);const x=pe({queryKey:["pendingPaperEdits","counts",o],queryFn:async()=>{const b=o==="all"?void 0:o,q=await Promise.all(ce.map(C=>ee({status:C,edit_type:b,limit:1,offset:0})));return Object.fromEntries(q.map((C,K)=>[ce[K],C.count]))},enabled:j,staleTime:30*1e3}),a=pe({queryKey:["pendingPaperEdits",{status:n,editType:o,visibleLimit:u}],queryFn:()=>xs(n,o,u),enabled:j,retry:!1}),c=y.useMemo(()=>{var b;return Array.from(new Set((((b=a.data)==null?void 0:b.results)??[]).map(q=>q.paper_id))).sort((q,C)=>q-C)},[(de=a.data)==null?void 0:de.results]),d=Y({queries:c.map(b=>({queryKey:["paper-summary",String(b)],queryFn:()=>Ue(String(b),!1),enabled:j,staleTime:5*60*1e3}))}),g=y.useMemo(()=>{const b=new Map;return d.forEach(q=>{const C=q.data;if(!C)return;const K=Number(C.id);Number.isFinite(K)&&b.set(K,C)}),b},[d]);if(y.useEffect(()=>{a.error&&i({title:"Could not load submissions",description:le(a.error,"Failed to load pending paper edits."),variant:"destructive"})},[a.error,i]),t)return e.jsx(ys,{});if(!j)return e.jsx(vs,{});const m=x.data,p=m?m.pending+m.approved+m.rejected:void 0,S={pending:m==null?void 0:m.pending,approved:m==null?void 0:m.approved,rejected:m==null?void 0:m.rejected,all:p},Q=((ue=a.data)==null?void 0:ue.results)??[],G=((me=a.data)==null?void 0:me.count)??0,Ae=Q.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(We,{className:M((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:hs.map(b=>e.jsxs("button",{type:"button",className:M("period-btn",n===b&&"active"),onClick:()=>r(b),children:[b,S[b]!=null&&e.jsx("span",{className:"submission-count",children:S[b]})]},b))})]}),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:fs.map(b=>e.jsx("button",{type:"button",className:M("sort-btn",o===b&&"active"),onClick:()=>l(b),children:V(b)},b))})]})]}),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(T,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):Q.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ts,{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:Q.map(b=>e.jsx(Ns,{submission:b,paper:g.get(b.paper_id)},b.id))}),Q.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",Q.length," of ",G," submissions"]}),Ae&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>h(b=>b+X),disabled:a.isFetching,children:[a.isFetching&&e.jsx(T,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Rs as default};
|
assets/SubmitView-CVFI-m88.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{a0 as R,o as T,n as D,W as n,j as e,af as k}from"./index-M24Hywem.js";import{u as _}from"./useMutation-CudKDByg.js";import{A as C,a as w}from"./alert-0Kui0gCY.js";import{I as m,B as v}from"./input-CpJZsE-m.js";import{T as z}from"./textarea-DnPbxyAL.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 j(r){const t=r.trim();return t?E.test(t)||F.test(t)||X.test(t)?"arxiv":/^https?:\/\//i.test(t)?"external":"arxiv":"empty"}function L(r,t){const i=r.trim();if(j(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=t.title.trim();l&&(s.title=l);const u=t.abstract.trim();u&&(s.abstract=u);const o=t.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return o.length>0&&(s.authors=o),t.datePublished&&(s.date_published=t.datePublished),s}function q(r){const t=r;if(!t)return"Submission failed";if(t.response)try{const i=JSON.parse(t.response);if(typeof i.detail=="string")return i.detail}catch{return t.response}return t.message||"Submission failed"}const V=()=>{const r=R(),t=T(),{toast:i}=D(),[d,s]=n.useState(""),[l,u]=n.useState(""),[o,h]=n.useState(""),[g,S]=n.useState(""),[f,I]=n.useState(""),[y,x]=n.useState(null),p=j(d),b=p==="external",c=_({mutationFn:a=>k(a),onSuccess:a=>{t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"}),i({title:a.created?"Paper submitted":"Paper already indexed",description:a.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${a.route_identifier}`)},onError:a=>{x(q(a))}}),A=a=>{if(a.preventDefault(),x(null),p==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const P=L(d,{title:l,abstract:o,authors:g,datePublished:f});c.mutate(P)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:A,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(m,{id:"submit-input",value:d,onChange:a=>s(a.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:p==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":p==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),b&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(m,{id:"submit-title",value:l,onChange:a=>u(a.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(z,{id:"submit-abstract",value:o,onChange:a=>h(a.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(m,{id:"submit-authors",value:g,onChange:a=>S(a.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(m,{id:"submit-date",type:"date",value:f,onChange:a=>I(a.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),y&&e.jsx(C,{variant:"destructive",children:e.jsx(w,{children:y})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(v,{type:"submit",disabled:c.isPending,children:c.isPending?b?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(v,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{V as default};
|
assets/SubmitView-DBn6RIiN.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as P,j as e,k as T,$ as w,l as D,m as _,V as n,ae as C}from"./index-D3-tYEe-.js";import{u as E}from"./useMutation-DDsKa144.js";import{A as z,a as F}from"./alert-Ayuop_ag.js";import{I as m,B as v}from"./input-C7eEyU6x.js";const j=P.forwardRef(({className:r,...t},i)=>e.jsx("textarea",{className:T("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:i,...t}));j.displayName="Textarea";const X=/^\d{4}\.\d{4,5}(v\d+)?$/i,L=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,q=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const t=r.trim();return t?X.test(t)||L.test(t)||q.test(t)?"arxiv":/^https?:\/\//i.test(t)?"external":"arxiv":"empty"}function N(r,t){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=t.title.trim();l&&(s.title=l);const u=t.abstract.trim();u&&(s.abstract=u);const o=t.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return o.length>0&&(s.authors=o),t.datePublished&&(s.date_published=t.datePublished),s}function U(r){const t=r;if(!t)return"Submission failed";if(t.response)try{const i=JSON.parse(t.response);if(typeof i.detail=="string")return i.detail}catch{return t.response}return t.message||"Submission failed"}const $=()=>{const r=w(),t=D(),{toast:i}=_(),[d,s]=n.useState(""),[l,u]=n.useState(""),[o,h]=n.useState(""),[g,I]=n.useState(""),[f,k]=n.useState(""),[b,x]=n.useState(null),p=S(d),y=p==="external",c=E({mutationFn:a=>C(a),onSuccess:a=>{t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"}),i({title:a.created?"Paper submitted":"Paper already indexed",description:a.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${a.route_identifier}`)},onError:a=>{x(U(a))}}),A=a=>{if(a.preventDefault(),x(null),p==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const R=N(d,{title:l,abstract:o,authors:g,datePublished:f});c.mutate(R)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:A,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(m,{id:"submit-input",value:d,onChange:a=>s(a.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:p==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":p==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),y&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(m,{id:"submit-title",value:l,onChange:a=>u(a.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(j,{id:"submit-abstract",value:o,onChange:a=>h(a.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(m,{id:"submit-authors",value:g,onChange:a=>I(a.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(m,{id:"submit-date",type:"date",value:f,onChange:a=>k(a.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(z,{variant:"destructive",children:e.jsx(F,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(v,{type:"submit",disabled:c.isPending,children:c.isPending?y?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(v,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{$ as default};
|
|
|
|
|
|
assets/TagBrowseView-Da16Rn5_.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{Z as os,$ as ms,u as hs,r as h,a as u,j as s,L as g,V as us}from"./index-D3-tYEe-.js";import{u as ps}from"./useQueries-7Jjoe24_.js";import{u as x}from"./useQuery-C6S8Ozku.js";import{P as gs,M as xs}from"./components-D244J_Aj.js";import{M as J}from"./MarkdownText-trAzkiVz.js";import{a as js,d as y}from"./transform-nNAikYlJ.js";import{c as Ns}from"./usePapers-C3rZB7Pt.js";import{u as ks}from"./useIntersectionObserver-SHZ4yqtO.js";import{S as _}from"./skeleton-D0cyB03X.js";import{A as bs,a as vs}from"./alert-Ayuop_ag.js";import"./LatexTitle-ZrlO0rs7.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DEoip3HO.js";const fs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ys=c=>c==="trending"||c==="date_published"||c==="citation_count"?c:"trending",C=3,w=2,_s=c=>[...c].sort((j,N)=>{const k=j.slug==="classic-language-modeling",b=N.slug==="classic-language-modeling";return k!==b?k?1:-1:0}),Ds=()=>{var R,D,A,I,K,O,Q,z,U,V,H,W,Z;const{taskSlug:c}=os(),j=ms(),[N,k]=hs(),b=ys(N.get("order_by")),X=e=>{const a=new URLSearchParams(N);a.set("order_by",e),k(a)},[F,Y]=h.useState(!1),[ss,es]=h.useState(()=>new Set),B=(e,a)=>{const t=e||"";return a?`/benchmark/${t}?task=${encodeURIComponent(a)}`:`/benchmark/${t}`},n=x({queryKey:["task",c],queryFn:()=>u.getTask(c),enabled:!!c,staleTime:10*60*1e3}),as=x({queryKey:["task-parents",(R=n.data)==null?void 0:R.id],queryFn:()=>u.getTaskParents(n.data.id),enabled:!!((D=n.data)!=null&&D.id),staleTime:10*60*1e3}),ts=x({queryKey:["task-sisters",(A=n.data)==null?void 0:A.area_id,(I=n.data)==null?void 0:I.id],queryFn:()=>u.getTasks({area_id:Number(n.data.area_id),page_size:50,visible_only:!0}),enabled:!!((K=n.data)!=null&&K.area_id),staleTime:10*60*1e3}),M=x({queryKey:["task-children",(O=n.data)==null?void 0:O.id],queryFn:()=>u.getTaskChildren(n.data.id,{page_size:50,visible_only:!0}),enabled:!!((Q=n.data)!=null&&Q.id),staleTime:10*60*1e3}),v=h.useMemo(()=>{var e;return _s(((e=M.data)==null?void 0:e.results)||[])},[M.data]),ns=x({queryKey:["task-datasets",(z=n.data)==null?void 0:z.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(n.data.id),page_size:100,ordering:"-paper_count",min_eval_count:w}),enabled:!!((U=n.data)!=null&&U.id),staleTime:10*60*1e3}),S=ps({queries:v.map(e=>({queryKey:["task-datasets",e.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(e.id),page_size:20,ordering:"-paper_count",min_eval_count:w}),staleTime:10*60*1e3}))}),l=Ns({taskId:((V=n.data)==null?void 0:V.id)||"",page_size:12,order_by:b,order_dir:"desc",include_resources:!0,enabled:!!((H=n.data)!=null&&H.id)}),E=h.useMemo(()=>{var a;return(((a=l.data)==null?void 0:a.pages.flatMap(t=>t.results))||[]).map(js)},[l.data]),T=h.useMemo(()=>{var a;const e={};return(a=l.data)==null||a.pages.forEach(t=>t.results.forEach(r=>(r.methods||[]).forEach(d=>{const p=d.slug||d.id;e[p]||(e[p]={id:d.id,name:d.name,slug:d.slug||"",count:0}),e[p].count++}))),Object.values(e).sort((t,r)=>r.count-t.count).slice(0,8)},[l.data]),{targetRef:rs,isIntersecting:$}=ks({rootMargin:"200px"});if(h.useEffect(()=>{$&&l.hasNextPage&&!l.isFetchingNextPage&&l.fetchNextPage()},[$,l.hasNextPage,l.isFetchingNextPage]),n.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(_,{className:"h-12 w-1/2 mb-4"}),s.jsx(_,{className:"h-6 w-1/3 mb-8"}),s.jsx(_,{className:"h-64 w-full"})]});if(n.error||!n.data)return s.jsx("div",{className:"page",children:s.jsx(bs,{variant:"destructive",children:s.jsx(vs,{children:"Task not found."})})});const i=n.data,f=y(i.name,i.slug),q=(((W=ts.data)==null?void 0:W.results)||[]).filter(e=>e.id!==i.id),o=((Z=ns.data)==null?void 0:Z.results)||[],is=v.some((e,a)=>{var r,d;return(((d=(r=S[a])==null?void 0:r.data)==null?void 0:d.results)||[]).length>0}),L=o.length>0,cs=(()=>{const e=new Set;return o.forEach(a=>e.add(a.id)),S.forEach(a=>{var t;return(((t=a.data)==null?void 0:t.results)||[]).forEach(r=>e.add(r.id))}),e.size})(),ls=e=>{es(a=>{const t=new Set(a);return t.has(e)?t.delete(e):t.add(e),t})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(g,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(g,{to:"/tasks",children:"Tasks"}),[...as.data||[]].reverse().map(e=>s.jsxs(us.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(g,{to:`/tasks/${e.slug||e.id}`,children:y(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:i.name.toUpperCase()})]}),s.jsxs("div",{className:i.image_url?"task-hero-grid":void 0,children:[s.jsxs("div",{children:[s.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),s.jsx("h1",{className:"domain-mega-title",children:f}),i.description&&s.jsx(J,{className:"task-explainer",text:i.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(i.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:cs}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[T.length,"+"]}),"METHODS USED"]})]})]}),i.image_url&&s.jsxs("figure",{className:`task-figure-card${i.slug==="omni-models"?" task-figure-card--compact":""}`,children:[s.jsx("div",{className:"task-figure-img-wrap",children:s.jsx("img",{className:"task-figure-img",src:i.image_url,alt:`${f} schematic`,onError:e=>{var a,t;(t=(a=e.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),s.jsxs("figcaption",{children:["Figure · ",f,i.image_credit&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),s.jsx(J,{className:"task-image-credit",text:i.image_credit})]})]})]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[L&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",children:[s.jsx("div",{className:"task-section-eyebrow",children:"Leaderboards · click any"}),s.jsxs("div",{className:"task-section-title",children:["Benchmarks ",s.jsxs("span",{className:"meta",children:["[",o.length,"]"]})]})]}),(F?o:o.slice(0,5)).map((e,a)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(B(e.slug||e.id,c)),children:[s.jsx("div",{className:"bench-row-num",children:String(a+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:e.name}),s.jsx("div",{className:"bench-row-sub",children:e.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:e.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},e.id)),o.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Y(e=>!e),children:F?"− show top 5":`+ show ${o.length-5} more benchmarks`})]}),is&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:L?{marginTop:36}:void 0,children:[s.jsx("div",{className:"task-section-eyebrow",children:"Benchmarks by capability"}),s.jsxs("div",{className:"task-section-title",children:["Subtasks ",s.jsxs("span",{className:"meta",children:["[",v.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:v.map((e,a)=>{var G;const t=S[a],r=((G=t==null?void 0:t.data)==null?void 0:G.results)||[];if(r.length===0)return null;const d=ss.has(e.id),p=d?r:r.slice(0,C),P=r.length-C;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(g,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:y(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",r.length," benchmark",r.length===1?"":"s","]"]})]}),p.map((m,ds)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(B(m.slug||m.id,e.slug||e.id)),children:[s.jsx("div",{className:"bench-row-num",children:String(ds+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:m.name}),s.jsx("div",{className:"bench-row-sub",children:m.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:m.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},m.id)),P>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ls(e.id),children:d?`− show top ${C}`:`+ show ${P} more benchmark${P===1?"":"s"}`})]},e.id)})})]}),s.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[s.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),s.jsxs("div",{className:"task-section-title",children:["Papers ",s.jsxs("span",{className:"meta",children:["[",(i.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:fs.map(([e,a])=>s.jsx("button",{className:`sort-btn ${b===e?"active":""}`,onClick:()=>X(e),children:a},e))}),s.jsxs("div",{className:"results-count",children:[E.length," loaded in ",s.jsx("span",{children:f})]})]}),l.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,a)=>s.jsx(_,{className:"h-40 w-full"},a))}):E.length===0?s.jsx("div",{className:"no-results",children:"No papers in this task yet."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"paper-list",children:E.map((e,a)=>s.jsx(gs,{paper:e,rank:a+1},e.id))}),s.jsx("div",{ref:rs,style:{height:1}}),l.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),s.jsxs("aside",{className:"task-side",children:[q.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"01/"}),s.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),q.slice(0,8).map(e=>s.jsxs(g,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:y(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),T.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"02/"}),s.jsx("div",{className:"side-block-label",children:"Common Methods"}),T.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(xs,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["·",e.count]})]},e.id))]})]})]})]})};export{Ds as default};
|
|
|
|
|
|
assets/TagBrowseView-m_DfgrJy.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{c as A,_ as W,a0 as Z,u as G,r as m,j as s,L as p,W as J,a as X}from"./index-M24Hywem.js";import{u as Y}from"./useQuery-C6YLWBWB.js";import{P as ss,M as es}from"./components-J9e6gtqw.js";import{M as L}from"./MarkdownText-BjEj6m-s.js";import{t as as,d as k}from"./transform-DVq_2bw1.js";import{b as ns}from"./usePapers-DAX-IssB.js";import{u as ts}from"./useIntersectionObserver-Bk74NMqD.js";import{S as N}from"./skeleton-DCGdUtqq.js";import{A as cs,a as rs}from"./alert-0Kui0gCY.js";import"./LatexTitle-C8-B6cG1.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-D8U4M_OT.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 R=A("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
|
| 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 is=A("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]),ls=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ds=r=>r==="trending"||r==="date_published"||r==="citation_count"?r:"trending",S=3,os=r=>[...r].sort((u,x)=>{const g=u.slug==="classic-language-modeling",j=x.slug==="classic-language-modeling";return g!==j?g?1:-1:0}),ws=()=>{var C,B,F,$;const{taskSlug:r}=W(),u=Z(),[x,g]=G(),j=ds(x.get("order_by")),I=e=>{const a=new URLSearchParams(x);a.set("order_by",e),g(a)},[_,z]=m.useState(!1),[H,O]=m.useState(()=>new Set),E=(e,a)=>{const n=e||"";return a?`/benchmark/${n}?task=${encodeURIComponent(a)}`:`/benchmark/${n}`},c=Y({queryKey:["task-page",r],queryFn:()=>X.getTaskPage(r),enabled:!!r,staleTime:10*60*1e3}),v=m.useMemo(()=>{var e;return os(((e=c.data)==null?void 0:e.children)||[])},[c.data]),f=m.useMemo(()=>{var a;const e=new Map;return(((a=c.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(n=>{e.set(n.subtask_id,n.benchmarks||[])}),e},[c.data]),i=ns({taskId:((B=(C=c.data)==null?void 0:C.task)==null?void 0:B.id)||"",page_size:12,order_by:j,order_dir:"desc",include_resources:!0,enabled:!!(($=(F=c.data)==null?void 0:F.task)!=null&&$.id)}),w=m.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages.flatMap(n=>n.results))||[]).map(as)},[i.data]),y=m.useMemo(()=>{var a;const e={};return(a=i.data)==null||a.pages.forEach(n=>n.results.forEach(h=>(h.methods||[]).forEach(d=>{const l=d.slug||d.id;e[l]||(e[l]={id:d.id,name:d.name,slug:d.slug||"",count:0}),e[l].count++}))),Object.values(e).sort((n,h)=>h.count-n.count).slice(0,8)},[i.data]),{targetRef:V,isIntersecting:P}=ts({rootMargin:"200px"});if(m.useEffect(()=>{P&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[P,i.hasNextPage,i.isFetchingNextPage]),c.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(N,{className:"h-12 w-1/2 mb-4"}),s.jsx(N,{className:"h-6 w-1/3 mb-8"}),s.jsx(N,{className:"h-64 w-full"})]});if(c.error||!c.data)return s.jsx("div",{className:"page",children:s.jsx(cs,{variant:"destructive",children:s.jsx(rs,{children:"Task not found."})})});const t=c.data.task,D=c.data.parents||[],b=k(t.name,t.slug),M=(c.data.sisters||[]).filter(e=>e.id!==t.id),o=c.data.benchmarks||[],q=v.some(e=>(f.get(e.id)||[]).length>0),T=o.length>0,U=(()=>{const e=new Set;return o.forEach(a=>e.add(a.id)),f.forEach(a=>a.forEach(n=>e.add(n.id))),e.size})(),K=e=>{O(a=>{const n=new Set(a);return n.has(e)?n.delete(e):n.add(e),n})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(p,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(p,{to:"/tasks",children:"Tasks"}),[...D].reverse().map(e=>s.jsxs(J.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(p,{to:`/tasks/${e.slug||e.id}`,children:k(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:t.name.toUpperCase()})]}),s.jsxs("div",{className:t.image_url?"task-hero-grid":void 0,children:[s.jsxs("div",{children:[s.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),s.jsx("h1",{className:"domain-mega-title",children:b}),t.description&&s.jsx(L,{className:"task-explainer",text:t.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(t.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:U}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[y.length,"+"]}),"METHODS USED"]})]})]}),t.image_url&&s.jsxs("figure",{className:`task-figure-card${t.slug==="omni-models"?" task-figure-card--compact":""}`,children:[s.jsx("div",{className:"task-figure-img-wrap",children:s.jsx("img",{className:"task-figure-img",src:t.image_url,alt:`${b} schematic`,onError:e=>{var a,n;(n=(a=e.currentTarget.parentElement)==null?void 0:a.parentElement)==null||n.style.setProperty("display","none")}})}),s.jsxs("figcaption",{children:["Figure · ",b,t.image_credit&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),s.jsx(L,{className:"task-image-credit",text:t.image_credit})]})]})]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[T&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",children:[s.jsx("div",{className:"task-section-eyebrow",children:"Leaderboards · click any"}),s.jsxs("div",{className:"task-section-title",children:["Benchmarks ",s.jsxs("span",{className:"meta",children:["[",o.length,"]"]})]})]}),(_?o:o.slice(0,5)).map((e,a)=>s.jsxs("div",{className:"bench-row",onClick:()=>u(E(e.slug||e.id,r)),children:[s.jsx("div",{className:"bench-row-num",children:String(a+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:e.name}),s.jsxs("div",{className:"bench-row-sub",children:[e.featured_rank!=null&&s.jsxs("span",{className:"bench-pin",children:[s.jsx(R,{size:11,className:"bench-pin-icon"})," pinned"]}),e.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:e.paper_count})," ENTRIES"]})]})]}),e.best_model_name&&s.jsxs("div",{className:"bench-row-best",children:[s.jsx(is,{size:13,className:"bench-row-best-icon"}),s.jsx("span",{className:"bench-row-best-name",children:e.best_model_name})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},e.id)),o.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>z(e=>!e),children:_?"− show top 5":`+ show ${o.length-5} more benchmarks`})]}),q&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:T?{marginTop:36}:void 0,children:[s.jsx("div",{className:"task-section-eyebrow",children:"Benchmarks by capability"}),s.jsxs("div",{className:"task-section-title",children:["Subtasks ",s.jsxs("span",{className:"meta",children:["[",v.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:v.map(e=>{const a=f.get(e.id)||[];if(a.length===0)return null;const n=H.has(e.id),h=n?a:a.slice(0,S),d=a.length-S;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(p,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:k(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",a.length," benchmark",a.length===1?"":"s","]"]})]}),h.map((l,Q)=>s.jsxs("div",{className:"bench-row",onClick:()=>u(E(l.slug||l.id,e.slug||e.id)),children:[s.jsx("div",{className:"bench-row-num",children:String(Q+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:l.name}),s.jsxs("div",{className:"bench-row-sub",children:[l.featured_rank!=null&&s.jsxs("span",{className:"bench-pin",children:[s.jsx(R,{size:11,className:"bench-pin-icon"})," pinned"]}),l.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:l.paper_count})," ENTRIES"]})]})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},l.id)),d>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>K(e.id),children:n?`− show top ${S}`:`+ show ${d} more benchmark${d===1?"":"s"}`})]},e.id)})})]}),s.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[s.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),s.jsxs("div",{className:"task-section-title",children:["Papers ",s.jsxs("span",{className:"meta",children:["[",(t.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:ls.map(([e,a])=>s.jsx("button",{className:`sort-btn ${j===e?"active":""}`,onClick:()=>I(e),children:a},e))}),s.jsxs("div",{className:"results-count",children:[w.length," loaded in ",s.jsx("span",{children:b})]})]}),i.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,a)=>s.jsx(N,{className:"h-40 w-full"},a))}):w.length===0?s.jsx("div",{className:"no-results",children:"No papers in this task yet."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"paper-list",children:w.map((e,a)=>s.jsx(ss,{paper:e,rank:a+1},e.id))}),s.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),s.jsxs("aside",{className:"task-side",children:[M.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"01/"}),s.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),M.slice(0,8).map(e=>s.jsxs(p,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:k(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),y.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"02/"}),s.jsx("div",{className:"side-block-label",children:"Common Methods"}),y.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(es,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["·",e.count]})]},e.id))]})]})]})]})};export{ws as default};
|
assets/{TagsIndexView-BrKZEoUv.js → TagsIndexView-DNU0YwA-.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as d,j as e,L as h,a as p}from"./index-
|
|
|
|
| 1 |
+
import{r as d,j as e,L as h,a as p}from"./index-M24Hywem.js";import{u as g}from"./useQuery-C6YLWBWB.js";import{e as x,h as f,d as u}from"./transform-DVq_2bw1.js";import{S as m}from"./skeleton-DCGdUtqq.js";import{A as j,a as y}from"./alert-0Kui0gCY.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",b=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>p.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>s[v(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,a)=>s+a.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>e.jsx(m,{className:"h-24"},t))})]},a))}):o.map(s=>{const a=s.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:a.map(t=>{const i=t.slug||"",l=x(f(i));return e.jsxs(h,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)})})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{b as default};
|
assets/alert-0Kui0gCY.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as a,j as s,k as l,m as i}from"./index-M24Hywem.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a};
|
assets/alert-Ayuop_ag.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as a,j as s,k as l,af as i}from"./index-D3-tYEe-.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a};
|
|
|
|
|
|
assets/{badge-CCpokg9G.js → badge-DZWw7QDg.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as a,j as n,k as s,
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as a,j as n,k as s,m as o}from"./index-M24Hywem.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/components-D244J_Aj.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{l as S,V as k,a as z,j as t,L as C,$ as w}from"./index-D3-tYEe-.js";import{L as P,a as H}from"./LatexTitle-ZrlO0rs7.js";import{h as T,d as A,g as E,f as R}from"./transform-nNAikYlJ.js";const I=({slug:e,label:s,onClick:r})=>{const o=w(),g=T(e),n=R(g),u=x=>{if(x.stopPropagation(),r){r(e);return}o(`/tasks/${e}`)};return t.jsxs("span",{className:"tag-chip",style:{background:n.bg,color:n.text},onClick:u,children:[t.jsx("span",{className:"dot",style:{background:n.dot}}),A(s||E(e),e)]})},K=({method:e,onClick:s})=>{const r=w(),o=e.slug||e.id||"";if(!o)return null;const g=n=>{if(n.stopPropagation(),s){s(o);return}r(`/methods/${o}`)};return t.jsx("span",{className:"method-chip",onClick:g,children:e.name})},V=({name:e,size:s=14})=>{const r={search:t.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:t.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:t.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:t.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:t.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:t.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:t.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:t.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:t.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:t.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:t.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:t.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:t.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:t.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:t.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:t.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:t.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return t.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[e]})},B=e=>{let s=2166136261;for(let r=0;r<e.length;r++)s=Math.imul(s^e.charCodeAt(r),16777619);return()=>(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},q=({paperId:e})=>{const s=B(e),r=160,o=220,g=[.85+s()*.1,.55+s()*.25],n=.45+s()*.3,u=[],x=9+Math.floor(s()*3);for(let d=0;d<x;d++)u.push(.55+s()*.4);const a=s()>.3,m=Math.floor(s()*3),y=[],b=6+Math.floor(s()*3);for(let d=0;d<b;d++)y.push(.5+s()*.45);const c="#9A9588",j="#3A352D",i=5,f=(r-i*2-2)/2,$=i,h=i+f+2;let v=i+2;const N=v;v+=6;const W=v+1;v+=5;const F=v;v+=3;const l=v+1;return t.jsx("div",{style:{width:r,height:o,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:t.jsxs("svg",{width:r,height:o,viewBox:`0 0 ${r} ${o}`,style:{display:"block"},children:[g.map((d,p)=>t.jsx("rect",{x:i+(r-i*2)*(1-d)/2,y:N+p*2.4,width:(r-i*2)*d,height:1.4,fill:j,rx:.3},`t${p}`)),t.jsx("rect",{x:i+(r-i*2)*(1-n)/2,y:W,width:(r-i*2)*n,height:.9,fill:c,opacity:.7,rx:.2}),t.jsx("rect",{x:i,y:F,width:6,height:1,fill:j,opacity:.6}),u.map((d,p)=>{const M=l+p*2.1;return M>o-i-1?null:t.jsx("rect",{x:$,y:M,width:f*d,height:.8,fill:c,opacity:.55,rx:.2},`l${p}`)}),a&&t.jsxs("g",{children:[t.jsx("rect",{x:h,y:l,width:f,height:14,fill:"#F0EBE0",stroke:c,strokeWidth:.3,opacity:.9}),m===0&&t.jsx("g",{stroke:j,strokeWidth:.4,fill:"none",opacity:.6,children:t.jsx("polyline",{points:`${h+2},${l+11} ${h+6},${l+8} ${h+10},${l+9} ${h+14},${l+5} ${h+18},${l+6} ${h+22},${l+3}`})}),m===1&&t.jsxs("g",{opacity:.55,children:[t.jsx("circle",{cx:h+f/2,cy:l+7,r:3.5,fill:j}),t.jsx("rect",{x:h+2,y:l+11,width:f-4,height:1.5,fill:c})]}),m===2&&t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:h+3,y:l+5,width:f-6,height:1,fill:j}),t.jsx("rect",{x:h+6,y:l+8,width:f-12,height:.8,fill:j})]})]}),y.map((d,p)=>{const M=l+(a?16:0)+p*2.1;return M>o-i-1?null:t.jsx("rect",{x:h,y:M,width:f*d,height:.8,fill:c,opacity:.55,rx:.2},`r${p}`)})]})})},D=({paperId:e,title:s,thumbnailUrl:r,priority:o=!1})=>{const[g,n]=k.useState(!1),[u,x]=k.useState(0),[a,m]=k.useState(o),y=k.useRef(null);k.useEffect(()=>{n(!1),x(0)},[r]);const b=k.useMemo(()=>{if(!r)return null;if(u===0)return r;const c=r.includes("?")?"&":"?";return`${r}${c}retry=${u}`},[r,u]);return k.useEffect(()=>{if(o||a)return;const c=y.current;if(!c)return;const j=new IntersectionObserver(([i])=>{i.isIntersecting&&(m(!0),j.disconnect())},{rootMargin:"250px"});return j.observe(c),()=>j.disconnect()},[o,a]),r&&!g?t.jsx("div",{ref:y,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:a&&b&&t.jsx("img",{src:b,alt:`Thumbnail for ${s}`,loading:o?"eager":"lazy",decoding:"async",fetchPriority:o?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(u<1){x(c=>c+1);return}n(!0)}},b)}):t.jsx(q,{paperId:e})},_=({paper:e,rank:s,onClickTag:r})=>{const o=S(),g=`/paper/${e.id}`,n=k.useCallback(()=>{o.prefetchQuery({queryKey:["paper-arxiv",e.id],queryFn:()=>z.getPaperByArxivId(e.id,!0),staleTime:10*60*1e3})},[e.id,o]),u=e.authors.slice(0,3).join(", "),x=e.authors.length;return t.jsxs("article",{className:"paper-card",children:[s!=null&&t.jsx(C,{to:g,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:t.jsx(D,{paperId:e.id,title:e.title,thumbnailUrl:e.thumbnailUrl,priority:s<=3})}),t.jsxs("div",{className:"paper-body",children:[t.jsxs("div",{className:"paper-body-main",children:[t.jsx("h3",{className:"paper-title",children:t.jsx(C,{to:g,onFocus:n,onMouseEnter:n,children:t.jsx(P,{title:e.title})})}),t.jsxs("div",{className:"paper-authors",children:[u,x>3&&t.jsxs("span",{children:[", ","+",x-3," authors"]}),e.date&&t.jsxs(t.Fragment,{children:[x>0?" · ":"",t.jsx("span",{children:e.date})]}),e.citations>0&&t.jsxs(t.Fragment,{children:[x>0||e.date?" · ":"",t.jsxs("span",{children:[e.citations.toLocaleString()," citations"]})]})]}),e.abstract&&t.jsx("p",{className:"paper-abstract",children:t.jsx(H,{text:e.abstract})}),e.tags.length>0&&t.jsx("div",{className:"paper-tags",children:e.tags.map(a=>t.jsx(I,{slug:a,onClick:r},a))})]}),e.github!=null&&(()=>{const a=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx(V,{name:"github",size:12}),t.jsx("span",{className:"gh-stars",children:L(e.github)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars"})]}),e.velocity24h!=null&&e.velocity24h>0&&t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx("span",{className:"gh-rate-arrow",children:"↑"}),t.jsx("span",{className:"gh-rate",children:Y(e.velocity24h)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars / hr"})]})]});return e.githubUrl?t.jsx("a",{className:"paper-github-stats is-link",href:e.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open GitHub repository (${L(e.github)} stars)`,onClick:m=>m.stopPropagation(),children:a}):t.jsx("aside",{className:"paper-github-stats",children:a})})()]})]})};function L(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Y(e){return e.toFixed(1)}export{V as I,K as M,_ as P,I as T,D as a};
|
|
|
|
|
|
assets/components-J9e6gtqw.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{o as S,W as k,a as z,j as t,L as C,a0 as w}from"./index-M24Hywem.js";import{L as P,a as H}from"./LatexTitle-C8-B6cG1.js";import{h as T,d as A,f as E,e as R}from"./transform-DVq_2bw1.js";const I=({slug:e,label:s,onClick:r})=>{const o=w(),g=T(e),n=R(g),u=x=>{if(x.stopPropagation(),r){r(e);return}o(`/tasks/${e}`)};return t.jsxs("span",{className:"tag-chip",style:{background:n.bg,color:n.text},onClick:u,children:[t.jsx("span",{className:"dot",style:{background:n.dot}}),A(s||E(e),e)]})},K=({method:e,onClick:s})=>{const r=w(),o=e.slug||e.id||"";if(!o)return null;const g=n=>{if(n.stopPropagation(),s){s(o);return}r(`/methods/${o}`)};return t.jsx("span",{className:"method-chip",onClick:g,children:e.name})},B=({name:e,size:s=14})=>{const r={search:t.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:t.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:t.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:t.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:t.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:t.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:t.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:t.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:t.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:t.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:t.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:t.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:t.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:t.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:t.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:t.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:t.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return t.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[e]})},V=e=>{let s=2166136261;for(let r=0;r<e.length;r++)s=Math.imul(s^e.charCodeAt(r),16777619);return()=>(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},q=({paperId:e})=>{const s=V(e),r=160,o=220,g=[.85+s()*.1,.55+s()*.25],n=.45+s()*.3,u=[],x=9+Math.floor(s()*3);for(let d=0;d<x;d++)u.push(.55+s()*.4);const l=s()>.3,m=Math.floor(s()*3),y=[],b=6+Math.floor(s()*3);for(let d=0;d<b;d++)y.push(.5+s()*.45);const c="#9A9588",j="#3A352D",i=5,f=(r-i*2-2)/2,$=i,h=i+f+2;let v=i+2;const N=v;v+=6;const W=v+1;v+=5;const F=v;v+=3;const a=v+1;return t.jsx("div",{style:{width:r,height:o,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:t.jsxs("svg",{width:r,height:o,viewBox:`0 0 ${r} ${o}`,style:{display:"block"},children:[g.map((d,p)=>t.jsx("rect",{x:i+(r-i*2)*(1-d)/2,y:N+p*2.4,width:(r-i*2)*d,height:1.4,fill:j,rx:.3},`t${p}`)),t.jsx("rect",{x:i+(r-i*2)*(1-n)/2,y:W,width:(r-i*2)*n,height:.9,fill:c,opacity:.7,rx:.2}),t.jsx("rect",{x:i,y:F,width:6,height:1,fill:j,opacity:.6}),u.map((d,p)=>{const M=a+p*2.1;return M>o-i-1?null:t.jsx("rect",{x:$,y:M,width:f*d,height:.8,fill:c,opacity:.55,rx:.2},`l${p}`)}),l&&t.jsxs("g",{children:[t.jsx("rect",{x:h,y:a,width:f,height:14,fill:"#F0EBE0",stroke:c,strokeWidth:.3,opacity:.9}),m===0&&t.jsx("g",{stroke:j,strokeWidth:.4,fill:"none",opacity:.6,children:t.jsx("polyline",{points:`${h+2},${a+11} ${h+6},${a+8} ${h+10},${a+9} ${h+14},${a+5} ${h+18},${a+6} ${h+22},${a+3}`})}),m===1&&t.jsxs("g",{opacity:.55,children:[t.jsx("circle",{cx:h+f/2,cy:a+7,r:3.5,fill:j}),t.jsx("rect",{x:h+2,y:a+11,width:f-4,height:1.5,fill:c})]}),m===2&&t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:h+3,y:a+5,width:f-6,height:1,fill:j}),t.jsx("rect",{x:h+6,y:a+8,width:f-12,height:.8,fill:j})]})]}),y.map((d,p)=>{const M=a+(l?16:0)+p*2.1;return M>o-i-1?null:t.jsx("rect",{x:h,y:M,width:f*d,height:.8,fill:c,opacity:.55,rx:.2},`r${p}`)})]})})},D=({paperId:e,title:s,thumbnailUrl:r,priority:o=!1})=>{const[g,n]=k.useState(!1),[u,x]=k.useState(0),[l,m]=k.useState(o),y=k.useRef(null);k.useEffect(()=>{n(!1),x(0)},[r]);const b=k.useMemo(()=>{if(!r)return null;if(u===0)return r;const c=r.includes("?")?"&":"?";return`${r}${c}retry=${u}`},[r,u]);return k.useEffect(()=>{if(o||l)return;const c=y.current;if(!c)return;const j=new IntersectionObserver(([i])=>{i.isIntersecting&&(m(!0),j.disconnect())},{rootMargin:"250px"});return j.observe(c),()=>j.disconnect()},[o,l]),r&&!g?t.jsx("div",{ref:y,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:l&&b&&t.jsx("img",{src:b,alt:`Thumbnail for ${s}`,loading:o?"eager":"lazy",decoding:"async",fetchPriority:o?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(u<1){x(c=>c+1);return}n(!0)}},b)}):t.jsx(q,{paperId:e})},_=({paper:e,rank:s,onClickTag:r})=>{const o=S(),g=`/paper/${e.id}`,n=k.useCallback(()=>{o.prefetchQuery({queryKey:["paper-arxiv",e.id],queryFn:()=>z.getPaperByArxivId(e.id,!0),staleTime:10*60*1e3})},[e.id,o]),u=e.authors.slice(0,3).join(", "),x=e.authors.length;return t.jsxs("article",{className:"paper-card",children:[s!=null&&t.jsx(C,{to:g,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:t.jsx(D,{paperId:e.id,title:e.title,thumbnailUrl:e.thumbnailUrl,priority:s<=3})}),t.jsxs("div",{className:"paper-body",children:[t.jsxs("div",{className:"paper-body-main",children:[t.jsx("h3",{className:"paper-title",children:t.jsx(C,{to:g,onFocus:n,onMouseEnter:n,children:t.jsx(P,{title:e.title})})}),t.jsxs("div",{className:"paper-authors",children:[u,x>3&&t.jsxs("span",{children:[", ","+",x-3," authors"]}),e.date&&t.jsxs(t.Fragment,{children:[x>0?" · ":"",t.jsx("span",{children:e.date})]}),e.citations>0&&t.jsxs(t.Fragment,{children:[x>0||e.date?" · ":"",t.jsxs("span",{children:[e.citations.toLocaleString()," citations"]})]})]}),e.abstract&&t.jsx("p",{className:"paper-abstract",children:t.jsx(H,{text:e.abstract})}),e.tags.length>0&&t.jsx("div",{className:"paper-tags",children:e.tags.map(l=>t.jsx(I,{slug:l,onClick:r},l))})]}),e.github!=null&&(()=>{const l=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx(B,{name:"github",size:12}),t.jsx("span",{className:"gh-stars",children:L(e.github)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars"})]}),e.velocity24h!=null&&e.velocity24h>0&&t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx("span",{className:"gh-rate-arrow",children:"↑"}),t.jsx("span",{className:"gh-rate",children:Y(e.velocity24h)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars / hr"})]})]});return e.githubUrl?t.jsx("a",{className:"paper-github-stats is-link",href:e.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open GitHub repository (${L(e.github)} stars)`,onClick:m=>m.stopPropagation(),children:l}):t.jsx("aside",{className:"paper-github-stats",children:l})})()]})]})};function L(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Y(e){return e.toFixed(1)}export{B as I,K as M,_ as P,I as T,D as a};
|
assets/{dialog-DzRXUQ09.js → dialog-D8hTxZ4f.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
import{r as s,j as i,
|
| 2 |
|
| 3 |
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
| 4 |
|
| 5 |
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},ve="DialogDescriptionWarning",ye=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ve).contentName}}.`;return s.useEffect(()=>{var r;const n=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Ce=P,Re=
|
|
|
|
| 1 |
+
import{r as s,j as i,z as q,d as J,A as R,P as N,E as K,b as D,f as x,i as U,e as h,F as X,G as Y,H as Q,I as ee,J as te,a9 as oe,X as ne,k as p}from"./index-M24Hywem.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?q(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=U(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=J({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};P.displayName=C;var O="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(O,o),r=h(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=O;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),A=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:n}=e,r=f(E,t);return i.jsx(fe,{scope:t,forceMount:o,children:s.Children.map(a,l=>i.jsx(N,{present:o||r.open,children:i.jsx(K,{asChild:!0,container:n,children:l})}))})};A.displayName=E;var y="DialogOverlay",w=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(N,{present:a||r.open,children:i.jsx(pe,{...n,ref:t})}):null});w.displayName=y;var ge=ae("DialogOverlay.RemoveScroll"),pe=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(y,o);return i.jsx(Y,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(N,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=h(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return X(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=h(t,d);return Q(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",F=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});F.displayName=_;var M="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(M,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=M;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
| 2 |
|
| 3 |
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
| 4 |
|
| 5 |
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},ve="DialogDescriptionWarning",ye=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ve).contentName}}.`;return s.useEffect(()=>{var r;const n=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Ce=P,Re=A,V=w,H=T,z=F,B=W,Ne=k;const Ae=Ce,he=Re,Z=s.forwardRef(({className:e,...t},o)=>i.jsx(V,{ref:o,className:p("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Z.displayName=V.displayName;const Ee=s.forwardRef(({className:e,children:t,...o},a)=>i.jsxs(he,{children:[i.jsx(Z,{}),i.jsxs(H,{ref:a,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,i.jsxs(Ne,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(ne,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ee.displayName=H.displayName;const _e=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_e.displayName="DialogHeader";const je=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});je.displayName="DialogFooter";const be=s.forwardRef(({className:e,...t},o)=>i.jsx(z,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));be.displayName=z.displayName;const Pe=s.forwardRef(({className:e,...t},o)=>i.jsx(B,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));Pe.displayName=B.displayName;export{H as C,Ae as D,V as O,Re as P,Ce as R,Ee as a,_e as b,be as c,Pe as d,je as e};
|
assets/{index-DOEjZKdL.css → index-BwwIoFDx.css}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{index-D3-tYEe-.js → index-M24Hywem.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{index-BsV_WMf3.js → index-t6Oi9XIP.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as u}from"./index-
|
|
|
|
| 1 |
+
import{r as u}from"./index-M24Hywem.js";function o(r){const e=u.useRef({value:r,previous:r});return u.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u};
|
assets/input-C7eEyU6x.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as n,j as s,ai as f,k as i,af as c}from"./index-D3-tYEe-.js";const l=c("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),g=n.forwardRef(({className:e,variant:r,size:t,asChild:o=!1,...a},d)=>{const u=o?f:"button";return s.jsx(u,{className:i(l({variant:r,size:t,className:e})),ref:d,...a})});g.displayName="Button";const b=n.forwardRef(({className:e,type:r,...t},o)=>s.jsx("input",{type:r,className:i("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...t}));b.displayName="Input";export{g as B,b as I};
|
|
|
|
|
|
assets/input-CpJZsE-m.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as n,j as s,ai as f,k as i,m as c}from"./index-M24Hywem.js";const l=c("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),g=n.forwardRef(({className:e,variant:r,size:t,asChild:o=!1,...a},d)=>{const u=o?f:"button";return s.jsx(u,{className:i(l({variant:r,size:t,className:e})),ref:d,...a})});g.displayName="Button";const b=n.forwardRef(({className:e,type:r,...t},o)=>s.jsx("input",{type:r,className:i("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...t}));b.displayName="Input";export{g as B,b as I};
|
assets/{loader-circle-BKVFOFo9.js → loader-circle-2lEq4cac.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as e}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}from"./index-M24Hywem.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{refresh-cw-gCrkdl6j.js → refresh-cw-CcmPDWxW.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as e}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}from"./index-M24Hywem.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{skeleton-D0cyB03X.js → skeleton-DCGdUtqq.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as t,k as n}from"./index-
|
|
|
|
| 1 |
+
import{j as t,k as n}from"./index-M24Hywem.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S};
|
assets/{switch-9KW_DGK2.js → switch-B1cyrnry.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as s,e as C,d as I,j as a,b as y,f as M,h as H,i as A,k as x}from"./index-
|
|
|
|
| 1 |
+
import{r as s,e as C,d as I,j as a,b as y,f as M,h as H,i as A,k as x}from"./index-M24Hywem.js";import{u as U}from"./index-t6Oi9XIP.js";var b="Switch",[q]=A(b),[z,L]=q(b),P=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),k=C(o,h=>p(h)),S=s.useRef(!1),g=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(z,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:k,onClick:M(t.onClick,h=>{B(T=>!T),g&&(S.current=h.isPropagationStopped(),S.current||h.stopPropagation())})}),g&&a.jsx(N,{control:l,bubbles:!S.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=E;var O="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=U(e),v=H(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const k=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(k)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:x("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(D,{className:x("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S};
|
assets/textarea-DnPbxyAL.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as s,j as a,k as t}from"./index-M24Hywem.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T};
|