diff --git a/assets/AiDeadlinesView-DKoPzbW5.js b/assets/AiDeadlinesView-SO_B8s6V.js similarity index 97% rename from assets/AiDeadlinesView-DKoPzbW5.js rename to assets/AiDeadlinesView-SO_B8s6V.js index a99a07d12300676f1e747f73b86dfaa8c05ce9ca..e66fc0ce8236d61b7d5cd2833d7bed5d97fc9da6 100644 --- a/assets/AiDeadlinesView-DKoPzbW5.js +++ b/assets/AiDeadlinesView-SO_B8s6V.js @@ -1,3 +1,3 @@ -import{r as x,j as t,b as E}from"./index-BfD7YdLr.js";import{u as A}from"./useQuery-BQY3DH-b.js";import{S as B}from"./switch-D_aiRxQJ.js";import{S as U}from"./skeleton-DlrhV-qs.js";import{A as W,a as O}from"./alert-zXn954y8.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-CDRq9Z7X.js";import"./useBaseQuery-zm-nsmQ1.js";import"./index-qlYSmaoI.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(` +import{r as x,j as t,b as E}from"./index-Bn8Ob2yb.js";import{u as A}from"./useQuery-DdnDUe7s.js";import{S as B}from"./switch-CO-39qkR.js";import{S as U}from"./skeleton-DMgHDmV1.js";import{A as W,a as O}from"./alert-ek_GWo6X.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-BBaz5Wr4.js";import"./useBaseQuery-DOoW3hTR.js";import"./index-Bty21uio.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(` `)},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(` `),g=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(g),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},te=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?I(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),g=e?z(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,p=s?new Date(s.deadline_at).getTime():null;return t.jsx(V,{open:a,onOpenChange:n,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(Y,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[g&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:g})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),p!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(p,r)},children:J(p,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,m)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,u=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(u?null:y,r)},children:X(y,r)})]},`${d.type??"deadline"}-${m}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},M=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ne=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),g=s?new Date(s.deadline_at).getTime():null,c=_(i?g:null,a),p=z(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:g!=null?Q(g,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[p&&t.jsx("span",{children:p}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(m=>{const y=n.has(m);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(m)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(m)},m)})})]})},me=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,g]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),p=A({queryKey:["conference-deadlines"],queryFn:()=>E.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(u=>{const h=new Set(u);return h.has(l)?h.delete(l):h.add(l),h})},m=x.useMemo(()=>{var u;const l=new Map;return(u=p.data)==null||u.results.forEach(h=>{D(h).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((h,j)=>j[1]-h[1]).map(([h])=>h)},[p.data]),y=x.useMemo(()=>{var j;const u=(((j=p.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),h=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,w)=>{const v=h(f),N=h(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[p.data,e,n,o,c]);return p.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(O,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(M,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(M,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),m.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[m.map(l=>{const u=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:p.isLoading?"…":`${y.length} conferences`})}),p.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,u)=>t.jsx(U,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ne,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:g},l.id))}),t.jsx(te,{conf:s,open:s!==null,onOpenChange:l=>{l||g(null)}})]})};export{me as default}; diff --git a/assets/AuthorDetailView-XYwc-69t.js b/assets/AuthorDetailView-DYzk7KbK.js similarity index 82% rename from assets/AuthorDetailView-XYwc-69t.js rename to assets/AuthorDetailView-DYzk7KbK.js index 77345c3e1f3cb095ba41d3dfaa912aa28e7b8a82..d8cf0a5387c37397563fab1f12660c45d87a3e8d 100644 --- a/assets/AuthorDetailView-XYwc-69t.js +++ b/assets/AuthorDetailView-DYzk7KbK.js @@ -1 +1 @@ -import{e as m,j as e,L as g,b as h}from"./index-BfD7YdLr.js";import{u as d}from"./useQuery-BQY3DH-b.js";import{S as c}from"./skeleton-DlrhV-qs.js";import x from"./NotFound-bD49ZyM9.js";import"./useBaseQuery-zm-nsmQ1.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default}; +import{e as m,j as e,L as g,b as h}from"./index-Bn8Ob2yb.js";import{u as d}from"./useQuery-DdnDUe7s.js";import{S as c}from"./skeleton-DMgHDmV1.js";import x from"./NotFound-DArrcZxf.js";import"./useBaseQuery-DOoW3hTR.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default}; diff --git a/assets/BenchmarkDetailView-HobUhRD6.js b/assets/BenchmarkDetailView-aQvia8JD.js similarity index 98% rename from assets/BenchmarkDetailView-HobUhRD6.js rename to assets/BenchmarkDetailView-aQvia8JD.js index 8388df0a18c5641f16647fbc02bb35ae47d883d5..383d5f782b6bcf87c4bfb01ec83d6336bfc65ea1 100644 --- a/assets/BenchmarkDetailView-HobUhRD6.js +++ b/assets/BenchmarkDetailView-aQvia8JD.js @@ -1,2 +1,2 @@ -import{u as vt,r as w,j as n,a3 as ne,g as jt,e as _t,a as kt,Z as St,L as me,b as ee}from"./index-BfD7YdLr.js";import{u as te}from"./useQuery-BQY3DH-b.js";import{S as xe}from"./skeleton-DlrhV-qs.js";import{S as Je}from"./switch-D_aiRxQJ.js";import{A as Ct,a as Et}from"./alert-zXn954y8.js";import{L as ye}from"./LatexTitle-Dyu7ZW4B.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-C0AdjeMr.js";import{B as Tt}from"./BenchmarkTrendSparkline-Dvz4QF2u.js";import{I as $t}from"./components-LTCBEq5x.js";import"./useBaseQuery-zm-nsmQ1.js";import"./index-qlYSmaoI.js";import"./katex.min-BSBacQyE.js";import"./hover-card-Bp6412TC.js";import"./transform-DCLb4olr.js";function Mt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ft(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Lt=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>Ze(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return Mi-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;ob.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Ft(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;Bi-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function It(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Pt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;rD||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Vt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Ot(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ut(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Ot(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Wt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function zt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Wt(r):qt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Pt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(zt(c,r,a,s)),t.appendChild(l)}function Gt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Kt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=Qt(e).toLowerCase();return Kt[t]||""}function Xt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Yt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function Jt(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=Jt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Xt(l)));a=Yt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function Zt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function er(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function tr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function rr(e,t){return P(e,HTMLCanvasElement)?Zt(e):P(e,HTMLVideoElement)?er(e,t):P(e,HTMLIFrameElement)?tr(e,t):e.cloneNode(ht(e))}const sr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function nr(e,t,r){var s,a;if(ht(t))return t;let i=[];return sr(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function ar(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function ir(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function lr(e,t,r){return P(t,Element)&&(ar(e,t,r),Gt(e,t,r),ir(e,t),cr(e,t)),t}async function or(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;irr(s,t)).then(s=>nr(e,s,t)).then(s=>lr(e,s,t)).then(s=>or(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,dr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ur=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function hr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function fr(e,t,r,s,a){try{const i=r?It(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(mr(t),`$1${l}$3`)}catch{}return e}function pr(e,{preferredFontFormat:t}){return t?e.replace(ur,r=>{for(;;){const[s,,a]=dr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=pr(e,r);return hr(s).reduce((i,c)=>i.then(l=>fr(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function xr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function br(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await gr(e,t),await xr(e,t),await br(e,t))}function yr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function wr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function vr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function jr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await wr(r,t);return vr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function _r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function kr(e,t){const r=await jr(e,t),s=_r(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(` +import{u as vt,r as w,j as n,a3 as ne,g as jt,e as _t,a as kt,Z as St,L as me,b as ee}from"./index-Bn8Ob2yb.js";import{u as te}from"./useQuery-DdnDUe7s.js";import{S as xe}from"./skeleton-DMgHDmV1.js";import{S as Je}from"./switch-CO-39qkR.js";import{A as Ct,a as Et}from"./alert-ek_GWo6X.js";import{L as ye}from"./LatexTitle-CCig7BhH.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-C_nXOup9.js";import{B as Tt}from"./BenchmarkTrendSparkline-D6qVvB70.js";import{I as $t}from"./components-CmiCpieH.js";import"./useBaseQuery-DOoW3hTR.js";import"./index-Bty21uio.js";import"./katex.min-BSBacQyE.js";import"./hover-card-BMKmh3eo.js";import"./transform-Z_GB05A-.js";function Mt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ft(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Lt=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>Ze(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return Mi-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;ob.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Ft(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;Bi-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function It(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Pt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;rD||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Vt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Ot(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ut(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Ot(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Wt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function zt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Wt(r):qt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Pt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(zt(c,r,a,s)),t.appendChild(l)}function Gt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Kt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=Qt(e).toLowerCase();return Kt[t]||""}function Xt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Yt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function Jt(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=Jt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Xt(l)));a=Yt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function Zt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function er(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function tr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function rr(e,t){return P(e,HTMLCanvasElement)?Zt(e):P(e,HTMLVideoElement)?er(e,t):P(e,HTMLIFrameElement)?tr(e,t):e.cloneNode(ht(e))}const sr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function nr(e,t,r){var s,a;if(ht(t))return t;let i=[];return sr(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function ar(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function ir(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function lr(e,t,r){return P(t,Element)&&(ar(e,t,r),Gt(e,t,r),ir(e,t),cr(e,t)),t}async function or(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;irr(s,t)).then(s=>nr(e,s,t)).then(s=>lr(e,s,t)).then(s=>or(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,dr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ur=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function hr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function fr(e,t,r,s,a){try{const i=r?It(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(mr(t),`$1${l}$3`)}catch{}return e}function pr(e,{preferredFontFormat:t}){return t?e.replace(ur,r=>{for(;;){const[s,,a]=dr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=pr(e,r);return hr(s).reduce((i,c)=>i.then(l=>fr(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function xr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function br(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await gr(e,t),await xr(e,t),await br(e,t))}function yr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function wr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function vr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function jr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await wr(r,t);return vr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function _r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function kr(e,t){const r=await jr(e,t),s=_r(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(` `)}async function Sr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Cr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Sr(a,t),await xt(a,t),yr(a,t),await Ut(a,r,s)}async function Er(e,t={}){const{width:r,height:s}=ut(e,t),a=await Cr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Bt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ht(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Nr(e,t={}){const r=await Er(e,t);return await Vt(r)}const Te="#ffffff";function Rr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Tr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Rr():t}async function $r(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Nr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Tr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await $r(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx($t,{name:"copy",size:11}),l]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Mr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Fr(e){const t=new Map;for(const r of e){const s=Mr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Lr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.valuei;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Ir=5;function Pr(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const Yr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Mt(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Fr(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Ir),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Lr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Pr(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx(Tt,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Lt,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Nt,{}),(h.external??h.is_external)&&n.jsx(Rt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Yr as default}; diff --git a/assets/BenchmarkTrendSparkline-Dvz4QF2u.js b/assets/BenchmarkTrendSparkline-D6qVvB70.js similarity index 97% rename from assets/BenchmarkTrendSparkline-Dvz4QF2u.js rename to assets/BenchmarkTrendSparkline-D6qVvB70.js index 49ac1fc54ef42b0bcf232d67c19781ee8a6d641d..57f0e3a86b0506c21a9ae5d3b4a79a015fe99410 100644 --- a/assets/BenchmarkTrendSparkline-Dvz4QF2u.js +++ b/assets/BenchmarkTrendSparkline-D6qVvB70.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-BfD7YdLr.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; +import{r as C,j as t}from"./index-Bn8Ob2yb.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; diff --git a/assets/ChatMessage-8Xxu3vLN.js b/assets/ChatMessage-BNDm-FB_.js similarity index 98% rename from assets/ChatMessage-8Xxu3vLN.js rename to assets/ChatMessage-BNDm-FB_.js index 3dd35f44b6d019ac2338f866be3dfd5b9f95c7a0..a0a1155ee7d7ffa5f57538c5dae87f8a063562e3 100644 --- a/assets/ChatMessage-8Xxu3vLN.js +++ b/assets/ChatMessage-BNDm-FB_.js @@ -1,4 +1,4 @@ -import{c as E,r as v,j as t,R as g}from"./index-BfD7YdLr.js";import{M as R,S as N,A as S,s as P,v as b,w as T}from"./chatSessions-Dl4MrfBi.js";import"./katex.min-BSBacQyE.js";import{H as $,a as F,b as H}from"./hover-card-Bp6412TC.js";import{r as I,a as M,P as U}from"./PaperPreviewLink-Dud2kyWl.js";import{M as O,r as L,d as B}from"./index-SnRTg719.js";/** +import{c as E,r as v,j as t,R as g}from"./index-Bn8Ob2yb.js";import{M as R,S as N,A as S,s as P,v as b,w as T}from"./chatSessions-CJGL67ci.js";import"./katex.min-BSBacQyE.js";import{H as $,a as F,b as H}from"./hover-card-BMKmh3eo.js";import{r as I,a as M,P as U}from"./PaperPreviewLink-hLdU_QRR.js";import{M as O,r as L,d as B}from"./index-N_WymWS-.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatView-DdHEqFeP.js b/assets/ChatView-CtDdhli3.js similarity index 98% rename from assets/ChatView-DdHEqFeP.js rename to assets/ChatView-CtDdhli3.js index 5b56a2608eba3b19fd6c59a9e89f2297250a44a4..9a50b9474a601c27b50390980d6f0f3f45c256e4 100644 --- a/assets/ChatView-DdHEqFeP.js +++ b/assets/ChatView-CtDdhli3.js @@ -1,4 +1,4 @@ -import{c as Ct,d as Me,r as i,j as t,e as Et,u as Ot,a as Tt,f as jt,g as Nt,h as It,k as Lt,l as Dt,X as At,b as Pt}from"./index-BfD7YdLr.js";import{u as Yt}from"./useQuery-BQY3DH-b.js";import{C as et,U as tt,A as Mt}from"./ChatMessage-8Xxu3vLN.js";import{a as Ft,g as Ye,t as gt,r as Ut,F as qt,D as Bt,l as Ht,C as rt,b as nt,d as st,e as Wt,f as Kt,P as Vt,h as at,i as Gt,T as $t,S as it,u as ot,j as Qt,k as zt,m as Jt}from"./chatSessions-Dl4MrfBi.js";import{S as Xt}from"./chatPrompts-CDY3UGU1.js";import{u as Zt,O as er,a as tr,b as rr,r as nr}from"./openrouter-ClIkjPp2.js";import"./useBaseQuery-zm-nsmQ1.js";import"./katex.min-BSBacQyE.js";import"./hover-card-Bp6412TC.js";import"./PaperPreviewLink-Dud2kyWl.js";import"./index-SnRTg719.js";/** +import{c as Ct,d as Me,r as i,j as t,e as Et,u as Ot,a as Tt,f as jt,g as Nt,h as It,k as Lt,l as Dt,X as At,b as Pt}from"./index-Bn8Ob2yb.js";import{u as Yt}from"./useQuery-DdnDUe7s.js";import{C as et,U as tt,A as Mt}from"./ChatMessage-BNDm-FB_.js";import{a as Ft,g as Ye,t as gt,r as Ut,F as qt,D as Bt,l as Ht,C as rt,b as nt,d as st,e as Wt,f as Kt,P as Vt,h as at,i as Gt,T as $t,S as it,u as ot,j as Qt,k as zt,m as Jt}from"./chatSessions-CJGL67ci.js";import{S as Xt}from"./chatPrompts-CDY3UGU1.js";import{u as Zt,O as er,a as tr,b as rr,r as nr}from"./openrouter-Ho6iwenl.js";import"./useBaseQuery-DOoW3hTR.js";import"./katex.min-BSBacQyE.js";import"./hover-card-BMKmh3eo.js";import"./PaperPreviewLink-hLdU_QRR.js";import"./index-N_WymWS-.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ConferenceDetailView-BLvSVhvE.js b/assets/ConferenceDetailView-Bc8hL_Zk.js similarity index 93% rename from assets/ConferenceDetailView-BLvSVhvE.js rename to assets/ConferenceDetailView-Bc8hL_Zk.js index 89f5fddab2b6c191a9745c8e284834a8ce4c080d..afc8bf2502df031126f0f0dbbcdaf208506a4be5 100644 --- a/assets/ConferenceDetailView-BLvSVhvE.js +++ b/assets/ConferenceDetailView-Bc8hL_Zk.js @@ -1 +1 @@ -import{e as L,r as D,j as e,L as p,b as C}from"./index-BfD7YdLr.js";import{u as T}from"./useQuery-BQY3DH-b.js";import{M as F}from"./MarkdownText-BmKXBVRs.js";import{c as B,h as A,d as E}from"./transform-DCLb4olr.js";import{S as f}from"./skeleton-DlrhV-qs.js";import{A as P,a as z}from"./alert-zXn954y8.js";import"./useBaseQuery-zm-nsmQ1.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Dud2kyWl.js";import"./index-SnRTg719.js";import"./hover-card-Bp6412TC.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},J=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{J as default}; +import{e as L,r as D,j as e,L as p,b as C}from"./index-Bn8Ob2yb.js";import{u as T}from"./useQuery-DdnDUe7s.js";import{M as F}from"./MarkdownText-DQLTyzIE.js";import{c as B,h as A,d as E}from"./transform-Z_GB05A-.js";import{S as f}from"./skeleton-DMgHDmV1.js";import{A as P,a as z}from"./alert-ek_GWo6X.js";import"./useBaseQuery-DOoW3hTR.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-hLdU_QRR.js";import"./index-N_WymWS-.js";import"./hover-card-BMKmh3eo.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},J=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{J as default}; diff --git a/assets/ConferenceTaskView-BjcxA6LX.js b/assets/ConferenceTaskView-DAbsNhLC.js similarity index 89% rename from assets/ConferenceTaskView-BjcxA6LX.js rename to assets/ConferenceTaskView-DAbsNhLC.js index 8dec568fdfe2d61c6336288eb31545381480732a..108ae0236e6e0afaa20dcb149be736f7e35e186d 100644 --- a/assets/ConferenceTaskView-BjcxA6LX.js +++ b/assets/ConferenceTaskView-DAbsNhLC.js @@ -1 +1 @@ -import{e as $,a as D,r as f,j as e,L as b,R as W,b as M}from"./index-BfD7YdLr.js";import{u as z}from"./useQuery-BQY3DH-b.js";import{P as G}from"./components-LTCBEq5x.js";import{u as J,P as X}from"./useIntersectionObserver-mJEWgLMQ.js";import{M as h}from"./MarkdownText-BmKXBVRs.js";import{t as Y,d as Z}from"./transform-DCLb4olr.js";import{c as ee}from"./usePapers-DrFoptcF.js";import{S as se}from"./skeleton-DlrhV-qs.js";import{A as ae,a as te}from"./alert-zXn954y8.js";import"./useBaseQuery-zm-nsmQ1.js";import"./LatexTitle-Dyu7ZW4B.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Dud2kyWl.js";import"./index-SnRTg719.js";import"./hover-card-Bp6412TC.js";import"./useInfiniteQuery-CVNt5m44.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ve=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=J({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(X,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ve as default}; +import{e as $,a as D,r as f,j as e,L as b,R as W,b as M}from"./index-Bn8Ob2yb.js";import{u as z}from"./useQuery-DdnDUe7s.js";import{P as G}from"./components-CmiCpieH.js";import{u as J,P as X}from"./useIntersectionObserver-odYwsx6w.js";import{M as h}from"./MarkdownText-DQLTyzIE.js";import{t as Y,d as Z}from"./transform-Z_GB05A-.js";import{c as ee}from"./usePapers-CQQdWWPS.js";import{S as se}from"./skeleton-DMgHDmV1.js";import{A as ae,a as te}from"./alert-ek_GWo6X.js";import"./useBaseQuery-DOoW3hTR.js";import"./LatexTitle-CCig7BhH.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-hLdU_QRR.js";import"./index-N_WymWS-.js";import"./hover-card-BMKmh3eo.js";import"./useInfiniteQuery-Be_M3qGu.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ve=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=J({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(X,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ve as default}; diff --git a/assets/ConferencesIndexView-gtHHJaQV.js b/assets/ConferencesIndexView-DiiMYBFz.js similarity index 86% rename from assets/ConferencesIndexView-gtHHJaQV.js rename to assets/ConferencesIndexView-DiiMYBFz.js index e8e98cdd500711598543142856163ac2882ba9c6..fb9109db05ee2ca2b5ae693cdac57256aa30402e 100644 --- a/assets/ConferencesIndexView-gtHHJaQV.js +++ b/assets/ConferencesIndexView-DiiMYBFz.js @@ -1 +1 @@ -import{r as p,j as e,L as d,b as u}from"./index-BfD7YdLr.js";import{u as h}from"./useQuery-BQY3DH-b.js";import{S as m}from"./skeleton-DlrhV-qs.js";import{A as f,a as g}from"./alert-zXn954y8.js";import{T as x}from"./TaxonomySuggestionTile-Cj81-tgl.js";import"./useBaseQuery-zm-nsmQ1.js";import"./SignInToEditDialog-DB0NqMGz.js";import"./button-CXFuJJQh.js";import"./textarea-DRF500G_.js";import"./dialog-CDRq9Z7X.js";import"./useMutation-BQa0xQql.js";import"./loader-circle-BQq8L_PA.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},y=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=p.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=v(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(y)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((s,i)=>e.jsx(m,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.reduce((l,o)=>l+(o.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default}; +import{r as p,j as e,L as d,b as u}from"./index-Bn8Ob2yb.js";import{u as h}from"./useQuery-DdnDUe7s.js";import{S as m}from"./skeleton-DMgHDmV1.js";import{A as f,a as g}from"./alert-ek_GWo6X.js";import{T as x}from"./TaxonomySuggestionTile-C_FUiSMg.js";import"./useBaseQuery-DOoW3hTR.js";import"./SignInToEditDialog-B6qsLc_U.js";import"./button-B1AjFwXv.js";import"./textarea-BIjKbX5f.js";import"./dialog-BBaz5Wr4.js";import"./useMutation-CkFxqrff.js";import"./loader-circle-CT-SvG9q.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},y=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=p.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=v(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(y)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((s,i)=>e.jsx(m,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.reduce((l,o)=>l+(o.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default}; diff --git a/assets/ContributionsPage-jUvwayNB.js b/assets/ContributionsPage-DVMwAad-.js similarity index 91% rename from assets/ContributionsPage-jUvwayNB.js rename to assets/ContributionsPage-DVMwAad-.js index 475de1beb0e58e3466b8f2ad5e9b4b29a04e198a..183aaa6c2a1aac67ab52f34c4a7e9c4ab38b2bcf 100644 --- a/assets/ContributionsPage-jUvwayNB.js +++ b/assets/ContributionsPage-DVMwAad-.js @@ -1 +1 @@ -import{f as o,j as t,b as n}from"./index-BfD7YdLr.js";import{u as c}from"./useInfiniteQuery-CVNt5m44.js";import{B as d}from"./button-CXFuJJQh.js";import"./useBaseQuery-zm-nsmQ1.js";const h=()=>{var r;const{user:s}=o(),a=c({queryKey:["contributions",s==null?void 0:s.username],queryFn:({pageParam:e})=>n.getMyContributions(e),initialPageParam:void 0,getNextPageParam:e=>e.next_cursor??void 0,enabled:!!(s!=null&&s.can_contribute)}),i=((r=a.data)==null?void 0:r.pages.flatMap(e=>e.events))??[];return s!=null&&s.can_contribute?t.jsxs("div",{className:"page max-w-5xl mx-auto px-4 py-8",children:[t.jsx("h1",{className:"text-3xl font-bold",children:"My contributions"}),t.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Private history for catalog changes made through your contributor account."}),a.isLoading&&t.jsx("p",{className:"mt-8",children:"Loading contributions…"}),a.error&&t.jsx("p",{className:"mt-8 text-destructive",children:"Could not load contribution history."}),t.jsxs("div",{className:"mt-6 space-y-3",children:[i.map(e=>t.jsxs("article",{className:"rounded-md border p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("strong",{children:[e.operation," ",e.entity_type]}),t.jsx("time",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),t.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e.entity_id," · ",e.id]}),t.jsxs("details",{className:"mt-3 text-xs",children:[t.jsx("summary",{children:"Before / after"}),t.jsx("pre",{className:"mt-2 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:e.before,after:e.after},null,2)})]})]},e.id)),a.data&&i.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No direct edits yet."}),a.hasNextPage&&t.jsx(d,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older contributions"})]})]}):t.jsxs("div",{className:"page",children:[t.jsx("h1",{children:"Contributions"}),t.jsx("p",{children:"This history is available to project contributors and admins."})]})};export{h as default}; +import{f as o,j as t,b as n}from"./index-Bn8Ob2yb.js";import{u as c}from"./useInfiniteQuery-Be_M3qGu.js";import{B as d}from"./button-B1AjFwXv.js";import"./useBaseQuery-DOoW3hTR.js";const h=()=>{var r;const{user:s}=o(),a=c({queryKey:["contributions",s==null?void 0:s.username],queryFn:({pageParam:e})=>n.getMyContributions(e),initialPageParam:void 0,getNextPageParam:e=>e.next_cursor??void 0,enabled:!!(s!=null&&s.can_contribute)}),i=((r=a.data)==null?void 0:r.pages.flatMap(e=>e.events))??[];return s!=null&&s.can_contribute?t.jsxs("div",{className:"page max-w-5xl mx-auto px-4 py-8",children:[t.jsx("h1",{className:"text-3xl font-bold",children:"My contributions"}),t.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Private history for catalog changes made through your contributor account."}),a.isLoading&&t.jsx("p",{className:"mt-8",children:"Loading contributions…"}),a.error&&t.jsx("p",{className:"mt-8 text-destructive",children:"Could not load contribution history."}),t.jsxs("div",{className:"mt-6 space-y-3",children:[i.map(e=>t.jsxs("article",{className:"rounded-md border p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("strong",{children:[e.operation," ",e.entity_type]}),t.jsx("time",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),t.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e.entity_id," · ",e.id]}),t.jsxs("details",{className:"mt-3 text-xs",children:[t.jsx("summary",{children:"Before / after"}),t.jsx("pre",{className:"mt-2 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:e.before,after:e.after},null,2)})]})]},e.id)),a.data&&i.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No direct edits yet."}),a.hasNextPage&&t.jsx(d,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older contributions"})]})]}):t.jsxs("div",{className:"page",children:[t.jsx("h1",{children:"Contributions"}),t.jsx("p",{children:"This history is available to project contributors and admins."})]})};export{h as default}; diff --git a/assets/CronDashboard-B5sdItZ8.js b/assets/CronDashboard-CzCV7fD-.js similarity index 98% rename from assets/CronDashboard-B5sdItZ8.js rename to assets/CronDashboard-CzCV7fD-.js index 9675d05aa68b7bac0fbf088969d2e551b60c0d50..f6a3680a64ffddca59a983b6a8c0f319806f591e 100644 --- a/assets/CronDashboard-B5sdItZ8.js +++ b/assets/CronDashboard-CzCV7fD-.js @@ -1,4 +1,4 @@ -import{c as y,r as x,j as e,v,O as Le,o as Me,n as O,a5 as Pe,Q as Fe,S as Ae,q as z,P as Ee,t as De,T as ae,L as qe,h as Ie,b as M,f as Je}from"./index-BfD7YdLr.js";import{u as I}from"./useQuery-BQY3DH-b.js";import{B as _,D as G,f as He}from"./codexAddEvals-BFPddk7M.js";import{B as P}from"./button-CXFuJJQh.js";import{C as Oe}from"./chevron-down-BBJrk-Yf.js";import{C as J,a as W,R as X,S as Ue}from"./shield-alert-BRNRcGFf.js";import{L as R}from"./loader-circle-BQq8L_PA.js";import{E as re}from"./external-link-lQRIh-Se.js";import{u as Z}from"./useMutation-BQa0xQql.js";import{u as ze}from"./useInfiniteQuery-CVNt5m44.js";import"./useBaseQuery-zm-nsmQ1.js";/** +import{c as y,r as x,j as e,v,O as Le,o as Me,n as O,a5 as Pe,Q as Fe,S as Ae,q as z,P as Ee,t as De,T as ae,L as qe,h as Ie,b as M,f as Je}from"./index-Bn8Ob2yb.js";import{u as I}from"./useQuery-DdnDUe7s.js";import{B as _,D as G,f as He}from"./codexAddEvals-C5IxXnlq.js";import{B as P}from"./button-B1AjFwXv.js";import{C as Oe}from"./chevron-down-BfIRuwQd.js";import{C as J,a as W,R as X,S as Ue}from"./shield-alert-vXFVjesh.js";import{L as R}from"./loader-circle-CT-SvG9q.js";import{E as re}from"./external-link-DEYzZhKb.js";import{u as Z}from"./useMutation-CkFxqrff.js";import{u as ze}from"./useInfiniteQuery-Be_M3qGu.js";import"./useBaseQuery-DOoW3hTR.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ExternalSourceEvalBadge-C0AdjeMr.js b/assets/ExternalSourceEvalBadge-C_nXOup9.js similarity index 92% rename from assets/ExternalSourceEvalBadge-C0AdjeMr.js rename to assets/ExternalSourceEvalBadge-C_nXOup9.js index 9413ae43756c7a4cafe6a4e720a33b39ed38d9b1..cc32e546154b4c3e5c0b1bd131082f9c03429be6 100644 --- a/assets/ExternalSourceEvalBadge-C0AdjeMr.js +++ b/assets/ExternalSourceEvalBadge-C_nXOup9.js @@ -1 +1 @@ -import{j as e,L as l}from"./index-BfD7YdLr.js";import{H as t,a as n,b as o}from"./hover-card-Bp6412TC.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E}; +import{j as e,L as l}from"./index-Bn8Ob2yb.js";import{H as t,a as n,b as o}from"./hover-card-BMKmh3eo.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E}; diff --git a/assets/FeedView-DmnQ8wtZ.js b/assets/FeedView-BQgIGsx_.js similarity index 91% rename from assets/FeedView-DmnQ8wtZ.js rename to assets/FeedView-BQgIGsx_.js index 671a52ee044d91704075dc63224a4128dd7f4a4b..f8f0f0d0a667c2d31a67cc01d7b51cb9a6b7c230 100644 --- a/assets/FeedView-DmnQ8wtZ.js +++ b/assets/FeedView-BQgIGsx_.js @@ -1 +1 @@ -import{u as O,r as u,j as e,a as H,L as N,i as F,b as S}from"./index-BfD7YdLr.js";import{P as I}from"./components-LTCBEq5x.js";import{u as q,P as U}from"./useIntersectionObserver-mJEWgLMQ.js";import{D as $,M as K,F as B,A as W,q as G,c as z}from"./chatSessions-Dl4MrfBi.js";import{S as _}from"./chatPrompts-CDY3UGU1.js";import{t as Q,d as E}from"./transform-DCLb4olr.js";import{u as V}from"./usePapers-DrFoptcF.js";import{P as X}from"./usePeriodFilter-Coc3diQT.js";import{S as g}from"./skeleton-DlrhV-qs.js";import{A as Y,a as J}from"./alert-zXn954y8.js";import{u as L}from"./useQuery-BQY3DH-b.js";import"./LatexTitle-Dyu7ZW4B.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CVNt5m44.js";import"./useBaseQuery-zm-nsmQ1.js";const Z=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},se={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},k=45,te=1800,ae=25,ie=350,re=a=>{const[r,m]=u.useState(_[0].slice(0,1));return u.useEffect(()=>{var p,f;if(!a)return;if((f=(p=window.matchMedia)==null?void 0:p.call(window,"(prefers-reduced-motion: reduce)"))!=null&&f.matches){m(_[0]);return}let o=0,n=1,l=!1,c;m(_[0].slice(0,n));const h=()=>{const i=_[o];if(!l){if(n+=1,m(i.slice(0,n)),n===i.length){l=!0,c=window.setTimeout(h,te);return}c=window.setTimeout(h,k);return}if(n-=1,m(i.slice(0,n)),n===0){l=!1,o=(o+1)%_.length,c=window.setTimeout(h,ie);return}c=window.setTimeout(h,ae)};return c=window.setTimeout(h,k),()=>window.clearTimeout(c)},[a]),r},ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",oe=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",le=()=>{const a=O(),[r,m]=u.useState(""),[o,n]=u.useState($),[l,c]=u.useState(!1),h=re(!r),p=u.useRef(null);u.useEffect(()=>{const i=p.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,160)}px`)},[r]);const f=async(i=r)=>{const j=i.trim();if(!(!j||l)){c(!0),G(j,o);try{const x=await z(o);a(`/chat/${x.id}`)}catch{a("/chat")}}};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:p,rows:1,value:r,placeholder:h,"aria-label":"Ask the assistant",disabled:l,onChange:i=>m(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),f())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(K,{models:B,selectedModel:o,onModelChange:n}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${r.trim()?" chat-send-on":""}`,onClick:()=>f(),disabled:!r.trim()||l,"aria-label":"Ask the assistant",children:e.jsx(W,{})})]})]})},we=()=>{var T,w,v,P,A;const[a,r]=H(),m=ne(a.get("order_by")),o=oe(a.get("time")),n=a.get("has_code")==="true",l=a.get("has_hf_artifacts")==="true",c=se[o],h=s=>{const t=new URLSearchParams(a);t.set("order_by",s),r(t)},p=s=>{const t=new URLSearchParams(a);t.set("time",ee[s]),r(t)},f=s=>{const t=new URLSearchParams(a);s?t.set("has_code","true"):t.delete("has_code"),r(t)},i=s=>{const t=new URLSearchParams(a);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},j=L({queryKey:["top-tasks-sidebar"],queryFn:()=>S.getTopTasks({limit:8}),staleTime:10*60*1e3}),x=L({queryKey:["trending-tasks-sidebar"],queryFn:()=>S.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),d=V({page_size:30,order_by:m,order_dir:"desc",time:o,include_resources:!0,has_code:n,has_hf_artifacts:l}),y=u.useMemo(()=>{var t;return(((t=d.data)==null?void 0:t.pages.flatMap(R=>R.results))||[]).map(Q)},[d.data]),{targetRef:C,isIntersecting:b}=q({rootMargin:"400px"});u.useEffect(()=>{b&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[b,d.hasNextPage,d.isFetchingNextPage]);const M=d.isLoading,D=d.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(g,{className:"h-5 w-full"},t))}),(T=j.data)==null?void 0:T.map(s=>e.jsxs(N,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[E(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(N,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(g,{className:"h-5 w-full"},t))}),((v=(w=x.data)==null?void 0:w.results)==null?void 0:v.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(P=x.data)==null?void 0:P.results)==null?void 0:A.map(s=>e.jsxs(N,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[E(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[F()&&e.jsx(le,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Z.map(([s,t])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>h(s),children:t},s))}),e.jsx(U,{hasCode:n,hasHfArtifacts:l,onHasCodeChange:f,onHasHfArtifactsChange:i})]}),e.jsx("div",{className:"sort-options sort-options-time",children:X.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${c===s?"active":""}`,onClick:()=>p(s),children:s},s))})]}),D&&e.jsx(Y,{variant:"destructive",className:"mb-4",children:e.jsx(J,{children:"Failed to load papers. Please try again."})}),M?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(g,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(g,{className:"h-6 w-3/4"}),e.jsx(g,{className:"h-4 w-1/2"}),e.jsx(g,{className:"h-12 w-full"})]})]},t))}):y.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,t)=>e.jsx(I,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:C,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{le as AskAssistant,we as default}; +import{u as O,r as u,j as e,a as H,L as N,i as F,b as S}from"./index-Bn8Ob2yb.js";import{P as I}from"./components-CmiCpieH.js";import{u as q,P as U}from"./useIntersectionObserver-odYwsx6w.js";import{D as $,M as K,F as B,A as W,q as G,c as z}from"./chatSessions-CJGL67ci.js";import{S as _}from"./chatPrompts-CDY3UGU1.js";import{t as Q,d as E}from"./transform-Z_GB05A-.js";import{u as V}from"./usePapers-CQQdWWPS.js";import{P as X}from"./usePeriodFilter-DFtHY8n2.js";import{S as g}from"./skeleton-DMgHDmV1.js";import{A as Y,a as J}from"./alert-ek_GWo6X.js";import{u as L}from"./useQuery-DdnDUe7s.js";import"./LatexTitle-CCig7BhH.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-Be_M3qGu.js";import"./useBaseQuery-DOoW3hTR.js";const Z=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},se={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},k=45,te=1800,ae=25,ie=350,re=a=>{const[r,m]=u.useState(_[0].slice(0,1));return u.useEffect(()=>{var p,f;if(!a)return;if((f=(p=window.matchMedia)==null?void 0:p.call(window,"(prefers-reduced-motion: reduce)"))!=null&&f.matches){m(_[0]);return}let o=0,n=1,l=!1,c;m(_[0].slice(0,n));const h=()=>{const i=_[o];if(!l){if(n+=1,m(i.slice(0,n)),n===i.length){l=!0,c=window.setTimeout(h,te);return}c=window.setTimeout(h,k);return}if(n-=1,m(i.slice(0,n)),n===0){l=!1,o=(o+1)%_.length,c=window.setTimeout(h,ie);return}c=window.setTimeout(h,ae)};return c=window.setTimeout(h,k),()=>window.clearTimeout(c)},[a]),r},ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",oe=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",le=()=>{const a=O(),[r,m]=u.useState(""),[o,n]=u.useState($),[l,c]=u.useState(!1),h=re(!r),p=u.useRef(null);u.useEffect(()=>{const i=p.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,160)}px`)},[r]);const f=async(i=r)=>{const j=i.trim();if(!(!j||l)){c(!0),G(j,o);try{const x=await z(o);a(`/chat/${x.id}`)}catch{a("/chat")}}};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:p,rows:1,value:r,placeholder:h,"aria-label":"Ask the assistant",disabled:l,onChange:i=>m(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),f())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(K,{models:B,selectedModel:o,onModelChange:n}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${r.trim()?" chat-send-on":""}`,onClick:()=>f(),disabled:!r.trim()||l,"aria-label":"Ask the assistant",children:e.jsx(W,{})})]})]})},we=()=>{var T,w,v,P,A;const[a,r]=H(),m=ne(a.get("order_by")),o=oe(a.get("time")),n=a.get("has_code")==="true",l=a.get("has_hf_artifacts")==="true",c=se[o],h=s=>{const t=new URLSearchParams(a);t.set("order_by",s),r(t)},p=s=>{const t=new URLSearchParams(a);t.set("time",ee[s]),r(t)},f=s=>{const t=new URLSearchParams(a);s?t.set("has_code","true"):t.delete("has_code"),r(t)},i=s=>{const t=new URLSearchParams(a);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},j=L({queryKey:["top-tasks-sidebar"],queryFn:()=>S.getTopTasks({limit:8}),staleTime:10*60*1e3}),x=L({queryKey:["trending-tasks-sidebar"],queryFn:()=>S.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),d=V({page_size:30,order_by:m,order_dir:"desc",time:o,include_resources:!0,has_code:n,has_hf_artifacts:l}),y=u.useMemo(()=>{var t;return(((t=d.data)==null?void 0:t.pages.flatMap(R=>R.results))||[]).map(Q)},[d.data]),{targetRef:C,isIntersecting:b}=q({rootMargin:"400px"});u.useEffect(()=>{b&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[b,d.hasNextPage,d.isFetchingNextPage]);const M=d.isLoading,D=d.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(g,{className:"h-5 w-full"},t))}),(T=j.data)==null?void 0:T.map(s=>e.jsxs(N,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[E(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(N,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(g,{className:"h-5 w-full"},t))}),((v=(w=x.data)==null?void 0:w.results)==null?void 0:v.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(P=x.data)==null?void 0:P.results)==null?void 0:A.map(s=>e.jsxs(N,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[E(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[F()&&e.jsx(le,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Z.map(([s,t])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>h(s),children:t},s))}),e.jsx(U,{hasCode:n,hasHfArtifacts:l,onHasCodeChange:f,onHasHfArtifactsChange:i})]}),e.jsx("div",{className:"sort-options sort-options-time",children:X.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${c===s?"active":""}`,onClick:()=>p(s),children:s},s))})]}),D&&e.jsx(Y,{variant:"destructive",className:"mb-4",children:e.jsx(J,{children:"Failed to load papers. Please try again."})}),M?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(g,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(g,{className:"h-6 w-3/4"}),e.jsx(g,{className:"h-4 w-1/2"}),e.jsx(g,{className:"h-12 w-full"})]})]},t))}):y.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,t)=>e.jsx(I,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:C,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{le as AskAssistant,we as default}; diff --git a/assets/FrameworksIndexView-BcHuX_Fi.js b/assets/FrameworksIndexView-BkdoKfPD.js similarity index 93% rename from assets/FrameworksIndexView-BcHuX_Fi.js rename to assets/FrameworksIndexView-BkdoKfPD.js index 8e814cde8ff98b961617cec73c9fcefeff708666..67006535c2dba41491f1e80162dca675c83fe50f 100644 --- a/assets/FrameworksIndexView-BcHuX_Fi.js +++ b/assets/FrameworksIndexView-BkdoKfPD.js @@ -1 +1 @@ -import{u as d,j as e,L as o,R as m,b as p}from"./index-BfD7YdLr.js";import{u as h}from"./useQuery-BQY3DH-b.js";import{I as u}from"./components-LTCBEq5x.js";import{c as g,h as f}from"./transform-DCLb4olr.js";import"./useBaseQuery-zm-nsmQ1.js";import"./LatexTitle-Dyu7ZW4B.js";import"./katex.min-BSBacQyE.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(u,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},B=()=>{var a;const r=h({queryKey:["framework-catalog"],queryFn:()=>p.getFrameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,B as default}; +import{u as d,j as e,L as o,R as m,b as p}from"./index-Bn8Ob2yb.js";import{u as h}from"./useQuery-DdnDUe7s.js";import{I as u}from"./components-CmiCpieH.js";import{c as g,h as f}from"./transform-Z_GB05A-.js";import"./useBaseQuery-DOoW3hTR.js";import"./LatexTitle-CCig7BhH.js";import"./katex.min-BSBacQyE.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(u,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},B=()=>{var a;const r=h({queryKey:["framework-catalog"],queryFn:()=>p.getFrameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,B as default}; diff --git a/assets/LatexTitle-Dyu7ZW4B.js b/assets/LatexTitle-CCig7BhH.js similarity index 98% rename from assets/LatexTitle-Dyu7ZW4B.js rename to assets/LatexTitle-CCig7BhH.js index a79966ae9a909bba244cf10e47560b04cd4bd8bd..05f2fe8e99e92d644ed0e9d98d1580c4d6b9b7f5 100644 --- a/assets/LatexTitle-Dyu7ZW4B.js +++ b/assets/LatexTitle-CCig7BhH.js @@ -1 +1 @@ -import{j as o,r as g}from"./index-BfD7YdLr.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)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)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`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;ii&&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}; +import{j as o,r as g}from"./index-Bn8Ob2yb.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)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)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`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;ii&&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}; diff --git a/assets/MarkdownText-BmKXBVRs.js b/assets/MarkdownText-DQLTyzIE.js similarity index 84% rename from assets/MarkdownText-BmKXBVRs.js rename to assets/MarkdownText-DQLTyzIE.js index 1b6c430472e299da601c63f18489e861b376598c..b67c96d8e1e710bfd7254b44132bba4d3ada6e87 100644 --- a/assets/MarkdownText-BmKXBVRs.js +++ b/assets/MarkdownText-DQLTyzIE.js @@ -1 +1 @@ -import{Y as l,j as s,L as u}from"./index-BfD7YdLr.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-Dud2kyWl.js";import{M as d,r as w}from"./index-SnRTg719.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M}; +import{Y as l,j as s,L as u}from"./index-Bn8Ob2yb.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-hLdU_QRR.js";import{M as d,r as w}from"./index-N_WymWS-.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M}; diff --git a/assets/MethodDetailView-BjNLNMvJ.js b/assets/MethodDetailView-CHwxmkDT.js similarity index 96% rename from assets/MethodDetailView-BjNLNMvJ.js rename to assets/MethodDetailView-CHwxmkDT.js index 4b205bbd45c811b7cb7333d046665cb549d73e78..fa8cc12553dac026ad35db1dd7ff85446b641db0 100644 --- a/assets/MethodDetailView-BjNLNMvJ.js +++ b/assets/MethodDetailView-CHwxmkDT.js @@ -1 +1 @@ -import{j as e,r as E,e as W,a as V,L as R,b as v,ao as Z}from"./index-BfD7YdLr.js";import{u as A}from"./useQuery-BQY3DH-b.js";import{u as X}from"./useInfiniteQuery-CVNt5m44.js";import{M as Y,P as J}from"./components-LTCBEq5x.js";import{u as ee,P as te}from"./useIntersectionObserver-mJEWgLMQ.js";import{M as H}from"./MarkdownText-BmKXBVRs.js";import{s as se}from"./slug-BpH-Nkvz.js";import{t as ae}from"./transform-DCLb4olr.js";import{S as M}from"./skeleton-DlrhV-qs.js";import{A as ie,a as re}from"./alert-zXn954y8.js";import"./useBaseQuery-zm-nsmQ1.js";import"./LatexTitle-Dyu7ZW4B.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Dud2kyWl.js";import"./index-SnRTg719.js";import"./hover-card-Bp6412TC.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"},g=({x:s,y:a,w:i,h:r,fill:f,stroke:j,label:p,fontSize:c=10,multiline:y})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:a,width:i,height:r,rx:"3",ry:"3",fill:f,stroke:j,strokeWidth:"1"}),y?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:s+i/2,y:a+r/2-2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[0]}),e.jsx("text",{x:s+i/2,y:a+r/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[1]})]}):e.jsx("text",{x:s+i/2,y:a+r/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:p})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(g,{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(g,{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(g,{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(g,{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(g,{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(g,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(g,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(g,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const a=30+s*75,i=60-s*8,r=240-s*30;return e.jsx("g",{children:e.jsx("rect",{x:a,y:(420-r)/2,width:i,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][s],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][s],strokeWidth:"1"})},s)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:50,y:i,width:r,height:f,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${s}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:210,y:i,width:r,height:f,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${s}`)}),[0,1,2,3].map(s=>{const a=60+s*80+(50-s*6)/2,i=50+(100-s*12);return e.jsx("path",{d:`M${i} ${a} L210 ${a}`,stroke:t.faint,strokeDasharray:"4 3"},`s${s}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),le=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(s=>[0,1,2].map(a=>e.jsx("rect",{x:20+a*40,y:40+s*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][s*3+a],stroke:t.faint},`${s}-${a}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(g,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(g,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(g,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(g,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(s=>{const a=25+s*56,i=(5-s)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:a,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-i*.1} 0.04 250)`,stroke:t.faint}),i<.4&&e.jsx("circle",{cx:a+25,cy:115,r:12-i*16,fill:t.orange,opacity:1-i*1.5})]},s)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),oe=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),de.map(([s,a],i)=>{const r=92+i*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),a?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:a}):null]},s)})]}),xe={attention:G,"self-attention":G,cnn:ne,"u-net":q,unet:q,vit:le,diffusion:O,ddpm:O,gan:oe,vae:ce,"agent-skills":he},me=({method:s})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(g,{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(g,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(g,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),fe=({method:s})=>{const a=(s.slug||"").toLowerCase(),i=xe[a];if(i)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(i,{})});if(s.image_url){const r=a==="transformer"||a==="gpt-4"||a==="gpt-4o"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${r}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(me,{method:s})})},L=720,C=138,u={top:8,right:10,bottom:25,left:36},U=56,ge=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),pe=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=s=>ge.format(new Date(`${s}T00:00:00Z`)),ue=(s,a)=>{if(s===0)return new Set;const i=s>48?12:s>36?6:s>18?3:2,r=Math.max(1,Math.ceil(U/a)),f=Math.max(i,r),j=s-1,p=new Set([0,j]);for(let c=f;c=U&&p.add(c);return p},K=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const a=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${a}`},je=({history:s,methodName:a})=>{const[i,r]=E.useState(null),f=Math.max(1,...s.map(n=>n.paper_count)),j=L-u.left-u.right,p=C-u.top-u.bottom,c=s.length?j/s.length:j,y=Math.max(2,c*.68),d=ue(s.length,c),z=Array.from(new Set([0,Math.ceil(f/2),f])),x=i==null?null:s[i],S=x?K(x):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${L} ${C}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),z.map(n=>{const m=u.top+p-n/f*p;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:L-u.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:m+3,textAnchor:"end",children:n})]},n)}),s.map((n,m)=>{const k=n.paper_count/f*p,b=n.paper_count>0?Math.max(1,k):0,F=u.left+c*m+(c-y)/2,l=u.top+p-b,_=i===m,N=m===s.length-1,w=K(n);return e.jsxs("g",{className:`method-usage-bar${_?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(n.start_date)}: ${n.paper_count} ${n.paper_count===1?"paper":"papers"}${w?`. ${w}`:""}`,onMouseEnter:()=>r(m),onMouseLeave:()=>r(null),onFocus:()=>r(m),onBlur:()=>r(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+c*m,y:u.top,width:c,height:p}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:l,width:y,height:b,rx:"1.5"})]},n.start_date)}),s.map((n,m)=>d.has(m)?e.jsx("text",{className:"method-usage-x-label",x:u.left+c*(m+.5),y:C-11,textAnchor:"middle",children:s.length>48?pe.format(new Date(`${n.start_date}T00:00:00Z`)):B(n.start_date)},n.start_date):null)]}),x&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(x.start_date)}),e.jsxs("span",{children:[x.paper_count," ",x.paper_count===1?"paper":"papers",i===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(x.catalog_share??0).toFixed(2),"% of"," ",(x.catalog_paper_count??0).toLocaleString()," catalog papers"]}),S&&e.jsx("span",{children:S})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Q={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},$e=()=>{var N,w,$,P,T,I;const{methodSlug:s}=W(),[a,i]=V(),[r,f]=E.useState("trending"),j=a.get("has_code")==="true",p=a.get("has_hf_artifacts")==="true",c=o=>{const h=new URLSearchParams(a);o?h.set("has_code","true"):h.delete("has_code"),i(h)},y=o=>{const h=new URLSearchParams(a);o?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),i(h)},d=A({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),z=A({queryKey:["areas-all"],queryFn:()=>v.getAreas({page_size:50,ordering:"name"}),enabled:!!((N=d.data)!=null&&N.area_id),staleTime:10*60*1e3}),x=A({queryKey:["method-trend",s],queryFn:()=>v.getMethodTrend(s),enabled:!!s&&!!d.data,staleTime:10*60*1e3}),S=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",n=X({queryKey:["method-papers-infinite",s,S,j,p],queryFn:({pageParam:o=1})=>v.getMethodPapers(s,{page:o,page_size:20,order_by:S,order_dir:"desc",include_resources:!0,has_code:j,has_hf_artifacts:p}),getNextPageParam:o=>o.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Z}),m=A({queryKey:["related-methods",(w=d.data)==null?void 0:w.slug,($=d.data)==null?void 0:$.area_id,(P=d.data)==null?void 0:P.id],queryFn:async()=>{const o=Q[d.data.slug];return o?Promise.all(o.map(D=>v.getMethod(D))):(await v.getMethods({area_id:d.data.area_id,exclude_id:d.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!d.data&&(!!Q[d.data.slug]||!!d.data.area_id),staleTime:10*60*1e3}),k=E.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(D=>D.results))||[]).map(ae)},[n.data]),{targetRef:b,isIntersecting:F}=ee({rootMargin:"200px"});if(E.useEffect(()=>{F&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[F,n.hasNextPage,n.isFetchingNextPage]),d.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(re,{children:"Method not found."})})});const l=d.data,_=(T=z.data)==null?void 0:T.results.find(o=>o.id===l.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(R,{to:"/methods",children:"Methods"}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(R,{to:`/methods#area-${se(_.name)}`,children:_.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:l.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${l.slug==="grokking"||l.slug==="latent-reasoning"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:l.name}),l.full_name&&l.full_name!==l.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:l.full_name}),l.description&&e.jsx(H,{className:"method-description",text:l.description}),l.source_url&&l.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:l.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:l.source_title}),l.introduced_year&&e.jsx("span",{className:"method-source-meta",children:l.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(l.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[x.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]})]}),l.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:l.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(je,{history:x.data.history,methodName:l.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(fe,{method:l}),l.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:l.image_credit})})]})]}),(((I=m.data)==null?void 0:I.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(o=>e.jsx(Y,{method:{slug:o.slug,name:o.name}},o.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([o,h])=>e.jsx("button",{className:`sort-btn ${r===o?"active":""}`,onClick:()=>f(o),children:h},o))}),e.jsx(te,{hasCode:j,hasHfArtifacts:p,onHasCodeChange:c,onHasHfArtifactsChange:y})]}),e.jsxs("div",{className:"results-count",children:[k.length," papers mentioning ",l.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((o,h)=>e.jsx(M,{className:"h-40 w-full"},h))}):k.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:k.map((o,h)=>e.jsx(J,{paper:o,rank:h+1},o.id))}),e.jsx("div",{ref:b,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{$e as default}; +import{j as e,r as E,e as W,a as V,L as R,b as v,ao as Z}from"./index-Bn8Ob2yb.js";import{u as A}from"./useQuery-DdnDUe7s.js";import{u as X}from"./useInfiniteQuery-Be_M3qGu.js";import{M as Y,P as J}from"./components-CmiCpieH.js";import{u as ee,P as te}from"./useIntersectionObserver-odYwsx6w.js";import{M as H}from"./MarkdownText-DQLTyzIE.js";import{s as se}from"./slug-BpH-Nkvz.js";import{t as ae}from"./transform-Z_GB05A-.js";import{S as M}from"./skeleton-DMgHDmV1.js";import{A as ie,a as re}from"./alert-ek_GWo6X.js";import"./useBaseQuery-DOoW3hTR.js";import"./LatexTitle-CCig7BhH.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-hLdU_QRR.js";import"./index-N_WymWS-.js";import"./hover-card-BMKmh3eo.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"},g=({x:s,y:a,w:i,h:r,fill:f,stroke:j,label:p,fontSize:c=10,multiline:y})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:a,width:i,height:r,rx:"3",ry:"3",fill:f,stroke:j,strokeWidth:"1"}),y?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:s+i/2,y:a+r/2-2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[0]}),e.jsx("text",{x:s+i/2,y:a+r/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:y[1]})]}):e.jsx("text",{x:s+i/2,y:a+r/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:p})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(g,{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(g,{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(g,{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(g,{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(g,{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(g,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(g,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(g,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const a=30+s*75,i=60-s*8,r=240-s*30;return e.jsx("g",{children:e.jsx("rect",{x:a,y:(420-r)/2,width:i,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][s],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][s],strokeWidth:"1"})},s)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:50,y:i,width:r,height:f,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${s}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(s=>{const i=60+s*80,r=100-s*12,f=50-s*6;return e.jsx("rect",{x:210,y:i,width:r,height:f,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${s}`)}),[0,1,2,3].map(s=>{const a=60+s*80+(50-s*6)/2,i=50+(100-s*12);return e.jsx("path",{d:`M${i} ${a} L210 ${a}`,stroke:t.faint,strokeDasharray:"4 3"},`s${s}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),le=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(s=>[0,1,2].map(a=>e.jsx("rect",{x:20+a*40,y:40+s*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][s*3+a],stroke:t.faint},`${s}-${a}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(g,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(g,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(g,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(g,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(s=>{const a=25+s*56,i=(5-s)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:a,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-i*.1} 0.04 250)`,stroke:t.faint}),i<.4&&e.jsx("circle",{cx:a+25,cy:115,r:12-i*16,fill:t.orange,opacity:1-i*1.5})]},s)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),oe=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),de.map(([s,a],i)=>{const r=92+i*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),a?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:a}):null]},s)})]}),xe={attention:G,"self-attention":G,cnn:ne,"u-net":q,unet:q,vit:le,diffusion:O,ddpm:O,gan:oe,vae:ce,"agent-skills":he},me=({method:s})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(g,{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(g,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(g,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),fe=({method:s})=>{const a=(s.slug||"").toLowerCase(),i=xe[a];if(i)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(i,{})});if(s.image_url){const r=a==="transformer"||a==="gpt-4"||a==="gpt-4o"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${r}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(me,{method:s})})},L=720,C=138,u={top:8,right:10,bottom:25,left:36},U=56,ge=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),pe=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=s=>ge.format(new Date(`${s}T00:00:00Z`)),ue=(s,a)=>{if(s===0)return new Set;const i=s>48?12:s>36?6:s>18?3:2,r=Math.max(1,Math.ceil(U/a)),f=Math.max(i,r),j=s-1,p=new Set([0,j]);for(let c=f;c=U&&p.add(c);return p},K=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const a=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${a}`},je=({history:s,methodName:a})=>{const[i,r]=E.useState(null),f=Math.max(1,...s.map(n=>n.paper_count)),j=L-u.left-u.right,p=C-u.top-u.bottom,c=s.length?j/s.length:j,y=Math.max(2,c*.68),d=ue(s.length,c),z=Array.from(new Set([0,Math.ceil(f/2),f])),x=i==null?null:s[i],S=x?K(x):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${L} ${C}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),z.map(n=>{const m=u.top+p-n/f*p;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:L-u.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:m+3,textAnchor:"end",children:n})]},n)}),s.map((n,m)=>{const k=n.paper_count/f*p,b=n.paper_count>0?Math.max(1,k):0,F=u.left+c*m+(c-y)/2,l=u.top+p-b,_=i===m,N=m===s.length-1,w=K(n);return e.jsxs("g",{className:`method-usage-bar${_?" is-active":""}${N?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(n.start_date)}: ${n.paper_count} ${n.paper_count===1?"paper":"papers"}${w?`. ${w}`:""}`,onMouseEnter:()=>r(m),onMouseLeave:()=>r(null),onFocus:()=>r(m),onBlur:()=>r(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+c*m,y:u.top,width:c,height:p}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:l,width:y,height:b,rx:"1.5"})]},n.start_date)}),s.map((n,m)=>d.has(m)?e.jsx("text",{className:"method-usage-x-label",x:u.left+c*(m+.5),y:C-11,textAnchor:"middle",children:s.length>48?pe.format(new Date(`${n.start_date}T00:00:00Z`)):B(n.start_date)},n.start_date):null)]}),x&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(x.start_date)}),e.jsxs("span",{children:[x.paper_count," ",x.paper_count===1?"paper":"papers",i===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(x.catalog_share??0).toFixed(2),"% of"," ",(x.catalog_paper_count??0).toLocaleString()," catalog papers"]}),S&&e.jsx("span",{children:S})]})]})},ye=[["trending","trending"],["new","newest"],["cited","most cited"]],Q={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},$e=()=>{var N,w,$,P,T,I;const{methodSlug:s}=W(),[a,i]=V(),[r,f]=E.useState("trending"),j=a.get("has_code")==="true",p=a.get("has_hf_artifacts")==="true",c=o=>{const h=new URLSearchParams(a);o?h.set("has_code","true"):h.delete("has_code"),i(h)},y=o=>{const h=new URLSearchParams(a);o?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),i(h)},d=A({queryKey:["method",s],queryFn:()=>v.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),z=A({queryKey:["areas-all"],queryFn:()=>v.getAreas({page_size:50,ordering:"name"}),enabled:!!((N=d.data)!=null&&N.area_id),staleTime:10*60*1e3}),x=A({queryKey:["method-trend",s],queryFn:()=>v.getMethodTrend(s),enabled:!!s&&!!d.data,staleTime:10*60*1e3}),S=r==="trending"?"trending":r==="cited"?"citation_count":"date_published",n=X({queryKey:["method-papers-infinite",s,S,j,p],queryFn:({pageParam:o=1})=>v.getMethodPapers(s,{page:o,page_size:20,order_by:S,order_dir:"desc",include_resources:!0,has_code:j,has_hf_artifacts:p}),getNextPageParam:o=>o.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Z}),m=A({queryKey:["related-methods",(w=d.data)==null?void 0:w.slug,($=d.data)==null?void 0:$.area_id,(P=d.data)==null?void 0:P.id],queryFn:async()=>{const o=Q[d.data.slug];return o?Promise.all(o.map(D=>v.getMethod(D))):(await v.getMethods({area_id:d.data.area_id,exclude_id:d.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!d.data&&(!!Q[d.data.slug]||!!d.data.area_id),staleTime:10*60*1e3}),k=E.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(D=>D.results))||[]).map(ae)},[n.data]),{targetRef:b,isIntersecting:F}=ee({rootMargin:"200px"});if(E.useEffect(()=>{F&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[F,n.hasNextPage,n.isFetchingNextPage]),d.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(d.error||!d.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(re,{children:"Method not found."})})});const l=d.data,_=(T=z.data)==null?void 0:T.results.find(o=>o.id===l.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(R,{to:"/methods",children:"Methods"}),_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(R,{to:`/methods#area-${se(_.name)}`,children:_.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:l.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${l.slug==="grokking"||l.slug==="latent-reasoning"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:l.name}),l.full_name&&l.full_name!==l.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:l.full_name}),l.description&&e.jsx(H,{className:"method-description",text:l.description}),l.source_url&&l.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:l.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:l.source_title}),l.introduced_year&&e.jsx("span",{className:"method-source-meta",children:l.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(l.paper_count??0).toLocaleString()})]}),x.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[x.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]})]}),l.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:l.introduced_year})]})]}),x.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):x.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:x.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",x.data.recent_days,"d"]})]})]}),e.jsx(je,{history:x.data.history,methodName:l.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(fe,{method:l}),l.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:l.image_credit})})]})]}),(((I=m.data)==null?void 0:I.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(o=>e.jsx(Y,{method:{slug:o.slug,name:o.name}},o.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ye.map(([o,h])=>e.jsx("button",{className:`sort-btn ${r===o?"active":""}`,onClick:()=>f(o),children:h},o))}),e.jsx(te,{hasCode:j,hasHfArtifacts:p,onHasCodeChange:c,onHasHfArtifactsChange:y})]}),e.jsxs("div",{className:"results-count",children:[k.length," papers mentioning ",l.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((o,h)=>e.jsx(M,{className:"h-40 w-full"},h))}):k.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:k.map((o,h)=>e.jsx(J,{paper:o,rank:h+1},o.id))}),e.jsx("div",{ref:b,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{$e as default}; diff --git a/assets/MethodsIndexView-83TGyPzJ.js b/assets/MethodsIndexView-B08rRVGN.js similarity index 87% rename from assets/MethodsIndexView-83TGyPzJ.js rename to assets/MethodsIndexView-B08rRVGN.js index 99d1b891186df6593e42f08085f95170f3493c48..4f18d11b419d9b254e93fe3a398c29946818ada8 100644 --- a/assets/MethodsIndexView-83TGyPzJ.js +++ b/assets/MethodsIndexView-B08rRVGN.js @@ -1,4 +1,4 @@ -import{c as g,r as d,j as e,L as j,b as m}from"./index-BfD7YdLr.js";import{u as h}from"./useQuery-BQY3DH-b.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-DlrhV-qs.js";import{A as y,a as v}from"./alert-zXn954y8.js";import{T as _}from"./TaxonomySuggestionTile-Cj81-tgl.js";import"./useBaseQuery-zm-nsmQ1.js";import"./SignInToEditDialog-DB0NqMGz.js";import"./button-CXFuJJQh.js";import"./textarea-DRF500G_.js";import"./dialog-CDRq9Z7X.js";import"./useMutation-BQa0xQql.js";import"./loader-circle-BQq8L_PA.js";/** +import{c as g,r as d,j as e,L as j,b as m}from"./index-Bn8Ob2yb.js";import{u as h}from"./useQuery-DdnDUe7s.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-DMgHDmV1.js";import{A as y,a as v}from"./alert-ek_GWo6X.js";import{T as _}from"./TaxonomySuggestionTile-C_FUiSMg.js";import"./useBaseQuery-DOoW3hTR.js";import"./SignInToEditDialog-B6qsLc_U.js";import"./button-B1AjFwXv.js";import"./textarea-BIjKbX5f.js";import"./dialog-BBaz5Wr4.js";import"./useMutation-CkFxqrff.js";import"./loader-circle-CT-SvG9q.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-bD49ZyM9.js b/assets/NotFound-DArrcZxf.js similarity index 89% rename from assets/NotFound-bD49ZyM9.js rename to assets/NotFound-DArrcZxf.js index bf0b74c12993b2428defbd7e7f35db9bd9880b5b..a14e73ccb2325d49d04825c7c160c43af3f0f543 100644 --- a/assets/NotFound-bD49ZyM9.js +++ b/assets/NotFound-DArrcZxf.js @@ -1 +1 @@ -import{aO as o,r as a,j as t,L as s}from"./index-BfD7YdLr.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}; +import{aO as o,r as a,j as t,L as s}from"./index-Bn8Ob2yb.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}; diff --git a/assets/OrganizationDetailView-CX0_k63U.js b/assets/OrganizationDetailView-CX0_k63U.js deleted file mode 100644 index b03893cc7d4c83550d591b76c57d7564aefeb309..0000000000000000000000000000000000000000 --- a/assets/OrganizationDetailView-CX0_k63U.js +++ /dev/null @@ -1 +0,0 @@ -import{e as t,j as r}from"./index-BfD7YdLr.js";import{O as i}from"./OrganizationPaperFeed-BO5S2des.js";import m from"./NotFound-bD49ZyM9.js";import"./useQuery-BQY3DH-b.js";import"./useBaseQuery-zm-nsmQ1.js";import"./components-LTCBEq5x.js";import"./LatexTitle-Dyu7ZW4B.js";import"./katex.min-BSBacQyE.js";import"./transform-DCLb4olr.js";import"./MarkdownText-BmKXBVRs.js";import"./PaperPreviewLink-Dud2kyWl.js";import"./index-SnRTg719.js";import"./hover-card-Bp6412TC.js";import"./skeleton-DlrhV-qs.js";import"./useIntersectionObserver-mJEWgLMQ.js";import"./alert-zXn954y8.js";import"./searchable-select-CriyPATu.js";import"./button-CXFuJJQh.js";import"./dialog-CDRq9Z7X.js";import"./loader-circle-BQq8L_PA.js";import"./usePapers-DrFoptcF.js";import"./useInfiniteQuery-CVNt5m44.js";const R=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{R as default}; diff --git a/assets/OrganizationDetailView-cWweA-IF.js b/assets/OrganizationDetailView-cWweA-IF.js new file mode 100644 index 0000000000000000000000000000000000000000..31957f4a89d67d0046a571484978e8e8da3a420c --- /dev/null +++ b/assets/OrganizationDetailView-cWweA-IF.js @@ -0,0 +1 @@ +import{e as t,j as r}from"./index-Bn8Ob2yb.js";import{O as i}from"./OrganizationPaperFeed-Bzx-8eUf.js";import m from"./NotFound-DArrcZxf.js";import"./useQuery-DdnDUe7s.js";import"./useBaseQuery-DOoW3hTR.js";import"./components-CmiCpieH.js";import"./LatexTitle-CCig7BhH.js";import"./katex.min-BSBacQyE.js";import"./transform-Z_GB05A-.js";import"./MarkdownText-DQLTyzIE.js";import"./PaperPreviewLink-hLdU_QRR.js";import"./index-N_WymWS-.js";import"./hover-card-BMKmh3eo.js";import"./skeleton-DMgHDmV1.js";import"./useIntersectionObserver-odYwsx6w.js";import"./alert-ek_GWo6X.js";import"./searchable-select-qrXUfGnF.js";import"./button-B1AjFwXv.js";import"./dialog-BBaz5Wr4.js";import"./loader-circle-CT-SvG9q.js";import"./usePapers-CQQdWWPS.js";import"./useInfiniteQuery-Be_M3qGu.js";const R=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{R as default}; diff --git a/assets/OrganizationPaperFeed-BO5S2des.js b/assets/OrganizationPaperFeed-Bzx-8eUf.js similarity index 94% rename from assets/OrganizationPaperFeed-BO5S2des.js rename to assets/OrganizationPaperFeed-Bzx-8eUf.js index 19ac83fa15793630f1e4d7428cef973e3574bada..16ee050ccdfb6b33f56783d87a541f7eb0f6a439 100644 --- a/assets/OrganizationPaperFeed-BO5S2des.js +++ b/assets/OrganizationPaperFeed-Bzx-8eUf.js @@ -1 +1 @@ -import{j as e,r as b,b as L,u as H,a as W,L as D}from"./index-BfD7YdLr.js";import{u as w}from"./useQuery-BQY3DH-b.js";import{P as G}from"./components-LTCBEq5x.js";import{M as K}from"./MarkdownText-BmKXBVRs.js";import{S as $}from"./skeleton-DlrhV-qs.js";import{u as Q,P as Z}from"./useIntersectionObserver-mJEWgLMQ.js";import{A as B,a as Y}from"./alert-zXn954y8.js";import{a as J}from"./searchable-select-CriyPATu.js";import{d as V}from"./usePapers-DrFoptcF.js";import{d as E,t as X}from"./transform-DCLb4olr.js";import ee from"./NotFound-bD49ZyM9.js";const v=24*60*60*1e3,C=12,te=3,se=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),R=s=>new Date(`${s}T00:00:00Z`),ae=s=>s.toISOString().slice(0,10),re=(s,c)=>{if(s===0)return 0;const l=c.findIndex(d=>s<=d);return l===-1?4:l+1},ne=s=>{const c=R(s.start_date),l=R(s.end_date),d=new Date(c.getTime()-c.getUTCDay()*v),j=new Date(l.getTime()+(6-l.getUTCDay())*v),g=new Map(s.results.map(a=>[a.date,a.paper_count])),h=s.results.map(a=>a.paper_count).sort((a,N)=>a-N),n=[.25,.5,.75].map(a=>h[Math.min(h.length-1,Math.floor(h.length*a))]??1),u=[];for(let a=d.getTime();a<=j.getTime();a+=v){const N=new Date(a),m=ae(N),_=a>=c.getTime()&&a<=l.getTime(),p=_?g.get(m)??0:0;u.push({key:m,date:N,count:p,inRange:_,level:re(p,n)})}const y=u.length/7,x=[];let f=-1;for(let a=0;a_.inRange&&(a===0||_.date.getUTCDate()<=7));m&&m.date.getUTCMonth()!==f&&(f=m.date.getUTCMonth(),x.length>0&&a-x[x.length-1].column<3&&x.pop(),x.push({label:m.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:a}))}return{days:u,months:x,weekCount:y}},ie=({data:s,organizationName:c})=>{const l=b.useRef(null),{days:d,months:j,weekCount:g}=b.useMemo(()=>ne(s),[s]),h=g*C+(g-1)*te;return b.useEffect(()=>{const n=l.current;n&&(n.scrollLeft=n.scrollWidth)},[g]),e.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[e.jsxs("div",{className:"organization-contributions-header",children:[e.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:"Paper contributions"}),e.jsxs("p",{className:"organization-contributions-summary",children:[s.total_count.toLocaleString()," ",s.total_count===1?"paper":"papers"," published in the last year"]})]}),e.jsx("div",{className:"organization-contributions-scroll",ref:l,children:e.jsxs("div",{className:"organization-contributions-plot",style:{width:h+34},role:"img","aria-label":`${c} published ${s.total_count} papers in the last year`,children:[e.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((n,u)=>e.jsx("span",{children:se.get(u)??""},u))}),e.jsxs("div",{children:[e.jsx("div",{className:"organization-contributions-months",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:j.map(n=>e.jsx("span",{style:{gridColumnStart:n.column+1},children:n.label},`${n.label}-${n.column}`))}),e.jsx("div",{className:"organization-contributions-grid",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:d.map(n=>e.jsx("span",{className:`organization-contribution-cell ${n.inRange?`level-${n.level}`:"is-outside"}`,title:n.inRange?`${n.count} ${n.count===1?"paper":"papers"} on ${n.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},n.key))})]})]})}),e.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[e.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(n=>e.jsx("span",{className:`organization-contribution-cell level-${n}`},n)),e.jsx("span",{children:"More"})]})]})},oe=({organizationSlug:s,organizationName:c})=>{const l=w({queryKey:["organization-contributions",s],queryFn:()=>L.getOrganizationContributions(s),staleTime:6e5});return l.isLoading?e.jsx($,{className:"organization-contributions-skeleton"}):l.data?e.jsx(ie,{data:l.data,organizationName:c}):null},le=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=s=>s==="date_published"||s==="citation_count"?s:"trending",Ne=({organizationSlug:s,taskSlug:c})=>{var k,P,F,M,A,O,z,S;const l=H(),[d,j]=W(),[g,h]=b.useState(!1),n=ce(d.get("order_by")),u=d.get("has_code")==="true",y=d.get("has_hf_artifacts")==="true",x=w({queryKey:["organization",s],queryFn:()=>L.getOrganization(s),staleTime:10*60*1e3}),f=w({queryKey:["organization-areas-with-tasks",s],queryFn:()=>L.getOrganizationAreasWithTasks(s),staleTime:10*60*1e3}),a=V({organizationSlug:s,taskSlug:c,page_size:12,order_by:n,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:y,enabled:!!s}),{targetRef:N,isIntersecting:m}=Q({rootMargin:"200px"});b.useEffect(()=>{m&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[m,a.hasNextPage,a.isFetchingNextPage]),b.useEffect(()=>{h(!1)},[s,c]);const _=b.useMemo(()=>{var r;return(((r=f.data)==null?void 0:r.results)??[]).flatMap(i=>i.tasks.filter(o=>!!o.slug).map(o=>({...o,slug:o.slug,label:E(o.name,o.slug)})))},[f.data]),p=_.find(r=>r.slug===c),T=b.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(i=>i.results.map(X))},[a.data]),t=x.data??((k=f.data)==null?void 0:k.organization),I=((F=(P=a.data)==null?void 0:P.pages[0])==null?void 0:F.count)??0;if(((M=x.error)==null?void 0:M.status)===404||((A=f.error)==null?void 0:A.status)===404||((O=a.error)==null?void 0:O.status)===404)return e.jsx(ee,{});if(f.error||a.error)return e.jsx("div",{className:"page",children:e.jsx(B,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load organization papers. Please try again."})})});const U=r=>{const i=r.trim().toLocaleLowerCase();return _.filter(o=>`${o.label} ${o.slug}`.toLocaleLowerCase().includes(i)).map(o=>({value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}))},q=r=>{const i=r==="__all__"?`/orgs/${s}`:`/orgs/${s}/${r}`,o=d.toString();l({pathname:i,search:o?`?${o}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(D,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(D,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(t==null?void 0:t.name)??s}),p&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:E(p.name,p.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[t!=null&&t.logo_url&&!g?e.jsx("img",{src:t.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):t?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:t.name.slice(0,1).toUpperCase()}):null,(t==null?void 0:t.name)??e.jsx($,{className:"h-12 w-64"})]}),t&&e.jsxs("div",{className:"feed-subtitle",children:[((z=t.paper_count)==null?void 0:z.toLocaleString())??0," papers",(t.organization_trending_score??0)>0&&t.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",t.trending_rank," trending this month"]})]}),(t==null?void 0:t.description)&&e.jsx(K,{className:"method-description",text:t.description}),t&&e.jsxs("div",{className:"organization-hero-links",children:[t.website_url&&e.jsx("a",{href:t.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),t.hf_url&&e.jsx("a",{href:t.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),t.github_url&&e.jsx("a",{href:t.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),t&&e.jsx(oe,{organizationSlug:s,organizationName:t.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(J,{value:c??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:p?{value:p.slug,label:p.label,description:`${p.paper_count.toLocaleString()} ${p.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((S=t==null?void 0:t.paper_count)==null?void 0:S.toLocaleString())??0} papers`},queryKey:["organization-task-options",s],queryFn:async r=>{var i;return[{value:"__all__",label:"All tasks",description:`${((i=t==null?void 0:t.paper_count)==null?void 0:i.toLocaleString())??0} papers`},...U(r)]},enabled:!f.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:le.map(([r,i])=>e.jsx("button",{type:"button",className:`sort-btn ${n===r?"active":""}`,onClick:()=>{const o=new URLSearchParams(d);r==="trending"?o.delete("order_by"):o.set("order_by",r),j(o)},children:i},r))}),e.jsx(Z,{hasCode:u,hasHfArtifacts:y,onHasCodeChange:r=>{const i=new URLSearchParams(d);r?i.set("has_code","true"):i.delete("has_code"),j(i)},onHasHfArtifactsChange:r=>{const i=new URLSearchParams(d);r?i.set("has_hf_artifacts","true"):i.delete("has_hf_artifacts"),j(i)}})]}),e.jsxs("div",{className:"results-count",children:[I.toLocaleString()," papers"]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,i)=>e.jsx($,{className:"h-40 w-full"},i))}):T.length===0?e.jsx("div",{className:"no-results",children:(t==null?void 0:t.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:T.map((r,i)=>e.jsx(G,{paper:r,rank:i+1},r.id))}),e.jsx("div",{ref:N,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{Ne as O}; +import{j as e,r as b,b as L,u as H,a as W,L as D}from"./index-Bn8Ob2yb.js";import{u as w}from"./useQuery-DdnDUe7s.js";import{P as G}from"./components-CmiCpieH.js";import{M as K}from"./MarkdownText-DQLTyzIE.js";import{S as $}from"./skeleton-DMgHDmV1.js";import{u as Q,P as Z}from"./useIntersectionObserver-odYwsx6w.js";import{A as B,a as Y}from"./alert-ek_GWo6X.js";import{a as J}from"./searchable-select-qrXUfGnF.js";import{d as V}from"./usePapers-CQQdWWPS.js";import{d as E,t as X}from"./transform-Z_GB05A-.js";import ee from"./NotFound-DArrcZxf.js";const v=24*60*60*1e3,C=12,te=3,se=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),R=s=>new Date(`${s}T00:00:00Z`),ae=s=>s.toISOString().slice(0,10),re=(s,c)=>{if(s===0)return 0;const l=c.findIndex(d=>s<=d);return l===-1?4:l+1},ne=s=>{const c=R(s.start_date),l=R(s.end_date),d=new Date(c.getTime()-c.getUTCDay()*v),j=new Date(l.getTime()+(6-l.getUTCDay())*v),g=new Map(s.results.map(a=>[a.date,a.paper_count])),h=s.results.map(a=>a.paper_count).sort((a,N)=>a-N),n=[.25,.5,.75].map(a=>h[Math.min(h.length-1,Math.floor(h.length*a))]??1),u=[];for(let a=d.getTime();a<=j.getTime();a+=v){const N=new Date(a),m=ae(N),_=a>=c.getTime()&&a<=l.getTime(),p=_?g.get(m)??0:0;u.push({key:m,date:N,count:p,inRange:_,level:re(p,n)})}const y=u.length/7,x=[];let f=-1;for(let a=0;a_.inRange&&(a===0||_.date.getUTCDate()<=7));m&&m.date.getUTCMonth()!==f&&(f=m.date.getUTCMonth(),x.length>0&&a-x[x.length-1].column<3&&x.pop(),x.push({label:m.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:a}))}return{days:u,months:x,weekCount:y}},ie=({data:s,organizationName:c})=>{const l=b.useRef(null),{days:d,months:j,weekCount:g}=b.useMemo(()=>ne(s),[s]),h=g*C+(g-1)*te;return b.useEffect(()=>{const n=l.current;n&&(n.scrollLeft=n.scrollWidth)},[g]),e.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[e.jsxs("div",{className:"organization-contributions-header",children:[e.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:"Paper contributions"}),e.jsxs("p",{className:"organization-contributions-summary",children:[s.total_count.toLocaleString()," ",s.total_count===1?"paper":"papers"," published in the last year"]})]}),e.jsx("div",{className:"organization-contributions-scroll",ref:l,children:e.jsxs("div",{className:"organization-contributions-plot",style:{width:h+34},role:"img","aria-label":`${c} published ${s.total_count} papers in the last year`,children:[e.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((n,u)=>e.jsx("span",{children:se.get(u)??""},u))}),e.jsxs("div",{children:[e.jsx("div",{className:"organization-contributions-months",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:j.map(n=>e.jsx("span",{style:{gridColumnStart:n.column+1},children:n.label},`${n.label}-${n.column}`))}),e.jsx("div",{className:"organization-contributions-grid",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:d.map(n=>e.jsx("span",{className:`organization-contribution-cell ${n.inRange?`level-${n.level}`:"is-outside"}`,title:n.inRange?`${n.count} ${n.count===1?"paper":"papers"} on ${n.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},n.key))})]})]})}),e.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[e.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(n=>e.jsx("span",{className:`organization-contribution-cell level-${n}`},n)),e.jsx("span",{children:"More"})]})]})},oe=({organizationSlug:s,organizationName:c})=>{const l=w({queryKey:["organization-contributions",s],queryFn:()=>L.getOrganizationContributions(s),staleTime:6e5});return l.isLoading?e.jsx($,{className:"organization-contributions-skeleton"}):l.data?e.jsx(ie,{data:l.data,organizationName:c}):null},le=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=s=>s==="date_published"||s==="citation_count"?s:"trending",Ne=({organizationSlug:s,taskSlug:c})=>{var k,P,F,M,A,O,z,S;const l=H(),[d,j]=W(),[g,h]=b.useState(!1),n=ce(d.get("order_by")),u=d.get("has_code")==="true",y=d.get("has_hf_artifacts")==="true",x=w({queryKey:["organization",s],queryFn:()=>L.getOrganization(s),staleTime:10*60*1e3}),f=w({queryKey:["organization-areas-with-tasks",s],queryFn:()=>L.getOrganizationAreasWithTasks(s),staleTime:10*60*1e3}),a=V({organizationSlug:s,taskSlug:c,page_size:12,order_by:n,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:y,enabled:!!s}),{targetRef:N,isIntersecting:m}=Q({rootMargin:"200px"});b.useEffect(()=>{m&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[m,a.hasNextPage,a.isFetchingNextPage]),b.useEffect(()=>{h(!1)},[s,c]);const _=b.useMemo(()=>{var r;return(((r=f.data)==null?void 0:r.results)??[]).flatMap(i=>i.tasks.filter(o=>!!o.slug).map(o=>({...o,slug:o.slug,label:E(o.name,o.slug)})))},[f.data]),p=_.find(r=>r.slug===c),T=b.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(i=>i.results.map(X))},[a.data]),t=x.data??((k=f.data)==null?void 0:k.organization),I=((F=(P=a.data)==null?void 0:P.pages[0])==null?void 0:F.count)??0;if(((M=x.error)==null?void 0:M.status)===404||((A=f.error)==null?void 0:A.status)===404||((O=a.error)==null?void 0:O.status)===404)return e.jsx(ee,{});if(f.error||a.error)return e.jsx("div",{className:"page",children:e.jsx(B,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load organization papers. Please try again."})})});const U=r=>{const i=r.trim().toLocaleLowerCase();return _.filter(o=>`${o.label} ${o.slug}`.toLocaleLowerCase().includes(i)).map(o=>({value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}))},q=r=>{const i=r==="__all__"?`/orgs/${s}`:`/orgs/${s}/${r}`,o=d.toString();l({pathname:i,search:o?`?${o}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(D,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(D,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(t==null?void 0:t.name)??s}),p&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:E(p.name,p.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[t!=null&&t.logo_url&&!g?e.jsx("img",{src:t.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):t?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:t.name.slice(0,1).toUpperCase()}):null,(t==null?void 0:t.name)??e.jsx($,{className:"h-12 w-64"})]}),t&&e.jsxs("div",{className:"feed-subtitle",children:[((z=t.paper_count)==null?void 0:z.toLocaleString())??0," papers",(t.organization_trending_score??0)>0&&t.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",t.trending_rank," trending this month"]})]}),(t==null?void 0:t.description)&&e.jsx(K,{className:"method-description",text:t.description}),t&&e.jsxs("div",{className:"organization-hero-links",children:[t.website_url&&e.jsx("a",{href:t.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),t.hf_url&&e.jsx("a",{href:t.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),t.github_url&&e.jsx("a",{href:t.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),t&&e.jsx(oe,{organizationSlug:s,organizationName:t.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(J,{value:c??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:p?{value:p.slug,label:p.label,description:`${p.paper_count.toLocaleString()} ${p.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((S=t==null?void 0:t.paper_count)==null?void 0:S.toLocaleString())??0} papers`},queryKey:["organization-task-options",s],queryFn:async r=>{var i;return[{value:"__all__",label:"All tasks",description:`${((i=t==null?void 0:t.paper_count)==null?void 0:i.toLocaleString())??0} papers`},...U(r)]},enabled:!f.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:le.map(([r,i])=>e.jsx("button",{type:"button",className:`sort-btn ${n===r?"active":""}`,onClick:()=>{const o=new URLSearchParams(d);r==="trending"?o.delete("order_by"):o.set("order_by",r),j(o)},children:i},r))}),e.jsx(Z,{hasCode:u,hasHfArtifacts:y,onHasCodeChange:r=>{const i=new URLSearchParams(d);r?i.set("has_code","true"):i.delete("has_code"),j(i)},onHasHfArtifactsChange:r=>{const i=new URLSearchParams(d);r?i.set("has_hf_artifacts","true"):i.delete("has_hf_artifacts"),j(i)}})]}),e.jsxs("div",{className:"results-count",children:[I.toLocaleString()," papers"]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,i)=>e.jsx($,{className:"h-40 w-full"},i))}):T.length===0?e.jsx("div",{className:"no-results",children:(t==null?void 0:t.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:T.map((r,i)=>e.jsx(G,{paper:r,rank:i+1},r.id))}),e.jsx("div",{ref:N,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{Ne as O}; diff --git a/assets/OrganizationTaskView-Bw4EgOqw.js b/assets/OrganizationTaskView-Bw4EgOqw.js new file mode 100644 index 0000000000000000000000000000000000000000..e5292b002170a369524f1ca541e8b96631f1c439 --- /dev/null +++ b/assets/OrganizationTaskView-Bw4EgOqw.js @@ -0,0 +1 @@ +import{e as i,j as t}from"./index-Bn8Ob2yb.js";import{O as m}from"./OrganizationPaperFeed-Bzx-8eUf.js";import p from"./NotFound-DArrcZxf.js";import"./useQuery-DdnDUe7s.js";import"./useBaseQuery-DOoW3hTR.js";import"./components-CmiCpieH.js";import"./LatexTitle-CCig7BhH.js";import"./katex.min-BSBacQyE.js";import"./transform-Z_GB05A-.js";import"./MarkdownText-DQLTyzIE.js";import"./PaperPreviewLink-hLdU_QRR.js";import"./index-N_WymWS-.js";import"./hover-card-BMKmh3eo.js";import"./skeleton-DMgHDmV1.js";import"./useIntersectionObserver-odYwsx6w.js";import"./alert-ek_GWo6X.js";import"./searchable-select-qrXUfGnF.js";import"./button-B1AjFwXv.js";import"./dialog-BBaz5Wr4.js";import"./loader-circle-CT-SvG9q.js";import"./usePapers-CQQdWWPS.js";import"./useInfiniteQuery-Be_M3qGu.js";const T=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{T as default}; diff --git a/assets/OrganizationTaskView-KCn9ADD3.js b/assets/OrganizationTaskView-KCn9ADD3.js deleted file mode 100644 index 861665f04315cf1a231ca2e206642fedbab23cdb..0000000000000000000000000000000000000000 --- a/assets/OrganizationTaskView-KCn9ADD3.js +++ /dev/null @@ -1 +0,0 @@ -import{e as i,j as t}from"./index-BfD7YdLr.js";import{O as m}from"./OrganizationPaperFeed-BO5S2des.js";import p from"./NotFound-bD49ZyM9.js";import"./useQuery-BQY3DH-b.js";import"./useBaseQuery-zm-nsmQ1.js";import"./components-LTCBEq5x.js";import"./LatexTitle-Dyu7ZW4B.js";import"./katex.min-BSBacQyE.js";import"./transform-DCLb4olr.js";import"./MarkdownText-BmKXBVRs.js";import"./PaperPreviewLink-Dud2kyWl.js";import"./index-SnRTg719.js";import"./hover-card-Bp6412TC.js";import"./skeleton-DlrhV-qs.js";import"./useIntersectionObserver-mJEWgLMQ.js";import"./alert-zXn954y8.js";import"./searchable-select-CriyPATu.js";import"./button-CXFuJJQh.js";import"./dialog-CDRq9Z7X.js";import"./loader-circle-BQq8L_PA.js";import"./usePapers-DrFoptcF.js";import"./useInfiniteQuery-CVNt5m44.js";const T=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{T as default}; diff --git a/assets/OrganizationsIndexView-eR9gHXDo.js b/assets/OrganizationsIndexView-DstHO0mQ.js similarity index 94% rename from assets/OrganizationsIndexView-eR9gHXDo.js rename to assets/OrganizationsIndexView-DstHO0mQ.js index 25ef2e6e1d1fd2c4a084ca0b662edf5c6ec19115..163d4b722e023d9d32fdd274bf0bfd7633933a87 100644 --- a/assets/OrganizationsIndexView-eR9gHXDo.js +++ b/assets/OrganizationsIndexView-DstHO0mQ.js @@ -1 +1 @@ -import{a as u,r as g,j as e,L as x,b as j}from"./index-BfD7YdLr.js";import{u as y}from"./useQuery-BQY3DH-b.js";import{A as f,a as _}from"./alert-zXn954y8.js";import{S as N}from"./skeleton-DlrhV-qs.js";import"./useBaseQuery-zm-nsmQ1.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},q=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{q as default}; +import{a as u,r as g,j as e,L as x,b as j}from"./index-Bn8Ob2yb.js";import{u as y}from"./useQuery-DdnDUe7s.js";import{A as f,a as _}from"./alert-ek_GWo6X.js";import{S as N}from"./skeleton-DMgHDmV1.js";import"./useBaseQuery-DOoW3hTR.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},q=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{q as default}; diff --git a/assets/PaperDetailView-BBswAFhU.js b/assets/PaperDetailView-BBswAFhU.js new file mode 100644 index 0000000000000000000000000000000000000000..ffcc04a990a69cb60bcc7b35a5aabee5001cc4d0 --- /dev/null +++ b/assets/PaperDetailView-BBswAFhU.js @@ -0,0 +1,29 @@ +import{c as vt,m as ta,r as m,j as e,P as os,n as _e,o as ls,p as Te,q as Le,s as cs,t as yt,C as je,v as Ve,h as me,g as he,X as ds,w as ve,x as sa,y as us,z as aa,B as ra,D as na,E as ia,F as oa,G as Qt,H as la,I as ca,J as da,K as ua,M as ma,f as We,R as _t,b as xe,N as ms,d as hs,O as ha,Q as pa,S as fa,T as ps,U as ga,V as xa,W as ba,A as Vt,e as ja,Y as va,u as ya,Z as _a,L as ge,_ as ka,$ as wa,a0 as Na,a1 as Ca,a2 as Ea,a3 as Sa,a4 as Ia}from"./index-Bn8Ob2yb.js";import{u as re}from"./useQuery-DdnDUe7s.js";import{I as W,S as Pa,a as $a,T as Ra,M as Aa}from"./components-CmiCpieH.js";import{C as Fa,E as La}from"./ExternalSourceEvalBadge-C_nXOup9.js";import{L as qe,a as Ta}from"./LatexTitle-CCig7BhH.js";import{s as Ua}from"./transform-Z_GB05A-.js";import{f as Ba,D as Da}from"./latexPlainText-DI8YEXVe.js";import{a as Ma}from"./usePapers-CQQdWWPS.js";import{S as Re}from"./skeleton-DMgHDmV1.js";import{A as Ha,a as qa}from"./alert-ek_GWo6X.js";import{B as H}from"./button-B1AjFwXv.js";import{u as fs}from"./index-Bty21uio.js";import{I as Z}from"./textarea-BIjKbX5f.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as ue}from"./dialog-BBaz5Wr4.js";import{u as pe}from"./useMutation-CkFxqrff.js";import{S as kt,P as Xe,L as ae,a as za}from"./SignInToEditDialog-B6qsLc_U.js";import{S as Je,a as Jt}from"./searchable-select-qrXUfGnF.js";import{L as ne}from"./loader-circle-CT-SvG9q.js";import{B as gs,D as Ka,c as Oa,g as Ga,s as Qa,a as Va,b as Ja,d as Wa,i as Xa,e as Ya}from"./codexAddEvals-C5IxXnlq.js";import{G as Wt}from"./github-Cxli8-iY.js";import{M as Za,r as er}from"./index-N_WymWS-.js";import"./useBaseQuery-DOoW3hTR.js";import"./hover-card-BMKmh3eo.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-Be_M3qGu.js";/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xt=vt("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"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xs=vt("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"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ye=vt("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 tr(t){return t!=null&&t.can_directly_edit_catalog?"direct":"pending"}function sr(t){return(t??[]).filter(a=>!!(a.dataset_slug&&a.task_slug))}function ar(t,a,r="https://paperswithcode.co"){return a.map(l=>{const i=encodeURIComponent(l.evaluation_id),c=`${r}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge.svg?eval=${i}&live=1`,o=`${r}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge-link?eval=${i}`;return`[![${`Papers with Code: ${l.best_rank===1?"SOTA":`#${l.best_rank}`} on ${l.dataset_name}`}](${c})](${o})`}).join(` +`)}function rr(t,a=!0){return re({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return ta(t)},enabled:a&&!!t,staleTime:0,refetchOnMount:"always"})}const bs=t=>t.replace(/v\d+$/,""),nr={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},it=(t,a)=>{const r=(t[a]||[]).length;return r<100?{count:r,isLimited:!1}:{count:r,isLimited:!0}},ot=(t,a)=>{const r=t[a];return Array.isArray(r)?r.map(l=>{if(typeof l=="string")return l;if(l&&typeof l=="object"){const i=l;return i.id||i.repoId||null}return null}).filter(l=>!!l).map(l=>`${nr[a]}${l}`):[]},ir=async t=>{try{return(await fetch(`https://huggingface.co/api/papers/${bs(t)}`)).ok}catch{return!1}},or=async t=>{const a=bs(t),[r,l]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${a}/repos`).then(async f=>f.ok?f.json():(console.warn(`Failed to fetch repos for arXiv:${a}, status: ${f.status}`),null)).catch(f=>(console.warn(`Failed to fetch repos for arXiv:${a}:`,f),null)),ir(a)]);if(!r)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:l};const i=it(r,"models"),c=it(r,"datasets"),o=it(r,"spaces");return{models:i.count,datasets:c.count,spaces:o.count,modelUrls:ot(r,"models"),datasetUrls:ot(r,"datasets"),spaceUrls:ot(r,"spaces"),isLimited:i.isLimited||c.isLimited||o.isLimited,paperExists:l}},lr=t=>re({queryKey:["huggingface-repos",t],queryFn:()=>or(t),enabled:!!t,staleTime:10*60*1e3,retry:1}),cr={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url"};function dr(t){return cr[t]??null}function ur(){const[t,a]=m.useState(null),r=m.useCallback(i=>{a(i)},[]),l=m.useCallback((i,c)=>{a(o=>c?i:o===i?null:o)},[]);return{activeEditor:t,openEditor:r,setEditorOpen:l}}var Ze="Checkbox",[mr]=yt(Ze),[hr,wt]=mr(Ze);function pr(t){const{__scopeCheckbox:a,checked:r,children:l,defaultChecked:i,disabled:c,form:o,name:f,onCheckedChange:u,required:s,value:N="on",internal_do_not_use_render:k}=t,[E,w]=ls({prop:r,defaultProp:i??!1,onChange:u,caller:Ze}),[P,h]=m.useState(null),[D,U]=m.useState(null),T=m.useRef(!1),M=P?!!o||!!P.closest("form"):!0,B={checked:E,disabled:c,setChecked:w,control:P,setControl:h,name:f,form:o,value:N,hasConsumerStoppedPropagationRef:T,required:s,defaultChecked:be(i)?!1:i,isFormControl:M,bubbleInput:D,setBubbleInput:U};return e.jsx(hr,{scope:a,...B,children:fr(k)?k(B):l})}var js="CheckboxTrigger",vs=m.forwardRef(({__scopeCheckbox:t,onKeyDown:a,onClick:r,...l},i)=>{const{control:c,value:o,disabled:f,checked:u,required:s,setControl:N,setChecked:k,hasConsumerStoppedPropagationRef:E,isFormControl:w,bubbleInput:P}=wt(js,t),h=Te(i,N),D=m.useRef(u);return m.useEffect(()=>{const U=c==null?void 0:c.form;if(U){const T=()=>k(D.current);return U.addEventListener("reset",T),()=>U.removeEventListener("reset",T)}},[c,k]),e.jsx(_e.button,{type:"button",role:"checkbox","aria-checked":be(u)?"mixed":u,"aria-required":s,"data-state":Ns(u),"data-disabled":f?"":void 0,disabled:f,value:o,...l,ref:h,onKeyDown:Le(a,U=>{U.key==="Enter"&&U.preventDefault()}),onClick:Le(r,U=>{k(T=>be(T)?!0:!T),P&&w&&(E.current=U.isPropagationStopped(),E.current||U.stopPropagation())})})});vs.displayName=js;var Nt=m.forwardRef((t,a)=>{const{__scopeCheckbox:r,name:l,checked:i,defaultChecked:c,required:o,disabled:f,value:u,onCheckedChange:s,form:N,...k}=t;return e.jsx(pr,{__scopeCheckbox:r,checked:i,defaultChecked:c,disabled:f,required:o,onCheckedChange:s,name:l,form:N,value:u,internal_do_not_use_render:({isFormControl:E})=>e.jsxs(e.Fragment,{children:[e.jsx(vs,{...k,ref:a,__scopeCheckbox:r}),E&&e.jsx(ws,{__scopeCheckbox:r})]})})});Nt.displayName=Ze;var ys="CheckboxIndicator",_s=m.forwardRef((t,a)=>{const{__scopeCheckbox:r,forceMount:l,...i}=t,c=wt(ys,r);return e.jsx(os,{present:l||be(c.checked)||c.checked===!0,children:e.jsx(_e.span,{"data-state":Ns(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a,style:{pointerEvents:"none",...t.style}})})});_s.displayName=ys;var ks="CheckboxBubbleInput",ws=m.forwardRef(({__scopeCheckbox:t,...a},r)=>{const{control:l,hasConsumerStoppedPropagationRef:i,checked:c,defaultChecked:o,required:f,disabled:u,name:s,value:N,form:k,bubbleInput:E,setBubbleInput:w}=wt(ks,t),P=Te(r,w),h=fs(c),D=cs(l);m.useEffect(()=>{const T=E;if(!T)return;const M=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(M,"checked").set,d=!i.current;if(h!==c&&v){const p=new Event("click",{bubbles:d});T.indeterminate=be(c),v.call(T,be(c)?!1:c),T.dispatchEvent(p)}},[E,h,c,i]);const U=m.useRef(be(c)?!1:c);return e.jsx(_e.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??U.current,required:f,disabled:u,name:s,value:N,form:k,...a,tabIndex:-1,ref:P,style:{...a.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ws.displayName=ks;function fr(t){return typeof t=="function"}function be(t){return t==="indeterminate"}function Ns(t){return be(t)?"indeterminate":t?"checked":"unchecked"}const et=m.forwardRef(({className:t,style:a,...r},l)=>e.jsx(Nt,{ref:l,className:Ve("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...a},...r,children:e.jsx(_s,{className:Ve("flex items-center justify-center text-current"),children:e.jsx(je,{className:"h-4 w-4"})})}));et.displayName=Nt.displayName;function gr(t,a,r){if(!t)return t;const l=i=>i.paper_id!==a||i.paper_title===r?i:{...i,paper_title:r};if(Array.isArray(t)){const i=t.map(l);return i.some((o,f)=>o!==t[f])?i:t}if(Array.isArray(t.results)){const i=t.results.map(l);return i.some((o,f)=>o!==t.results[f])?{...t,results:i}:t}return t}function Ce(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 i=String(a.id),c=o=>gr(o,i,a.title);t.setQueriesData({queryKey:["evaluations"]},c),t.setQueriesData({queryKey:["dataset-evals"]},c),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}function ye({isAuthor:t=!1}){const a=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";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:a?"Test-only: this change stays on staging.":"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:a?"This exercises staging-local pending behavior and is not queued for production review.":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 xr=250,br=100;function jr({open:t,onOpenChange:a,paperId:r,arxivId:l,initialTaskIds:i,initialTasks:c,onSuccess:o,submitMode:f="direct",isAuthor:u=!1}){const[s,N]=m.useState(i),[k,E]=m.useState(!1),[w,P]=m.useState(""),[h,D]=m.useState(""),[U,T]=m.useState(new Map),M=me(),{toast:B}=he(),v=m.useRef(!1);m.useEffect(()=>{if(!t){v.current=!1;return}if(v.current)return;v.current=!0,N(i),P(""),D("");const x=new Map;(c||[]).forEach(I=>{const L=parseInt(I.id);Number.isNaN(L)||x.set(L,I)}),T(x)},[t,i,c]),m.useEffect(()=>{const x=window.setTimeout(()=>{D(w.trim())},xr);return()=>window.clearTimeout(x)},[w]);const{data:d,isFetching:p}=re({queryKey:["tasks-search",h],queryFn:()=>us({page_size:br,...h?{q:h}:{}}),enabled:t});m.useEffect(()=>{var x;(x=d==null?void 0:d.results)!=null&&x.length&&T(I=>{const L=new Map(I);return d.results.forEach(F=>{const C=parseInt(F.id);Number.isNaN(C)||L.set(C,F)}),L})},[d]);const y=m.useMemo(()=>{const x=(d==null?void 0:d.results)||[],I=new Set,L=[];return s.forEach(F=>{if(I.has(F))return;const C=U.get(F);C&&(L.push(C),I.add(F))}),x.forEach(F=>{const C=parseInt(F.id);Number.isNaN(C)||I.has(C)||(L.push(F),I.add(C))}),L},[d,s,U]),A=pe({mutationFn:async({paperId:x,taskIds:I})=>f==="pending"?(await ve({paper_id:parseInt(x),edit_type:"tasks",proposed_payload:{task_ids:I}}),null):sa(x,I),onMutate:async({taskIds:x})=>{if(f==="pending")return{snapshots:[]};const I=x.map(C=>U.get(C)).filter(C=>!!C).map(C=>({id:C.id,name:C.name,slug:C.slug})).sort((C,G)=>C.name.localeCompare(G.name)),L=Array.from(new Set([r,l].filter(C=>!!C)));await Promise.all(L.flatMap(C=>[M.cancelQueries({queryKey:["paper",C]}),M.cancelQueries({queryKey:["paper-arxiv",C]})]));const F=[];return L.forEach(C=>{["paper","paper-arxiv"].forEach(G=>{const X=[G,C],g=M.getQueryData(X);F.push({key:X,data:g}),g&&M.setQueryData(X,{...g,tasks:I})})}),B({title:"Tasks updated",description:`Saved ${x.length} task${x.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1),{snapshots:F}},onSuccess:x=>{if(f==="pending"){B({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),o==null||o(),a(!1);return}x&&Ce(M,x,[r,l])},onError:(x,I,L)=>{var G,X;(G=L==null?void 0:L.snapshots)==null||G.forEach(({key:g,data:S})=>{M.setQueryData(g,S)});const F=x;let C=F.message||(f==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(F.response)try{const g=JSON.parse(F.response);typeof(g==null?void 0:g.detail)=="string"?C=g.detail:Array.isArray(g==null?void 0:g.detail)&&((X=g.detail[0])!=null&&X.msg)&&(C=g.detail[0].msg)}catch{C=F.response}B({title:f==="pending"?"Could not submit edit":"Could not save tasks",description:C,variant:"destructive"})}}),z=()=>{f==="direct"&&i.some(x=>!s.includes(x))&&!window.confirm("Remove one or more task links from this paper?")||A.mutate({paperId:r,taskIds:s})},K=m.useMemo(()=>{if(s.length!==i.length)return!0;const x=new Set(i);return s.some(I=>!x.has(I))},[s,i]),$=(x,I)=>{N(L=>I?L.includes(x)?L:[...L,x]:L.filter(F=>F!==x))},O=()=>P("");return e.jsxs(ie,{open:t,onOpenChange:a,children:[e.jsxs(oe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Paper Tasks"}),e.jsx(de,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),f==="pending"&&e.jsx(ye,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Je,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(Z,{type:"text",placeholder:"Search tasks...",value:w,onChange:x=>P(x.target.value),className:"pl-9 pr-9"}),w&&e.jsx("button",{type:"button",onClick:O,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(ds,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:y.length>0?e.jsx("div",{className:"space-y-2",children:y.map(x=>{const I=parseInt(x.id),L=s.includes(I);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(et,{id:`task-${x.id}`,checked:L,onCheckedChange:F=>$(I,F===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${x.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[x.name,x.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[x.description.substring(0,100),x.description.length>100?"...":""]})]})]},x.id)})}):p?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Je,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:h?`No tasks found matching "${h}"`:"No tasks available"})]})}),e.jsxs(ue,{children:[e.jsx(H,{variant:"ghost",className:"sm:mr-auto",onClick:()=>E(!0),children:"Suggest a new task"}),e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:z,disabled:A.isPending||!K,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),f==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),f==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(kt,{open:k,onOpenChange:E,paperId:r,kind:"task"})]})}const vr=250,yr=100;function _r({open:t,onOpenChange:a,paperId:r,arxivId:l,initialMethodIds:i,initialMethods:c,onSuccess:o,submitMode:f="direct",isAuthor:u=!1}){const[s,N]=m.useState(i),[k,E]=m.useState(!1),[w,P]=m.useState(""),[h,D]=m.useState(""),[U,T]=m.useState(new Map),M=me(),{toast:B}=he(),v=m.useRef(!1);m.useEffect(()=>{if(!t){v.current=!1;return}if(v.current)return;v.current=!0,N(i),P(""),D("");const x=new Map;(c||[]).forEach(I=>{const L=parseInt(I.id);Number.isNaN(L)||x.set(L,I)}),T(x)},[t,i,c]),m.useEffect(()=>{const x=window.setTimeout(()=>{D(w.trim())},vr);return()=>window.clearTimeout(x)},[w]);const{data:d,isFetching:p}=re({queryKey:["methods-search",h],queryFn:()=>ra({page_size:yr,...h?{q:h}:{}}),enabled:t});m.useEffect(()=>{var x;(x=d==null?void 0:d.results)!=null&&x.length&&T(I=>{const L=new Map(I);return d.results.forEach(F=>{const C=parseInt(F.id);Number.isNaN(C)||L.set(C,F)}),L})},[d]);const y=m.useMemo(()=>{const x=(d==null?void 0:d.results)||[],I=new Set,L=[];return s.forEach(F=>{if(I.has(F))return;const C=U.get(F);C&&(L.push(C),I.add(F))}),x.forEach(F=>{const C=parseInt(F.id);Number.isNaN(C)||I.has(C)||(L.push(F),I.add(C))}),L},[d,s,U]),A=pe({mutationFn:async({paperId:x,methodIds:I})=>f==="pending"?(await ve({paper_id:parseInt(x),edit_type:"methods",proposed_payload:{method_ids:I}}),null):aa(x,I),onSuccess:x=>{if(f==="pending"){B({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),o==null||o(),a(!1);return}x&&Ce(M,x,[r,l]),B({title:"Methods updated",description:`Saved ${s.length} method${s.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1)},onError:x=>{var F;const I=x;let L=I.message||(f==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(I.response)try{const C=JSON.parse(I.response);typeof(C==null?void 0:C.detail)=="string"?L=C.detail:Array.isArray(C==null?void 0:C.detail)&&((F=C.detail[0])!=null&&F.msg)&&(L=C.detail[0].msg)}catch{L=I.response}B({title:f==="pending"?"Could not submit edit":"Could not save methods",description:L,variant:"destructive"})}}),z=()=>{f==="direct"&&i.some(x=>!s.includes(x))&&!window.confirm("Remove one or more method links from this paper?")||A.mutate({paperId:r,methodIds:s})},K=m.useMemo(()=>{if(s.length!==i.length)return!0;const x=new Set(i);return s.some(I=>!x.has(I))},[s,i]),$=(x,I)=>{N(L=>I?L.includes(x)?L:[...L,x]:L.filter(F=>F!==x))},O=()=>P("");return e.jsxs(ie,{open:t,onOpenChange:a,children:[e.jsxs(oe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Paper Methods"}),e.jsx(de,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),f==="pending"&&e.jsx(ye,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Je,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(Z,{type:"text",placeholder:"Search methods...",value:w,onChange:x=>P(x.target.value),className:"pl-9 pr-9"}),w&&e.jsx("button",{type:"button",onClick:O,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(ds,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:y.length>0?e.jsx("div",{className:"space-y-2",children:y.map(x=>{const I=parseInt(x.id),L=s.includes(I);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(et,{id:`method-${x.id}`,checked:L,onCheckedChange:F=>$(I,F===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${x.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[x.name,x.full_name&&x.full_name!==x.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:x.full_name}),x.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[x.description.substring(0,100),x.description.length>100?"...":""]})]})]},x.id)})}):p?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Je,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:h?`No methods found matching "${h}"`:"No methods available"})]})}),e.jsxs(ue,{children:[e.jsx(H,{variant:"ghost",className:"sm:mr-auto",onClick:()=>E(!0),children:"Suggest a new method"}),e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:z,disabled:A.isPending||!K,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),f==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),f==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(kt,{open:k,onOpenChange:E,paperId:r,kind:"method"})]})}function Fe(t){const a=t.trim();if(!a)return null;let r=a;!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`https://${r}`);try{const l=new URL(r);if(l.hostname.toLowerCase()!=="github.com")return null;const i=l.pathname.split("/").filter(Boolean);if(i.length<2)return null;const c=i[0].toLowerCase();let o=i[1].toLowerCase();return o.endsWith(".git")&&(o=o.slice(0,-4)),`https://github.com/${c}/${o}`}catch{return null}}function Yt(t,a){const r=Fe(t),l=Fe(a);return r&&l?r===l:t.trim()===a.trim()}function kr({open:t,onOpenChange:a,paperId:r,arxivId:l,initialRepositories:i,onSuccess:c,submitMode:o="direct",isAuthor:f=!1}){const[u,s]=m.useState(i),[N,k]=m.useState(""),E=me(),{toast:w}=he(),P=m.useRef(!1);m.useEffect(()=>{if(!t){P.current=!1;return}P.current||(P.current=!0,s(i),k(""))},[t,i]);const h=pe({mutationFn:async({paperId:p,repositories:y})=>o==="pending"?(await ve({paper_id:parseInt(p),edit_type:"repositories",proposed_payload:{repositories:y}}),null):na(p,y),onSuccess:p=>{if(o==="pending"){w({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),c==null||c(),a(!1),k("");return}p&&Ce(E,p,[r,l]),c==null||c(),a(!1),k("")},onError:p=>{var z;const y=p;let A=y.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(y.response)try{const K=JSON.parse(y.response);typeof(K==null?void 0:K.detail)=="string"?A=K.detail:Array.isArray(K==null?void 0:K.detail)&&((z=K.detail[0])!=null&&z.msg)&&(A=K.detail[0].msg)}catch{A=y.response}w({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:A,variant:"destructive"})}}),D=p=>{const y=[];for(const A of p){const z=y.find(K=>Yt(K.url,A.url));if(z)z.is_official=z.is_official||A.is_official;else{const K=Fe(A.url);y.push({url:K??A.url.trim(),is_official:A.is_official})}}return y},U=()=>{const p=N.trim(),y=p?[...u,{url:p,is_official:!1}]:u;return p&&u.some(A=>Yt(A.url,p))?(alert("This repository URL is already added"),null):D(y)},T=()=>{const p=U();p!==null&&p.length!==u.length&&(s(p),k(""))},M=p=>{s(u.filter(y=>y.url!==p))},B=p=>{s(u.map(y=>y.url===p?{...y,is_official:!y.is_official}:y))},v=()=>{const p=U();p!==null&&(o==="direct"&&i.some(y=>!p.some(A=>A.url===y.url))&&!window.confirm("Remove one or more repositories from this paper?")||h.mutate({paperId:r,repositories:p}))},d=m.useMemo(()=>{const p=N.trim(),y=p?[...u,{url:p,is_official:!1}]:u;if(y.length!==i.length)return!0;const A=D(i),z=D(y);if(z.length!==A.length)return!0;const K=new Map(A.map($=>[Fe($.url)??$.url.trim(),!!$.is_official]));return z.some($=>{const O=Fe($.url)??$.url.trim(),x=K.get(O);return x===void 0||x!==!!$.is_official})},[u,N,i]);return e.jsx(ie,{open:t,onOpenChange:a,children:e.jsxs(oe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Paper Repositories"}),e.jsx(de,{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(ye,{isAuthor:f}),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(Z,{type:"url",placeholder:"https://github.com/owner/repo",value:N,onChange:p=>k(p.target.value),onKeyPress:p=>{p.key==="Enter"&&(p.preventDefault(),T())},className:"flex-1"}),e.jsxs(H,{onClick:T,size:"sm",disabled:!N.trim(),children:[e.jsx(Xe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((p,y)=>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(Wt,{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:p.url}),p.is_official&&e.jsx(gs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(H,{variant:p.is_official?"default":"outline",size:"sm",onClick:()=>B(p.url),className:"h-8 px-2 text-xs",title:p.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(xs,{className:`w-3.5 h-3.5 mr-1 ${p.is_official?"fill-current":""}`}),p.is_official?"Official":"Mark official"]}),e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>M(p.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Ye,{className:"w-4 h-4"})})]})]},y))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Wt,{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(ue,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:v,disabled:h.isPending||!d,children:h.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(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function wr({open:t,onOpenChange:a,paperId:r,arxivId:l,initialProjectPages:i,onSuccess:c,submitMode:o="direct",isAuthor:f=!1}){const[u,s]=m.useState(i),[N,k]=m.useState(""),E=me(),{toast:w}=he(),P=m.useRef(!1);m.useEffect(()=>{if(!t){P.current=!1;return}P.current||(P.current=!0,s(i),k(""))},[t,i]);const h=pe({mutationFn:async({paperId:d,projectPages:p})=>o==="pending"?(await ve({paper_id:parseInt(d),edit_type:"project_pages",proposed_payload:{project_pages:p}}),null):ia(d,p),onSuccess:d=>{if(o==="pending"){w({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),c==null||c(),a(!1),k("");return}d&&Ce(E,d,[r,l]),c==null||c(),a(!1),k("")},onError:d=>{var A;const p=d;let y=p.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(p.response)try{const z=JSON.parse(p.response);typeof(z==null?void 0:z.detail)=="string"?y=z.detail:Array.isArray(z==null?void 0:z.detail)&&((A=z.detail[0])!=null&&A.msg)&&(y=z.detail[0].msg)}catch{y=p.response}w({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:y,variant:"destructive"})}}),D=()=>{const d=N.trim();return d?u.some(p=>p.url===d)?(alert("This project page URL is already added"),null):[...u,{url:d,is_official:!1}]:u},U=()=>{const d=D();d!==null&&d.length!==u.length&&(s(d),k(""))},T=d=>{s(u.filter(p=>p.url!==d))},M=d=>{s(u.map(p=>p.url===d?{...p,is_official:!p.is_official}:p))},B=()=>{const d=D();d!==null&&(o==="direct"&&i.some(p=>!d.some(y=>y.url===p.url))&&!window.confirm("Remove one or more project pages from this paper?")||h.mutate({paperId:r,projectPages:d}))},v=m.useMemo(()=>{const d=N.trim(),p=d?[...u,{url:d,is_official:!1}]:u;if(p.length!==i.length)return!0;const y=new Map(i.map(A=>[A.url.trim(),!!A.is_official]));return p.some(A=>{const z=y.get(A.url.trim());return z===void 0||z!==!!A.is_official})},[u,N,i]);return e.jsx(ie,{open:t,onOpenChange:a,children:e.jsxs(oe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Paper Project Pages"}),e.jsx(de,{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(ye,{isAuthor:f}),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(Z,{type:"url",placeholder:"https://example.com/project",value:N,onChange:d=>k(d.target.value),onKeyPress:d=>{d.key==="Enter"&&(d.preventDefault(),U())},className:"flex-1"}),e.jsxs(H,{onClick:U,size:"sm",disabled:!N.trim(),children:[e.jsx(Xe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((d,p)=>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(Xt,{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:d.url}),d.is_official&&e.jsx(gs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(H,{variant:d.is_official?"default":"outline",size:"sm",onClick:()=>M(d.url),className:"h-8 px-2 text-xs",title:d.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(xs,{className:`w-3.5 h-3.5 mr-1 ${d.is_official?"fill-current":""}`}),d.is_official?"Official":"Mark official"]}),e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>T(d.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Ye,{className:"w-4 h-4"})})]})]},p))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Xt,{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(ue,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:B,disabled:h.isPending||!v,children:h.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(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Nr({open:t,onOpenChange:a,paperId:r,arxivId:l,initialUrl:i,onSuccess:c,submitMode:o="direct",isAuthor:f=!1}){const[u,s]=m.useState(i),N=me(),{toast:k}=he(),E=m.useRef(!1);m.useEffect(()=>{if(!t){E.current=!1;return}E.current||(E.current=!0,s(i))},[t,i]);const w=pe({mutationFn:async({paperId:T,sourceUrl:M})=>o==="pending"?(await ve({paper_id:parseInt(T),edit_type:"source_url",proposed_payload:{source_url:M}}),null):oa(T,M),onSuccess:T=>{if(o==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),c==null||c(),a(!1);return}T&&Ce(N,T,[r,l]),c==null||c(),a(!1)},onError:T=>{var v;const M=T;let B=M.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(M.response)try{const d=JSON.parse(M.response);typeof(d==null?void 0:d.detail)=="string"?B=d.detail:Array.isArray(d==null?void 0:d.detail)&&((v=d.detail[0])!=null&&v.msg)&&(B=d.detail[0].msg)}catch{B=M.response}k({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:B,variant:"destructive"})}}),P=u.trim(),h=/^https?:\/\//i.test(P),D=P!==(i||"").trim(),U=()=>{h&&w.mutate({paperId:r,sourceUrl:P})};return e.jsx(ie,{open:t,onOpenChange:a,children:e.jsxs(oe,{className:"max-w-2xl",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Source URL"}),e.jsxs(de,{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(ye,{isAuthor:f}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(Z,{type:"url",placeholder:"https://example.com/paper",value:u,onChange:T=>s(T.target.value),onKeyPress:T=>{T.key==="Enter"&&h&&D&&(T.preventDefault(),U())}}),!h&&P.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(ue,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:U,disabled:w.isPending||!h||!D,children:w.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(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const lt=100;function Cr(t){return(t??[]).some(a=>a.slug==="coding-agents"||a.name.trim().toLowerCase()==="coding agents")}function Zt(t){const a=parseInt(t.task_id,10),r=parseInt(t.dataset_id,10);return!(!Number.isFinite(a)||!Number.isFinite(r)||!t.metric_name.trim()||!t.metric_value.trim())}function Er(t){return t.map(a=>{const r=a.best_metric||Object.keys(a.metrics)[0],l=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(l||""),best_rank:a.best_rank?String(a.best_rank):"",num_parameters:a.num_parameters!=null?String(a.num_parameters):"",hf_model_url:a.hf_model_url||"",is_open:a.is_open!==!1,operation:"unchanged"}})}function Sr(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 Ir(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 es(t,a){return`${t}:${a}`}function ze(t){const a=t.trim();if(a==="")return null;const r=Number(a);return!Number.isFinite(r)||r<0?null:Math.trunc(r)}function Ke(t){const a=t.trim();return a===""?null:a}function Pr({open:t,onOpenChange:a,paperId:r,arxivId:l,initialEvaluations:i,paperTasks:c,onSuccess:o,submitMode:f="direct",isAdmin:u=!1,isAuthor:s=!1}){const N=Cr(c),[k,E]=m.useState([]),[w,P]=m.useState(null),[h,D]=m.useState(new Map),[U,T]=m.useState(new Map),M=me(),{toast:B}=he(),v=m.useRef(!1),d=m.useRef(!1);m.useEffect(()=>{if(!t){v.current=!1,d.current=!1;return}v.current||d.current||i.length!==0&&(v.current=!0,E(Er(i)),D(Sr(i)),T(Ir(i)))},[t,i]);const p=m.useMemo(()=>Array.from(new Set(k.map(g=>g.task_id).filter(g=>g&&g!==""))),[k]),y=m.useMemo(()=>{const g=new Set;return k.forEach(S=>{S.task_id&&S.dataset_id&&g.add(es(S.task_id,S.dataset_id))}),Array.from(g)},[k]),A=re({queryKey:["datasets-by-tasks-for-eval-edit",p,t],queryFn:async()=>{const g={};return await Promise.all(p.map(async S=>{try{const R=await Qt({task_id:parseInt(S),page_size:lt});g[S]=R.results}catch(R){console.error(`Error fetching datasets for task ${S}:`,R),g[S]=[]}})),g},enabled:t&&p.length>0});m.useEffect(()=>{A.data&&T(g=>{const S=new Map(g);return Object.values(A.data).forEach(R=>{R.forEach(b=>{S.set(b.id,b)})}),S})},[A.data]);const z=re({queryKey:["leaderboard-metrics-for-eval-edit",y,t],queryFn:async()=>{const g={};return await Promise.all(y.map(async S=>{const[R,b]=S.split(":");try{g[S]=await ca(b,R)}catch(j){console.error(`Error fetching metrics for leaderboard ${S}:`,j),g[S]=[]}})),g},enabled:t&&y.length>0}),K=async g=>{const S=await us({page_size:lt,...g?{q:g}:{}});return D(R=>{const b=new Map(R);return S.results.forEach(j=>b.set(j.id,j)),b}),S.results.map(R=>{var b;return{value:R.id,label:R.name,description:(b=R.description)==null?void 0:b.slice(0,100)}})},$=g=>async S=>{const R=await Qt({task_id:parseInt(g),page_size:lt,...S?{q:S}:{}});return T(b=>{const j=new Map(b);return R.results.forEach(Q=>j.set(Q.id,Q)),j}),R.results.map(b=>({value:b.id,label:b.name,description:b.full_name}))},O=(g,S)=>{if(!g||!S)return!1;const R=U.get(S);return!!(R!=null&&R.supports_harness)},x=(g,S,R)=>{var Q;if(!g||!S)return[];const j=(((Q=z.data)==null?void 0:Q[es(g,S)])||[]).map(q=>({value:q.metric_name,label:q.metric_name,description:q.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return R&&!j.some(q=>q.value===R)&&j.unshift({value:R,label:`${R} (legacy)`,description:void 0}),j},I=pe({mutationFn:async({paperId:g,evaluations:S})=>{if(f==="pending"){const b=[];for(const j of S){if(j.operation==="delete"&&j.id){b.push({op:"delete",evaluation_id:parseInt(j.id)});continue}const Q=O(j.task_id,j.dataset_id);if(j.operation==="create"){if(!Zt(j))continue;const q=ze(j.num_parameters),te={task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),metrics:{[j.metric_name]:j.metric_value},best_metric:j.metric_name},Ee=Ke(j.hf_model_url);j.model_name&&(te.model_name=j.model_name),Q&&j.harness&&(te.harness=j.harness),j.best_rank&&(te.best_rank=parseInt(j.best_rank)),q!=null&&(te.num_parameters=q),Ee!=null&&(te.hf_model_url=Ee),te.is_open=j.is_open,b.push({op:"create",data:te})}else if(j.operation==="update"&&j.id){const q={task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),model_name:j.model_name||void 0,harness:Q&&j.harness||null,metrics:{[j.metric_name]:j.metric_value},best_metric:j.metric_name,best_rank:j.best_rank?parseInt(j.best_rank):void 0,num_parameters:ze(j.num_parameters),hf_model_url:Ke(j.hf_model_url),is_open:j.is_open};b.push({op:"update",evaluation_id:parseInt(j.id),data:q})}}return b.length===0?{submitted:!1}:(await ve({paper_id:parseInt(g),edit_type:"evaluations",proposed_payload:{operations:b}}),{submitted:!0})}const R=[];for(const b of S)if(b.operation==="delete"&&b.id)R.push({operation:"delete",evaluation_id:parseInt(b.id)});else if(b.operation==="create"){if(!Zt(b))continue;const j=O(b.task_id,b.dataset_id),Q=ze(b.num_parameters);R.push({operation:"create",payload:{paper_id:parseInt(g),task_id:parseInt(b.task_id),dataset_id:parseInt(b.dataset_id),model_name:b.model_name||void 0,harness:j&&b.harness||void 0,metrics:{[b.metric_name]:b.metric_value},best_metric:b.metric_name,best_rank:b.best_rank?parseInt(b.best_rank):void 0,num_parameters:Q??void 0,hf_model_url:Ke(b.hf_model_url)??void 0,is_open:b.is_open}})}else if(b.operation==="update"&&b.id){const j=O(b.task_id,b.dataset_id);R.push({operation:"update",evaluation_id:parseInt(b.id),payload:{task_id:parseInt(b.task_id),dataset_id:parseInt(b.dataset_id),model_name:b.model_name||void 0,harness:j&&b.harness||null,metrics:{[b.metric_name]:b.metric_value},best_metric:b.metric_name,best_rank:b.best_rank?parseInt(b.best_rank):void 0,num_parameters:ze(b.num_parameters),hf_model_url:Ke(b.hf_model_url),is_open:b.is_open,harness_set:!0,num_parameters_set:!0,hf_model_url_set:!0}})}if(!u&&R.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");return R.length>0&&await la(parseInt(g),R),{submitted:R.length>0}},onSuccess:g=>{if(f==="pending"){g!=null&&g.submitted?B({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):B({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),o==null||o(),a(!1);return}M.invalidateQueries({queryKey:["paper-arxiv",l]}),M.invalidateQueries({queryKey:["evaluations","paper",r]}),o==null||o(),a(!1)},onError:g=>{var b;const S=g;let R=S.message||(f==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(S.response)try{const j=JSON.parse(S.response);typeof(j==null?void 0:j.detail)=="string"?R=j.detail:Array.isArray(j==null?void 0:j.detail)&&((b=j.detail[0])!=null&&b.msg)&&(R=j.detail[0].msg)}catch{R=S.response}B({title:f==="pending"?"Could not submit edit":"Could not save evaluations",description:R,variant:"destructive"})}}),L=()=>{d.current=!0,E([...k,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},F=g=>{if(d.current=!0,k[g].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;E(k.map((R,b)=>b===g?{...R,operation:"delete"}:R))}else E(k.filter((R,b)=>b!==g))},C=(g,S,R)=>{d.current=!0,E(k.map((b,j)=>{if(j!==g)return b;const Q={...b,[S]:R};return S==="task_id"&&(Q.dataset_id="",Q.metric_name="",Q.harness=""),S==="dataset_id"&&(Q.metric_name="",R&&!O(Q.task_id,R)&&(Q.harness="")),b.operation==="unchanged"&&(Q.operation="update"),Q}))},G=(g,S)=>{d.current=!0,E(k.map((R,b)=>{if(b!==g)return R;const j={...R,is_open:S};return R.operation==="unchanged"&&(j.operation="update"),j}))},X=()=>{const g=k.filter(S=>S.operation!=="delete"||S.id);I.mutate({paperId:r,evaluations:g})};return e.jsxs(ie,{open:t,onOpenChange:a,children:[e.jsxs(oe,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Evaluation Results"}),e.jsx(de,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),f==="pending"&&e.jsx(ye,{isAuthor:s}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[k.filter(g=>g.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 ${N?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),N&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:k.map((g,S)=>{if(g.operation==="delete")return null;const R=h.get(g.task_id),b=U.get(g.dataset_id),j=x(g.task_id,g.dataset_id,g.metric_name),Q=!!(g.task_id&&g.dataset_id)&&z.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(Jt,{value:g.task_id,onChange:q=>C(S,"task_id",q),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:R?{value:R.id,label:R.name}:null,queryKey:["eval-edit-task-search"],queryFn:K,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Jt,{value:g.dataset_id,onChange:q=>C(S,"dataset_id",q),placeholder:g.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:g.task_id?"No datasets found for this task.":"Select a task first.",disabled:!g.task_id,selectedOption:b?{value:b.id,label:b.name}:null,queryKey:["eval-edit-dataset-search",g.task_id],queryFn:$(g.task_id),enabled:t&&!!g.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Z,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:g.model_name,onChange:q=>C(S,"model_name",q.target.value)})}),N&&e.jsx("td",{className:"py-2 px-2",children:O(g.task_id,g.dataset_id)?e.jsx(Z,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:g.harness,onChange:q=>C(S,"harness",q.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!g.task_id||!g.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):Q?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(ne,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):j.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:g.metric_name,onChange:q=>C(S,"metric_name",q.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),j.map(q=>e.jsx("option",{value:q.value,children:q.label},q.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(Z,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:g.metric_value,onChange:q=>C(S,"metric_value",q.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Z,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:g.num_parameters,onChange:q=>C(S,"num_parameters",q.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Z,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:g.hf_model_url,onChange:q=>C(S,"hf_model_url",q.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:g.is_open,onChange:q=>G(S,q.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(H,{variant:"ghost",size:"sm",onClick:()=>F(S),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(Ye,{className:"w-4 h-4"})})})]},S)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ka,{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(H,{variant:"outline",size:"sm",onClick:L,className:"flex items-center space-x-2",children:[e.jsx(Xe,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(ue,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(H,{variant:"ghost",onClick:()=>P("benchmark"),children:"Suggest a new benchmark"}),e.jsx(H,{variant:"ghost",onClick:()=>P("metric"),children:"Suggest a new metric"})]}),e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:X,disabled:I.isPending,children:I.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),f==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),f==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(kt,{open:w!==null,onOpenChange:g=>{g||P(null)},paperId:r,kind:w??"benchmark"})]})}const ct=[{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 ts(t){return t.map(a=>a.trim()).filter(Boolean)}function dt(t,a){const r=ts(t).sort(),l=ts(a).sort();return r.length!==l.length?!1:r.every((i,c)=>i===l[c])}function $r(t,a){return dt(t.hf_models,a.hf_models)&&dt(t.hf_datasets,a.hf_datasets)&&dt(t.hf_spaces,a.hf_spaces)}function Rr({open:t,onOpenChange:a,paperId:r,arxivId:l,initialArtifacts:i,onSuccess:c,submitMode:o="direct",isAuthor:f=!1}){const[u,s]=m.useState(i),[N,k]=m.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),E=me(),{toast:w}=he(),P=m.useRef(!1);m.useEffect(()=>{if(!t){P.current=!1;return}P.current||(P.current=!0,s(i),k({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,i]);const h=pe({mutationFn:async({paperId:v,artifacts:d})=>o==="pending"?(await ve({paper_id:parseInt(v),edit_type:"hf_artifacts",proposed_payload:d}),null):da(v,d),onSuccess:v=>{if(o==="pending"){w({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),c==null||c(),a(!1),k({hf_models:"",hf_datasets:"",hf_spaces:""});return}v&&Ce(E,v,[r,l]),c==null||c(),a(!1),k({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:v=>{var y;const d=v;let p=d.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");if(d.response)try{const A=JSON.parse(d.response);typeof(A==null?void 0:A.detail)=="string"?p=A.detail:Array.isArray(A==null?void 0:A.detail)&&((y=A.detail[0])!=null&&y.msg)&&(p=A.detail[0].msg)}catch{p=d.response}w({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:p,variant:"destructive"})}}),D=()=>{const v={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:d}of ct){const p=N[d].trim();if(p){if(v[d].some(y=>y.trim()===p))return alert(`This ${d.replace("hf_","")} URL is already added`),null;v[d]=[...v[d],p]}}return v},U=v=>{const d=N[v].trim();if(d){if(u[v].some(p=>p.trim()===d)){alert(`This ${v.replace("hf_","")} URL is already added`);return}s(p=>({...p,[v]:[...p[v],d]})),k(p=>({...p,[v]:""}))}},T=(v,d)=>{s(p=>({...p,[v]:p[v].filter(y=>y!==d)}))},M=()=>{const v=D();if(v===null)return;const d=Object.keys(i).some(p=>i[p].some(y=>!v[p].includes(y)));o==="direct"&&d&&!window.confirm("Remove one or more Hugging Face artifact links?")||h.mutate({paperId:r,artifacts:v})},B=m.useMemo(()=>{const v={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:d}of ct){const p=N[d].trim();if(p){if(v[d].some(y=>y.trim()===p))return!1;v[d]=[...v[d],p]}}return!$r(v,i)},[u,N,i]);return e.jsx(ie,{open:t,onOpenChange:a,children:e.jsxs(oe,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Hugging Face Artifacts"}),e.jsx(de,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(ye,{isAuthor:f}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:ct.map(({key:v,label:d,placeholder:p})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:d}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(Z,{type:"url",placeholder:p,value:N[v],onChange:y=>k(A=>({...A,[v]:y.target.value})),onKeyPress:y=>{y.key==="Enter"&&(y.preventDefault(),U(v))},className:"flex-1"}),e.jsxs(H,{onClick:()=>U(v),size:"sm",disabled:!N[v].trim(),children:[e.jsx(Xe,{className:"w-4 h-4 mr-1"}),"Add"]})]}),u[v].length>0?e.jsx("div",{className:"space-y-2",children:u[v].map(y=>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:y}),e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>T(v,y),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${d.toLowerCase()} URL`,children:e.jsx(Ye,{className:"w-4 h-4"})})]},y))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",d.toLowerCase()," linked yet."]})]},v))}),e.jsxs(ue,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:M,disabled:h.isPending||!B,children:h.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(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const Ar=({open:t,onOpenChange:a,paperId:r,initialOrganizationIds:l,submitMode:i,isAuthor:c})=>{var k;const[o,f]=m.useState(l),u=me();m.useEffect(()=>{t&&f(l)},[l,t]);const s=re({queryKey:["organizations","curation"],queryFn:()=>ma(!1),enabled:t}),N=pe({mutationFn:async()=>{l.some(w=>!o.includes(w))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")||(i==="pending"?await ve({paper_id:Number(r),edit_type:"organizations",proposed_payload:{organization_ids:o}}):await ua(r,o))},onSuccess:()=>{u.invalidateQueries({queryKey:["paper-arxiv"]}),a(!1)}});return e.jsx(ie,{open:t,onOpenChange:a,children:e.jsxs(oe,{children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit organizations"}),e.jsx(de,{children:"Associate existing organizations with this paper. Organization creation remains admin-only."})]}),i==="pending"&&e.jsx(ye,{isAuthor:c}),e.jsx("div",{className:"max-h-80 space-y-2 overflow-auto",children:(k=s.data)==null?void 0:k.results.map(E=>{const w=Number(E.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes(w),onChange:P=>f(h=>P.target.checked?[...h,w]:h.filter(D=>D!==w))}),E.name]},E.id)})}),e.jsxs(ue,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:()=>N.mutate(),disabled:N.isPending,children:i==="pending"?"Submit test edit":"Save changes"})]})]})})},Ne=["my-bookmark-ids"];function Fr(){var l,i;const{user:t}=We(),a=re({queryKey:Ne,queryFn:()=>xe.getMyBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),r=_t.useMemo(()=>{var c;return new Set(((c=a.data)==null?void 0:c.paper_ids)??[])},[(l=a.data)==null?void 0:l.paper_ids]);return{ids:((i=a.data)==null?void 0:i.paper_ids)??[],idSet:r,isLoading:a.isLoading,isError:a.isError}}function Lr(){const{user:t}=We(),a=me(),r=pe({mutationFn:async({paperId:i,isBookmarked:c})=>{c?await xe.removeBookmark(i):await xe.addBookmark(i)},onMutate:async({paperId:i,isBookmarked:c})=>{await a.cancelQueries({queryKey:Ne});const o=a.getQueryData(Ne),f=typeof i=="string"?Number(i):i,u=(o==null?void 0:o.paper_ids)??[],s=c?u.filter(N=>N!==f):[f,...u.filter(N=>N!==f)];return a.setQueryData(Ne,{paper_ids:s}),{previous:o}},onError:(i,c,o)=>{o!=null&&o.previous&&a.setQueryData(Ne,o.previous)},onSettled:()=>{a.invalidateQueries({queryKey:Ne}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:_t.useCallback((i,c)=>{if(!t){if(ms())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=hs(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}r.mutate({paperId:i,isBookmarked:c})},[r,t]),isPending:r.isPending}}const Tr=({paperId:t})=>{const{user:a}=We(),{idSet:r}=Fr(),{toggle:l,isPending:i}=Lr();if(ms())return null;const c=Number(t),o=!!a&&r.has(c),f=()=>{Number.isFinite(c)&&l(c,o)},u=a&&o?"Saved":"Save",s=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:f,disabled:i,"aria-pressed":o,"aria-label":s,title:s,children:[e.jsx(W,{name:"bookmark",size:12}),u]})};function Oe({children:t,showEdit:a=!1,onEdit:r,editAriaLabel:l}){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":l,children:"edit"})]}):t}const Ur={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals",start:Wa,get:Ja,cancel:Va},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper",start:Qa,get:Ga,cancel:Oa}};function Br({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(Za,{remarkPlugins:[er],components:{a:({children:a,...r})=>e.jsx("a",{...r,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:a}),p:({children:a})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:a}),ul:({children:a})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:a}),ol:({children:a})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:a}),h1:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),h2:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),h3:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),code:({children:a})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:a}),pre:({children:a})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:a})},children:t})})}function Cs({kind:t,paperId:a,paperTitle:r,triggerClassName:l,onComplete:i}){const c=Ur[t],[o,f]=m.useState(!1),[u,s]=m.useState(null),[N,k]=m.useState(!1),[E,w]=m.useState(null),P=m.useRef(null),h=(u==null?void 0:u.status)==="queued"||(u==null?void 0:u.status)==="dispatching"||(u==null?void 0:u.status)==="running",D=u==null?void 0:u.id;m.useEffect(()=>{if(!h||!D)return;let B=!1;const v=window.setInterval(async()=>{try{const d=await c.get(D);B||(s(d),w(null))}catch(d){B||w(d instanceof Error?d.message:"Could not check job status.")}},2e3);return()=>{B=!0,window.clearInterval(v)}},[h,c,D]),m.useEffect(()=>{(u==null?void 0:u.status)!=="completed"||P.current===u.id||(P.current=u.id,i())},[u,i]);const U=async()=>{k(!0),w(null);try{s(await c.start(a))}catch(B){w(B instanceof Error?B.message:"Could not start Codex.")}finally{k(!1)}},T=()=>{s(null),w(null),P.current=null},M=async()=>{if(u){w(null);try{s(await c.cancel(u.id))}catch(B){w(B instanceof Error?B.message:"Could not cancel Codex.")}}};return e.jsxs(ie,{open:o,onOpenChange:f,children:[e.jsx("button",{type:"button",className:l,onClick:()=>f(!0),children:h?c.running:(u==null?void 0:u.status)==="completed"?c.complete:c.trigger}),e.jsxs(oe,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(le,{className:"min-w-0",children:[e.jsx(ce,{children:c.title}),e.jsx(de,{children:c.description(r)})]}),u?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",u.status]}),u.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:u.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),h&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[u.status==="queued"?"This job is queued and will start after the current Codex job finishes.":c.progress," ","This can take several minutes; you can close this window and return."]}),u.report&&e.jsx(Br,{report:u.report}),u.error&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:u.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:c.notice}),E&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:E}),e.jsxs(ue,{children:[e.jsx(H,{variant:"outline",onClick:()=>f(!1),children:h?"Close":"Cancel"}),h&&e.jsx(H,{variant:"outline",onClick:()=>void M(),children:"Cancel job"}),!u&&e.jsx(H,{onClick:U,disabled:N,children:N?"Starting…":c.action}),u&&!h&&e.jsx(H,{variant:"outline",onClick:T,children:"Run again"})]})]})]})}function Dr(t){return e.jsx(Cs,{...t,kind:"add-evals",triggerClassName:"edit-link"})}function Mr(t){return e.jsx(Cs,{...t,kind:"enrich-paper",triggerClassName:"action-btn"})}var Ct="Radio",[Hr,Es]=yt(Ct),[qr,zr]=Hr(Ct),Ss=m.forwardRef((t,a)=>{const{__scopeRadio:r,name:l,checked:i=!1,required:c,disabled:o,value:f="on",onCheck:u,form:s,...N}=t,[k,E]=m.useState(null),w=Te(a,D=>E(D)),P=m.useRef(!1),h=k?s||!!k.closest("form"):!0;return e.jsxs(qr,{scope:r,checked:i,disabled:o,children:[e.jsx(_e.button,{type:"button",role:"radio","aria-checked":i,"data-state":Rs(i),"data-disabled":o?"":void 0,disabled:o,value:f,...N,ref:w,onClick:Le(t.onClick,D=>{i||u==null||u(),h&&(P.current=D.isPropagationStopped(),P.current||D.stopPropagation())})}),h&&e.jsx($s,{control:k,bubbles:!P.current,name:l,value:f,checked:i,required:c,disabled:o,form:s,style:{transform:"translateX(-100%)"}})]})});Ss.displayName=Ct;var Is="RadioIndicator",Ps=m.forwardRef((t,a)=>{const{__scopeRadio:r,forceMount:l,...i}=t,c=zr(Is,r);return e.jsx(os,{present:l||c.checked,children:e.jsx(_e.span,{"data-state":Rs(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})})});Ps.displayName=Is;var Kr="RadioBubbleInput",$s=m.forwardRef(({__scopeRadio:t,control:a,checked:r,bubbles:l=!0,...i},c)=>{const o=m.useRef(null),f=Te(o,c),u=fs(r),s=cs(a);return m.useEffect(()=>{const N=o.current;if(!N)return;const k=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(k,"checked").set;if(u!==r&&w){const P=new Event("click",{bubbles:l});w.call(N,r),N.dispatchEvent(P)}},[u,r,l]),e.jsx(_e.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:f,style:{...i.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$s.displayName=Kr;function Rs(t){return t?"checked":"unchecked"}var Or=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tt="RadioGroup",[Gr]=yt(tt,[ps,Es]),As=ps(),Fs=Es(),[Qr,Vr]=Gr(tt),Ls=m.forwardRef((t,a)=>{const{__scopeRadioGroup:r,name:l,defaultValue:i,value:c,required:o=!1,disabled:f=!1,orientation:u,dir:s,loop:N=!0,onValueChange:k,...E}=t,w=As(r),P=ha(s),[h,D]=ls({prop:c,defaultProp:i??null,onChange:k,caller:tt});return e.jsx(Qr,{scope:r,name:l,required:o,disabled:f,value:h,onValueChange:D,children:e.jsx(pa,{asChild:!0,...w,orientation:u,dir:P,loop:N,children:e.jsx(_e.div,{role:"radiogroup","aria-required":o,"aria-orientation":u,"data-disabled":f?"":void 0,dir:P,...E,ref:a})})})});Ls.displayName=tt;var Ts="RadioGroupItem",Us=m.forwardRef((t,a)=>{const{__scopeRadioGroup:r,disabled:l,...i}=t,c=Vr(Ts,r),o=c.disabled||l,f=As(r),u=Fs(r),s=m.useRef(null),N=Te(a,s),k=c.value===i.value,E=m.useRef(!1);return m.useEffect(()=>{const w=h=>{Or.includes(h.key)&&(E.current=!0)},P=()=>E.current=!1;return document.addEventListener("keydown",w),document.addEventListener("keyup",P),()=>{document.removeEventListener("keydown",w),document.removeEventListener("keyup",P)}},[]),e.jsx(fa,{asChild:!0,...f,focusable:!o,active:k,children:e.jsx(Ss,{disabled:o,required:c.required,checked:k,...u,...i,name:c.name,ref:N,onCheck:()=>c.onValueChange(i.value),onKeyDown:Le(w=>{w.key==="Enter"&&w.preventDefault()}),onFocus:Le(i.onFocus,()=>{var w;E.current&&((w=s.current)==null||w.click())})})})});Us.displayName=Ts;var Jr="RadioGroupIndicator",Bs=m.forwardRef((t,a)=>{const{__scopeRadioGroup:r,...l}=t,i=Fs(r);return e.jsx(Ps,{...i,...l,ref:a})});Bs.displayName=Jr;var Ds=Ls,Ms=Us,Wr=Bs;const gt=m.forwardRef(({className:t,...a},r)=>e.jsx(Ds,{className:Ve("grid gap-2",t),...a,ref:r}));gt.displayName=Ds.displayName;const Ae=m.forwardRef(({className:t,...a},r)=>e.jsx(Ms,{ref:r,className:Ve("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(Wr,{className:"flex items-center justify-center",children:e.jsx(ga,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Ae.displayName=Ms.displayName;const Xr={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},xt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,Yr=20,bt="copy_to_bucket";function jt(t){return`pwc:bucket-copy:${t}`}function Zr(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(bt)!==t)return null;try{const r=window.sessionStorage.getItem(jt(t));if(!r)return null;const l=JSON.parse(r);return l.paperId!==t||typeof l.bucketId!="string"||!["new","existing"].includes(l.destinationMode)||!["public","private"].includes(l.visibility)||!Array.isArray(l.selectedIds)||l.selectedIds.some(i=>typeof i!="string")?null:l}catch{return null}}function en(t,a=Yr){if(a<1)throw new Error("Bucket copy batch size must be positive");const r=[];for(let l=0;l!xt.test(u)))return null;const o=c.join("/"),f=a==="model"?"":`${a}s/`;return{id:`${a}:${o}`,kind:a,label:o,url:`https://huggingface.co/${f}${o}`,source:`hf://${f}${o}/`,destination:`${a}s/${o}/`,repoId:o}}catch{return null}}function tn(t){try{const a=new URL(t);if(a.hostname!=="github.com"&&a.hostname!=="www.github.com")return null;const r=a.pathname.split("/").filter(Boolean);if(r.length<2)return null;const l=r[0],i=r[1].replace(/\.git$/,"");if(!xt.test(l)||!xt.test(i))return null;const c=`${l}/${i}`;return{id:`github:${c}`,kind:"github",label:c,url:`https://github.com/${c}`,source:`https://github.com/${c}.git`,destination:`github/${c}/`}}catch{return null}}function sn({githubUrls:t,hfModelUrls:a,hfDatasetUrls:r,hfSpaceUrls:l,paperId:i,pdfName:c,pdfUrl:o}){const f=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${c||i}.pdf`}:null,...a.map(s=>ut(s,"model")),...r.map(s=>ut(s,"dataset")),...l.map(s=>ut(s,"space")),...t.map(tn)],u=new Set;return f.filter(s=>!s||u.has(s.id)?!1:(u.add(s.id),!0))}function an(t,a,r){const l=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${Ge(t.trim())}`];r.create&&l.push(`hf buckets create "$HF_BUCKET" --exist-ok${r.isPrivate?" --private":""}`);for(const o of a.filter(f=>f.kind!=="github"&&f.kind!=="pdf"))l.push(`hf cp ${Ge(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const i=a.find(o=>o.kind==="pdf");i&&l.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${Ge(i.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${i.destination}"`);const c=a.filter(o=>o.kind==="github");if(c.length){l.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of c){const f=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;l.push(`git clone --depth 1 -- ${Ge(o.source)} "${f}"`,`hf sync "${f}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return l.join(` +`)}function rn(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function nn(t){const{toast:a}=he(),r=m.useMemo(()=>sn({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),l=m.useMemo(()=>Zr(t.paperId),[t.paperId]),[i,c]=m.useState(!!l),[o,f]=m.useState((l==null?void 0:l.destinationMode)??"new"),[u,s]=m.useState((l==null?void 0:l.bucketId)??""),[N,k]=m.useState((l==null?void 0:l.visibility)??"public"),[E,w]=m.useState(()=>new Set((l==null?void 0:l.selectedIds)??r.map($=>$.id))),[P,h]=m.useState(!1),[D,U]=m.useState(null),[T,M]=m.useState(!!l),B=r.filter($=>E.has($.id)),v=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/.test(u.trim()),d=an(u,B,{create:o==="new",isPrivate:N==="private"}),p=($,O)=>{w(x=>{const I=new Set(x);return O?I.add($):I.delete($),I})},y=async()=>{try{await navigator.clipboard.writeText(d),a({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},A=m.useCallback(()=>{const $=xa("/api/v1/auth/hf/login"),O=new URL(window.location.href);O.searchParams.set(bt,t.paperId),window.sessionStorage.setItem(jt(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:u.trim(),destinationMode:o,visibility:N,selectedIds:Array.from(E)}));const x=new URLSearchParams({return_to:O.toString(),authorize_bucket:"true"});o==="new"&&x.set("bucket_create","true"),window.location.assign(`${$}?${x.toString()}`)},[u,o,t.paperId,E,N]),z=m.useCallback(async()=>{if(!t.isSignedIn){A();return}h(!0);let $=0,O=0;try{const x=B.filter(F=>F.kind!=="pdf"&&F.kind!=="github"&&!!F.repoId).map(F=>({kind:F.kind,repo_id:F.repoId})),I=en(x);I.length||I.push([]);for(const[F,C]of I.entries()){U({current:F+1,total:I.length});const G=await ba(t.paperId,{bucket_id:u.trim(),create:F===0&&o==="new",private:N==="private",include_pdf:F===0&&B.some(X=>X.kind==="pdf"),artifacts:C});$+=G.copied.length,O+=G.errors.length}const L=B.filter(F=>F.kind==="github").length;a({title:O?"Bucket copy partially completed":"Copied to bucket",description:[`${$} item${$===1?"":"s"} copied.`,O?`${O} item${O===1?"":"s"} failed.`:"",L?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:O?"destructive":void 0}),!O&&!L&&c(!1)}catch(x){if(x instanceof Vt&&x.code==="bucket_authorization_required"){A();return}a({title:$?"Bucket copy partially completed":"Bucket copy failed",description:$?`${$} item${$===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:x instanceof Vt&&typeof x.detail=="string"?x.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{h(!1),U(null)}},[A,u,o,t.isSignedIn,t.paperId,B,a,N]);m.useEffect(()=>{if(!T||!t.isSignedIn)return;M(!1),window.sessionStorage.removeItem(jt(t.paperId));const $=new URL(window.location.href);$.searchParams.delete(bt),window.history.replaceState({},"",`${$.pathname}${$.search}${$.hash}`),z()},[z,t.isSignedIn,t.paperId,T]);const K=()=>{w(new Set(r.map($=>$.id))),!u&&t.suggestedBucketId&&s(t.suggestedBucketId),c(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:K,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:r.length?`${r.length} linked artifact${r.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(ie,{open:i,onOpenChange:c,children:e.jsxs(oe,{className:"max-h-[90vh] max-w-2xl overflow-y-auto",children:[e.jsxs(le,{children:[e.jsxs(ce,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(de,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),r.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Choose your destination"}),e.jsxs(gt,{value:o,onValueChange:$=>f($),className:"grid grid-cols-2 gap-2",children:[e.jsxs(ae,{className:"bucket-choice",children:[e.jsx(Ae,{value:"new"}),"New bucket"]}),e.jsxs(ae,{className:"bucket-choice",children:[e.jsx(Ae,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(Z,{id:"bucket-id",value:u,onChange:$=>s($.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":u.length>0&&!v}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Bucket visibility"}),e.jsxs(gt,{value:N,onValueChange:$=>k($),className:"flex gap-5",children:[e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Ae,{value:"public"}),"Public"]}),e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Ae,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Artifacts"}),e.jsx("div",{className:"bucket-artifact-list",children:r.map($=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(et,{id:`bucket-artifact-${$.id}`,checked:E.has($.id),onCheckedChange:O=>p($.id,O===!0)}),e.jsxs(ae,{htmlFor:`bucket-artifact-${$.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:Xr[$.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:$.label})]}),e.jsxs("a",{href:$.url,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(W,{name:"external",size:10})]})]},$.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands",children:v?d:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."}),e.jsxs(ue,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(H,{type:"button",onClick:y,variant:"outline",disabled:!v||B.length===0,children:[e.jsx(W,{name:"copy",size:12}),"Copy commands"]}),e.jsx(H,{type:"button",onClick:z,disabled:P||t.isSignedIn&&(!v||!B.some($=>$.kind!=="github")),children:P?D&&D.total>1?`Copying ${D.current}/${D.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}const on={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL"},Qe=360,mt=3,ss=3,ln=["tldr","abstract","tasks","methods","results"];function cn(t){if(!t)return{section:null,resultsTaskSlug:null};const[a,r]=t.split("?",2);if(!ln.includes(a))return{section:null,resultsTaskSlug:null};const l=a;return l!=="results"||!r?{section:l,resultsTaskSlug:null}:{section:l,resultsTaskSlug:new URLSearchParams(r).get("task")}}function as(t){return`results-task-${t}`}function dn(t){return`#results?task=${encodeURIComponent(t)}`}function $e({id:t,label:a,accent:r}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:t,children:[e.jsx("span",{children:e.jsx("a",{href:`#${t}`,className:"section-anchor-link",children:a})}),r]})}function rs(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ns(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function is(t,a){try{const r=new URL(t),i=r.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return i?i.replace(/[-_]+/g," "):r.hostname.replace(/^www\./,"")}catch{return a}}const Dn=()=>{var Ut,Bt,Dt,Mt,Ht,qt,zt,Kt,Ot,Gt;const{arxivId:t}=ja(),a=t?va(t):"",r=ya(),{toast:l}=he(),{user:i}=We(),c=(i==null?void 0:i.is_admin)??!1,o=!!i,f=tr(i),u=!0,{data:s,isLoading:N,error:k,refetch:E}=Ma(a||"",!!a),[w,P]=m.useState(!1);m.useEffect(()=>{if(!t||t===a)return;const n=window.location.search+window.location.hash;r(`/paper/${a}${n}`,{replace:!0})},[a,r,t]),m.useEffect(()=>{if(s!=null&&s.title)return document.title=Ba(s.title),()=>{document.title=Da}},[s==null?void 0:s.title]),m.useEffect(()=>{if(P(!1),!(s!=null&&s.id))return;const n=window.setTimeout(()=>P(!0),0);return()=>window.clearTimeout(n)},[s==null?void 0:s.id]);const{data:h,isLoading:D}=lr(w?s==null?void 0:s.arxiv_id:void 0),{data:U,isLoading:T,refetch:M}=rr(s==null?void 0:s.id,w&&!!(s!=null&&s.id));m.useEffect(()=>{const n=()=>{E(),M(),f==="direct"&&(s!=null&&s.id)&&(xe.primePaperCurationState(s.id,!0).catch(()=>{}),xe.primeEvaluationCurationState(s.id,!0).catch(()=>{})),l({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",n),()=>window.removeEventListener("pwc:catalog-conflict",n)},[f,s==null?void 0:s.id,E,M,l]);const{preferences:B}=_a(),v=m.useMemo(()=>!U||!B.hide_closed_source_evals?U:U.filter(n=>n.is_open!==!1),[U,B.hide_closed_source_evals]),d=m.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]),p=m.useMemo(()=>{const n=(_,V,J)=>{const se=new Set,Y=[];for(const ee of[..._,...V??[]])se.has(ee)||(se.add(ee),Y.push({href:ee,label:is(ee,J)}));return Y};return{models:n(d.models,h==null?void 0:h.modelUrls,"Model"),datasets:n(d.datasets,h==null?void 0:h.datasetUrls,"Dataset"),spaces:n(d.spaces,h==null?void 0:h.spaceUrls,"Space")}},[d.models,d.datasets,d.spaces,h==null?void 0:h.modelUrls,h==null?void 0:h.datasetUrls,h==null?void 0:h.spaceUrls]),y=m.useMemo(()=>{if(!v)return[];const n=new Map;for(const _ of v){const V=_.task_id,J=n.get(V);J?J.rows.push(_):n.set(V,{taskId:V,taskName:_.task_name||"—",taskSlug:_.task_slug,rows:[_]})}return Array.from(n.values())},[v]),A=m.useMemo(()=>y.map(n=>n.taskSlug??"").join("|"),[y]),z=re({queryKey:["paper-versions",s==null?void 0:s.arxiv_id],queryFn:async()=>{const n=s.arxiv_id.replace(/v\d+$/,""),_=await fetch(hs(`/api/v1/papers/arxiv/${n}/versions`));return _.ok?await _.json():[]},enabled:w&&!!(s!=null&&s.arxiv_id),staleTime:10*60*1e3}),K=re({queryKey:["related-papers",s==null?void 0:s.id],queryFn:()=>xe.getRelatedPapers(s.arxiv_id||s.id,4),enabled:w&&!!(s!=null&&s.id),staleTime:10*60*1e3}),[$,O]=m.useState(!1),[x,I]=m.useState(!1),[L,F]=m.useState(!1),C=m.useRef(!1);m.useEffect(()=>{C.current=!1},[a]),m.useEffect(()=>{let n=0;const _=(J=!1,se=!1)=>{const{section:Y,resultsTaskSlug:ee}=cn(window.location.hash.slice(1));if(!Y||!s||Y==="tldr"&&!s.tldr||Y==="results"&&(!w||T)||!J&&C.current)return;let we=null;if(Y==="results"&&ee){if(we=document.getElementById(as(ee)),!we){if(y.find(ea=>ea.taskSlug===ee))return;we=document.getElementById("results")}}else we=document.getElementById(Y);if(!we)return;const Zs=we;n=window.requestAnimationFrame(()=>{C.current=!0,Zs.scrollIntoView({block:"start",behavior:se?"smooth":"auto"})})};_();const V=()=>{C.current=!1,_(!0,!0)};return window.addEventListener("hashchange",V),()=>{window.removeEventListener("hashchange",V),n&&window.cancelAnimationFrame(n)}},[s,s==null?void 0:s.tldr,w,T,A,y]);const{activeEditor:G,openEditor:X,setEditorOpen:g}=ur();m.useEffect(()=>{f!=="direct"||!(s!=null&&s.id)||(G&&G!=="results"&&xe.primePaperCurationState(s.id).catch(()=>{}),G==="results"&&xe.primeEvaluationCurationState(s.id).catch(()=>{}))},[G,f,s==null?void 0:s.id]);const[S,R]=m.useState(null);m.useEffect(()=>{if(!i||!s)return;const n=sessionStorage.getItem("pwc:fresh-auth-edit");if(!n)return;sessionStorage.removeItem("pwc:fresh-auth-edit");const _=dr(n);_&&X(_)},[X,s,i]);const b=m.useMemo(()=>{if(!i||!(s!=null&&s.author_links))return!1;const n=i.username.toLowerCase();return s.author_links.some(_=>!!_.hf_username&&_.hf_username.toLowerCase()===n)},[i,s==null?void 0:s.author_links]),j=n=>{if(!o){R(n);return}X(n)},[Q,q]=m.useState("idle"),[te,Ee]=m.useState(null),[Et,St]=m.useState(null),Hs=async()=>{if(a){q("indexing"),Ee(null),St(null);try{await Ia(a),l({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>E(),1200),q("idle")}catch(n){const _=n;let V=_.message||"Failed to index paper";if(_.response)try{V=JSON.parse(_.response).detail||V}catch{V=_.response}Ee(V),(_.status===429||_.status===503)&&St("Try again later after arXiv has lifted the temporary limit."),q("idle")}}},{citationDisplay:qs,citationCopy:It}=m.useMemo(()=>{if(!s)return{citationDisplay:"",citationCopy:""};const n=`${s.title.slice(0,60)}${s.title.length>60?"…":""}`,_=`${s.authors[0]||""}${s.authors.length>1?" et al.":""}`,V=s.authors.join(" and "),J=(s.published||"").slice(0,4)||"—",se=(Y,ee)=>s.arxiv_id?`@article{${s.arxiv_id.replace(".","")}, + title={{${Y}}}, + author=${ee}, + year={{${J}}}, + eprint={{${s.arxiv_id}}}, + archivePrefix={{arXiv}} +}`:`@misc{paper${s.id}, + title={{${Y}}}, + author=${ee}, + year={{${J}}}, + url={{${s.source_url||s.url_abs||""}}} +}`;return{citationDisplay:se(n,`{{${_}}}`),citationCopy:se(s.title,`{${V}}`)}},[s]),Pt=m.useMemo(()=>sr(s==null?void 0:s.leaderboard_ranks),[s==null?void 0:s.leaderboard_ranks]),[zs,$t]=m.useState(!1),Ks=async()=>{if(It)try{await navigator.clipboard.writeText(It),$t(!0),l({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>$t(!1),1500)}catch{l({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},Os=async()=>{if(!s)return;const n=s.arxiv_id||s.id,_=ar(n,Pt);if(_)try{await navigator.clipboard.writeText(_),l({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{l({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(N)return e.jsxs("div",{className:"page",children:[e.jsx(Re,{className:"h-12 w-3/4 mb-4"}),e.jsx(Re,{className:"h-6 w-1/3 mb-8"}),e.jsx(Re,{className:"h-64 w-full"})]});if(k||!s)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(ge,{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."]}),te&&e.jsx(Ha,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(qa,{children:[e.jsx("div",{children:te}),Et&&e.jsx("div",{className:"mt-2",children:Et})]})}),e.jsxs("div",{className:"action-row",children:[c&&e.jsxs("button",{className:"action-btn",onClick:Hs,disabled:Q==="indexing",children:[e.jsx(W,{name:"sparkle",size:12}),Q==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(H,{variant:"outline",onClick:()=>r("/papers"),children:"Browse Papers"})]})]});const Rt=z.data||[],Se=Ua(s.repositories),fe=[...s.repositories??[]].sort((n,_)=>{const V=n.is_official?1:0,J=_.is_official?1:0;return V!==J?J-V:(_.num_stars||0)-(n.num_stars||0)}),Gs=L?fe:fe.slice(0,mt),st={models:[...new Set([...d.models,...(h==null?void 0:h.modelUrls)??[]])],datasets:[...new Set([...d.datasets,...(h==null?void 0:h.datasetUrls)??[]])],spaces:[...new Set([...d.spaces,...(h==null?void 0:h.spaceUrls)??[]])]},at=((Ut=s.arxiv_id)==null?void 0:Ut.replace(/v\d+$/,""))??null,rt=s.arxiv_id?{isLoading:D,paperHref:`https://huggingface.co/papers/${at}`,rows:[{label:"Models",href:pt(`https://huggingface.co/models?other=arxiv:${s.arxiv_id}`,d.models),count:ft(d.models,h==null?void 0:h.modelUrls,h==null?void 0:h.models),isLimited:h==null?void 0:h.isLimited,links:p.models},{label:"Datasets",href:pt(`https://huggingface.co/datasets?other=arxiv:${s.arxiv_id}`,d.datasets),count:ft(d.datasets,h==null?void 0:h.datasetUrls,h==null?void 0:h.datasets),isLimited:h==null?void 0:h.isLimited,links:p.datasets},{label:"Spaces",href:pt(`https://huggingface.co/papers/${at}`,d.spaces),count:ft(d.spaces,h==null?void 0:h.spaceUrls,h==null?void 0:h.spaces),isLimited:h==null?void 0:h.isLimited,links:p.spaces}],footer:`Cite arxiv.org/abs/${at} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:ht(d.models),count:d.models.length,links:p.models},{label:"Datasets",href:ht(d.datasets),count:d.datasets.length,links:p.datasets},{label:"Spaces",href:ht(d.spaces),count:d.spaces.length,links:p.spaces}],footer:null},At=s.tldr||null,Ft=s.num_pages||null,ke=s.abstract||"",Qs=ke.length>Qe?ke.slice(0,Qe)+"…":ke,Vs=$||ke.length<=Qe?ke:Qs,Ue=(s.methods||[]).filter(n=>n.source_paper_id===s.id),Be=s.introduced_benchmarks||[],Ie=s.introduced_frameworks||[],Js=Ue.length>0||Be.length>0||Ie.length>0,Lt=s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource",Ws=s.source==="external"?"Source page":"arXiv page",Pe=((Bt=s.project_pages)==null?void 0:Bt.filter(n=>n.url))??[],Xs=(()=>{const n=[];return Ue.length>0&&n.push(Ue.length===1?"this method":"these methods"),Be.length>0&&n.push(Be.length===1?"this benchmark":"these benchmarks"),Ie.length>0&&n.push(Ie.length===1?"this framework":"these frameworks"),n.length===0?"":n.length===1?n[0]:n.join(" and ")})(),De=s.predecessor_papers||[],Me=s.successor_papers||[],Ys=De.length>0||Me.length>0,He=12,nt=s.authors.map((n,_)=>{var V,J,se,Y;return{name:n,id:((J=(V=s.author_links)==null?void 0:V[_])==null?void 0:J.id)??null,hf_username:((Y=(se=s.author_links)==null?void 0:se[_])==null?void 0:Y.hf_username)??null}}),Tt=x||nt.length<=He?nt:nt.slice(0,He);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(ge,{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(qe,{title:s.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:Lt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",rs(s.published)]}),Ft&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Ft," 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}$/,"")})]}),Rt.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:s.version,onChange:n=>{const _=n.target.value;s.arxiv_id&&r(`/paper/${s.arxiv_id.replace(/v\d+$/,"")}${_?`?version=${_}`:""}`)},children:Rt.map(n=>e.jsxs("option",{value:n.version,children:[n.version," — ",rs(n.published)]},n.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Tt.map((n,_)=>e.jsxs(_t.Fragment,{children:[n.id?e.jsx(ge,{to:`/authors/${n.id}`,children:n.name}):n.hf_username?e.jsx("a",{href:`https://huggingface.co/${n.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${n.hf_username} on Hugging Face`,children:n.name}):e.jsx("a",{children:n.name}),_He&&e.jsx("button",{className:"show-more-authors",onClick:()=>I(n=>!n),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:x?"show fewer":`+${s.authors.length-He} 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(W,{name:"pdf",size:12})," View PDF"]}),s.url_abs&&e.jsx(Oe,{showEdit:s.source==="external"&&u,onEdit:()=>j("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:s.source==="external"&&u?"action-btn-segment action-btn-main":"action-btn",href:s.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(W,{name:"external",size:12})," ",Ws]})}),rt.paperHref&&(h==null?void 0:h.paperExists)&&e.jsxs("a",{className:"bm-action-btn",href:rt.paperHref,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Hugging Face",children:["View on ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})]}),Se.githubUrl&&e.jsx(Oe,{showEdit:u,onEdit:()=>j("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Se.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(W,{name:"github",size:12})," Code",Se.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",ns(Se.github)," ★"]})]})}),Se.githubUrl?null:e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>j("repositories"),title:"Add GitHub repository",children:[e.jsx(W,{name:"github",size:12})," Add code"]}),Pe.length===1?e.jsx(Oe,{showEdit:u,onEdit:()=>j("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Pe[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(W,{name:"globe",size:12})," Project page"]})}):null,Pe.length>1?e.jsx(Oe,{showEdit:u,onEdit:()=>j("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(ka,{children:[e.jsx(wa,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(W,{name:"globe",size:12})," Project page"]})}),e.jsx(Na,{align:"start",className:"project-page-menu",children:Pe.map((n,_)=>e.jsx(Ca,{asChild:!0,children:e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",children:is(n.url,`Project page ${_+1}`)})},n.url))})]})}):null,Pe.length===0&&o?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>j("project-pages"),title:"Add project page",children:[e.jsx(W,{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(W,{name:"external",size:12})," Conference"]}),(s.organizations||[]).map(n=>e.jsxs(ge,{to:`/orgs/${n.slug}`,className:"action-btn",title:n.name,"aria-label":n.name,children:[n.logo_url&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:16,width:16,borderRadius:3,overflow:"hidden"},children:e.jsx("img",{src:n.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:_=>{_.currentTarget.style.display="none"}})}),n.name]},n.id)),e.jsx("button",{type:"button",className:"action-btn",onClick:()=>j("organizations"),children:"Edit organizations"}),c&&Xa()&&e.jsx(Mr,{paperId:Number(s.id),paperTitle:s.title,onComplete:()=>void E()}),e.jsx(Tr,{paperId:s.id})]}),s.leaderboard_ranks&&s.leaderboard_ranks.length>0&&e.jsx(Pa,{wrap:!0,paperHref:`/paper/${s.arxiv_id||s.id}`,ranks:s.leaderboard_ranks.filter(n=>n.best_rank>=1&&n.best_rank<=3).map(n=>({name:n.dataset_name,slug:n.dataset_slug||null,rank:n.best_rank}))})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx($a,{paperId:s.arxiv_id||s.id,title:s.title,thumbnailUrl:Ea(s.thumbnail_url),priority:!0})})]}),Js&&e.jsxs("div",{className:`introduced-banner${Ie.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Ue.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/methods/${n.slug||n.id}`),children:[n.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${n.id}`)),Be.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/benchmark/${n.slug||n.id}`),children:[n.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${n.id}`)),Ie.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/frameworks#framework-${n.slug}`),children:[n.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${n.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Xs,"."]})]}),Ys&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Me.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Me.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Me.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>r(`/paper/${n.route_identifier}`),children:[e.jsx(qe,{title:n.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${n.id}`))})]}),De.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:De.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:De.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>r(`/paper/${n.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(qe,{title:n.title})]},`predecessor-${n.id}`))})]})]}),At&&e.jsxs(e.Fragment,{children:[e.jsx($e,{id:"tldr",label:"TL;DR · AI-generated"}),e.jsx("div",{className:"tldr-box",children:At})]}),e.jsx($e,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Ta,{text:Vs})}),ke.length>Qe&&e.jsx("div",{className:"read-full",onClick:()=>O(n=>!n),children:$?"− collapse abstract":"+ read full abstract"}),e.jsx($e,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((Dt=s.tasks)==null?void 0:Dt.length)||0," tagged",e.jsx("button",{type:"button",onClick:()=>j("tasks"),className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(s.tasks||[]).map(n=>e.jsx(Ra,{slug:n.slug||"",label:n.name},n.id))}),e.jsx($e,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((Mt=s.methods)==null?void 0:Mt.length)||0," used",e.jsx("button",{type:"button",onClick:()=>j("methods"),className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(s.methods||[]).map(n=>e.jsx(Aa,{method:n},n.id))}),e.jsx($e,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[(v==null?void 0:v.length)||0," benchmarks",Pt.length>0&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:Os,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(W,{name:"copy",size:10})," Copy PwC badge"]}),c&&Ya()&&e.jsx(Dr,{paperId:Number(s.id),paperTitle:s.title,onComplete:()=>void M()}),e.jsx("button",{type:"button",onClick:()=>j("results"),className:"edit-link",children:"edit"})]})}),T?e.jsx(Re,{className:"h-32 w-full"}):y.length>0?y.map(n=>e.jsxs("div",{className:n.taskSlug?"paper-section-anchor":void 0,id:n.taskSlug?as(n.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:n.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(ge,{to:`/tasks/${n.taskSlug}`,children:n.taskName}),e.jsx("a",{href:dn(n.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${n.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):n.taskName}),e.jsxs("span",{className:"accent",children:[n.rows.length," ",n.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:n.rows.map(_=>{var V;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:_.dataset_slug?e.jsx(ge,{to:`/benchmark/${_.dataset_slug}`,children:_.dataset_name||"—"}):_.dataset_name||"—"}),e.jsxs("td",{className:"model",title:_.model_name||void 0,children:[_.hf_model_url?e.jsx("a",{href:_.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${_.model_name||"model"} on Hugging Face`,children:_.model_name||"—"}):_.model_name||"—",_.is_open===!1&&e.jsx(Fa,{}),(_.external??_.is_external)&&e.jsx(La,{sourceUrl:_.source_url||_.external_source_url||_.result_url})]}),e.jsx("td",{className:"metric",children:_.best_metric}),e.jsx("td",{className:"value",children:Sa((V=_.metrics)==null?void 0:V[_.best_metric||""])}),e.jsx("td",{className:"rank",children:_.best_rank!=null?`#${_.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:_.dataset_slug&&e.jsx(ge,{to:`/benchmark/${_.dataset_slug}?${[_.task_slug?`task=${encodeURIComponent(_.task_slug)}`:"",`eval=${encodeURIComponent(_.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},_.id)})})]})]},n.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[fe.length," repo",fe.length===1?"":"s",e.jsx("button",{type:"button",onClick:()=>j("repositories"),className:"edit-link",children:"edit"})]})]}),Gs.map(n=>e.jsxs("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(W,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[n.owner,"/",n.name]}),n.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",ns(n.num_stars)]})]},n.id)),fe.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),fe.length>mt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>F(n=>!n),children:L?"− show top 3":`+ show ${fe.length-mt} more repos`})]}),e.jsx(un,{viewer:rt,onEdit:()=>j("hf-artifacts")}),e.jsx(nn,{githubUrls:fe.map(n=>n.url),hfModelUrls:st.models,hfDatasetUrls:st.datasets,hfSpaceUrls:st.spaces,paperId:s.id,pdfName:((Ht=s.arxiv_id)==null?void 0:Ht.replace("/","-"))||s.id,pdfUrl:s.url_pdf,isSignedIn:!!i,suggestedBucketId:i?`${i.username}/${rn(s.title)}`:void 0}),K.isLoading&&e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}),!K.isLoading&&(((qt=K.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"}),K.data.map(n=>e.jsxs(ge,{to:`/paper/${n.arxiv_id||n.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(qe,{title:n.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:n.arxiv_id?`arXiv:${n.arxiv_id}`:"External resource"}),n.citation_count!=null&&e.jsxs("span",{children:[n.citation_count.toLocaleString()," cites"]})]})]},n.id))]}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:Ks,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(W,{name:"copy",size:11}),zs?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:qs})]})]})]}),e.jsx(jr,{open:G==="tasks",onOpenChange:n=>g("tasks",n),paperId:s.id,arxivId:a,initialTaskIds:((zt=s.tasks)==null?void 0:zt.map(n=>parseInt(n.id)))||[],initialTasks:s.tasks||[],submitMode:f,isAuthor:b}),e.jsx(_r,{open:G==="methods",onOpenChange:n=>g("methods",n),paperId:s.id,arxivId:a,initialMethodIds:((Kt=s.methods)==null?void 0:Kt.map(n=>parseInt(n.id)))||[],initialMethods:s.methods||[],submitMode:f,isAuthor:b}),e.jsx(kr,{open:G==="repositories",onOpenChange:n=>g("repositories",n),paperId:s.id,arxivId:a,initialRepositories:((Ot=s.repositories)==null?void 0:Ot.map(n=>({url:n.url,is_official:n.is_official||!1})))||[],submitMode:f,isAuthor:b}),e.jsx(wr,{open:G==="project-pages",onOpenChange:n=>g("project-pages",n),paperId:s.id,arxivId:a,initialProjectPages:((Gt=s.project_pages)==null?void 0:Gt.map(n=>({url:n.url,is_official:n.is_official||!1})))||[],submitMode:f,isAuthor:b}),e.jsx(Pr,{open:G==="results",onOpenChange:n=>g("results",n),paperId:s.id,arxivId:a,initialEvaluations:U||[],paperTasks:s.tasks||[],submitMode:f,isAdmin:c,isAuthor:b}),e.jsx(Nr,{open:G==="source-url",onOpenChange:n=>g("source-url",n),paperId:s.id,arxivId:a,initialUrl:s.source_url??s.url_abs??"",submitMode:f,isAuthor:b}),e.jsx(Rr,{open:G==="hf-artifacts",onOpenChange:n=>g("hf-artifacts",n),paperId:s.id,arxivId:a,initialArtifacts:{hf_models:d.models,hf_datasets:d.datasets,hf_spaces:d.spaces},submitMode:f,isAuthor:b}),e.jsx(Ar,{open:G==="organizations",onOpenChange:n=>g("organizations",n),paperId:s.id,initialOrganizationIds:(s.organizations||[]).map(n=>Number(n.id)),submitMode:f,isAuthor:b}),e.jsx(za,{open:S!==null,onOpenChange:n=>{n||R(null)},sectionLabel:S?on[S]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})},un=({viewer:t,onEdit:a})=>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"}),e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]}),t.isLoading?e.jsx(Re,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[t.rows.map(r=>e.jsx(mn,{...r},r.label)),t.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:t.footer})]})]}),mn=({label:t,href:a,count:r,isLimited:l,links:i})=>{const[c,o]=m.useState(!1),f=((i==null?void 0:i.length)??0)>0,u=((i==null?void 0:i.length)??0)>ss,s=c?i:i==null?void 0:i.slice(0,ss),N=r!=null?`${r}${l?"+":""}`:"—",k=r?e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:N}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:N});return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:t}),k]}),f&&e.jsxs("div",{className:"hf-artifact-links",children:[s.map(E=>e.jsx("a",{href:E.href,target:"_blank",rel:"noopener noreferrer",children:E.label},E.href)),u&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":c,onClick:()=>o(E=>!E),children:c?"Show fewer":`View all ${i.length}`})]})]})};function ht(t){return t[0]??"https://huggingface.co"}function pt(t,a){return a[0]??t}function ft(t,a,r){if(r==null&&t.length===0&&!(a!=null&&a.length))return;const l=new Set([...t,...a??[]]);return Math.max(r??0,l.size)}export{Dn as default}; diff --git a/assets/PaperDetailView-KJONkjMT.js b/assets/PaperDetailView-KJONkjMT.js deleted file mode 100644 index 0bb9aef262bb5981bf05e88b898c6676edf21d98..0000000000000000000000000000000000000000 --- a/assets/PaperDetailView-KJONkjMT.js +++ /dev/null @@ -1,29 +0,0 @@ -import{c as bt,m as Ys,r as m,j as e,P as rs,n as _e,o as ns,p as Te,q as Le,s as is,t as jt,C as je,v as Ve,h as me,g as he,X as os,w as ve,x as Zs,y as ls,z as ea,B as ta,D as sa,E as aa,F as ra,G as Ot,H as na,I as ia,J as oa,K as la,M as ca,f as Xe,R as vt,b as xe,N as cs,d as ds,O as da,Q as ua,S as ma,T as us,U as ha,V as pa,A as fa,W as ga,e as xa,Y as ba,u as ja,Z as va,L as ge,_ as ya,$ as _a,a0 as ka,a1 as wa,a2 as Na,a3 as Ca,a4 as Ea}from"./index-BfD7YdLr.js";import{u as re}from"./useQuery-BQY3DH-b.js";import{I as X,S as Sa,a as Pa,T as $a,M as Ia}from"./components-LTCBEq5x.js";import{C as Ra,E as Aa}from"./ExternalSourceEvalBadge-C0AdjeMr.js";import{L as qe,a as Fa}from"./LatexTitle-Dyu7ZW4B.js";import{s as La}from"./transform-DCLb4olr.js";import{f as Ta,D as Ua}from"./latexPlainText-DI8YEXVe.js";import{a as Da}from"./usePapers-DrFoptcF.js";import{S as Re}from"./skeleton-DlrhV-qs.js";import{A as Ba,a as Ha}from"./alert-zXn954y8.js";import{B as M}from"./button-CXFuJJQh.js";import{u as ms}from"./index-qlYSmaoI.js";import{I as Z}from"./textarea-DRF500G_.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as ue}from"./dialog-CDRq9Z7X.js";import{u as pe}from"./useMutation-BQa0xQql.js";import{S as yt,P as Je,L as ae,a as Ma}from"./SignInToEditDialog-DB0NqMGz.js";import{S as We,a as Gt}from"./searchable-select-CriyPATu.js";import{L as ne}from"./loader-circle-BQq8L_PA.js";import{B as hs,D as qa,c as za,g as Ka,s as Oa,a as Ga,b as Qa,d as Va,i as Wa,e as Xa}from"./codexAddEvals-BFPddk7M.js";import{G as Qt}from"./github-B6jYY6fQ.js";import{M as Ja,r as Ya}from"./index-SnRTg719.js";import"./useBaseQuery-zm-nsmQ1.js";import"./hover-card-Bp6412TC.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CVNt5m44.js";/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vt=bt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ps=bt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ye=bt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function Za(s){return s!=null&&s.can_directly_edit_catalog?"direct":"pending"}function er(s){return(s??[]).filter(a=>!!(a.dataset_slug&&a.task_slug))}function tr(s,a,r="https://paperswithcode.co"){return a.map(d=>{const i=encodeURIComponent(d.evaluation_id),l=`${r}/api/v1/papers/${encodeURIComponent(s)}/leaderboard-badge.svg?eval=${i}&live=1`,o=`${r}/api/v1/papers/${encodeURIComponent(s)}/leaderboard-badge-link?eval=${i}`;return`[![${`Papers with Code: ${d.best_rank===1?"SOTA":`#${d.best_rank}`} on ${d.dataset_name}`}](${l})](${o})`}).join(` -`)}function sr(s,a=!0){return re({queryKey:["evaluations","paper",s],queryFn:()=>{if(!s)throw new Error("Paper ID is required");return Ys(s)},enabled:a&&!!s,staleTime:0,refetchOnMount:"always"})}const fs=s=>s.replace(/v\d+$/,""),ar={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},it=(s,a)=>{const r=(s[a]||[]).length;return r<100?{count:r,isLimited:!1}:{count:r,isLimited:!0}},ot=(s,a)=>{const r=s[a];return Array.isArray(r)?r.map(d=>{if(typeof d=="string")return d;if(d&&typeof d=="object"){const i=d;return i.id||i.repoId||null}return null}).filter(d=>!!d).map(d=>`${ar[a]}${d}`):[]},rr=async s=>{try{return(await fetch(`https://huggingface.co/api/papers/${fs(s)}`)).ok}catch{return!1}},nr=async s=>{const a=fs(s),[r,d]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${a}/repos`).then(async f=>f.ok?f.json():(console.warn(`Failed to fetch repos for arXiv:${a}, status: ${f.status}`),null)).catch(f=>(console.warn(`Failed to fetch repos for arXiv:${a}:`,f),null)),rr(a)]);if(!r)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:d};const i=it(r,"models"),l=it(r,"datasets"),o=it(r,"spaces");return{models:i.count,datasets:l.count,spaces:o.count,modelUrls:ot(r,"models"),datasetUrls:ot(r,"datasets"),spaceUrls:ot(r,"spaces"),isLimited:i.isLimited||l.isLimited||o.isLimited,paperExists:d}},ir=s=>re({queryKey:["huggingface-repos",s],queryFn:()=>nr(s),enabled:!!s,staleTime:10*60*1e3,retry:1}),or={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url"};function lr(s){return or[s]??null}function cr(){const[s,a]=m.useState(null),r=m.useCallback(i=>{a(i)},[]),d=m.useCallback((i,l)=>{a(o=>l?i:o===i?null:o)},[]);return{activeEditor:s,openEditor:r,setEditorOpen:d}}var Ze="Checkbox",[dr]=jt(Ze),[ur,_t]=dr(Ze);function mr(s){const{__scopeCheckbox:a,checked:r,children:d,defaultChecked:i,disabled:l,form:o,name:f,onCheckedChange:u,required:t,value:C="on",internal_do_not_use_render:w}=s,[P,N]=ns({prop:r,defaultProp:i??!1,onChange:u,caller:Ze}),[$,h]=m.useState(null),[U,L]=m.useState(null),A=m.useRef(!1),H=$?!!o||!!$.closest("form"):!0,B={checked:P,disabled:l,setChecked:N,control:$,setControl:h,name:f,form:o,value:C,hasConsumerStoppedPropagationRef:A,required:t,defaultChecked:be(i)?!1:i,isFormControl:H,bubbleInput:U,setBubbleInput:L};return e.jsx(ur,{scope:a,...B,children:hr(w)?w(B):d})}var gs="CheckboxTrigger",xs=m.forwardRef(({__scopeCheckbox:s,onKeyDown:a,onClick:r,...d},i)=>{const{control:l,value:o,disabled:f,checked:u,required:t,setControl:C,setChecked:w,hasConsumerStoppedPropagationRef:P,isFormControl:N,bubbleInput:$}=_t(gs,s),h=Te(i,C),U=m.useRef(u);return m.useEffect(()=>{const L=l==null?void 0:l.form;if(L){const A=()=>w(U.current);return L.addEventListener("reset",A),()=>L.removeEventListener("reset",A)}},[l,w]),e.jsx(_e.button,{type:"button",role:"checkbox","aria-checked":be(u)?"mixed":u,"aria-required":t,"data-state":_s(u),"data-disabled":f?"":void 0,disabled:f,value:o,...d,ref:h,onKeyDown:Le(a,L=>{L.key==="Enter"&&L.preventDefault()}),onClick:Le(r,L=>{w(A=>be(A)?!0:!A),$&&N&&(P.current=L.isPropagationStopped(),P.current||L.stopPropagation())})})});xs.displayName=gs;var kt=m.forwardRef((s,a)=>{const{__scopeCheckbox:r,name:d,checked:i,defaultChecked:l,required:o,disabled:f,value:u,onCheckedChange:t,form:C,...w}=s;return e.jsx(mr,{__scopeCheckbox:r,checked:i,defaultChecked:l,disabled:f,required:o,onCheckedChange:t,name:d,form:C,value:u,internal_do_not_use_render:({isFormControl:P})=>e.jsxs(e.Fragment,{children:[e.jsx(xs,{...w,ref:a,__scopeCheckbox:r}),P&&e.jsx(ys,{__scopeCheckbox:r})]})})});kt.displayName=Ze;var bs="CheckboxIndicator",js=m.forwardRef((s,a)=>{const{__scopeCheckbox:r,forceMount:d,...i}=s,l=_t(bs,r);return e.jsx(rs,{present:d||be(l.checked)||l.checked===!0,children:e.jsx(_e.span,{"data-state":_s(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:a,style:{pointerEvents:"none",...s.style}})})});js.displayName=bs;var vs="CheckboxBubbleInput",ys=m.forwardRef(({__scopeCheckbox:s,...a},r)=>{const{control:d,hasConsumerStoppedPropagationRef:i,checked:l,defaultChecked:o,required:f,disabled:u,name:t,value:C,form:w,bubbleInput:P,setBubbleInput:N}=_t(vs,s),$=Te(r,N),h=ms(l),U=is(d);m.useEffect(()=>{const A=P;if(!A)return;const H=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(H,"checked").set,c=!i.current;if(h!==l&&k){const p=new Event("click",{bubbles:c});A.indeterminate=be(l),k.call(A,be(l)?!1:l),A.dispatchEvent(p)}},[P,h,l,i]);const L=m.useRef(be(l)?!1:l);return e.jsx(_e.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??L.current,required:f,disabled:u,name:t,value:C,form:w,...a,tabIndex:-1,ref:$,style:{...a.style,...U,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ys.displayName=vs;function hr(s){return typeof s=="function"}function be(s){return s==="indeterminate"}function _s(s){return be(s)?"indeterminate":s?"checked":"unchecked"}const et=m.forwardRef(({className:s,style:a,...r},d)=>e.jsx(kt,{ref:d,className:Ve("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),style:{border:"1px solid #000",...a},...r,children:e.jsx(js,{className:Ve("flex items-center justify-center text-current"),children:e.jsx(je,{className:"h-4 w-4"})})}));et.displayName=kt.displayName;function pr(s,a,r){if(!s)return s;const d=i=>i.paper_id!==a||i.paper_title===r?i:{...i,paper_title:r};if(Array.isArray(s)){const i=s.map(d);return i.some((o,f)=>o!==s[f])?i:s}if(Array.isArray(s.results)){const i=s.results.map(d);return i.some((o,f)=>o!==s.results[f])?{...s,results:i}:s}return s}function Ce(s,a,r){new Set([...r,a.id,a.arxiv_id].filter(o=>!!o)).forEach(o=>{s.setQueryData(["paper",o],a),s.setQueryData(["paper-arxiv",o],a)}),s.invalidateQueries({queryKey:["papers"],refetchType:"none"}),s.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),s.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const i=String(a.id),l=o=>pr(o,i,a.title);s.setQueriesData({queryKey:["evaluations"]},l),s.setQueriesData({queryKey:["dataset-evals"]},l),s.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),s.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}function ye({isAuthor:s=!1}){const a=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";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:a?"Test-only: this change stays on staging.":"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:a?"This exercises staging-local pending behavior and is not queued for production review.":s?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}const fr=250,gr=100;function xr({open:s,onOpenChange:a,paperId:r,arxivId:d,initialTaskIds:i,initialTasks:l,onSuccess:o,submitMode:f="direct",isAuthor:u=!1}){const[t,C]=m.useState(i),[w,P]=m.useState(!1),[N,$]=m.useState(""),[h,U]=m.useState(""),[L,A]=m.useState(new Map),H=me(),{toast:B}=he(),k=m.useRef(!1);m.useEffect(()=>{if(!s){k.current=!1;return}if(k.current)return;k.current=!0,C(i),$(""),U("");const x=new Map;(l||[]).forEach(R=>{const F=parseInt(R.id);Number.isNaN(F)||x.set(F,R)}),A(x)},[s,i,l]),m.useEffect(()=>{const x=window.setTimeout(()=>{U(N.trim())},fr);return()=>window.clearTimeout(x)},[N]);const{data:c,isFetching:p}=re({queryKey:["tasks-search",h],queryFn:()=>ls({page_size:gr,...h?{q:h}:{}}),enabled:s});m.useEffect(()=>{var x;(x=c==null?void 0:c.results)!=null&&x.length&&A(R=>{const F=new Map(R);return c.results.forEach(D=>{const E=parseInt(D.id);Number.isNaN(E)||F.set(E,D)}),F})},[c]);const y=m.useMemo(()=>{const x=(c==null?void 0:c.results)||[],R=new Set,F=[];return t.forEach(D=>{if(R.has(D))return;const E=L.get(D);E&&(F.push(E),R.add(D))}),x.forEach(D=>{const E=parseInt(D.id);Number.isNaN(E)||R.has(E)||(F.push(D),R.add(E))}),F},[c,t,L]),b=pe({mutationFn:async({paperId:x,taskIds:R})=>f==="pending"?(await ve({paper_id:parseInt(x),edit_type:"tasks",proposed_payload:{task_ids:R}}),null):Zs(x,R),onMutate:async({taskIds:x})=>{if(f==="pending")return{snapshots:[]};const R=x.map(E=>L.get(E)).filter(E=>!!E).map(E=>({id:E.id,name:E.name,slug:E.slug})).sort((E,Q)=>E.name.localeCompare(Q.name)),F=Array.from(new Set([r,d].filter(E=>!!E)));await Promise.all(F.flatMap(E=>[H.cancelQueries({queryKey:["paper",E]}),H.cancelQueries({queryKey:["paper-arxiv",E]})]));const D=[];return F.forEach(E=>{["paper","paper-arxiv"].forEach(Q=>{const Y=[Q,E],g=H.getQueryData(Y);D.push({key:Y,data:g}),g&&H.setQueryData(Y,{...g,tasks:R})})}),B({title:"Tasks updated",description:`Saved ${x.length} task${x.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1),{snapshots:D}},onSuccess:x=>{if(f==="pending"){B({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),o==null||o(),a(!1);return}x&&Ce(H,x,[r,d])},onError:(x,R,F)=>{var Q,Y;(Q=F==null?void 0:F.snapshots)==null||Q.forEach(({key:g,data:S})=>{H.setQueryData(g,S)});const D=x;let E=D.message||(f==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(D.response)try{const g=JSON.parse(D.response);typeof(g==null?void 0:g.detail)=="string"?E=g.detail:Array.isArray(g==null?void 0:g.detail)&&((Y=g.detail[0])!=null&&Y.msg)&&(E=g.detail[0].msg)}catch{E=D.response}B({title:f==="pending"?"Could not submit edit":"Could not save tasks",description:E,variant:"destructive"})}}),T=()=>{f==="direct"&&i.some(x=>!t.includes(x))&&!window.confirm("Remove one or more task links from this paper?")||b.mutate({paperId:r,taskIds:t})},z=m.useMemo(()=>{if(t.length!==i.length)return!0;const x=new Set(i);return t.some(R=>!x.has(R))},[t,i]),K=(x,R)=>{C(F=>R?F.includes(x)?F:[...F,x]:F.filter(D=>D!==x))},V=()=>$("");return e.jsxs(ie,{open:s,onOpenChange:a,children:[e.jsxs(oe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Paper Tasks"}),e.jsx(de,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),f==="pending"&&e.jsx(ye,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(We,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(Z,{type:"text",placeholder:"Search tasks...",value:N,onChange:x=>$(x.target.value),className:"pl-9 pr-9"}),N&&e.jsx("button",{type:"button",onClick:V,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(os,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:y.length>0?e.jsx("div",{className:"space-y-2",children:y.map(x=>{const R=parseInt(x.id),F=t.includes(R);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(et,{id:`task-${x.id}`,checked:F,onCheckedChange:D=>K(R,D===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${x.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[x.name,x.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[x.description.substring(0,100),x.description.length>100?"...":""]})]})]},x.id)})}):p?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(We,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:h?`No tasks found matching "${h}"`:"No tasks available"})]})}),e.jsxs(ue,{children:[e.jsx(M,{variant:"ghost",className:"sm:mr-auto",onClick:()=>P(!0),children:"Suggest a new task"}),e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:T,disabled:b.isPending||!z,children:b.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),f==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),f==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(yt,{open:w,onOpenChange:P,paperId:r,kind:"task"})]})}const br=250,jr=100;function vr({open:s,onOpenChange:a,paperId:r,arxivId:d,initialMethodIds:i,initialMethods:l,onSuccess:o,submitMode:f="direct",isAuthor:u=!1}){const[t,C]=m.useState(i),[w,P]=m.useState(!1),[N,$]=m.useState(""),[h,U]=m.useState(""),[L,A]=m.useState(new Map),H=me(),{toast:B}=he(),k=m.useRef(!1);m.useEffect(()=>{if(!s){k.current=!1;return}if(k.current)return;k.current=!0,C(i),$(""),U("");const x=new Map;(l||[]).forEach(R=>{const F=parseInt(R.id);Number.isNaN(F)||x.set(F,R)}),A(x)},[s,i,l]),m.useEffect(()=>{const x=window.setTimeout(()=>{U(N.trim())},br);return()=>window.clearTimeout(x)},[N]);const{data:c,isFetching:p}=re({queryKey:["methods-search",h],queryFn:()=>ta({page_size:jr,...h?{q:h}:{}}),enabled:s});m.useEffect(()=>{var x;(x=c==null?void 0:c.results)!=null&&x.length&&A(R=>{const F=new Map(R);return c.results.forEach(D=>{const E=parseInt(D.id);Number.isNaN(E)||F.set(E,D)}),F})},[c]);const y=m.useMemo(()=>{const x=(c==null?void 0:c.results)||[],R=new Set,F=[];return t.forEach(D=>{if(R.has(D))return;const E=L.get(D);E&&(F.push(E),R.add(D))}),x.forEach(D=>{const E=parseInt(D.id);Number.isNaN(E)||R.has(E)||(F.push(D),R.add(E))}),F},[c,t,L]),b=pe({mutationFn:async({paperId:x,methodIds:R})=>f==="pending"?(await ve({paper_id:parseInt(x),edit_type:"methods",proposed_payload:{method_ids:R}}),null):ea(x,R),onSuccess:x=>{if(f==="pending"){B({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),o==null||o(),a(!1);return}x&&Ce(H,x,[r,d]),B({title:"Methods updated",description:`Saved ${t.length} method${t.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1)},onError:x=>{var D;const R=x;let F=R.message||(f==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(R.response)try{const E=JSON.parse(R.response);typeof(E==null?void 0:E.detail)=="string"?F=E.detail:Array.isArray(E==null?void 0:E.detail)&&((D=E.detail[0])!=null&&D.msg)&&(F=E.detail[0].msg)}catch{F=R.response}B({title:f==="pending"?"Could not submit edit":"Could not save methods",description:F,variant:"destructive"})}}),T=()=>{f==="direct"&&i.some(x=>!t.includes(x))&&!window.confirm("Remove one or more method links from this paper?")||b.mutate({paperId:r,methodIds:t})},z=m.useMemo(()=>{if(t.length!==i.length)return!0;const x=new Set(i);return t.some(R=>!x.has(R))},[t,i]),K=(x,R)=>{C(F=>R?F.includes(x)?F:[...F,x]:F.filter(D=>D!==x))},V=()=>$("");return e.jsxs(ie,{open:s,onOpenChange:a,children:[e.jsxs(oe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Paper Methods"}),e.jsx(de,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),f==="pending"&&e.jsx(ye,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(We,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(Z,{type:"text",placeholder:"Search methods...",value:N,onChange:x=>$(x.target.value),className:"pl-9 pr-9"}),N&&e.jsx("button",{type:"button",onClick:V,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(os,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:y.length>0?e.jsx("div",{className:"space-y-2",children:y.map(x=>{const R=parseInt(x.id),F=t.includes(R);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(et,{id:`method-${x.id}`,checked:F,onCheckedChange:D=>K(R,D===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${x.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[x.name,x.full_name&&x.full_name!==x.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:x.full_name}),x.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[x.description.substring(0,100),x.description.length>100?"...":""]})]})]},x.id)})}):p?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(We,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:h?`No methods found matching "${h}"`:"No methods available"})]})}),e.jsxs(ue,{children:[e.jsx(M,{variant:"ghost",className:"sm:mr-auto",onClick:()=>P(!0),children:"Suggest a new method"}),e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:T,disabled:b.isPending||!z,children:b.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),f==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),f==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(yt,{open:w,onOpenChange:P,paperId:r,kind:"method"})]})}function Fe(s){const a=s.trim();if(!a)return null;let r=a;!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`https://${r}`);try{const d=new URL(r);if(d.hostname.toLowerCase()!=="github.com")return null;const i=d.pathname.split("/").filter(Boolean);if(i.length<2)return null;const l=i[0].toLowerCase();let o=i[1].toLowerCase();return o.endsWith(".git")&&(o=o.slice(0,-4)),`https://github.com/${l}/${o}`}catch{return null}}function Wt(s,a){const r=Fe(s),d=Fe(a);return r&&d?r===d:s.trim()===a.trim()}function yr({open:s,onOpenChange:a,paperId:r,arxivId:d,initialRepositories:i,onSuccess:l,submitMode:o="direct",isAuthor:f=!1}){const[u,t]=m.useState(i),[C,w]=m.useState(""),P=me(),{toast:N}=he(),$=m.useRef(!1);m.useEffect(()=>{if(!s){$.current=!1;return}$.current||($.current=!0,t(i),w(""))},[s,i]);const h=pe({mutationFn:async({paperId:p,repositories:y})=>o==="pending"?(await ve({paper_id:parseInt(p),edit_type:"repositories",proposed_payload:{repositories:y}}),null):sa(p,y),onSuccess:p=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),l==null||l(),a(!1),w("");return}p&&Ce(P,p,[r,d]),l==null||l(),a(!1),w("")},onError:p=>{var T;const y=p;let b=y.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(y.response)try{const z=JSON.parse(y.response);typeof(z==null?void 0:z.detail)=="string"?b=z.detail:Array.isArray(z==null?void 0:z.detail)&&((T=z.detail[0])!=null&&T.msg)&&(b=z.detail[0].msg)}catch{b=y.response}N({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:b,variant:"destructive"})}}),U=p=>{const y=[];for(const b of p){const T=y.find(z=>Wt(z.url,b.url));if(T)T.is_official=T.is_official||b.is_official;else{const z=Fe(b.url);y.push({url:z??b.url.trim(),is_official:b.is_official})}}return y},L=()=>{const p=C.trim(),y=p?[...u,{url:p,is_official:!1}]:u;return p&&u.some(b=>Wt(b.url,p))?(alert("This repository URL is already added"),null):U(y)},A=()=>{const p=L();p!==null&&p.length!==u.length&&(t(p),w(""))},H=p=>{t(u.filter(y=>y.url!==p))},B=p=>{t(u.map(y=>y.url===p?{...y,is_official:!y.is_official}:y))},k=()=>{const p=L();p!==null&&(o==="direct"&&i.some(y=>!p.some(b=>b.url===y.url))&&!window.confirm("Remove one or more repositories from this paper?")||h.mutate({paperId:r,repositories:p}))},c=m.useMemo(()=>{const p=C.trim(),y=p?[...u,{url:p,is_official:!1}]:u;if(y.length!==i.length)return!0;const b=U(i),T=U(y);if(T.length!==b.length)return!0;const z=new Map(b.map(K=>[Fe(K.url)??K.url.trim(),!!K.is_official]));return T.some(K=>{const V=Fe(K.url)??K.url.trim(),x=z.get(V);return x===void 0||x!==!!K.is_official})},[u,C,i]);return e.jsx(ie,{open:s,onOpenChange:a,children:e.jsxs(oe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Paper Repositories"}),e.jsx(de,{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(ye,{isAuthor:f}),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(Z,{type:"url",placeholder:"https://github.com/owner/repo",value:C,onChange:p=>w(p.target.value),onKeyPress:p=>{p.key==="Enter"&&(p.preventDefault(),A())},className:"flex-1"}),e.jsxs(M,{onClick:A,size:"sm",disabled:!C.trim(),children:[e.jsx(Je,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((p,y)=>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(Qt,{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:p.url}),p.is_official&&e.jsx(hs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(M,{variant:p.is_official?"default":"outline",size:"sm",onClick:()=>B(p.url),className:"h-8 px-2 text-xs",title:p.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ps,{className:`w-3.5 h-3.5 mr-1 ${p.is_official?"fill-current":""}`}),p.is_official?"Official":"Mark official"]}),e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>H(p.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Ye,{className:"w-4 h-4"})})]})]},y))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Qt,{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(ue,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:k,disabled:h.isPending||!c,children:h.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(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function _r({open:s,onOpenChange:a,paperId:r,arxivId:d,initialProjectPages:i,onSuccess:l,submitMode:o="direct",isAuthor:f=!1}){const[u,t]=m.useState(i),[C,w]=m.useState(""),P=me(),{toast:N}=he(),$=m.useRef(!1);m.useEffect(()=>{if(!s){$.current=!1;return}$.current||($.current=!0,t(i),w(""))},[s,i]);const h=pe({mutationFn:async({paperId:c,projectPages:p})=>o==="pending"?(await ve({paper_id:parseInt(c),edit_type:"project_pages",proposed_payload:{project_pages:p}}),null):aa(c,p),onSuccess:c=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),l==null||l(),a(!1),w("");return}c&&Ce(P,c,[r,d]),l==null||l(),a(!1),w("")},onError:c=>{var b;const p=c;let y=p.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(p.response)try{const T=JSON.parse(p.response);typeof(T==null?void 0:T.detail)=="string"?y=T.detail:Array.isArray(T==null?void 0:T.detail)&&((b=T.detail[0])!=null&&b.msg)&&(y=T.detail[0].msg)}catch{y=p.response}N({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:y,variant:"destructive"})}}),U=()=>{const c=C.trim();return c?u.some(p=>p.url===c)?(alert("This project page URL is already added"),null):[...u,{url:c,is_official:!1}]:u},L=()=>{const c=U();c!==null&&c.length!==u.length&&(t(c),w(""))},A=c=>{t(u.filter(p=>p.url!==c))},H=c=>{t(u.map(p=>p.url===c?{...p,is_official:!p.is_official}:p))},B=()=>{const c=U();c!==null&&(o==="direct"&&i.some(p=>!c.some(y=>y.url===p.url))&&!window.confirm("Remove one or more project pages from this paper?")||h.mutate({paperId:r,projectPages:c}))},k=m.useMemo(()=>{const c=C.trim(),p=c?[...u,{url:c,is_official:!1}]:u;if(p.length!==i.length)return!0;const y=new Map(i.map(b=>[b.url.trim(),!!b.is_official]));return p.some(b=>{const T=y.get(b.url.trim());return T===void 0||T!==!!b.is_official})},[u,C,i]);return e.jsx(ie,{open:s,onOpenChange:a,children:e.jsxs(oe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Paper Project Pages"}),e.jsx(de,{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(ye,{isAuthor:f}),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(Z,{type:"url",placeholder:"https://example.com/project",value:C,onChange:c=>w(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),L())},className:"flex-1"}),e.jsxs(M,{onClick:L,size:"sm",disabled:!C.trim(),children:[e.jsx(Je,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((c,p)=>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(Vt,{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(hs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(M,{variant:c.is_official?"default":"outline",size:"sm",onClick:()=>H(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(ps,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>A(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Ye,{className:"w-4 h-4"})})]})]},p))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Vt,{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(ue,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:B,disabled:h.isPending||!k,children:h.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(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function kr({open:s,onOpenChange:a,paperId:r,arxivId:d,initialUrl:i,onSuccess:l,submitMode:o="direct",isAuthor:f=!1}){const[u,t]=m.useState(i),C=me(),{toast:w}=he(),P=m.useRef(!1);m.useEffect(()=>{if(!s){P.current=!1;return}P.current||(P.current=!0,t(i))},[s,i]);const N=pe({mutationFn:async({paperId:A,sourceUrl:H})=>o==="pending"?(await ve({paper_id:parseInt(A),edit_type:"source_url",proposed_payload:{source_url:H}}),null):ra(A,H),onSuccess:A=>{if(o==="pending"){w({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),l==null||l(),a(!1);return}A&&Ce(C,A,[r,d]),l==null||l(),a(!1)},onError:A=>{var k;const H=A;let B=H.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(H.response)try{const c=JSON.parse(H.response);typeof(c==null?void 0:c.detail)=="string"?B=c.detail:Array.isArray(c==null?void 0:c.detail)&&((k=c.detail[0])!=null&&k.msg)&&(B=c.detail[0].msg)}catch{B=H.response}w({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:B,variant:"destructive"})}}),$=u.trim(),h=/^https?:\/\//i.test($),U=$!==(i||"").trim(),L=()=>{h&&N.mutate({paperId:r,sourceUrl:$})};return e.jsx(ie,{open:s,onOpenChange:a,children:e.jsxs(oe,{className:"max-w-2xl",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Source URL"}),e.jsxs(de,{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(ye,{isAuthor:f}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(Z,{type:"url",placeholder:"https://example.com/paper",value:u,onChange:A=>t(A.target.value),onKeyPress:A=>{A.key==="Enter"&&h&&U&&(A.preventDefault(),L())}}),!h&&$.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(ue,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:L,disabled:N.isPending||!h||!U,children:N.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(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const lt=100;function wr(s){return(s??[]).some(a=>a.slug==="coding-agents"||a.name.trim().toLowerCase()==="coding agents")}function Xt(s){const a=parseInt(s.task_id,10),r=parseInt(s.dataset_id,10);return!(!Number.isFinite(a)||!Number.isFinite(r)||!s.metric_name.trim()||!s.metric_value.trim())}function Nr(s){return s.map(a=>{const r=a.best_metric||Object.keys(a.metrics)[0],d=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(d||""),best_rank:a.best_rank?String(a.best_rank):"",num_parameters:a.num_parameters!=null?String(a.num_parameters):"",hf_model_url:a.hf_model_url||"",is_open:a.is_open!==!1,operation:"unchanged"}})}function Cr(s){const a=new Map;return s.forEach(r=>{r.task_id&&r.task_name&&a.set(r.task_id,{id:r.task_id,name:r.task_name,slug:r.task_slug,level:0})}),a}function Er(s){const a=new Map;return s.forEach(r=>{r.dataset_id&&r.dataset_name&&a.set(r.dataset_id,{id:r.dataset_id,name:r.dataset_name,slug:r.dataset_slug})}),a}function Jt(s,a){return`${s}:${a}`}function ze(s){const a=s.trim();if(a==="")return null;const r=Number(a);return!Number.isFinite(r)||r<0?null:Math.trunc(r)}function Ke(s){const a=s.trim();return a===""?null:a}function Sr({open:s,onOpenChange:a,paperId:r,arxivId:d,initialEvaluations:i,paperTasks:l,onSuccess:o,submitMode:f="direct",isAdmin:u=!1,isAuthor:t=!1}){const C=wr(l),[w,P]=m.useState([]),[N,$]=m.useState(null),[h,U]=m.useState(new Map),[L,A]=m.useState(new Map),H=me(),{toast:B}=he(),k=m.useRef(!1),c=m.useRef(!1);m.useEffect(()=>{if(!s){k.current=!1,c.current=!1;return}k.current||c.current||i.length!==0&&(k.current=!0,P(Nr(i)),U(Cr(i)),A(Er(i)))},[s,i]);const p=m.useMemo(()=>Array.from(new Set(w.map(g=>g.task_id).filter(g=>g&&g!==""))),[w]),y=m.useMemo(()=>{const g=new Set;return w.forEach(S=>{S.task_id&&S.dataset_id&&g.add(Jt(S.task_id,S.dataset_id))}),Array.from(g)},[w]),b=re({queryKey:["datasets-by-tasks-for-eval-edit",p,s],queryFn:async()=>{const g={};return await Promise.all(p.map(async S=>{try{const I=await Ot({task_id:parseInt(S),page_size:lt});g[S]=I.results}catch(I){console.error(`Error fetching datasets for task ${S}:`,I),g[S]=[]}})),g},enabled:s&&p.length>0});m.useEffect(()=>{b.data&&A(g=>{const S=new Map(g);return Object.values(b.data).forEach(I=>{I.forEach(j=>{S.set(j.id,j)})}),S})},[b.data]);const T=re({queryKey:["leaderboard-metrics-for-eval-edit",y,s],queryFn:async()=>{const g={};return await Promise.all(y.map(async S=>{const[I,j]=S.split(":");try{g[S]=await ia(j,I)}catch(v){console.error(`Error fetching metrics for leaderboard ${S}:`,v),g[S]=[]}})),g},enabled:s&&y.length>0}),z=async g=>{const S=await ls({page_size:lt,...g?{q:g}:{}});return U(I=>{const j=new Map(I);return S.results.forEach(v=>j.set(v.id,v)),j}),S.results.map(I=>{var j;return{value:I.id,label:I.name,description:(j=I.description)==null?void 0:j.slice(0,100)}})},K=g=>async S=>{const I=await Ot({task_id:parseInt(g),page_size:lt,...S?{q:S}:{}});return A(j=>{const v=new Map(j);return I.results.forEach(O=>v.set(O.id,O)),v}),I.results.map(j=>({value:j.id,label:j.name,description:j.full_name}))},V=(g,S)=>{if(!g||!S)return!1;const I=L.get(S);return!!(I!=null&&I.supports_harness)},x=(g,S,I)=>{var O;if(!g||!S)return[];const v=(((O=T.data)==null?void 0:O[Jt(g,S)])||[]).map(q=>({value:q.metric_name,label:q.metric_name,description:q.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return I&&!v.some(q=>q.value===I)&&v.unshift({value:I,label:`${I} (legacy)`,description:void 0}),v},R=pe({mutationFn:async({paperId:g,evaluations:S})=>{if(f==="pending"){const j=[];for(const v of S){if(v.operation==="delete"&&v.id){j.push({op:"delete",evaluation_id:parseInt(v.id)});continue}const O=V(v.task_id,v.dataset_id);if(v.operation==="create"){if(!Xt(v))continue;const q=ze(v.num_parameters),te={task_id:parseInt(v.task_id),dataset_id:parseInt(v.dataset_id),metrics:{[v.metric_name]:v.metric_value},best_metric:v.metric_name},Ee=Ke(v.hf_model_url);v.model_name&&(te.model_name=v.model_name),O&&v.harness&&(te.harness=v.harness),v.best_rank&&(te.best_rank=parseInt(v.best_rank)),q!=null&&(te.num_parameters=q),Ee!=null&&(te.hf_model_url=Ee),te.is_open=v.is_open,j.push({op:"create",data:te})}else if(v.operation==="update"&&v.id){const q={task_id:parseInt(v.task_id),dataset_id:parseInt(v.dataset_id),model_name:v.model_name||void 0,harness:O&&v.harness||null,metrics:{[v.metric_name]:v.metric_value},best_metric:v.metric_name,best_rank:v.best_rank?parseInt(v.best_rank):void 0,num_parameters:ze(v.num_parameters),hf_model_url:Ke(v.hf_model_url),is_open:v.is_open};j.push({op:"update",evaluation_id:parseInt(v.id),data:q})}}return j.length===0?{submitted:!1}:(await ve({paper_id:parseInt(g),edit_type:"evaluations",proposed_payload:{operations:j}}),{submitted:!0})}const I=[];for(const j of S)if(j.operation==="delete"&&j.id)I.push({operation:"delete",evaluation_id:parseInt(j.id)});else if(j.operation==="create"){if(!Xt(j))continue;const v=V(j.task_id,j.dataset_id),O=ze(j.num_parameters);I.push({operation:"create",payload:{paper_id:parseInt(g),task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),model_name:j.model_name||void 0,harness:v&&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:O??void 0,hf_model_url:Ke(j.hf_model_url)??void 0,is_open:j.is_open}})}else if(j.operation==="update"&&j.id){const v=V(j.task_id,j.dataset_id);I.push({operation:"update",evaluation_id:parseInt(j.id),payload:{task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),model_name:j.model_name||void 0,harness:v&&j.harness||null,metrics:{[j.metric_name]:j.metric_value},best_metric:j.metric_name,best_rank:j.best_rank?parseInt(j.best_rank):void 0,num_parameters:ze(j.num_parameters),hf_model_url:Ke(j.hf_model_url),is_open:j.is_open,harness_set:!0,num_parameters_set:!0,hf_model_url_set:!0}})}if(!u&&I.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");return I.length>0&&await na(parseInt(g),I),{submitted:I.length>0}},onSuccess:g=>{if(f==="pending"){g!=null&&g.submitted?B({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):B({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),o==null||o(),a(!1);return}H.invalidateQueries({queryKey:["paper-arxiv",d]}),H.invalidateQueries({queryKey:["evaluations","paper",r]}),o==null||o(),a(!1)},onError:g=>{var j;const S=g;let I=S.message||(f==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(S.response)try{const v=JSON.parse(S.response);typeof(v==null?void 0:v.detail)=="string"?I=v.detail:Array.isArray(v==null?void 0:v.detail)&&((j=v.detail[0])!=null&&j.msg)&&(I=v.detail[0].msg)}catch{I=S.response}B({title:f==="pending"?"Could not submit edit":"Could not save evaluations",description:I,variant:"destructive"})}}),F=()=>{c.current=!0,P([...w,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},D=g=>{if(c.current=!0,w[g].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;P(w.map((I,j)=>j===g?{...I,operation:"delete"}:I))}else P(w.filter((I,j)=>j!==g))},E=(g,S,I)=>{c.current=!0,P(w.map((j,v)=>{if(v!==g)return j;const O={...j,[S]:I};return S==="task_id"&&(O.dataset_id="",O.metric_name="",O.harness=""),S==="dataset_id"&&(O.metric_name="",I&&!V(O.task_id,I)&&(O.harness="")),j.operation==="unchanged"&&(O.operation="update"),O}))},Q=(g,S)=>{c.current=!0,P(w.map((I,j)=>{if(j!==g)return I;const v={...I,is_open:S};return I.operation==="unchanged"&&(v.operation="update"),v}))},Y=()=>{const g=w.filter(S=>S.operation!=="delete"||S.id);R.mutate({paperId:r,evaluations:g})};return e.jsxs(ie,{open:s,onOpenChange:a,children:[e.jsxs(oe,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Evaluation Results"}),e.jsx(de,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),f==="pending"&&e.jsx(ye,{isAuthor:t}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[w.filter(g=>g.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 ${C?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),C&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:w.map((g,S)=>{if(g.operation==="delete")return null;const I=h.get(g.task_id),j=L.get(g.dataset_id),v=x(g.task_id,g.dataset_id,g.metric_name),O=!!(g.task_id&&g.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(Gt,{value:g.task_id,onChange:q=>E(S,"task_id",q),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:I?{value:I.id,label:I.name}:null,queryKey:["eval-edit-task-search"],queryFn:z,enabled:s})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Gt,{value:g.dataset_id,onChange:q=>E(S,"dataset_id",q),placeholder:g.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:g.task_id?"No datasets found for this task.":"Select a task first.",disabled:!g.task_id,selectedOption:j?{value:j.id,label:j.name}:null,queryKey:["eval-edit-dataset-search",g.task_id],queryFn:K(g.task_id),enabled:s&&!!g.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Z,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:g.model_name,onChange:q=>E(S,"model_name",q.target.value)})}),C&&e.jsx("td",{className:"py-2 px-2",children:V(g.task_id,g.dataset_id)?e.jsx(Z,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:g.harness,onChange:q=>E(S,"harness",q.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!g.task_id||!g.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):O?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..."]}):v.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:g.metric_name,onChange:q=>E(S,"metric_name",q.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),v.map(q=>e.jsx("option",{value:q.value,children:q.label},q.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(Z,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:g.metric_value,onChange:q=>E(S,"metric_value",q.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Z,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:g.num_parameters,onChange:q=>E(S,"num_parameters",q.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Z,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:g.hf_model_url,onChange:q=>E(S,"hf_model_url",q.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:g.is_open,onChange:q=>Q(S,q.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(M,{variant:"ghost",size:"sm",onClick:()=>D(S),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(Ye,{className:"w-4 h-4"})})})]},S)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(qa,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(M,{variant:"outline",size:"sm",onClick:F,className:"flex items-center space-x-2",children:[e.jsx(Je,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(ue,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(M,{variant:"ghost",onClick:()=>$("benchmark"),children:"Suggest a new benchmark"}),e.jsx(M,{variant:"ghost",onClick:()=>$("metric"),children:"Suggest a new metric"})]}),e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:Y,disabled:R.isPending,children:R.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),f==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),f==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(yt,{open:N!==null,onOpenChange:g=>{g||$(null)},paperId:r,kind:N??"benchmark"})]})}const ct=[{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 Yt(s){return s.map(a=>a.trim()).filter(Boolean)}function dt(s,a){const r=Yt(s).sort(),d=Yt(a).sort();return r.length!==d.length?!1:r.every((i,l)=>i===d[l])}function Pr(s,a){return dt(s.hf_models,a.hf_models)&&dt(s.hf_datasets,a.hf_datasets)&&dt(s.hf_spaces,a.hf_spaces)}function $r({open:s,onOpenChange:a,paperId:r,arxivId:d,initialArtifacts:i,onSuccess:l,submitMode:o="direct",isAuthor:f=!1}){const[u,t]=m.useState(i),[C,w]=m.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),P=me(),{toast:N}=he(),$=m.useRef(!1);m.useEffect(()=>{if(!s){$.current=!1;return}$.current||($.current=!0,t(i),w({hf_models:"",hf_datasets:"",hf_spaces:""}))},[s,i]);const h=pe({mutationFn:async({paperId:k,artifacts:c})=>o==="pending"?(await ve({paper_id:parseInt(k),edit_type:"hf_artifacts",proposed_payload:c}),null):oa(k,c),onSuccess:k=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),l==null||l(),a(!1),w({hf_models:"",hf_datasets:"",hf_spaces:""});return}k&&Ce(P,k,[r,d]),l==null||l(),a(!1),w({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:k=>{var y;const c=k;let p=c.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");if(c.response)try{const b=JSON.parse(c.response);typeof(b==null?void 0:b.detail)=="string"?p=b.detail:Array.isArray(b==null?void 0:b.detail)&&((y=b.detail[0])!=null&&y.msg)&&(p=b.detail[0].msg)}catch{p=c.response}N({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:p,variant:"destructive"})}}),U=()=>{const k={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:c}of ct){const p=C[c].trim();if(p){if(k[c].some(y=>y.trim()===p))return alert(`This ${c.replace("hf_","")} URL is already added`),null;k[c]=[...k[c],p]}}return k},L=k=>{const c=C[k].trim();if(c){if(u[k].some(p=>p.trim()===c)){alert(`This ${k.replace("hf_","")} URL is already added`);return}t(p=>({...p,[k]:[...p[k],c]})),w(p=>({...p,[k]:""}))}},A=(k,c)=>{t(p=>({...p,[k]:p[k].filter(y=>y!==c)}))},H=()=>{const k=U();if(k===null)return;const c=Object.keys(i).some(p=>i[p].some(y=>!k[p].includes(y)));o==="direct"&&c&&!window.confirm("Remove one or more Hugging Face artifact links?")||h.mutate({paperId:r,artifacts:k})},B=m.useMemo(()=>{const k={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:c}of ct){const p=C[c].trim();if(p){if(k[c].some(y=>y.trim()===p))return!1;k[c]=[...k[c],p]}}return!Pr(k,i)},[u,C,i]);return e.jsx(ie,{open:s,onOpenChange:a,children:e.jsxs(oe,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit Hugging Face Artifacts"}),e.jsx(de,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(ye,{isAuthor:f}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:ct.map(({key:k,label:c,placeholder:p})=>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(Z,{type:"url",placeholder:p,value:C[k],onChange:y=>w(b=>({...b,[k]:y.target.value})),onKeyPress:y=>{y.key==="Enter"&&(y.preventDefault(),L(k))},className:"flex-1"}),e.jsxs(M,{onClick:()=>L(k),size:"sm",disabled:!C[k].trim(),children:[e.jsx(Je,{className:"w-4 h-4 mr-1"}),"Add"]})]}),u[k].length>0?e.jsx("div",{className:"space-y-2",children:u[k].map(y=>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:y}),e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>A(k,y),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${c.toLowerCase()} URL`,children:e.jsx(Ye,{className:"w-4 h-4"})})]},y))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",c.toLowerCase()," linked yet."]})]},k))}),e.jsxs(ue,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:H,disabled:h.isPending||!B,children:h.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(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const Ir=({open:s,onOpenChange:a,paperId:r,initialOrganizationIds:d,submitMode:i,isAuthor:l})=>{var w;const[o,f]=m.useState(d),u=me();m.useEffect(()=>{s&&f(d)},[d,s]);const t=re({queryKey:["organizations","curation"],queryFn:()=>ca(!1),enabled:s}),C=pe({mutationFn:async()=>{d.some(N=>!o.includes(N))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")||(i==="pending"?await ve({paper_id:Number(r),edit_type:"organizations",proposed_payload:{organization_ids:o}}):await la(r,o))},onSuccess:()=>{u.invalidateQueries({queryKey:["paper-arxiv"]}),a(!1)}});return e.jsx(ie,{open:s,onOpenChange:a,children:e.jsxs(oe,{children:[e.jsxs(le,{children:[e.jsx(ce,{children:"Edit organizations"}),e.jsx(de,{children:"Associate existing organizations with this paper. Organization creation remains admin-only."})]}),i==="pending"&&e.jsx(ye,{isAuthor:l}),e.jsx("div",{className:"max-h-80 space-y-2 overflow-auto",children:(w=t.data)==null?void 0:w.results.map(P=>{const N=Number(P.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes(N),onChange:$=>f(h=>$.target.checked?[...h,N]:h.filter(U=>U!==N))}),P.name]},P.id)})}),e.jsxs(ue,{children:[e.jsx(M,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(M,{onClick:()=>C.mutate(),disabled:C.isPending,children:i==="pending"?"Submit test edit":"Save changes"})]})]})})},Ne=["my-bookmark-ids"];function Rr(){var d,i;const{user:s}=Xe(),a=re({queryKey:Ne,queryFn:()=>xe.getMyBookmarkIds(),enabled:!!s,staleTime:60*1e3,refetchOnWindowFocus:!1}),r=vt.useMemo(()=>{var l;return new Set(((l=a.data)==null?void 0:l.paper_ids)??[])},[(d=a.data)==null?void 0:d.paper_ids]);return{ids:((i=a.data)==null?void 0:i.paper_ids)??[],idSet:r,isLoading:a.isLoading,isError:a.isError}}function Ar(){const{user:s}=Xe(),a=me(),r=pe({mutationFn:async({paperId:i,isBookmarked:l})=>{l?await xe.removeBookmark(i):await xe.addBookmark(i)},onMutate:async({paperId:i,isBookmarked:l})=>{await a.cancelQueries({queryKey:Ne});const o=a.getQueryData(Ne),f=typeof i=="string"?Number(i):i,u=(o==null?void 0:o.paper_ids)??[],t=l?u.filter(C=>C!==f):[f,...u.filter(C=>C!==f)];return a.setQueryData(Ne,{paper_ids:t}),{previous:o}},onError:(i,l,o)=>{o!=null&&o.previous&&a.setQueryData(Ne,o.previous)},onSettled:()=>{a.invalidateQueries({queryKey:Ne}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:vt.useCallback((i,l)=>{if(!s){if(cs())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=ds(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}r.mutate({paperId:i,isBookmarked:l})},[r,s]),isPending:r.isPending}}const Fr=({paperId:s})=>{const{user:a}=Xe(),{idSet:r}=Rr(),{toggle:d,isPending:i}=Ar();if(cs())return null;const l=Number(s),o=!!a&&r.has(l),f=()=>{Number.isFinite(l)&&d(l,o)},u=a&&o?"Saved":"Save",t=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:f,disabled:i,"aria-pressed":o,"aria-label":t,title:t,children:[e.jsx(X,{name:"bookmark",size:12}),u]})};function Oe({children:s,showEdit:a=!1,onEdit:r,editAriaLabel:d}){return a?e.jsxs("span",{className:"action-btn-composite",children:[s,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:r,"aria-label":d,children:"edit"})]}):s}const Lr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:s=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",s,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals",start:Va,get:Qa,cancel:Ga},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:s=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",s,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper",start:Oa,get:Ka,cancel:za}};function Tr({report:s}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(Ja,{remarkPlugins:[Ya],components:{a:({children:a,...r})=>e.jsx("a",{...r,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:a}),p:({children:a})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:a}),ul:({children:a})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:a}),ol:({children:a})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:a}),h1:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),h2:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),h3:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),code:({children:a})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:a}),pre:({children:a})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:a})},children:s})})}function ks({kind:s,paperId:a,paperTitle:r,triggerClassName:d,onComplete:i}){const l=Lr[s],[o,f]=m.useState(!1),[u,t]=m.useState(null),[C,w]=m.useState(!1),[P,N]=m.useState(null),$=m.useRef(null),h=(u==null?void 0:u.status)==="queued"||(u==null?void 0:u.status)==="dispatching"||(u==null?void 0:u.status)==="running",U=u==null?void 0:u.id;m.useEffect(()=>{if(!h||!U)return;let B=!1;const k=window.setInterval(async()=>{try{const c=await l.get(U);B||(t(c),N(null))}catch(c){B||N(c instanceof Error?c.message:"Could not check job status.")}},2e3);return()=>{B=!0,window.clearInterval(k)}},[h,l,U]),m.useEffect(()=>{(u==null?void 0:u.status)!=="completed"||$.current===u.id||($.current=u.id,i())},[u,i]);const L=async()=>{w(!0),N(null);try{t(await l.start(a))}catch(B){N(B instanceof Error?B.message:"Could not start Codex.")}finally{w(!1)}},A=()=>{t(null),N(null),$.current=null},H=async()=>{if(u){N(null);try{t(await l.cancel(u.id))}catch(B){N(B instanceof Error?B.message:"Could not cancel Codex.")}}};return e.jsxs(ie,{open:o,onOpenChange:f,children:[e.jsx("button",{type:"button",className:d,onClick:()=>f(!0),children:h?l.running:(u==null?void 0:u.status)==="completed"?l.complete:l.trigger}),e.jsxs(oe,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(le,{className:"min-w-0",children:[e.jsx(ce,{children:l.title}),e.jsx(de,{children:l.description(r)})]}),u?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",u.status]}),u.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:u.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),h&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[u.status==="queued"?"This job is queued and will start after the current Codex job finishes.":l.progress," ","This can take several minutes; you can close this window and return."]}),u.report&&e.jsx(Tr,{report:u.report}),u.error&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:u.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:l.notice}),P&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:P}),e.jsxs(ue,{children:[e.jsx(M,{variant:"outline",onClick:()=>f(!1),children:h?"Close":"Cancel"}),h&&e.jsx(M,{variant:"outline",onClick:()=>void H(),children:"Cancel job"}),!u&&e.jsx(M,{onClick:L,disabled:C,children:C?"Starting…":l.action}),u&&!h&&e.jsx(M,{variant:"outline",onClick:A,children:"Run again"})]})]})]})}function Ur(s){return e.jsx(ks,{...s,kind:"add-evals",triggerClassName:"edit-link"})}function Dr(s){return e.jsx(ks,{...s,kind:"enrich-paper",triggerClassName:"action-btn"})}var wt="Radio",[Br,ws]=jt(wt),[Hr,Mr]=Br(wt),Ns=m.forwardRef((s,a)=>{const{__scopeRadio:r,name:d,checked:i=!1,required:l,disabled:o,value:f="on",onCheck:u,form:t,...C}=s,[w,P]=m.useState(null),N=Te(a,U=>P(U)),$=m.useRef(!1),h=w?t||!!w.closest("form"):!0;return e.jsxs(Hr,{scope:r,checked:i,disabled:o,children:[e.jsx(_e.button,{type:"button",role:"radio","aria-checked":i,"data-state":Ps(i),"data-disabled":o?"":void 0,disabled:o,value:f,...C,ref:N,onClick:Le(s.onClick,U=>{i||u==null||u(),h&&($.current=U.isPropagationStopped(),$.current||U.stopPropagation())})}),h&&e.jsx(Ss,{control:w,bubbles:!$.current,name:d,value:f,checked:i,required:l,disabled:o,form:t,style:{transform:"translateX(-100%)"}})]})});Ns.displayName=wt;var Cs="RadioIndicator",Es=m.forwardRef((s,a)=>{const{__scopeRadio:r,forceMount:d,...i}=s,l=Mr(Cs,r);return e.jsx(rs,{present:d||l.checked,children:e.jsx(_e.span,{"data-state":Ps(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:a})})});Es.displayName=Cs;var qr="RadioBubbleInput",Ss=m.forwardRef(({__scopeRadio:s,control:a,checked:r,bubbles:d=!0,...i},l)=>{const o=m.useRef(null),f=Te(o,l),u=ms(r),t=is(a);return m.useEffect(()=>{const C=o.current;if(!C)return;const w=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==r&&N){const $=new Event("click",{bubbles:d});N.call(C,r),C.dispatchEvent($)}},[u,r,d]),e.jsx(_e.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:f,style:{...i.style,...t,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ss.displayName=qr;function Ps(s){return s?"checked":"unchecked"}var zr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tt="RadioGroup",[Kr]=jt(tt,[us,ws]),$s=us(),Is=ws(),[Or,Gr]=Kr(tt),Rs=m.forwardRef((s,a)=>{const{__scopeRadioGroup:r,name:d,defaultValue:i,value:l,required:o=!1,disabled:f=!1,orientation:u,dir:t,loop:C=!0,onValueChange:w,...P}=s,N=$s(r),$=da(t),[h,U]=ns({prop:l,defaultProp:i??null,onChange:w,caller:tt});return e.jsx(Or,{scope:r,name:d,required:o,disabled:f,value:h,onValueChange:U,children:e.jsx(ua,{asChild:!0,...N,orientation:u,dir:$,loop:C,children:e.jsx(_e.div,{role:"radiogroup","aria-required":o,"aria-orientation":u,"data-disabled":f?"":void 0,dir:$,...P,ref:a})})})});Rs.displayName=tt;var As="RadioGroupItem",Fs=m.forwardRef((s,a)=>{const{__scopeRadioGroup:r,disabled:d,...i}=s,l=Gr(As,r),o=l.disabled||d,f=$s(r),u=Is(r),t=m.useRef(null),C=Te(a,t),w=l.value===i.value,P=m.useRef(!1);return m.useEffect(()=>{const N=h=>{zr.includes(h.key)&&(P.current=!0)},$=()=>P.current=!1;return document.addEventListener("keydown",N),document.addEventListener("keyup",$),()=>{document.removeEventListener("keydown",N),document.removeEventListener("keyup",$)}},[]),e.jsx(ma,{asChild:!0,...f,focusable:!o,active:w,children:e.jsx(Ns,{disabled:o,required:l.required,checked:w,...u,...i,name:l.name,ref:C,onCheck:()=>l.onValueChange(i.value),onKeyDown:Le(N=>{N.key==="Enter"&&N.preventDefault()}),onFocus:Le(i.onFocus,()=>{var N;P.current&&((N=t.current)==null||N.click())})})})});Fs.displayName=As;var Qr="RadioGroupIndicator",Ls=m.forwardRef((s,a)=>{const{__scopeRadioGroup:r,...d}=s,i=Is(r);return e.jsx(Es,{...i,...d,ref:a})});Ls.displayName=Qr;var Ts=Rs,Us=Fs,Vr=Ls;const gt=m.forwardRef(({className:s,...a},r)=>e.jsx(Ts,{className:Ve("grid gap-2",s),...a,ref:r}));gt.displayName=Ts.displayName;const Ae=m.forwardRef(({className:s,...a},r)=>e.jsx(Us,{ref:r,className:Ve("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:e.jsx(Vr,{className:"flex items-center justify-center",children:e.jsx(ha,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Ae.displayName=Us.displayName;const Wr={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},xt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,Xr=20;function Jr(s,a=Xr){if(a<1)throw new Error("Bucket copy batch size must be positive");const r=[];for(let d=0;d!xt.test(u)))return null;const o=l.join("/"),f=a==="model"?"":`${a}s/`;return{id:`${a}:${o}`,kind:a,label:o,url:`https://huggingface.co/${f}${o}`,source:`hf://${f}${o}/`,destination:`${a}s/${o}/`,repoId:o}}catch{return null}}function Yr(s){try{const a=new URL(s);if(a.hostname!=="github.com"&&a.hostname!=="www.github.com")return null;const r=a.pathname.split("/").filter(Boolean);if(r.length<2)return null;const d=r[0],i=r[1].replace(/\.git$/,"");if(!xt.test(d)||!xt.test(i))return null;const l=`${d}/${i}`;return{id:`github:${l}`,kind:"github",label:l,url:`https://github.com/${l}`,source:`https://github.com/${l}.git`,destination:`github/${l}/`}}catch{return null}}function Zr({githubUrls:s,hfModelUrls:a,hfDatasetUrls:r,hfSpaceUrls:d,paperId:i,pdfName:l,pdfUrl:o}){const f=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${l||i}.pdf`}:null,...a.map(t=>ut(t,"model")),...r.map(t=>ut(t,"dataset")),...d.map(t=>ut(t,"space")),...s.map(Yr)],u=new Set;return f.filter(t=>!t||u.has(t.id)?!1:(u.add(t.id),!0))}function en(s,a,r){const d=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${Ge(s.trim())}`];r.create&&d.push(`hf buckets create "$HF_BUCKET" --exist-ok${r.isPrivate?" --private":""}`);for(const o of a.filter(f=>f.kind!=="github"&&f.kind!=="pdf"))d.push(`hf cp ${Ge(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const i=a.find(o=>o.kind==="pdf");i&&d.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${Ge(i.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${i.destination}"`);const l=a.filter(o=>o.kind==="github");if(l.length){d.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of l){const f=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;d.push(`git clone --depth 1 -- ${Ge(o.source)} "${f}"`,`hf sync "${f}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return d.join(` -`)}function tn(s){return`${(s.split(/[:|–—]/,1)[0]||s).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function sn(s){const{toast:a}=he(),r=m.useMemo(()=>Zr({githubUrls:s.githubUrls,hfDatasetUrls:s.hfDatasetUrls,hfModelUrls:s.hfModelUrls,hfSpaceUrls:s.hfSpaceUrls,paperId:s.paperId,pdfName:s.pdfName,pdfUrl:s.pdfUrl}),[s.githubUrls,s.hfDatasetUrls,s.hfModelUrls,s.hfSpaceUrls,s.paperId,s.pdfName,s.pdfUrl]),[d,i]=m.useState(!1),[l,o]=m.useState("new"),[f,u]=m.useState(""),[t,C]=m.useState("public"),[w,P]=m.useState(()=>new Set(r.map(b=>b.id))),[N,$]=m.useState(!1),[h,U]=m.useState(null),L=r.filter(b=>w.has(b.id)),A=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/.test(f.trim()),H=en(f,L,{create:l==="new",isPrivate:t==="private"}),B=(b,T)=>{P(z=>{const K=new Set(z);return T?K.add(b):K.delete(b),K})},k=async()=>{try{await navigator.clipboard.writeText(H),a({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},c=()=>{const b=ga("/api/v1/auth/hf/login"),T=new URLSearchParams({return_to:window.location.href,authorize_bucket:"true"});l==="new"&&T.set("bucket_create","true"),window.location.assign(`${b}?${T.toString()}`)},p=async()=>{if(!s.isSignedIn){c();return}$(!0);let b=0,T=0;try{const z=L.filter(x=>x.kind!=="pdf"&&x.kind!=="github"&&!!x.repoId).map(x=>({kind:x.kind,repo_id:x.repoId})),K=Jr(z);K.length||K.push([]);for(const[x,R]of K.entries()){U({current:x+1,total:K.length});const F=await pa(s.paperId,{bucket_id:f.trim(),create:x===0&&l==="new",private:t==="private",include_pdf:x===0&&L.some(D=>D.kind==="pdf"),artifacts:R});b+=F.copied.length,T+=F.errors.length}const V=L.filter(x=>x.kind==="github").length;a({title:T?"Bucket copy partially completed":"Copied to bucket",description:[`${b} item${b===1?"":"s"} copied.`,T?`${T} item${T===1?"":"s"} failed.`:"",V?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:T?"destructive":void 0}),!T&&!V&&i(!1)}catch(z){if(z instanceof fa&&z.code==="bucket_authorization_required"){c();return}a({title:b?"Bucket copy partially completed":"Bucket copy failed",description:b?`${b} item${b===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{$(!1),U(null)}},y=()=>{P(new Set(r.map(b=>b.id))),!f&&s.suggestedBucketId&&u(s.suggestedBucketId),i(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:y,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:r.length?`${r.length} linked artifact${r.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(ie,{open:d,onOpenChange:i,children:e.jsxs(oe,{className:"max-h-[90vh] max-w-2xl overflow-y-auto",children:[e.jsxs(le,{children:[e.jsxs(ce,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(de,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),r.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Choose your destination"}),e.jsxs(gt,{value:l,onValueChange:b=>o(b),className:"grid grid-cols-2 gap-2",children:[e.jsxs(ae,{className:"bucket-choice",children:[e.jsx(Ae,{value:"new"}),"New bucket"]}),e.jsxs(ae,{className:"bucket-choice",children:[e.jsx(Ae,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(Z,{id:"bucket-id",value:f,onChange:b=>u(b.target.value),placeholder:s.suggestedBucketId||"username/paper-artifacts","aria-invalid":f.length>0&&!A}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."})]}),l==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Bucket visibility"}),e.jsxs(gt,{value:t,onValueChange:b=>C(b),className:"flex gap-5",children:[e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Ae,{value:"public"}),"Public"]}),e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Ae,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Artifacts"}),e.jsx("div",{className:"bucket-artifact-list",children:r.map(b=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(et,{id:`bucket-artifact-${b.id}`,checked:w.has(b.id),onCheckedChange:T=>B(b.id,T===!0)}),e.jsxs(ae,{htmlFor:`bucket-artifact-${b.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:Wr[b.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:b.label})]}),e.jsxs("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(X,{name:"external",size:10})]})]},b.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands",children:A?H:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."}),e.jsxs(ue,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(M,{type:"button",onClick:k,variant:"outline",disabled:!A||L.length===0,children:[e.jsx(X,{name:"copy",size:12}),"Copy commands"]}),e.jsx(M,{type:"button",onClick:p,disabled:N||s.isSignedIn&&(!A||!L.some(b=>b.kind!=="github")),children:N?h&&h.total>1?`Copying ${h.current}/${h.total}…`:"Copying…":s.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}const an={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL"},Qe=360,mt=3,Zt=3,rn=["tldr","abstract","tasks","methods","results"];function nn(s){if(!s)return{section:null,resultsTaskSlug:null};const[a,r]=s.split("?",2);if(!rn.includes(a))return{section:null,resultsTaskSlug:null};const d=a;return d!=="results"||!r?{section:d,resultsTaskSlug:null}:{section:d,resultsTaskSlug:new URLSearchParams(r).get("task")}}function es(s){return`results-task-${s}`}function on(s){return`#results?task=${encodeURIComponent(s)}`}function Ie({id:s,label:a,accent:r}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:s,children:[e.jsx("span",{children:e.jsx("a",{href:`#${s}`,className:"section-anchor-link",children:a})}),r]})}function ts(s){if(!s)return"—";try{return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ss(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function as(s,a){try{const r=new URL(s),i=r.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return i?i.replace(/[-_]+/g," "):r.hostname.replace(/^www\./,"")}catch{return a}}const Tn=()=>{var Lt,Tt,Ut,Dt,Bt,Ht,Mt,qt,zt,Kt;const{arxivId:s}=xa(),a=s?ba(s):"",r=ja(),{toast:d}=he(),{user:i}=Xe(),l=(i==null?void 0:i.is_admin)??!1,o=!!i,f=Za(i),u=!0,{data:t,isLoading:C,error:w,refetch:P}=Da(a||"",!!a),[N,$]=m.useState(!1);m.useEffect(()=>{if(!s||s===a)return;const n=window.location.search+window.location.hash;r(`/paper/${a}${n}`,{replace:!0})},[a,r,s]),m.useEffect(()=>{if(t!=null&&t.title)return document.title=Ta(t.title),()=>{document.title=Ua}},[t==null?void 0:t.title]),m.useEffect(()=>{if($(!1),!(t!=null&&t.id))return;const n=window.setTimeout(()=>$(!0),0);return()=>window.clearTimeout(n)},[t==null?void 0:t.id]);const{data:h,isLoading:U}=ir(N?t==null?void 0:t.arxiv_id:void 0),{data:L,isLoading:A,refetch:H}=sr(t==null?void 0:t.id,N&&!!(t!=null&&t.id));m.useEffect(()=>{const n=()=>{P(),H(),f==="direct"&&(t!=null&&t.id)&&(xe.primePaperCurationState(t.id,!0).catch(()=>{}),xe.primeEvaluationCurationState(t.id,!0).catch(()=>{})),d({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",n),()=>window.removeEventListener("pwc:catalog-conflict",n)},[f,t==null?void 0:t.id,P,H,d]);const{preferences:B}=va(),k=m.useMemo(()=>!L||!B.hide_closed_source_evals?L:L.filter(n=>n.is_open!==!1),[L,B.hide_closed_source_evals]),c=m.useMemo(()=>({models:(t==null?void 0:t.hf_models)??[],datasets:(t==null?void 0:t.hf_datasets)??[],spaces:(t==null?void 0:t.hf_spaces)??[]}),[t==null?void 0:t.hf_models,t==null?void 0:t.hf_datasets,t==null?void 0:t.hf_spaces]),p=m.useMemo(()=>{const n=(_,G,W)=>{const se=new Set,J=[];for(const ee of[..._,...G??[]])se.has(ee)||(se.add(ee),J.push({href:ee,label:as(ee,W)}));return J};return{models:n(c.models,h==null?void 0:h.modelUrls,"Model"),datasets:n(c.datasets,h==null?void 0:h.datasetUrls,"Dataset"),spaces:n(c.spaces,h==null?void 0:h.spaceUrls,"Space")}},[c.models,c.datasets,c.spaces,h==null?void 0:h.modelUrls,h==null?void 0:h.datasetUrls,h==null?void 0:h.spaceUrls]),y=m.useMemo(()=>{if(!k)return[];const n=new Map;for(const _ of k){const G=_.task_id,W=n.get(G);W?W.rows.push(_):n.set(G,{taskId:G,taskName:_.task_name||"—",taskSlug:_.task_slug,rows:[_]})}return Array.from(n.values())},[k]),b=m.useMemo(()=>y.map(n=>n.taskSlug??"").join("|"),[y]),T=re({queryKey:["paper-versions",t==null?void 0:t.arxiv_id],queryFn:async()=>{const n=t.arxiv_id.replace(/v\d+$/,""),_=await fetch(ds(`/api/v1/papers/arxiv/${n}/versions`));return _.ok?await _.json():[]},enabled:N&&!!(t!=null&&t.arxiv_id),staleTime:10*60*1e3}),z=re({queryKey:["related-papers",t==null?void 0:t.id],queryFn:()=>xe.getRelatedPapers(t.arxiv_id||t.id,4),enabled:N&&!!(t!=null&&t.id),staleTime:10*60*1e3}),[K,V]=m.useState(!1),[x,R]=m.useState(!1),[F,D]=m.useState(!1),E=m.useRef(!1);m.useEffect(()=>{E.current=!1},[a]),m.useEffect(()=>{let n=0;const _=(W=!1,se=!1)=>{const{section:J,resultsTaskSlug:ee}=nn(window.location.hash.slice(1));if(!J||!t||J==="tldr"&&!t.tldr||J==="results"&&(!N||A)||!W&&E.current)return;let we=null;if(J==="results"&&ee){if(we=document.getElementById(es(ee)),!we){if(y.find(Js=>Js.taskSlug===ee))return;we=document.getElementById("results")}}else we=document.getElementById(J);if(!we)return;const Xs=we;n=window.requestAnimationFrame(()=>{E.current=!0,Xs.scrollIntoView({block:"start",behavior:se?"smooth":"auto"})})};_();const G=()=>{E.current=!1,_(!0,!0)};return window.addEventListener("hashchange",G),()=>{window.removeEventListener("hashchange",G),n&&window.cancelAnimationFrame(n)}},[t,t==null?void 0:t.tldr,N,A,b,y]);const{activeEditor:Q,openEditor:Y,setEditorOpen:g}=cr();m.useEffect(()=>{f!=="direct"||!(t!=null&&t.id)||(Q&&Q!=="results"&&xe.primePaperCurationState(t.id).catch(()=>{}),Q==="results"&&xe.primeEvaluationCurationState(t.id).catch(()=>{}))},[Q,f,t==null?void 0:t.id]);const[S,I]=m.useState(null);m.useEffect(()=>{if(!i||!t)return;const n=sessionStorage.getItem("pwc:fresh-auth-edit");if(!n)return;sessionStorage.removeItem("pwc:fresh-auth-edit");const _=lr(n);_&&Y(_)},[Y,t,i]);const j=m.useMemo(()=>{if(!i||!(t!=null&&t.author_links))return!1;const n=i.username.toLowerCase();return t.author_links.some(_=>!!_.hf_username&&_.hf_username.toLowerCase()===n)},[i,t==null?void 0:t.author_links]),v=n=>{if(!o){I(n);return}Y(n)},[O,q]=m.useState("idle"),[te,Ee]=m.useState(null),[Nt,Ct]=m.useState(null),Ds=async()=>{if(a){q("indexing"),Ee(null),Ct(null);try{await Ea(a),d({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>P(),1200),q("idle")}catch(n){const _=n;let G=_.message||"Failed to index paper";if(_.response)try{G=JSON.parse(_.response).detail||G}catch{G=_.response}Ee(G),(_.status===429||_.status===503)&&Ct("Try again later after arXiv has lifted the temporary limit."),q("idle")}}},{citationDisplay:Bs,citationCopy:Et}=m.useMemo(()=>{if(!t)return{citationDisplay:"",citationCopy:""};const n=`${t.title.slice(0,60)}${t.title.length>60?"…":""}`,_=`${t.authors[0]||""}${t.authors.length>1?" et al.":""}`,G=t.authors.join(" and "),W=(t.published||"").slice(0,4)||"—",se=(J,ee)=>t.arxiv_id?`@article{${t.arxiv_id.replace(".","")}, - title={{${J}}}, - author=${ee}, - year={{${W}}}, - eprint={{${t.arxiv_id}}}, - archivePrefix={{arXiv}} -}`:`@misc{paper${t.id}, - title={{${J}}}, - author=${ee}, - year={{${W}}}, - url={{${t.source_url||t.url_abs||""}}} -}`;return{citationDisplay:se(n,`{{${_}}}`),citationCopy:se(t.title,`{${G}}`)}},[t]),St=m.useMemo(()=>er(t==null?void 0:t.leaderboard_ranks),[t==null?void 0:t.leaderboard_ranks]),[Hs,Pt]=m.useState(!1),Ms=async()=>{if(Et)try{await navigator.clipboard.writeText(Et),Pt(!0),d({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Pt(!1),1500)}catch{d({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},qs=async()=>{if(!t)return;const n=t.arxiv_id||t.id,_=tr(n,St);if(_)try{await navigator.clipboard.writeText(_),d({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{d({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(C)return e.jsxs("div",{className:"page",children:[e.jsx(Re,{className:"h-12 w-3/4 mb-4"}),e.jsx(Re,{className:"h-6 w-1/3 mb-8"}),e.jsx(Re,{className:"h-64 w-full"})]});if(w||!t)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(ge,{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."]}),te&&e.jsx(Ba,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(Ha,{children:[e.jsx("div",{children:te}),Nt&&e.jsx("div",{className:"mt-2",children:Nt})]})}),e.jsxs("div",{className:"action-row",children:[l&&e.jsxs("button",{className:"action-btn",onClick:Ds,disabled:O==="indexing",children:[e.jsx(X,{name:"sparkle",size:12}),O==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(M,{variant:"outline",onClick:()=>r("/papers"),children:"Browse Papers"})]})]});const $t=T.data||[],Se=La(t.repositories),fe=[...t.repositories??[]].sort((n,_)=>{const G=n.is_official?1:0,W=_.is_official?1:0;return G!==W?W-G:(_.num_stars||0)-(n.num_stars||0)}),zs=F?fe:fe.slice(0,mt),st={models:[...new Set([...c.models,...(h==null?void 0:h.modelUrls)??[]])],datasets:[...new Set([...c.datasets,...(h==null?void 0:h.datasetUrls)??[]])],spaces:[...new Set([...c.spaces,...(h==null?void 0:h.spaceUrls)??[]])]},at=((Lt=t.arxiv_id)==null?void 0:Lt.replace(/v\d+$/,""))??null,rt=t.arxiv_id?{isLoading:U,paperHref:`https://huggingface.co/papers/${at}`,rows:[{label:"Models",href:pt(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,c.models),count:ft(c.models,h==null?void 0:h.modelUrls,h==null?void 0:h.models),isLimited:h==null?void 0:h.isLimited,links:p.models},{label:"Datasets",href:pt(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,c.datasets),count:ft(c.datasets,h==null?void 0:h.datasetUrls,h==null?void 0:h.datasets),isLimited:h==null?void 0:h.isLimited,links:p.datasets},{label:"Spaces",href:pt(`https://huggingface.co/papers/${at}`,c.spaces),count:ft(c.spaces,h==null?void 0:h.spaceUrls,h==null?void 0:h.spaces),isLimited:h==null?void 0:h.isLimited,links:p.spaces}],footer:`Cite arxiv.org/abs/${at} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:ht(c.models),count:c.models.length,links:p.models},{label:"Datasets",href:ht(c.datasets),count:c.datasets.length,links:p.datasets},{label:"Spaces",href:ht(c.spaces),count:c.spaces.length,links:p.spaces}],footer:null},It=t.tldr||null,Rt=t.num_pages||null,ke=t.abstract||"",Ks=ke.length>Qe?ke.slice(0,Qe)+"…":ke,Os=K||ke.length<=Qe?ke:Ks,Ue=(t.methods||[]).filter(n=>n.source_paper_id===t.id),De=t.introduced_benchmarks||[],Pe=t.introduced_frameworks||[],Gs=Ue.length>0||De.length>0||Pe.length>0,At=t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",Qs=t.source==="external"?"Source page":"arXiv page",$e=((Tt=t.project_pages)==null?void 0:Tt.filter(n=>n.url))??[],Vs=(()=>{const n=[];return Ue.length>0&&n.push(Ue.length===1?"this method":"these methods"),De.length>0&&n.push(De.length===1?"this benchmark":"these benchmarks"),Pe.length>0&&n.push(Pe.length===1?"this framework":"these frameworks"),n.length===0?"":n.length===1?n[0]:n.join(" and ")})(),Be=t.predecessor_papers||[],He=t.successor_papers||[],Ws=Be.length>0||He.length>0,Me=12,nt=t.authors.map((n,_)=>{var G,W,se,J;return{name:n,id:((W=(G=t.author_links)==null?void 0:G[_])==null?void 0:W.id)??null,hf_username:((J=(se=t.author_links)==null?void 0:se[_])==null?void 0:J.hf_username)??null}}),Ft=x||nt.length<=Me?nt:nt.slice(0,Me);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(ge,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:At})]}),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(qe,{title:t.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:At}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",ts(t.published)]}),Rt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Rt," pages"]})]}),t.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[t.citation_count.toLocaleString()," citations"]})]}),(t.proceeding||t.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),t.conference_slug?e.jsx("a",{href:`/conferences/${t.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(t.proceeding||t.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:t.proceeding.replace(/\s+\d{1,2}$/,"")})]}),$t.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:t.version,onChange:n=>{const _=n.target.value;t.arxiv_id&&r(`/paper/${t.arxiv_id.replace(/v\d+$/,"")}${_?`?version=${_}`:""}`)},children:$t.map(n=>e.jsxs("option",{value:n.version,children:[n.version," — ",ts(n.published)]},n.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Ft.map((n,_)=>e.jsxs(vt.Fragment,{children:[n.id?e.jsx(ge,{to:`/authors/${n.id}`,children:n.name}):n.hf_username?e.jsx("a",{href:`https://huggingface.co/${n.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${n.hf_username} on Hugging Face`,children:n.name}):e.jsx("a",{children:n.name}),_Me&&e.jsx("button",{className:"show-more-authors",onClick:()=>R(n=>!n),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:x?"show fewer":`+${t.authors.length-Me} more`})]}),e.jsxs("div",{className:"action-row",children:[t.url_pdf&&e.jsxs("a",{className:"action-btn",href:t.url_pdf,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(X,{name:"pdf",size:12})," View PDF"]}),t.url_abs&&e.jsx(Oe,{showEdit:t.source==="external"&&u,onEdit:()=>v("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:t.source==="external"&&u?"action-btn-segment action-btn-main":"action-btn",href:t.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(X,{name:"external",size:12})," ",Qs]})}),rt.paperHref&&(h==null?void 0:h.paperExists)&&e.jsxs("a",{className:"bm-action-btn",href:rt.paperHref,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Hugging Face",children:["View on ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})]}),Se.githubUrl&&e.jsx(Oe,{showEdit:u,onEdit:()=>v("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Se.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(X,{name:"github",size:12})," Code",Se.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",ss(Se.github)," ★"]})]})}),Se.githubUrl?null:e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>v("repositories"),title:"Add GitHub repository",children:[e.jsx(X,{name:"github",size:12})," Add code"]}),$e.length===1?e.jsx(Oe,{showEdit:u,onEdit:()=>v("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:$e[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(X,{name:"globe",size:12})," Project page"]})}):null,$e.length>1?e.jsx(Oe,{showEdit:u,onEdit:()=>v("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(ya,{children:[e.jsx(_a,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(X,{name:"globe",size:12})," Project page"]})}),e.jsx(ka,{align:"start",className:"project-page-menu",children:$e.map((n,_)=>e.jsx(wa,{asChild:!0,children:e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",children:as(n.url,`Project page ${_+1}`)})},n.url))})]})}):null,$e.length===0&&o?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>v("project-pages"),title:"Add project page",children:[e.jsx(X,{name:"globe",size:12})," Add project page"]}):null,t.conference_url_abs&&e.jsxs("a",{className:"action-btn",href:t.conference_url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(X,{name:"external",size:12})," Conference"]}),(t.organizations||[]).map(n=>e.jsxs(ge,{to:`/orgs/${n.slug}`,className:"action-btn",title:n.name,"aria-label":n.name,children:[n.logo_url&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:16,width:16,borderRadius:3,overflow:"hidden"},children:e.jsx("img",{src:n.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:_=>{_.currentTarget.style.display="none"}})}),n.name]},n.id)),e.jsx("button",{type:"button",className:"action-btn",onClick:()=>v("organizations"),children:"Edit organizations"}),l&&Wa()&&e.jsx(Dr,{paperId:Number(t.id),paperTitle:t.title,onComplete:()=>void P()}),e.jsx(Fr,{paperId:t.id})]}),t.leaderboard_ranks&&t.leaderboard_ranks.length>0&&e.jsx(Sa,{wrap:!0,paperHref:`/paper/${t.arxiv_id||t.id}`,ranks:t.leaderboard_ranks.filter(n=>n.best_rank>=1&&n.best_rank<=3).map(n=>({name:n.dataset_name,slug:n.dataset_slug||null,rank:n.best_rank}))})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Pa,{paperId:t.arxiv_id||t.id,title:t.title,thumbnailUrl:Na(t.thumbnail_url),priority:!0})})]}),Gs&&e.jsxs("div",{className:`introduced-banner${Pe.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Ue.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/methods/${n.slug||n.id}`),children:[n.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${n.id}`)),De.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/benchmark/${n.slug||n.id}`),children:[n.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${n.id}`)),Pe.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>r(`/frameworks#framework-${n.slug}`),children:[n.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${n.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Vs,"."]})]}),Ws&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[He.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:He.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:He.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>r(`/paper/${n.route_identifier}`),children:[e.jsx(qe,{title:n.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${n.id}`))})]}),Be.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Be.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Be.map(n=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>r(`/paper/${n.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(qe,{title:n.title})]},`predecessor-${n.id}`))})]})]}),It&&e.jsxs(e.Fragment,{children:[e.jsx(Ie,{id:"tldr",label:"TL;DR · AI-generated"}),e.jsx("div",{className:"tldr-box",children:It})]}),e.jsx(Ie,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Fa,{text:Os})}),ke.length>Qe&&e.jsx("div",{className:"read-full",onClick:()=>V(n=>!n),children:K?"− collapse abstract":"+ read full abstract"}),e.jsx(Ie,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((Ut=t.tasks)==null?void 0:Ut.length)||0," tagged",e.jsx("button",{type:"button",onClick:()=>v("tasks"),className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(t.tasks||[]).map(n=>e.jsx($a,{slug:n.slug||"",label:n.name},n.id))}),e.jsx(Ie,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((Dt=t.methods)==null?void 0:Dt.length)||0," used",e.jsx("button",{type:"button",onClick:()=>v("methods"),className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(t.methods||[]).map(n=>e.jsx(Ia,{method:n},n.id))}),e.jsx(Ie,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[(k==null?void 0:k.length)||0," benchmarks",St.length>0&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:qs,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(X,{name:"copy",size:10})," Copy PwC badge"]}),l&&Xa()&&e.jsx(Ur,{paperId:Number(t.id),paperTitle:t.title,onComplete:()=>void H()}),e.jsx("button",{type:"button",onClick:()=>v("results"),className:"edit-link",children:"edit"})]})}),A?e.jsx(Re,{className:"h-32 w-full"}):y.length>0?y.map(n=>e.jsxs("div",{className:n.taskSlug?"paper-section-anchor":void 0,id:n.taskSlug?es(n.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:n.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(ge,{to:`/tasks/${n.taskSlug}`,children:n.taskName}),e.jsx("a",{href:on(n.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${n.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):n.taskName}),e.jsxs("span",{className:"accent",children:[n.rows.length," ",n.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:n.rows.map(_=>{var G;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:_.dataset_slug?e.jsx(ge,{to:`/benchmark/${_.dataset_slug}`,children:_.dataset_name||"—"}):_.dataset_name||"—"}),e.jsxs("td",{className:"model",title:_.model_name||void 0,children:[_.hf_model_url?e.jsx("a",{href:_.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${_.model_name||"model"} on Hugging Face`,children:_.model_name||"—"}):_.model_name||"—",_.is_open===!1&&e.jsx(Ra,{}),(_.external??_.is_external)&&e.jsx(Aa,{sourceUrl:_.source_url||_.external_source_url||_.result_url})]}),e.jsx("td",{className:"metric",children:_.best_metric}),e.jsx("td",{className:"value",children:Ca((G=_.metrics)==null?void 0:G[_.best_metric||""])}),e.jsx("td",{className:"rank",children:_.best_rank!=null?`#${_.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:_.dataset_slug&&e.jsx(ge,{to:`/benchmark/${_.dataset_slug}?${[_.task_slug?`task=${encodeURIComponent(_.task_slug)}`:"",`eval=${encodeURIComponent(_.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},_.id)})})]})]},n.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[fe.length," repo",fe.length===1?"":"s",e.jsx("button",{type:"button",onClick:()=>v("repositories"),className:"edit-link",children:"edit"})]})]}),zs.map(n=>e.jsxs("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(X,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[n.owner,"/",n.name]}),n.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",ss(n.num_stars)]})]},n.id)),fe.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),fe.length>mt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>D(n=>!n),children:F?"− show top 3":`+ show ${fe.length-mt} more repos`})]}),e.jsx(ln,{viewer:rt,onEdit:()=>v("hf-artifacts")}),e.jsx(sn,{githubUrls:fe.map(n=>n.url),hfModelUrls:st.models,hfDatasetUrls:st.datasets,hfSpaceUrls:st.spaces,paperId:t.id,pdfName:((Bt=t.arxiv_id)==null?void 0:Bt.replace("/","-"))||t.id,pdfUrl:t.url_pdf,isSignedIn:!!i,suggestedBucketId:i?`${i.username}/${tn(t.title)}`:void 0}),z.isLoading&&e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}),!z.isLoading&&(((Ht=z.data)==null?void 0:Ht.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),z.data.map(n=>e.jsxs(ge,{to:`/paper/${n.arxiv_id||n.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(qe,{title:n.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:n.arxiv_id?`arXiv:${n.arxiv_id}`:"External resource"}),n.citation_count!=null&&e.jsxs("span",{children:[n.citation_count.toLocaleString()," cites"]})]})]},n.id))]}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:Ms,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(X,{name:"copy",size:11}),Hs?"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:Bs})]})]})]}),e.jsx(xr,{open:Q==="tasks",onOpenChange:n=>g("tasks",n),paperId:t.id,arxivId:a,initialTaskIds:((Mt=t.tasks)==null?void 0:Mt.map(n=>parseInt(n.id)))||[],initialTasks:t.tasks||[],submitMode:f,isAuthor:j}),e.jsx(vr,{open:Q==="methods",onOpenChange:n=>g("methods",n),paperId:t.id,arxivId:a,initialMethodIds:((qt=t.methods)==null?void 0:qt.map(n=>parseInt(n.id)))||[],initialMethods:t.methods||[],submitMode:f,isAuthor:j}),e.jsx(yr,{open:Q==="repositories",onOpenChange:n=>g("repositories",n),paperId:t.id,arxivId:a,initialRepositories:((zt=t.repositories)==null?void 0:zt.map(n=>({url:n.url,is_official:n.is_official||!1})))||[],submitMode:f,isAuthor:j}),e.jsx(_r,{open:Q==="project-pages",onOpenChange:n=>g("project-pages",n),paperId:t.id,arxivId:a,initialProjectPages:((Kt=t.project_pages)==null?void 0:Kt.map(n=>({url:n.url,is_official:n.is_official||!1})))||[],submitMode:f,isAuthor:j}),e.jsx(Sr,{open:Q==="results",onOpenChange:n=>g("results",n),paperId:t.id,arxivId:a,initialEvaluations:L||[],paperTasks:t.tasks||[],submitMode:f,isAdmin:l,isAuthor:j}),e.jsx(kr,{open:Q==="source-url",onOpenChange:n=>g("source-url",n),paperId:t.id,arxivId:a,initialUrl:t.source_url??t.url_abs??"",submitMode:f,isAuthor:j}),e.jsx($r,{open:Q==="hf-artifacts",onOpenChange:n=>g("hf-artifacts",n),paperId:t.id,arxivId:a,initialArtifacts:{hf_models:c.models,hf_datasets:c.datasets,hf_spaces:c.spaces},submitMode:f,isAuthor:j}),e.jsx(Ir,{open:Q==="organizations",onOpenChange:n=>g("organizations",n),paperId:t.id,initialOrganizationIds:(t.organizations||[]).map(n=>Number(n.id)),submitMode:f,isAuthor:j}),e.jsx(Ma,{open:S!==null,onOpenChange:n=>{n||I(null)},sectionLabel:S?an[S]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})},ln=({viewer:s,onEdit:a})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]}),s.isLoading?e.jsx(Re,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(r=>e.jsx(cn,{...r},r.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]}),cn=({label:s,href:a,count:r,isLimited:d,links:i})=>{const[l,o]=m.useState(!1),f=((i==null?void 0:i.length)??0)>0,u=((i==null?void 0:i.length)??0)>Zt,t=l?i:i==null?void 0:i.slice(0,Zt),C=r!=null?`${r}${d?"+":""}`:"—",w=r?e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:C}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:C});return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:s}),w]}),f&&e.jsxs("div",{className:"hf-artifact-links",children:[t.map(P=>e.jsx("a",{href:P.href,target:"_blank",rel:"noopener noreferrer",children:P.label},P.href)),u&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":l,onClick:()=>o(P=>!P),children:l?"Show fewer":`View all ${i.length}`})]})]})};function ht(s){return s[0]??"https://huggingface.co"}function pt(s,a){return a[0]??s}function ft(s,a,r){if(r==null&&s.length===0&&!(a!=null&&a.length))return;const d=new Set([...s,...a??[]]);return Math.max(r??0,d.size)}export{Tn as default}; diff --git a/assets/PaperPreviewLink-Dud2kyWl.js b/assets/PaperPreviewLink-hLdU_QRR.js similarity index 98% rename from assets/PaperPreviewLink-Dud2kyWl.js rename to assets/PaperPreviewLink-hLdU_QRR.js index eea7817b12bb05f2488fbf8af68489edaca4320d..a2d709c631510eed721cd61c6dbc435159b28548 100644 --- a/assets/PaperPreviewLink-Dud2kyWl.js +++ b/assets/PaperPreviewLink-hLdU_QRR.js @@ -1,4 +1,4 @@ -import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-SnRTg719.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,a2 as ce,Y as ue,L as he,ap as pe}from"./index-BfD7YdLr.js";import{u as me}from"./useQuery-BQY3DH-b.js";import{H as fe,a as de,b as ge}from"./hover-card-Bp6412TC.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-N_WymWS-.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,a2 as ce,Y as ue,L as he,ap as pe}from"./index-Bn8Ob2yb.js";import{u as me}from"./useQuery-DdnDUe7s.js";import{H as fe,a as de,b as ge}from"./hover-card-BMKmh3eo.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,l,a){const u=o.value||"",p=l.createTracker(a),m="$".repeat(Math.max(ne(u,"$")+1,2)),g=l.enter("mathFlow");let x=p.move(m);if(o.meta){const d=l.enter("mathFlowMeta");x+=p.move(l.safe(o.meta,{after:` `,before:x,encode:["$"],...p.current()})),d()}return x+=p.move(` `),u&&(x+=p.move(u+` diff --git a/assets/PapersListView-Cz1rE6-Q.js b/assets/PapersListView-BmApqIB5.js similarity index 89% rename from assets/PapersListView-Cz1rE6-Q.js rename to assets/PapersListView-BmApqIB5.js index a9cfa4ff4443fcf52e7d4be08f837dcf7c8a48f7..24e78b81faa37b17811e3899760c000fd1dd9640 100644 --- a/assets/PapersListView-Cz1rE6-Q.js +++ b/assets/PapersListView-BmApqIB5.js @@ -1 +1 @@ -import{a as q,r as l,A as z,j as e,L as f,b as G}from"./index-BfD7YdLr.js";import{I as H,P as Q}from"./components-LTCBEq5x.js";import{t as U,d as W}from"./transform-DCLb4olr.js";import{u as K}from"./usePapers-DrFoptcF.js";import{u as V}from"./useDebounce-Czrc054X.js";import{P as J}from"./usePeriodFilter-Coc3diQT.js";import{u as X,P as Y}from"./useIntersectionObserver-mJEWgLMQ.js";import{S as m}from"./skeleton-DlrhV-qs.js";import{A as Z,a as ee}from"./alert-zXn954y8.js";import{u as se}from"./useQuery-BQY3DH-b.js";import"./LatexTitle-Dyu7ZW4B.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CVNt5m44.js";import"./useBaseQuery-zm-nsmQ1.js";const ae=[["trending","trending"],["new","newest"],["cited","most cited"]],je=()=>{var T,A,C,I,L,R,E;const[i,b]=q(),h=i.get("framework")||void 0,g=i.get("repository")||void 0,n=!!(h||g),p=i.get("search")||"",[_,y]=l.useState(p),c=V(_,300);l.useEffect(()=>y(p),[p]),l.useEffect(()=>{if(c===p)return;const s=new URLSearchParams(i);c?s.set("search",c):s.delete("search"),b(s,{replace:!0})},[c]);const j=i.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=i.get("time"),B=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",w=i.get("has_hf_artifacts")==="true",k=!n&&i.get("has_code")==="true",u=(s,t)=>{const d=new URLSearchParams(i);t?d.set(s,t):d.delete(s),b(d)},O=s=>{u("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},$=s=>{u("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},r=K({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:c||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:i.get("published_after")||void 0,published_before:i.get("published_before")||void 0,conference:i.get("conference")||void 0,latest_only:i.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:h,repository:g}),P=se({queryKey:["top-tasks-sidebar"],queryFn:()=>G.getTopTasks({limit:8}),enabled:!n,staleTime:10*60*1e3}),v=l.useMemo(()=>{var t;return(((t=r.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(U)},[r.data]),{targetRef:D,isIntersecting:F}=X({rootMargin:"200px"});l.useEffect(()=>{F&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[F,r.hasNextPage,r.isFetchingNextPage]);const x=((C=(A=(T=r.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=r.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&r.error instanceof z&&r.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(f,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(f,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",x>0&&`${x.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",x>0&&`${x.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"framework-card-links paper-feed-scope-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(H,{name:"github",size:13}),"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(f,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]})]}),e.jsx("div",{className:"period-switch",children:J.map(s=>e.jsx("button",{className:`period-btn ${B===s?"active":""}`,onClick:()=>O(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(H,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:_,onChange:s=>y(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(m,{className:"h-5 w-full"},t))}),(E=P.data)==null?void 0:E.map(s=>e.jsxs(f,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[W(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ae.map(([s,t])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>$(s),children:t},s))}),e.jsx(Y,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>u("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>u("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):r.error&&e.jsx(Z,{variant:"destructive",className:"mb-4",children:e.jsx(ee,{children:"Failed to load papers. Please try again."})}),!S&&(r.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(m,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(m,{className:"h-6 w-3/4"}),e.jsx(m,{className:"h-4 w-1/2"}),e.jsx(m,{className:"h-12 w-full"})]})]},t))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,t)=>e.jsx(Q,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:D,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{je as default}; +import{a as q,r as l,A as z,j as e,L as f,b as G}from"./index-Bn8Ob2yb.js";import{I as H,P as Q}from"./components-CmiCpieH.js";import{t as U,d as W}from"./transform-Z_GB05A-.js";import{u as K}from"./usePapers-CQQdWWPS.js";import{u as V}from"./useDebounce-Q8ScjHA0.js";import{P as J}from"./usePeriodFilter-DFtHY8n2.js";import{u as X,P as Y}from"./useIntersectionObserver-odYwsx6w.js";import{S as m}from"./skeleton-DMgHDmV1.js";import{A as Z,a as ee}from"./alert-ek_GWo6X.js";import{u as se}from"./useQuery-DdnDUe7s.js";import"./LatexTitle-CCig7BhH.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-Be_M3qGu.js";import"./useBaseQuery-DOoW3hTR.js";const ae=[["trending","trending"],["new","newest"],["cited","most cited"]],je=()=>{var T,A,C,I,L,R,E;const[i,b]=q(),h=i.get("framework")||void 0,g=i.get("repository")||void 0,n=!!(h||g),p=i.get("search")||"",[_,y]=l.useState(p),c=V(_,300);l.useEffect(()=>y(p),[p]),l.useEffect(()=>{if(c===p)return;const s=new URLSearchParams(i);c?s.set("search",c):s.delete("search"),b(s,{replace:!0})},[c]);const j=i.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=i.get("time"),B=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",w=i.get("has_hf_artifacts")==="true",k=!n&&i.get("has_code")==="true",u=(s,t)=>{const d=new URLSearchParams(i);t?d.set(s,t):d.delete(s),b(d)},O=s=>{u("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},$=s=>{u("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},r=K({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:c||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:i.get("published_after")||void 0,published_before:i.get("published_before")||void 0,conference:i.get("conference")||void 0,latest_only:i.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:h,repository:g}),P=se({queryKey:["top-tasks-sidebar"],queryFn:()=>G.getTopTasks({limit:8}),enabled:!n,staleTime:10*60*1e3}),v=l.useMemo(()=>{var t;return(((t=r.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(U)},[r.data]),{targetRef:D,isIntersecting:F}=X({rootMargin:"200px"});l.useEffect(()=>{F&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[F,r.hasNextPage,r.isFetchingNextPage]);const x=((C=(A=(T=r.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=r.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&r.error instanceof z&&r.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(f,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(f,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",x>0&&`${x.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",x>0&&`${x.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"framework-card-links paper-feed-scope-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(H,{name:"github",size:13}),"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(f,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]})]}),e.jsx("div",{className:"period-switch",children:J.map(s=>e.jsx("button",{className:`period-btn ${B===s?"active":""}`,onClick:()=>O(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(H,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:_,onChange:s=>y(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(m,{className:"h-5 w-full"},t))}),(E=P.data)==null?void 0:E.map(s=>e.jsxs(f,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[W(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ae.map(([s,t])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>$(s),children:t},s))}),e.jsx(Y,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>u("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>u("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):r.error&&e.jsx(Z,{variant:"destructive",className:"mb-4",children:e.jsx(ee,{children:"Failed to load papers. Please try again."})}),!S&&(r.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(m,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(m,{className:"h-6 w-3/4"}),e.jsx(m,{className:"h-4 w-1/2"}),e.jsx(m,{className:"h-12 w-full"})]})]},t))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,t)=>e.jsx(Q,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:D,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{je as default}; diff --git a/assets/SavedPapersView-DIgZ31F9.js b/assets/SavedPapersView-Bt241wOv.js similarity index 86% rename from assets/SavedPapersView-DIgZ31F9.js rename to assets/SavedPapersView-Bt241wOv.js index 15638dd7cf3a90c37f34ece43d07ec0b4da1d476..1ab7c5b9dbb9f268052a7a4970566d21a12bfe00 100644 --- a/assets/SavedPapersView-DIgZ31F9.js +++ b/assets/SavedPapersView-Bt241wOv.js @@ -1 +1 @@ -import{f as o,j as s,aa as m,L as p,b as h}from"./index-BfD7YdLr.js";import{u as x}from"./useQuery-BQY3DH-b.js";import{T as u,P as j}from"./components-LTCBEq5x.js";import{S as r}from"./skeleton-DlrhV-qs.js";import{A as v,a as N}from"./alert-zXn954y8.js";import{t as g}from"./transform-DCLb4olr.js";import"./useBaseQuery-zm-nsmQ1.js";import"./LatexTitle-Dyu7ZW4B.js";import"./katex.min-BSBacQyE.js";const C=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{C as default}; +import{f as o,j as s,aa as m,L as p,b as h}from"./index-Bn8Ob2yb.js";import{u as x}from"./useQuery-DdnDUe7s.js";import{T as u,P as j}from"./components-CmiCpieH.js";import{S as r}from"./skeleton-DMgHDmV1.js";import{A as v,a as N}from"./alert-ek_GWo6X.js";import{t as g}from"./transform-Z_GB05A-.js";import"./useBaseQuery-DOoW3hTR.js";import"./LatexTitle-CCig7BhH.js";import"./katex.min-BSBacQyE.js";const C=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{C as default}; diff --git a/assets/SearchOverlay-CZcmEWhv.js b/assets/SearchOverlay-97sfjbbt.js similarity index 93% rename from assets/SearchOverlay-CZcmEWhv.js rename to assets/SearchOverlay-97sfjbbt.js index b060534db30b0dcb591bced94b1710eca48c7705..2ca70ea02435a9cc27c198d4a1d2d4a825433af0 100644 --- a/assets/SearchOverlay-CZcmEWhv.js +++ b/assets/SearchOverlay-97sfjbbt.js @@ -1 +1 @@ -import{r as C,u as L,R as T,i as $,j as s,b as m}from"./index-BfD7YdLr.js";import{u as p}from"./useQuery-BQY3DH-b.js";import{L as A}from"./LatexTitle-Dyu7ZW4B.js";import{u as D}from"./useDebounce-Czrc054X.js";import{c as z,h as M,d as B}from"./transform-DCLb4olr.js";import"./useBaseQuery-zm-nsmQ1.js";import"./katex.min-BSBacQyE.js";const I=10,J=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{J as default}; +import{r as C,u as L,R as T,i as $,j as s,b as m}from"./index-Bn8Ob2yb.js";import{u as p}from"./useQuery-DdnDUe7s.js";import{L as A}from"./LatexTitle-CCig7BhH.js";import{u as D}from"./useDebounce-Q8ScjHA0.js";import{c as z,h as M,d as B}from"./transform-Z_GB05A-.js";import"./useBaseQuery-DOoW3hTR.js";import"./katex.min-BSBacQyE.js";const I=10,J=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{J as default}; diff --git a/assets/SettingsView-DzELfroP.js b/assets/SettingsView-BT6c57TI.js similarity index 97% rename from assets/SettingsView-DzELfroP.js rename to assets/SettingsView-BT6c57TI.js index 3fc1cbac197291360b632bd5ea31aa9a89d5f2d7..5fb230a1eb422812afd8b2d27a118f53949cc0f0 100644 --- a/assets/SettingsView-DzELfroP.js +++ b/assets/SettingsView-BT6c57TI.js @@ -1,4 +1,4 @@ -import{c as v,f as Q,Z as q,as as B,R as g,h as z,j as e,aa as h,d as P,b as y,A as W}from"./index-BfD7YdLr.js";import{u as Y}from"./useQuery-BQY3DH-b.js";import{u as m}from"./useMutation-BQa0xQql.js";import{S as F}from"./switch-D_aiRxQJ.js";import{f as $,D as K}from"./latexPlainText-DI8YEXVe.js";import{b as L,u as V,r as Z,a as j}from"./openrouter-ClIkjPp2.js";import{E as I}from"./external-link-lQRIh-Se.js";import"./useBaseQuery-zm-nsmQ1.js";import"./index-qlYSmaoI.js";/** +import{c as v,f as Q,Z as q,as as B,R as g,h as z,j as e,aa as h,d as P,b as y,A as W}from"./index-Bn8Ob2yb.js";import{u as Y}from"./useQuery-DdnDUe7s.js";import{u as m}from"./useMutation-CkFxqrff.js";import{S as F}from"./switch-CO-39qkR.js";import{f as $,D as K}from"./latexPlainText-DI8YEXVe.js";import{b as L,u as V,r as Z,a as j}from"./openrouter-Ho6iwenl.js";import{E as I}from"./external-link-DEYzZhKb.js";import"./useBaseQuery-DOoW3hTR.js";import"./index-Bty21uio.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SharedChatView-BcOQHbFQ.js b/assets/SharedChatView-BiDdc9TO.js similarity index 86% rename from assets/SharedChatView-BcOQHbFQ.js rename to assets/SharedChatView-BiDdc9TO.js index ee44b6fcfd0bb7a65027adc1afd4a0609ac871a6..a846116f26ed38c5a2b0ff2b426cce67ed768487 100644 --- a/assets/SharedChatView-BcOQHbFQ.js +++ b/assets/SharedChatView-BiDdc9TO.js @@ -1 +1 @@ -import{e as g,u as f,r as u,j as e,l as x}from"./index-BfD7YdLr.js";import{u as v}from"./useQuery-BQY3DH-b.js";import{C as j,U as S,A as y}from"./ChatMessage-8Xxu3vLN.js";import{n as p,S as b,p as N,q,o as C}from"./chatSessions-Dl4MrfBi.js";import"./useBaseQuery-zm-nsmQ1.js";import"./katex.min-BSBacQyE.js";import"./hover-card-Bp6412TC.js";import"./PaperPreviewLink-Dud2kyWl.js";import"./index-SnRTg719.js";const k=({detail:d})=>{const[i,h]=u.useState(()=>N(d)),a=u.useMemo(()=>{const t={};for(const n of i)for(const s of n.blocks??[])if(s.kind==="tool")for(const r of s.results??[])t[r.route_id]=r;return t},[i]),l=(t,n)=>{h(s=>s.map(r=>{var o;return r.id!==t?r:{...r,blocks:(o=r.blocks)==null?void 0:o.map((c,m)=>m===n&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??""},t.id):e.jsx(y,{msg:t,papers:a,onToggleBlock:l},t.id))})},B=()=>{const{shareId:d=""}=g(),i=f(),h=x(),a=v({queryKey:["shared-chat",d],queryFn:()=>C(d),retry:(n,s)=>!(s instanceof p&&s.status===404)&&n<1});u.useEffect(()=>{const n=document.title,s=document.head.querySelector('meta[name="robots"]'),r=s==null?void 0:s.content,o=s??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",s||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=n,s?s.content=r??"":o.remove()}},[]);const l=n=>{q(n,void 0,{autoSend:!1}),i("/chat")},t=a.error instanceof p&&a.error.status===404;return a.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(b,{})," Loading shared conversation…"]}):t?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):a.isError||!a.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void a.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(k,{detail:a.data},a.data.updated_at),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users. Hugging Face models also require the Inference Providers permission granted during sign-in; choose personal or organization billing in"," ",e.jsx("a",{href:"/settings",children:"Settings"}),"."]}),e.jsx(j,{onSend:l,placeholder:"Ask a new research question…"})]})]})]})};export{B as default}; +import{e as g,u as f,r as u,j as e,l as x}from"./index-Bn8Ob2yb.js";import{u as v}from"./useQuery-DdnDUe7s.js";import{C as j,U as S,A as y}from"./ChatMessage-BNDm-FB_.js";import{n as p,S as b,p as N,q,o as C}from"./chatSessions-CJGL67ci.js";import"./useBaseQuery-DOoW3hTR.js";import"./katex.min-BSBacQyE.js";import"./hover-card-BMKmh3eo.js";import"./PaperPreviewLink-hLdU_QRR.js";import"./index-N_WymWS-.js";const k=({detail:d})=>{const[i,h]=u.useState(()=>N(d)),a=u.useMemo(()=>{const t={};for(const n of i)for(const s of n.blocks??[])if(s.kind==="tool")for(const r of s.results??[])t[r.route_id]=r;return t},[i]),l=(t,n)=>{h(s=>s.map(r=>{var o;return r.id!==t?r:{...r,blocks:(o=r.blocks)==null?void 0:o.map((c,m)=>m===n&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??""},t.id):e.jsx(y,{msg:t,papers:a,onToggleBlock:l},t.id))})},B=()=>{const{shareId:d=""}=g(),i=f(),h=x(),a=v({queryKey:["shared-chat",d],queryFn:()=>C(d),retry:(n,s)=>!(s instanceof p&&s.status===404)&&n<1});u.useEffect(()=>{const n=document.title,s=document.head.querySelector('meta[name="robots"]'),r=s==null?void 0:s.content,o=s??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",s||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=n,s?s.content=r??"":o.remove()}},[]);const l=n=>{q(n,void 0,{autoSend:!1}),i("/chat")},t=a.error instanceof p&&a.error.status===404;return a.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(b,{})," Loading shared conversation…"]}):t?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):a.isError||!a.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void a.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(k,{detail:a.data},a.data.updated_at),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users. Hugging Face models also require the Inference Providers permission granted during sign-in; choose personal or organization billing in"," ",e.jsx("a",{href:"/settings",children:"Settings"}),"."]}),e.jsx(j,{onSend:l,placeholder:"Ask a new research question…"})]})]})]})};export{B as default}; diff --git a/assets/SignInToEditDialog-DB0NqMGz.js b/assets/SignInToEditDialog-B6qsLc_U.js similarity index 96% rename from assets/SignInToEditDialog-DB0NqMGz.js rename to assets/SignInToEditDialog-B6qsLc_U.js index 8652cb5004975efc4e88f14e0244c0a9f6ad82b3..9ae6fadeae9f973b7cde59d6b4a1eb2ff045618a 100644 --- a/assets/SignInToEditDialog-DB0NqMGz.js +++ b/assets/SignInToEditDialog-B6qsLc_U.js @@ -1,4 +1,4 @@ -import{c as X,r as i,j as e,a8 as W,v as q,a9 as Q,g as Z,w as ee,X as te,C as se,aa as ae}from"./index-BfD7YdLr.js";import{B as D}from"./button-CXFuJJQh.js";import{I as h,T as re}from"./textarea-DRF500G_.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-CDRq9Z7X.js";import{u as oe}from"./useMutation-BQa0xQql.js";import{L as ie}from"./loader-circle-BQq8L_PA.js";/** +import{c as X,r as i,j as e,a8 as W,v as q,a9 as Q,g as Z,w as ee,X as te,C as se,aa as ae}from"./index-Bn8Ob2yb.js";import{B as D}from"./button-B1AjFwXv.js";import{I as h,T as re}from"./textarea-BIjKbX5f.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-BBaz5Wr4.js";import{u as oe}from"./useMutation-CkFxqrff.js";import{L as ie}from"./loader-circle-CT-SvG9q.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmissionsDashboard-DXt7HV10.js b/assets/SubmissionsDashboard-B38pktVP.js similarity index 98% rename from assets/SubmissionsDashboard-DXt7HV10.js rename to assets/SubmissionsDashboard-B38pktVP.js index 1702f6f5425f32d830964161f7df7c7d4269cde6..ffb24b2c8c2f8ed284e12c0590062c360d300247 100644 --- a/assets/SubmissionsDashboard-DXt7HV10.js +++ b/assets/SubmissionsDashboard-B38pktVP.js @@ -1,4 +1,4 @@ -var fe=s=>{throw TypeError(s)};var X=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(X(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(X(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(X(s,t,"access private method"),i);import{au as Ae,av as ee,aw as Oe,ax as Me,h as ke,r as $,ay as Fe,c as Qe,j as e,az as Se,aA as qe,R as N,v as q,aB as Ie,a2 as Ue,f as De,g as we,ap as Le,aC as $e,aD as Te,aE as Be,aF as ze,aG as He,aH as se}from"./index-BfD7YdLr.js";import{Q as Ee,u as Ke,a as Pe,e as Je,b as We,c as Ge,s as pe,f as Ve,g as Ye}from"./useBaseQuery-zm-nsmQ1.js";import{u as ge}from"./useQuery-BQY3DH-b.js";import{u as be}from"./useMutation-BQa0xQql.js";import{R as Xe,S as Ze,C as es,a as ss}from"./shield-alert-BRNRcGFf.js";import{L as B}from"./loader-circle-BQq8L_PA.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var D,S,L,U,w,Q,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,D);E(this,S);E(this,L);E(this,U);E(this,w);E(this,Q);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,D,t),_(this,U,n),_(this,L,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,L,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,L));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,L=new WeakMap,U=new WeakMap,w=new WeakMap,Q=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,Q)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,Q,Me(p(this,Q),i(t)))),p(this,Q)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,D).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,D),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,Q),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function V({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ge(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):Fe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ve(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ye({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/** +var fe=s=>{throw TypeError(s)};var X=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(X(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(X(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(X(s,t,"access private method"),i);import{au as Ae,av as ee,aw as Oe,ax as Me,h as ke,r as $,ay as Fe,c as Qe,j as e,az as Se,aA as qe,R as N,v as q,aB as Ie,a2 as Ue,f as De,g as we,ap as Le,aC as $e,aD as Te,aE as Be,aF as ze,aG as He,aH as se}from"./index-Bn8Ob2yb.js";import{Q as Ee,u as Ke,a as Pe,e as Je,b as We,c as Ge,s as pe,f as Ve,g as Ye}from"./useBaseQuery-DOoW3hTR.js";import{u as ge}from"./useQuery-DdnDUe7s.js";import{u as be}from"./useMutation-CkFxqrff.js";import{R as Xe,S as Ze,C as es,a as ss}from"./shield-alert-vXFVjesh.js";import{L as B}from"./loader-circle-CT-SvG9q.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var D,S,L,U,w,Q,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,D);E(this,S);E(this,L);E(this,U);E(this,w);E(this,Q);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,D,t),_(this,U,n),_(this,L,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,L,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,L));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,L=new WeakMap,U=new WeakMap,w=new WeakMap,Q=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,Q)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,Q,Me(p(this,Q),i(t)))),p(this,Q)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,D).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,D),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,Q),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function V({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ge(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):Fe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ve(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ye({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmitView-CZsQVJqY.js b/assets/SubmitView-QOnyc1Iu.js similarity index 96% rename from assets/SubmitView-CZsQVJqY.js rename to assets/SubmitView-QOnyc1Iu.js index cd0bc920424cc89684ffead65f43475bfaf4c0ca..47545266e9253d2d8061e7fde21e85662deabcba 100644 --- a/assets/SubmitView-CZsQVJqY.js +++ b/assets/SubmitView-QOnyc1Iu.js @@ -1 +1 @@ -import{u as R,h as T,g as _,R as n,j as e,at as D}from"./index-BfD7YdLr.js";import{u as k}from"./useMutation-BQa0xQql.js";import{A as w,a as C}from"./alert-zXn954y8.js";import{B as j}from"./button-CXFuJJQh.js";import{I as h,T as z}from"./textarea-DRF500G_.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(g=>g.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,g]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,x]=n.useState(null),u=S(d),v=u==="external",c=k({mutationFn:t=>D(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{x(q(t))}}),P=t=>{if(t.preventDefault(),x(null),u==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:P,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:d,onChange:t=>s(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),v&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:l,onChange:t=>p(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(z,{id:"submit-abstract",value:o,onChange:t=>g(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:f,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default}; +import{u as R,h as T,g as _,R as n,j as e,at as D}from"./index-Bn8Ob2yb.js";import{u as k}from"./useMutation-CkFxqrff.js";import{A as w,a as C}from"./alert-ek_GWo6X.js";import{B as j}from"./button-B1AjFwXv.js";import{I as h,T as z}from"./textarea-BIjKbX5f.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(g=>g.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,g]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,x]=n.useState(null),u=S(d),v=u==="external",c=k({mutationFn:t=>D(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{x(q(t))}}),P=t=>{if(t.preventDefault(),x(null),u==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:P,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:d,onChange:t=>s(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),v&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:l,onChange:t=>p(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(z,{id:"submit-abstract",value:o,onChange:t=>g(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:f,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default}; diff --git a/assets/TagBrowseView-BvmWc5Bi.js b/assets/TagBrowseView-Cs6vCRf6.js similarity index 96% rename from assets/TagBrowseView-BvmWc5Bi.js rename to assets/TagBrowseView-Cs6vCRf6.js index 6564f1a411e31249d5f43daf22270058d9415e85..73c662db59b702747d6cafadd811c75cea664ce2 100644 --- a/assets/TagBrowseView-BvmWc5Bi.js +++ b/assets/TagBrowseView-Cs6vCRf6.js @@ -1,4 +1,4 @@ -import{c as je,r as h,o as Y,j as e,n as B,a5 as _e,q as ve,P as Xe,t as Ne,p as ke,a6 as es,R as _,a7 as ss,O as as,v as J,e as ts,u as ns,a as rs,Z as os,L as P,a2 as cs,b as ge}from"./index-BfD7YdLr.js";import{u as be}from"./useQuery-BQY3DH-b.js";import{P as is,M as ls}from"./components-LTCBEq5x.js";import{B as ds}from"./BenchmarkTrendSparkline-Dvz4QF2u.js";import{u as ps,P as ms}from"./useIntersectionObserver-mJEWgLMQ.js";import{M as W}from"./MarkdownText-BmKXBVRs.js";import{t as hs,d as V}from"./transform-DCLb4olr.js";import{b as us}from"./usePapers-DrFoptcF.js";import{S as U}from"./skeleton-DlrhV-qs.js";import{A as xs,a as gs}from"./alert-zXn954y8.js";import{C as bs}from"./chevron-down-BBJrk-Yf.js";import{G as fe}from"./github-B6jYY6fQ.js";import"./useBaseQuery-zm-nsmQ1.js";import"./LatexTitle-Dyu7ZW4B.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Dud2kyWl.js";import"./index-SnRTg719.js";import"./hover-card-Bp6412TC.js";import"./useInfiniteQuery-CVNt5m44.js";/** +import{c as je,r as h,o as Y,j as e,n as B,a5 as _e,q as ve,P as Xe,t as Ne,p as ke,a6 as es,R as _,a7 as ss,O as as,v as J,e as ts,u as ns,a as rs,Z as os,L as P,a2 as cs,b as ge}from"./index-Bn8Ob2yb.js";import{u as be}from"./useQuery-DdnDUe7s.js";import{P as is,M as ls}from"./components-CmiCpieH.js";import{B as ds}from"./BenchmarkTrendSparkline-D6qVvB70.js";import{u as ps,P as ms}from"./useIntersectionObserver-odYwsx6w.js";import{M as W}from"./MarkdownText-DQLTyzIE.js";import{t as hs,d as V}from"./transform-Z_GB05A-.js";import{b as us}from"./usePapers-CQQdWWPS.js";import{S as U}from"./skeleton-DMgHDmV1.js";import{A as xs,a as gs}from"./alert-ek_GWo6X.js";import{C as bs}from"./chevron-down-BfIRuwQd.js";import{G as fe}from"./github-Cxli8-iY.js";import"./useBaseQuery-DOoW3hTR.js";import"./LatexTitle-CCig7BhH.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-hLdU_QRR.js";import"./index-N_WymWS-.js";import"./hover-card-BMKmh3eo.js";import"./useInfiniteQuery-Be_M3qGu.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TagsIndexView-CdwyuGNP.js b/assets/TagsIndexView-D_No0JK1.js similarity index 82% rename from assets/TagsIndexView-CdwyuGNP.js rename to assets/TagsIndexView-D_No0JK1.js index 67ebf98323d4a546fda844cb072db2a81c0411f9..37abea184dfd6c3ba7a41b4650c76e601cb83257 100644 --- a/assets/TagsIndexView-CdwyuGNP.js +++ b/assets/TagsIndexView-D_No0JK1.js @@ -1 +1 @@ -import{r as d,j as s,L as p,b as h}from"./index-BfD7YdLr.js";import{u as g}from"./useQuery-BQY3DH-b.js";import{c as x,h as f,d as u}from"./transform-DCLb4olr.js";import{S as m}from"./skeleton-DlrhV-qs.js";import{A as j,a as y}from"./alert-zXn954y8.js";import{T as k}from"./TaxonomySuggestionTile-Cj81-tgl.js";import"./useBaseQuery-zm-nsmQ1.js";import"./SignInToEditDialog-DB0NqMGz.js";import"./button-CXFuJJQh.js";import"./textarea-DRF500G_.js";import"./dialog-CDRq9Z7X.js";import"./useMutation-BQa0xQql.js";import"./loader-circle-BQq8L_PA.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>h.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>e[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=d.useMemo(()=>o.reduce((e,t)=>e+t.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(j,{variant:"destructive",children:s.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,t)=>s.jsxs("div",{children:[s.jsx(m,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>s.jsx(m,{className:"h-24"},a))})]},t))}):o.map(e=>{const t=e.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return s.jsxs("section",{style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),s.jsx(k,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{E as default}; +import{r as d,j as s,L as p,b as h}from"./index-Bn8Ob2yb.js";import{u as g}from"./useQuery-DdnDUe7s.js";import{c as x,h as f,d as u}from"./transform-Z_GB05A-.js";import{S as m}from"./skeleton-DMgHDmV1.js";import{A as j,a as y}from"./alert-ek_GWo6X.js";import{T as k}from"./TaxonomySuggestionTile-C_FUiSMg.js";import"./useBaseQuery-DOoW3hTR.js";import"./SignInToEditDialog-B6qsLc_U.js";import"./button-B1AjFwXv.js";import"./textarea-BIjKbX5f.js";import"./dialog-BBaz5Wr4.js";import"./useMutation-CkFxqrff.js";import"./loader-circle-CT-SvG9q.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>h.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>e[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=d.useMemo(()=>o.reduce((e,t)=>e+t.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(j,{variant:"destructive",children:s.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,t)=>s.jsxs("div",{children:[s.jsx(m,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>s.jsx(m,{className:"h-24"},a))})]},t))}):o.map(e=>{const t=e.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return s.jsxs("section",{style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),s.jsx(k,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{E as default}; diff --git a/assets/TaxonomySuggestionTile-Cj81-tgl.js b/assets/TaxonomySuggestionTile-C_FUiSMg.js similarity index 83% rename from assets/TaxonomySuggestionTile-Cj81-tgl.js rename to assets/TaxonomySuggestionTile-C_FUiSMg.js index dbdd7035e8e21ea18276d4ffe2d75f5dcb4e0fd7..972bc87c40c6b4bee18979fe91acea08f677b24c 100644 --- a/assets/TaxonomySuggestionTile-Cj81-tgl.js +++ b/assets/TaxonomySuggestionTile-C_FUiSMg.js @@ -1 +1 @@ -import{f as u,r as o,j as e}from"./index-BfD7YdLr.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-DB0NqMGz.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T}; +import{f as u,r as o,j as e}from"./index-Bn8Ob2yb.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-B6qsLc_U.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T}; diff --git a/assets/TrendsView-C2z7VhZS.js b/assets/TrendsView-jMSY3gur.js similarity index 96% rename from assets/TrendsView-C2z7VhZS.js rename to assets/TrendsView-jMSY3gur.js index 46b7ddfc4918cad80d71ea1d65cfeae887ee476b..839562e8de177e913cb5012ad2a2540f19ae4960 100644 --- a/assets/TrendsView-C2z7VhZS.js +++ b/assets/TrendsView-jMSY3gur.js @@ -1 +1 @@ -import{b as X,R as G,j as e}from"./index-BfD7YdLr.js";import{u as J}from"./useQuery-BQY3DH-b.js";import{A as q,a as E}from"./alert-zXn954y8.js";import{S as P}from"./skeleton-DlrhV-qs.js";import"./useBaseQuery-zm-nsmQ1.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ne=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ne as default}; +import{b as X,R as G,j as e}from"./index-Bn8Ob2yb.js";import{u as J}from"./useQuery-DdnDUe7s.js";import{A as q,a as E}from"./alert-ek_GWo6X.js";import{S as P}from"./skeleton-DMgHDmV1.js";import"./useBaseQuery-DOoW3hTR.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ne=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ne as default}; diff --git a/assets/alert-zXn954y8.js b/assets/alert-ek_GWo6X.js similarity index 92% rename from assets/alert-zXn954y8.js rename to assets/alert-ek_GWo6X.js index b1b8a9aeb9b70f4f8dbc859c4dee98ae07609f34..bf596cc58229cc851117106ddafeb2910577b947 100644 --- a/assets/alert-zXn954y8.js +++ b/assets/alert-ek_GWo6X.js @@ -1 +1 @@ -import{r as a,j as s,v as l,a9 as i}from"./index-BfD7YdLr.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}; +import{r as a,j as s,v as l,a9 as i}from"./index-Bn8Ob2yb.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}; diff --git a/assets/button-CXFuJJQh.js b/assets/button-B1AjFwXv.js similarity index 89% rename from assets/button-CXFuJJQh.js rename to assets/button-B1AjFwXv.js index e0020cb7459a745b1393d081f76862844e20fd8f..1f96c5ec88eebbb41f673a28c31a1e688acbe363 100644 --- a/assets/button-CXFuJJQh.js +++ b/assets/button-B1AjFwXv.js @@ -1 +1 @@ -import{r as a,j as d,aN as u,v as c,a9 as f}from"./index-BfD7YdLr.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; +import{r as a,j as d,aN as u,v as c,a9 as f}from"./index-Bn8Ob2yb.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; diff --git a/assets/chatSessions-Dl4MrfBi.js b/assets/chatSessions-CJGL67ci.js similarity index 99% rename from assets/chatSessions-Dl4MrfBi.js rename to assets/chatSessions-CJGL67ci.js index 9c348a766956cf9387c797127b620e80816fc623..dbc7adab0da58df1968b05f5cd1f49642fbb542f 100644 --- a/assets/chatSessions-Dl4MrfBi.js +++ b/assets/chatSessions-CJGL67ci.js @@ -1 +1 @@ -import{j as o,d as f}from"./index-BfD7YdLr.js";const _=({light:t})=>o.jsx("span",{className:`chat-spinner${t?" chat-spinner-light":""}`}),w=({open:t})=>o.jsx("svg",{className:`chat-chev${t?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"m6 9 6 6 6-6"})}),x=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]}),S=({size:t=14})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),b=()=>o.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:o.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),k=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M12 5v14M5 12h14"})}),C=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),o.jsx("path",{d:"M9 4v16"})]}),j=()=>o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),T=({models:t,selectedModel:r,onModelChange:e,disabled:s})=>{var c;const n=((c=t.find(a=>a.id===r))==null?void 0:c.label)??`${r} (unavailable)`,i=Math.min(Math.max(n.length+5,12),32);return o.jsxs("select",{className:"chat-model-select",style:{width:`${i}ch`},value:r,disabled:s,onChange:a=>e(a.target.value),"aria-label":"Research model",children:[!t.some(a=>a.id===r)&&o.jsx("option",{value:r,disabled:!0,children:n}),t.map(a=>o.jsx("option",{value:a.id,children:a.label},a.id))]})},p="pwc:chat-oauth-draft",l="pwc:chat-oauth-model",h="pwc:chat-oauth-auto-send";function I(t,r,e={}){const s=t.trim();s&&(sessionStorage.setItem(p,s),e.autoSend===!1?sessionStorage.removeItem(h):sessionStorage.setItem(h,"1"),r?sessionStorage.setItem(l,r):sessionStorage.removeItem(l))}function R(){var r;if(typeof window>"u"||sessionStorage.getItem(h)!=="1")return null;const t=(r=sessionStorage.getItem(p))==null?void 0:r.trim();return t?{prompt:t,model:sessionStorage.getItem(l)}:null}function O(){sessionStorage.removeItem(p),sessionStorage.removeItem(l),sessionStorage.removeItem(h)}const v="google/gemma-4-31B-it",M=[{id:v,label:"Gemma 4 31B",provider:"huggingface"},{id:"zai-org/GLM-5.2",label:"GLM 5.2",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"},{id:"deepseek-ai/DeepSeek-V4-Flash-0731",label:"DeepSeek V4 Flash 0731",provider:"openrouter"}];async function u(t,r){const e=await fetch(f(t),{credentials:"include",headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(!e.ok){const s=await e.json().catch(()=>null),n=s==null?void 0:s.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${e.status})`)}return e.status===204?void 0:e.json()}class g extends Error{constructor(r,e){super(r),this.status=e}}async function m(t){const r=await fetch(f(t),{headers:{Accept:"application/json"}});if(!r.ok){const e=await r.json().catch(()=>null),s=e==null?void 0:e.detail;throw new g((s==null?void 0:s.message)||s||`Shared conversation request failed (${r.status})`,r.status)}return r.json()}async function A(){const t=[];let r=null;do{const e=new URLSearchParams({limit:"50"});r&&e.set("cursor",r);const s=await u(`/api/v1/chat/sessions?${e.toString()}`);t.push(...s.items),r=s.next_cursor}while(r&&t.length<100);return t}function D(t){return u("/api/v1/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:t||null})})}function P(t){return u(`/api/v1/chat/sessions/${t}`)}function E(t,r){return u(`/api/v1/chat/sessions/${t}`,{method:"PATCH",body:JSON.stringify(r)})}function $(t){return u(`/api/v1/chat/sessions/${t}`,{method:"DELETE"})}function L(){return u("/api/v1/chat/sessions/archive-old",{method:"POST"})}function q(t){return u(`/api/v1/chat/sessions/${t}/cancel`,{method:"POST"})}function B(t){return u(`/api/v1/chat/sessions/${t}/share`,{method:"POST"})}function Y(t){return m(`/api/v1/chat/shares/${encodeURIComponent(t)}`)}async function H(){return u("/api/v1/chat/models")}function d(t,r){const e=t.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:r&&(s.status==="error"||s.status==="denied"||s.status==="running")}:{...s,done:!0});return e.filter((s,n)=>{const i=e[n-1];return!(s.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&s.text===i.text)})}function F(t){const r=e=>e==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":e==="hf_inference_credential_expired"?"Your Hugging Face authorization expired. Reconnect in Settings.":e==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":e==="provider_timeout"?"The model provider timed out. Try again shortly.":e==="openrouter_monthly_budget_exhausted"?"You have used this month's Papers With Code OpenRouter allowance. Review the reset time or enable your own key in Settings.":e==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":e==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":e==="openrouter_byok_billing_error"?"OpenRouter could not bill your API key. Review your OpenRouter credits and spending limits.":e==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":["provider_error","provider_unavailable"].includes(e??"")?"The model provider failed before completing the response. You can edit and retry your question.":e==="persistence_error"?"The response could not be saved. You can edit and retry your question.":e==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return t.messages.flatMap(e=>{if(e.role==="assistant")return[{id:e.id,role:"assistant",blocks:d(e.display_blocks,!0),followups:e.followups,citations:e.citations,finishReason:e.finish_reason??void 0,streaming:!1}];const s={id:e.id,role:"user",text:e.content,revision:e.revision,status:e.status,error:e.status==="complete"?void 0:e.error_code||e.status};if(!["error","interrupted"].includes(e.status))return[s];const n=e.status==="interrupted";return[s,{id:`${e.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:d(e.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:r(e.error_code),errorCode:n?void 0:e.error_code??void 0}]})}function K(t){return t.messages.map(r=>r.role==="user"?{id:r.id,role:"user",text:r.content}:{id:r.id,role:"assistant",blocks:d(r.display_blocks,!1),citations:r.citations,finishReason:r.finish_reason??void 0,error:r.error??void 0,streaming:!1})}function U(t){const r=Date.now(),e=new Date().setHours(0,0,0,0),s=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...t].sort((i,c)=>Date.parse(c.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(n.updated_at),c=r-i;i>=e?s[0].items.push(n):c<7*864e5?s[1].items.push(n):c<30*864e5?s[2].items.push(n):s[3].items.push(n)}return s.filter(n=>n.items.length>0)}export{b as A,p as C,v as D,M as F,T as M,k as P,_ as S,j as T,q as a,l as b,D as c,h as d,O as e,H as f,P as g,C as h,U as i,$ as j,B as k,A as l,L as m,g as n,Y as o,K as p,I as q,R as r,x as s,F as t,E as u,w as v,S as w}; +import{j as o,d as f}from"./index-Bn8Ob2yb.js";const _=({light:t})=>o.jsx("span",{className:`chat-spinner${t?" chat-spinner-light":""}`}),w=({open:t})=>o.jsx("svg",{className:`chat-chev${t?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"m6 9 6 6 6-6"})}),x=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]}),S=({size:t=14})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),b=()=>o.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:o.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),k=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M12 5v14M5 12h14"})}),C=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),o.jsx("path",{d:"M9 4v16"})]}),j=()=>o.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),T=({models:t,selectedModel:r,onModelChange:e,disabled:s})=>{var c;const n=((c=t.find(a=>a.id===r))==null?void 0:c.label)??`${r} (unavailable)`,i=Math.min(Math.max(n.length+5,12),32);return o.jsxs("select",{className:"chat-model-select",style:{width:`${i}ch`},value:r,disabled:s,onChange:a=>e(a.target.value),"aria-label":"Research model",children:[!t.some(a=>a.id===r)&&o.jsx("option",{value:r,disabled:!0,children:n}),t.map(a=>o.jsx("option",{value:a.id,children:a.label},a.id))]})},p="pwc:chat-oauth-draft",l="pwc:chat-oauth-model",h="pwc:chat-oauth-auto-send";function I(t,r,e={}){const s=t.trim();s&&(sessionStorage.setItem(p,s),e.autoSend===!1?sessionStorage.removeItem(h):sessionStorage.setItem(h,"1"),r?sessionStorage.setItem(l,r):sessionStorage.removeItem(l))}function R(){var r;if(typeof window>"u"||sessionStorage.getItem(h)!=="1")return null;const t=(r=sessionStorage.getItem(p))==null?void 0:r.trim();return t?{prompt:t,model:sessionStorage.getItem(l)}:null}function O(){sessionStorage.removeItem(p),sessionStorage.removeItem(l),sessionStorage.removeItem(h)}const v="google/gemma-4-31B-it",M=[{id:v,label:"Gemma 4 31B",provider:"huggingface"},{id:"zai-org/GLM-5.2",label:"GLM 5.2",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"},{id:"deepseek-ai/DeepSeek-V4-Flash-0731",label:"DeepSeek V4 Flash 0731",provider:"openrouter"}];async function u(t,r){const e=await fetch(f(t),{credentials:"include",headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(!e.ok){const s=await e.json().catch(()=>null),n=s==null?void 0:s.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${e.status})`)}return e.status===204?void 0:e.json()}class g extends Error{constructor(r,e){super(r),this.status=e}}async function m(t){const r=await fetch(f(t),{headers:{Accept:"application/json"}});if(!r.ok){const e=await r.json().catch(()=>null),s=e==null?void 0:e.detail;throw new g((s==null?void 0:s.message)||s||`Shared conversation request failed (${r.status})`,r.status)}return r.json()}async function A(){const t=[];let r=null;do{const e=new URLSearchParams({limit:"50"});r&&e.set("cursor",r);const s=await u(`/api/v1/chat/sessions?${e.toString()}`);t.push(...s.items),r=s.next_cursor}while(r&&t.length<100);return t}function D(t){return u("/api/v1/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:t||null})})}function P(t){return u(`/api/v1/chat/sessions/${t}`)}function E(t,r){return u(`/api/v1/chat/sessions/${t}`,{method:"PATCH",body:JSON.stringify(r)})}function $(t){return u(`/api/v1/chat/sessions/${t}`,{method:"DELETE"})}function L(){return u("/api/v1/chat/sessions/archive-old",{method:"POST"})}function q(t){return u(`/api/v1/chat/sessions/${t}/cancel`,{method:"POST"})}function B(t){return u(`/api/v1/chat/sessions/${t}/share`,{method:"POST"})}function Y(t){return m(`/api/v1/chat/shares/${encodeURIComponent(t)}`)}async function H(){return u("/api/v1/chat/models")}function d(t,r){const e=t.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:r&&(s.status==="error"||s.status==="denied"||s.status==="running")}:{...s,done:!0});return e.filter((s,n)=>{const i=e[n-1];return!(s.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&s.text===i.text)})}function F(t){const r=e=>e==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":e==="hf_inference_credential_expired"?"Your Hugging Face authorization expired. Reconnect in Settings.":e==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":e==="provider_timeout"?"The model provider timed out. Try again shortly.":e==="openrouter_monthly_budget_exhausted"?"You have used this month's Papers With Code OpenRouter allowance. Review the reset time or enable your own key in Settings.":e==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":e==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":e==="openrouter_byok_billing_error"?"OpenRouter could not bill your API key. Review your OpenRouter credits and spending limits.":e==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":["provider_error","provider_unavailable"].includes(e??"")?"The model provider failed before completing the response. You can edit and retry your question.":e==="persistence_error"?"The response could not be saved. You can edit and retry your question.":e==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return t.messages.flatMap(e=>{if(e.role==="assistant")return[{id:e.id,role:"assistant",blocks:d(e.display_blocks,!0),followups:e.followups,citations:e.citations,finishReason:e.finish_reason??void 0,streaming:!1}];const s={id:e.id,role:"user",text:e.content,revision:e.revision,status:e.status,error:e.status==="complete"?void 0:e.error_code||e.status};if(!["error","interrupted"].includes(e.status))return[s];const n=e.status==="interrupted";return[s,{id:`${e.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:d(e.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:r(e.error_code),errorCode:n?void 0:e.error_code??void 0}]})}function K(t){return t.messages.map(r=>r.role==="user"?{id:r.id,role:"user",text:r.content}:{id:r.id,role:"assistant",blocks:d(r.display_blocks,!1),citations:r.citations,finishReason:r.finish_reason??void 0,error:r.error??void 0,streaming:!1})}function U(t){const r=Date.now(),e=new Date().setHours(0,0,0,0),s=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...t].sort((i,c)=>Date.parse(c.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(n.updated_at),c=r-i;i>=e?s[0].items.push(n):c<7*864e5?s[1].items.push(n):c<30*864e5?s[2].items.push(n):s[3].items.push(n)}return s.filter(n=>n.items.length>0)}export{b as A,p as C,v as D,M as F,T as M,k as P,_ as S,j as T,q as a,l as b,D as c,h as d,O as e,H as f,P as g,C as h,U as i,$ as j,B as k,A as l,L as m,g as n,Y as o,K as p,I as q,R as r,x as s,F as t,E as u,w as v,S as w}; diff --git a/assets/chevron-down-BBJrk-Yf.js b/assets/chevron-down-BfIRuwQd.js similarity index 85% rename from assets/chevron-down-BBJrk-Yf.js rename to assets/chevron-down-BfIRuwQd.js index 86ab887612de46d4fbe041d29e1387e4ba1036a0..cf4aa6ad477978bd2dea036985ee9dd322fbeb2e 100644 --- a/assets/chevron-down-BBJrk-Yf.js +++ b/assets/chevron-down-BfIRuwQd.js @@ -1,4 +1,4 @@ -import{c as o}from"./index-BfD7YdLr.js";/** +import{c as o}from"./index-Bn8Ob2yb.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codexAddEvals-BFPddk7M.js b/assets/codexAddEvals-C5IxXnlq.js similarity index 97% rename from assets/codexAddEvals-BFPddk7M.js rename to assets/codexAddEvals-C5IxXnlq.js index 247a774d08d1e9b5279c416cc8a56092e03ae478..8e0b5b7fc660b549d0158c6718292b22960bc789 100644 --- a/assets/codexAddEvals-BFPddk7M.js +++ b/assets/codexAddEvals-C5IxXnlq.js @@ -1,4 +1,4 @@ -import{c as o,j as i,v as c,a9 as d,d as n}from"./index-BfD7YdLr.js";/** +import{c as o,j as i,v as c,a9 as d,d as n}from"./index-Bn8Ob2yb.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/components-LTCBEq5x.js b/assets/components-CmiCpieH.js similarity index 98% rename from assets/components-LTCBEq5x.js rename to assets/components-CmiCpieH.js index 72e6b1a10b5414324bbf619987fb812a1a23f2dc..04be46ea5ff70f8a11091403e39892cdb1bf280e 100644 --- a/assets/components-LTCBEq5x.js +++ b/assets/components-CmiCpieH.js @@ -1 +1 @@ -import{h as R,R as g,b as T,j as e,L,u as w}from"./index-BfD7YdLr.js";import{L as E,a as z}from"./LatexTitle-Dyu7ZW4B.js";import{h as P,d as Z,a as B,c as H}from"./transform-DCLb4olr.js";const D=({slug:t,label:s,onClick:r})=>{const l=w(),x=P(t),o=H(x),h=i=>{if(i.stopPropagation(),r){r(t);return}l(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),Z(s||B(t),t)]})},G=({method:t,onClick:s})=>{const r=w(),l=t.slug||t.id||"";if(!l)return null;const x=o=>{if(o.stopPropagation(),s){s(l);return}r(`/methods/${l}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},N={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=g.useRef(null),l=g.useRef(null),[x,o]=g.useState(t.length);if(g.useLayoutEffect(()=>{const n=r.current,a=l.current;if(!n||!a||t.length===0)return;const m=f=>(a.textContent=f,a.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let c=0,d=0;for(const C of t){const p=m(C.measureText);if(c+p<=f)c+=p,d+=1;else break}if(d0&&c+m(` · +${t.length-d} more`)>f;)d-=1,c-=m(t[d].measureText);d===0&&(d=1)}o(d)};M();const u=new ResizeObserver(M);return u.observe(n),()=>u.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:l,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,a)=>e.jsxs(g.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[a>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:N[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${a}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const l=g.useMemo(()=>{const o=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(a=>a.rank===i);n.forEach((a,m)=>{const M=m===0,u=M?`${h?"":" · "}${N[i]} on `:", ";o.push({name:a.name,slug:a.slug,rank:i,isGroupStart:M,measureText:u+a.name})}),n.length>0&&(h=!1)}return o},[t]),x=g.useMemo(()=>[1,2,3].map(o=>t.filter(i=>i.rank===o).map((i,n)=>({name:i.name,slug:i.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${N[o]} on `:", ")+i.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):l.length===0?null:e.jsx(F,{units:l,paperHref:s})},O=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},U=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),K=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},_=({paperId:t})=>{const s=K(t),r=160,l=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let k=0;k.3,a=Math.floor(s()*3),m=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:c+(r-c*2)*(1-k)/2,y:S+v*2.4,width:(r-c*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-o)/2,y:W,width:(r-c*2)*o,height:.9,fill:u,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:A,width:6,height:1,fill:f,opacity:.6}),h.map((k,v)=>{const y=j+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:C,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:j,width:d,height:14,fill:"#F0EBE0",stroke:u,strokeWidth:.3,opacity:.9}),a===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${j+11} ${p+6},${j+8} ${p+10},${j+9} ${p+14},${j+5} ${p+18},${j+6} ${p+22},${j+3}`})}),a===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:p+2,y:j+11,width:d-4,height:1.5,fill:u})]}),a===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:j+5,width:d-6,height:1,fill:f}),e.jsx("rect",{x:p+6,y:j+8,width:d-12,height:.8,fill:f})]})]}),m.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:p,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`r${v}`)})]})})},V=({paperId:t,title:s,thumbnailUrl:r,priority:l=!1})=>{const[x,o]=g.useState(!1),[h,i]=g.useState(0),[n,a]=g.useState(l),m=g.useRef(null);g.useEffect(()=>{o(!1),i(0)},[r]);const M=g.useMemo(()=>{if(!r)return null;if(h===0)return r;const u=r.includes("?")?"&":"?";return`${r}${u}retry=${h}`},[r,h]);return g.useEffect(()=>{if(l||n)return;const u=m.current;if(!u)return;const f=new IntersectionObserver(([c])=>{c.isIntersecting&&(a(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(u),()=>f.disconnect()},[l,n]),r&&!x?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(l||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:l?"eager":"lazy",decoding:"async",fetchPriority:l?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(u=>u+1);return}o(!0)}},M)}):e.jsx(_,{paperId:t})},q="language-modeling";function $(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Y(t){return $(t.slug)==="large language model"||$(t.name)==="large language model"}function Q(t){return t.tags.includes(q)?t.methods.filter(s=>!Y(s)):t.methods}const se=({paper:t,rank:s,onClickTag:r})=>{const l=R(),x=`/paper/${t.id}`,o=g.useCallback(()=>{l.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>T.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,l]),h=t.authors.slice(0,3).join(", "),i=t.authors.length,n=Q(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:x,className:"paper-thumb-wrap",onFocus:o,onMouseEnter:o,children:e.jsx(V,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[e.jsx("h3",{className:"paper-title",children:e.jsx(L,{to:x,onFocus:o,onMouseEnter:o,children:e.jsx(E,{title:t.title})})}),e.jsxs("div",{className:"paper-authors",children:[h,i>3&&e.jsxs("span",{children:[", ","+",i-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[i>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[i>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(z,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:x}),(t.tags.length>0||n.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(a=>e.jsx(D,{slug:a,onClick:r},a)),n.map(a=>e.jsx(G,{method:a},a.id||a.slug||a.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[t.githubUrl&&e.jsxs("a",{className:"paper-resource is-link",href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:a=>a.stopPropagation(),children:[e.jsx(O,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),J(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),t.hfUrl&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:t.hfUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:a=>a.stopPropagation(),children:[e.jsx(U,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function J(t){return t.toFixed(1)}export{O as I,G as M,se as P,I as S,D as T,V as a}; +import{h as R,R as g,b as T,j as e,L,u as w}from"./index-Bn8Ob2yb.js";import{L as E,a as z}from"./LatexTitle-CCig7BhH.js";import{h as P,d as Z,a as B,c as H}from"./transform-Z_GB05A-.js";const D=({slug:t,label:s,onClick:r})=>{const l=w(),x=P(t),o=H(x),h=i=>{if(i.stopPropagation(),r){r(t);return}l(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),Z(s||B(t),t)]})},G=({method:t,onClick:s})=>{const r=w(),l=t.slug||t.id||"";if(!l)return null;const x=o=>{if(o.stopPropagation(),s){s(l);return}r(`/methods/${l}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},N={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=g.useRef(null),l=g.useRef(null),[x,o]=g.useState(t.length);if(g.useLayoutEffect(()=>{const n=r.current,a=l.current;if(!n||!a||t.length===0)return;const m=f=>(a.textContent=f,a.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let c=0,d=0;for(const C of t){const p=m(C.measureText);if(c+p<=f)c+=p,d+=1;else break}if(d0&&c+m(` · +${t.length-d} more`)>f;)d-=1,c-=m(t[d].measureText);d===0&&(d=1)}o(d)};M();const u=new ResizeObserver(M);return u.observe(n),()=>u.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:l,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,a)=>e.jsxs(g.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[a>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:N[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${a}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const l=g.useMemo(()=>{const o=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(a=>a.rank===i);n.forEach((a,m)=>{const M=m===0,u=M?`${h?"":" · "}${N[i]} on `:", ";o.push({name:a.name,slug:a.slug,rank:i,isGroupStart:M,measureText:u+a.name})}),n.length>0&&(h=!1)}return o},[t]),x=g.useMemo(()=>[1,2,3].map(o=>t.filter(i=>i.rank===o).map((i,n)=>({name:i.name,slug:i.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${N[o]} on `:", ")+i.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):l.length===0?null:e.jsx(F,{units:l,paperHref:s})},O=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},U=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),K=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},_=({paperId:t})=>{const s=K(t),r=160,l=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let k=0;k.3,a=Math.floor(s()*3),m=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:c+(r-c*2)*(1-k)/2,y:S+v*2.4,width:(r-c*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-o)/2,y:W,width:(r-c*2)*o,height:.9,fill:u,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:A,width:6,height:1,fill:f,opacity:.6}),h.map((k,v)=>{const y=j+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:C,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:j,width:d,height:14,fill:"#F0EBE0",stroke:u,strokeWidth:.3,opacity:.9}),a===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${j+11} ${p+6},${j+8} ${p+10},${j+9} ${p+14},${j+5} ${p+18},${j+6} ${p+22},${j+3}`})}),a===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:p+2,y:j+11,width:d-4,height:1.5,fill:u})]}),a===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:j+5,width:d-6,height:1,fill:f}),e.jsx("rect",{x:p+6,y:j+8,width:d-12,height:.8,fill:f})]})]}),m.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:p,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`r${v}`)})]})})},V=({paperId:t,title:s,thumbnailUrl:r,priority:l=!1})=>{const[x,o]=g.useState(!1),[h,i]=g.useState(0),[n,a]=g.useState(l),m=g.useRef(null);g.useEffect(()=>{o(!1),i(0)},[r]);const M=g.useMemo(()=>{if(!r)return null;if(h===0)return r;const u=r.includes("?")?"&":"?";return`${r}${u}retry=${h}`},[r,h]);return g.useEffect(()=>{if(l||n)return;const u=m.current;if(!u)return;const f=new IntersectionObserver(([c])=>{c.isIntersecting&&(a(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(u),()=>f.disconnect()},[l,n]),r&&!x?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(l||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:l?"eager":"lazy",decoding:"async",fetchPriority:l?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(u=>u+1);return}o(!0)}},M)}):e.jsx(_,{paperId:t})},q="language-modeling";function $(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Y(t){return $(t.slug)==="large language model"||$(t.name)==="large language model"}function Q(t){return t.tags.includes(q)?t.methods.filter(s=>!Y(s)):t.methods}const se=({paper:t,rank:s,onClickTag:r})=>{const l=R(),x=`/paper/${t.id}`,o=g.useCallback(()=>{l.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>T.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,l]),h=t.authors.slice(0,3).join(", "),i=t.authors.length,n=Q(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:x,className:"paper-thumb-wrap",onFocus:o,onMouseEnter:o,children:e.jsx(V,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[e.jsx("h3",{className:"paper-title",children:e.jsx(L,{to:x,onFocus:o,onMouseEnter:o,children:e.jsx(E,{title:t.title})})}),e.jsxs("div",{className:"paper-authors",children:[h,i>3&&e.jsxs("span",{children:[", ","+",i-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[i>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[i>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(z,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:x}),(t.tags.length>0||n.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(a=>e.jsx(D,{slug:a,onClick:r},a)),n.map(a=>e.jsx(G,{method:a},a.id||a.slug||a.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[t.githubUrl&&e.jsxs("a",{className:"paper-resource is-link",href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:a=>a.stopPropagation(),children:[e.jsx(O,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),J(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),t.hfUrl&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:t.hfUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:a=>a.stopPropagation(),children:[e.jsx(U,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function J(t){return t.toFixed(1)}export{O as I,G as M,se as P,I as S,D as T,V as a}; diff --git a/assets/dialog-CDRq9Z7X.js b/assets/dialog-BBaz5Wr4.js similarity index 99% rename from assets/dialog-CDRq9Z7X.js rename to assets/dialog-BBaz5Wr4.js index f9720e2f2fc7cd46c68785ab66be4942407d025b..8131f77969aa9f4233ad9891c1150eddb37f88ed 100644 --- a/assets/dialog-CDRq9Z7X.js +++ b/assets/dialog-BBaz5Wr4.js @@ -1,4 +1,4 @@ -import{r as s,j as i,ab as Z,o as K,a5 as R,P as h,af as U,n as D,q as x,t as X,p as N,ag as Y,ah as J,ai as Q,aj as ee,ak as te,an as oe,X as ne,v as p}from"./index-BfD7YdLr.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?Z(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=X(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=K({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};P.displayName=C;var O="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(O,o),r=N(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=O;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),w=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:n}=e,r=f(E,t);return i.jsx(fe,{scope:t,forceMount:o,children:s.Children.map(a,l=>i.jsx(h,{present:o||r.open,children:i.jsx(U,{asChild:!0,container:n,children:l})}))})};w.displayName=E;var y="DialogOverlay",A=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(h,{present:a||r.open,children:i.jsx(pe,{...n,ref:t})}):null});A.displayName=y;var ge=ae("DialogOverlay.RemoveScroll"),pe=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(y,o);return i.jsx(J,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(h,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=N(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return Y(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=N(t,d);return Q(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",F=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});F.displayName=_;var M="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(M,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=M;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. +import{r as s,j as i,ab as Z,o as K,a5 as R,P as h,af as U,n as D,q as x,t as X,p as N,ag as Y,ah as J,ai as Q,aj as ee,ak as te,an as oe,X as ne,v as p}from"./index-Bn8Ob2yb.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?Z(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=X(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=K({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};P.displayName=C;var O="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(O,o),r=N(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=O;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),w=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:n}=e,r=f(E,t);return i.jsx(fe,{scope:t,forceMount:o,children:s.Children.map(a,l=>i.jsx(h,{present:o||r.open,children:i.jsx(U,{asChild:!0,container:n,children:l})}))})};w.displayName=E;var y="DialogOverlay",A=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(h,{present:a||r.open,children:i.jsx(pe,{...n,ref:t})}):null});A.displayName=y;var ge=ae("DialogOverlay.RemoveScroll"),pe=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(y,o);return i.jsx(J,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(h,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=N(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return Y(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=N(t,d);return Q(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",F=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});F.displayName=_;var M="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(M,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=M;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. diff --git a/assets/external-link-lQRIh-Se.js b/assets/external-link-DEYzZhKb.js similarity index 89% rename from assets/external-link-lQRIh-Se.js rename to assets/external-link-DEYzZhKb.js index 25d266f5d681e722735045aab6768a9772abc6ad..f5a2262d5eb870fe9d377bbf04f948e195380747 100644 --- a/assets/external-link-lQRIh-Se.js +++ b/assets/external-link-DEYzZhKb.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-BfD7YdLr.js";/** +import{c as a}from"./index-Bn8Ob2yb.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-B6jYY6fQ.js b/assets/github-Cxli8-iY.js similarity index 93% rename from assets/github-B6jYY6fQ.js rename to assets/github-Cxli8-iY.js index 7e3ceb440f506824ddc49bc87039c698cbb5fc54..4c69b3b4b7941fc2502c31c47529643ac3d71334 100644 --- a/assets/github-B6jYY6fQ.js +++ b/assets/github-Cxli8-iY.js @@ -1,4 +1,4 @@ -import{c}from"./index-BfD7YdLr.js";/** +import{c}from"./index-Bn8Ob2yb.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-Bp6412TC.js b/assets/hover-card-BMKmh3eo.js similarity index 98% rename from assets/hover-card-Bp6412TC.js rename to assets/hover-card-BMKmh3eo.js index 43d1faebc06e364c341b99fc9bcdd14cfc369400..7376ae239076316fe37baf3da0064fab44a92251 100644 --- a/assets/hover-card-Bp6412TC.js +++ b/assets/hover-card-BMKmh3eo.js @@ -1 +1 @@ -import{r as n,o as M,j as c,ac as F,ad as I,n as U,q as l,ae as T,P as O,af as $,t as W,p as z,ak as B,al as G,am as K,v as q}from"./index-BfD7YdLr.js";var E,g="HoverCard",[y]=W(g,[T]),w=T(),[V,S]=y(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=M({prop:s,defaultProp:a??!1,onChange:i,caller:g}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),k=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:k,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=w(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(J,{scope:o,forceMount:r,children:c.jsx(O,{present:r||i.open,children:c.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=S(R,e.__scopeHoverCard);return c.jsx(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,b(i.onOpen)),onPointerLeave:l(e.onPointerLeave,b(i.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=S(R,r),C=w(r),u=n.useRef(null),h=z(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),c.jsx(B,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(i,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.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)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function b(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.jsx(L,{ref:a,align:o,sideOffset:r,className:q("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),...s})}));ne.displayName=L.displayName;export{se as H,ce as a,ne as b}; +import{r as n,o as M,j as c,ac as F,ad as I,n as U,q as l,ae as T,P as O,af as $,t as W,p as z,ak as B,al as G,am as K,v as q}from"./index-Bn8Ob2yb.js";var E,g="HoverCard",[y]=W(g,[T]),w=T(),[V,S]=y(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=M({prop:s,defaultProp:a??!1,onChange:i,caller:g}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),k=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:k,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=w(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(J,{scope:o,forceMount:r,children:c.jsx(O,{present:r||i.open,children:c.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=S(R,e.__scopeHoverCard);return c.jsx(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,b(i.onOpen)),onPointerLeave:l(e.onPointerLeave,b(i.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=S(R,r),C=w(r),u=n.useRef(null),h=z(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),c.jsx(B,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(i,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.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)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function b(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.jsx(L,{ref:a,align:o,sideOffset:r,className:q("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),...s})}));ne.displayName=L.displayName;export{se as H,ce as a,ne as b}; diff --git a/assets/index-BfD7YdLr.js b/assets/index-Bn8Ob2yb.js similarity index 98% rename from assets/index-BfD7YdLr.js rename to assets/index-Bn8Ob2yb.js index cfb485f296a6852925e0df3003b494ba4625d2cf..1f9923b2084c02490ffbde565abda64d111f2346 100644 --- a/assets/index-BfD7YdLr.js +++ b/assets/index-Bn8Ob2yb.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-DmnQ8wtZ.js","assets/components-LTCBEq5x.js","assets/LatexTitle-Dyu7ZW4B.js","assets/katex.min-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/transform-DCLb4olr.js","assets/useIntersectionObserver-mJEWgLMQ.js","assets/chatSessions-Dl4MrfBi.js","assets/chatPrompts-CDY3UGU1.js","assets/usePapers-DrFoptcF.js","assets/useQuery-BQY3DH-b.js","assets/useBaseQuery-zm-nsmQ1.js","assets/useInfiniteQuery-CVNt5m44.js","assets/usePeriodFilter-Coc3diQT.js","assets/skeleton-DlrhV-qs.js","assets/alert-zXn954y8.js","assets/ChatView-DdHEqFeP.js","assets/ChatMessage-8Xxu3vLN.js","assets/hover-card-Bp6412TC.js","assets/PaperPreviewLink-Dud2kyWl.js","assets/index-SnRTg719.js","assets/openrouter-ClIkjPp2.js","assets/SharedChatView-BcOQHbFQ.js","assets/PapersListView-Cz1rE6-Q.js","assets/useDebounce-Czrc054X.js","assets/PaperDetailView-KJONkjMT.js","assets/ExternalSourceEvalBadge-C0AdjeMr.js","assets/ExternalSourceEvalBadge-DXfuqNnO.css","assets/latexPlainText-DI8YEXVe.js","assets/button-CXFuJJQh.js","assets/index-qlYSmaoI.js","assets/textarea-DRF500G_.js","assets/dialog-CDRq9Z7X.js","assets/useMutation-BQa0xQql.js","assets/SignInToEditDialog-DB0NqMGz.js","assets/loader-circle-BQq8L_PA.js","assets/searchable-select-CriyPATu.js","assets/codexAddEvals-BFPddk7M.js","assets/github-B6jYY6fQ.js","assets/TagsIndexView-CdwyuGNP.js","assets/TaxonomySuggestionTile-Cj81-tgl.js","assets/TagBrowseView-BvmWc5Bi.js","assets/BenchmarkTrendSparkline-Dvz4QF2u.js","assets/MarkdownText-BmKXBVRs.js","assets/chevron-down-BBJrk-Yf.js","assets/MethodsIndexView-83TGyPzJ.js","assets/slug-BpH-Nkvz.js","assets/FrameworksIndexView-BcHuX_Fi.js","assets/TrendsView-C2z7VhZS.js","assets/ConferencesIndexView-gtHHJaQV.js","assets/AiDeadlinesView-DKoPzbW5.js","assets/switch-D_aiRxQJ.js","assets/ConferenceDetailView-BLvSVhvE.js","assets/ConferenceTaskView-BjcxA6LX.js","assets/OrganizationsIndexView-eR9gHXDo.js","assets/OrganizationsIndexView-dniuSNch.css","assets/OrganizationDetailView-CX0_k63U.js","assets/OrganizationPaperFeed-BO5S2des.js","assets/NotFound-bD49ZyM9.js","assets/OrganizationTaskView-KCn9ADD3.js","assets/AuthorDetailView-XYwc-69t.js","assets/MethodDetailView-BjNLNMvJ.js","assets/BenchmarkDetailView-HobUhRD6.js","assets/BenchmarkDetailView-DS2Mrskn.css","assets/SavedPapersView-DIgZ31F9.js","assets/SettingsView-DzELfroP.js","assets/external-link-lQRIh-Se.js","assets/SubmitView-CZsQVJqY.js","assets/CronDashboard-B5sdItZ8.js","assets/shield-alert-BRNRcGFf.js","assets/CronDashboard-DwChfW9h.css","assets/SubmissionsDashboard-DXt7HV10.js","assets/ContributionsPage-jUvwayNB.js","assets/SearchOverlay-CZcmEWhv.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-BQgIGsx_.js","assets/components-CmiCpieH.js","assets/LatexTitle-CCig7BhH.js","assets/katex.min-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/transform-Z_GB05A-.js","assets/useIntersectionObserver-odYwsx6w.js","assets/chatSessions-CJGL67ci.js","assets/chatPrompts-CDY3UGU1.js","assets/usePapers-CQQdWWPS.js","assets/useQuery-DdnDUe7s.js","assets/useBaseQuery-DOoW3hTR.js","assets/useInfiniteQuery-Be_M3qGu.js","assets/usePeriodFilter-DFtHY8n2.js","assets/skeleton-DMgHDmV1.js","assets/alert-ek_GWo6X.js","assets/ChatView-CtDdhli3.js","assets/ChatMessage-BNDm-FB_.js","assets/hover-card-BMKmh3eo.js","assets/PaperPreviewLink-hLdU_QRR.js","assets/index-N_WymWS-.js","assets/openrouter-Ho6iwenl.js","assets/SharedChatView-BiDdc9TO.js","assets/PapersListView-BmApqIB5.js","assets/useDebounce-Q8ScjHA0.js","assets/PaperDetailView-BBswAFhU.js","assets/ExternalSourceEvalBadge-C_nXOup9.js","assets/ExternalSourceEvalBadge-DXfuqNnO.css","assets/latexPlainText-DI8YEXVe.js","assets/button-B1AjFwXv.js","assets/index-Bty21uio.js","assets/textarea-BIjKbX5f.js","assets/dialog-BBaz5Wr4.js","assets/useMutation-CkFxqrff.js","assets/SignInToEditDialog-B6qsLc_U.js","assets/loader-circle-CT-SvG9q.js","assets/searchable-select-qrXUfGnF.js","assets/codexAddEvals-C5IxXnlq.js","assets/github-Cxli8-iY.js","assets/TagsIndexView-D_No0JK1.js","assets/TaxonomySuggestionTile-C_FUiSMg.js","assets/TagBrowseView-Cs6vCRf6.js","assets/BenchmarkTrendSparkline-D6qVvB70.js","assets/MarkdownText-DQLTyzIE.js","assets/chevron-down-BfIRuwQd.js","assets/MethodsIndexView-B08rRVGN.js","assets/slug-BpH-Nkvz.js","assets/FrameworksIndexView-BkdoKfPD.js","assets/TrendsView-jMSY3gur.js","assets/ConferencesIndexView-DiiMYBFz.js","assets/AiDeadlinesView-SO_B8s6V.js","assets/switch-CO-39qkR.js","assets/ConferenceDetailView-Bc8hL_Zk.js","assets/ConferenceTaskView-DAbsNhLC.js","assets/OrganizationsIndexView-DstHO0mQ.js","assets/OrganizationsIndexView-dniuSNch.css","assets/OrganizationDetailView-cWweA-IF.js","assets/OrganizationPaperFeed-Bzx-8eUf.js","assets/NotFound-DArrcZxf.js","assets/OrganizationTaskView-Bw4EgOqw.js","assets/AuthorDetailView-DYzk7KbK.js","assets/MethodDetailView-CHwxmkDT.js","assets/BenchmarkDetailView-aQvia8JD.js","assets/BenchmarkDetailView-DS2Mrskn.css","assets/SavedPapersView-Bt241wOv.js","assets/SettingsView-BT6c57TI.js","assets/external-link-DEYzZhKb.js","assets/SubmitView-QOnyc1Iu.js","assets/CronDashboard-CzCV7fD-.js","assets/shield-alert-vXFVjesh.js","assets/CronDashboard-DwChfW9h.css","assets/SubmissionsDashboard-B38pktVP.js","assets/ContributionsPage-DVMwAad-.js","assets/SearchOverlay-97sfjbbt.js"])))=>i.map(i=>d[i]); var E0=Object.defineProperty;var uf=e=>{throw TypeError(e)};var C0=(e,t,n)=>t in e?E0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var St=(e,t,n)=>C0(e,typeof t!="symbol"?t+"":t,n),vl=(e,t,n)=>t.has(e)||uf("Cannot "+n);var N=(e,t,n)=>(vl(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>t.has(e)?uf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(vl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Oe=(e,t,n)=>(vl(e,t,"access private method"),n);var ts=(e,t,n,r)=>({set _(o){W(e,t,o,n)},get _(){return N(e,t,r)}});function b0(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var KN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ap(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lp={exports:{}},Ra={},jp={exports:{}},Z={};/** * @license React * react.production.min.js @@ -154,4 +154,4 @@ Error generating stack: `+i.message+` * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hT=ll("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pT=oT,gT=iT,mT=f.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(_w,{ref:o,className:Ne("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,g.jsx(dT,{className:"ml-auto h-4 w-4"})]}));mT.displayName=_w.displayName;const vT=f.forwardRef(({className:e,...t},n)=>g.jsx(Pw,{ref:n,className:Ne("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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),...t}));vT.displayName=Pw.displayName;const Tw=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(sT,{children:g.jsx(yw,{ref:r,sideOffset:t,className:Ne("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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),...n})}));Tw.displayName=yw.displayName;const It=f.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(xw,{ref:r,className:Ne("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));It.displayName=xw.displayName;const yT=f.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(Sw,{ref:o,className:Ne("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Cw,{children:g.jsx(cT,{className:"h-4 w-4"})})}),t]}));yT.displayName=Sw.displayName;const wT=f.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(Ew,{ref:r,className:Ne("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Cw,{children:g.jsx(fT,{className:"h-2 w-2 fill-current"})})}),t]}));wT.displayName=Ew.displayName;const Rw=f.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(ww,{ref:r,className:Ne("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Rw.displayName=ww.displayName;const xc=f.forwardRef(({className:e,...t},n)=>g.jsx(bw,{ref:n,className:Ne("-mx-1 my-1 h-px bg-muted",e),...t}));xc.displayName=bw.displayName;function xT(e){const n=(e.name||e.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const ST=({user:e,onLogout:t})=>g.jsxs(pT,{children:[g.jsx(gT,{asChild:!0,children:g.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:g.jsxs(zv,{className:"h-8 w-8",children:[e.avatar_url&&g.jsx(Uv,{src:e.avatar_url,alt:e.username}),g.jsx(Bv,{className:"text-xs",children:xT(e)})]})})}),g.jsxs(Tw,{align:"end",className:"w-56",children:[g.jsxs(Rw,{className:"flex flex-col gap-0.5 py-2",children:[g.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),g.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&g.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-900",children:"Admin"}),e.role==="contributor"&&g.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),g.jsx(xc,{}),g.jsx(It,{asChild:!0,children:g.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),xa()&&g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/chat",children:"Chat"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/frameworks",children:"Frameworks"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/trends",children:"Trends"})}),e.is_admin&&g.jsxs(g.Fragment,{children:[g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/admin-dashboard",children:"Admin dashboard"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/submissions",children:"Review submissions"})})]}),e.can_contribute&&g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/contributions",children:"My contributions"})}),g.jsx(It,{asChild:!0,children:g.jsx(Cn,{to:"/settings",children:"Settings"})}),g.jsx(xc,{}),g.jsx(It,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),Nw=T.createContext(null),fp="pwc:auth-stale";async function ET(){if(qi())return null;const e=await fetch(io("/api/v1/auth/me"),{credentials:"include",cache:"no-store"});return e.status===401||!e.ok?null:await e.json()}const CT=({children:e})=>{const[t,n]=T.useState(null),[r,o]=T.useState(!0),i=T.useCallback(async()=>{o(!0);const l=await ET();n(l),o(!1)},[]),s=T.useCallback(async()=>{const l=Xa("/api/v1/auth/logout");if(new URL(l,window.location.origin).origin!==window.location.origin){const u=document.createElement("form");u.method="POST",u.action=`${l}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(u),u.submit();return}await fetch(io("/api/v1/auth/logout"),{method:"POST",credentials:"include"}),n(null)},[]);T.useEffect(()=>{i()},[i]),T.useEffect(()=>{const l=()=>n(null);return window.addEventListener(fp,l),()=>window.removeEventListener(fp,l)},[]);const a=T.useMemo(()=>({user:t,isLoading:r,refresh:i,logout:s}),[t,r,i,s]);return g.jsx(Nw.Provider,{value:a,children:e})};function Xd(){const e=T.useContext(Nw);if(!e)throw new Error("useAuth must be used inside an ");return e}const Yo=({name:e,size:t=14})=>{const n={search:g.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"}),bookmark:g.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:g.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:g.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return g.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},hp="https://github.com/huggingface/paperswithcode-feedback/issues",bT="https://github.com/huggingface/pwc-cli",pp=[{to:"/",label:"Trending",end:!0},{to:"/tasks",label:"Browse state-of-the-art",end:!1},{to:"/methods",label:"Methods",end:!1},{to:"/conferences",label:"Conferences",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],_T=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgentData,t=(e==null?void 0:e.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(t)},PT=()=>{const[e,t]=T.useState(!1);return T.useEffect(()=>{t(_T())},[]),g.jsx("kbd",{children:e?"⌘K":"Ctrl K"})},kT=({onOpenSearch:e})=>{const[t,n]=T.useState(!1),r=()=>n(!1),{user:o,logout:i}=Xd(),s=hn(),a=xa()&&(s.pathname==="/chat"||s.pathname.startsWith("/chat/")),l=`${s.pathname}${s.search}`||"/",u=qi();return g.jsxs(g.Fragment,{children:[g.jsxs("header",{className:`app-header${a?" app-header-chat":""}`,children:[g.jsxs("div",{className:"app-header-inner",children:[g.jsxs(Dr,{to:"/",className:"brand",onClick:r,children:[g.jsx("span",{className:"brand-mark"}),g.jsxs("span",{className:"brand-name",children:["Papers ",g.jsx("em",{children:"With Code"})]})]}),g.jsx("nav",{className:"nav",children:pp.map(({to:c,label:d,end:p})=>g.jsx(Dr,{to:c,end:p,className:({isActive:h})=>`nav-item ${h?"active":""}`,children:d},c))}),g.jsx("div",{className:"header-spacer"}),g.jsx("a",{className:"feedback-link header-feedback-link",href:hp,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),g.jsxs("button",{className:"search-trigger",onClick:e,children:[g.jsx(Yo,{name:"search",size:13}),g.jsx("span",{children:"Search papers, authors, domains…"}),g.jsx(PT,{})]}),g.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:g.jsx(Yo,{name:"search",size:14})}),!u&&g.jsx(Dr,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:g.jsx(Yo,{name:"bookmark",size:13})}),u?null:o?g.jsx(ST,{user:o,onLogout:i}):g.jsx(wv,{returnTo:l}),g.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(c=>!c),children:g.jsx(Yo,{name:t?"close":"menu",size:14})})]}),g.jsxs("div",{className:"site-announcement",role:"status",children:[g.jsx("span",{children:"New: Papers with Code CLI and Skill now "}),g.jsx("a",{href:bT,target:"_blank",rel:"noreferrer",children:"available"})]})]}),t&&g.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:g.jsxs("div",{className:"mobile-nav-panel",onClick:c=>c.stopPropagation(),children:[g.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),e()},children:[g.jsx(Yo,{name:"search",size:14}),g.jsx("span",{children:"Search papers, authors, domains…"})]}),pp.map(({to:c,label:d,end:p})=>g.jsx(Dr,{to:c,end:p,className:"mobile-nav-link",onClick:r,children:d},c)),g.jsx("a",{className:"mobile-nav-link",href:hp,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!u&&g.jsx(Dr,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),!u&&(o==null?void 0:o.is_admin)&&g.jsx(Dr,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:r,children:"Admin dashboard"})]})})]})},TT=1,RT=1e6;let iu=0;function NT(){return iu=(iu+1)%Number.MAX_SAFE_INTEGER,iu.toString()}const su=new Map,gp=e=>{if(su.has(e))return;const t=setTimeout(()=>{su.delete(e),di({type:"REMOVE_TOAST",toastId:e})},RT);su.set(e,t)},OT=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,TT)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?gp(n):e.toasts.forEach(r=>{gp(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Vs=[];let Ws={toasts:[]};function di(e){Ws=OT(Ws,e),Vs.forEach(t=>{t(Ws)})}function MT({...e}){const t=NT(),n=o=>di({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>di({type:"DISMISS_TOAST",toastId:t});return di({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function AT(){const[e,t]=f.useState(Ws);return f.useEffect(()=>(Vs.push(t),()=>{const n=Vs.indexOf(t);n>-1&&Vs.splice(n,1)}),[e]),{...e,toast:MT,dismiss:n=>di({type:"DISMISS_TOAST",toastId:n})}}var LT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),jT="VisuallyHidden",ul=f.forwardRef((e,t)=>g.jsx(ve.span,{...e,ref:t,style:{...LT,...e.style}}));ul.displayName=jT;var IT=ul,Jd="ToastProvider",[Zd,DT,$T]=Ld("Toast"),[Ow]=kr("Toast",[$T]),[FT,cl]=Ow(Jd),Mw=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=f.useState(null),[u,c]=f.useState(0),d=f.useRef(!1),p=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Jd}\`. Expected non-empty \`string\`.`),g.jsx(Zd.Provider,{scope:t,children:g.jsx(FT,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>c(h=>h+1),[]),onToastRemove:f.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:p,children:s})})};Mw.displayName=Jd;var Aw="ToastViewport",zT=["F8"],Sc="toast.viewportPause",Ec="toast.viewportResume",Lw=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=zT,label:o="Notifications ({hotkey})",...i}=e,s=cl(Aw,n),a=DT(n),l=f.useRef(null),u=f.useRef(null),c=f.useRef(null),d=f.useRef(null),p=Re(t,d,s.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=s.toastCount>0;f.useEffect(()=>{const x=v=>{var w;r.length!==0&&r.every(S=>v[S]||v.code===S)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=l.current,v=d.current;if(E&&x&&v){const m=()=>{if(!s.isClosePausedRef.current){const b=new CustomEvent(Sc);v.dispatchEvent(b),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const b=new CustomEvent(Ec);v.dispatchEvent(b),s.isClosePausedRef.current=!1}},S=b=>{!x.contains(b.relatedTarget)&&w()},C=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",m),x.addEventListener("focusout",S),x.addEventListener("pointermove",m),x.addEventListener("pointerleave",C),window.addEventListener("blur",m),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",m),x.removeEventListener("focusout",S),x.removeEventListener("pointermove",m),x.removeEventListener("pointerleave",C),window.removeEventListener("blur",m),window.removeEventListener("focus",w)}}},[E,s.isClosePausedRef]);const y=f.useCallback(({tabbingDirection:x})=>{const m=a().map(w=>{const S=w.ref.current,C=[S,...ZT(S)];return x==="forwards"?C:C.reverse()});return(x==="forwards"?m.reverse():m).flat()},[a]);return f.useEffect(()=>{const x=d.current;if(x){const v=m=>{var C,b,P;const w=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!w){const R=document.activeElement,L=m.shiftKey;if(m.target===x&&L){(C=u.current)==null||C.focus();return}const D=y({tabbingDirection:L?"backwards":"forwards"}),q=D.findIndex(I=>I===R);au(D.slice(q+1))?m.preventDefault():L?(b=u.current)==null||b.focus():(P=c.current)==null||P.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,y]),g.jsxs(wb,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&g.jsx(Cc,{ref:u,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});au(x)}}),g.jsx(Zd.Slot,{scope:n,children:g.jsx(ve.ol,{tabIndex:-1,...i,ref:p})}),E&&g.jsx(Cc,{ref:c,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});au(x)}})]})});Lw.displayName=Aw;var jw="ToastFocusProxy",Cc=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=cl(jw,n);return g.jsx(ul,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});Cc.displayName=jw;var Xi="Toast",UT="toast.swipeStart",BT="toast.swipeMove",VT="toast.swipeCancel",WT="toast.swipeEnd",Iw=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a,l]=Md({prop:r,defaultProp:o??!0,onChange:i,caller:Xi});return g.jsx(Tr,{present:n||a,children:g.jsx(KT,{open:a,...s,ref:t,onClose:()=>l(!1),onPause:Je(e.onPause),onResume:Je(e.onResume),onSwipeStart:V(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:V(e.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:V(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:V(e.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Iw.displayName=Xi;var[HT,qT]=Ow(Xi,{onClose(){}}),KT=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:p,onSwipeEnd:h,...E}=e,y=cl(Xi,n),[x,v]=f.useState(null),m=Re(t,I=>v(I)),w=f.useRef(null),S=f.useRef(null),C=o||y.duration,b=f.useRef(0),P=f.useRef(C),R=f.useRef(0),{onToastAdd:L,onToastRemove:A}=y,z=Je(()=>{var Y;(x==null?void 0:x.contains(document.activeElement))&&((Y=y.viewport)==null||Y.focus()),s()}),D=f.useCallback(I=>{!I||I===1/0||(window.clearTimeout(R.current),b.current=new Date().getTime(),R.current=window.setTimeout(z,I))},[z]);f.useEffect(()=>{const I=y.viewport;if(I){const Y=()=>{D(P.current),u==null||u()},U=()=>{const H=new Date().getTime()-b.current;P.current=P.current-H,window.clearTimeout(R.current),l==null||l()};return I.addEventListener(Sc,U),I.addEventListener(Ec,Y),()=>{I.removeEventListener(Sc,U),I.removeEventListener(Ec,Y)}}},[y.viewport,C,l,u,D]),f.useEffect(()=>{i&&!y.isClosePausedRef.current&&D(C)},[i,C,y.isClosePausedRef,D]),f.useEffect(()=>(L(),()=>A()),[L,A]);const q=f.useMemo(()=>x?Vw(x):null,[x]);return y.viewport?g.jsxs(g.Fragment,{children:[q&&g.jsx(GT,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:q}),g.jsx(HT,{scope:n,onClose:z,children:Hi.createPortal(g.jsx(Zd.ItemSlot,{scope:n,children:g.jsx(yb,{asChild:!0,onEscapeKeyDown:V(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||z(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:g.jsx(ve.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...E,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:V(e.onKeyDown,I=>{I.key==="Escape"&&(a==null||a(I.nativeEvent),I.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:V(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:V(e.onPointerMove,I=>{if(!w.current)return;const Y=I.clientX-w.current.x,U=I.clientY-w.current.y,H=!!S.current,O=["left","right"].includes(y.swipeDirection),k=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,j=O?k(0,Y):0,B=O?0:k(0,U),F=I.pointerType==="touch"?10:2,G={x:j,y:B},X={originalEvent:I,delta:G};H?(S.current=G,Ps(BT,d,X,{discrete:!1})):mp(G,y.swipeDirection,F)?(S.current=G,Ps(UT,c,X,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(Y)>F||Math.abs(U)>F)&&(w.current=null)}),onPointerUp:V(e.onPointerUp,I=>{const Y=S.current,U=I.target;if(U.hasPointerCapture(I.pointerId)&&U.releasePointerCapture(I.pointerId),S.current=null,w.current=null,Y){const H=I.currentTarget,O={originalEvent:I,delta:Y};mp(Y,y.swipeDirection,y.swipeThreshold)?Ps(WT,h,O,{discrete:!0}):Ps(VT,p,O,{discrete:!0}),H.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),GT=e=>{const{__scopeToast:t,children:n,...r}=e,o=cl(Xi,t),[i,s]=f.useState(!1),[a,l]=f.useState(!1);return XT(()=>s(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:g.jsx(Vd,{asChild:!0,children:g.jsx(ul,{...r,children:i&&g.jsxs(g.Fragment,{children:[o.label," ",n]})})})},QT="ToastTitle",Dw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});Dw.displayName=QT;var YT="ToastDescription",$w=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});$w.displayName=YT;var Fw="ToastAction",zw=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?g.jsx(Bw,{altText:n,asChild:!0,children:g.jsx(ef,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Fw}\`. Expected non-empty \`string\`.`),null)});zw.displayName=Fw;var Uw="ToastClose",ef=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=qT(Uw,n);return g.jsx(Bw,{asChild:!0,children:g.jsx(ve.button,{type:"button",...r,ref:t,onClick:V(e.onClick,o.onClose)})})});ef.displayName=Uw;var Bw=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return g.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Vw(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),JT(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...Vw(r))}}),t}function Ps(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ad(o,i):o.dispatchEvent(i)}var mp=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function XT(e=()=>{}){const t=Je(e);vt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function JT(e){return e.nodeType===e.ELEMENT_NODE}function ZT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function au(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var eR=Mw,Ww=Lw,Hw=Iw,qw=Dw,Kw=$w,Gw=zw,Qw=ef;const vp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yp=Lv,tR=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const p=vp(c)||vp(d);return o[u][p]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,p]=c;return p===void 0||(u[d]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:p,...h}=c;return Object.entries(h).every(E=>{let[y,x]=E;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...u,d,p]:u},[]);return yp(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},nR=eR,Yw=f.forwardRef(({className:e,...t},n)=>g.jsx(Ww,{ref:n,className:Ne("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Yw.displayName=Ww.displayName;const rR=tR("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Xw=f.forwardRef(({className:e,variant:t,...n},r)=>g.jsx(Hw,{ref:r,className:Ne(rR({variant:t}),e),...n}));Xw.displayName=Hw.displayName;const oR=f.forwardRef(({className:e,...t},n)=>g.jsx(Gw,{ref:n,className:Ne("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));oR.displayName=Gw.displayName;const Jw=f.forwardRef(({className:e,...t},n)=>g.jsx(Qw,{ref:n,className:Ne("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:g.jsx(hT,{className:"h-4 w-4"})}));Jw.displayName=Qw.displayName;const Zw=f.forwardRef(({className:e,...t},n)=>g.jsx(qw,{ref:n,className:Ne("text-sm font-semibold",e),...t}));Zw.displayName=qw.displayName;const e0=f.forwardRef(({className:e,...t},n)=>g.jsx(Kw,{ref:n,className:Ne("text-sm opacity-90",e),...t}));e0.displayName=Kw.displayName;function iR(){const{toasts:e}=AT();return g.jsxs(nR,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return g.jsxs(Xw,{...i,children:[g.jsxs("div",{className:"grid gap-1",children:[n&&g.jsx(Zw,{children:n}),r&&g.jsx(e0,{children:r})]}),o,g.jsx(Jw,{})]},t)}),g.jsx(Yw,{})]})}var sR=e=>{switch(e){case"success":return uR;case"info":return dR;case"warning":return cR;case"error":return fR;default:return null}},aR=Array(12).fill(0),lR=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},aR.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),uR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),cR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),dR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),fR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),hR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),pR=()=>{let[e,t]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},bc=1,gR=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:bc++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,i,s=r.then(async l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(vR(l)&&!l.ok){o=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,c=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:u,description:c})}else if(t.success!==void 0){o=!1;let u=typeof t.success=="function"?await t.success(l):t.success,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let u=typeof t.error=="function"?await t.error(l):t.error,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,u)=>s.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||bc++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},qe=new gR,mR=(e,t)=>{let n=(t==null?void 0:t.id)||bc++;return qe.addToast({title:e,...t,id:n}),n},vR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",yR=mR,wR=()=>qe.toasts,xR=()=>qe.getActiveToasts();Object.assign(yR,{success:qe.success,info:qe.info,warning:qe.warning,error:qe.error,custom:qe.custom,message:qe.message,promise:qe.promise,dismiss:qe.dismiss,loading:qe.loading},{getHistory:wR,getToasts:xR});function SR(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}SR(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);function ks(e){return e.label!==void 0}var ER=3,CR="32px",bR="16px",wp=4e3,_R=356,PR=14,kR=20,TR=200;function Ct(...e){return e.filter(Boolean).join(" ")}function RR(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var NR=e=>{var t,n,r,o,i,s,a,l,u,c,d;let{invert:p,toast:h,unstyled:E,interacting:y,setHeights:x,visibleToasts:v,heights:m,index:w,toasts:S,expanded:C,removeToast:b,defaultRichColors:P,closeButton:R,style:L,cancelButtonStyle:A,actionButtonStyle:z,className:D="",descriptionClassName:q="",duration:I,position:Y,gap:U,loadingIcon:H,expandByDefault:O,classNames:k,icons:j,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:F}=e,[G,X]=T.useState(null),[fe,ye]=T.useState(null),[J,Gt]=T.useState(!1),[_e,Lt]=T.useState(!1),[gn,Or]=T.useState(!1),[mn,Ji]=T.useState(!1),[hl,Zi]=T.useState(!1),[pl,$o]=T.useState(0),[Mr,nf]=T.useState(0),Fo=T.useRef(h.duration||I||wp),rf=T.useRef(null),tr=T.useRef(null),h0=w===0,p0=w+1<=v,lt=h.type,Ar=h.dismissible!==!1,g0=h.className||"",m0=h.descriptionClassName||"",es=T.useMemo(()=>m.findIndex(K=>K.toastId===h.id)||0,[m,h.id]),v0=T.useMemo(()=>{var K;return(K=h.closeButton)!=null?K:R},[h.closeButton,R]),of=T.useMemo(()=>h.duration||I||wp,[h.duration,I]),gl=T.useRef(0),Lr=T.useRef(0),sf=T.useRef(0),jr=T.useRef(null),[y0,w0]=Y.split("-"),af=T.useMemo(()=>m.reduce((K,oe,ce)=>ce>=es?K:K+oe.height,0),[m,es]),lf=pR(),x0=h.invert||p,ml=lt==="loading";Lr.current=T.useMemo(()=>es*U+af,[es,af]),T.useEffect(()=>{Fo.current=of},[of]),T.useEffect(()=>{Gt(!0)},[]),T.useEffect(()=>{let K=tr.current;if(K){let oe=K.getBoundingClientRect().height;return nf(oe),x(ce=>[{toastId:h.id,height:oe,position:h.position},...ce]),()=>x(ce=>ce.filter(yt=>yt.toastId!==h.id))}},[x,h.id]),T.useLayoutEffect(()=>{if(!J)return;let K=tr.current,oe=K.style.height;K.style.height="auto";let ce=K.getBoundingClientRect().height;K.style.height=oe,nf(ce),x(yt=>yt.find(wt=>wt.toastId===h.id)?yt.map(wt=>wt.toastId===h.id?{...wt,height:ce}:wt):[{toastId:h.id,height:ce,position:h.position},...yt])},[J,h.title,h.description,x,h.id]);let vn=T.useCallback(()=>{Lt(!0),$o(Lr.current),x(K=>K.filter(oe=>oe.toastId!==h.id)),setTimeout(()=>{b(h)},TR)},[h,b,x,Lr]);T.useEffect(()=>{if(h.promise&<==="loading"||h.duration===1/0||h.type==="loading")return;let K;return C||y||F&&lf?(()=>{if(sf.current{var oe;(oe=h.onAutoClose)==null||oe.call(h,h),vn()},Fo.current)),()=>clearTimeout(K)},[C,y,h,lt,F,lf,vn]),T.useEffect(()=>{h.delete&&vn()},[vn,h.delete]);function S0(){var K,oe,ce;return j!=null&&j.loading?T.createElement("div",{className:Ct(k==null?void 0:k.loader,(K=h==null?void 0:h.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":lt==="loading"},j.loading):H?T.createElement("div",{className:Ct(k==null?void 0:k.loader,(oe=h==null?void 0:h.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":lt==="loading"},H):T.createElement(lR,{className:Ct(k==null?void 0:k.loader,(ce=h==null?void 0:h.classNames)==null?void 0:ce.loader),visible:lt==="loading"})}return T.createElement("li",{tabIndex:0,ref:tr,className:Ct(D,g0,k==null?void 0:k.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[lt],(n=h==null?void 0:h.classNames)==null?void 0:n[lt]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:P,"data-styled":!(h.jsx||h.unstyled||E),"data-mounted":J,"data-promise":!!h.promise,"data-swiped":hl,"data-removed":_e,"data-visible":p0,"data-y-position":y0,"data-x-position":w0,"data-index":w,"data-front":h0,"data-swiping":gn,"data-dismissible":Ar,"data-type":lt,"data-invert":x0,"data-swipe-out":mn,"data-swipe-direction":fe,"data-expanded":!!(C||O&&J),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${_e?pl:Lr.current}px`,"--initial-height":O?"auto":`${Mr}px`,...L,...h.style},onDragEnd:()=>{Or(!1),X(null),jr.current=null},onPointerDown:K=>{ml||!Ar||(rf.current=new Date,$o(Lr.current),K.target.setPointerCapture(K.pointerId),K.target.tagName!=="BUTTON"&&(Or(!0),jr.current={x:K.clientX,y:K.clientY}))},onPointerUp:()=>{var K,oe,ce,yt;if(mn||!Ar)return;jr.current=null;let wt=Number(((K=tr.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),yn=Number(((oe=tr.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nr=new Date().getTime()-((ce=rf.current)==null?void 0:ce.getTime()),xt=G==="x"?wt:yn,wn=Math.abs(xt)/nr;if(Math.abs(xt)>=kR||wn>.11){$o(Lr.current),(yt=h.onDismiss)==null||yt.call(h,h),ye(G==="x"?wt>0?"right":"left":yn>0?"down":"up"),vn(),Ji(!0),Zi(!1);return}Or(!1),X(null)},onPointerMove:K=>{var oe,ce,yt,wt;if(!jr.current||!Ar||((oe=window.getSelection())==null?void 0:oe.toString().length)>0)return;let yn=K.clientY-jr.current.y,nr=K.clientX-jr.current.x,xt=(ce=e.swipeDirections)!=null?ce:RR(Y);!G&&(Math.abs(nr)>1||Math.abs(yn)>1)&&X(Math.abs(nr)>Math.abs(yn)?"x":"y");let wn={x:0,y:0};G==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&yn<0||xt.includes("bottom")&&yn>0)&&(wn.y=yn):G==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&nr<0||xt.includes("right")&&nr>0)&&(wn.x=nr),(Math.abs(wn.x)>0||Math.abs(wn.y)>0)&&Zi(!0),(yt=tr.current)==null||yt.style.setProperty("--swipe-amount-x",`${wn.x}px`),(wt=tr.current)==null||wt.style.setProperty("--swipe-amount-y",`${wn.y}px`)}},v0&&!h.jsx?T.createElement("button",{"aria-label":B,"data-disabled":ml,"data-close-button":!0,onClick:ml||!Ar?()=>{}:()=>{var K;vn(),(K=h.onDismiss)==null||K.call(h,h)},className:Ct(k==null?void 0:k.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(i=j==null?void 0:j.close)!=null?i:hR):null,h.jsx||f.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:T.createElement(T.Fragment,null,lt||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:Ct(k==null?void 0:k.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||S0():null,h.type!=="loading"?h.icon||(j==null?void 0:j[lt])||sR(lt):null):null,T.createElement("div",{"data-content":"",className:Ct(k==null?void 0:k.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:Ct(k==null?void 0:k.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?T.createElement("div",{"data-description":"",className:Ct(q,m0,k==null?void 0:k.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),f.isValidElement(h.cancel)?h.cancel:h.cancel&&ks(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||A,onClick:K=>{var oe,ce;ks(h.cancel)&&Ar&&((ce=(oe=h.cancel).onClick)==null||ce.call(oe,K),vn())},className:Ct(k==null?void 0:k.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,f.isValidElement(h.action)?h.action:h.action&&ks(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||z,onClick:K=>{var oe,ce;ks(h.action)&&((ce=(oe=h.action).onClick)==null||ce.call(oe,K),!K.defaultPrevented&&vn())},className:Ct(k==null?void 0:k.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function xp(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function OR(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?bR:CR;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${s}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${s}-${u}`]=a:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var MR=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:p,style:h,visibleToasts:E=ER,toastOptions:y,dir:x=xp(),gap:v=PR,loadingIcon:m,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=e,[b,P]=T.useState([]),R=T.useMemo(()=>Array.from(new Set([r].concat(b.filter(F=>F.position).map(F=>F.position)))),[b,r]),[L,A]=T.useState([]),[z,D]=T.useState(!1),[q,I]=T.useState(!1),[Y,U]=T.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=T.useRef(null),O=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=T.useRef(null),j=T.useRef(!1),B=T.useCallback(F=>{P(G=>{var X;return(X=G.find(fe=>fe.id===F.id))!=null&&X.delete||qe.dismiss(F.id),G.filter(({id:fe})=>fe!==F.id)})},[]);return T.useEffect(()=>qe.subscribe(F=>{if(F.dismiss){P(G=>G.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{qm.flushSync(()=>{P(G=>{let X=G.findIndex(fe=>fe.id===F.id);return X!==-1?[...G.slice(0,X),{...G[X],...F},...G.slice(X+1)]:[F,...G]})})})}),[]),T.useEffect(()=>{if(c!=="system"){U(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:G})=>{U(G?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{U(X?"dark":"light")}catch(fe){console.error(fe)}})}},[c]),T.useEffect(()=>{b.length<=1&&D(!1)},[b]),T.useEffect(()=>{let F=G=>{var X,fe;o.every(ye=>G[ye]||G.code===ye)&&(D(!0),(X=H.current)==null||X.focus()),G.code==="Escape"&&(document.activeElement===H.current||(fe=H.current)!=null&&fe.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),T.useEffect(()=>{if(H.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,j.current=!1)}},[H.current]),T.createElement("section",{ref:t,"aria-label":`${S} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,G)=>{var X;let[fe,ye]=F.split("-");return b.length?T.createElement("ol",{key:F,dir:x==="auto"?xp():x,tabIndex:-1,ref:H,className:a,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":fe,"data-lifted":z&&b.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((X=L[0])==null?void 0:X.height)||0}px`,"--width":`${_R}px`,"--gap":`${v}px`,...h,...OR(l,u)},onBlur:J=>{j.current&&!J.currentTarget.contains(J.relatedTarget)&&(j.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||j.current||(j.current=!0,k.current=J.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{q||D(!1)},onDragEnd:()=>D(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},b.filter(J=>!J.position&&G===0||J.position===F).map((J,Gt)=>{var _e,Lt;return T.createElement(NR,{key:J.id,icons:w,index:Gt,toast:J,defaultRichColors:d,duration:(_e=y==null?void 0:y.duration)!=null?_e:p,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:E,closeButton:(Lt=y==null?void 0:y.closeButton)!=null?Lt:s,interacting:q,position:F,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:B,toasts:b.filter(gn=>gn.position==J.position),heights:L.filter(gn=>gn.position==J.position),setHeights:A,expandByDefault:i,gap:v,loadingIcon:m,expanded:z,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const AR=({...e})=>{const{theme:t="system"}=JS();return g.jsx(MR,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var LR=Symbol("radix.slottable");function jR(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=LR,t}var[dl]=kr("Tooltip",[rl]),tf=rl(),t0="TooltipProvider",IR=700,Sp="tooltip.open",[DR,n0]=dl(t0),r0=e=>{const{__scopeTooltip:t,delayDuration:n=IR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(DR,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};r0.displayName=t0;var o0="Tooltip",[lO,fl]=dl(o0),_c="TooltipTrigger",$R=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=fl(_c,n),i=n0(_c,n),s=tf(n),a=f.useRef(null),l=Re(t,a,o.onTriggerChange),u=f.useRef(!1),c=f.useRef(!1),d=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(my,{asChild:!0,...s,children:g.jsx(ve.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:V(e.onPointerMove,p=>{p.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),c.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})});$R.displayName=_c;var FR="TooltipPortal",[uO,zR]=dl(FR,{forceMount:void 0}),No="TooltipContent",i0=f.forwardRef((e,t)=>{const n=zR(No,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=fl(No,e.__scopeTooltip);return g.jsx(Tr,{present:r||s.open,children:s.disableHoverableContent?g.jsx(s0,{side:o,...i,ref:t}):g.jsx(UR,{side:o,...i,ref:t})})}),UR=f.forwardRef((e,t)=>{const n=fl(No,e.__scopeTooltip),r=n0(No,e.__scopeTooltip),o=f.useRef(null),i=Re(t,o),[s,a]=f.useState(null),{trigger:l,onClose:u}=n,c=o.current,{onPointerInTransitChange:d}=r,p=f.useCallback(()=>{a(null),d(!1)},[d]),h=f.useCallback((E,y)=>{const x=E.currentTarget,v={x:E.clientX,y:E.clientY},m=qR(v,x.getBoundingClientRect()),w=KR(v,m),S=GR(y.getBoundingClientRect()),C=YR([...w,...S]);a(C),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(l&&c){const E=x=>h(x,c),y=x=>h(x,l);return l.addEventListener("pointerleave",E),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",E),c.removeEventListener("pointerleave",y)}}},[l,c,h,p]),f.useEffect(()=>{if(s){const E=y=>{const x=y.target,v={x:y.clientX,y:y.clientY},m=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),w=!QR(v,s);m?p():w&&(p(),u())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[l,c,s,u,p]),g.jsx(s0,{...e,ref:i})}),[BR,VR]=dl(o0,{isInside:!1}),WR=jR("TooltipContent"),s0=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=fl(No,n),u=tf(n),{onClose:c}=l;return f.useEffect(()=>(document.addEventListener(Sp,c),()=>document.removeEventListener(Sp,c)),[c]),f.useEffect(()=>{if(l.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),g.jsx(Ja,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:g.jsxs(vy,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(WR,{children:r}),g.jsx(BR,{scope:n,isInside:!0,children:g.jsx(IT,{id:l.contentId,role:"tooltip",children:o||r})})]})})});i0.displayName=No;var a0="TooltipArrow",HR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=tf(n);return VR(a0,n).isInside?null:g.jsx(yy,{...o,...r,ref:t})});HR.displayName=a0;function qR(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function KR(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function GR(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function QR(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=p>r&&n<(d-u)*(r-c)/(p-c)+u&&(o=!o)}return o}function YR(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),XR(t)}function XR(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var JR=r0,l0=i0;const ZR=JR,eN=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(l0,{ref:r,sideOffset:t,className:Ne("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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),...n}));eN.displayName=l0.displayName;function tN(){const{pathname:e,hash:t}=hn();f.useEffect(()=>{t||window.scrollTo(0,0)},[e,t])}const nN="cronAdminToken";function rN(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(nN))==null?void 0:e.trim())??""}const Ep=!1;class Ta extends Error{constructor(n,r){var o;super(`API request failed: ${n.status} ${n.statusText}`);St(this,"status");St(this,"statusText");St(this,"response");St(this,"detail");St(this,"code");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{this.detail=(o=JSON.parse(r))==null?void 0:o.detail,typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code)}catch{this.detail=void 0}}}async function u0(e,t,n){const r=`${e}${t}`;try{const{headers:o,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=rN(),u=new Headers(o);u.has("Content-Type")||u.set("Content-Type","application/json"),l&&!u.has("X-Admin-Token")&&u.set("X-Admin-Token",l);const c=await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:u});if(!c.ok){const p=new Ta(c,await c.text());throw console.error("[API] Error response:",p.response),p}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${r} failed:`,o),o}}async function oN(e){try{return await e()}catch(t){throw t instanceof Ta&&t.status===401&&t.code!=="fresh_auth_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale")),t}}function iN(e){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",e);const t=Xa("/api/v1/auth/hf/login");window.location.assign(`${t}?return_to=${encodeURIComponent(window.location.href)}`)}class sN{constructor(t,n=iN){St(this,"paperLoads",new Map);St(this,"evaluationLoads",new Map);this.request=t,this.recoverFreshAuth=n}primePaper(t,n=!1){n&&this.paperLoads.delete(t);let r=this.paperLoads.get(t);return r||(r=this.request(`/papers/${t}/curation-state`).catch(o=>{throw this.paperLoads.delete(t),o}),this.paperLoads.set(t,r)),r}primeEvaluations(t,n=!1){n&&this.evaluationLoads.delete(t);let r=this.evaluationLoads.get(t);return r||(r=this.request(`/evaluations/curation-state?paper_id=${t}`).catch(o=>{throw this.evaluationLoads.delete(t),o}),this.evaluationLoads.set(t,r)),r}async mutatePaper(t,n,r,o,i){const s=this.paperLoads.get(t);if(!s)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const a=(await s).sections[n];if(!a)throw new Error(`Missing curation version for ${n}`);return this.mutate(n,o,r,a,i,`paper:${t}:${n}`)}async mutateEvaluations(t,n,r,o){const i=this.evaluationLoads.get(String(t));if(!i)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const s=(await i).version;return this.mutate("evaluations",r,n,s,o,`paper:${t}:evaluations`)}async mutate(t,n,r,o,i,s){const a=new Headers(i.headers);Object.entries(this.idempotencyHeaders(s,r,o)).forEach(([u,c])=>a.set(u,c));const l={...i,headers:a};try{const u=await this.request(n,l);return this.clearAttempt(l),u}catch(u){throw u instanceof Ta&&u.status===401&&u.code==="fresh_auth_required"?this.recoverFreshAuth(t):u instanceof Ta&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:n}}))),u}}idempotencyHeaders(t,n,r){const o=`pwc:mutation:${t}:${JSON.stringify(n)}`,i=sessionStorage.getItem(o);if(i){const a=JSON.parse(i);return{"Idempotency-Key":a.key,"If-Match":a.version}}const s=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:s,version:r})),sessionStorage.setItem(`pwc:mutation-key:${s}`,o),{"Idempotency-Key":s,"If-Match":r}}clearAttempt(t){const n=new Headers(t.headers).get("Idempotency-Key");if(!n)return;const r=sessionStorage.getItem(`pwc:mutation-key:${n}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${n}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const c0=`${Td()}/api/v1`;async function cO(e,t){return u0(c0,`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}class aN{constructor(t=c0){St(this,"baseUrl");St(this,"curation");this.baseUrl=t,this.curation=new sN((n,r)=>this.request(n,r))}async request(t,n){return oN(()=>u0(this.baseUrl,t,n))}async getPapers(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir),t!=null&&t.time&&n.append("time",t.time),t!=null&&t.published_after&&n.append("published_after",t.published_after),t!=null&&t.published_before&&n.append("published_before",t.published_before),t!=null&&t.conference&&n.append("conference",t.conference),(t==null?void 0:t.latest_only)!==void 0&&n.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&n.append("include_resources",t.include_resources.toString()),(t==null?void 0:t.has_code)!==void 0&&n.append("has_code",t.has_code.toString()),(t==null?void 0:t.has_hf_artifacts)!==void 0&&n.append("has_hf_artifacts",t.has_hf_artifacts.toString()),t!=null&&t.framework&&n.append("framework",t.framework),t!=null&&t.repository&&n.append("repository",t.repository);const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(t,n=1,r=10,o){const i=new URLSearchParams;return i.append("q",t),i.append("page",n.toString()),i.append("page_size",r.toString()),o&&i.append("mode",o),this.request(`/papers/search?${i.toString()}`)}async getPaper(t,n=!0){const r=`/papers/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getPaperByArxivId(t,n=!0){const r=`/papers/arxiv/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getRelatedPapers(t,n=4){const r=new URLSearchParams({limit:n.toString()});return this.request(`/papers/${encodeURIComponent(t)}/related?${r.toString()}`)}async indexPaperFromArxiv(t){const n=`/papers/index/${t}`;return this.request(n,{method:"POST"})}async submitPaper(t){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(t)})}primePaperCurationState(t,n=!1){return this.curation.primePaper(t,n)}primeEvaluationCurationState(t,n=!1){return this.curation.primeEvaluations(t,n)}async updatePaperTasks(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("task_ids",i.toString()));const o=`/papers/${t}/tasks?${r.toString()}`;return this.curation.mutatePaper(t,"tasks",n,o,{method:"PUT"})}async updatePaperMethods(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("method_ids",i.toString()));const o=`/papers/${t}/methods?${r.toString()}`;return this.curation.mutatePaper(t,"methods",n,o,{method:"PUT"})}async updatePaperOrganizations(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("organization_ids",i.toString()));const o=`/papers/${t}/organizations?${r.toString()}`;return this.curation.mutatePaper(t,"organizations",n,o,{method:"PUT"})}async updatePaperRepositories(t,n){const r=`/papers/${t}/repositories`;return this.curation.mutatePaper(t,"repositories",n,r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(t,n){const r=`/papers/${t}/project-pages`;return this.curation.mutatePaper(t,"project_pages",n,r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(t,n){const r=`/papers/${t}/source-url`;return this.curation.mutatePaper(t,"source_url",n,r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(t,n){const r=`/papers/${t}/hf-artifacts`;return this.curation.mutatePaper(t,"hf_artifacts",n,r,{method:"PUT",body:JSON.stringify(n)})}async getTrendingPapers(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.max_age_days&&n.append("max_age_days",t.max_age_days.toString()),(t==null?void 0:t.min_velocity)!==void 0&&n.append("min_velocity",t.min_velocity.toString());const r=`/papers/trending${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getRepositoriesForPaper(t){return this.request(`/papers/${t}/repositories`)}async getRepositories(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.owner&&n.append("owner",t.owner),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.min_stars&&n.append("min_stars",t.min_stars.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/repositories/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getProjectPagesForPaper(t){return this.request(`/papers/${t}/project-pages`)}async getProjectPages(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/project-pages/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthors(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.sort_by&&n.append("sort_by",t.sort_by),t!=null&&t.sort_order&&n.append("sort_order",t.sort_order);const r=`/authors${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthor(t){return this.request(`/authors/${t}`)}async getAuthorPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=r.toString();return this.request(`/authors/${t}/papers${o?`?${o}`:""}`)}async getAreas(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/areas/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getArea(t){return this.request(`/areas/${t}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getConferences(){return this.request("/conferences/")}async getConferenceDeadlines(){return this.request("/conferences/deadlines")}async getConference(t){return this.request(`/conferences/${t}`)}async getConferenceAreasWithTasks(t){return this.request(`/conferences/${t}/areas-with-tasks`)}async getConferencePapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.presentation&&r.append("presentation",n.presentation),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/conferences/${t}/papers?${o}`:`/conferences/${t}/papers`;return this.request(i)}async getOrganizations(t=!1){return this.request(`/organizations/${t?"?featured_only=true":""}`)}async getOrganization(t){return this.request(`/organizations/${t}`)}async getOrganizationContributions(t){return this.request(`/organizations/${t}/contributions`)}async getOrganizationAreasWithTasks(t){return this.request(`/organizations/${t}/areas-with-tasks`)}async getOrganizationPapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/organizations/${t}/papers?${o}`:`/organizations/${t}/papers`;return this.request(i)}async getAreaTasks(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/areas/${t}/tasks${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTasks(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.area_id&&n.append("area_id",t.area_id.toString()),t!=null&&t.parent_id&&n.append("parent_id",t.parent_id.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/tasks/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getTask(t){return this.request(`/tasks/${t}`)}async getFrameworkCatalog(){return this.request("/frameworks/")}async getTopTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString());const r=n.toString(),o=r?`/tasks/top?${r}`:"/tasks/top";return this.request(o)}async getTrendingTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.recent_days&&n.append("recent_days",t.recent_days.toString()),t!=null&&t.baseline_days&&n.append("baseline_days",t.baseline_days.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),(t==null?void 0:t.min_recent_papers)!==void 0&&n.append("min_recent_papers",t.min_recent_papers.toString()),(t==null?void 0:t.min_baseline_papers)!==void 0&&n.append("min_baseline_papers",t.min_baseline_papers.toString()),(t==null?void 0:t.min_share_lift)!==void 0&&n.append("min_share_lift",t.min_share_lift.toString());const r=n.toString(),o=r?`/tasks/trending?${r}`:"/tasks/trending";return this.request(o)}async getTaskChildren(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/tasks/${t}/children${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTaskParents(t){return this.request(`/tasks/${t}/parents`)}async getTaskPage(t,n){const r=new URLSearchParams;(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=`/tasks/${t}/page${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTrendingBenchmarks(t,n){const r=new URLSearchParams;(n==null?void 0:n.limit)!==void 0&&r.append("limit",n.limit.toString()),(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.min_recent_papers)!==void 0&&r.append("min_recent_papers",n.min_recent_papers.toString()),(n==null?void 0:n.include_descendants)!==void 0&&r.append("include_descendants",n.include_descendants.toString()),(n==null?void 0:n.bucket_days)!==void 0&&r.append("bucket_days",n.bucket_days.toString()),(n==null?void 0:n.history_buckets)!==void 0&&r.append("history_buckets",n.history_buckets.toString()),(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=r.toString(),i=`/tasks/${encodeURIComponent(t)}/trending-benchmarks${o?`?${o}`:""}`;return this.request(i)}async getTaskPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.toString());const o=r.toString(),i=o?`/tasks/${t}/papers?${o}`:`/tasks/${t}/papers`;return this.request(i)}async getMethods(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.introduced_year&&n.append("introduced_year",t.introduced_year.toString()),(t==null?void 0:t.area_id)!==void 0&&n.append("area_id",t.area_id.toString()),(t==null?void 0:t.exclude_id)!==void 0&&n.append("exclude_id",t.exclude_id.toString()),(t==null?void 0:t.include_trends)!==void 0&&n.append("include_trends",t.include_trends.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/methods/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMethod(t){return this.request(`/methods/${encodeURIComponent(t)}`)}async getMethodTrend(t,n){const r=new URLSearchParams;(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.history_months)!==void 0&&r.append("history_months",n.history_months.toString());const o=r.toString();return this.request(`/methods/${encodeURIComponent(t)}/trend${o?`?${o}`:""}`)}async getMethodPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.toString());const o=r.toString(),i=o?`/methods/${encodeURIComponent(t)}/papers?${o}`:`/methods/${encodeURIComponent(t)}/papers`;return this.request(i)}async getDatasets(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.task&&n.append("task",t.task),t!=null&&t.task_id&&n.append("task",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),(t==null?void 0:t.min_eval_count)!==void 0&&n.append("min_eval_count",t.min_eval_count.toString()),(t==null?void 0:t.is_open)!==void 0&&n.append("is_open",t.is_open.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/datasets/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getDataset(t){return this.request(`/datasets/${t}`)}async getDatasetBySlug(t,n){const r=new URLSearchParams;n!=null&&n.include_paper&&r.set("include_paper","true"),n!=null&&n.task&&r.set("task",n.task),(n==null?void 0:n.is_open)!==void 0&&r.set("is_open",String(n.is_open));const o=r.size?`?${r.toString()}`:"";return this.request(`/datasets/${t}${o}`)}async getDatasetTasks(t){return(await this.request(`/datasets/${t}/tasks/`)).results}async getLeaderboardMetrics(t,n){return(await this.request(`/datasets/${t}/tasks/${n}/metrics`)).metrics}async getEvaluations(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.task_id&&n.append("task_id",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),t!=null&&t.dataset_id&&n.append("dataset_id",t.dataset_id.toString()),t!=null&&t.best_metric&&n.append("best_metric",t.best_metric),(t==null?void 0:t.external)!==void 0&&n.append("external",String(t.external)),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/evaluations/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getEvaluation(t){return this.request(`/evaluations/${t}`)}async getEvaluationsByPaper(t){const r=parseInt(t),o=await this.getEvaluations({paper_id:r,page_size:100,ordering:"-benchmark_popularity"}),i=[...o.results];let s=o.next_page;for(;s;){const a=await this.getEvaluations({paper_id:r,page:s,page_size:100,ordering:"-benchmark_popularity"});i.push(...a.results),s=a.next_page}return i}async getEvaluationsByDataset(t,n){const o=parseInt(t),i=await this.getEvaluations({dataset_id:o,best_metric:n,page_size:100,ordering:"best_rank"}),s=[...i.results];let a=i.next_page;for(;a;){const l=await this.getEvaluations({dataset_id:o,best_metric:n,page:a,page_size:100,ordering:"best_rank"});s.push(...l.results),a=l.next_page}return s}async createEvaluation(t){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(t)})}async updateEvaluation(t,n){const r=`/evaluations/${t}`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async deleteEvaluation(t){const n=`/evaluations/${t}`;return this.request(n,{method:"DELETE"})}async batchEvaluations(t,n){return this.curation.mutateEvaluations(t,n,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:t,operations:n})})}async generateThumbnail(t){const n=io(`/api/thumbnails/generate/${t}`),r=await fetch(n,{method:"POST"});if(!r.ok)throw new Error(`Thumbnail generation failed: ${r.status}`);return await r.json()}async getThumbnailStatus(t){const n=io(`/api/thumbnails/status/${t}`),r=await fetch(n);if(!r.ok)throw new Error(`Thumbnail status check failed: ${r.status}`);return await r.json()}async healthCheck(){const t=io("/health"),n=await fetch(t);if(!n.ok)throw new Error(`Health check failed: ${n.status}`);return await n.json()}async getMetrics(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.direction&&n.append("direction",t.direction),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/metrics/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMetric(t){return this.request(`/metrics/${t}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(t){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(t)})}async listPendingPaperEdits(t){const n=new URLSearchParams;t!=null&&t.status&&n.append("status",t.status),t!=null&&t.edit_type&&n.append("edit_type",t.edit_type),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString());const r=`/admin/paper-edits${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getPendingPaperEdit(t){return this.request(`/admin/paper-edits/${t}`)}async approvePendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/approve`,{method:"POST",body:JSON.stringify(n??{})})}async rejectPendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/reject`,{method:"POST",body:JSON.stringify(n??{})})}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"POST"})}async removeBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"DELETE"})}async getMyPreferences(){return this.request("/me/preferences")}async updateMyPreferences(t){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(t)})}async getOpenRouterUsage(){return this.request("/chat/usage",{cache:"no-store"})}async getChatAvailability(){return this.request("/chat/availability",{cache:"no-store"})}async getChatSandboxSpend(t){const n=t?`?environment=${encodeURIComponent(t)}`:"";return this.request(`/chat/admin/sandbox-spend${n}`,{cache:"no-store"})}async getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}async connectOpenRouterCredential(t){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:t})})}async setOpenRouterFallback(t){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:t})})}async disconnectOpenRouterCredential(){await this.request("/chat/openrouter-key",{method:"DELETE"})}async getCronStatus(){return this.request("/cron/status",{cache:"no-store"})}async getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}async getMyContributions(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/contributions${n}`)}async getCatalogAudit(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/admin/catalog-audit${n}`)}async acknowledgeCatalogAudit(){await this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}async rollbackCatalogEvent(t){return this.request(`/admin/catalog-audit/${t}/rollback`,{method:"POST"})}}const _=new aN;_.getPapers.bind(_);const dO=_.getPaper.bind(_);_.getPaperByArxivId.bind(_);const fO=_.indexPaperFromArxiv.bind(_),hO=_.submitPaper.bind(_),pO=_.updatePaperTasks.bind(_),gO=_.updatePaperMethods.bind(_),mO=_.updatePaperOrganizations.bind(_),vO=_.updatePaperRepositories.bind(_),yO=_.updatePaperProjectPages.bind(_),wO=_.updatePaperSourceUrl.bind(_),xO=_.updatePaperHfArtifacts.bind(_);_.primePaperCurationState.bind(_);_.primeEvaluationCurationState.bind(_);_.getTrendingPapers.bind(_);_.getRepositoriesForPaper.bind(_);_.getRepositories.bind(_);_.getProjectPagesForPaper.bind(_);_.getProjectPages.bind(_);_.getAuthors.bind(_);_.getAuthor.bind(_);_.getAreas.bind(_);_.getArea.bind(_);_.getAreasWithTasks.bind(_);_.getConferences.bind(_);_.getConferenceDeadlines.bind(_);_.getConference.bind(_);_.getConferenceAreasWithTasks.bind(_);_.getConferencePapers.bind(_);const SO=_.getOrganizations.bind(_);_.getOrganization.bind(_);_.getOrganizationContributions.bind(_);_.getOrganizationAreasWithTasks.bind(_);_.getOrganizationPapers.bind(_);_.getAreaTasks.bind(_);const EO=_.getTasks.bind(_),CO=_.getTask.bind(_);_.getTopTasks.bind(_);_.getTrendingTasks.bind(_);_.getTaskChildren.bind(_);_.getTaskParents.bind(_);_.getTaskPage.bind(_);_.getTaskPapers.bind(_);const bO=_.getMethods.bind(_),_O=_.getMethod.bind(_);_.getMethodPapers.bind(_);const PO=_.getDatasets.bind(_),kO=_.getDataset.bind(_);_.getDatasetBySlug.bind(_);_.getDatasetTasks.bind(_);const TO=_.getLeaderboardMetrics.bind(_);_.getEvaluations.bind(_);_.getEvaluation.bind(_);const RO=_.getEvaluationsByPaper.bind(_);_.getEvaluationsByDataset.bind(_);_.createEvaluation.bind(_);_.updateEvaluation.bind(_);_.deleteEvaluation.bind(_);const NO=_.batchEvaluations.bind(_);_.generateThumbnail.bind(_);_.getThumbnailStatus.bind(_);_.getMetrics.bind(_);_.getMetric.bind(_);_.getMetricDirections.bind(_);_.getResearchTrends.bind(_);_.healthCheck.bind(_);_.getMyBookmarkIds.bind(_);_.getMyBookmarks.bind(_);_.addBookmark.bind(_);_.getMyPreferences.bind(_);_.updateMyPreferences.bind(_);const OO=_.submitPendingPaperEdit.bind(_),MO=_.listPendingPaperEdits.bind(_);_.getPendingPaperEdit.bind(_);const AO=_.approvePendingPaperEdit.bind(_),LO=_.rejectPendingPaperEdit.bind(_);_.removeBookmark.bind(_);const lu={hide_closed_source_evals:!1},d0=T.createContext(null),lN=({children:e})=>{const{user:t}=Xd(),[n,r]=T.useState(lu),[o,i]=T.useState(!1);T.useEffect(()=>{let l=!1;if(!t){r(lu);return}return i(!0),_.getMyPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(lu)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[t]);const s=T.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!t)try{const c=await _.updateMyPreferences(u);r(c)}catch{r(n)}},[n,t]),a=T.useMemo(()=>({preferences:n,canPersist:!!t,isLoading:o,setHideClosedSourceEvals:s}),[n,t,o,s]);return g.jsx(d0.Provider,{value:a,children:e})};function jO(){const e=T.useContext(d0);if(!e)throw new Error("usePreferences must be used inside a ");return e}const f0=BE(),uN=f0?sE:iE;if(!f0&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const cN=T.lazy(()=>ie(()=>import("./FeedView-DmnQ8wtZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),dN=T.lazy(()=>ie(()=>import("./ChatView-DdHEqFeP.js"),__vite__mapDeps([16,10,11,17,7,3,4,18,19,20,8,21]))),fN=T.lazy(()=>ie(()=>import("./SharedChatView-BcOQHbFQ.js"),__vite__mapDeps([22,10,11,17,7,3,4,18,19,20]))),hN=T.lazy(()=>ie(()=>import("./PapersListView-Cz1rE6-Q.js"),__vite__mapDeps([23,1,2,3,4,5,9,10,11,12,24,13,6,14,15]))),pN=T.lazy(()=>ie(()=>import("./PaperDetailView-KJONkjMT.js"),__vite__mapDeps([25,10,11,1,2,3,4,5,26,18,27,28,9,12,14,15,29,30,31,32,33,34,35,36,37,38,20]))),gN=T.lazy(()=>ie(()=>import("./TagsIndexView-CdwyuGNP.js"),__vite__mapDeps([39,10,11,5,14,15,40,34,29,31,32,33,35]))),mN=T.lazy(()=>ie(()=>import("./TagBrowseView-BvmWc5Bi.js"),__vite__mapDeps([41,10,11,1,2,3,4,5,42,6,43,19,20,18,9,12,14,15,44,38]))),vN=T.lazy(()=>ie(()=>import("./MethodsIndexView-83TGyPzJ.js"),__vite__mapDeps([45,10,11,46,14,15,40,34,29,31,32,33,35]))),yN=T.lazy(()=>ie(()=>import("./FrameworksIndexView-BcHuX_Fi.js"),__vite__mapDeps([47,10,11,1,2,3,4,5]))),wN=T.lazy(()=>ie(()=>import("./TrendsView-C2z7VhZS.js"),__vite__mapDeps([48,10,11,15,14]))),xN=T.lazy(()=>ie(()=>import("./ConferencesIndexView-gtHHJaQV.js"),__vite__mapDeps([49,10,11,14,15,40,34,29,31,32,33,35]))),SN=T.lazy(()=>ie(()=>import("./AiDeadlinesView-DKoPzbW5.js"),__vite__mapDeps([50,10,11,51,30,14,15,32]))),EN=T.lazy(()=>ie(()=>import("./ConferenceDetailView-BLvSVhvE.js"),__vite__mapDeps([52,10,11,43,3,4,19,20,18,5,14,15]))),CN=T.lazy(()=>ie(()=>import("./ConferenceTaskView-BjcxA6LX.js"),__vite__mapDeps([53,10,11,1,2,3,4,5,6,43,19,20,18,9,12,14,15]))),bN=T.lazy(()=>ie(()=>import("./OrganizationsIndexView-eR9gHXDo.js"),__vite__mapDeps([54,10,11,15,14,55]))),_N=T.lazy(()=>ie(()=>import("./OrganizationDetailView-CX0_k63U.js"),__vite__mapDeps([56,57,10,11,1,2,3,4,5,43,19,20,18,14,6,15,36,29,32,35,9,12,58]))),PN=T.lazy(()=>ie(()=>import("./OrganizationTaskView-KCn9ADD3.js"),__vite__mapDeps([59,57,10,11,1,2,3,4,5,43,19,20,18,14,6,15,36,29,32,35,9,12,58]))),kN=T.lazy(()=>ie(()=>import("./AuthorDetailView-XYwc-69t.js"),__vite__mapDeps([60,10,11,14,58]))),TN=T.lazy(()=>ie(()=>import("./MethodDetailView-BjNLNMvJ.js"),__vite__mapDeps([61,10,11,12,1,2,3,4,5,6,43,19,20,18,46,14,15]))),RN=T.lazy(()=>ie(()=>import("./BenchmarkDetailView-HobUhRD6.js"),__vite__mapDeps([62,10,11,14,51,30,15,2,3,4,26,18,27,42,1,5,63]))),NN=T.lazy(()=>ie(()=>import("./SavedPapersView-DIgZ31F9.js"),__vite__mapDeps([64,10,11,1,2,3,4,5,14,15]))),ON=T.lazy(()=>ie(()=>import("./SettingsView-DzELfroP.js"),__vite__mapDeps([65,10,11,33,51,30,28,21,66]))),MN=T.lazy(()=>ie(()=>import("./SubmitView-CZsQVJqY.js"),__vite__mapDeps([67,33,15,29,31]))),AN=T.lazy(()=>ie(()=>import("./CronDashboard-B5sdItZ8.js"),__vite__mapDeps([68,10,11,37,29,44,69,35,66,33,12,70]))),LN=T.lazy(()=>ie(()=>import("./SubmissionsDashboard-DXt7HV10.js"),__vite__mapDeps([71,11,10,33,69,35]))),jN=T.lazy(()=>ie(()=>import("./ContributionsPage-jUvwayNB.js"),__vite__mapDeps([72,12,11,29]))),Cp=T.lazy(()=>ie(()=>import("./NotFound-bD49ZyM9.js"),[])),IN=T.lazy(()=>ie(()=>import("./SearchOverlay-CZcmEWhv.js"),__vite__mapDeps([73,10,11,2,3,4,24,5]))),DN=()=>g.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),g.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),$N=new FE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),FN=()=>{const{arxivId:e}=nv();return g.jsx(ko,{to:e?`/paper/${e}`:"/papers",replace:!0})},zN=()=>{const{taskSlug:e}=nv();return g.jsx(ko,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},uu=({element:e})=>qi()?g.jsx(ko,{to:"/",replace:!0}):g.jsx(g.Fragment,{children:e}),UN=({element:e})=>{const{user:t,isLoading:n}=Xd();return qi()?g.jsx(ko,{to:"/",replace:!0}):n?g.jsx("div",{className:"page",children:g.jsx("div",{className:"submission-loading",children:g.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?g.jsx(g.Fragment,{children:e}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Admin access required"}),g.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Sign in required"}),g.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),g.jsx(wv,{returnTo:"/admin-dashboard"})]})})},BN=()=>{const e=UE(),t=typeof window<"u"&&new URL(e,window.location.origin).origin!==window.location.origin;return T.useEffect(()=>{t&&window.location.replace(e)},[e,t]),t?g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-loading",children:[g.jsx("span",{children:"Opening the production admin dashboard..."}),g.jsx("a",{href:e,children:"Continue"})]})}):g.jsx(UN,{element:g.jsx(AN,{})})},VN=()=>{const[e,t]=T.useState(!1);return tN(),T.useLayoutEffect(()=>{var n;(n=document.getElementById("initial-discovery-footer"))==null||n.remove()},[]),T.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="k"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),g.jsxs(g.Fragment,{children:[g.jsx(kT,{onOpenSearch:()=>t(!0)}),g.jsx("main",{children:g.jsx(T.Suspense,{fallback:g.jsx(DN,{}),children:g.jsxs(Y1,{children:[g.jsx(ne,{path:"/",element:g.jsx(cN,{})}),g.jsx(ne,{path:"/chat/:sessionId?",element:xa()?g.jsx(dN,{}):g.jsx(ko,{to:"/",replace:!0})}),g.jsx(ne,{path:"/share/:shareId",element:xa()?g.jsx(fN,{}):g.jsx(Cp,{})}),g.jsx(ne,{path:"/papers",element:g.jsx(hN,{})}),g.jsx(ne,{path:"/papers/:arxivId",element:g.jsx(FN,{})}),g.jsx(ne,{path:"/paper/:arxivId",element:g.jsx(pN,{})}),g.jsx(ne,{path:"/tasks",element:g.jsx(gN,{})}),g.jsx(ne,{path:"/tasks/:taskSlug",element:g.jsx(mN,{})}),g.jsx(ne,{path:"/task/:taskSlug",element:g.jsx(zN,{})}),g.jsx(ne,{path:"/methods",element:g.jsx(vN,{})}),g.jsx(ne,{path:"/methods/:methodSlug",element:g.jsx(TN,{})}),g.jsx(ne,{path:"/frameworks",element:g.jsx(yN,{})}),g.jsx(ne,{path:"/trends",element:g.jsx(wN,{})}),g.jsx(ne,{path:"/conferences",element:g.jsx(xN,{})}),g.jsx(ne,{path:"/ai-deadlines",element:g.jsx(SN,{})}),g.jsx(ne,{path:"/conferences/:confSlug",element:g.jsx(EN,{})}),g.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:g.jsx(CN,{})}),g.jsx(ne,{path:"/organizations",element:g.jsx(bN,{})}),g.jsx(ne,{path:"/orgs/:orgSlug",element:g.jsx(_N,{})}),g.jsx(ne,{path:"/orgs/:orgSlug/:taskSlug",element:g.jsx(PN,{})}),g.jsx(ne,{path:"/authors/:authorId",element:g.jsx(kN,{})}),g.jsx(ne,{path:"/benchmark/:datasetSlug",element:g.jsx(RN,{})}),g.jsx(ne,{path:"/submit",element:g.jsx(MN,{})}),g.jsx(ne,{path:"/saved",element:g.jsx(uu,{element:g.jsx(NN,{})})}),g.jsx(ne,{path:"/settings",element:g.jsx(ON,{})}),g.jsx(ne,{path:"/admin-dashboard",element:g.jsx(BN,{})}),g.jsx(ne,{path:"/cron-dashboard",element:g.jsx(ko,{to:"/admin-dashboard",replace:!0})}),g.jsx(ne,{path:"/submissions",element:g.jsx(uu,{element:g.jsx(LN,{})})}),g.jsx(ne,{path:"/contributions",element:g.jsx(uu,{element:g.jsx(jN,{})})}),g.jsx(ne,{path:"*",element:g.jsx(Cp,{})})]})})}),e&&g.jsx(T.Suspense,{fallback:null,children:g.jsx(IN,{open:e,onClose:()=>t(!1)})})]})},WN=()=>g.jsx(zE,{client:$N,children:g.jsx(CT,{children:g.jsx(lN,{children:g.jsxs(ZR,{children:[g.jsx(uN,{children:g.jsx(VN,{})}),g.jsx(iR,{}),g.jsx(AR,{}),!1]})})})});s1();const HN=Km(document.getElementById("root"));HN.render(g.jsx(T.StrictMode,{children:g.jsx(ZS,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:g.jsx(o1,{children:g.jsx(WN,{})})})}));export{gT as $,Ta as A,bO as B,cT as C,vO as D,yO as E,wO as F,PO as G,NO as H,TO as I,xO as J,mO as K,Cn as L,SO as M,qi as N,Vv as O,Tr as P,oP as Q,T as R,iP as S,xy as T,fT as U,cO as V,Xa as W,hT as X,oO as Y,jO as Z,pT as _,GN as a,Tw as a0,It as a1,tO as a2,iO as a3,fO as a4,hc as a5,vt as a6,Ld as a7,Sv as a8,tR as a9,_O as aA,kO as aB,zv as aC,Uv as aD,Bv as aE,AO as aF,LO as aG,MO as aH,Mi as aI,IE as aJ,XN as aK,ZN as aL,JN as aM,rO as aN,hn as aO,kE as aP,xE as aQ,ac as aR,fv as aS,yE as aT,wE as aU,sc as aV,uv as aW,LE as aX,CE as aY,wv as aa,Pr as ab,V_ as ac,my as ad,rl as ae,Vd as af,gP as ag,Ay as ah,xb as ai,Kv as aj,Ja as ak,vy as al,yy as am,sO as an,YN as ao,dO as ap,KN as aq,Ap as ar,JS as as,hO as at,Ya as au,Ue as av,QN as aw,cv as ax,_t as ay,CO as az,_ as b,ll as c,io as d,nv as e,Xd as f,AT as g,eO as h,xa as i,g as j,WE as k,nO as l,RO as m,ve as n,Md as o,Re as p,V as q,f as r,I_ as s,kr as t,_d as u,Ne as v,OO as w,pO as x,EO as y,gO as z}; +`);function ks(e){return e.label!==void 0}var ER=3,CR="32px",bR="16px",wp=4e3,_R=356,PR=14,kR=20,TR=200;function Ct(...e){return e.filter(Boolean).join(" ")}function RR(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var NR=e=>{var t,n,r,o,i,s,a,l,u,c,d;let{invert:p,toast:h,unstyled:E,interacting:y,setHeights:x,visibleToasts:v,heights:m,index:w,toasts:S,expanded:C,removeToast:b,defaultRichColors:P,closeButton:R,style:L,cancelButtonStyle:A,actionButtonStyle:z,className:D="",descriptionClassName:q="",duration:I,position:Y,gap:U,loadingIcon:H,expandByDefault:O,classNames:k,icons:j,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:F}=e,[G,X]=T.useState(null),[fe,ye]=T.useState(null),[J,Gt]=T.useState(!1),[_e,Lt]=T.useState(!1),[gn,Or]=T.useState(!1),[mn,Ji]=T.useState(!1),[hl,Zi]=T.useState(!1),[pl,$o]=T.useState(0),[Mr,nf]=T.useState(0),Fo=T.useRef(h.duration||I||wp),rf=T.useRef(null),tr=T.useRef(null),h0=w===0,p0=w+1<=v,lt=h.type,Ar=h.dismissible!==!1,g0=h.className||"",m0=h.descriptionClassName||"",es=T.useMemo(()=>m.findIndex(K=>K.toastId===h.id)||0,[m,h.id]),v0=T.useMemo(()=>{var K;return(K=h.closeButton)!=null?K:R},[h.closeButton,R]),of=T.useMemo(()=>h.duration||I||wp,[h.duration,I]),gl=T.useRef(0),Lr=T.useRef(0),sf=T.useRef(0),jr=T.useRef(null),[y0,w0]=Y.split("-"),af=T.useMemo(()=>m.reduce((K,oe,ce)=>ce>=es?K:K+oe.height,0),[m,es]),lf=pR(),x0=h.invert||p,ml=lt==="loading";Lr.current=T.useMemo(()=>es*U+af,[es,af]),T.useEffect(()=>{Fo.current=of},[of]),T.useEffect(()=>{Gt(!0)},[]),T.useEffect(()=>{let K=tr.current;if(K){let oe=K.getBoundingClientRect().height;return nf(oe),x(ce=>[{toastId:h.id,height:oe,position:h.position},...ce]),()=>x(ce=>ce.filter(yt=>yt.toastId!==h.id))}},[x,h.id]),T.useLayoutEffect(()=>{if(!J)return;let K=tr.current,oe=K.style.height;K.style.height="auto";let ce=K.getBoundingClientRect().height;K.style.height=oe,nf(ce),x(yt=>yt.find(wt=>wt.toastId===h.id)?yt.map(wt=>wt.toastId===h.id?{...wt,height:ce}:wt):[{toastId:h.id,height:ce,position:h.position},...yt])},[J,h.title,h.description,x,h.id]);let vn=T.useCallback(()=>{Lt(!0),$o(Lr.current),x(K=>K.filter(oe=>oe.toastId!==h.id)),setTimeout(()=>{b(h)},TR)},[h,b,x,Lr]);T.useEffect(()=>{if(h.promise&<==="loading"||h.duration===1/0||h.type==="loading")return;let K;return C||y||F&&lf?(()=>{if(sf.current{var oe;(oe=h.onAutoClose)==null||oe.call(h,h),vn()},Fo.current)),()=>clearTimeout(K)},[C,y,h,lt,F,lf,vn]),T.useEffect(()=>{h.delete&&vn()},[vn,h.delete]);function S0(){var K,oe,ce;return j!=null&&j.loading?T.createElement("div",{className:Ct(k==null?void 0:k.loader,(K=h==null?void 0:h.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":lt==="loading"},j.loading):H?T.createElement("div",{className:Ct(k==null?void 0:k.loader,(oe=h==null?void 0:h.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":lt==="loading"},H):T.createElement(lR,{className:Ct(k==null?void 0:k.loader,(ce=h==null?void 0:h.classNames)==null?void 0:ce.loader),visible:lt==="loading"})}return T.createElement("li",{tabIndex:0,ref:tr,className:Ct(D,g0,k==null?void 0:k.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[lt],(n=h==null?void 0:h.classNames)==null?void 0:n[lt]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:P,"data-styled":!(h.jsx||h.unstyled||E),"data-mounted":J,"data-promise":!!h.promise,"data-swiped":hl,"data-removed":_e,"data-visible":p0,"data-y-position":y0,"data-x-position":w0,"data-index":w,"data-front":h0,"data-swiping":gn,"data-dismissible":Ar,"data-type":lt,"data-invert":x0,"data-swipe-out":mn,"data-swipe-direction":fe,"data-expanded":!!(C||O&&J),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${_e?pl:Lr.current}px`,"--initial-height":O?"auto":`${Mr}px`,...L,...h.style},onDragEnd:()=>{Or(!1),X(null),jr.current=null},onPointerDown:K=>{ml||!Ar||(rf.current=new Date,$o(Lr.current),K.target.setPointerCapture(K.pointerId),K.target.tagName!=="BUTTON"&&(Or(!0),jr.current={x:K.clientX,y:K.clientY}))},onPointerUp:()=>{var K,oe,ce,yt;if(mn||!Ar)return;jr.current=null;let wt=Number(((K=tr.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),yn=Number(((oe=tr.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nr=new Date().getTime()-((ce=rf.current)==null?void 0:ce.getTime()),xt=G==="x"?wt:yn,wn=Math.abs(xt)/nr;if(Math.abs(xt)>=kR||wn>.11){$o(Lr.current),(yt=h.onDismiss)==null||yt.call(h,h),ye(G==="x"?wt>0?"right":"left":yn>0?"down":"up"),vn(),Ji(!0),Zi(!1);return}Or(!1),X(null)},onPointerMove:K=>{var oe,ce,yt,wt;if(!jr.current||!Ar||((oe=window.getSelection())==null?void 0:oe.toString().length)>0)return;let yn=K.clientY-jr.current.y,nr=K.clientX-jr.current.x,xt=(ce=e.swipeDirections)!=null?ce:RR(Y);!G&&(Math.abs(nr)>1||Math.abs(yn)>1)&&X(Math.abs(nr)>Math.abs(yn)?"x":"y");let wn={x:0,y:0};G==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&yn<0||xt.includes("bottom")&&yn>0)&&(wn.y=yn):G==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&nr<0||xt.includes("right")&&nr>0)&&(wn.x=nr),(Math.abs(wn.x)>0||Math.abs(wn.y)>0)&&Zi(!0),(yt=tr.current)==null||yt.style.setProperty("--swipe-amount-x",`${wn.x}px`),(wt=tr.current)==null||wt.style.setProperty("--swipe-amount-y",`${wn.y}px`)}},v0&&!h.jsx?T.createElement("button",{"aria-label":B,"data-disabled":ml,"data-close-button":!0,onClick:ml||!Ar?()=>{}:()=>{var K;vn(),(K=h.onDismiss)==null||K.call(h,h)},className:Ct(k==null?void 0:k.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(i=j==null?void 0:j.close)!=null?i:hR):null,h.jsx||f.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:T.createElement(T.Fragment,null,lt||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:Ct(k==null?void 0:k.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||S0():null,h.type!=="loading"?h.icon||(j==null?void 0:j[lt])||sR(lt):null):null,T.createElement("div",{"data-content":"",className:Ct(k==null?void 0:k.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:Ct(k==null?void 0:k.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?T.createElement("div",{"data-description":"",className:Ct(q,m0,k==null?void 0:k.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),f.isValidElement(h.cancel)?h.cancel:h.cancel&&ks(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||A,onClick:K=>{var oe,ce;ks(h.cancel)&&Ar&&((ce=(oe=h.cancel).onClick)==null||ce.call(oe,K),vn())},className:Ct(k==null?void 0:k.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,f.isValidElement(h.action)?h.action:h.action&&ks(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||z,onClick:K=>{var oe,ce;ks(h.action)&&((ce=(oe=h.action).onClick)==null||ce.call(oe,K),!K.defaultPrevented&&vn())},className:Ct(k==null?void 0:k.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function xp(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function OR(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?bR:CR;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${s}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${s}-${u}`]=a:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var MR=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:p,style:h,visibleToasts:E=ER,toastOptions:y,dir:x=xp(),gap:v=PR,loadingIcon:m,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=e,[b,P]=T.useState([]),R=T.useMemo(()=>Array.from(new Set([r].concat(b.filter(F=>F.position).map(F=>F.position)))),[b,r]),[L,A]=T.useState([]),[z,D]=T.useState(!1),[q,I]=T.useState(!1),[Y,U]=T.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=T.useRef(null),O=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=T.useRef(null),j=T.useRef(!1),B=T.useCallback(F=>{P(G=>{var X;return(X=G.find(fe=>fe.id===F.id))!=null&&X.delete||qe.dismiss(F.id),G.filter(({id:fe})=>fe!==F.id)})},[]);return T.useEffect(()=>qe.subscribe(F=>{if(F.dismiss){P(G=>G.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{qm.flushSync(()=>{P(G=>{let X=G.findIndex(fe=>fe.id===F.id);return X!==-1?[...G.slice(0,X),{...G[X],...F},...G.slice(X+1)]:[F,...G]})})})}),[]),T.useEffect(()=>{if(c!=="system"){U(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:G})=>{U(G?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{U(X?"dark":"light")}catch(fe){console.error(fe)}})}},[c]),T.useEffect(()=>{b.length<=1&&D(!1)},[b]),T.useEffect(()=>{let F=G=>{var X,fe;o.every(ye=>G[ye]||G.code===ye)&&(D(!0),(X=H.current)==null||X.focus()),G.code==="Escape"&&(document.activeElement===H.current||(fe=H.current)!=null&&fe.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),T.useEffect(()=>{if(H.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,j.current=!1)}},[H.current]),T.createElement("section",{ref:t,"aria-label":`${S} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,G)=>{var X;let[fe,ye]=F.split("-");return b.length?T.createElement("ol",{key:F,dir:x==="auto"?xp():x,tabIndex:-1,ref:H,className:a,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":fe,"data-lifted":z&&b.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((X=L[0])==null?void 0:X.height)||0}px`,"--width":`${_R}px`,"--gap":`${v}px`,...h,...OR(l,u)},onBlur:J=>{j.current&&!J.currentTarget.contains(J.relatedTarget)&&(j.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||j.current||(j.current=!0,k.current=J.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{q||D(!1)},onDragEnd:()=>D(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},b.filter(J=>!J.position&&G===0||J.position===F).map((J,Gt)=>{var _e,Lt;return T.createElement(NR,{key:J.id,icons:w,index:Gt,toast:J,defaultRichColors:d,duration:(_e=y==null?void 0:y.duration)!=null?_e:p,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:E,closeButton:(Lt=y==null?void 0:y.closeButton)!=null?Lt:s,interacting:q,position:F,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:B,toasts:b.filter(gn=>gn.position==J.position),heights:L.filter(gn=>gn.position==J.position),setHeights:A,expandByDefault:i,gap:v,loadingIcon:m,expanded:z,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const AR=({...e})=>{const{theme:t="system"}=JS();return g.jsx(MR,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var LR=Symbol("radix.slottable");function jR(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=LR,t}var[dl]=kr("Tooltip",[rl]),tf=rl(),t0="TooltipProvider",IR=700,Sp="tooltip.open",[DR,n0]=dl(t0),r0=e=>{const{__scopeTooltip:t,delayDuration:n=IR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(DR,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};r0.displayName=t0;var o0="Tooltip",[lO,fl]=dl(o0),_c="TooltipTrigger",$R=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=fl(_c,n),i=n0(_c,n),s=tf(n),a=f.useRef(null),l=Re(t,a,o.onTriggerChange),u=f.useRef(!1),c=f.useRef(!1),d=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(my,{asChild:!0,...s,children:g.jsx(ve.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:V(e.onPointerMove,p=>{p.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),c.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})});$R.displayName=_c;var FR="TooltipPortal",[uO,zR]=dl(FR,{forceMount:void 0}),No="TooltipContent",i0=f.forwardRef((e,t)=>{const n=zR(No,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=fl(No,e.__scopeTooltip);return g.jsx(Tr,{present:r||s.open,children:s.disableHoverableContent?g.jsx(s0,{side:o,...i,ref:t}):g.jsx(UR,{side:o,...i,ref:t})})}),UR=f.forwardRef((e,t)=>{const n=fl(No,e.__scopeTooltip),r=n0(No,e.__scopeTooltip),o=f.useRef(null),i=Re(t,o),[s,a]=f.useState(null),{trigger:l,onClose:u}=n,c=o.current,{onPointerInTransitChange:d}=r,p=f.useCallback(()=>{a(null),d(!1)},[d]),h=f.useCallback((E,y)=>{const x=E.currentTarget,v={x:E.clientX,y:E.clientY},m=qR(v,x.getBoundingClientRect()),w=KR(v,m),S=GR(y.getBoundingClientRect()),C=YR([...w,...S]);a(C),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(l&&c){const E=x=>h(x,c),y=x=>h(x,l);return l.addEventListener("pointerleave",E),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",E),c.removeEventListener("pointerleave",y)}}},[l,c,h,p]),f.useEffect(()=>{if(s){const E=y=>{const x=y.target,v={x:y.clientX,y:y.clientY},m=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),w=!QR(v,s);m?p():w&&(p(),u())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[l,c,s,u,p]),g.jsx(s0,{...e,ref:i})}),[BR,VR]=dl(o0,{isInside:!1}),WR=jR("TooltipContent"),s0=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=fl(No,n),u=tf(n),{onClose:c}=l;return f.useEffect(()=>(document.addEventListener(Sp,c),()=>document.removeEventListener(Sp,c)),[c]),f.useEffect(()=>{if(l.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),g.jsx(Ja,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:g.jsxs(vy,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(WR,{children:r}),g.jsx(BR,{scope:n,isInside:!0,children:g.jsx(IT,{id:l.contentId,role:"tooltip",children:o||r})})]})})});i0.displayName=No;var a0="TooltipArrow",HR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=tf(n);return VR(a0,n).isInside?null:g.jsx(yy,{...o,...r,ref:t})});HR.displayName=a0;function qR(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function KR(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function GR(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function QR(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=p>r&&n<(d-u)*(r-c)/(p-c)+u&&(o=!o)}return o}function YR(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),XR(t)}function XR(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var JR=r0,l0=i0;const ZR=JR,eN=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(l0,{ref:r,sideOffset:t,className:Ne("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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),...n}));eN.displayName=l0.displayName;function tN(){const{pathname:e,hash:t}=hn();f.useEffect(()=>{t||window.scrollTo(0,0)},[e,t])}const nN="cronAdminToken";function rN(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(nN))==null?void 0:e.trim())??""}const Ep=!1;class Ta extends Error{constructor(n,r){var o;super(`API request failed: ${n.status} ${n.statusText}`);St(this,"status");St(this,"statusText");St(this,"response");St(this,"detail");St(this,"code");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{this.detail=(o=JSON.parse(r))==null?void 0:o.detail,typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code)}catch{this.detail=void 0}}}async function u0(e,t,n){const r=`${e}${t}`;try{const{headers:o,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=rN(),u=new Headers(o);u.has("Content-Type")||u.set("Content-Type","application/json"),l&&!u.has("X-Admin-Token")&&u.set("X-Admin-Token",l);const c=await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:u});if(!c.ok){const p=new Ta(c,await c.text());throw console.error("[API] Error response:",p.response),p}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${r} failed:`,o),o}}async function oN(e){try{return await e()}catch(t){throw t instanceof Ta&&t.status===401&&t.code!=="fresh_auth_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale")),t}}function iN(e){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",e);const t=Xa("/api/v1/auth/hf/login");window.location.assign(`${t}?return_to=${encodeURIComponent(window.location.href)}`)}class sN{constructor(t,n=iN){St(this,"paperLoads",new Map);St(this,"evaluationLoads",new Map);this.request=t,this.recoverFreshAuth=n}primePaper(t,n=!1){n&&this.paperLoads.delete(t);let r=this.paperLoads.get(t);return r||(r=this.request(`/papers/${t}/curation-state`).catch(o=>{throw this.paperLoads.delete(t),o}),this.paperLoads.set(t,r)),r}primeEvaluations(t,n=!1){n&&this.evaluationLoads.delete(t);let r=this.evaluationLoads.get(t);return r||(r=this.request(`/evaluations/curation-state?paper_id=${t}`).catch(o=>{throw this.evaluationLoads.delete(t),o}),this.evaluationLoads.set(t,r)),r}async mutatePaper(t,n,r,o,i){const s=this.paperLoads.get(t);if(!s)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const a=(await s).sections[n];if(!a)throw new Error(`Missing curation version for ${n}`);return this.mutate(n,o,r,a,i,`paper:${t}:${n}`)}async mutateEvaluations(t,n,r,o){const i=this.evaluationLoads.get(String(t));if(!i)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const s=(await i).version;return this.mutate("evaluations",r,n,s,o,`paper:${t}:evaluations`)}async mutate(t,n,r,o,i,s){const a=new Headers(i.headers);Object.entries(this.idempotencyHeaders(s,r,o)).forEach(([u,c])=>a.set(u,c));const l={...i,headers:a};try{const u=await this.request(n,l);return this.clearAttempt(l),u}catch(u){throw u instanceof Ta&&u.status===401&&u.code==="fresh_auth_required"?this.recoverFreshAuth(t):u instanceof Ta&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:n}}))),u}}idempotencyHeaders(t,n,r){const o=`pwc:mutation:${t}:${JSON.stringify(n)}`,i=sessionStorage.getItem(o);if(i){const a=JSON.parse(i);return{"Idempotency-Key":a.key,"If-Match":a.version}}const s=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:s,version:r})),sessionStorage.setItem(`pwc:mutation-key:${s}`,o),{"Idempotency-Key":s,"If-Match":r}}clearAttempt(t){const n=new Headers(t.headers).get("Idempotency-Key");if(!n)return;const r=sessionStorage.getItem(`pwc:mutation-key:${n}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${n}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const c0=`${Td()}/api/v1`;async function cO(e,t){return u0(c0,`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}class aN{constructor(t=c0){St(this,"baseUrl");St(this,"curation");this.baseUrl=t,this.curation=new sN((n,r)=>this.request(n,r))}async request(t,n){return oN(()=>u0(this.baseUrl,t,n))}async getPapers(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir),t!=null&&t.time&&n.append("time",t.time),t!=null&&t.published_after&&n.append("published_after",t.published_after),t!=null&&t.published_before&&n.append("published_before",t.published_before),t!=null&&t.conference&&n.append("conference",t.conference),(t==null?void 0:t.latest_only)!==void 0&&n.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&n.append("include_resources",t.include_resources.toString()),(t==null?void 0:t.has_code)!==void 0&&n.append("has_code",t.has_code.toString()),(t==null?void 0:t.has_hf_artifacts)!==void 0&&n.append("has_hf_artifacts",t.has_hf_artifacts.toString()),t!=null&&t.framework&&n.append("framework",t.framework),t!=null&&t.repository&&n.append("repository",t.repository);const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(t,n=1,r=10,o){const i=new URLSearchParams;return i.append("q",t),i.append("page",n.toString()),i.append("page_size",r.toString()),o&&i.append("mode",o),this.request(`/papers/search?${i.toString()}`)}async getPaper(t,n=!0){const r=`/papers/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getPaperByArxivId(t,n=!0){const r=`/papers/arxiv/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getRelatedPapers(t,n=4){const r=new URLSearchParams({limit:n.toString()});return this.request(`/papers/${encodeURIComponent(t)}/related?${r.toString()}`)}async indexPaperFromArxiv(t){const n=`/papers/index/${t}`;return this.request(n,{method:"POST"})}async submitPaper(t){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(t)})}primePaperCurationState(t,n=!1){return this.curation.primePaper(t,n)}primeEvaluationCurationState(t,n=!1){return this.curation.primeEvaluations(t,n)}async updatePaperTasks(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("task_ids",i.toString()));const o=`/papers/${t}/tasks?${r.toString()}`;return this.curation.mutatePaper(t,"tasks",n,o,{method:"PUT"})}async updatePaperMethods(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("method_ids",i.toString()));const o=`/papers/${t}/methods?${r.toString()}`;return this.curation.mutatePaper(t,"methods",n,o,{method:"PUT"})}async updatePaperOrganizations(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("organization_ids",i.toString()));const o=`/papers/${t}/organizations?${r.toString()}`;return this.curation.mutatePaper(t,"organizations",n,o,{method:"PUT"})}async updatePaperRepositories(t,n){const r=`/papers/${t}/repositories`;return this.curation.mutatePaper(t,"repositories",n,r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(t,n){const r=`/papers/${t}/project-pages`;return this.curation.mutatePaper(t,"project_pages",n,r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(t,n){const r=`/papers/${t}/source-url`;return this.curation.mutatePaper(t,"source_url",n,r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(t,n){const r=`/papers/${t}/hf-artifacts`;return this.curation.mutatePaper(t,"hf_artifacts",n,r,{method:"PUT",body:JSON.stringify(n)})}async getTrendingPapers(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.max_age_days&&n.append("max_age_days",t.max_age_days.toString()),(t==null?void 0:t.min_velocity)!==void 0&&n.append("min_velocity",t.min_velocity.toString());const r=`/papers/trending${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getRepositoriesForPaper(t){return this.request(`/papers/${t}/repositories`)}async getRepositories(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.owner&&n.append("owner",t.owner),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.min_stars&&n.append("min_stars",t.min_stars.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/repositories/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getProjectPagesForPaper(t){return this.request(`/papers/${t}/project-pages`)}async getProjectPages(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/project-pages/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthors(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.sort_by&&n.append("sort_by",t.sort_by),t!=null&&t.sort_order&&n.append("sort_order",t.sort_order);const r=`/authors${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthor(t){return this.request(`/authors/${t}`)}async getAuthorPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=r.toString();return this.request(`/authors/${t}/papers${o?`?${o}`:""}`)}async getAreas(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/areas/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getArea(t){return this.request(`/areas/${t}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getConferences(){return this.request("/conferences/")}async getConferenceDeadlines(){return this.request("/conferences/deadlines")}async getConference(t){return this.request(`/conferences/${t}`)}async getConferenceAreasWithTasks(t){return this.request(`/conferences/${t}/areas-with-tasks`)}async getConferencePapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.presentation&&r.append("presentation",n.presentation),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/conferences/${t}/papers?${o}`:`/conferences/${t}/papers`;return this.request(i)}async getOrganizations(t=!1){return this.request(`/organizations/${t?"?featured_only=true":""}`)}async getOrganization(t){return this.request(`/organizations/${t}`)}async getOrganizationContributions(t){return this.request(`/organizations/${t}/contributions`)}async getOrganizationAreasWithTasks(t){return this.request(`/organizations/${t}/areas-with-tasks`)}async getOrganizationPapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/organizations/${t}/papers?${o}`:`/organizations/${t}/papers`;return this.request(i)}async getAreaTasks(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/areas/${t}/tasks${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTasks(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.area_id&&n.append("area_id",t.area_id.toString()),t!=null&&t.parent_id&&n.append("parent_id",t.parent_id.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/tasks/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getTask(t){return this.request(`/tasks/${t}`)}async getFrameworkCatalog(){return this.request("/frameworks/")}async getTopTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString());const r=n.toString(),o=r?`/tasks/top?${r}`:"/tasks/top";return this.request(o)}async getTrendingTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.recent_days&&n.append("recent_days",t.recent_days.toString()),t!=null&&t.baseline_days&&n.append("baseline_days",t.baseline_days.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),(t==null?void 0:t.min_recent_papers)!==void 0&&n.append("min_recent_papers",t.min_recent_papers.toString()),(t==null?void 0:t.min_baseline_papers)!==void 0&&n.append("min_baseline_papers",t.min_baseline_papers.toString()),(t==null?void 0:t.min_share_lift)!==void 0&&n.append("min_share_lift",t.min_share_lift.toString());const r=n.toString(),o=r?`/tasks/trending?${r}`:"/tasks/trending";return this.request(o)}async getTaskChildren(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/tasks/${t}/children${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTaskParents(t){return this.request(`/tasks/${t}/parents`)}async getTaskPage(t,n){const r=new URLSearchParams;(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=`/tasks/${t}/page${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTrendingBenchmarks(t,n){const r=new URLSearchParams;(n==null?void 0:n.limit)!==void 0&&r.append("limit",n.limit.toString()),(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.min_recent_papers)!==void 0&&r.append("min_recent_papers",n.min_recent_papers.toString()),(n==null?void 0:n.include_descendants)!==void 0&&r.append("include_descendants",n.include_descendants.toString()),(n==null?void 0:n.bucket_days)!==void 0&&r.append("bucket_days",n.bucket_days.toString()),(n==null?void 0:n.history_buckets)!==void 0&&r.append("history_buckets",n.history_buckets.toString()),(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=r.toString(),i=`/tasks/${encodeURIComponent(t)}/trending-benchmarks${o?`?${o}`:""}`;return this.request(i)}async getTaskPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.toString());const o=r.toString(),i=o?`/tasks/${t}/papers?${o}`:`/tasks/${t}/papers`;return this.request(i)}async getMethods(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.introduced_year&&n.append("introduced_year",t.introduced_year.toString()),(t==null?void 0:t.area_id)!==void 0&&n.append("area_id",t.area_id.toString()),(t==null?void 0:t.exclude_id)!==void 0&&n.append("exclude_id",t.exclude_id.toString()),(t==null?void 0:t.include_trends)!==void 0&&n.append("include_trends",t.include_trends.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/methods/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMethod(t){return this.request(`/methods/${encodeURIComponent(t)}`)}async getMethodTrend(t,n){const r=new URLSearchParams;(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.history_months)!==void 0&&r.append("history_months",n.history_months.toString());const o=r.toString();return this.request(`/methods/${encodeURIComponent(t)}/trend${o?`?${o}`:""}`)}async getMethodPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.toString());const o=r.toString(),i=o?`/methods/${encodeURIComponent(t)}/papers?${o}`:`/methods/${encodeURIComponent(t)}/papers`;return this.request(i)}async getDatasets(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.task&&n.append("task",t.task),t!=null&&t.task_id&&n.append("task",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),(t==null?void 0:t.min_eval_count)!==void 0&&n.append("min_eval_count",t.min_eval_count.toString()),(t==null?void 0:t.is_open)!==void 0&&n.append("is_open",t.is_open.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/datasets/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getDataset(t){return this.request(`/datasets/${t}`)}async getDatasetBySlug(t,n){const r=new URLSearchParams;n!=null&&n.include_paper&&r.set("include_paper","true"),n!=null&&n.task&&r.set("task",n.task),(n==null?void 0:n.is_open)!==void 0&&r.set("is_open",String(n.is_open));const o=r.size?`?${r.toString()}`:"";return this.request(`/datasets/${t}${o}`)}async getDatasetTasks(t){return(await this.request(`/datasets/${t}/tasks/`)).results}async getLeaderboardMetrics(t,n){return(await this.request(`/datasets/${t}/tasks/${n}/metrics`)).metrics}async getEvaluations(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.task_id&&n.append("task_id",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),t!=null&&t.dataset_id&&n.append("dataset_id",t.dataset_id.toString()),t!=null&&t.best_metric&&n.append("best_metric",t.best_metric),(t==null?void 0:t.external)!==void 0&&n.append("external",String(t.external)),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/evaluations/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getEvaluation(t){return this.request(`/evaluations/${t}`)}async getEvaluationsByPaper(t){const r=parseInt(t),o=await this.getEvaluations({paper_id:r,page_size:100,ordering:"-benchmark_popularity"}),i=[...o.results];let s=o.next_page;for(;s;){const a=await this.getEvaluations({paper_id:r,page:s,page_size:100,ordering:"-benchmark_popularity"});i.push(...a.results),s=a.next_page}return i}async getEvaluationsByDataset(t,n){const o=parseInt(t),i=await this.getEvaluations({dataset_id:o,best_metric:n,page_size:100,ordering:"best_rank"}),s=[...i.results];let a=i.next_page;for(;a;){const l=await this.getEvaluations({dataset_id:o,best_metric:n,page:a,page_size:100,ordering:"best_rank"});s.push(...l.results),a=l.next_page}return s}async createEvaluation(t){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(t)})}async updateEvaluation(t,n){const r=`/evaluations/${t}`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async deleteEvaluation(t){const n=`/evaluations/${t}`;return this.request(n,{method:"DELETE"})}async batchEvaluations(t,n){return this.curation.mutateEvaluations(t,n,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:t,operations:n})})}async generateThumbnail(t){const n=io(`/api/thumbnails/generate/${t}`),r=await fetch(n,{method:"POST"});if(!r.ok)throw new Error(`Thumbnail generation failed: ${r.status}`);return await r.json()}async getThumbnailStatus(t){const n=io(`/api/thumbnails/status/${t}`),r=await fetch(n);if(!r.ok)throw new Error(`Thumbnail status check failed: ${r.status}`);return await r.json()}async healthCheck(){const t=io("/health"),n=await fetch(t);if(!n.ok)throw new Error(`Health check failed: ${n.status}`);return await n.json()}async getMetrics(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.direction&&n.append("direction",t.direction),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/metrics/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMetric(t){return this.request(`/metrics/${t}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(t){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(t)})}async listPendingPaperEdits(t){const n=new URLSearchParams;t!=null&&t.status&&n.append("status",t.status),t!=null&&t.edit_type&&n.append("edit_type",t.edit_type),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString());const r=`/admin/paper-edits${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getPendingPaperEdit(t){return this.request(`/admin/paper-edits/${t}`)}async approvePendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/approve`,{method:"POST",body:JSON.stringify(n??{})})}async rejectPendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/reject`,{method:"POST",body:JSON.stringify(n??{})})}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"POST"})}async removeBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"DELETE"})}async getMyPreferences(){return this.request("/me/preferences")}async updateMyPreferences(t){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(t)})}async getOpenRouterUsage(){return this.request("/chat/usage",{cache:"no-store"})}async getChatAvailability(){return this.request("/chat/availability",{cache:"no-store"})}async getChatSandboxSpend(t){const n=t?`?environment=${encodeURIComponent(t)}`:"";return this.request(`/chat/admin/sandbox-spend${n}`,{cache:"no-store"})}async getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}async connectOpenRouterCredential(t){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:t})})}async setOpenRouterFallback(t){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:t})})}async disconnectOpenRouterCredential(){await this.request("/chat/openrouter-key",{method:"DELETE"})}async getCronStatus(){return this.request("/cron/status",{cache:"no-store"})}async getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}async getMyContributions(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/contributions${n}`)}async getCatalogAudit(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/admin/catalog-audit${n}`)}async acknowledgeCatalogAudit(){await this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}async rollbackCatalogEvent(t){return this.request(`/admin/catalog-audit/${t}/rollback`,{method:"POST"})}}const _=new aN;_.getPapers.bind(_);const dO=_.getPaper.bind(_);_.getPaperByArxivId.bind(_);const fO=_.indexPaperFromArxiv.bind(_),hO=_.submitPaper.bind(_),pO=_.updatePaperTasks.bind(_),gO=_.updatePaperMethods.bind(_),mO=_.updatePaperOrganizations.bind(_),vO=_.updatePaperRepositories.bind(_),yO=_.updatePaperProjectPages.bind(_),wO=_.updatePaperSourceUrl.bind(_),xO=_.updatePaperHfArtifacts.bind(_);_.primePaperCurationState.bind(_);_.primeEvaluationCurationState.bind(_);_.getTrendingPapers.bind(_);_.getRepositoriesForPaper.bind(_);_.getRepositories.bind(_);_.getProjectPagesForPaper.bind(_);_.getProjectPages.bind(_);_.getAuthors.bind(_);_.getAuthor.bind(_);_.getAreas.bind(_);_.getArea.bind(_);_.getAreasWithTasks.bind(_);_.getConferences.bind(_);_.getConferenceDeadlines.bind(_);_.getConference.bind(_);_.getConferenceAreasWithTasks.bind(_);_.getConferencePapers.bind(_);const SO=_.getOrganizations.bind(_);_.getOrganization.bind(_);_.getOrganizationContributions.bind(_);_.getOrganizationAreasWithTasks.bind(_);_.getOrganizationPapers.bind(_);_.getAreaTasks.bind(_);const EO=_.getTasks.bind(_),CO=_.getTask.bind(_);_.getTopTasks.bind(_);_.getTrendingTasks.bind(_);_.getTaskChildren.bind(_);_.getTaskParents.bind(_);_.getTaskPage.bind(_);_.getTaskPapers.bind(_);const bO=_.getMethods.bind(_),_O=_.getMethod.bind(_);_.getMethodPapers.bind(_);const PO=_.getDatasets.bind(_),kO=_.getDataset.bind(_);_.getDatasetBySlug.bind(_);_.getDatasetTasks.bind(_);const TO=_.getLeaderboardMetrics.bind(_);_.getEvaluations.bind(_);_.getEvaluation.bind(_);const RO=_.getEvaluationsByPaper.bind(_);_.getEvaluationsByDataset.bind(_);_.createEvaluation.bind(_);_.updateEvaluation.bind(_);_.deleteEvaluation.bind(_);const NO=_.batchEvaluations.bind(_);_.generateThumbnail.bind(_);_.getThumbnailStatus.bind(_);_.getMetrics.bind(_);_.getMetric.bind(_);_.getMetricDirections.bind(_);_.getResearchTrends.bind(_);_.healthCheck.bind(_);_.getMyBookmarkIds.bind(_);_.getMyBookmarks.bind(_);_.addBookmark.bind(_);_.getMyPreferences.bind(_);_.updateMyPreferences.bind(_);const OO=_.submitPendingPaperEdit.bind(_),MO=_.listPendingPaperEdits.bind(_);_.getPendingPaperEdit.bind(_);const AO=_.approvePendingPaperEdit.bind(_),LO=_.rejectPendingPaperEdit.bind(_);_.removeBookmark.bind(_);const lu={hide_closed_source_evals:!1},d0=T.createContext(null),lN=({children:e})=>{const{user:t}=Xd(),[n,r]=T.useState(lu),[o,i]=T.useState(!1);T.useEffect(()=>{let l=!1;if(!t){r(lu);return}return i(!0),_.getMyPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(lu)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[t]);const s=T.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!t)try{const c=await _.updateMyPreferences(u);r(c)}catch{r(n)}},[n,t]),a=T.useMemo(()=>({preferences:n,canPersist:!!t,isLoading:o,setHideClosedSourceEvals:s}),[n,t,o,s]);return g.jsx(d0.Provider,{value:a,children:e})};function jO(){const e=T.useContext(d0);if(!e)throw new Error("usePreferences must be used inside a ");return e}const f0=BE(),uN=f0?sE:iE;if(!f0&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const cN=T.lazy(()=>ie(()=>import("./FeedView-BQgIGsx_.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),dN=T.lazy(()=>ie(()=>import("./ChatView-CtDdhli3.js"),__vite__mapDeps([16,10,11,17,7,3,4,18,19,20,8,21]))),fN=T.lazy(()=>ie(()=>import("./SharedChatView-BiDdc9TO.js"),__vite__mapDeps([22,10,11,17,7,3,4,18,19,20]))),hN=T.lazy(()=>ie(()=>import("./PapersListView-BmApqIB5.js"),__vite__mapDeps([23,1,2,3,4,5,9,10,11,12,24,13,6,14,15]))),pN=T.lazy(()=>ie(()=>import("./PaperDetailView-BBswAFhU.js"),__vite__mapDeps([25,10,11,1,2,3,4,5,26,18,27,28,9,12,14,15,29,30,31,32,33,34,35,36,37,38,20]))),gN=T.lazy(()=>ie(()=>import("./TagsIndexView-D_No0JK1.js"),__vite__mapDeps([39,10,11,5,14,15,40,34,29,31,32,33,35]))),mN=T.lazy(()=>ie(()=>import("./TagBrowseView-Cs6vCRf6.js"),__vite__mapDeps([41,10,11,1,2,3,4,5,42,6,43,19,20,18,9,12,14,15,44,38]))),vN=T.lazy(()=>ie(()=>import("./MethodsIndexView-B08rRVGN.js"),__vite__mapDeps([45,10,11,46,14,15,40,34,29,31,32,33,35]))),yN=T.lazy(()=>ie(()=>import("./FrameworksIndexView-BkdoKfPD.js"),__vite__mapDeps([47,10,11,1,2,3,4,5]))),wN=T.lazy(()=>ie(()=>import("./TrendsView-jMSY3gur.js"),__vite__mapDeps([48,10,11,15,14]))),xN=T.lazy(()=>ie(()=>import("./ConferencesIndexView-DiiMYBFz.js"),__vite__mapDeps([49,10,11,14,15,40,34,29,31,32,33,35]))),SN=T.lazy(()=>ie(()=>import("./AiDeadlinesView-SO_B8s6V.js"),__vite__mapDeps([50,10,11,51,30,14,15,32]))),EN=T.lazy(()=>ie(()=>import("./ConferenceDetailView-Bc8hL_Zk.js"),__vite__mapDeps([52,10,11,43,3,4,19,20,18,5,14,15]))),CN=T.lazy(()=>ie(()=>import("./ConferenceTaskView-DAbsNhLC.js"),__vite__mapDeps([53,10,11,1,2,3,4,5,6,43,19,20,18,9,12,14,15]))),bN=T.lazy(()=>ie(()=>import("./OrganizationsIndexView-DstHO0mQ.js"),__vite__mapDeps([54,10,11,15,14,55]))),_N=T.lazy(()=>ie(()=>import("./OrganizationDetailView-cWweA-IF.js"),__vite__mapDeps([56,57,10,11,1,2,3,4,5,43,19,20,18,14,6,15,36,29,32,35,9,12,58]))),PN=T.lazy(()=>ie(()=>import("./OrganizationTaskView-Bw4EgOqw.js"),__vite__mapDeps([59,57,10,11,1,2,3,4,5,43,19,20,18,14,6,15,36,29,32,35,9,12,58]))),kN=T.lazy(()=>ie(()=>import("./AuthorDetailView-DYzk7KbK.js"),__vite__mapDeps([60,10,11,14,58]))),TN=T.lazy(()=>ie(()=>import("./MethodDetailView-CHwxmkDT.js"),__vite__mapDeps([61,10,11,12,1,2,3,4,5,6,43,19,20,18,46,14,15]))),RN=T.lazy(()=>ie(()=>import("./BenchmarkDetailView-aQvia8JD.js"),__vite__mapDeps([62,10,11,14,51,30,15,2,3,4,26,18,27,42,1,5,63]))),NN=T.lazy(()=>ie(()=>import("./SavedPapersView-Bt241wOv.js"),__vite__mapDeps([64,10,11,1,2,3,4,5,14,15]))),ON=T.lazy(()=>ie(()=>import("./SettingsView-BT6c57TI.js"),__vite__mapDeps([65,10,11,33,51,30,28,21,66]))),MN=T.lazy(()=>ie(()=>import("./SubmitView-QOnyc1Iu.js"),__vite__mapDeps([67,33,15,29,31]))),AN=T.lazy(()=>ie(()=>import("./CronDashboard-CzCV7fD-.js"),__vite__mapDeps([68,10,11,37,29,44,69,35,66,33,12,70]))),LN=T.lazy(()=>ie(()=>import("./SubmissionsDashboard-B38pktVP.js"),__vite__mapDeps([71,11,10,33,69,35]))),jN=T.lazy(()=>ie(()=>import("./ContributionsPage-DVMwAad-.js"),__vite__mapDeps([72,12,11,29]))),Cp=T.lazy(()=>ie(()=>import("./NotFound-DArrcZxf.js"),[])),IN=T.lazy(()=>ie(()=>import("./SearchOverlay-97sfjbbt.js"),__vite__mapDeps([73,10,11,2,3,4,24,5]))),DN=()=>g.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),g.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),$N=new FE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),FN=()=>{const{arxivId:e}=nv();return g.jsx(ko,{to:e?`/paper/${e}`:"/papers",replace:!0})},zN=()=>{const{taskSlug:e}=nv();return g.jsx(ko,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},uu=({element:e})=>qi()?g.jsx(ko,{to:"/",replace:!0}):g.jsx(g.Fragment,{children:e}),UN=({element:e})=>{const{user:t,isLoading:n}=Xd();return qi()?g.jsx(ko,{to:"/",replace:!0}):n?g.jsx("div",{className:"page",children:g.jsx("div",{className:"submission-loading",children:g.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?g.jsx(g.Fragment,{children:e}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Admin access required"}),g.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Sign in required"}),g.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),g.jsx(wv,{returnTo:"/admin-dashboard"})]})})},BN=()=>{const e=UE(),t=typeof window<"u"&&new URL(e,window.location.origin).origin!==window.location.origin;return T.useEffect(()=>{t&&window.location.replace(e)},[e,t]),t?g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-loading",children:[g.jsx("span",{children:"Opening the production admin dashboard..."}),g.jsx("a",{href:e,children:"Continue"})]})}):g.jsx(UN,{element:g.jsx(AN,{})})},VN=()=>{const[e,t]=T.useState(!1);return tN(),T.useLayoutEffect(()=>{var n;(n=document.getElementById("initial-discovery-footer"))==null||n.remove()},[]),T.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="k"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),g.jsxs(g.Fragment,{children:[g.jsx(kT,{onOpenSearch:()=>t(!0)}),g.jsx("main",{children:g.jsx(T.Suspense,{fallback:g.jsx(DN,{}),children:g.jsxs(Y1,{children:[g.jsx(ne,{path:"/",element:g.jsx(cN,{})}),g.jsx(ne,{path:"/chat/:sessionId?",element:xa()?g.jsx(dN,{}):g.jsx(ko,{to:"/",replace:!0})}),g.jsx(ne,{path:"/share/:shareId",element:xa()?g.jsx(fN,{}):g.jsx(Cp,{})}),g.jsx(ne,{path:"/papers",element:g.jsx(hN,{})}),g.jsx(ne,{path:"/papers/:arxivId",element:g.jsx(FN,{})}),g.jsx(ne,{path:"/paper/:arxivId",element:g.jsx(pN,{})}),g.jsx(ne,{path:"/tasks",element:g.jsx(gN,{})}),g.jsx(ne,{path:"/tasks/:taskSlug",element:g.jsx(mN,{})}),g.jsx(ne,{path:"/task/:taskSlug",element:g.jsx(zN,{})}),g.jsx(ne,{path:"/methods",element:g.jsx(vN,{})}),g.jsx(ne,{path:"/methods/:methodSlug",element:g.jsx(TN,{})}),g.jsx(ne,{path:"/frameworks",element:g.jsx(yN,{})}),g.jsx(ne,{path:"/trends",element:g.jsx(wN,{})}),g.jsx(ne,{path:"/conferences",element:g.jsx(xN,{})}),g.jsx(ne,{path:"/ai-deadlines",element:g.jsx(SN,{})}),g.jsx(ne,{path:"/conferences/:confSlug",element:g.jsx(EN,{})}),g.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:g.jsx(CN,{})}),g.jsx(ne,{path:"/organizations",element:g.jsx(bN,{})}),g.jsx(ne,{path:"/orgs/:orgSlug",element:g.jsx(_N,{})}),g.jsx(ne,{path:"/orgs/:orgSlug/:taskSlug",element:g.jsx(PN,{})}),g.jsx(ne,{path:"/authors/:authorId",element:g.jsx(kN,{})}),g.jsx(ne,{path:"/benchmark/:datasetSlug",element:g.jsx(RN,{})}),g.jsx(ne,{path:"/submit",element:g.jsx(MN,{})}),g.jsx(ne,{path:"/saved",element:g.jsx(uu,{element:g.jsx(NN,{})})}),g.jsx(ne,{path:"/settings",element:g.jsx(ON,{})}),g.jsx(ne,{path:"/admin-dashboard",element:g.jsx(BN,{})}),g.jsx(ne,{path:"/cron-dashboard",element:g.jsx(ko,{to:"/admin-dashboard",replace:!0})}),g.jsx(ne,{path:"/submissions",element:g.jsx(uu,{element:g.jsx(LN,{})})}),g.jsx(ne,{path:"/contributions",element:g.jsx(uu,{element:g.jsx(jN,{})})}),g.jsx(ne,{path:"*",element:g.jsx(Cp,{})})]})})}),e&&g.jsx(T.Suspense,{fallback:null,children:g.jsx(IN,{open:e,onClose:()=>t(!1)})})]})},WN=()=>g.jsx(zE,{client:$N,children:g.jsx(CT,{children:g.jsx(lN,{children:g.jsxs(ZR,{children:[g.jsx(uN,{children:g.jsx(VN,{})}),g.jsx(iR,{}),g.jsx(AR,{}),!1]})})})});s1();const HN=Km(document.getElementById("root"));HN.render(g.jsx(T.StrictMode,{children:g.jsx(ZS,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:g.jsx(o1,{children:g.jsx(WN,{})})})}));export{gT as $,Ta as A,bO as B,cT as C,vO as D,yO as E,wO as F,PO as G,NO as H,TO as I,xO as J,mO as K,Cn as L,SO as M,qi as N,Vv as O,Tr as P,oP as Q,T as R,iP as S,xy as T,fT as U,Xa as V,cO as W,hT as X,oO as Y,jO as Z,pT as _,GN as a,Tw as a0,It as a1,tO as a2,iO as a3,fO as a4,hc as a5,vt as a6,Ld as a7,Sv as a8,tR as a9,_O as aA,kO as aB,zv as aC,Uv as aD,Bv as aE,AO as aF,LO as aG,MO as aH,Mi as aI,IE as aJ,XN as aK,ZN as aL,JN as aM,rO as aN,hn as aO,kE as aP,xE as aQ,ac as aR,fv as aS,yE as aT,wE as aU,sc as aV,uv as aW,LE as aX,CE as aY,wv as aa,Pr as ab,V_ as ac,my as ad,rl as ae,Vd as af,gP as ag,Ay as ah,xb as ai,Kv as aj,Ja as ak,vy as al,yy as am,sO as an,YN as ao,dO as ap,KN as aq,Ap as ar,JS as as,hO as at,Ya as au,Ue as av,QN as aw,cv as ax,_t as ay,CO as az,_ as b,ll as c,io as d,nv as e,Xd as f,AT as g,eO as h,xa as i,g as j,WE as k,nO as l,RO as m,ve as n,Md as o,Re as p,V as q,f as r,I_ as s,kr as t,_d as u,Ne as v,OO as w,pO as x,EO as y,gO as z}; diff --git a/assets/index-qlYSmaoI.js b/assets/index-Bty21uio.js similarity index 72% rename from assets/index-qlYSmaoI.js rename to assets/index-Bty21uio.js index 5e7aab7ac8928b9b550b7429ff78478cacc6e1eb..6e99cccd19da3e00b1226dde2ee149ed6e1d86fa 100644 --- a/assets/index-qlYSmaoI.js +++ b/assets/index-Bty21uio.js @@ -1 +1 @@ -import{r as u}from"./index-BfD7YdLr.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}; +import{r as u}from"./index-Bn8Ob2yb.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}; diff --git a/assets/index-SnRTg719.js b/assets/index-N_WymWS-.js similarity index 99% rename from assets/index-SnRTg719.js rename to assets/index-N_WymWS-.js index 966fe739a9c79bc54024195a16ccce8d00c33f2a..f75accb9bec496694e6cbae181f12b7533d4b8cd 100644 --- a/assets/index-SnRTg719.js +++ b/assets/index-N_WymWS-.js @@ -1,4 +1,4 @@ -import{aq as nn,ar as or,j as pn}from"./index-BfD7YdLr.js";function pf(){}function mf(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(i,r).trim();(l||!o)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function wi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Si=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ci=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ei={};function ft(e,t){return(Ei.jsx?Ci:Si).test(e)}const Ii=/[ \t\n\f\r]/g;function Ai(e){return typeof e=="object"?e.type==="text"?ht(e.value):!1:ht(e)}function ht(e){return e.replace(Ii,"")===""}class qe{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qe.prototype.normal={};qe.prototype.property={};qe.prototype.space=void 0;function ar(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new qe(n,r,t)}function vn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ti=0;const D=Ie(),W=Ie(),zn=Ie(),S=Ie(),V=Ie(),De=Ie(),te=Ie();function Ie(){return 2**++Ti}const Dn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:W,commaOrSpaceSeparated:te,commaSeparated:De,number:S,overloadedBoolean:zn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),mn=Object.keys(Dn);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Li.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,_i);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Di,Ri);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function Ri(e){return"-"+e.toLowerCase()}function _i(e){return e.charAt(1).toUpperCase()}const Oi=ar([ur,Pi,fr,hr,pr],"html"),Un=ar([ur,vi,fr,hr,pr],"svg");function gf(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Mi(e){return e.join(" ").trim()}var Vn={},gt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ni=/\n/g,Bi=/^\s*/,ji=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Hi=/^:\s*/,Ui=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Vi=/^[;\s]*/,$i=/^\s+|\s+$/g,qi=` +import{aq as nn,ar as or,j as pn}from"./index-Bn8Ob2yb.js";function pf(){}function mf(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(i,r).trim();(l||!o)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function wi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Si=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ci=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ei={};function ft(e,t){return(Ei.jsx?Ci:Si).test(e)}const Ii=/[ \t\n\f\r]/g;function Ai(e){return typeof e=="object"?e.type==="text"?ht(e.value):!1:ht(e)}function ht(e){return e.replace(Ii,"")===""}class qe{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qe.prototype.normal={};qe.prototype.property={};qe.prototype.space=void 0;function ar(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new qe(n,r,t)}function vn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ti=0;const D=Ie(),W=Ie(),zn=Ie(),S=Ie(),V=Ie(),De=Ie(),te=Ie();function Ie(){return 2**++Ti}const Dn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:W,commaOrSpaceSeparated:te,commaSeparated:De,number:S,overloadedBoolean:zn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),mn=Object.keys(Dn);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Li.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,_i);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Di,Ri);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function Ri(e){return"-"+e.toLowerCase()}function _i(e){return e.charAt(1).toUpperCase()}const Oi=ar([ur,Pi,fr,hr,pr],"html"),Un=ar([ur,vi,fr,hr,pr],"svg");function gf(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Mi(e){return e.join(" ").trim()}var Vn={},gt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ni=/\n/g,Bi=/^\s*/,ji=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Hi=/^:\s*/,Ui=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Vi=/^[;\s]*/,$i=/^\s+|\s+$/g,qi=` `,dt="/",yt="*",Ce="",Wi="comment",Yi="declaration";function Xi(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(d){var x=d.match(Ni);x&&(n+=x.length);var C=d.lastIndexOf(qi);r=~C?d.length-C:r+d.length}function o(){var d={line:n,column:r};return function(x){return x.position=new l(d),s(),x}}function l(d){this.start=d,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function a(d){var x=new Error(t.source+":"+n+":"+r+": "+d);if(x.reason=d,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(d){var x=d.exec(e);if(x){var C=x[0];return i(C),e=e.slice(C.length),x}}function s(){u(Bi)}function f(d){var x;for(d=d||[];x=c();)x!==!1&&d.push(x);return d}function c(){var d=o();if(!(dt!=e.charAt(0)||yt!=e.charAt(1))){for(var x=2;Ce!=e.charAt(x)&&(yt!=e.charAt(x)||dt!=e.charAt(x+1));)++x;if(x+=2,Ce===e.charAt(x-1))return a("End of comment missing");var C=e.slice(2,x-2);return r+=2,i(C),e=e.slice(x),r+=2,d({type:Wi,comment:C})}}function p(){var d=o(),x=u(ji);if(x){if(c(),!u(Hi))return a("property missing ':'");var C=u(Ui),y=d({type:Yi,property:kt(x[0].replace(gt,Ce)),value:C?kt(C[0].replace(gt,Ce)):Ce});return u(Vi),y}}function h(){var d=[];f(d);for(var x;x=p();)x!==!1&&(d.push(x),f(d));return d}return s(),h()}function kt(e){return e?e.replace($i,Ce):Ce}var Qi=Xi,Gi=nn&&nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.default=Ji;const Ki=Gi(Qi);function Ji(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Ki.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:l,value:a}=o;i?t(l,a,o):a&&(n=n||{},n[l]=a)}),n}var an={};Object.defineProperty(an,"__esModule",{value:!0});an.camelCase=void 0;var Zi=/^--[a-zA-Z0-9_-]+$/,el=/-([a-z])/g,nl=/^[^-]+$/,tl=/^-(webkit|moz|ms|o|khtml)-/,rl=/^-(ms)-/,il=function(e){return!e||nl.test(e)||Zi.test(e)},ll=function(e,t){return t.toUpperCase()},xt=function(e,t){return"".concat(t,"-")},ol=function(e,t){return t===void 0&&(t={}),il(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(rl,xt):e=e.replace(tl,xt),e.replace(el,ll))};an.camelCase=ol;var al=nn&&nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ul=al(Vn),sl=an;function Ln(e,t){var n={};return!e||typeof e!="string"||(0,ul.default)(e,function(r,i){r&&i&&(n[(0,sl.camelCase)(r,t)]=i)}),n}Ln.default=Ln;var cl=Ln;const fl=or(cl),mr=gr("end"),$n=gr("start");function gr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function hl(e){const t=$n(e),n=mr(e);if(t&&n)return{start:t,end:n}}function je(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bt(e.position):"start"in e||"end"in e?bt(e):"line"in e||"column"in e?Fn(e):""}function Fn(e){return wt(e&&e.line)+":"+wt(e&&e.column)}function bt(e){return Fn(e&&e.start)+"-"+Fn(e&&e.end)}function wt(e){return e&&typeof e=="number"?e:1}class K extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=je(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const qn={}.hasOwnProperty,pl=new Map,ml=/[A-Z]/g,gl=new Set(["table","tbody","thead","tfoot","tr"]),dl=new Set(["td","th"]),dr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yl(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Il(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=El(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Un:Oi,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=yr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function yr(e,t,n){if(t.type==="element")return kl(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return xl(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return wl(e,t,n);if(t.type==="mdxjsEsm")return bl(e,t);if(t.type==="root")return Sl(e,t,n);if(t.type==="text")return Cl(e,t)}function kl(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=xr(e,t.tagName,!1),l=Al(e,t);let a=Yn(e,t);return gl.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Ai(u):!0})),kr(e,l,o,t),Wn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function xl(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ve(e,t.position)}function bl(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ve(e,t.position)}function wl(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:xr(e,t.name,!0),l=Tl(e,t),a=Yn(e,t);return kr(e,l,o,t),Wn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Sl(e,t,n){const r={};return Wn(r,Yn(e,t)),e.create(t,e.Fragment,r,n)}function Cl(e,t){return t.value}function kr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function El(e,t,n){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?n:t;return a?s(o,l,a):s(o,l)}}function Il(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=$n(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Al(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&qn.call(t.properties,i)){const o=Pl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&dl.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Tl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Ve(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Ve(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Yn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:pl;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(re(e,e.length,0,t),e):t}const Et={}.hasOwnProperty;function wr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function se(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=xe(/[A-Za-z]/),G=xe(/[\dA-Za-z]/),Ml=xe(/[#-'*+\--9=?A-Z^-~]/);function tn(e){return e!==null&&(e<32||e===127)}const Rn=xe(/\d/),Nl=xe(/[\dA-Fa-f]/),Bl=xe(/[!-/:-@[-`{-~]/);function v(e){return e!==null&&e<-2}function U(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}const un=xe(new RegExp("\\p{P}|\\p{S}","u")),Ee=xe(/\s/);function xe(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Re(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function O(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return R(u)?(e.enter(n),a(u)):t(u)}function a(u){return R(u)&&o++l))return;const M=t.events.length;let $=M,B,k;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(B){k=t.events[$][1].end;break}B=!0}for(y(r),w=M;wE;){const F=n[L];t.containerState=F[1],F[0].exit.call(t,e)}n.length=E}function A(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function $l(e,t,n){return O(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Le(e){if(e===null||U(e)||Ee(e))return 1;if(un(e))return 2}function sn(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};At(c,-u),At(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ie(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=ie(s,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),s=ie(s,sn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=ie(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,s=ie(s,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,re(e,r-1,n-r+3,s),n=r+s.length-f-2;break}}for(n=-1;++n0&&R(w)?O(e,A,"linePrefix",o+1)(w):A(w)}function A(w){return w===null||v(w)?e.check(Tt,x,L)(w):(e.enter("codeFlowValue"),E(w))}function E(w){return w===null||v(w)?(e.exit("codeFlowValue"),A(w)):(e.consume(w),E)}function L(w){return e.exit("codeFenced"),t(w)}function F(w,M,$){let B=0;return k;function k(N){return w.enter("lineEnding"),w.consume(N),w.exit("lineEnding"),T}function T(N){return w.enter("codeFencedFence"),R(N)?O(w,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):P(N)}function P(N){return N===a?(w.enter("codeFencedFenceSequence"),j(N)):$(N)}function j(N){return N===a?(B++,w.consume(N),j):B>=l?(w.exit("codeFencedFenceSequence"),R(N)?O(w,q,"whitespace")(N):q(N)):$(N)}function q(N){return N===null||v(N)?(w.exit("codeFencedFence"),M(N)):$(N)}}}function to(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const dn={name:"codeIndented",tokenize:io},ro={partial:!0,tokenize:lo};function io(e,t,n){const r=this;return i;function i(s){return e.enter("codeIndented"),O(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):n(s)}function l(s){return s===null?u(s):v(s)?e.attempt(ro,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||v(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),t(s)}}function lo(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):v(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):O(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):v(l)?i(l):n(l)}}const oo={name:"codeText",previous:uo,resolve:ao,tokenize:so};function ao(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ne(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ne(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ne(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Tr(e,t,n,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||tn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||v(y)?n(y):(e.consume(y),y===92?d:h)}function d(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function x(y){return!f&&(y===null||y===41||U(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):f999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):v(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||v(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!R(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function vr(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?n(p):v(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),O(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||v(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function He(e,t){let n;return r;function r(i){return v(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):R(i)?O(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ko={name:"definition",tokenize:bo},xo={partial:!0,tokenize:wo};function bo(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return Pr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return U(h)?He(e,s)(h):s(h)}function s(h){return Tr(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(xo,c,c)(h)}function c(h){return R(h)?O(e,p,"whitespace")(h):p(h)}function p(h){return h===null||v(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function wo(e,t,n){return r;function r(a){return U(a)?He(e,i)(a):n(a)}function i(a){return vr(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return R(a)?O(e,l,"whitespace")(a):l(a)}function l(a){return a===null||v(a)?t(a):n(a)}}const So={name:"hardBreakEscape",tokenize:Co};function Co(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return v(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Eo={name:"headingAtx",resolve:Io,tokenize:Ao};function Io(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},re(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ao(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||U(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||v(f)?(e.exit("atxHeading"),t(f)):R(f)?O(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||U(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const To=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vt=["pre","script","style","textarea"],Po={concrete:!0,name:"htmlFlow",resolveTo:Do,tokenize:Lo},vo={partial:!0,tokenize:Ro},zo={partial:!0,tokenize:Fo};function Do(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Lo(e,t,n){const r=this;let i,o,l,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),o=!0,x):g===63?(e.consume(g),i=3,r.interrupt?t:m):J(g)?(e.consume(g),l=String.fromCharCode(g),C):n(g)}function p(g){return g===45?(e.consume(g),i=2,h):g===91?(e.consume(g),i=5,a=0,d):J(g)?(e.consume(g),i=4,r.interrupt?t:m):n(g)}function h(g){return g===45?(e.consume(g),r.interrupt?t:m):n(g)}function d(g){const ae="CDATA[";return g===ae.charCodeAt(a++)?(e.consume(g),a===ae.length?r.interrupt?t:P:d):n(g)}function x(g){return J(g)?(e.consume(g),l=String.fromCharCode(g),C):n(g)}function C(g){if(g===null||g===47||g===62||U(g)){const ae=g===47,be=l.toLowerCase();return!ae&&!o&&vt.includes(be)?(i=1,r.interrupt?t(g):P(g)):To.includes(l.toLowerCase())?(i=6,ae?(e.consume(g),y):r.interrupt?t(g):P(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?A(g):E(g))}return g===45||G(g)?(e.consume(g),l+=String.fromCharCode(g),C):n(g)}function y(g){return g===62?(e.consume(g),r.interrupt?t:P):n(g)}function A(g){return R(g)?(e.consume(g),A):k(g)}function E(g){return g===47?(e.consume(g),k):g===58||g===95||J(g)?(e.consume(g),L):R(g)?(e.consume(g),E):k(g)}function L(g){return g===45||g===46||g===58||g===95||G(g)?(e.consume(g),L):F(g)}function F(g){return g===61?(e.consume(g),w):R(g)?(e.consume(g),F):E(g)}function w(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),u=g,M):R(g)?(e.consume(g),w):$(g)}function M(g){return g===u?(e.consume(g),u=null,B):g===null||v(g)?n(g):(e.consume(g),M)}function $(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||U(g)?F(g):(e.consume(g),$)}function B(g){return g===47||g===62||R(g)?E(g):n(g)}function k(g){return g===62?(e.consume(g),T):n(g)}function T(g){return g===null||v(g)?P(g):R(g)?(e.consume(g),T):n(g)}function P(g){return g===45&&i===2?(e.consume(g),Q):g===60&&i===1?(e.consume(g),Y):g===62&&i===4?(e.consume(g),oe):g===63&&i===3?(e.consume(g),m):g===93&&i===5?(e.consume(g),he):v(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(vo,pe,j)(g)):g===null||v(g)?(e.exit("htmlFlowData"),j(g)):(e.consume(g),P)}function j(g){return e.check(zo,q,pe)(g)}function q(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),N}function N(g){return g===null||v(g)?j(g):(e.enter("htmlFlowData"),P(g))}function Q(g){return g===45?(e.consume(g),m):P(g)}function Y(g){return g===47?(e.consume(g),l="",le):P(g)}function le(g){if(g===62){const ae=l.toLowerCase();return vt.includes(ae)?(e.consume(g),oe):P(g)}return J(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),le):P(g)}function he(g){return g===93?(e.consume(g),m):P(g)}function m(g){return g===62?(e.consume(g),oe):g===45&&i===2?(e.consume(g),m):P(g)}function oe(g){return g===null||v(g)?(e.exit("htmlFlowData"),pe(g)):(e.consume(g),oe)}function pe(g){return e.exit("htmlFlow"),t(g)}}function Fo(e,t,n){const r=this;return i;function i(l){return v(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Ro(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(We,t,n)}}const _o={name:"htmlText",tokenize:Oo};function Oo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),F):m===63?(e.consume(m),E):J(m)?(e.consume(m),$):n(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,d):J(m)?(e.consume(m),A):n(m)}function f(m){return m===45?(e.consume(m),h):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):v(m)?(l=c,Y(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?Q(m):m===45?p(m):c(m)}function d(m){const oe="CDATA[";return m===oe.charCodeAt(o++)?(e.consume(m),o===oe.length?x:d):n(m)}function x(m){return m===null?n(m):m===93?(e.consume(m),C):v(m)?(l=x,Y(m)):(e.consume(m),x)}function C(m){return m===93?(e.consume(m),y):x(m)}function y(m){return m===62?Q(m):m===93?(e.consume(m),y):x(m)}function A(m){return m===null||m===62?Q(m):v(m)?(l=A,Y(m)):(e.consume(m),A)}function E(m){return m===null?n(m):m===63?(e.consume(m),L):v(m)?(l=E,Y(m)):(e.consume(m),E)}function L(m){return m===62?Q(m):E(m)}function F(m){return J(m)?(e.consume(m),w):n(m)}function w(m){return m===45||G(m)?(e.consume(m),w):M(m)}function M(m){return v(m)?(l=M,Y(m)):R(m)?(e.consume(m),M):Q(m)}function $(m){return m===45||G(m)?(e.consume(m),$):m===47||m===62||U(m)?B(m):n(m)}function B(m){return m===47?(e.consume(m),Q):m===58||m===95||J(m)?(e.consume(m),k):v(m)?(l=B,Y(m)):R(m)?(e.consume(m),B):Q(m)}function k(m){return m===45||m===46||m===58||m===95||G(m)?(e.consume(m),k):T(m)}function T(m){return m===61?(e.consume(m),P):v(m)?(l=T,Y(m)):R(m)?(e.consume(m),T):B(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,j):v(m)?(l=P,Y(m)):R(m)?(e.consume(m),P):(e.consume(m),q)}function j(m){return m===i?(e.consume(m),i=void 0,N):m===null?n(m):v(m)?(l=j,Y(m)):(e.consume(m),j)}function q(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||U(m)?B(m):(e.consume(m),q)}function N(m){return m===47||m===62||U(m)?B(m):n(m)}function Q(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function Y(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),le}function le(m){return R(m)?O(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):he(m)}function he(m){return e.enter("htmlTextData"),l(m)}}const Gn={name:"labelEnd",resolveAll:jo,resolveTo:Ho,tokenize:Uo},Mo={tokenize:Vo},No={tokenize:$o},Bo={tokenize:qo};function jo(e){let t=-1;const n=[];for(;++t=3&&(s===null||v(s))?(e.exit("thematicBreak"),t(s)):n(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),R(s)?O(e,a,"whitespace")(s):a(s))}}const Z={continuation:{tokenize:na},exit:ra,name:"list",tokenize:ea},Jo={partial:!0,tokenize:ia},Zo={partial:!0,tokenize:ta};function ea(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const d=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(d==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Rn(h)){if(r.containerState.type||(r.containerState.type=d,e.enter(d,{_container:!0})),d==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Ze,n,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return Rn(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):n(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(We,r.interrupt?n:f,e.attempt(Jo,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return R(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function na(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(We,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,O(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!R(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Zo,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,O(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function ta(e,t,n){const r=this;return O(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function ra(e){e.exit(this.containerState.type)}function ia(e,t,n){const r=this;return O(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!R(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const zt={name:"setextUnderline",resolveTo:la,tokenize:oa};function la(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function oa(e,t,n){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):n(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),R(s)?O(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||v(s)?(e.exit("setextHeadingLine"),t(s)):n(s)}}const aa={tokenize:ua};function ua(e){const t=this,n=e.attempt(We,r,e.attempt(this.parser.constructs.flowInitial,i,O(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ho,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const sa={resolveAll:Dr()},ca=zr("string"),fa=zr("text");function zr(e){return{resolveAll:Dr(e==="text"?ha:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return s(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Ia(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=z.tokenStack[z.tokenStack.length-1];(ue[1]||Lt).call(z,void 0,ue[0])}for(I.position={start:ke(b.length>0?b[0][1].start:{line:1,column:1,offset:0}),end:ke(b.length>0?b[b.length-2][1].end:{line:1,column:1,offset:0})},H=-1;++Hn.getOpenRouterUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{u as O,o as a,s as b,m as r,c as u}; +import{u as r}from"./useQuery-DdnDUe7s.js";import{b as n}from"./index-Bn8Ob2yb.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getOpenRouterUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{u as O,o as a,s as b,m as r,c as u}; diff --git a/assets/searchable-select-CriyPATu.js b/assets/searchable-select-qrXUfGnF.js similarity index 98% rename from assets/searchable-select-CriyPATu.js rename to assets/searchable-select-qrXUfGnF.js index 1a16d82800757d456f9e97ac4497b86a20309d9d..6367b897272447a8e7d531fe92ee665116a789c4 100644 --- a/assets/searchable-select-CriyPATu.js +++ b/assets/searchable-select-qrXUfGnF.js @@ -1,4 +1,4 @@ -import{c as we,r as n,j as f,ab as B,o as Ye,ac as et,a5 as $,p as Re,n as A,q as G,ad as Ee,ae as Pe,P as Se,af as tt,t as rt,ag as nt,ah as ot,ai as at,aj as lt,ak as st,al as it,am as ct,v as M,C as ut}from"./index-BfD7YdLr.js";import{u as dt}from"./useQuery-BQY3DH-b.js";import{B as ft}from"./button-CXFuJJQh.js";import{R as pt,P as mt,O as vt,C as ht}from"./dialog-CDRq9Z7X.js";import{L as gt}from"./loader-circle-BQq8L_PA.js";/** +import{c as we,r as n,j as f,ab as B,o as Ye,ac as et,a5 as $,p as Re,n as A,q as G,ad as Ee,ae as Pe,P as Se,af as tt,t as rt,ag as nt,ah as ot,ai as at,aj as lt,ak as st,al as it,am as ct,v as M,C as ut}from"./index-Bn8Ob2yb.js";import{u as dt}from"./useQuery-DdnDUe7s.js";import{B as ft}from"./button-B1AjFwXv.js";import{R as pt,P as mt,O as vt,C as ht}from"./dialog-BBaz5Wr4.js";import{L as gt}from"./loader-circle-CT-SvG9q.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/shield-alert-BRNRcGFf.js b/assets/shield-alert-vXFVjesh.js similarity index 97% rename from assets/shield-alert-BRNRcGFf.js rename to assets/shield-alert-vXFVjesh.js index ecf2313006f8d4dc29736e443d0babfadbd1dc71..3de0ff6133d30e722ac488c8cdc560e490cb3d56 100644 --- a/assets/shield-alert-BRNRcGFf.js +++ b/assets/shield-alert-vXFVjesh.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-BfD7YdLr.js";/** +import{c as e}from"./index-Bn8Ob2yb.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-DlrhV-qs.js b/assets/skeleton-DMgHDmV1.js similarity index 62% rename from assets/skeleton-DlrhV-qs.js rename to assets/skeleton-DMgHDmV1.js index b93cfe65cd6f362a33d702ddf79d6a82861a4c5b..f7db7574393a257fd0d466e9953abac0af5d62e6 100644 --- a/assets/skeleton-DlrhV-qs.js +++ b/assets/skeleton-DMgHDmV1.js @@ -1 +1 @@ -import{j as t,v as n}from"./index-BfD7YdLr.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; +import{j as t,v as n}from"./index-Bn8Ob2yb.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; diff --git a/assets/switch-D_aiRxQJ.js b/assets/switch-CO-39qkR.js similarity index 94% rename from assets/switch-D_aiRxQJ.js rename to assets/switch-CO-39qkR.js index e0a760cbf531c76549601c129be9d3c4a0a025f4..3d7729d36e9d0b043ee0565df6280b2e8c5f7a95 100644 --- a/assets/switch-D_aiRxQJ.js +++ b/assets/switch-CO-39qkR.js @@ -1 +1 @@ -import{r as s,p as C,o as I,j as a,n as y,q as M,s as H,t as q,v as x}from"./index-BfD7YdLr.js";import{u as A}from"./index-qlYSmaoI.js";var b="Switch",[U]=q(b),[z,L]=U(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),S=C(o,h=>p(h)),k=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:S,onClick:M(t.onClick,h=>{B(T=>!T),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&a.jsx(N,{control:l,bubbles:!k.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=A(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 S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[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}; +import{r as s,p as C,o as I,j as a,n as y,q as M,s as H,t as q,v as x}from"./index-Bn8Ob2yb.js";import{u as A}from"./index-Bty21uio.js";var b="Switch",[U]=q(b),[z,L]=U(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),S=C(o,h=>p(h)),k=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:S,onClick:M(t.onClick,h=>{B(T=>!T),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&a.jsx(N,{control:l,bubbles:!k.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=A(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 S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[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}; diff --git a/assets/textarea-DRF500G_.js b/assets/textarea-BIjKbX5f.js similarity index 93% rename from assets/textarea-DRF500G_.js rename to assets/textarea-BIjKbX5f.js index 239838d6d9b4e6781a00d4fcbdbc4ca9400b9d50..763156e79feaf9cddc5c7f610dd88491b2122220 100644 --- a/assets/textarea-DRF500G_.js +++ b/assets/textarea-BIjKbX5f.js @@ -1 +1 @@ -import{r as s,j as i,v as t}from"./index-BfD7YdLr.js";const a=s.forwardRef(({className:e,type:r,...o},n)=>i.jsx("input",{type:r,className:t("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:n,...o}));a.displayName="Input";const d=s.forwardRef(({className:e,...r},o)=>i.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}));d.displayName="Textarea";export{a as I,d as T}; +import{r as s,j as i,v as t}from"./index-Bn8Ob2yb.js";const a=s.forwardRef(({className:e,type:r,...o},n)=>i.jsx("input",{type:r,className:t("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:n,...o}));a.displayName="Input";const d=s.forwardRef(({className:e,...r},o)=>i.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}));d.displayName="Textarea";export{a as I,d as T}; diff --git a/assets/transform-DCLb4olr.js b/assets/transform-Z_GB05A-.js similarity index 99% rename from assets/transform-DCLb4olr.js rename to assets/transform-Z_GB05A-.js index d97256d5f085dd45bef4977e0515652e9fa591eb..f21957d704bf01fdb48f2336b9c154935bd99557 100644 --- a/assets/transform-DCLb4olr.js +++ b/assets/transform-Z_GB05A-.js @@ -1 +1 @@ -import{a2 as $}from"./index-BfD7YdLr.js";function pe(t){let e=2166136261;const n=t||"";for(let r=0;r=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function _(t){const e=w(t);return e.setHours(0,0,0,0),e}function F(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=_(t),r=_(e),a=+n-F(n),i=+r-F(r);return Math.round((a-i)/z)}function K(t){const e=A(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function Z(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!Z(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Y(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:Y({formats:at,defaultWidth:"full"}),time:Y({formats:it,defaultWidth:"full"}),dateTime:Y({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function k(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:k({values:dt,defaultWidth:"wide"}),quarter:k({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:k({values:ft,defaultWidth:"wide"}),day:k({values:ht,defaultWidth:"wide"}),dayPeriod:k({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Ot=/^(\d+)(th|st|nd|rd)?/i,kt=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:Ot,parsePattern:kt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+T(e)-+K(e);return Math.round(n/H)+1}function j(t,e){var f,g,l,O;const n=w(t),r=n.getFullYear(),a=S(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((O=(l=a.locale)==null?void 0:l.options)==null?void 0:O.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=x(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=x(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Lt(t,e){var s,u,d,f;const n=S(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=j(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),x(i,e)}function Ut(t,e){const n=w(t),r=+x(n,e)-+Lt(n,e);return Math.round(r/H)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=j(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=A(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ut(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const U=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Q=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return U(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",U(r,e)).replace("{{time}}",Q(a,e))},It={p:Q,P:Ht},Rt=/^D+$/,At=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return Rt.test(t)}function Xt(t){return At.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Kt=/[a-zA-Z]/;function Zt(t,e,n){var f,g,l,O;const r=S(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((O=(l=r.locale)==null?void 0:l.options)==null?void 0:O.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const W=It[h];return W(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(E[h])return{isToken:!0,value:m};if(h.match(Kt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const W=E[h[0]];return W(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function X(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const v={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(v.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],v.timeZoneDelimiter.test(e.date)&&(e.date=t.split(v.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=v.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function B(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(B(t)?29:28))}function fe(t,e){return e>=1&&e<=(B(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?X(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return X(t).getFullYear()}catch{return null}}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=(t.leaderboard_ranks||[]).filter(l=>l.best_rank>=1&&l.best_rank<=3).map(l=>({name:l.dataset_name,slug:l.dataset_slug||null,rank:l.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:s,methods:u,citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:$(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=G.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return C.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const C=new Set(["OCR"]),G=new Map([["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function Te(t,e){const n=t||Oe(e||""),r=G.get((e==null?void 0:e.toLowerCase())||ke(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function ke(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{Oe as a,xe as c,Te as d,pe as h,be as s,ve as t}; +import{a2 as $}from"./index-Bn8Ob2yb.js";function pe(t){let e=2166136261;const n=t||"";for(let r=0;r=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function _(t){const e=w(t);return e.setHours(0,0,0,0),e}function F(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=_(t),r=_(e),a=+n-F(n),i=+r-F(r);return Math.round((a-i)/z)}function K(t){const e=A(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function Z(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!Z(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Y(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:Y({formats:at,defaultWidth:"full"}),time:Y({formats:it,defaultWidth:"full"}),dateTime:Y({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function k(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:k({values:dt,defaultWidth:"wide"}),quarter:k({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:k({values:ft,defaultWidth:"wide"}),day:k({values:ht,defaultWidth:"wide"}),dayPeriod:k({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Ot=/^(\d+)(th|st|nd|rd)?/i,kt=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:Ot,parsePattern:kt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+T(e)-+K(e);return Math.round(n/H)+1}function j(t,e){var f,g,l,O;const n=w(t),r=n.getFullYear(),a=S(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((O=(l=a.locale)==null?void 0:l.options)==null?void 0:O.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=x(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=x(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Lt(t,e){var s,u,d,f;const n=S(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=j(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),x(i,e)}function Ut(t,e){const n=w(t),r=+x(n,e)-+Lt(n,e);return Math.round(r/H)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=j(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=A(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ut(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const U=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Q=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return U(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",U(r,e)).replace("{{time}}",Q(a,e))},It={p:Q,P:Ht},Rt=/^D+$/,At=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return Rt.test(t)}function Xt(t){return At.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Kt=/[a-zA-Z]/;function Zt(t,e,n){var f,g,l,O;const r=S(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((O=(l=r.locale)==null?void 0:l.options)==null?void 0:O.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const W=It[h];return W(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(E[h])return{isToken:!0,value:m};if(h.match(Kt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const W=E[h[0]];return W(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function X(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const v={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(v.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],v.timeZoneDelimiter.test(e.date)&&(e.date=t.split(v.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=v.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function B(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(B(t)?29:28))}function fe(t,e){return e>=1&&e<=(B(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?X(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return X(t).getFullYear()}catch{return null}}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=(t.leaderboard_ranks||[]).filter(l=>l.best_rank>=1&&l.best_rank<=3).map(l=>({name:l.dataset_name,slug:l.dataset_slug||null,rank:l.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:s,methods:u,citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:$(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=G.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return C.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const C=new Set(["OCR"]),G=new Map([["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function Te(t,e){const n=t||Oe(e||""),r=G.get((e==null?void 0:e.toLowerCase())||ke(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function ke(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{Oe as a,xe as c,Te as d,pe as h,be as s,ve as t}; diff --git a/assets/useBaseQuery-zm-nsmQ1.js b/assets/useBaseQuery-DOoW3hTR.js similarity index 99% rename from assets/useBaseQuery-zm-nsmQ1.js rename to assets/useBaseQuery-DOoW3hTR.js index 5efd1875c4db96e41a998b4212cebb440819a9a0..c4f83025aff024c66c66ce1113eb07682ca43ae5 100644 --- a/assets/useBaseQuery-zm-nsmQ1.js +++ b/assets/useBaseQuery-DOoW3hTR.js @@ -1 +1 @@ -var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{au as Tt,aP as gt,aQ as S,aw as q,aR as j,ay as tt,aS as et,aT as vt,aU as Mt,aV as Y,aW as Qt,aX as xt,aY as Rt,av as Ct,r as O,aK as Ot,h as _t}from"./index-BfD7YdLr.js";var v,a,H,g,x,P,C,w,W,D,L,_,U,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Xt=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,x);p(this,P);p(this,C);p(this,w);p(this,W);p(this,D);p(this,L);p(this,_);p(this,U);p(this,T);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),mt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||j(this.options.staleTime,i(this,a))!==j(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,T))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Ft(this,r)&&(u(this,g,r),u(this,P,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,P),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const m=this.hasListeners(),k=!m&&mt(t,e),z=m&&St(t,r,e,h);(k||z)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:R}=d;f=d.data;let V=!1;if(e.placeholderData!==void 0&&f===void 0&&R==="pending"){let m;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(m=o.data,V=!0):m=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,m!==void 0&&(R="success",f=Rt(o==null?void 0:o.data,m,e),M=!0)}if(e.select&&f!==void 0&&!V)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,W))f=i(this,D);else try{u(this,W,e.select),f=e.select(f),f=Rt(o==null?void 0:o.data,f,e),u(this,D,f),u(this,w,null)}catch(m){u(this,w,m)}i(this,w)&&(Q=i(this,w),f=i(this,D),B=Date.now(),R="error");const G=d.fetchStatus==="fetching",J=R==="pending",Z=R==="error",lt=J&&G,dt=f!==void 0,I={status:R,fetchStatus:d.fetchStatus,isPending:J,isSuccess:R==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:G,isRefetching:G&&!J,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const m=I.data!==void 0,k=I.status==="error"&&!m,z=X=>{k?X.reject(I.error):m&&X.resolve(I.data)},pt=()=>{const X=u(this,C,I.promise=gt());z(X)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&z(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,P,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const F=y;return i(this,g)[F]!==t[F]&&c.has(F)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,H=new WeakMap,g=new WeakMap,x=new WeakMap,P=new WeakMap,C=new WeakMap,w=new WeakMap,W=new WeakMap,D=new WeakMap,L=new WeakMap,_=new WeakMap,U=new WeakMap,T=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=j(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,Y.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,U,Y.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,T)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(Y.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,U)!==void 0&&(Y.clearInterval(i(this,U)),u(this,U,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Ut(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function mt(s,t){return Ut(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&j(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(j(t.staleTime,s))}function Ft(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Dt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Lt=O.createContext(Dt()),Nt=()=>O.useContext(Lt),Bt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},kt=s=>{O.useEffect(()=>{s.clearReset()},[s])},At=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),jt=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},Ht=(s,t)=>s.isLoading&&s.isFetching&&!t,Wt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Yt(s,t,e){var M,f,Q,B;const r=Pt(),h=Nt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jt(c),Bt(c,h,y),kt(h);const F=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(R=>{const V=d?b.subscribe(Ct.batchCalls(R)):tt;return b.updateResult(),V},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(At({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&Ht(E,r)){const R=F?yt(c,b,h):y==null?void 0:y.promise;R==null||R.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}export{Xt as Q,Nt as a,Bt as b,kt as c,Yt as d,jt as e,yt as f,At as g,Wt as s,Pt as u}; +var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{au as Tt,aP as gt,aQ as S,aw as q,aR as j,ay as tt,aS as et,aT as vt,aU as Mt,aV as Y,aW as Qt,aX as xt,aY as Rt,av as Ct,r as O,aK as Ot,h as _t}from"./index-Bn8Ob2yb.js";var v,a,H,g,x,P,C,w,W,D,L,_,U,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Xt=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,x);p(this,P);p(this,C);p(this,w);p(this,W);p(this,D);p(this,L);p(this,_);p(this,U);p(this,T);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),mt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||j(this.options.staleTime,i(this,a))!==j(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,T))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Ft(this,r)&&(u(this,g,r),u(this,P,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,P),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const m=this.hasListeners(),k=!m&&mt(t,e),z=m&&St(t,r,e,h);(k||z)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:R}=d;f=d.data;let V=!1;if(e.placeholderData!==void 0&&f===void 0&&R==="pending"){let m;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(m=o.data,V=!0):m=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,m!==void 0&&(R="success",f=Rt(o==null?void 0:o.data,m,e),M=!0)}if(e.select&&f!==void 0&&!V)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,W))f=i(this,D);else try{u(this,W,e.select),f=e.select(f),f=Rt(o==null?void 0:o.data,f,e),u(this,D,f),u(this,w,null)}catch(m){u(this,w,m)}i(this,w)&&(Q=i(this,w),f=i(this,D),B=Date.now(),R="error");const G=d.fetchStatus==="fetching",J=R==="pending",Z=R==="error",lt=J&&G,dt=f!==void 0,I={status:R,fetchStatus:d.fetchStatus,isPending:J,isSuccess:R==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:G,isRefetching:G&&!J,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const m=I.data!==void 0,k=I.status==="error"&&!m,z=X=>{k?X.reject(I.error):m&&X.resolve(I.data)},pt=()=>{const X=u(this,C,I.promise=gt());z(X)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&z(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,P,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const F=y;return i(this,g)[F]!==t[F]&&c.has(F)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,H=new WeakMap,g=new WeakMap,x=new WeakMap,P=new WeakMap,C=new WeakMap,w=new WeakMap,W=new WeakMap,D=new WeakMap,L=new WeakMap,_=new WeakMap,U=new WeakMap,T=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=j(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,Y.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,U,Y.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,T)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(Y.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,U)!==void 0&&(Y.clearInterval(i(this,U)),u(this,U,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Ut(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function mt(s,t){return Ut(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&j(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(j(t.staleTime,s))}function Ft(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Dt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Lt=O.createContext(Dt()),Nt=()=>O.useContext(Lt),Bt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},kt=s=>{O.useEffect(()=>{s.clearReset()},[s])},At=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),jt=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},Ht=(s,t)=>s.isLoading&&s.isFetching&&!t,Wt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Yt(s,t,e){var M,f,Q,B;const r=Pt(),h=Nt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jt(c),Bt(c,h,y),kt(h);const F=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(R=>{const V=d?b.subscribe(Ct.batchCalls(R)):tt;return b.updateResult(),V},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(At({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&Ht(E,r)){const R=F?yt(c,b,h):y==null?void 0:y.promise;R==null||R.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}export{Xt as Q,Nt as a,Bt as b,kt as c,Yt as d,jt as e,yt as f,At as g,Wt as s,Pt as u}; diff --git a/assets/useDebounce-Czrc054X.js b/assets/useDebounce-Q8ScjHA0.js similarity index 66% rename from assets/useDebounce-Czrc054X.js rename to assets/useDebounce-Q8ScjHA0.js index 3497d0253be40e4ad2cc18f7cbeaf60d6772c688..13745dc45a99c885a32114bfb3830025a1f98819 100644 --- a/assets/useDebounce-Czrc054X.js +++ b/assets/useDebounce-Q8ScjHA0.js @@ -1 +1 @@ -import{r as o}from"./index-BfD7YdLr.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; +import{r as o}from"./index-Bn8Ob2yb.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; diff --git a/assets/useInfiniteQuery-CVNt5m44.js b/assets/useInfiniteQuery-Be_M3qGu.js similarity index 89% rename from assets/useInfiniteQuery-CVNt5m44.js rename to assets/useInfiniteQuery-Be_M3qGu.js index 8698128be1c528ec4ee77e3dbccb597eae7626e7..8cc688cbfecaf9a50441f96d0e3203de7a2cda55 100644 --- a/assets/useInfiniteQuery-CVNt5m44.js +++ b/assets/useInfiniteQuery-Be_M3qGu.js @@ -1 +1 @@ -import{Q as v,d as p}from"./useBaseQuery-zm-nsmQ1.js";import{aL as x,aM as b}from"./index-BfD7YdLr.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function M(e,t){return p(e,l)}export{M as u}; +import{Q as v,d as p}from"./useBaseQuery-DOoW3hTR.js";import{aL as x,aM as b}from"./index-Bn8Ob2yb.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function M(e,t){return p(e,l)}export{M as u}; diff --git a/assets/useIntersectionObserver-mJEWgLMQ.js b/assets/useIntersectionObserver-odYwsx6w.js similarity index 92% rename from assets/useIntersectionObserver-mJEWgLMQ.js rename to assets/useIntersectionObserver-odYwsx6w.js index f7ee6efb0dd4d53aedbe690a9f2e24f06b540b92..b5aa192cda0a7150f26f4637f20385a07892082e 100644 --- a/assets/useIntersectionObserver-mJEWgLMQ.js +++ b/assets/useIntersectionObserver-odYwsx6w.js @@ -1 +1 @@ -import{j as e,r as c}from"./index-BfD7YdLr.js";import{I as d}from"./components-LTCBEq5x.js";const h=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),u=({checked:r,icon:t,label:n,onChange:a})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${r?"active":""}`,"aria-pressed":r,onClick:()=>a(!r),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:t}),n]}),r&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),x=({hasCode:r,hasHfArtifacts:t,onHasCodeChange:n,onHasHfArtifactsChange:a,showDivider:o=!0,showHasCode:s=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[o&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[s&&e.jsx(u,{checked:r,icon:e.jsx(d,{name:"github",size:14}),label:"Has code",onChange:n}),e.jsx(u,{checked:t,icon:e.jsx(h,{}),label:"Has artifacts",onChange:a})]})]});function j(r={}){const{threshold:t=0,rootMargin:n="0px"}=r,[a,o]=c.useState(!1),s=c.useRef(null),f=c.useCallback(i=>{if(s.current&&(s.current.disconnect(),s.current=null),!i){o(!1);return}const l=new IntersectionObserver(([p])=>o(p.isIntersecting),{threshold:t,rootMargin:n});l.observe(i),s.current=l},[t,n]);return c.useEffect(()=>()=>{s.current&&(s.current.disconnect(),s.current=null)},[]),{targetRef:f,isIntersecting:a}}export{x as P,j as u}; +import{j as e,r as c}from"./index-Bn8Ob2yb.js";import{I as d}from"./components-CmiCpieH.js";const h=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),u=({checked:r,icon:t,label:n,onChange:a})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${r?"active":""}`,"aria-pressed":r,onClick:()=>a(!r),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:t}),n]}),r&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),x=({hasCode:r,hasHfArtifacts:t,onHasCodeChange:n,onHasHfArtifactsChange:a,showDivider:o=!0,showHasCode:s=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[o&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[s&&e.jsx(u,{checked:r,icon:e.jsx(d,{name:"github",size:14}),label:"Has code",onChange:n}),e.jsx(u,{checked:t,icon:e.jsx(h,{}),label:"Has artifacts",onChange:a})]})]});function j(r={}){const{threshold:t=0,rootMargin:n="0px"}=r,[a,o]=c.useState(!1),s=c.useRef(null),f=c.useCallback(i=>{if(s.current&&(s.current.disconnect(),s.current=null),!i){o(!1);return}const l=new IntersectionObserver(([p])=>o(p.isIntersecting),{threshold:t,rootMargin:n});l.observe(i),s.current=l},[t,n]);return c.useEffect(()=>()=>{s.current&&(s.current.disconnect(),s.current=null)},[]),{targetRef:f,isIntersecting:a}}export{x as P,j as u}; diff --git a/assets/useMutation-BQa0xQql.js b/assets/useMutation-CkFxqrff.js similarity index 97% rename from assets/useMutation-BQa0xQql.js rename to assets/useMutation-CkFxqrff.js index cc0b8328ec279b75f6c853d8a1bfb96ca29d1002..a8dcdb13b6167403f93aacc9095a45575389d848 100644 --- a/assets/useMutation-BQa0xQql.js +++ b/assets/useMutation-CkFxqrff.js @@ -1 +1 @@ -var w=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||w("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?w("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{au as U,aw as k,aI as R,aJ as q,av as P,h as I,r as v,ay as L,aK as A}from"./index-BfD7YdLr.js";var h,c,o,a,n,C,S,j,D=(j=class extends U{constructor(t,s){super();b(this,n);b(this,h);b(this,c);b(this,o);b(this,a);p(this,h,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,h).defaultMutationOptions(t),k(this.options,s)||e(this,h).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&R(s.mutationKey)!==R(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,a,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,h).getMutationCache().build(e(this,h),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},h=new WeakMap,c=new WeakMap,o=new WeakMap,a=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,K,x;if(e(this,a)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,h),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,a)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,a)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,a)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(x=(K=e(this,a)).onSettled)==null||x.call(K,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},j);function T(i,t){const s=I(),[r]=v.useState(()=>new D(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(L)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{T as u}; +var w=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||w("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?w("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{au as U,aw as k,aI as R,aJ as q,av as P,h as I,r as v,ay as L,aK as A}from"./index-Bn8Ob2yb.js";var h,c,o,a,n,C,S,j,D=(j=class extends U{constructor(t,s){super();b(this,n);b(this,h);b(this,c);b(this,o);b(this,a);p(this,h,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,h).defaultMutationOptions(t),k(this.options,s)||e(this,h).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&R(s.mutationKey)!==R(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,a,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,h).getMutationCache().build(e(this,h),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},h=new WeakMap,c=new WeakMap,o=new WeakMap,a=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,K,x;if(e(this,a)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,h),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,a)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,a)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,a)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(x=(K=e(this,a)).onSettled)==null||x.call(K,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},j);function T(i,t){const s=I(),[r]=v.useState(()=>new D(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(L)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{T as u}; diff --git a/assets/usePapers-DrFoptcF.js b/assets/usePapers-CQQdWWPS.js similarity index 93% rename from assets/usePapers-DrFoptcF.js rename to assets/usePapers-CQQdWWPS.js index 268c46f054ef0a59de38e4cbfdc8991da44604b1..67796b2ffdfc858b0deb9d93e3a40f50dd9872d0 100644 --- a/assets/usePapers-DrFoptcF.js +++ b/assets/usePapers-CQQdWWPS.js @@ -1 +1 @@ -import{b as p,ao as _}from"./index-BfD7YdLr.js";import{u as m}from"./useQuery-BQY3DH-b.js";import{u as g}from"./useInfiniteQuery-CVNt5m44.js";function x(a,e=!0){return m({queryKey:["paper",a],queryFn:()=>p.getPaper(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function z(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:s="desc",time:n,published_after:i,published_before:o,conference:u,latest_only:c=!0,include_resources:l=!1,has_code:f=!1,has_hf_artifacts:d=!1,framework:P,repository:y,enabled:b=!0}=a;return g({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:o,conference:u,latest_only:c,include_resources:l,has_code:f,has_hf_artifacts:d,framework:P,repository:y}],queryFn:({pageParam:h=1})=>p.getPapers({page:h,page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:o,conference:u,latest_only:c,include_resources:l,has_code:f,has_hf_artifacts:d,framework:P,repository:y}),getNextPageParam:h=>h.next_page,initialPageParam:1,enabled:b,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function O(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:s="desc",latest_only:n=!0,include_resources:i=!0,has_code:o=!1,has_hf_artifacts:u=!1,enabled:c=!0}=a;return g({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:o,has_hf_artifacts:u}],queryFn:({pageParam:l=1})=>p.getTaskPapers(e,{page:l,page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:o,has_hf_artifacts:u}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function T(a){const{conferenceSlug:e,taskSlug:r,presentation:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:u=!0,has_code:c=!1,has_hf_artifacts:l=!1,enabled:f=!0}=a;return g({queryKey:["conference-papers-infinite",e,r,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:c,has_hf_artifacts:l}],queryFn:({pageParam:d=1})=>p.getConferencePapers(e,{task:r,presentation:t,page:d,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:c,has_hf_artifacts:l}),getNextPageParam:d=>d.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function w(a){const{organizationSlug:e,taskSlug:r,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:u=!1,has_hf_artifacts:c=!1,enabled:l=!0}=a;return g({queryKey:["organization-papers-infinite",e,r,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:c}],queryFn:({pageParam:f=1})=>p.getOrganizationPapers(e,{task:r,page:f,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:c}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:l&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}export{x as a,O as b,T as c,w as d,z as u}; +import{b as p,ao as _}from"./index-Bn8Ob2yb.js";import{u as m}from"./useQuery-DdnDUe7s.js";import{u as g}from"./useInfiniteQuery-Be_M3qGu.js";function x(a,e=!0){return m({queryKey:["paper",a],queryFn:()=>p.getPaper(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function z(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:s="desc",time:n,published_after:i,published_before:o,conference:u,latest_only:c=!0,include_resources:l=!1,has_code:f=!1,has_hf_artifacts:d=!1,framework:P,repository:y,enabled:b=!0}=a;return g({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:o,conference:u,latest_only:c,include_resources:l,has_code:f,has_hf_artifacts:d,framework:P,repository:y}],queryFn:({pageParam:h=1})=>p.getPapers({page:h,page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:o,conference:u,latest_only:c,include_resources:l,has_code:f,has_hf_artifacts:d,framework:P,repository:y}),getNextPageParam:h=>h.next_page,initialPageParam:1,enabled:b,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function O(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:s="desc",latest_only:n=!0,include_resources:i=!0,has_code:o=!1,has_hf_artifacts:u=!1,enabled:c=!0}=a;return g({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:o,has_hf_artifacts:u}],queryFn:({pageParam:l=1})=>p.getTaskPapers(e,{page:l,page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:o,has_hf_artifacts:u}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function T(a){const{conferenceSlug:e,taskSlug:r,presentation:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:u=!0,has_code:c=!1,has_hf_artifacts:l=!1,enabled:f=!0}=a;return g({queryKey:["conference-papers-infinite",e,r,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:c,has_hf_artifacts:l}],queryFn:({pageParam:d=1})=>p.getConferencePapers(e,{task:r,presentation:t,page:d,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:c,has_hf_artifacts:l}),getNextPageParam:d=>d.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function w(a){const{organizationSlug:e,taskSlug:r,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:u=!1,has_hf_artifacts:c=!1,enabled:l=!0}=a;return g({queryKey:["organization-papers-infinite",e,r,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:c}],queryFn:({pageParam:f=1})=>p.getOrganizationPapers(e,{task:r,page:f,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:c}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:l&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}export{x as a,O as b,T as c,w as d,z as u}; diff --git a/assets/usePeriodFilter-Coc3diQT.js b/assets/usePeriodFilter-Coc3diQT.js deleted file mode 100644 index 9751e8a0537891c1c562814683e3adf13e1af1df..0000000000000000000000000000000000000000 --- a/assets/usePeriodFilter-Coc3diQT.js +++ /dev/null @@ -1 +0,0 @@ -import"./index-BfD7YdLr.js";const e=["Today","This Week","This Month","All Time"];export{e as P}; diff --git a/assets/usePeriodFilter-DFtHY8n2.js b/assets/usePeriodFilter-DFtHY8n2.js new file mode 100644 index 0000000000000000000000000000000000000000..246a6830de30df692b0785c67112da944f25f2f3 --- /dev/null +++ b/assets/usePeriodFilter-DFtHY8n2.js @@ -0,0 +1 @@ +import"./index-Bn8Ob2yb.js";const e=["Today","This Week","This Month","All Time"];export{e as P}; diff --git a/assets/useQuery-BQY3DH-b.js b/assets/useQuery-BQY3DH-b.js deleted file mode 100644 index 3b1953552115a9e48f3aa7596531d498be1a3297..0000000000000000000000000000000000000000 --- a/assets/useQuery-BQY3DH-b.js +++ /dev/null @@ -1 +0,0 @@ -import{d as r,Q as u}from"./useBaseQuery-zm-nsmQ1.js";function a(e,s){return r(e,u)}export{a as u}; diff --git a/assets/useQuery-DdnDUe7s.js b/assets/useQuery-DdnDUe7s.js new file mode 100644 index 0000000000000000000000000000000000000000..a6d953e6dd0575f2a8eedb73a364176386d6e438 --- /dev/null +++ b/assets/useQuery-DdnDUe7s.js @@ -0,0 +1 @@ +import{d as r,Q as u}from"./useBaseQuery-DOoW3hTR.js";function a(e,s){return r(e,u)}export{a as u}; diff --git a/index.html b/index.html index 9675ef90d2b6bc7c9dde3480a16d83b61a51ee9f..633aad44dedb7d8def49e15e19e23c1063f72852 100644 --- a/index.html +++ b/index.html @@ -73,7 +73,7 @@ plausible.init(); })(); - +