diff --git a/assets/AiDeadlinesView-BG7IjWh-.js b/assets/AiDeadlinesView-DN11lHYR.js similarity index 96% rename from assets/AiDeadlinesView-BG7IjWh-.js rename to assets/AiDeadlinesView-DN11lHYR.js index cfcbe95f68f415c2ff01ac4defb7789196ce81ff..01df80b0dd254c2b1a02e91385105baaf603d888 100644 --- a/assets/AiDeadlinesView-BG7IjWh-.js +++ b/assets/AiDeadlinesView-DN11lHYR.js @@ -1,3 +1,3 @@ -import{r as x,j as t}from"./index-CnNiludC.js";import{u as A}from"./useQuery-C87uSz9p.js";import{c as B}from"./catalog-D7qk7tAG.js";import{S as U}from"./switch-BmJwxg75.js";import{S as W}from"./skeleton-BU3tw6-C.js";import{A as O,a as V}from"./alert-CV1yu6Q5.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-COYv9g-7.js";import"./index-D0hHQwos.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` +import{r as x,j as t}from"./index-W0d3uysl.js";import{u as A}from"./useQuery-vQc9wuoD.js";import{c as B}from"./catalog-C5kDa2mw.js";import{S as U}from"./switch-C5eRfEo5.js";import{S as W}from"./skeleton-CPsExHBt.js";import{A as O,a as V}from"./alert-BKLY_Sey.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-DOTf3B8r.js";import"./index-C3rnUhi0.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(` `),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},ne=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[m&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:m})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),u!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(u,r)},children:X(u,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:h&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),g=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default}; diff --git a/assets/AuthorDetailView-BT0wFF7e.js b/assets/AuthorDetailView-DDFAChyR.js similarity index 86% rename from assets/AuthorDetailView-BT0wFF7e.js rename to assets/AuthorDetailView-DDFAChyR.js index 67b6156374b3061bb98011581e264f1d43d8681d..e38e232490618cdc21bece0a1c7d10965780b21e 100644 --- a/assets/AuthorDetailView-BT0wFF7e.js +++ b/assets/AuthorDetailView-DDFAChyR.js @@ -1 +1 @@ -import{f as m,j as e,L as x,p as h}from"./index-CnNiludC.js";import{u as d}from"./useQuery-C87uSz9p.js";import{S as c}from"./skeleton-BU3tw6-C.js";import g from"./NotFound-B6qYFFtn.js";const N=()=>{var l,n,i,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((l=r.error)==null?void 0:l.status)===404?e.jsx(g,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((n=r.data)==null?void 0:n.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((i=r.data)==null?void 0:i.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(x,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{N as default}; +import{f as m,j as e,L as x,p as h}from"./index-W0d3uysl.js";import{u as d}from"./useQuery-vQc9wuoD.js";import{S as c}from"./skeleton-CPsExHBt.js";import g from"./NotFound-C0O3bfE-.js";const N=()=>{var l,n,i,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((l=r.error)==null?void 0:l.status)===404?e.jsx(g,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((n=r.data)==null?void 0:n.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((i=r.data)==null?void 0:i.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(x,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{N as default}; diff --git a/assets/BenchmarkDetailView-CJEQANf-.js b/assets/BenchmarkDetailView-DL9QgA3B.js similarity index 98% rename from assets/BenchmarkDetailView-CJEQANf-.js rename to assets/BenchmarkDetailView-DL9QgA3B.js index 73e18f3f12e2a25a8e000896166087d601ff294d..94cbb5d402d3d9f873b5ac2422a0c18c7982a5df 100644 --- a/assets/BenchmarkDetailView-CJEQANf-.js +++ b/assets/BenchmarkDetailView-DL9QgA3B.js @@ -1,2 +1,2 @@ -import{u as vt,r as w,j as n,O as se,h as jt,f as _t,a as kt,G as St,L as ue}from"./index-CnNiludC.js";import{u as ee}from"./useQuery-C87uSz9p.js";import{c as me}from"./catalog-D7qk7tAG.js";import{C as Ct,E as Et,e as Nt}from"./evaluations-imurwG7D.js";import{S as xe}from"./skeleton-BU3tw6-C.js";import{S as Je}from"./switch-BmJwxg75.js";import{A as Rt,a as $t}from"./alert-CV1yu6Q5.js";import{L as ye}from"./LatexTitle-B1FyT_-3.js";import{B as Tt}from"./BenchmarkTrendSparkline-DAxMFKnm.js";import{I as Mt}from"./components-skIcbldg.js";import{s as Ft}from"./safeExternalHref-CkBrsh84.js";import"./hover-card-CDhcGwFp.js";import"./index-D0hHQwos.js";import"./katex.min-BSBacQyE.js";import"./transform-zlVHQ5aE.js";function Lt(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 It(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 At=({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,ne=i-l-u,L=c-p-f,T=e.map(o=>Ze(o.date)),z=Math.min(...T),I=Math.max(...T),ae=I-z||1,Y=o=>z===I?l+ne/2:l+(o-z)/ae*ne,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}},ie=[],b=N.length>0?P(N[N.length-1]):null;let _e=-1/0;for(let o=0;ob.left-fe||(_e=m.right,ie.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ie.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=It(z,I),W=5,ce=o=>a(m=>m===o?null:m),le=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${se(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:()=>ce(o.idx),onFocus:()=>a(o.idx),onBlur:()=>ce(o.idx),onClick:()=>le(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),le(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:se(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"}}))}),ie.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}: ${se(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 Pt(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 Dt=(()=>{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 Ut(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 Wt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qt(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),Wt(a)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function zt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Gt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Kt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?zt(r):Gt(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=Dt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Kt(c,r,a,s)),t.appendChild(l)}function Qt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Xt={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 Yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Te(e){const t=Yt(e).toLowerCase();return Xt[t]||""}function Jt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Zt(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 er(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=er(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")||""),Jt(l)));a=Zt(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 tr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function rr(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=Te(r),a=await Me(r,s,t);return ve(a)}async function sr(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 nr(e,t){return A(e,HTMLCanvasElement)?tr(e):A(e,HTMLVideoElement)?rr(e,t):A(e,HTMLIFrameElement)?sr(e,t):e.cloneNode(ht(e))}const ar=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ir(e,t,r){var s,a;if(ht(t))return t;let i=[];return ar(e)&&e.assignedNodes?i=q(e.assignedNodes()):A(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||A(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function cr(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`),A(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 lr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function or(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function dr(e,t,r){return A(t,Element)&&(cr(e,t,r),Qt(e,t,r),lr(e,t),or(e,t)),t}async function ur(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;inr(s,t)).then(s=>ir(e,s,t)).then(s=>dr(e,s,t)).then(s=>ur(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,mr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,hr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function fr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function pr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function gr(e,t,r,s,a){try{const i=r?Pt(t,r):t,c=Te(t);let l;return a||(l=await Me(i,c,s)),e.replace(fr(t),`$1${l}$3`)}catch{}return e}function xr(e,{preferredFontFormat:t}){return t?e.replace(hr,r=>{for(;;){const[s,,a]=mr.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=xr(e,r);return pr(s).reduce((i,c)=>i.then(l=>gr(l,c,t,r)),Promise.resolve(s))}async function re(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 br(e,t){await re("background",e,t)||await re("background-image",e,t),await re("mask",e,t)||await re("-webkit-mask",e,t)||await re("mask-image",e,t)||await re("-webkit-mask-image",e,t)}async function yr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(A(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Te(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 wr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){A(e,Element)&&(await br(e,t),await yr(e,t),await wr(e,t))}function vr(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 jr(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 _r(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function kr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await jr(r,t);return _r(s)}function bt(e){return e.trim().replace(/["']/g,"")}function Sr(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 Cr(e,t){const r=await kr(e,t),s=Sr(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,O as se,h as jt,f as _t,a as kt,G as St,L as ue}from"./index-W0d3uysl.js";import{u as ee}from"./useQuery-vQc9wuoD.js";import{c as me}from"./catalog-C5kDa2mw.js";import{C as Ct,E as Et,e as Nt}from"./evaluations-ByQ-gfqI.js";import{S as xe}from"./skeleton-CPsExHBt.js";import{S as Je}from"./switch-C5eRfEo5.js";import{A as Rt,a as $t}from"./alert-BKLY_Sey.js";import{L as ye}from"./LatexTitle-CPXUtZtc.js";import{B as Tt}from"./BenchmarkTrendSparkline-D6Sf06U6.js";import{I as Mt}from"./components-DA5I2P56.js";import{s as Ft}from"./safeExternalHref-CkBrsh84.js";import"./hover-card-CPjdcVfA.js";import"./index-C3rnUhi0.js";import"./katex.min-BSBacQyE.js";import"./transform-a-eujQMz.js";function Lt(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 It(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 At=({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,ne=i-l-u,L=c-p-f,T=e.map(o=>Ze(o.date)),z=Math.min(...T),I=Math.max(...T),ae=I-z||1,Y=o=>z===I?l+ne/2:l+(o-z)/ae*ne,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}},ie=[],b=N.length>0?P(N[N.length-1]):null;let _e=-1/0;for(let o=0;ob.left-fe||(_e=m.right,ie.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ie.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=It(z,I),W=5,ce=o=>a(m=>m===o?null:m),le=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${se(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:()=>ce(o.idx),onFocus:()=>a(o.idx),onBlur:()=>ce(o.idx),onClick:()=>le(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),le(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:se(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"}}))}),ie.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}: ${se(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 Pt(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 Dt=(()=>{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 Ut(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 Wt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qt(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),Wt(a)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function zt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Gt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Kt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?zt(r):Gt(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=Dt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Kt(c,r,a,s)),t.appendChild(l)}function Qt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Xt={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 Yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Te(e){const t=Yt(e).toLowerCase();return Xt[t]||""}function Jt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Zt(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 er(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=er(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")||""),Jt(l)));a=Zt(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 tr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function rr(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=Te(r),a=await Me(r,s,t);return ve(a)}async function sr(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 nr(e,t){return A(e,HTMLCanvasElement)?tr(e):A(e,HTMLVideoElement)?rr(e,t):A(e,HTMLIFrameElement)?sr(e,t):e.cloneNode(ht(e))}const ar=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ir(e,t,r){var s,a;if(ht(t))return t;let i=[];return ar(e)&&e.assignedNodes?i=q(e.assignedNodes()):A(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||A(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function cr(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`),A(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 lr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function or(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function dr(e,t,r){return A(t,Element)&&(cr(e,t,r),Qt(e,t,r),lr(e,t),or(e,t)),t}async function ur(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;inr(s,t)).then(s=>ir(e,s,t)).then(s=>dr(e,s,t)).then(s=>ur(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,mr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,hr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function fr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function pr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function gr(e,t,r,s,a){try{const i=r?Pt(t,r):t,c=Te(t);let l;return a||(l=await Me(i,c,s)),e.replace(fr(t),`$1${l}$3`)}catch{}return e}function xr(e,{preferredFontFormat:t}){return t?e.replace(hr,r=>{for(;;){const[s,,a]=mr.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=xr(e,r);return pr(s).reduce((i,c)=>i.then(l=>gr(l,c,t,r)),Promise.resolve(s))}async function re(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 br(e,t){await re("background",e,t)||await re("background-image",e,t),await re("mask",e,t)||await re("-webkit-mask",e,t)||await re("mask-image",e,t)||await re("-webkit-mask-image",e,t)}async function yr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(A(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Te(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 wr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){A(e,Element)&&(await br(e,t),await yr(e,t),await wr(e,t))}function vr(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 jr(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 _r(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function kr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await jr(r,t);return _r(s)}function bt(e){return e.trim().replace(/["']/g,"")}function Sr(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 Cr(e,t){const r=await kr(e,t),s=Sr(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 Er(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Cr(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 Nr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Er(a,t),await xt(a,t),vr(a,t),await qt(a,r,s)}async function Rr(e,t={}){const{width:r,height:s}=ut(e,t),a=await Nr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Vt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ot(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 $r(e,t={}){const r=await Rr(e,t);return await Ut(r)}const $e="#ffffff";function Tr(){return typeof window>"u"?$e:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||$e}function Mr(e){if(typeof window>"u")return $e;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Tr():t}async function Fr(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 $r(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Mr(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 Fr(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(Mt,{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 Lr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Ir(e){const t=new Map;for(const r of e){const s=Lr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function 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 Ar(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 Pr=5;function Dr(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 es=()=>{var Le,Ie,Ae,Pe,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=ee({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>me.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=ee({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>Nt.byDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=ee({queryKey:["dataset-tasks",(Ae=x.data)==null?void 0:Ae.id],queryFn:()=>me.datasetTasks(x.data.id),enabled:!!((Pe=x.data)!=null&&Pe.id),staleTime:10*60*1e3}),ne=ee({queryKey:["metric-directions"],queryFn:()=>me.metricDirections(),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]),T=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,$=-1;for(const j of d){const de=h.get(j.id)||0;de>$&&($=de,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=ee({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>me.trendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((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]),ae=ee({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,T],queryFn:()=>me.leaderboardMetrics(x.data.id,T),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!T,staleTime:10*60*1e3}),Y=w.useMemo(()=>Lt(E.data,T,a.hide_closed_source_evals),[E.data,T,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Ir(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ae.data||[]).map(d=>d.metric_name),[ae.data]),P=J.length?J:fe,ie=w.useMemo(()=>{var S;if(H.length===0)return P[0]||"";const d=new Map;for(const $ of H)for(const j of Object.keys($.metrics||{}))J.length&&!P.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[$,j]of d)j>h&&(h=j,g=$);return g||P[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,P,J]),b=c||(L==null?void 0:L.best_metric)||ie,K=(((Ue=(Oe=ne.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!P.includes(b)?P:[b,...P.filter(d=>d!==b)],[P,b]),ce=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Pr),[W,b]),{points:le,sota:pe,sotaModel:o}=w.useMemo(()=>Ar(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ne.isSuccess&&(!T||ae.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 T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]);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(Rt,{variant:"destructive",children:n.jsx($t,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var $,j;const h=he(($=d.metrics)==null?void 0:$[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,oe=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Dr(_.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=!!oe||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${oe}`:`Paper ${oe}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(ue,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(ue,{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:se(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"}),oe?n.jsxs(ue,{to:`/paper/${oe}`,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:Ft(_.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(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})]})]}),le.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:[P.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(At,{points:le,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 $,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&&(($=R.metrics)==null?void 0:$[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,": ",se(S),g?" · ":""]}):null,d?n.jsx(ue,{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:[P.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"}),ce.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 $=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;$!==null&&((d===null||$!==d)&&(g=S+1,d=$),j=g);const de=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(Ct,{}),(h.external??h.is_external)&&n.jsx(Et,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),ce.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!==""?se(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:de?n.jsx(ue,{to:`/paper/${de}`,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{es as default}; diff --git a/assets/BenchmarkTrendSparkline-DAxMFKnm.js b/assets/BenchmarkTrendSparkline-D6Sf06U6.js similarity index 97% rename from assets/BenchmarkTrendSparkline-DAxMFKnm.js rename to assets/BenchmarkTrendSparkline-D6Sf06U6.js index 9beb49e4d31ff73bca5cb1b5781392cf93f1baa1..adf8fa79a432732af35a69107f06b89728847025 100644 --- a/assets/BenchmarkTrendSparkline-DAxMFKnm.js +++ b/assets/BenchmarkTrendSparkline-D6Sf06U6.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-CnNiludC.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-W0d3uysl.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-BqPqQClr.js b/assets/ChatMessage-CAxQh_v6.js similarity index 98% rename from assets/ChatMessage-BqPqQClr.js rename to assets/ChatMessage-CAxQh_v6.js index 3c1932ec8b5a80af1b9f93f1ab1323f4ae09bc54..6b37ad4b45d47aa85f4d8cc21f8e1f29f7185c44 100644 --- a/assets/ChatMessage-BqPqQClr.js +++ b/assets/ChatMessage-CAxQh_v6.js @@ -1,4 +1,4 @@ -import{d as L,r as C,j as e,R as f,C as B}from"./index-CnNiludC.js";import{u as O,a as q,b as D,M as J,R as Q,W as Z,p as F,A as ee,F as te,G as A,H as se}from"./chatSessions-B5wJO74B.js";import"./katex.min-BSBacQyE.js";import{H as R,a as M,b as H}from"./hover-card-CDhcGwFp.js";import{u as ae}from"./useQuery-C87uSz9p.js";import{f as re,p as ne}from"./github-6FmJETBJ.js";import{G as U}from"./github-CRO5e-fY.js";import{r as ie,a as oe,P as G}from"./PaperPreviewLink-DAFhnDhq.js";import{M as ce,r as le,d as de}from"./index-B8BJTSsG.js";import{F as ue}from"./file-text-CzoH1JKN.js";/** +import{d as L,r as C,j as e,R as f,C as B}from"./index-W0d3uysl.js";import{u as O,a as q,b as D,M as J,R as Q,W as Z,p as F,A as ee,F as te,G as A,H as se}from"./chatSessions-BMqD4j8C.js";import"./katex.min-BSBacQyE.js";import{H as R,a as M,b as H}from"./hover-card-CPjdcVfA.js";import{u as ae}from"./useQuery-vQc9wuoD.js";import{f as re,p as ne}from"./github-UfpFvTKs.js";import{G as U}from"./github-CVlHVGA6.js";import{r as ie,a as oe,P as G}from"./PaperPreviewLink-CRTwuY7t.js";import{M as ce,r as le,d as de}from"./index-B1HJ4Whn.js";import{F as ue}from"./file-text-DmyxYjhS.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatView-DRCYIPi4.js b/assets/ChatView-CgnMUN-T.js similarity index 99% rename from assets/ChatView-DRCYIPi4.js rename to assets/ChatView-CgnMUN-T.js index 215ed96f6717d24ab7d30860c9ff3eba804efb2f..cd0ca9bff63b2a694b0b61a0902efa5d273052da 100644 --- a/assets/ChatView-DRCYIPi4.js +++ b/assets/ChatView-CgnMUN-T.js @@ -1,4 +1,4 @@ -import{d as qt,e as Ze,r as c,j as r,f as Bt,u as Ht,a as Wt,g as Gt,h as Kt,k as $t,l as Vt,b as zt,X as Qt,c as Jt}from"./index-CnNiludC.js";import{u as Xt}from"./useQuery-C87uSz9p.js";import{C as St,U as Et,A as Zt}from"./ChatMessage-BqPqQClr.js";import{d as en,g as ct,t as Lt,r as tn,S as nn,P as rn,D as sn,l as an,C as Xe,e as ze,f as on,h as Qe,i as Je,j as cn,k as ln,m as un,n as Ct,o as dn,T as hn,p as kt,s as it,v as fn,w as pn,x as mn,y as gn}from"./chatSessions-B5wJO74B.js";import{S as yn}from"./chatPrompts-CDY3UGU1.js";import{u as bn,r as vn,a as _n,O as wn,b as xn}from"./openrouter-CSA2RSTl.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CDhcGwFp.js";import"./github-6FmJETBJ.js";import"./github-CRO5e-fY.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./file-text-CzoH1JKN.js";import"./chevron-down-Bjm5Iw9B.js";/** +import{d as qt,e as Ze,r as c,j as r,f as Bt,u as Ht,a as Wt,g as Gt,h as Kt,k as $t,l as Vt,b as zt,X as Qt,c as Jt}from"./index-W0d3uysl.js";import{u as Xt}from"./useQuery-vQc9wuoD.js";import{C as St,U as Et,A as Zt}from"./ChatMessage-CAxQh_v6.js";import{d as en,g as ct,t as Lt,r as tn,S as nn,P as rn,D as sn,l as an,C as Xe,e as ze,f as on,h as Qe,i as Je,j as cn,k as ln,m as un,n as Ct,o as dn,T as hn,p as kt,s as it,v as fn,w as pn,x as mn,y as gn}from"./chatSessions-BMqD4j8C.js";import{S as yn}from"./chatPrompts-CDY3UGU1.js";import{u as bn,r as vn,a as _n,O as wn,b as xn}from"./openrouter-HpeJ3LPX.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CPjdcVfA.js";import"./github-UfpFvTKs.js";import"./github-CVlHVGA6.js";import"./PaperPreviewLink-CRTwuY7t.js";import"./index-B1HJ4Whn.js";import"./file-text-DmyxYjhS.js";import"./chevron-down-CmhJtq6c.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ConferenceDetailView-BP5drqUx.js b/assets/ConferenceDetailView-DYomCgtB.js similarity index 93% rename from assets/ConferenceDetailView-BP5drqUx.js rename to assets/ConferenceDetailView-DYomCgtB.js index 7c4497016be6160c37369365f3bf260c28038266..c5806944de36746e2b0743e3ed537961b14a1083 100644 --- a/assets/ConferenceDetailView-BP5drqUx.js +++ b/assets/ConferenceDetailView-DYomCgtB.js @@ -1 +1 @@ -import{f as L,r as D,j as e,L as p}from"./index-CnNiludC.js";import{u as T}from"./useQuery-C87uSz9p.js";import{M as F}from"./MarkdownText-mvLqNfwe.js";import{c as A}from"./catalog-D7qk7tAG.js";import{c as B,h as C,d as E}from"./transform-zlVHQ5aE.js";import{S as f}from"./skeleton-BU3tw6-C.js";import{A as P,a as z}from"./alert-CV1yu6Q5.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},Z=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?O(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{Z as default}; +import{f as L,r as D,j as e,L as p}from"./index-W0d3uysl.js";import{u as T}from"./useQuery-vQc9wuoD.js";import{M as F}from"./MarkdownText-79sq6Tks.js";import{c as A}from"./catalog-C5kDa2mw.js";import{c as B,h as C,d as E}from"./transform-a-eujQMz.js";import{S as f}from"./skeleton-CPsExHBt.js";import{A as P,a as z}from"./alert-BKLY_Sey.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-CRTwuY7t.js";import"./index-B1HJ4Whn.js";import"./hover-card-CPjdcVfA.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},Z=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?O(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{Z as default}; diff --git a/assets/ConferenceTaskView-DeQ10q-x.js b/assets/ConferenceTaskView-mNatIt13.js similarity index 88% rename from assets/ConferenceTaskView-DeQ10q-x.js rename to assets/ConferenceTaskView-mNatIt13.js index 7657363c935b63c88c0b4333abeb3cddf2e259c0..660de6e8283f82c460b7987ad9b565136b743e86 100644 --- a/assets/ConferenceTaskView-DeQ10q-x.js +++ b/assets/ConferenceTaskView-mNatIt13.js @@ -1 +1 @@ -import{f as $,a as D,r as x,j as e,L as b,R as W}from"./index-CnNiludC.js";import{u as M}from"./useQuery-C87uSz9p.js";import{P as G}from"./components-skIcbldg.js";import{u as J,P as X}from"./useIntersectionObserver-BUxW5ZLf.js";import{M as h}from"./MarkdownText-mvLqNfwe.js";import{c as z}from"./catalog-D7qk7tAG.js";import{t as Y,d as Z}from"./transform-zlVHQ5aE.js";import{c as ee}from"./usePapers-C15Wpgxo.js";import{S as se}from"./skeleton-BU3tw6-C.js";import{A as ae,a as te}from"./alert-CV1yu6Q5.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.js";import"./useInfiniteQuery-DulZ-zOj.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var A,F,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",a],queryFn:()=>z.getConference(a),enabled:!!a,staleTime:10*60*1e3}),f=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:R}=J({rootMargin:"200px"});x.useEffect(()=>{R&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[R,i.hasNextPage,i.isFetchingNextPage]),x.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=x.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=x.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((A=f.data)==null?void 0:A.name)||n||"",((F=f.data)==null?void 0:F.slug)||n),C=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=f.data;return m.error||f.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:C.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",C.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(X,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{be as default}; +import{f as $,a as D,r as x,j as e,L as b,R as W}from"./index-W0d3uysl.js";import{u as M}from"./useQuery-vQc9wuoD.js";import{P as G}from"./components-DA5I2P56.js";import{u as J,P as X}from"./useIntersectionObserver-C1k1BF8O.js";import{M as h}from"./MarkdownText-79sq6Tks.js";import{c as z}from"./catalog-C5kDa2mw.js";import{t as Y,d as Z}from"./transform-a-eujQMz.js";import{c as ee}from"./usePapers-CQOaIFi3.js";import{S as se}from"./skeleton-CPsExHBt.js";import{A as ae,a as te}from"./alert-BKLY_Sey.js";import"./LatexTitle-CPXUtZtc.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-CRTwuY7t.js";import"./index-B1HJ4Whn.js";import"./hover-card-CPjdcVfA.js";import"./useInfiniteQuery-JgP-qE09.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var A,F,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",a],queryFn:()=>z.getConference(a),enabled:!!a,staleTime:10*60*1e3}),f=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:R}=J({rootMargin:"200px"});x.useEffect(()=>{R&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[R,i.hasNextPage,i.isFetchingNextPage]),x.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=x.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=x.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((A=f.data)==null?void 0:A.name)||n||"",((F=f.data)==null?void 0:F.slug)||n),C=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=f.data;return m.error||f.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:C.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",C.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(X,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{be as default}; diff --git a/assets/ConferencesIndexView-ESNh5pHs.js b/assets/ConferencesIndexView-1eSAeZYb.js similarity index 87% rename from assets/ConferencesIndexView-ESNh5pHs.js rename to assets/ConferencesIndexView-1eSAeZYb.js index 2fa67dcc02e1c147905c76e91a912a6ae72d163e..e3dd53a68b8ff6b8b8c56bbac8ff87ded2f089ed 100644 --- a/assets/ConferencesIndexView-ESNh5pHs.js +++ b/assets/ConferencesIndexView-1eSAeZYb.js @@ -1 +1 @@ -import{r as u,j as e,L as d}from"./index-CnNiludC.js";import{u as p}from"./useQuery-C87uSz9p.js";import{c as f}from"./catalog-D7qk7tAG.js";import{S as m}from"./skeleton-BU3tw6-C.js";import{A as h,a as g}from"./alert-CV1yu6Q5.js";import{T as x}from"./TaxonomySuggestionTile-DPjYd5AL.js";import"./SignInToEditDialog-ByW2mx_A.js";import"./button-Cb-e5tHG.js";import"./textarea-DuxG42Qe.js";import"./dialog-COYv9g-7.js";import"./useMutation-CZOEaG9X.js";import"./loader-circle-3AJg82rJ.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},B=()=>{const r=p({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{B as default}; +import{r as u,j as e,L as d}from"./index-W0d3uysl.js";import{u as p}from"./useQuery-vQc9wuoD.js";import{c as f}from"./catalog-C5kDa2mw.js";import{S as m}from"./skeleton-CPsExHBt.js";import{A as h,a as g}from"./alert-BKLY_Sey.js";import{T as x}from"./TaxonomySuggestionTile-C5fAeYBQ.js";import"./SignInToEditDialog-aDxqeILo.js";import"./button-BCHGalXc.js";import"./textarea-D8WJ-V7X.js";import"./dialog-DOTf3B8r.js";import"./useMutation-BMLNTksL.js";import"./loader-circle-BkFdIra2.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},B=()=>{const r=p({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{B as default}; diff --git a/assets/CronDashboard-BWvUvwNE.js b/assets/CronDashboard-BWvUvwNE.js new file mode 100644 index 0000000000000000000000000000000000000000..b6b6111f36869625f3c3691b11c71051fdd9e3fd --- /dev/null +++ b/assets/CronDashboard-BWvUvwNE.js @@ -0,0 +1,56 @@ +import{d as C,r as m,j as e,v as y,y as He,n as Be,m as W,Q as We,z as Ue,I as ze,q as K,P as Ke,t as Qe,B as he,L as Ge,k as Ve,g as Xe,b as Ye,c as H}from"./index-W0d3uysl.js";import{u as E}from"./useQuery-vQc9wuoD.js";import{B as w,D as te,f as Ze}from"./codexAddEvals-BYyAthFq.js";import{B as A}from"./button-BCHGalXc.js";import{C as es}from"./chevron-down-CmhJtq6c.js";import{F as ie}from"./file-text-DmyxYjhS.js";import{C as D,R as ce,S as ss}from"./shield-alert-DCTkHXsf.js";import{L as S}from"./loader-circle-BkFdIra2.js";import{C as V}from"./circle-check-ChtT1K-E.js";import{E as ue}from"./external-link-C-XvH9CF.js";import{u as le}from"./useMutation-BMLNTksL.js";import{u as as}from"./useInfiniteQuery-JgP-qE09.js";import{c as Q}from"./catalog-C5kDa2mw.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 B=C("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @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 oe=C("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + * @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 rs=C("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @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 ns=C("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @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 ts=C("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** + * @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 is=C("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/** + * @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 cs=C("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** + * @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 pe=C("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @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 ls=C("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/** + * @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 os=C("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + * @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 ge=C("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),h=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));h.displayName="Card";const v=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("flex flex-col space-y-1.5 p-6",s),...a}));v.displayName="CardHeader";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:y("text-2xl font-semibold leading-none tracking-tight",s),...a}));N.displayName="CardTitle";const k=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:y("text-sm text-muted-foreground",s),...a}));k.displayName="CardDescription";const u=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("p-6 pt-0",s),...a}));u.displayName="CardContent";const ds=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("flex items-center p-6 pt-0",s),...a}));ds.displayName="CardFooter";var U="Tabs",[ms]=Qe(U,[he]),je=he(),[xs,X]=ms(U),fe=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:c,defaultValue:d,orientation:x="horizontal",dir:o,activationMode:i="automatic",...g}=s,p=He(o),[b,l]=Be({prop:n,onChange:c,defaultProp:d??"",caller:U});return e.jsx(xs,{scope:r,baseId:We(),value:b,onValueChange:l,orientation:x,dir:p,activationMode:i,children:e.jsx(W.div,{dir:p,"data-orientation":x,...g,ref:a})})});fe.displayName=U;var ve="TabsList",Ne=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...c}=s,d=X(ve,r),x=je(r);return e.jsx(Ue,{asChild:!0,...x,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(W.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});Ne.displayName=ve;var be="TabsTrigger",ye=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:c=!1,...d}=s,x=X(be,r),o=je(r),i=ke(x.baseId,n),g=Ce(x.baseId,n),p=n===x.value;return e.jsx(ze,{asChild:!0,...o,focusable:!c,active:p,children:e.jsx(W.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":g,"data-state":p?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:i,...d,ref:a,onMouseDown:K(s.onMouseDown,b=>{!c&&b.button===0&&b.ctrlKey===!1?x.onValueChange(n):b.preventDefault()}),onKeyDown:K(s.onKeyDown,b=>{[" ","Enter"].includes(b.key)&&x.onValueChange(n)}),onFocus:K(s.onFocus,()=>{const b=x.activationMode!=="manual";!p&&!c&&b&&x.onValueChange(n)})})})});ye.displayName=be;var _e="TabsContent",we=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:c,children:d,...x}=s,o=X(_e,r),i=ke(o.baseId,n),g=Ce(o.baseId,n),p=n===o.value,b=m.useRef(p);return m.useEffect(()=>{const l=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(l)},[]),e.jsx(Ke,{present:c||p,children:({present:l})=>e.jsx(W.div,{"data-state":p?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":i,hidden:!l,id:g,tabIndex:0,...x,ref:a,style:{...s.style,animationDuration:b.current?"0s":void 0},children:l&&d})})});we.displayName=_e;function ke(s,a){return`${s}-trigger-${a}`}function Ce(s,a){return`${s}-content-${a}`}var hs=fe,Se=Ne,$e=ye,Re=we;const us=hs,Te=m.forwardRef(({className:s,...a},r)=>e.jsx(Se,{ref:r,className:y("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Te.displayName=Se.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx($e,{ref:r,className:y("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));L.displayName=$e.displayName;const F=m.forwardRef(({className:s,...a},r)=>e.jsx(Re,{ref:r,className:y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));F.displayName=Re.displayName;function f(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),c=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:c<24?`${c}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Le(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function Fe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function Y(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const ps={healthy:V,degraded:ge,broken:D,running:S,stuck:D,unknown:ns};function gs({status:s,isRunning:a}){const r=a?"running":s,n=ps[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function de({label:s,axis:a}){return e.jsxs(w,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function me({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([n,c])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Y(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof c=="number"?c.toLocaleString():c})]},n))})]})}function js({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(B,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",Fe(s)],...s.updated_at?[["Updated",f(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(w,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(w,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function fs(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function vs({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"outline",className:fs(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(ue,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",f(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",f(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",Le(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function Ns({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ls,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,c])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Y(n)}),e.jsx("div",{className:"text-lg font-semibold",children:c.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(vs,{job:n},n.id))})]})]})}function bs({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:c=!1,paperMarkdownJobsError:d=null}){const x=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),i=s.job_name==="paper_markdown_backfill";return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(gs,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(w,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(w,{variant:"outline",className:"cron-status--broken",children:"Held lock"}),e.jsx(de,{label:"Execution",axis:s.execution_health}),e.jsx(de,{label:"Output",axis:s.output_health}),a?e.jsx(rs,{className:"h-4 w-4 cron-muted"}):e.jsx(es,{className:"h-4 w-4 cron-muted"})]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(pe,{}),"Log: ",f(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(te,{}),"DB: ",f(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(os,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(B,{}),"Duration: ",Le(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(oe,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ie,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(B,{}),"Actions: ",Fe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(w,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&!0&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",f(s.execution_health.last_expected_at??null)],["Last started",f(s.execution_health.last_started_at??null)],["Last completed",f(s.execution_health.last_completed_at??null)],["Next expected",f(s.execution_health.next_expected_at??null)]].map(([p,b])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:p}),e.jsx("span",{children:b})]},p))})]}),s.work_metrics&&x&&e.jsx(me,{icon:ie,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(me,{icon:te,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(js,{workflow:s.workflow_status}),i&&e.jsx(Ns,{monitor:n,loading:c,error:d}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(p=>p.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ge,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,p])=>p.length>0).map(([p,b])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:Y(p)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:b.map(l=>e.jsx("li",{children:l},l))})]},p))})]})]})})]})}const Pe=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:y("w-full caption-bottom text-sm",s),...a})}));Pe.displayName="Table";const Me=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:y("[&_tr]:border-b",s),...a}));Me.displayName="TableHeader";const Ae=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:y("[&_tr:last-child]:border-0",s),...a}));Ae.displayName="TableBody";const ys=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));ys.displayName="TableFooter";const G=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:y("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));G.displayName="TableRow";const P=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:y("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));P.displayName="TableHead";const M=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:y("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));M.displayName="TableCell";const _s=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:y("mt-4 text-sm text-muted-foreground",s),...a}));_s.displayName="TableCaption";const ws={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},ks={"add-evals":"Add evals","enrich-paper":"Enrich paper"},Cs={queued:cs,dispatching:S,running:ts,completed:V,failed:D,canceled:is};function Ss({status:s}){const a=Cs[s];return e.jsxs(w,{variant:"outline",className:ws[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function $s(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function Rs({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:c,error:d}=E({queryKey:["codexPaperJobs",a],queryFn:()=>Ze(100),refetchInterval:s?1e4:!1,retry:!1}),x=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(h,{className:"mb-8",children:[e.jsx(v,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(k,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),c&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(u,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(S,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&x!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),x===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(o=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:o}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[o]})]},o)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(Pe,{children:[e.jsx(Me,{children:e.jsxs(G,{children:[e.jsx(P,{children:"Status"}),e.jsx(P,{children:"Paper"}),e.jsx(P,{children:"Action"}),e.jsx(P,{children:"Requested"}),e.jsx(P,{children:"Execution"})]})}),e.jsx(Ae,{children:r.jobs.map(o=>{const i=$s(o);return e.jsxs(G,{children:[e.jsx(M,{className:"align-top",children:e.jsx(Ss,{status:o.status})}),e.jsxs(M,{className:"min-w-[260px] align-top",children:[e.jsx(Ge,{to:`/paper/${encodeURIComponent(o.paper_route)}`,className:"font-medium hover:underline",children:o.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",o.paper_id]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[ks[o.kind],o.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(V,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:f(o.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",o.requested_by]})]}),e.jsxs(M,{className:"max-w-[360px] align-top",children:[o.hf_job_url?e.jsxs("a",{href:o.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(ue,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),i&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${o.error?"text-red-700":"cron-muted"}`,title:i,children:i})]})]},o.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",f(r.timestamp)]})]})]})]})}const Ts=()=>{var d,x,o;const s=Ve(),a=as({queryKey:["catalog-audit"],queryFn:({pageParam:i})=>Q.audit(i),initialPageParam:void 0,getNextPageParam:i=>i.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(i=>i.events))??[],n=le({mutationFn:()=>Q.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),c=le({mutationFn:i=>Q.rollbackEvent(i),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(h,{children:[e.jsxs(v,{className:"flex-row items-center justify-between",children:[e.jsx(N,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((o=(x=a.data)==null?void 0:x.pages[0])==null?void 0:o.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(A,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(u,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(i=>e.jsxs("article",{className:`rounded-md border p-3 ${i.operation==="delete"||i.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[i.operation," ",i.entity_type," ",i.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",i.actor_username??i.actor_role," ·"," ",new Date(i.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:i.before,after:i.after},null,2)})]}),!i.rollback_of_event_id&&e.jsx(A,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>c.mutate(i.id),disabled:c.isPending||i.rollback_eligible===!1,children:i.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},i.id)),a.hasNextPage&&e.jsx(A,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},xe={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},_=s=>`$${(s/1e6).toFixed(2)}`,Ls=({data:s,loading:a,error:r})=>{const[n,c]=m.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(S,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const x=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),o=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",i=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(h,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Circuit"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:o}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Month to date"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(x),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${x}%`}})})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Application headroom"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",_(s.application_cap_microusd)]})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Live compute"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(h,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Accounting and policy"}),e.jsxs(k,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(u,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:n,onChange:g=>c(g.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[n]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),_(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),_(s.provider_floor_microusd)," · ",e.jsx(w,{children:i})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${_(s.environment_cap_microusd)}`," · Workspace ",_(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",_(s.warning_microusd)," · trip ",_(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),f(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?f(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?f(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${f(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${f(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${_(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${f(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${_(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{children:"Live lifecycle"})}),e.jsx(u,{className:"text-sm",children:Object.entries(s.live_states).map(([g,p])=>e.jsxs("span",{className:"mr-4",children:[g,": ",p]},g))})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{children:"Daily spend"})}),e.jsx(u,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(g=>e.jsxs("li",{children:[g.date,": blank ",_(g.blank_pool_microusd)," · assigned ",_(g.assigned_microusd)]},g.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(h,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Recent circuit events"}),e.jsx(k,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(u,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(g=>e.jsxs("li",{children:[e.jsx(w,{children:g.severity})," ",g.type," · ",f(g.created_at)]},g.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Fs=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(S,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(r||!s)return e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const n=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(h,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Web search"}),e.jsxs(k,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(u,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${n}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",f(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${f(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(c=>e.jsxs("li",{children:[c.type," · ",f(c.created_at),c.error_class?` · ${c.error_class}`:""]},c.id))})]})]})},Ps=({data:s})=>s!=null&&s.snapshot_stale?e.jsx(h,{className:"mb-6 cron-status--degraded",role:"status",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Refreshing status… Current snapshot is ",Math.ceil(s.snapshot_age_seconds)," seconds old."]})]})})}):null,Ms=(s,a)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?1e3:a?3e4:!1,Gs=()=>{const s=Ye(),[a,r]=m.useState(!0),[n,c]=m.useState(0),[d,x]=m.useState(""),[o,i]=m.useState(""),[g,p]=m.useState(new Set),b=m.useRef(!1),{user:l}=Xe(),{data:j,isLoading:Z,isFetching:ee,error:$,refetch:Ee}=E({queryKey:["cronStatus",l==null?void 0:l.username],queryFn:()=>{const t=b.current;return b.current=!1,H.getCronStatus(t)},enabled:!!(l!=null&&l.is_admin),refetchInterval:t=>Ms(t.state.data,a),retry:!1}),I=E({queryKey:["paperMarkdownJobs",l==null?void 0:l.username],queryFn:()=>H.getPaperMarkdownJobs(),enabled:!!(l!=null&&l.is_admin),refetchInterval:a?3e4:!1,retry:!1}),q=E({queryKey:["chatSandboxSpend",l==null?void 0:l.username,o],queryFn:()=>H.getChatSandboxSpend(o||void 0),enabled:!!(l!=null&&l.is_admin),refetchInterval:a?3e4:!1,retry:!1}),z=E({queryKey:["chatWebSearchBudget",l==null?void 0:l.username],queryFn:()=>H.getChatWebSearchBudget(),enabled:!!(l!=null&&l.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),se=($&&typeof $=="object"&&"status"in $?$.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":$ instanceof Error?$.message:void 0,De=t=>{p(R=>{const T=new Set(R);return T.has(t)?T.delete(t):T.add(t),T})},ae=(j==null?void 0:j.jobs.filter(t=>t.dashboard_group==="leaderboard_sync"))??[],re=(j==null?void 0:j.jobs.filter(t=>t.category!=="manual"&&t.dashboard_group!=="leaderboard_sync"))??[],Ie=re.filter(t=>t.critical),qe=re.filter(t=>!t.critical),ne=(j==null?void 0:j.manual_operations)??[],J=qe.reduce((t,R)=>(t[R.category]||(t[R.category]=[]),t[R.category].push(R),t),{}),Je=Object.keys(J).sort((t,R)=>{const T=["systemd","hourly","daily","weekly","backfill"];return T.indexOf(t)-T.indexOf(R)}),O=t=>e.jsx(bs,{job:t,expanded:g.has(t.job_name),onToggle:()=>De(t.job_name),paperMarkdownJobs:t.job_name==="paper_markdown_backfill"?I.data:void 0,paperMarkdownJobsLoading:t.job_name==="paper_markdown_backfill"?I.isLoading:!1,paperMarkdownJobsError:t.job_name==="paper_markdown_backfill"?I.error:null},t.job_name),Oe=()=>{c(t=>t+1),b.current=!0,Ee(),I.refetch(),q.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(B,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>r(!a),className:a?"cron-status--running":"",children:[e.jsx(ce,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(A,{variant:"outline",size:"sm",onClick:Oe,disabled:ee,children:[e.jsx(ce,{className:`h-4 w-4 mr-2 ${ee?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(h,{className:"mb-6",children:e.jsx(u,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",l==null?void 0:l.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsx(Ps,{data:j}),e.jsxs(us,{defaultValue:"critical-jobs",children:[e.jsxs(Te,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(L,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(F,{value:"critical-jobs",className:"mt-6",children:[Z&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),$&&e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(D,{className:"h-5 w-5"}),e.jsx("p",{children:se??"Failed to load CRON jobs status. Please try again."})]})})}),j&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(t=>e.jsxs(h,{children:[e.jsx(v,{className:"pb-2",children:e.jsx(N,{className:"text-sm font-medium cron-muted capitalize",children:t})}),e.jsx(u,{children:e.jsx("div",{className:"text-2xl font-bold",children:j.summary[t]})})]},t))}),j.summary.critical_issues.length>0&&e.jsxs(h,{className:"mb-6 cron-status--broken",children:[e.jsx(v,{children:e.jsxs(N,{className:"flex items-center gap-2",children:[e.jsx(ss,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(u,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:j.summary.critical_issues.map(t=>e.jsx("li",{children:t},t))})})]}),e.jsxs(h,{className:"mb-8",children:[e.jsx(v,{children:e.jsx(N,{className:"text-base",children:"What to check next"})}),e.jsxs(u,{children:[e.jsx("p",{className:"text-sm cron-muted",children:j.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(pe,{className:"h-4 w-4"}),"Last updated: ",f(j.timestamp)," · Health score:"," ",j.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(h,{className:`mb-8 ${j.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-base",children:"Coverage"}),e.jsx(k,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(u,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(h,{className:"mb-8",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Critical jobs"}),e.jsx(k,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(u,{className:"space-y-4",children:Ie.map(O)})]}),e.jsx("div",{className:"space-y-6",children:Je.map(t=>e.jsxs(h,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(N,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:xe[t]??xe.hourly,children:t}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(k,{children:[J[t].length," job",J[t].length!==1?"s":""]})]})}),e.jsx(u,{className:"space-y-4",children:J[t].map(O)})]},t))}),ne.length>0&&e.jsxs(h,{className:"mt-6",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Manual operations"}),e.jsx(k,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(u,{className:"space-y-4",children:ne.map(O)})]})]})]}),e.jsxs(F,{value:"leaderboard-syncs",className:"mt-6",children:[Z&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),$&&e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(D,{className:"h-5 w-5"}),e.jsx("p",{children:se??"Failed to load leaderboard sync status. Please try again."})]})})}),j&&e.jsxs(h,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(k,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(w,{children:[ae.length," jobs"]})]})}),e.jsx(u,{className:"space-y-4",children:ae.map(O)})]})]}),e.jsx(F,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(Rs,{autoRefresh:a,refreshToken:n})}),e.jsx(F,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ts,{})}),e.jsxs(F,{value:"chat-compute",className:"mt-6",children:[e.jsxs(h,{className:"mb-6",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Environment record"}),e.jsx(k,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(u,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:d,onChange:t=>x(t.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(A,{onClick:()=>i(d.trim()),children:"Load"})]})]}),e.jsx(Ls,{data:q.data,loading:q.isLoading,error:q.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Fs,{data:z.data,loading:z.isLoading,error:z.error})})]})]})]})})};export{Ls as ChatComputePanel,Ps as CronSnapshotNotice,Fs as WebSearchBudgetPanel,Ms as cronStatusRefetchInterval,Gs as default}; diff --git a/assets/CronDashboard-Bo73phUc.js b/assets/CronDashboard-Bo73phUc.js deleted file mode 100644 index 551553197ad2a4044f5dd4f6b833d4e2fcd01898..0000000000000000000000000000000000000000 --- a/assets/CronDashboard-Bo73phUc.js +++ /dev/null @@ -1,56 +0,0 @@ -import{d as k,r as x,j as e,v as b,y as Oe,n as He,m as B,Q as Be,z as We,I as Ue,q as z,P as ze,t as Ke,B as xe,L as Qe,k as Ge,g as Ve,b as Xe,c as O}from"./index-CnNiludC.js";import{u as A}from"./useQuery-C87uSz9p.js";import{B as _,D as ne,f as Ye}from"./codexAddEvals-DIZEZyhj.js";import{B as M}from"./button-Cb-e5tHG.js";import{C as Ze}from"./chevron-down-Bjm5Iw9B.js";import{F as te}from"./file-text-CzoH1JKN.js";import{C as E,R as ie,S as es}from"./shield-alert-BRQa4qRa.js";import{L as C}from"./loader-circle-3AJg82rJ.js";import{C as G}from"./circle-check-BO6NSWAF.js";import{E as he}from"./external-link-05AgYo3a.js";import{u as ce}from"./useMutation-CZOEaG9X.js";import{u as ss}from"./useInfiniteQuery-DulZ-zOj.js";import{c as K}from"./catalog-D7qk7tAG.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 H=k("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** - * @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 le=k("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** - * @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 as=k("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @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 rs=k("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** - * @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 ns=k("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** - * @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 ts=k("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/** - * @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 is=k("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** - * @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 ue=k("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** - * @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 cs=k("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/** - * @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 ls=k("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** - * @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 pe=k("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),u=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));u.displayName="Card";const v=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("flex flex-col space-y-1.5 p-6",s),...a}));v.displayName="CardHeader";const N=x.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:b("text-2xl font-semibold leading-none tracking-tight",s),...a}));N.displayName="CardTitle";const w=x.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:b("text-sm text-muted-foreground",s),...a}));w.displayName="CardDescription";const p=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("p-6 pt-0",s),...a}));p.displayName="CardContent";const os=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("flex items-center p-6 pt-0",s),...a}));os.displayName="CardFooter";var W="Tabs",[ds]=Ke(W,[xe]),ge=xe(),[ms,V]=ds(W),je=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:l,defaultValue:m,orientation:h="horizontal",dir:o,activationMode:c="automatic",...j}=s,g=Oe(o),[i,d]=He({prop:n,onChange:l,defaultProp:m??"",caller:W});return e.jsx(ms,{scope:r,baseId:Be(),value:i,onValueChange:d,orientation:h,dir:g,activationMode:c,children:e.jsx(B.div,{dir:g,"data-orientation":h,...j,ref:a})})});je.displayName=W;var fe="TabsList",ve=x.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...l}=s,m=V(fe,r),h=ge(r);return e.jsx(We,{asChild:!0,...h,orientation:m.orientation,dir:m.dir,loop:n,children:e.jsx(B.div,{role:"tablist","aria-orientation":m.orientation,...l,ref:a})})});ve.displayName=fe;var Ne="TabsTrigger",be=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:l=!1,...m}=s,h=V(Ne,r),o=ge(r),c=we(h.baseId,n),j=ke(h.baseId,n),g=n===h.value;return e.jsx(Ue,{asChild:!0,...o,focusable:!l,active:g,children:e.jsx(B.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":j,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...m,ref:a,onMouseDown:z(s.onMouseDown,i=>{!l&&i.button===0&&i.ctrlKey===!1?h.onValueChange(n):i.preventDefault()}),onKeyDown:z(s.onKeyDown,i=>{[" ","Enter"].includes(i.key)&&h.onValueChange(n)}),onFocus:z(s.onFocus,()=>{const i=h.activationMode!=="manual";!g&&!l&&i&&h.onValueChange(n)})})})});be.displayName=Ne;var ye="TabsContent",_e=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:l,children:m,...h}=s,o=V(ye,r),c=we(o.baseId,n),j=ke(o.baseId,n),g=n===o.value,i=x.useRef(g);return x.useEffect(()=>{const d=requestAnimationFrame(()=>i.current=!1);return()=>cancelAnimationFrame(d)},[]),e.jsx(ze,{present:l||g,children:({present:d})=>e.jsx(B.div,{"data-state":g?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:j,tabIndex:0,...h,ref:a,style:{...s.style,animationDuration:i.current?"0s":void 0},children:d&&m})})});_e.displayName=ye;function we(s,a){return`${s}-trigger-${a}`}function ke(s,a){return`${s}-content-${a}`}var xs=je,Ce=ve,Se=be,$e=_e;const hs=xs,Te=x.forwardRef(({className:s,...a},r)=>e.jsx(Ce,{ref:r,className:b("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Te.displayName=Ce.displayName;const L=x.forwardRef(({className:s,...a},r)=>e.jsx(Se,{ref:r,className:b("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));L.displayName=Se.displayName;const R=x.forwardRef(({className:s,...a},r)=>e.jsx($e,{ref:r,className:b("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));R.displayName=$e.displayName;function f(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),l=Math.floor(r/36e5),m=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:l<24?`${l}h ago`:m<7?`${m}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Le(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function Re(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function X(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const us={healthy:G,degraded:pe,broken:E,running:C,stuck:E,unknown:rs};function ps({status:s,isRunning:a}){const r=a?"running":s,n=us[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function oe({label:s,axis:a}){return e.jsxs(_,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function de({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof l=="number"?l.toLocaleString():l})]},n))})]})}function gs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(H,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",Re(s)],...s.updated_at?[["Updated",f(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(_,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(_,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function js(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function fs({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",className:js(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(he,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",f(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",f(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",Le(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function vs({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(cs,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(C,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:l.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(fs,{job:n},n.id))})]})]})}function Ns({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:l=!1,paperMarkdownJobsError:m=null}){const h=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),c=s.job_name==="paper_markdown_backfill";return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(ps,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(_,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(_,{variant:"outline",className:"cron-status--broken",children:"Held lock"}),e.jsx(oe,{label:"Execution",axis:s.execution_health}),e.jsx(oe,{label:"Output",axis:s.output_health}),a?e.jsx(as,{className:"h-4 w-4 cron-muted"}):e.jsx(Ze,{className:"h-4 w-4 cron-muted"})]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(ue,{}),"Log: ",f(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(ne,{}),"DB: ",f(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ls,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Duration: ",Le(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(le,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(te,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Actions: ",Re(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(_,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&!0&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(le,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",f(s.execution_health.last_expected_at??null)],["Last started",f(s.execution_health.last_started_at??null)],["Last completed",f(s.execution_health.last_completed_at??null)],["Next expected",f(s.execution_health.next_expected_at??null)]].map(([g,i])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:g}),e.jsx("span",{children:i})]},g))})]}),s.work_metrics&&h&&e.jsx(de,{icon:te,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(de,{icon:ne,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(gs,{workflow:s.workflow_status}),c&&e.jsx(vs,{monitor:n,loading:l,error:m}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(g=>g.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(pe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,g])=>g.length>0).map(([g,i])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:X(g)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:i.map(d=>e.jsx("li",{children:d},d))})]},g))})]})]})})]})}const Fe=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:b("w-full caption-bottom text-sm",s),...a})}));Fe.displayName="Table";const Pe=x.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:b("[&_tr]:border-b",s),...a}));Pe.displayName="TableHeader";const Me=x.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:b("[&_tr:last-child]:border-0",s),...a}));Me.displayName="TableBody";const bs=x.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:b("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));bs.displayName="TableFooter";const Q=x.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:b("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));Q.displayName="TableRow";const F=x.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:b("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));F.displayName="TableHead";const P=x.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:b("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));P.displayName="TableCell";const ys=x.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:b("mt-4 text-sm text-muted-foreground",s),...a}));ys.displayName="TableCaption";const _s={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},ws={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ks={queued:is,dispatching:C,running:ns,completed:G,failed:E,canceled:ts};function Cs({status:s}){const a=ks[s];return e.jsxs(_,{variant:"outline",className:_s[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function Ss(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function $s({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:l,error:m}=A({queryKey:["codexPaperJobs",a],queryFn:()=>Ye(100),refetchInterval:s?1e4:!1,retry:!1}),h=m&&typeof m=="object"&&"status"in m?m.status:void 0;return e.jsxs(u,{className:"mb-8",children:[e.jsx(v,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(w,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),l&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(p,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(C,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),m&&h!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:m instanceof Error?m.message:"Could not load Codex paper jobs."}),h===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(o=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:o}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[o]})]},o)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(Fe,{children:[e.jsx(Pe,{children:e.jsxs(Q,{children:[e.jsx(F,{children:"Status"}),e.jsx(F,{children:"Paper"}),e.jsx(F,{children:"Action"}),e.jsx(F,{children:"Requested"}),e.jsx(F,{children:"Execution"})]})}),e.jsx(Me,{children:r.jobs.map(o=>{const c=Ss(o);return e.jsxs(Q,{children:[e.jsx(P,{className:"align-top",children:e.jsx(Cs,{status:o.status})}),e.jsxs(P,{className:"min-w-[260px] align-top",children:[e.jsx(Qe,{to:`/paper/${encodeURIComponent(o.paper_route)}`,className:"font-medium hover:underline",children:o.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",o.paper_id]})]}),e.jsxs(P,{className:"whitespace-nowrap align-top",children:[ws[o.kind],o.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(G,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(P,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:f(o.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",o.requested_by]})]}),e.jsxs(P,{className:"max-w-[360px] align-top",children:[o.hf_job_url?e.jsxs("a",{href:o.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(he,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),c&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${o.error?"text-red-700":"cron-muted"}`,title:c,children:c})]})]},o.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",f(r.timestamp)]})]})]})]})}const Ts=()=>{var m,h,o;const s=Ge(),a=ss({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>K.audit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),r=((m=a.data)==null?void 0:m.pages.flatMap(c=>c.events))??[],n=ce({mutationFn:()=>K.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),l=ce({mutationFn:c=>K.rollbackEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(u,{children:[e.jsxs(v,{className:"flex-row items-center justify-between",children:[e.jsx(N,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((o=(h=a.data)==null?void 0:h.pages[0])==null?void 0:o.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(p,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:c.before,after:c.after},null,2)})]}),!c.rollback_of_event_id&&e.jsx(M,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>l.mutate(c.id),disabled:l.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(M,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},me={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},y=s=>`$${(s/1e6).toFixed(2)}`,Ls=({data:s,loading:a,error:r})=>{const[n,l]=x.useState("staging-current"),m={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(C,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const h=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),o=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",c=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(u,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Circuit"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:o}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Month to date"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(h),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${h}%`}})})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Application headroom"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",y(s.application_cap_microusd)]})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Live compute"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(u,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Accounting and policy"}),e.jsxs(w,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(p,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:n,onChange:j=>l(j.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[m[n]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),y(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),y(s.provider_floor_microusd)," · ",e.jsx(_,{children:c})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${y(s.environment_cap_microusd)}`," · Workspace ",y(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",y(s.warning_microusd)," · trip ",y(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),f(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?f(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?f(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${f(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${f(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${y(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${f(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${y(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{children:"Live lifecycle"})}),e.jsx(p,{className:"text-sm",children:Object.entries(s.live_states).map(([j,g])=>e.jsxs("span",{className:"mr-4",children:[j,": ",g]},j))})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{children:"Daily spend"})}),e.jsx(p,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(j=>e.jsxs("li",{children:[j.date,": blank ",y(j.blank_pool_microusd)," · assigned ",y(j.assigned_microusd)]},j.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(u,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Recent circuit events"}),e.jsx(w,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(p,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(j=>e.jsxs("li",{children:[e.jsx(_,{children:j.severity})," ",j.type," · ",f(j.created_at)]},j.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Rs=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(C,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(r||!s)return e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const n=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(u,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Web search"}),e.jsxs(w,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(p,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${n}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",f(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${f(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(l=>e.jsxs("li",{children:[l.type," · ",f(l.created_at),l.error_class?` · ${l.error_class}`:""]},l.id))})]})]})},zs=()=>{const s=Xe(),[a,r]=x.useState(!0),[n,l]=x.useState(0),[m,h]=x.useState(""),[o,c]=x.useState(""),[j,g]=x.useState(new Set),{user:i}=Ve(),{data:d,isLoading:Y,isFetching:Z,error:S,refetch:Ae}=A({queryKey:["cronStatus",i==null?void 0:i.username],queryFn:()=>O.getCronStatus(),enabled:!!(i!=null&&i.is_admin),refetchInterval:a?3e4:!1,retry:!1}),D=A({queryKey:["paperMarkdownJobs",i==null?void 0:i.username],queryFn:()=>O.getPaperMarkdownJobs(),enabled:!!(i!=null&&i.is_admin),refetchInterval:a?3e4:!1,retry:!1}),I=A({queryKey:["chatSandboxSpend",i==null?void 0:i.username,o],queryFn:()=>O.getChatSandboxSpend(o||void 0),enabled:!!(i!=null&&i.is_admin),refetchInterval:a?3e4:!1,retry:!1}),U=A({queryKey:["chatWebSearchBudget",i==null?void 0:i.username],queryFn:()=>O.getChatWebSearchBudget(),enabled:!!(i!=null&&i.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),ee=(S&&typeof S=="object"&&"status"in S?S.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":S instanceof Error?S.message:void 0,Ee=t=>{g($=>{const T=new Set($);return T.has(t)?T.delete(t):T.add(t),T})},se=(d==null?void 0:d.jobs.filter(t=>t.dashboard_group==="leaderboard_sync"))??[],ae=(d==null?void 0:d.jobs.filter(t=>t.category!=="manual"&&t.dashboard_group!=="leaderboard_sync"))??[],De=ae.filter(t=>t.critical),Ie=ae.filter(t=>!t.critical),re=(d==null?void 0:d.manual_operations)??[],q=Ie.reduce((t,$)=>(t[$.category]||(t[$.category]=[]),t[$.category].push($),t),{}),qe=Object.keys(q).sort((t,$)=>{const T=["systemd","hourly","daily","weekly","backfill"];return T.indexOf(t)-T.indexOf($)}),J=t=>e.jsx(Ns,{job:t,expanded:j.has(t.job_name),onToggle:()=>Ee(t.job_name),paperMarkdownJobs:t.job_name==="paper_markdown_backfill"?D.data:void 0,paperMarkdownJobsLoading:t.job_name==="paper_markdown_backfill"?D.isLoading:!1,paperMarkdownJobsError:t.job_name==="paper_markdown_backfill"?D.error:null},t.job_name),Je=()=>{l(t=>t+1),Ae(),D.refetch(),I.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(H,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(M,{variant:"outline",size:"sm",onClick:()=>r(!a),className:a?"cron-status--running":"",children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:Je,disabled:Z,children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${Z?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(u,{className:"mb-6",children:e.jsx(p,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",i==null?void 0:i.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(hs,{defaultValue:"critical-jobs",children:[e.jsxs(Te,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(L,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(R,{value:"critical-jobs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(C,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),S&&e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load CRON jobs status. Please try again."})]})})}),d&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(t=>e.jsxs(u,{children:[e.jsx(v,{className:"pb-2",children:e.jsx(N,{className:"text-sm font-medium cron-muted capitalize",children:t})}),e.jsx(p,{children:e.jsx("div",{className:"text-2xl font-bold",children:d.summary[t]})})]},t))}),d.summary.critical_issues.length>0&&e.jsxs(u,{className:"mb-6 cron-status--broken",children:[e.jsx(v,{children:e.jsxs(N,{className:"flex items-center gap-2",children:[e.jsx(es,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(p,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:d.summary.critical_issues.map(t=>e.jsx("li",{children:t},t))})})]}),e.jsxs(u,{className:"mb-8",children:[e.jsx(v,{children:e.jsx(N,{className:"text-base",children:"What to check next"})}),e.jsxs(p,{children:[e.jsx("p",{className:"text-sm cron-muted",children:d.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(ue,{className:"h-4 w-4"}),"Last updated: ",f(d.timestamp)," · Health score:"," ",d.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(u,{className:`mb-8 ${d.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-base",children:"Coverage"}),e.jsx(w,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(p,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(u,{className:"mb-8",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Critical jobs"}),e.jsx(w,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(p,{className:"space-y-4",children:De.map(J)})]}),e.jsx("div",{className:"space-y-6",children:qe.map(t=>e.jsxs(u,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(N,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(_,{className:me[t]??me.hourly,children:t}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(w,{children:[q[t].length," job",q[t].length!==1?"s":""]})]})}),e.jsx(p,{className:"space-y-4",children:q[t].map(J)})]},t))}),re.length>0&&e.jsxs(u,{className:"mt-6",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Manual operations"}),e.jsx(w,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(p,{className:"space-y-4",children:re.map(J)})]})]})]}),e.jsxs(R,{value:"leaderboard-syncs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(C,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),S&&e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load leaderboard sync status. Please try again."})]})})}),d&&e.jsxs(u,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(w,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(_,{children:[se.length," jobs"]})]})}),e.jsx(p,{className:"space-y-4",children:se.map(J)})]})]}),e.jsx(R,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx($s,{autoRefresh:a,refreshToken:n})}),e.jsx(R,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ts,{})}),e.jsxs(R,{value:"chat-compute",className:"mt-6",children:[e.jsxs(u,{className:"mb-6",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Environment record"}),e.jsx(w,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(p,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:m,onChange:t=>h(t.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(M,{onClick:()=>c(m.trim()),children:"Load"})]})]}),e.jsx(Ls,{data:I.data,loading:I.isLoading,error:I.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Rs,{data:U.data,loading:U.isLoading,error:U.error})})]})]})]})})};export{Ls as ChatComputePanel,Rs as WebSearchBudgetPanel,zs as default}; diff --git a/assets/FeedView-Dv7Ll2yq.js b/assets/FeedView-Dd-lH8Q-.js similarity index 91% rename from assets/FeedView-Dv7Ll2yq.js rename to assets/FeedView-Dd-lH8Q-.js index fabfa252911283e6bc891942e0ccd446a15b3a5a..5d6444e11876a3c4967565010991e698a4fccde3 100644 --- a/assets/FeedView-Dv7Ll2yq.js +++ b/assets/FeedView-Dd-lH8Q-.js @@ -1 +1 @@ -import{u as F,r as d,i as R,j as e,a as q,L as M,b as $,c as U}from"./index-CnNiludC.js";import{P as B}from"./components-skIcbldg.js";import{u as K,P as W}from"./useIntersectionObserver-BUxW5ZLf.js";import{D as G,S as z,P as Q,u as V,a as X,M as Y,R as J,W as Z,A as ee,b as se,q as ae,c as te}from"./chatSessions-B5wJO74B.js";import{c as I}from"./catalog-D7qk7tAG.js";import{S}from"./chatPrompts-CDY3UGU1.js";import{t as re,d as O}from"./transform-zlVHQ5aE.js";import{u as ie}from"./usePapers-C15Wpgxo.js";import{P as ne}from"./usePeriodFilter-CAw9mrm9.js";import{S as v}from"./skeleton-BU3tw6-C.js";import{A as oe,a as le}from"./alert-CV1yu6Q5.js";import{u as D}from"./useQuery-C87uSz9p.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-Bjm5Iw9B.js";import"./useInfiniteQuery-DulZ-zOj.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],de={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},me={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},H=45,he=1800,pe=25,ue=350,fe=i=>{const[h,o]=d.useState(S[0].slice(0,1));return d.useEffect(()=>{var j,_;if(!i)return;if((_=(j=window.matchMedia)==null?void 0:j.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){o(S[0]);return}let p=0,n=1,u=!1,m;o(S[0].slice(0,n));const l=()=>{const f=S[p];if(!u){if(n+=1,o(f.slice(0,n)),n===f.length){u=!0,m=window.setTimeout(l,he);return}m=window.setTimeout(l,H);return}if(n-=1,o(f.slice(0,n)),n===0){u=!1,p=(p+1)%S.length,m=window.setTimeout(l,ue);return}m=window.setTimeout(l,pe)};return m=window.setTimeout(l,H),()=>window.clearTimeout(m)},[i]),h},xe=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",ge=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",be=()=>{var w,s,a;const i=F(),h=$()?z:Q,[o,p]=d.useState({text:"",paperMentions:[]}),n=o.text,[u,m]=d.useState(0),[l,j]=d.useState(G),_=(w=h.find(r=>r.id===l))==null?void 0:w.provider,[f,k]=d.useState(!1),[x,c]=d.useState("low"),[g,L]=d.useState(!1),A=fe(!n),y=d.useRef(null),E=D({queryKey:["chatAvailability"],queryFn:()=>U.getChatAvailability(),retry:!1,enabled:R()}),N=!!((s=E.data)!=null&&s.web_search_available),b=R()&&((a=E.data)==null?void 0:a.paper_mentions_enabled)!==!1,t=V({draft:o,onChange:p,enabled:b,textareaRef:y});d.useEffect(()=>{const r=y.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[n]);const T=async(r=o)=>{if(!(!r.text.trim()||g)){L(!0),ae(r,l,{webSearchEnabled:N&&f,reasoningEffort:x});try{const C=await te(l,x);i(`/chat/${C.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(X,{text:o.text,mentions:o.paperMentions,scrollTop:u,variant:"home"}),e.jsx("textarea",{ref:y,rows:1,value:n,placeholder:A,"aria-label":"Ask the assistant",disabled:g,onChange:r=>t.updateText(r.target.value,r.target.selectionStart),onSelect:r=>t.refresh(r.currentTarget.selectionStart),onClick:r=>t.refresh(r.currentTarget.selectionStart),onScroll:r=>m(r.currentTarget.scrollTop),onBlur:r=>{var P,C;(C=(P=r.relatedTarget)==null?void 0:P.closest)!=null&&C.call(P,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:r=>{t.keyDown(r)||r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),T())},role:b?"combobox":void 0,"aria-expanded":b?t.open:void 0,"aria-controls":t.open?t.pickerId:void 0,"aria-activedescendant":t.open&&t.results.length?`${t.optionIdPrefix}-${t.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":t.message?"ask-home-paper-mention-message":void 0})]}),t.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:t.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(Y,{models:h,selectedModel:l,onModelChange:j}),e.jsx(J,{value:x,onChange:c,disabled:g}),N&&e.jsx(Z,{enabled:f,onChange:k,disabled:g}),_!=="openrouter"&&e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:()=>void T(),disabled:!n.trim()||g,"aria-label":"Ask the assistant",children:e.jsx(ee,{})})]}),e.jsx(se,{open:t.open,query:t.query,results:t.results,activeIndex:t.activeIndex,loading:t.loading,error:t.error,onSelect:t.select,id:t.pickerId,optionIdPrefix:t.optionIdPrefix})]})]})},Ie=()=>{var N,b,t,T,w;const[i,h]=q(),o=xe(i.get("order_by")),p=ge(i.get("time")),n=i.get("has_code")==="true",u=i.get("has_hf_artifacts")==="true",m=me[p],l=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},j=s=>{const a=new URLSearchParams(i);a.set("time",de[s]),h(a)},_=s=>{const a=new URLSearchParams(i);s?a.set("has_code","true"):a.delete("has_code"),h(a)},f=s=>{const a=new URLSearchParams(i);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),h(a)},k=D({queryKey:["top-tasks-sidebar"],queryFn:()=>I.topTasks(8),staleTime:10*60*1e3}),x=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>I.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=ie({page_size:30,order_by:o,order_dir:"desc",time:p,include_resources:!0,has_code:n,has_hf_artifacts:u}),g=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(r=>r.results))||[]).map(re)},[c.data]),{targetRef:L,isIntersecting:A}=K({rootMargin:"400px"});d.useEffect(()=>{A&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[A,c.hasNextPage,c.isFetchingNextPage]);const y=c.isLoading,E=c.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),k.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),(N=k.data)==null?void 0:N.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),((t=(b=x.data)==null?void 0:b.results)==null?void 0:t.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(w=(T=x.data)==null?void 0:T.results)==null?void 0:w.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[R()&&e.jsx(be,{}),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:ce.map(([s,a])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:a},s))}),e.jsx(W,{hasCode:n,hasHfArtifacts:u,onHasCodeChange:_,onHasHfArtifactsChange:f})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ne.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>j(s),children:s},s))})]}),E&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsx(le,{children:"Failed to load papers. Please try again."})}),y?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(v,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(v,{className:"h-6 w-3/4"}),e.jsx(v,{className:"h-4 w-1/2"}),e.jsx(v,{className:"h-12 w-full"})]})]},a))}):g.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:g.map((s,a)=>e.jsx(B,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{be as AskAssistant,Ie as default}; +import{u as F,r as d,i as R,j as e,a as q,L as M,b as $,c as U}from"./index-W0d3uysl.js";import{P as B}from"./components-DA5I2P56.js";import{u as K,P as W}from"./useIntersectionObserver-C1k1BF8O.js";import{D as G,S as z,P as Q,u as V,a as X,M as Y,R as J,W as Z,A as ee,b as se,q as ae,c as te}from"./chatSessions-BMqD4j8C.js";import{c as I}from"./catalog-C5kDa2mw.js";import{S}from"./chatPrompts-CDY3UGU1.js";import{t as re,d as O}from"./transform-a-eujQMz.js";import{u as ie}from"./usePapers-CQOaIFi3.js";import{P as ne}from"./usePeriodFilter-D1eMQYtm.js";import{S as v}from"./skeleton-CPsExHBt.js";import{A as oe,a as le}from"./alert-BKLY_Sey.js";import{u as D}from"./useQuery-vQc9wuoD.js";import"./LatexTitle-CPXUtZtc.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-CmhJtq6c.js";import"./useInfiniteQuery-JgP-qE09.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],de={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},me={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},H=45,he=1800,pe=25,ue=350,fe=i=>{const[h,o]=d.useState(S[0].slice(0,1));return d.useEffect(()=>{var j,_;if(!i)return;if((_=(j=window.matchMedia)==null?void 0:j.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){o(S[0]);return}let p=0,n=1,u=!1,m;o(S[0].slice(0,n));const l=()=>{const f=S[p];if(!u){if(n+=1,o(f.slice(0,n)),n===f.length){u=!0,m=window.setTimeout(l,he);return}m=window.setTimeout(l,H);return}if(n-=1,o(f.slice(0,n)),n===0){u=!1,p=(p+1)%S.length,m=window.setTimeout(l,ue);return}m=window.setTimeout(l,pe)};return m=window.setTimeout(l,H),()=>window.clearTimeout(m)},[i]),h},xe=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",ge=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",be=()=>{var w,s,a;const i=F(),h=$()?z:Q,[o,p]=d.useState({text:"",paperMentions:[]}),n=o.text,[u,m]=d.useState(0),[l,j]=d.useState(G),_=(w=h.find(r=>r.id===l))==null?void 0:w.provider,[f,k]=d.useState(!1),[x,c]=d.useState("low"),[g,L]=d.useState(!1),A=fe(!n),y=d.useRef(null),E=D({queryKey:["chatAvailability"],queryFn:()=>U.getChatAvailability(),retry:!1,enabled:R()}),N=!!((s=E.data)!=null&&s.web_search_available),b=R()&&((a=E.data)==null?void 0:a.paper_mentions_enabled)!==!1,t=V({draft:o,onChange:p,enabled:b,textareaRef:y});d.useEffect(()=>{const r=y.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[n]);const T=async(r=o)=>{if(!(!r.text.trim()||g)){L(!0),ae(r,l,{webSearchEnabled:N&&f,reasoningEffort:x});try{const C=await te(l,x);i(`/chat/${C.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(X,{text:o.text,mentions:o.paperMentions,scrollTop:u,variant:"home"}),e.jsx("textarea",{ref:y,rows:1,value:n,placeholder:A,"aria-label":"Ask the assistant",disabled:g,onChange:r=>t.updateText(r.target.value,r.target.selectionStart),onSelect:r=>t.refresh(r.currentTarget.selectionStart),onClick:r=>t.refresh(r.currentTarget.selectionStart),onScroll:r=>m(r.currentTarget.scrollTop),onBlur:r=>{var P,C;(C=(P=r.relatedTarget)==null?void 0:P.closest)!=null&&C.call(P,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:r=>{t.keyDown(r)||r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),T())},role:b?"combobox":void 0,"aria-expanded":b?t.open:void 0,"aria-controls":t.open?t.pickerId:void 0,"aria-activedescendant":t.open&&t.results.length?`${t.optionIdPrefix}-${t.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":t.message?"ask-home-paper-mention-message":void 0})]}),t.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:t.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(Y,{models:h,selectedModel:l,onModelChange:j}),e.jsx(J,{value:x,onChange:c,disabled:g}),N&&e.jsx(Z,{enabled:f,onChange:k,disabled:g}),_!=="openrouter"&&e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:()=>void T(),disabled:!n.trim()||g,"aria-label":"Ask the assistant",children:e.jsx(ee,{})})]}),e.jsx(se,{open:t.open,query:t.query,results:t.results,activeIndex:t.activeIndex,loading:t.loading,error:t.error,onSelect:t.select,id:t.pickerId,optionIdPrefix:t.optionIdPrefix})]})]})},Ie=()=>{var N,b,t,T,w;const[i,h]=q(),o=xe(i.get("order_by")),p=ge(i.get("time")),n=i.get("has_code")==="true",u=i.get("has_hf_artifacts")==="true",m=me[p],l=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},j=s=>{const a=new URLSearchParams(i);a.set("time",de[s]),h(a)},_=s=>{const a=new URLSearchParams(i);s?a.set("has_code","true"):a.delete("has_code"),h(a)},f=s=>{const a=new URLSearchParams(i);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),h(a)},k=D({queryKey:["top-tasks-sidebar"],queryFn:()=>I.topTasks(8),staleTime:10*60*1e3}),x=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>I.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=ie({page_size:30,order_by:o,order_dir:"desc",time:p,include_resources:!0,has_code:n,has_hf_artifacts:u}),g=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(r=>r.results))||[]).map(re)},[c.data]),{targetRef:L,isIntersecting:A}=K({rootMargin:"400px"});d.useEffect(()=>{A&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[A,c.hasNextPage,c.isFetchingNextPage]);const y=c.isLoading,E=c.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),k.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),(N=k.data)==null?void 0:N.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),((t=(b=x.data)==null?void 0:b.results)==null?void 0:t.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(w=(T=x.data)==null?void 0:T.results)==null?void 0:w.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[R()&&e.jsx(be,{}),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:ce.map(([s,a])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:a},s))}),e.jsx(W,{hasCode:n,hasHfArtifacts:u,onHasCodeChange:_,onHasHfArtifactsChange:f})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ne.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>j(s),children:s},s))})]}),E&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsx(le,{children:"Failed to load papers. Please try again."})}),y?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(v,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(v,{className:"h-6 w-3/4"}),e.jsx(v,{className:"h-4 w-1/2"}),e.jsx(v,{className:"h-12 w-full"})]})]},a))}):g.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:g.map((s,a)=>e.jsx(B,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{be as AskAssistant,Ie as default}; diff --git a/assets/FrameworksIndexView-CJh-2Pow.js b/assets/FrameworksIndexView-Ch67e2Te.js similarity index 93% rename from assets/FrameworksIndexView-CJh-2Pow.js rename to assets/FrameworksIndexView-Ch67e2Te.js index 5224429a7820dc294cbeeb8d5d805c13eb6c21c6..93e68e31b99fd060ce33d8eaac820627e5caa881 100644 --- a/assets/FrameworksIndexView-CJh-2Pow.js +++ b/assets/FrameworksIndexView-Ch67e2Te.js @@ -1 +1 @@ -import{u as d,j as e,L as o,R as m}from"./index-CnNiludC.js";import{u as p}from"./useQuery-C87uSz9p.js";import{I as h}from"./components-skIcbldg.js";import{c as u}from"./catalog-D7qk7tAG.js";import{c as g,h as f}from"./transform-zlVHQ5aE.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},L=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,L as default}; +import{u as d,j as e,L as o,R as m}from"./index-W0d3uysl.js";import{u as p}from"./useQuery-vQc9wuoD.js";import{I as h}from"./components-DA5I2P56.js";import{c as u}from"./catalog-C5kDa2mw.js";import{c as g,h as f}from"./transform-a-eujQMz.js";import"./LatexTitle-CPXUtZtc.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},L=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,L as default}; diff --git a/assets/LatexTitle-B1FyT_-3.js b/assets/LatexTitle-CPXUtZtc.js similarity index 98% rename from assets/LatexTitle-B1FyT_-3.js rename to assets/LatexTitle-CPXUtZtc.js index 1dc4223f421dd3c6d1b661daae03f712c3d255cc..27251779b370c45511014c6e000a186a71015f3b 100644 --- a/assets/LatexTitle-B1FyT_-3.js +++ b/assets/LatexTitle-CPXUtZtc.js @@ -1 +1 @@ -import{j as o,r as g}from"./index-CnNiludC.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-W0d3uysl.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-mvLqNfwe.js b/assets/MarkdownText-79sq6Tks.js similarity index 85% rename from assets/MarkdownText-mvLqNfwe.js rename to assets/MarkdownText-79sq6Tks.js index 65103725770b3451afad235b31a1d387f242369a..7eca43004bd827078c9c51f66a7c92407e6c5a27 100644 --- a/assets/MarkdownText-mvLqNfwe.js +++ b/assets/MarkdownText-79sq6Tks.js @@ -1 +1 @@ -import{F as l,j as s,L as u}from"./index-CnNiludC.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-DAFhnDhq.js";import{M as d,r as w}from"./index-B8BJTSsG.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M,f as r}; +import{F as l,j as s,L as u}from"./index-W0d3uysl.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-CRTwuY7t.js";import{M as d,r as w}from"./index-B1HJ4Whn.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M,f as r}; diff --git a/assets/MethodDetailView-CkUzVx0g.js b/assets/MethodDetailView-CfP7e-SP.js similarity index 95% rename from assets/MethodDetailView-CkUzVx0g.js rename to assets/MethodDetailView-CfP7e-SP.js index d1fe60e5709b8e89d1a7f5cf57531b76bff9cd38..6ebaa11a51eea886117664ae96378ddcf215f5e0 100644 --- a/assets/MethodDetailView-CkUzVx0g.js +++ b/assets/MethodDetailView-CfP7e-SP.js @@ -1 +1 @@ -import{j as e,r as L,f as W,a as Z,L as C,ab as V,p as X}from"./index-CnNiludC.js";import{u as M}from"./useQuery-C87uSz9p.js";import{u as Y}from"./useInfiniteQuery-DulZ-zOj.js";import{M as J,P as ee}from"./components-skIcbldg.js";import{u as te,P as se}from"./useIntersectionObserver-BUxW5ZLf.js";import{r as ae,M as O}from"./MarkdownText-mvLqNfwe.js";import{c as b}from"./catalog-D7qk7tAG.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-zlVHQ5aE.js";import{S as A}from"./skeleton-BU3tw6-C.js";import{A as ie,a as le}from"./alert-CV1yu6Q5.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.js";const s={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},j=({x:t,y:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),de.map(([t,n],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({method:t})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Te=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=Y({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>X.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=te({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=ae(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(J,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(se,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((r,d)=>e.jsx(ee,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Te as default}; +import{j as e,r as L,f as W,a as Z,L as C,ab as V,p as X}from"./index-W0d3uysl.js";import{u as M}from"./useQuery-vQc9wuoD.js";import{u as Y}from"./useInfiniteQuery-JgP-qE09.js";import{M as J,P as ee}from"./components-DA5I2P56.js";import{u as te,P as se}from"./useIntersectionObserver-C1k1BF8O.js";import{r as ae,M as O}from"./MarkdownText-79sq6Tks.js";import{c as b}from"./catalog-C5kDa2mw.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-a-eujQMz.js";import{S as A}from"./skeleton-CPsExHBt.js";import{A as ie,a as le}from"./alert-BKLY_Sey.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-CPXUtZtc.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-CRTwuY7t.js";import"./index-B1HJ4Whn.js";import"./hover-card-CPjdcVfA.js";const s={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},j=({x:t,y:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),de.map(([t,n],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({method:t})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Te=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=Y({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>X.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=te({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=ae(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(J,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(se,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((r,d)=>e.jsx(ee,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Te as default}; diff --git a/assets/MethodsIndexView-BlcIa_fS.js b/assets/MethodsIndexView-CKTQ6cDe.js similarity index 87% rename from assets/MethodsIndexView-BlcIa_fS.js rename to assets/MethodsIndexView-CKTQ6cDe.js index e94f127823aeaaf37a5090fac646ef2506e5cd93..0758864f636418250c47581a734877d84ed7fd90 100644 --- a/assets/MethodsIndexView-BlcIa_fS.js +++ b/assets/MethodsIndexView-CKTQ6cDe.js @@ -1,4 +1,4 @@ -import{d as g,r as d,j as e,L as f}from"./index-CnNiludC.js";import{u as m}from"./useQuery-C87uSz9p.js";import{c as h}from"./catalog-D7qk7tAG.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-BU3tw6-C.js";import{A as y,a as v}from"./alert-CV1yu6Q5.js";import{T as _}from"./TaxonomySuggestionTile-DPjYd5AL.js";import"./SignInToEditDialog-ByW2mx_A.js";import"./button-Cb-e5tHG.js";import"./textarea-DuxG42Qe.js";import"./dialog-COYv9g-7.js";import"./useMutation-CZOEaG9X.js";import"./loader-circle-3AJg82rJ.js";/** +import{d as g,r as d,j as e,L as f}from"./index-W0d3uysl.js";import{u as m}from"./useQuery-vQc9wuoD.js";import{c as h}from"./catalog-C5kDa2mw.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-CPsExHBt.js";import{A as y,a as v}from"./alert-BKLY_Sey.js";import{T as _}from"./TaxonomySuggestionTile-C5fAeYBQ.js";import"./SignInToEditDialog-aDxqeILo.js";import"./button-BCHGalXc.js";import"./textarea-D8WJ-V7X.js";import"./dialog-DOTf3B8r.js";import"./useMutation-BMLNTksL.js";import"./loader-circle-BkFdIra2.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-B6qYFFtn.js b/assets/NotFound-C0O3bfE-.js similarity index 89% rename from assets/NotFound-B6qYFFtn.js rename to assets/NotFound-C0O3bfE-.js index 1d34145a6b3a9fcd981a24296c7cb1cafaf7e553..81a33522508a06d586e640cbf344c519dfc75f4c 100644 --- a/assets/NotFound-B6qYFFtn.js +++ b/assets/NotFound-C0O3bfE-.js @@ -1 +1 @@ -import{aw as o,r as a,j as t,L as s}from"./index-CnNiludC.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{aw as o,r as a,j as t,L as s}from"./index-W0d3uysl.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/OrganizationContributionGraph-CBDgtzLe.js b/assets/OrganizationContributionGraph-goBBZ8vD.js similarity index 94% rename from assets/OrganizationContributionGraph-CBDgtzLe.js rename to assets/OrganizationContributionGraph-goBBZ8vD.js index 74037321ff5d0568e743708e40d57253d887279a..0e60cc255843d3a6e19168786aac44f931c2eeb4 100644 --- a/assets/OrganizationContributionGraph-CBDgtzLe.js +++ b/assets/OrganizationContributionGraph-goBBZ8vD.js @@ -1 +1 @@ -import{r as b,j as o}from"./index-CnNiludC.js";import{u as z}from"./useQuery-C87uSz9p.js";import{S as T}from"./skeleton-BU3tw6-C.js";import{c as w}from"./catalog-D7qk7tAG.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;eg.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O}; +import{r as b,j as o}from"./index-W0d3uysl.js";import{u as z}from"./useQuery-vQc9wuoD.js";import{S as T}from"./skeleton-CPsExHBt.js";import{c as w}from"./catalog-C5kDa2mw.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;eg.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O}; diff --git a/assets/OrganizationDetailView-BbrTMC2j.js b/assets/OrganizationDetailView-BbrTMC2j.js deleted file mode 100644 index 43d6f161179329c0f9707a66c35a62f37039ed53..0000000000000000000000000000000000000000 --- a/assets/OrganizationDetailView-BbrTMC2j.js +++ /dev/null @@ -1 +0,0 @@ -import{f as t,j as r}from"./index-CnNiludC.js";import{O as i}from"./OrganizationPaperFeed-BPCfQF2i.js";import m from"./NotFound-B6qYFFtn.js";import"./useQuery-C87uSz9p.js";import"./components-skIcbldg.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./transform-zlVHQ5aE.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-mvLqNfwe.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.js";import"./OrganizationContributionGraph-CBDgtzLe.js";import"./skeleton-BU3tw6-C.js";import"./catalog-D7qk7tAG.js";import"./useIntersectionObserver-BUxW5ZLf.js";import"./alert-CV1yu6Q5.js";import"./searchable-select-BV8KO0OB.js";import"./button-Cb-e5tHG.js";import"./dialog-COYv9g-7.js";import"./loader-circle-3AJg82rJ.js";import"./usePapers-C15Wpgxo.js";import"./useInfiniteQuery-DulZ-zOj.js";const b=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{b as default}; diff --git a/assets/OrganizationDetailView-CwAChot3.js b/assets/OrganizationDetailView-CwAChot3.js new file mode 100644 index 0000000000000000000000000000000000000000..ae61b475a9920416ce504f5766359cf4604d165e --- /dev/null +++ b/assets/OrganizationDetailView-CwAChot3.js @@ -0,0 +1 @@ +import{f as t,j as r}from"./index-W0d3uysl.js";import{O as i}from"./OrganizationPaperFeed-MkPLSiOD.js";import m from"./NotFound-C0O3bfE-.js";import"./useQuery-vQc9wuoD.js";import"./components-DA5I2P56.js";import"./LatexTitle-CPXUtZtc.js";import"./katex.min-BSBacQyE.js";import"./transform-a-eujQMz.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-79sq6Tks.js";import"./PaperPreviewLink-CRTwuY7t.js";import"./index-B1HJ4Whn.js";import"./hover-card-CPjdcVfA.js";import"./OrganizationContributionGraph-goBBZ8vD.js";import"./skeleton-CPsExHBt.js";import"./catalog-C5kDa2mw.js";import"./useIntersectionObserver-C1k1BF8O.js";import"./alert-BKLY_Sey.js";import"./searchable-select-C2wKP4v0.js";import"./button-BCHGalXc.js";import"./dialog-DOTf3B8r.js";import"./loader-circle-BkFdIra2.js";import"./usePapers-CQOaIFi3.js";import"./useInfiniteQuery-JgP-qE09.js";const b=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{b as default}; diff --git a/assets/OrganizationPaperFeed-BPCfQF2i.js b/assets/OrganizationPaperFeed-MkPLSiOD.js similarity index 89% rename from assets/OrganizationPaperFeed-BPCfQF2i.js rename to assets/OrganizationPaperFeed-MkPLSiOD.js index 47ad8a01fcafd3e7dfcc654be26f5d0c2cf54c54..67182e0723e18ca6b8cc26a69ffe27bd51d9811c 100644 --- a/assets/OrganizationPaperFeed-BPCfQF2i.js +++ b/assets/OrganizationPaperFeed-MkPLSiOD.js @@ -1 +1 @@ -import{u as E,a as Q,r as d,j as e,L as w}from"./index-CnNiludC.js";import{u as A}from"./useQuery-C87uSz9p.js";import{P as U}from"./components-skIcbldg.js";import{M as B}from"./MarkdownText-mvLqNfwe.js";import{O as G}from"./OrganizationContributionGraph-CBDgtzLe.js";import{u as K,P as W}from"./useIntersectionObserver-BUxW5ZLf.js";import{A as D,a as Z}from"./alert-CV1yu6Q5.js";import{a as z}from"./searchable-select-BV8KO0OB.js";import{S as C}from"./skeleton-BU3tw6-C.js";import{d as J}from"./usePapers-C15Wpgxo.js";import{c as $}from"./catalog-D7qk7tAG.js";import{d as T,t as V}from"./transform-zlVHQ5aE.js";import X from"./NotFound-B6qYFFtn.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",ue=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>$.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>$.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:f,enabled:!!n}),{targetRef:H,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=_.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=_.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const q=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},S=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[s!=null&&s.logo_url&&!M?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx(C,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:S,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...q(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx(C,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ue as O}; +import{u as E,a as Q,r as d,j as e,L as w}from"./index-W0d3uysl.js";import{u as A}from"./useQuery-vQc9wuoD.js";import{P as U}from"./components-DA5I2P56.js";import{M as B}from"./MarkdownText-79sq6Tks.js";import{O as G}from"./OrganizationContributionGraph-goBBZ8vD.js";import{u as K,P as W}from"./useIntersectionObserver-C1k1BF8O.js";import{A as D,a as Z}from"./alert-BKLY_Sey.js";import{a as z}from"./searchable-select-C2wKP4v0.js";import{S as C}from"./skeleton-CPsExHBt.js";import{d as J}from"./usePapers-CQOaIFi3.js";import{c as $}from"./catalog-C5kDa2mw.js";import{d as T,t as V}from"./transform-a-eujQMz.js";import X from"./NotFound-C0O3bfE-.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",ue=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>$.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>$.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:f,enabled:!!n}),{targetRef:H,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=_.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=_.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const q=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},S=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[s!=null&&s.logo_url&&!M?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx(C,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:S,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...q(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx(C,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ue as O}; diff --git a/assets/OrganizationTaskView-CFdQxMtl.js b/assets/OrganizationTaskView-CFdQxMtl.js deleted file mode 100644 index 8aaadb7dd4d570fdf2aeebaf493576fba2242b23..0000000000000000000000000000000000000000 --- a/assets/OrganizationTaskView-CFdQxMtl.js +++ /dev/null @@ -1 +0,0 @@ -import{f as i,j as t}from"./index-CnNiludC.js";import{O as m}from"./OrganizationPaperFeed-BPCfQF2i.js";import p from"./NotFound-B6qYFFtn.js";import"./useQuery-C87uSz9p.js";import"./components-skIcbldg.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./transform-zlVHQ5aE.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-mvLqNfwe.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.js";import"./OrganizationContributionGraph-CBDgtzLe.js";import"./skeleton-BU3tw6-C.js";import"./catalog-D7qk7tAG.js";import"./useIntersectionObserver-BUxW5ZLf.js";import"./alert-CV1yu6Q5.js";import"./searchable-select-BV8KO0OB.js";import"./button-Cb-e5tHG.js";import"./dialog-COYv9g-7.js";import"./loader-circle-3AJg82rJ.js";import"./usePapers-C15Wpgxo.js";import"./useInfiniteQuery-DulZ-zOj.js";const b=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{b as default}; diff --git a/assets/OrganizationTaskView-Dp5482-s.js b/assets/OrganizationTaskView-Dp5482-s.js new file mode 100644 index 0000000000000000000000000000000000000000..cf42939066150d03084ccf8903664e3b5ee904d8 --- /dev/null +++ b/assets/OrganizationTaskView-Dp5482-s.js @@ -0,0 +1 @@ +import{f as i,j as t}from"./index-W0d3uysl.js";import{O as m}from"./OrganizationPaperFeed-MkPLSiOD.js";import p from"./NotFound-C0O3bfE-.js";import"./useQuery-vQc9wuoD.js";import"./components-DA5I2P56.js";import"./LatexTitle-CPXUtZtc.js";import"./katex.min-BSBacQyE.js";import"./transform-a-eujQMz.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-79sq6Tks.js";import"./PaperPreviewLink-CRTwuY7t.js";import"./index-B1HJ4Whn.js";import"./hover-card-CPjdcVfA.js";import"./OrganizationContributionGraph-goBBZ8vD.js";import"./skeleton-CPsExHBt.js";import"./catalog-C5kDa2mw.js";import"./useIntersectionObserver-C1k1BF8O.js";import"./alert-BKLY_Sey.js";import"./searchable-select-C2wKP4v0.js";import"./button-BCHGalXc.js";import"./dialog-DOTf3B8r.js";import"./loader-circle-BkFdIra2.js";import"./usePapers-CQOaIFi3.js";import"./useInfiniteQuery-JgP-qE09.js";const b=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{b as default}; diff --git a/assets/OrganizationsIndexView-DN3ysr-g.js b/assets/OrganizationsIndexView-BnLo3hfA.js similarity index 94% rename from assets/OrganizationsIndexView-DN3ysr-g.js rename to assets/OrganizationsIndexView-BnLo3hfA.js index cae8036c253e718df3654c4f8dd6a2ece9bbc35d..75f2cc21a776cd406da898c92015129cbcf83138 100644 --- a/assets/OrganizationsIndexView-DN3ysr-g.js +++ b/assets/OrganizationsIndexView-BnLo3hfA.js @@ -1 +1 @@ -import{a as u,r as g,j as e,L as x}from"./index-CnNiludC.js";import{u as j}from"./useQuery-C87uSz9p.js";import{A as y,a as f}from"./alert-CV1yu6Q5.js";import{S as _}from"./skeleton-BU3tw6-C.js";import{c as N}from"./catalog-D7qk7tAG.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{A as default}; +import{a as u,r as g,j as e,L as x}from"./index-W0d3uysl.js";import{u as j}from"./useQuery-vQc9wuoD.js";import{A as y,a as f}from"./alert-BKLY_Sey.js";import{S as _}from"./skeleton-CPsExHBt.js";import{c as N}from"./catalog-C5kDa2mw.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{A as default}; diff --git a/assets/PaperDetailView-BEjlwQbA.js b/assets/PaperDetailView-D3_ZsBvI.js similarity index 98% rename from assets/PaperDetailView-BEjlwQbA.js rename to assets/PaperDetailView-D3_ZsBvI.js index 6c3cf68af57be7d83ae7dc41479fed3b06490d14..a9397e14d919f184adde93bab922094c900f51d1 100644 --- a/assets/PaperDetailView-BEjlwQbA.js +++ b/assets/PaperDetailView-D3_ZsBvI.js @@ -1,4 +1,4 @@ -import{d as Ct,r as h,j as e,P as gs,m as ke,n as xs,o as Le,q as Fe,s as bs,t as Et,C as be,v as Ge,k as me,h as he,X as St,w as je,p as X,g as Je,R as Qe,A as jt,c as vt,x as js,e as oa,y as la,z as ca,I as da,B as vs,D as ua,E as ma,T as ha,f as pa,F as fa,u as ga,G as xa,L as ge,H as ba,J as ja,K as va,M as ya,N as ka,O as wa}from"./index-CnNiludC.js";import{u as re}from"./useQuery-C87uSz9p.js";import{I as J,S as _a,a as Na,T as Ca,M as Ea}from"./components-skIcbldg.js";import{e as Ve,C as Sa,E as Ia}from"./evaluations-imurwG7D.js";import{L as ze,a as Aa}from"./LatexTitle-B1FyT_-3.js";import{s as $a}from"./transform-zlVHQ5aE.js";import{f as Pa,D as Ra}from"./latexPlainText-DI8YEXVe.js";import{a as Fa}from"./usePapers-C15Wpgxo.js";import{S as Pe}from"./skeleton-BU3tw6-C.js";import{A as Ta,a as La}from"./alert-CV1yu6Q5.js";import{B as H}from"./button-Cb-e5tHG.js";import{u as ys}from"./index-D0hHQwos.js";import{I as ee}from"./textarea-DuxG42Qe.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as ue}from"./dialog-COYv9g-7.js";import{u as pe}from"./useMutation-CZOEaG9X.js";import{c as ye}from"./catalog-D7qk7tAG.js";import{S as It,P as Xe,L as ae,a as Ua}from"./SignInToEditDialog-ByW2mx_A.js";import{S as Te,a as rs}from"./searchable-select-BV8KO0OB.js";import{L as ne}from"./loader-circle-3AJg82rJ.js";import{B as ks,D as Da,c as Ba,g as Ha,s as Ma,a as za,b as qa,d as Oa,i as Ka,e as Ga}from"./codexAddEvals-DIZEZyhj.js";import{n as it,g as ns}from"./github-6FmJETBJ.js";import{G as is}from"./github-CRO5e-fY.js";import{S as os,s as Qa}from"./savedPapersAuth-BGaR1VbQ.js";import{M as Va,r as Ja}from"./index-B8BJTSsG.js";import{s as Ne}from"./safeExternalHref-CkBrsh84.js";import"./hover-card-CDhcGwFp.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DulZ-zOj.js";/** +import{d as Ct,r as h,j as e,P as gs,m as ke,n as xs,o as Le,q as Fe,s as bs,t as Et,C as be,v as Ge,k as me,h as he,X as St,w as je,p as X,g as Je,R as Qe,A as jt,c as vt,x as js,e as oa,y as la,z as ca,I as da,B as vs,D as ua,E as ma,T as ha,f as pa,F as fa,u as ga,G as xa,L as ge,H as ba,J as ja,K as va,M as ya,N as ka,O as wa}from"./index-W0d3uysl.js";import{u as re}from"./useQuery-vQc9wuoD.js";import{I as J,S as _a,a as Na,T as Ca,M as Ea}from"./components-DA5I2P56.js";import{e as Ve,C as Sa,E as Ia}from"./evaluations-ByQ-gfqI.js";import{L as ze,a as Aa}from"./LatexTitle-CPXUtZtc.js";import{s as $a}from"./transform-a-eujQMz.js";import{f as Pa,D as Ra}from"./latexPlainText-DI8YEXVe.js";import{a as Fa}from"./usePapers-CQOaIFi3.js";import{S as Pe}from"./skeleton-CPsExHBt.js";import{A as Ta,a as La}from"./alert-BKLY_Sey.js";import{B as H}from"./button-BCHGalXc.js";import{u as ys}from"./index-C3rnUhi0.js";import{I as ee}from"./textarea-D8WJ-V7X.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as ue}from"./dialog-DOTf3B8r.js";import{u as pe}from"./useMutation-BMLNTksL.js";import{c as ye}from"./catalog-C5kDa2mw.js";import{S as It,P as Xe,L as ae,a as Ua}from"./SignInToEditDialog-aDxqeILo.js";import{S as Te,a as rs}from"./searchable-select-C2wKP4v0.js";import{L as ne}from"./loader-circle-BkFdIra2.js";import{B as ks,D as Da,c as Ba,g as Ha,s as Ma,a as za,b as qa,d as Oa,i as Ka,e as Ga}from"./codexAddEvals-BYyAthFq.js";import{n as it,g as ns}from"./github-UfpFvTKs.js";import{G as is}from"./github-CVlHVGA6.js";import{S as os,s as Qa}from"./savedPapersAuth-hSKa9YsO.js";import{M as Va,r as Ja}from"./index-B1HJ4Whn.js";import{s as Ne}from"./safeExternalHref-CkBrsh84.js";import"./hover-card-CPjdcVfA.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-JgP-qE09.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/PaperPreviewLink-DAFhnDhq.js b/assets/PaperPreviewLink-CRTwuY7t.js similarity index 98% rename from assets/PaperPreviewLink-DAFhnDhq.js rename to assets/PaperPreviewLink-CRTwuY7t.js index 1419c49722fc48020943eedee9c69b004b5a16b4..a71a1dbe697da9140d1fdf4eb7442a2781e14b6f 100644 --- a/assets/PaperPreviewLink-DAFhnDhq.js +++ b/assets/PaperPreviewLink-CRTwuY7t.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-B8BJTSsG.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,N as ce,F as ue,L as he,p as pe}from"./index-CnNiludC.js";import{u as me}from"./useQuery-C87uSz9p.js";import{H as fe,a as de,b as ge}from"./hover-card-CDhcGwFp.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-B1HJ4Whn.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,N as ce,F as ue,L as he,p as pe}from"./index-W0d3uysl.js";import{u as me}from"./useQuery-vQc9wuoD.js";import{H as fe,a as de,b as ge}from"./hover-card-CPjdcVfA.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-DpeQT2iM.js b/assets/PapersListView-U1p3L-FQ.js similarity index 90% rename from assets/PapersListView-DpeQT2iM.js rename to assets/PapersListView-U1p3L-FQ.js index f22690ef1a14552ddc560402ad7e7d3f886e06c5..2edf1370fe004809a6864d4404ad146ee60badef 100644 --- a/assets/PapersListView-DpeQT2iM.js +++ b/assets/PapersListView-U1p3L-FQ.js @@ -1 +1 @@ -import{a as q,r as m,A as z,j as e,L as x}from"./index-CnNiludC.js";import{I as E,T as G,P as Q}from"./components-skIcbldg.js";import{c as U}from"./catalog-D7qk7tAG.js";import{t as W,d as K}from"./transform-zlVHQ5aE.js";import{u as V}from"./usePapers-C15Wpgxo.js";import{u as J}from"./useDebounce-tmUrFXv0.js";import{P as X}from"./usePeriodFilter-CAw9mrm9.js";import{u as Y,P as Z}from"./useIntersectionObserver-BUxW5ZLf.js";import{S as p}from"./skeleton-BU3tw6-C.js";import{A as ee,a as se}from"./alert-CV1yu6Q5.js";import{u as ae}from"./useQuery-C87uSz9p.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-DulZ-zOj.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),_e=()=>{var T,A,C,I,L,R,H;const[r,_]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[b,k]=m.useState(u),d=J(b,300);m.useEffect(()=>k(u),[u]),m.useEffect(()=>{if(d===u)return;const s=new URLSearchParams(r);d?s.set("search",d):s.delete("search"),_(s,{replace:!0})},[d]);const j=r.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const l=new URLSearchParams(r);i?l.set(s,i):l.delete(s),_(l)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:d||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>U.topTasks(8),enabled:!n,staleTime:10*60*1e3}),v=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(l=>l.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((C=(A=(T=t.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?(a==null?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(G,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:s=>k(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[K(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,i)=>e.jsx(Q,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{_e as default}; +import{a as q,r as m,A as z,j as e,L as x}from"./index-W0d3uysl.js";import{I as E,T as G,P as Q}from"./components-DA5I2P56.js";import{c as U}from"./catalog-C5kDa2mw.js";import{t as W,d as K}from"./transform-a-eujQMz.js";import{u as V}from"./usePapers-CQOaIFi3.js";import{u as J}from"./useDebounce-CX9U7t5A.js";import{P as X}from"./usePeriodFilter-D1eMQYtm.js";import{u as Y,P as Z}from"./useIntersectionObserver-C1k1BF8O.js";import{S as p}from"./skeleton-CPsExHBt.js";import{A as ee,a as se}from"./alert-BKLY_Sey.js";import{u as ae}from"./useQuery-vQc9wuoD.js";import"./LatexTitle-CPXUtZtc.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-JgP-qE09.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),_e=()=>{var T,A,C,I,L,R,H;const[r,_]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[b,k]=m.useState(u),d=J(b,300);m.useEffect(()=>k(u),[u]),m.useEffect(()=>{if(d===u)return;const s=new URLSearchParams(r);d?s.set("search",d):s.delete("search"),_(s,{replace:!0})},[d]);const j=r.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const l=new URLSearchParams(r);i?l.set(s,i):l.delete(s),_(l)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:d||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>U.topTasks(8),enabled:!n,staleTime:10*60*1e3}),v=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(l=>l.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((C=(A=(T=t.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?(a==null?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(G,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:s=>k(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[K(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,i)=>e.jsx(Q,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{_e as default}; diff --git a/assets/PrivacyView-CIEmHSbN.js b/assets/PrivacyView-CTPtZXFS.js similarity index 99% rename from assets/PrivacyView-CIEmHSbN.js rename to assets/PrivacyView-CTPtZXFS.js index f9bd02fc727a20898f1aa3f5e36de99ba4aedc3d..1d095d79a5008da0fbb003622e11933f1a0291e6 100644 --- a/assets/PrivacyView-CIEmHSbN.js +++ b/assets/PrivacyView-CTPtZXFS.js @@ -1 +1 @@ -import{R as s,j as e}from"./index-CnNiludC.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 100 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default}; +import{R as s,j as e}from"./index-W0d3uysl.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 100 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default}; diff --git a/assets/RateLimitsView-C-wgjf0f.js b/assets/RateLimitsView-Bztx-Hl-.js similarity index 88% rename from assets/RateLimitsView-C-wgjf0f.js rename to assets/RateLimitsView-Bztx-Hl-.js index 20137b26b00345291035e7b1914c7839b0be17ac..40c2e27bf7d09d04bd39258ab1cdb7ec328700fc 100644 --- a/assets/RateLimitsView-C-wgjf0f.js +++ b/assets/RateLimitsView-Bztx-Hl-.js @@ -1 +1 @@ -import{j as e,e as s}from"./index-CnNiludC.js";import{u as r}from"./useQuery-C87uSz9p.js";const c=()=>{const i=r({queryKey:["submission-rate-limit-policy"],queryFn:async()=>{const t=await fetch(s("/api/v1/rate-limits"));if(!t.ok)throw new Error("Policy unavailable");return t.json()}}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{c as default}; +import{j as e,e as s}from"./index-W0d3uysl.js";import{u as r}from"./useQuery-vQc9wuoD.js";const c=()=>{const i=r({queryKey:["submission-rate-limit-policy"],queryFn:async()=>{const t=await fetch(s("/api/v1/rate-limits"));if(!t.ok)throw new Error("Policy unavailable");return t.json()}}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{c as default}; diff --git a/assets/SavedPapersView-CKKGXgM6.js b/assets/SavedPapersView-VCnhdKfX.js similarity index 91% rename from assets/SavedPapersView-CKKGXgM6.js rename to assets/SavedPapersView-VCnhdKfX.js index 74d182f657a1fc65d7bc26e73e7bd5795fdebf8b..c2c4ea7b42dc714d00c1b09454da5070701fafa5 100644 --- a/assets/SavedPapersView-CKKGXgM6.js +++ b/assets/SavedPapersView-VCnhdKfX.js @@ -1 +1 @@ -import{g as h,A as g,j as e,Z as v,L as x,c as j}from"./index-CnNiludC.js";import{u as N}from"./useQuery-C87uSz9p.js";import{T as b,P as f}from"./components-skIcbldg.js";import{S as r}from"./skeleton-BU3tw6-C.js";import{A as k,a as y}from"./alert-CV1yu6Q5.js";import{t as w}from"./transform-zlVHQ5aE.js";import{s as A}from"./savedPapersAuth-BGaR1VbQ.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const T=()=>{var d,o;const{user:t,isLoading:u}=h(),a=N({queryKey:["my-bookmarks"],queryFn:()=>j.getMyBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{T as default}; +import{g as h,A as g,j as e,Z as v,L as x,c as j}from"./index-W0d3uysl.js";import{u as N}from"./useQuery-vQc9wuoD.js";import{T as b,P as f}from"./components-DA5I2P56.js";import{S as r}from"./skeleton-CPsExHBt.js";import{A as k,a as y}from"./alert-BKLY_Sey.js";import{t as w}from"./transform-a-eujQMz.js";import{s as A}from"./savedPapersAuth-hSKa9YsO.js";import"./LatexTitle-CPXUtZtc.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const T=()=>{var d,o;const{user:t,isLoading:u}=h(),a=N({queryKey:["my-bookmarks"],queryFn:()=>j.getMyBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{T as default}; diff --git a/assets/SearchOverlay-hqfeEBSl.js b/assets/SearchOverlay-D86Q6M8C.js similarity index 93% rename from assets/SearchOverlay-hqfeEBSl.js rename to assets/SearchOverlay-D86Q6M8C.js index 7f705eadd655ab3996caca1cfe695c300caa5bd0..ace23bacc55f4c406085659b94d9152755bba2da 100644 --- a/assets/SearchOverlay-hqfeEBSl.js +++ b/assets/SearchOverlay-D86Q6M8C.js @@ -1 +1 @@ -import{r as C,u as K,R as T,i as L,j as s,p as $}from"./index-CnNiludC.js";import{u as m}from"./useQuery-C87uSz9p.js";import{L as D}from"./LatexTitle-B1FyT_-3.js";import{c as j}from"./catalog-D7qk7tAG.js";import{u as z}from"./useDebounce-tmUrFXv0.js";import{c as M,h as B,d as I}from"./transform-zlVHQ5aE.js";import"./katex.min-BSBacQyE.js";const X=10,V=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=K(),[c,R]=T.useState(""),[h,p]=T.useState(1),a=z(c,200),g=L();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=A=>{A.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=m({queryKey:["search-papers",a,h],queryFn:()=>$.search(a,h,X),enabled:n&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=m({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],x=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||x.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),p(1)},onKeyDown:e=>{g&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[g&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",g&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=M(B(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:I(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),x.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),x.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(D,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return p(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&p(t.data.next_page)},children:"Next"})]})]})]})]})})};export{V as default}; +import{r as C,u as K,R as T,i as L,j as s,p as $}from"./index-W0d3uysl.js";import{u as m}from"./useQuery-vQc9wuoD.js";import{L as D}from"./LatexTitle-CPXUtZtc.js";import{c as j}from"./catalog-C5kDa2mw.js";import{u as z}from"./useDebounce-CX9U7t5A.js";import{c as M,h as B,d as I}from"./transform-a-eujQMz.js";import"./katex.min-BSBacQyE.js";const X=10,V=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=K(),[c,R]=T.useState(""),[h,p]=T.useState(1),a=z(c,200),g=L();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=A=>{A.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=m({queryKey:["search-papers",a,h],queryFn:()=>$.search(a,h,X),enabled:n&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=m({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],x=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||x.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),p(1)},onKeyDown:e=>{g&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[g&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",g&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=M(B(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:I(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),x.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),x.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(D,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return p(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&p(t.data.next_page)},children:"Next"})]})]})]})]})})};export{V as default}; diff --git a/assets/SettingsView-CwSxZOuD.js b/assets/SettingsView-CDI6bQH7.js similarity index 97% rename from assets/SettingsView-CwSxZOuD.js rename to assets/SettingsView-CDI6bQH7.js index b7ffa798531e10d369c6eeae818564d5cff763a8..5f999f5de420a45a03fef015f6d4b1b53b26fdf8 100644 --- a/assets/SettingsView-CwSxZOuD.js +++ b/assets/SettingsView-CDI6bQH7.js @@ -1,4 +1,4 @@ -import{d as j,g as q,G as F,ag as Y,i as U,R as u,k as $,j as e,Z as x,c as y,A as O}from"./index-CnNiludC.js";import{u as v}from"./useMutation-CZOEaG9X.js";import{S as _}from"./switch-BmJwxg75.js";import{f as Q,D as W}from"./latexPlainText-DI8YEXVe.js";import{u as B,a as H,r as K,b}from"./openrouter-CSA2RSTl.js";import{E as L}from"./external-link-05AgYo3a.js";import"./index-D0hHQwos.js";import"./useQuery-C87uSz9p.js";/** +import{d as j,g as q,G as F,ag as Y,i as U,R as u,k as $,j as e,Z as x,c as y,A as O}from"./index-W0d3uysl.js";import{u as v}from"./useMutation-BMLNTksL.js";import{S as _}from"./switch-C5eRfEo5.js";import{f as Q,D as W}from"./latexPlainText-DI8YEXVe.js";import{u as B,a as H,r as K,b}from"./openrouter-HpeJ3LPX.js";import{E as L}from"./external-link-C-XvH9CF.js";import"./index-C3rnUhi0.js";import"./useQuery-vQc9wuoD.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SharedChatView-DUG-nNC-.js b/assets/SharedChatView-5e3UDn1a.js similarity index 86% rename from assets/SharedChatView-DUG-nNC-.js rename to assets/SharedChatView-5e3UDn1a.js index bbef4e133d77c3ecbe6abecba74ccdab0aad804e..b7d888b9b5caab6070452df58feb3536e423155d 100644 --- a/assets/SharedChatView-DUG-nNC-.js +++ b/assets/SharedChatView-5e3UDn1a.js @@ -1 +1 @@ -import{f as x,u as f,r as u,j as e,b as g}from"./index-CnNiludC.js";import{u as j}from"./useQuery-C87uSz9p.js";import{C as v,U as b,A as y}from"./ChatMessage-BqPqQClr.js";import{z as p,p as S,B as N,q as k,E as w}from"./chatSessions-B5wJO74B.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CDhcGwFp.js";import"./github-6FmJETBJ.js";import"./github-CRO5e-fY.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./file-text-CzoH1JKN.js";import"./chevron-down-Bjm5Iw9B.js";const C=({detail:c})=>{const[i,h]=u.useState(()=>N(c)),s=u.useMemo(()=>{const a={};for(const r of i)for(const t of r.blocks??[])if(t.kind==="tool")for(const n of t.results??[])a[n.route_id]=n;return a},[i]),l=(a,r)=>{h(t=>t.map(n=>{var o;return n.id!==a?n:{...n,blocks:(o=n.blocks)==null?void 0:o.map((d,m)=>m===r&&(d.kind==="reasoning"||d.kind==="tool")?{...d,open:!d.open}:d)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(a=>a.role==="user"?e.jsx(b,{id:a.id,text:a.text??"",paperMentions:a.paperMentions??[]},a.id):e.jsx(y,{msg:a,papers:s,onToggleBlock:l},a.id))})},I=()=>{const{shareId:c=""}=x(),i=f(),h=g(),s=j({queryKey:["shared-chat",c],queryFn:()=>w(c),retry:(r,t)=>!(t instanceof p&&t.status===404)&&r<1});u.useEffect(()=>{const r=document.title,t=document.head.querySelector('meta[name="robots"]'),n=t==null?void 0:t.content,o=t??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",t||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,t?t.content=n??"":o.remove()}},[]);const l=r=>{k(r,void 0,{autoSend:!1}),i("/chat")},a=s.error instanceof p&&s.error.status===404;return s.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):a?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):s.isError||!s.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(C,{detail:s.data},s.data.updated_at),s.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",s.data.model_label]}),s.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),s.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai/",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(v,{onSend:r=>l(r.text),placeholder:"Ask a new research question…"})]})]})]})};export{I as default}; +import{f as x,u as f,r as u,j as e,b as g}from"./index-W0d3uysl.js";import{u as j}from"./useQuery-vQc9wuoD.js";import{C as v,U as b,A as y}from"./ChatMessage-CAxQh_v6.js";import{z as p,p as S,B as N,q as k,E as w}from"./chatSessions-BMqD4j8C.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CPjdcVfA.js";import"./github-UfpFvTKs.js";import"./github-CVlHVGA6.js";import"./PaperPreviewLink-CRTwuY7t.js";import"./index-B1HJ4Whn.js";import"./file-text-DmyxYjhS.js";import"./chevron-down-CmhJtq6c.js";const C=({detail:c})=>{const[i,h]=u.useState(()=>N(c)),s=u.useMemo(()=>{const a={};for(const r of i)for(const t of r.blocks??[])if(t.kind==="tool")for(const n of t.results??[])a[n.route_id]=n;return a},[i]),l=(a,r)=>{h(t=>t.map(n=>{var o;return n.id!==a?n:{...n,blocks:(o=n.blocks)==null?void 0:o.map((d,m)=>m===r&&(d.kind==="reasoning"||d.kind==="tool")?{...d,open:!d.open}:d)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(a=>a.role==="user"?e.jsx(b,{id:a.id,text:a.text??"",paperMentions:a.paperMentions??[]},a.id):e.jsx(y,{msg:a,papers:s,onToggleBlock:l},a.id))})},I=()=>{const{shareId:c=""}=x(),i=f(),h=g(),s=j({queryKey:["shared-chat",c],queryFn:()=>w(c),retry:(r,t)=>!(t instanceof p&&t.status===404)&&r<1});u.useEffect(()=>{const r=document.title,t=document.head.querySelector('meta[name="robots"]'),n=t==null?void 0:t.content,o=t??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",t||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,t?t.content=n??"":o.remove()}},[]);const l=r=>{k(r,void 0,{autoSend:!1}),i("/chat")},a=s.error instanceof p&&s.error.status===404;return s.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):a?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):s.isError||!s.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(C,{detail:s.data},s.data.updated_at),s.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",s.data.model_label]}),s.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),s.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai/",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(v,{onSend:r=>l(r.text),placeholder:"Ask a new research question…"})]})]})]})};export{I as default}; diff --git a/assets/SignInToEditDialog-ByW2mx_A.js b/assets/SignInToEditDialog-aDxqeILo.js similarity index 97% rename from assets/SignInToEditDialog-ByW2mx_A.js rename to assets/SignInToEditDialog-aDxqeILo.js index a4cebce7b9b438b5ad89e53ea20e2ec5d3e4aab4..c029d1660177a8c38a7b71880c80a8287e3d179d 100644 --- a/assets/SignInToEditDialog-ByW2mx_A.js +++ b/assets/SignInToEditDialog-aDxqeILo.js @@ -1,4 +1,4 @@ -import{d as ne,r as a,j as e,V as ve,v as be,W as je,h as fe,w as v,Y as b,X as ye,C as Ne,Z as we}from"./index-CnNiludC.js";import{B as L}from"./button-Cb-e5tHG.js";import{I as d,T as Ie}from"./textarea-DuxG42Qe.js";import{D as oe,a as le,b as ce,c as de,d as me,e as Se}from"./dialog-COYv9g-7.js";import{u as _e}from"./useMutation-CZOEaG9X.js";import{L as De}from"./loader-circle-3AJg82rJ.js";/** +import{d as ne,r as a,j as e,V as ve,v as be,W as je,h as fe,w as v,Y as b,X as ye,C as Ne,Z as we}from"./index-W0d3uysl.js";import{B as L}from"./button-BCHGalXc.js";import{I as d,T as Ie}from"./textarea-D8WJ-V7X.js";import{D as oe,a as le,b as ce,c as de,d as me,e as Se}from"./dialog-DOTf3B8r.js";import{u as _e}from"./useMutation-BMLNTksL.js";import{L as De}from"./loader-circle-BkFdIra2.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/StagingAccessRequestView-DPg61I7V.js b/assets/StagingAccessRequestView-CaYzuGTH.js similarity index 95% rename from assets/StagingAccessRequestView-DPg61I7V.js rename to assets/StagingAccessRequestView-CaYzuGTH.js index 65f58786ec9bee341845cd9bf0ee02ef972ee0fc..536510ca5918ef639ae6f1b4984fc08a7e1d5092 100644 --- a/assets/StagingAccessRequestView-DPg61I7V.js +++ b/assets/StagingAccessRequestView-CaYzuGTH.js @@ -1 +1 @@ -import{g,R as t,j as e,Z as p,e as j}from"./index-CnNiludC.js";import{C as x}from"./circle-check-BO6NSWAF.js";const b=()=>{const{user:s,isLoading:l}=g(),[o,d]=t.useState(!1),[c,i]=t.useState(!1),[n,u]=t.useState(null),h=async m=>{m.preventDefault(),i(!0),u(null);try{const a=await fetch(j("/api/v1/staging-access-request"),{method:"POST",credentials:"include"});if(!a.ok){const r=await a.json().catch(()=>null);throw new Error((r==null?void 0:r.detail)||"Could not submit your request. Please try again.")}d(!0)}catch(a){u(a instanceof Error?a.message:"Could not submit your request.")}finally{i(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),o?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(x,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),l?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:h,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),n&&e.jsx("p",{className:"access-request-error",role:"alert",children:n}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:c,children:c?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(p,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{b as default}; +import{g,R as t,j as e,Z as p,e as j}from"./index-W0d3uysl.js";import{C as x}from"./circle-check-ChtT1K-E.js";const b=()=>{const{user:s,isLoading:l}=g(),[o,d]=t.useState(!1),[c,i]=t.useState(!1),[n,u]=t.useState(null),h=async m=>{m.preventDefault(),i(!0),u(null);try{const a=await fetch(j("/api/v1/staging-access-request"),{method:"POST",credentials:"include"});if(!a.ok){const r=await a.json().catch(()=>null);throw new Error((r==null?void 0:r.detail)||"Could not submit your request. Please try again.")}d(!0)}catch(a){u(a instanceof Error?a.message:"Could not submit your request.")}finally{i(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),o?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(x,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),l?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:h,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),n&&e.jsx("p",{className:"access-request-error",role:"alert",children:n}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:c,children:c?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(p,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{b as default}; diff --git a/assets/SubmissionsDashboard-bmyAR3Ji.js b/assets/SubmissionsDashboard-C_oeE-yO.js similarity index 98% rename from assets/SubmissionsDashboard-bmyAR3Ji.js rename to assets/SubmissionsDashboard-C_oeE-yO.js index 3cb621bd678a204e0cdcf86c4704667651638022..745079b786f9581d95dffe615e0d53d001986054 100644 --- a/assets/SubmissionsDashboard-bmyAR3Ji.js +++ b/assets/SubmissionsDashboard-C_oeE-yO.js @@ -1,4 +1,4 @@ -var be=s=>{throw TypeError(s)};var ee=(s,t,i)=>t.has(s)||be("Cannot "+i);var f=(s,t,i)=>(ee(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(ee(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),R=(s,t,i)=>(ee(s,t,"access private method"),i);import{ak as Ce,al as te,am as Re,an as Oe,k as Ne,r as $,ao as Me,d as qe,j as e,N as Ae,R as w,v as T,g as Te,h as ke,p as Fe,ap as Ie,aq as Qe,ar as Le,w as B}from"./index-CnNiludC.js";import{Q as we,b as Ue,c as De,e as $e,d as ze,f as Be,s as xe,g as He,h as Je,u as ie}from"./useQuery-C87uSz9p.js";import{u as ge}from"./useMutation-CZOEaG9X.js";import{c as I}from"./catalog-D7qk7tAG.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{R as Ke,S as Pe,C as Ge}from"./shield-alert-BRQa4qRa.js";import{L as H}from"./loader-circle-3AJg82rJ.js";import{C as We}from"./circle-check-BO6NSWAF.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function Ye(s,t,i){const n=s.slice(0);return n[t]=i,n}var L,S,U,Q,E,A,J,K,P,G,N,ne,re,Se,ae,oe,le,_e,Ve=(_e=class extends Ce{constructor(t,i,n){super();C(this,N);C(this,L);C(this,S);C(this,U);C(this,Q);C(this,E);C(this,A);C(this,J);C(this,K);C(this,P);C(this,G,[]);k(this,L,t),k(this,Q,n),k(this,U,[]),k(this,E,[]),k(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,E).forEach(t=>{t.subscribe(i=>{R(this,N,oe).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,E).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,U,t),k(this,Q,i),te.batch(()=>{const n=f(this,E),a=R(this,N,ae).call(this,f(this,U));a.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const l=a.map(r=>r.observer),o=l.map(r=>r.getCurrentResult()),d=n.length!==l.length,h=l.some((r,m)=>r!==n[m]),b=d||h,j=b?!0:o.some((r,m)=>{const c=f(this,S)[m];return!c||!Re(r,c)});!b&&!j||(b&&(k(this,G,a),k(this,E,l)),k(this,S,o),this.hasListeners()&&(b&&(je(n,l).forEach(r=>{r.destroy()}),je(l,n).forEach(r=>{r.subscribe(m=>{R(this,N,oe).call(this,r,m)})})),R(this,N,le).call(this)))})}getCurrentResult(){return f(this,S)}getQueries(){return f(this,E).map(t=>t.getCurrentQuery())}getObservers(){return f(this,E)}getOptimisticResult(t,i){const n=R(this,N,ae).call(this,t),a=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>R(this,N,re).call(this,o??a,i,l),()=>R(this,N,ne).call(this,a,n)]}},L=new WeakMap,S=new WeakMap,U=new WeakMap,Q=new WeakMap,E=new WeakMap,A=new WeakMap,J=new WeakMap,K=new WeakMap,P=new WeakMap,G=new WeakMap,N=new WeakSet,ne=function(t,i){return i.map((n,a)=>{const l=t[a];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},re=function(t,i,n){if(i){const a=f(this,P),l=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((o,d)=>o!==a[d]));return(!f(this,A)||f(this,S)!==f(this,K)||l||i!==f(this,J))&&(k(this,J,i),k(this,K,f(this,S)),n!==void 0&&k(this,P,n),k(this,A,Oe(f(this,A),i(t)))),f(this,A)}return t},Se=function(){var t;return((t=f(this,Q))==null?void 0:t.combine)!==void 0&&f(this,E).some((i,n)=>{var a;return i.options.suspense&&((a=f(this,S)[n])==null?void 0:a.data)===void 0})},ae=function(t){const i=new Map;f(this,E).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const n=[];return t.forEach(a=>{var h;const l=f(this,L).defaultQueryOptions(a),d=((h=i.get(l.queryHash))==null?void 0:h.shift())??new we(f(this,L),l);n.push({defaultedQueryOptions:l,observer:d})}),n},oe=function(t,i){const n=f(this,E).indexOf(t);n!==-1&&(k(this,S,Ye(f(this,S),n,i)),R(this,N,le).call(this))},le=function(){var t;if(this.hasListeners()){const i=R(this,N,ne).call(this,f(this,S),f(this,G)),n=R(this,N,Se).call(this),a=f(this,A),l=n?a:R(this,N,re).call(this,i,(t=f(this,Q))==null?void 0:t.combine);(n||a!==l)&&te.batch(()=>{this.listeners.forEach(o=>{o(f(this,S))})})}},_e);function V({queries:s,...t},i){const n=Ne(),a=Ue(),l=De(),o=$.useMemo(()=>s.map(u=>{const v=n.defaultQueryOptions(u);return v._optimisticResults=a?"isRestoring":"optimistic",v}),[s,n,a]);o.forEach(u=>{$e(u);const v=n.getQueryCache().get(u.queryHash);ze(u,l,v)}),Be(l);const[d]=$.useState(()=>new Ve(n,o,t)),[h,b,j]=d.getOptimisticResult(o,t.combine),r=!a&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(u=>r?d.subscribe(te.batchCalls(u)):Me,[d,r]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=h.some((u,v)=>xe(o[v],u))?h.flatMap((u,v)=>{const g=o[v];if(g&&xe(g,u)){const F=new we(n,g);return He(g,F,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const p=h.find((u,v)=>{const g=o[v];return g&&Je({result:u,errorResetBoundary:l,throwOnError:g.throwOnError,query:n.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(p!=null&&p.error)throw p.error;return b(j())}/** +var be=s=>{throw TypeError(s)};var ee=(s,t,i)=>t.has(s)||be("Cannot "+i);var f=(s,t,i)=>(ee(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(ee(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),R=(s,t,i)=>(ee(s,t,"access private method"),i);import{ak as Ce,al as te,am as Re,an as Oe,k as Ne,r as $,ao as Me,d as qe,j as e,N as Ae,R as w,v as T,g as Te,h as ke,p as Fe,ap as Ie,aq as Qe,ar as Le,w as B}from"./index-W0d3uysl.js";import{Q as we,b as Ue,c as De,e as $e,d as ze,f as Be,s as xe,g as He,h as Je,u as ie}from"./useQuery-vQc9wuoD.js";import{u as ge}from"./useMutation-BMLNTksL.js";import{c as I}from"./catalog-C5kDa2mw.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{R as Ke,S as Pe,C as Ge}from"./shield-alert-DCTkHXsf.js";import{L as H}from"./loader-circle-BkFdIra2.js";import{C as We}from"./circle-check-ChtT1K-E.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function Ye(s,t,i){const n=s.slice(0);return n[t]=i,n}var L,S,U,Q,E,A,J,K,P,G,N,ne,re,Se,ae,oe,le,_e,Ve=(_e=class extends Ce{constructor(t,i,n){super();C(this,N);C(this,L);C(this,S);C(this,U);C(this,Q);C(this,E);C(this,A);C(this,J);C(this,K);C(this,P);C(this,G,[]);k(this,L,t),k(this,Q,n),k(this,U,[]),k(this,E,[]),k(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,E).forEach(t=>{t.subscribe(i=>{R(this,N,oe).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,E).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,U,t),k(this,Q,i),te.batch(()=>{const n=f(this,E),a=R(this,N,ae).call(this,f(this,U));a.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const l=a.map(r=>r.observer),o=l.map(r=>r.getCurrentResult()),d=n.length!==l.length,h=l.some((r,m)=>r!==n[m]),b=d||h,j=b?!0:o.some((r,m)=>{const c=f(this,S)[m];return!c||!Re(r,c)});!b&&!j||(b&&(k(this,G,a),k(this,E,l)),k(this,S,o),this.hasListeners()&&(b&&(je(n,l).forEach(r=>{r.destroy()}),je(l,n).forEach(r=>{r.subscribe(m=>{R(this,N,oe).call(this,r,m)})})),R(this,N,le).call(this)))})}getCurrentResult(){return f(this,S)}getQueries(){return f(this,E).map(t=>t.getCurrentQuery())}getObservers(){return f(this,E)}getOptimisticResult(t,i){const n=R(this,N,ae).call(this,t),a=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>R(this,N,re).call(this,o??a,i,l),()=>R(this,N,ne).call(this,a,n)]}},L=new WeakMap,S=new WeakMap,U=new WeakMap,Q=new WeakMap,E=new WeakMap,A=new WeakMap,J=new WeakMap,K=new WeakMap,P=new WeakMap,G=new WeakMap,N=new WeakSet,ne=function(t,i){return i.map((n,a)=>{const l=t[a];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},re=function(t,i,n){if(i){const a=f(this,P),l=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((o,d)=>o!==a[d]));return(!f(this,A)||f(this,S)!==f(this,K)||l||i!==f(this,J))&&(k(this,J,i),k(this,K,f(this,S)),n!==void 0&&k(this,P,n),k(this,A,Oe(f(this,A),i(t)))),f(this,A)}return t},Se=function(){var t;return((t=f(this,Q))==null?void 0:t.combine)!==void 0&&f(this,E).some((i,n)=>{var a;return i.options.suspense&&((a=f(this,S)[n])==null?void 0:a.data)===void 0})},ae=function(t){const i=new Map;f(this,E).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const n=[];return t.forEach(a=>{var h;const l=f(this,L).defaultQueryOptions(a),d=((h=i.get(l.queryHash))==null?void 0:h.shift())??new we(f(this,L),l);n.push({defaultedQueryOptions:l,observer:d})}),n},oe=function(t,i){const n=f(this,E).indexOf(t);n!==-1&&(k(this,S,Ye(f(this,S),n,i)),R(this,N,le).call(this))},le=function(){var t;if(this.hasListeners()){const i=R(this,N,ne).call(this,f(this,S),f(this,G)),n=R(this,N,Se).call(this),a=f(this,A),l=n?a:R(this,N,re).call(this,i,(t=f(this,Q))==null?void 0:t.combine);(n||a!==l)&&te.batch(()=>{this.listeners.forEach(o=>{o(f(this,S))})})}},_e);function V({queries:s,...t},i){const n=Ne(),a=Ue(),l=De(),o=$.useMemo(()=>s.map(u=>{const v=n.defaultQueryOptions(u);return v._optimisticResults=a?"isRestoring":"optimistic",v}),[s,n,a]);o.forEach(u=>{$e(u);const v=n.getQueryCache().get(u.queryHash);ze(u,l,v)}),Be(l);const[d]=$.useState(()=>new Ve(n,o,t)),[h,b,j]=d.getOptimisticResult(o,t.combine),r=!a&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(u=>r?d.subscribe(te.batchCalls(u)):Me,[d,r]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=h.some((u,v)=>xe(o[v],u))?h.flatMap((u,v)=>{const g=o[v];if(g&&xe(g,u)){const F=new we(n,g);return He(g,F,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const p=h.find((u,v)=>{const g=o[v];return g&&Je({result:u,errorResetBoundary:l,throwOnError:g.throwOnError,query:n.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(p!=null&&p.error)throw p.error;return b(j())}/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmitView-oLTX5Nai.js b/assets/SubmitView-rnoDJcn0.js similarity index 95% rename from assets/SubmitView-oLTX5Nai.js rename to assets/SubmitView-rnoDJcn0.js index 9987e6054c8587f19757910316da1008c641a8e7..60900962b409de81088e9f6be62544d10de22b1d 100644 --- a/assets/SubmitView-oLTX5Nai.js +++ b/assets/SubmitView-rnoDJcn0.js @@ -1 +1 @@ -import{u as k,k as D,h as E,g as C,R as d,j as e,E as L,p as z}from"./index-CnNiludC.js";import{u as F}from"./useMutation-CZOEaG9X.js";import{A as X,a as q}from"./alert-CV1yu6Q5.js";import{B as _}from"./button-Cb-e5tHG.js";import{I as g,T as N}from"./textarea-DuxG42Qe.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const W=()=>{const n=k(),i=D(),{toast:a}=E(),{user:s,isLoading:o}=C(),[l,p]=d.useState(""),[u,h]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[b,w]=d.useState(""),[I,y]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),h(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const m=A(l),R=m==="external",c=F({mutationFn:t=>z.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(J(t))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:b}));const P=L("/api/v1/auth/hf/login");window.location.assign(`${P}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:b});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(g,{id:"submit-input",value:l,onChange:t=>p(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),R&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(g,{id:"submit-title",value:u,onChange:t=>h(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(N,{id:"submit-abstract",value:f,onChange:t=>S(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(g,{id:"submit-authors",value:x,onChange:t=>j(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(g,{id:"submit-date",type:"date",value:b,onChange:t=>w(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),I&&e.jsx(X,{variant:"destructive",children:e.jsx(q,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{W as default}; +import{u as k,k as D,h as E,g as C,R as d,j as e,E as L,p as z}from"./index-W0d3uysl.js";import{u as F}from"./useMutation-BMLNTksL.js";import{A as X,a as q}from"./alert-BKLY_Sey.js";import{B as _}from"./button-BCHGalXc.js";import{I as g,T as N}from"./textarea-D8WJ-V7X.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const W=()=>{const n=k(),i=D(),{toast:a}=E(),{user:s,isLoading:o}=C(),[l,p]=d.useState(""),[u,h]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[b,w]=d.useState(""),[I,y]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),h(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const m=A(l),R=m==="external",c=F({mutationFn:t=>z.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(J(t))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:b}));const P=L("/api/v1/auth/hf/login");window.location.assign(`${P}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:b});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(g,{id:"submit-input",value:l,onChange:t=>p(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),R&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(g,{id:"submit-title",value:u,onChange:t=>h(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(N,{id:"submit-abstract",value:f,onChange:t=>S(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(g,{id:"submit-authors",value:x,onChange:t=>j(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(g,{id:"submit-date",type:"date",value:b,onChange:t=>w(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),I&&e.jsx(X,{variant:"destructive",children:e.jsx(q,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{W as default}; diff --git a/assets/TagBrowseView-Dwwqp3GC.js b/assets/TagBrowseView-CEaJ7wkX.js similarity index 96% rename from assets/TagBrowseView-Dwwqp3GC.js rename to assets/TagBrowseView-CEaJ7wkX.js index cb56691b98d307bec7fa7ed6273021dd5c92a0d0..0a46d538c1b84df880a661f8a321f2cc23bb53ed 100644 --- a/assets/TagBrowseView-Dwwqp3GC.js +++ b/assets/TagBrowseView-CEaJ7wkX.js @@ -1,4 +1,4 @@ -import{d as fe,r as h,n as Z,j as e,m as F,Q as be,q as je,P as Je,t as _e,o as ve,S as Xe,R as _,U as es,y as ss,v as J,L as A,f as as,u as ts,a as ns,G as rs,N as os}from"./index-CnNiludC.js";import{u as xe}from"./useQuery-C87uSz9p.js";import{P as cs,M as is}from"./components-skIcbldg.js";import{B as ls}from"./BenchmarkTrendSparkline-DAxMFKnm.js";import{u as ds,P as ms}from"./useIntersectionObserver-BUxW5ZLf.js";import{M as Q}from"./MarkdownText-mvLqNfwe.js";import{c as ge}from"./catalog-D7qk7tAG.js";import{t as ps,d as V}from"./transform-zlVHQ5aE.js";import{b as hs}from"./usePapers-C15Wpgxo.js";import{S as U}from"./skeleton-BU3tw6-C.js";import{A as us,a as xs}from"./alert-CV1yu6Q5.js";import{C as gs}from"./chevron-down-Bjm5Iw9B.js";import{G as fs}from"./github-CRO5e-fY.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.js";import"./useInfiniteQuery-DulZ-zOj.js";/** +import{d as fe,r as h,n as Z,j as e,m as F,Q as be,q as je,P as Je,t as _e,o as ve,S as Xe,R as _,U as es,y as ss,v as J,L as A,f as as,u as ts,a as ns,G as rs,N as os}from"./index-W0d3uysl.js";import{u as xe}from"./useQuery-vQc9wuoD.js";import{P as cs,M as is}from"./components-DA5I2P56.js";import{B as ls}from"./BenchmarkTrendSparkline-D6Sf06U6.js";import{u as ds,P as ms}from"./useIntersectionObserver-C1k1BF8O.js";import{M as Q}from"./MarkdownText-79sq6Tks.js";import{c as ge}from"./catalog-C5kDa2mw.js";import{t as ps,d as V}from"./transform-a-eujQMz.js";import{b as hs}from"./usePapers-CQOaIFi3.js";import{S as U}from"./skeleton-CPsExHBt.js";import{A as us,a as xs}from"./alert-BKLY_Sey.js";import{C as gs}from"./chevron-down-CmhJtq6c.js";import{G as fs}from"./github-CVlHVGA6.js";import"./LatexTitle-CPXUtZtc.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-CRTwuY7t.js";import"./index-B1HJ4Whn.js";import"./hover-card-CPjdcVfA.js";import"./useInfiniteQuery-JgP-qE09.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TagsIndexView-Dnvf32XM.js b/assets/TagsIndexView-XFOoHwb9.js similarity index 82% rename from assets/TagsIndexView-Dnvf32XM.js rename to assets/TagsIndexView-XFOoHwb9.js index 7a6205b9b9f768d85a74203f16ec68d67cbde6d9..9378830aa8a508601fd39bd22d9db3025d1561b9 100644 --- a/assets/TagsIndexView-Dnvf32XM.js +++ b/assets/TagsIndexView-XFOoHwb9.js @@ -1 +1 @@ -import{r as m,j as s,L as p}from"./index-CnNiludC.js";import{u as h}from"./useQuery-C87uSz9p.js";import{c as g}from"./catalog-D7qk7tAG.js";import{c as x,h as f,d as u}from"./transform-zlVHQ5aE.js";import{S as d}from"./skeleton-BU3tw6-C.js";import{A as j,a as y}from"./alert-CV1yu6Q5.js";import{T as k}from"./TaxonomySuggestionTile-DPjYd5AL.js";import"./SignInToEditDialog-ByW2mx_A.js";import"./button-Cb-e5tHG.js";import"./textarea-DuxG42Qe.js";import"./dialog-COYv9g-7.js";import"./useMutation-CZOEaG9X.js";import"./loader-circle-3AJg82rJ.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>e[v(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=m.useMemo(()=>o.reduce((e,a)=>e+a.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,a)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>s.jsx(d,{className:"h-24"},t))})]},a))}):o.map(e=>{const a=e.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return s.jsxs("section",{style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[a.map(t=>{const i=t.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)}),s.jsx(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 m,j as s,L as p}from"./index-W0d3uysl.js";import{u as h}from"./useQuery-vQc9wuoD.js";import{c as g}from"./catalog-C5kDa2mw.js";import{c as x,h as f,d as u}from"./transform-a-eujQMz.js";import{S as d}from"./skeleton-CPsExHBt.js";import{A as j,a as y}from"./alert-BKLY_Sey.js";import{T as k}from"./TaxonomySuggestionTile-C5fAeYBQ.js";import"./SignInToEditDialog-aDxqeILo.js";import"./button-BCHGalXc.js";import"./textarea-D8WJ-V7X.js";import"./dialog-DOTf3B8r.js";import"./useMutation-BMLNTksL.js";import"./loader-circle-BkFdIra2.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>e[v(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=m.useMemo(()=>o.reduce((e,a)=>e+a.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,a)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>s.jsx(d,{className:"h-24"},t))})]},a))}):o.map(e=>{const a=e.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return s.jsxs("section",{style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[a.map(t=>{const i=t.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)}),s.jsx(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-DPjYd5AL.js b/assets/TaxonomySuggestionTile-C5fAeYBQ.js similarity index 83% rename from assets/TaxonomySuggestionTile-DPjYd5AL.js rename to assets/TaxonomySuggestionTile-C5fAeYBQ.js index 233a8ecf92f3a543e27452a14986ada3bb3e2201..37d99b9928d43ff293d60cfeebe54427d571257a 100644 --- a/assets/TaxonomySuggestionTile-DPjYd5AL.js +++ b/assets/TaxonomySuggestionTile-C5fAeYBQ.js @@ -1 +1 @@ -import{g as u,r as o,j as e}from"./index-CnNiludC.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-ByW2mx_A.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),g=`Suggest a new ${s}...`,r=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:r,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),g]}),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{g as u,r as o,j as e}from"./index-W0d3uysl.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-aDxqeILo.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),g=`Suggest a new ${s}...`,r=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:r,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),g]}),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-Dse5C7fn.js b/assets/TrendsView-C5JngdLN.js similarity index 97% rename from assets/TrendsView-Dse5C7fn.js rename to assets/TrendsView-C5JngdLN.js index 33417e89e8cc88e7041ed56ae5105172a9935646..2273f29cd7841ed27ed6f608e4224f0b189ba2c3 100644 --- a/assets/TrendsView-Dse5C7fn.js +++ b/assets/TrendsView-C5JngdLN.js @@ -1 +1 @@ -import{c as X,R as G,j as e}from"./index-CnNiludC.js";import{u as J}from"./useQuery-C87uSz9p.js";import{A as q,a as E}from"./alert-CV1yu6Q5.js";import{S as P}from"./skeleton-BU3tw6-C.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},te=()=>{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{te as default}; +import{c as X,R as G,j as e}from"./index-W0d3uysl.js";import{u as J}from"./useQuery-vQc9wuoD.js";import{A as q,a as E}from"./alert-BKLY_Sey.js";import{S as P}from"./skeleton-CPsExHBt.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},te=()=>{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{te as default}; diff --git a/assets/UserProfileView-DLYWBFmP.js b/assets/UserProfileView-CNXz88Hn.js similarity index 87% rename from assets/UserProfileView-DLYWBFmP.js rename to assets/UserProfileView-CNXz88Hn.js index 08b3d9659c8489ac777dd1d76046928b6d606f15..a1f879d7d36cfccb34019119d5bb80abb4c36f8c 100644 --- a/assets/UserProfileView-DLYWBFmP.js +++ b/assets/UserProfileView-CNXz88Hn.js @@ -1 +1 @@ -import{f as s,j as e,av as i,e as o}from"./index-CnNiludC.js";import{u as d}from"./useQuery-C87uSz9p.js";import{C as l}from"./OrganizationContributionGraph-CBDgtzLe.js";import"./skeleton-BU3tw6-C.js";import"./catalog-D7qk7tAG.js";async function c(t){const a=await fetch(o(`/api/v1/profiles/${encodeURIComponent(t)}`),{credentials:"include"});if(!a.ok)throw new Error("Profile not found");const r=await a.json();if(a.redirected){const n=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:n,redirected_from_alias:!0}}return r}const f=()=>{const{username:t=""}=s(),a=d({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>c(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(i,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(l,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default}; +import{f as s,j as e,av as i,e as o}from"./index-W0d3uysl.js";import{u as d}from"./useQuery-vQc9wuoD.js";import{C as l}from"./OrganizationContributionGraph-goBBZ8vD.js";import"./skeleton-CPsExHBt.js";import"./catalog-C5kDa2mw.js";async function c(t){const a=await fetch(o(`/api/v1/profiles/${encodeURIComponent(t)}`),{credentials:"include"});if(!a.ok)throw new Error("Profile not found");const r=await a.json();if(a.redirected){const n=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:n,redirected_from_alias:!0}}return r}const f=()=>{const{username:t=""}=s(),a=d({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>c(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(i,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(l,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default}; diff --git a/assets/alert-CV1yu6Q5.js b/assets/alert-BKLY_Sey.js similarity index 92% rename from assets/alert-CV1yu6Q5.js rename to assets/alert-BKLY_Sey.js index c2c02da06e0a4b50e2335f5aedadf14cd4161a63..53562780d23c97e739cccc330328a8d09736c7ea 100644 --- a/assets/alert-CV1yu6Q5.js +++ b/assets/alert-BKLY_Sey.js @@ -1 +1 @@ -import{r as a,j as s,v as l,W as i}from"./index-CnNiludC.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,W as i}from"./index-W0d3uysl.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-Cb-e5tHG.js b/assets/button-BCHGalXc.js similarity index 94% rename from assets/button-Cb-e5tHG.js rename to assets/button-BCHGalXc.js index 87959d78d8623800919b75e4d629bbf08ca6ba3d..a0058a5e1f1882af25176b27c88cfffabaddadf7 100644 --- a/assets/button-Cb-e5tHG.js +++ b/assets/button-BCHGalXc.js @@ -1 +1 @@ -import{r as a,j as d,aj as u,v as c,W as f}from"./index-CnNiludC.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,aj as u,v as c,W as f}from"./index-W0d3uysl.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/catalog-D7qk7tAG.js b/assets/catalog-C5kDa2mw.js similarity index 97% rename from assets/catalog-D7qk7tAG.js rename to assets/catalog-C5kDa2mw.js index 7d4582eeffebfcc1c484503bfadf2f9ac95ba107..e7da994439562329a865f41b257ed5d78c50fdb3 100644 --- a/assets/catalog-D7qk7tAG.js +++ b/assets/catalog-C5kDa2mw.js @@ -1 +1 @@ -import{ae as o}from"./index-CnNiludC.js";function s(n,e){const t=new URLSearchParams;for(const[i,a]of Object.entries(e??{}))a!==void 0&&a!==""&&t.set(i,String(a));const r=t.toString();return`${n}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const h=new u(o);export{h as c}; +import{ae as o}from"./index-W0d3uysl.js";function s(n,e){const t=new URLSearchParams;for(const[i,a]of Object.entries(e??{}))a!==void 0&&a!==""&&t.set(i,String(a));const r=t.toString();return`${n}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const h=new u(o);export{h as c}; diff --git a/assets/chatSessions-B5wJO74B.js b/assets/chatSessions-BMqD4j8C.js similarity index 99% rename from assets/chatSessions-B5wJO74B.js rename to assets/chatSessions-BMqD4j8C.js index 2e5457a365303beb6a7d714d9e3ad1d402ffc01f..0d9f2025dcfa2fdbd80fa9215c2f2b4f65582b7e 100644 --- a/assets/chatSessions-B5wJO74B.js +++ b/assets/chatSessions-BMqD4j8C.js @@ -1,4 +1,4 @@ -import{d as G,j as a,r as C,C as Q,R as d,c as J,p as X,e as W}from"./index-CnNiludC.js";import{C as Z}from"./chevron-down-Bjm5Iw9B.js";import{u as ee}from"./useQuery-C87uSz9p.js";/** +import{d as G,j as a,r as C,C as Q,R as d,c as J,p as X,e as W}from"./index-W0d3uysl.js";import{C as Z}from"./chevron-down-CmhJtq6c.js";import{u as ee}from"./useQuery-vQc9wuoD.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/chevron-down-Bjm5Iw9B.js b/assets/chevron-down-CmhJtq6c.js similarity index 85% rename from assets/chevron-down-Bjm5Iw9B.js rename to assets/chevron-down-CmhJtq6c.js index 9dfbb9227b734cfab13daa5429efc6ed3c840019..ea0a17b9aa8f99a9a5b1bf3c2a30b02f4b120453 100644 --- a/assets/chevron-down-Bjm5Iw9B.js +++ b/assets/chevron-down-CmhJtq6c.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-CnNiludC.js";/** +import{d as o}from"./index-W0d3uysl.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-BO6NSWAF.js b/assets/circle-check-ChtT1K-E.js similarity index 87% rename from assets/circle-check-BO6NSWAF.js rename to assets/circle-check-ChtT1K-E.js index 40056d112defc8e91f830d69205885965945b593..735737985cb6dcf1598e91090ac0b98faf80b101 100644 --- a/assets/circle-check-BO6NSWAF.js +++ b/assets/circle-check-ChtT1K-E.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-CnNiludC.js";/** +import{d as c}from"./index-W0d3uysl.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codexAddEvals-DIZEZyhj.js b/assets/codexAddEvals-BYyAthFq.js similarity index 97% rename from assets/codexAddEvals-DIZEZyhj.js rename to assets/codexAddEvals-BYyAthFq.js index 7185edc788537da0d7b63351ab6d7e4fd23ff6f7..cd82497c3446bb77c9cff98c9329ec181f46878f 100644 --- a/assets/codexAddEvals-DIZEZyhj.js +++ b/assets/codexAddEvals-BYyAthFq.js @@ -1,4 +1,4 @@ -import{d as o,j as i,v as c,W as d,e as n}from"./index-CnNiludC.js";/** +import{d as o,j as i,v as c,W as d,e as n}from"./index-W0d3uysl.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/components-skIcbldg.js b/assets/components-DA5I2P56.js similarity index 98% rename from assets/components-skIcbldg.js rename to assets/components-DA5I2P56.js index 6be50b724cdd9f1c9cce72442beec27f4bc3944c..f3277e28a80f13c662a512ae83c450cc0fc954a6 100644 --- a/assets/components-skIcbldg.js +++ b/assets/components-DA5I2P56.js @@ -1 +1 @@ -import{k as R,R as p,p as E,j as e,L,u as S}from"./index-CnNiludC.js";import{L as T,a as P}from"./LatexTitle-B1FyT_-3.js";import{h as Z,d as H,a as B,c as D}from"./transform-zlVHQ5aE.js";import{s as C}from"./safeExternalHref-CkBrsh84.js";const G=({slug:t,label:s,onClick:r})=>{const a=S(),x=Z(t),o=D(x),i=c=>{if(c.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:i,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),H(s||B(t),t)]})},O=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const x=o=>{if(o.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=p.useRef(null),a=p.useRef(null),[x,o]=p.useState(t.length);if(p.useLayoutEffect(()=>{const n=r.current,h=a.current;if(!n||!h||t.length===0)return;const l=f=>(h.textContent=f,h.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let d=0,u=0;for(const N of t){const m=l(N.measureText);if(d+m<=f)d+=m,u+=1;else break}if(u0&&d+l(` · +${t.length-u} more`)>f;)u-=1,d-=l(t[u].measureText);u===0&&(u=1)}o(u)};M();const g=new ResizeObserver(M);return g.observe(n),()=>g.disconnect()},[t]),t.length===0)return null;const i=t.slice(0,Math.max(1,Math.min(x,t.length))),c=t.length-i.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),i.map((n,h)=>e.jsxs(p.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[h>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.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:l=>l.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${h}`)),c>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",c," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=p.useMemo(()=>{const o=[];let i=!0;for(const c of[1,2,3]){const n=t.filter(h=>h.rank===c);n.forEach((h,l)=>{const M=l===0,g=M?`${i?"":" · "}${$[c]} on `:", ";o.push({name:h.name,slug:h.slug,rank:c,isGroupStart:M,measureText:g+h.name})}),n.length>0&&(i=!1)}return o},[t]),x=p.useMemo(()=>[1,2,3].map(o=>t.filter(c=>c.rank===o).map((c,n)=>({name:c.name,slug:c.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${$[o]} on `:", ")+c.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))}):a.length===0?null:e.jsx(F,{units:a,paperHref:s})},K=({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"})]}),_=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)},V=({paperId:t})=>{const s=_(t),r=160,a=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,i=[],c=9+Math.floor(s()*3);for(let k=0;k.3,h=Math.floor(s()*3),l=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:d+(r-d*2)*(1-k)/2,y:z+v*2.4,width:(r-d*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:d+(r-d*2)*(1-o)/2,y:A,width:(r-d*2)*o,height:.9,fill:g,opacity:.7,rx:.2}),e.jsx("rect",{x:d,y:W,width:6,height:1,fill:f,opacity:.6}),i.map((k,v)=>{const y=j+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:N,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:m,y:j,width:u,height:14,fill:"#F0EBE0",stroke:g,strokeWidth:.3,opacity:.9}),h===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${m+2},${j+11} ${m+6},${j+8} ${m+10},${j+9} ${m+14},${j+5} ${m+18},${j+6} ${m+22},${j+3}`})}),h===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:m+u/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:m+2,y:j+11,width:u-4,height:1.5,fill:g})]}),h===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:m+3,y:j+5,width:u-6,height:1,fill:f}),e.jsx("rect",{x:m+6,y:j+8,width:u-12,height:.8,fill:f})]})]}),l.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:m,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`r${v}`)})]})})},q=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[x,o]=p.useState(!1),[i,c]=p.useState(0),[n,h]=p.useState(a),l=p.useRef(null);p.useEffect(()=>{o(!1),c(0)},[r]);const M=p.useMemo(()=>{if(!r)return null;if(i===0)return r;const g=r.includes("?")?"&":"?";return`${r}${g}retry=${i}`},[r,i]);return p.useEffect(()=>{if(a||n)return;const g=l.current;if(!g)return;const f=new IntersectionObserver(([d])=>{d.isIntersecting&&(h(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(g),()=>f.disconnect()},[a,n]),r&&!x?e.jsx("div",{ref:l,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(i<1){c(g=>g+1);return}o(!0)}},M)}):e.jsx(V,{paperId:t})},Y="language-modeling";function w(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Q(t){return w(t.slug)==="large language model"||w(t.name)==="large language model"}function J(t){return t.tags.includes(Y)?t.methods.filter(s=>!Q(s)):t.methods}const X=({name:t,slug:s,logoUrl:r})=>{const[a,x]=p.useState(!1);return!r||a?null:e.jsx(L,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>x(!0)})})},oe=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a})=>{const x=R(),o=`/paper/${t.id}`,i=p.useCallback(()=>{x.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>E.getByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,x]),c=t.authors.slice(0,3).join(", "),n=t.authors.length,h=J(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:o,className:"paper-thumb-wrap",onFocus:i,onMouseEnter:i,children:e.jsx(q,{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.jsxs("h3",{className:"paper-title",children:[e.jsx(L,{to:o,onFocus:i,onMouseEnter:i,children:e.jsx(T,{title:t.title})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(l=>e.jsx(X,{...l},l.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[c,n>3&&e.jsxs("span",{children:[", ","+",n-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[n>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[n>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(P,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:o}),(t.tags.length>0||h.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(l=>e.jsx(G,{slug:l,onClick:a},l)),h.map(l=>e.jsx(O,{method:l},l.id||l.slug||l.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[C(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:l=>l.stopPropagation(),children:[e.jsx(K,{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:"↑"}),ee(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),C(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:l=>l.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 ee(t){return t.toFixed(1)}export{K as I,O as M,oe as P,I as S,G as T,q as a}; +import{k as R,R as p,p as E,j as e,L,u as S}from"./index-W0d3uysl.js";import{L as T,a as P}from"./LatexTitle-CPXUtZtc.js";import{h as Z,d as H,a as B,c as D}from"./transform-a-eujQMz.js";import{s as C}from"./safeExternalHref-CkBrsh84.js";const G=({slug:t,label:s,onClick:r})=>{const a=S(),x=Z(t),o=D(x),i=c=>{if(c.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:i,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),H(s||B(t),t)]})},O=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const x=o=>{if(o.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=p.useRef(null),a=p.useRef(null),[x,o]=p.useState(t.length);if(p.useLayoutEffect(()=>{const n=r.current,h=a.current;if(!n||!h||t.length===0)return;const l=f=>(h.textContent=f,h.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let d=0,u=0;for(const N of t){const m=l(N.measureText);if(d+m<=f)d+=m,u+=1;else break}if(u0&&d+l(` · +${t.length-u} more`)>f;)u-=1,d-=l(t[u].measureText);u===0&&(u=1)}o(u)};M();const g=new ResizeObserver(M);return g.observe(n),()=>g.disconnect()},[t]),t.length===0)return null;const i=t.slice(0,Math.max(1,Math.min(x,t.length))),c=t.length-i.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),i.map((n,h)=>e.jsxs(p.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[h>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.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:l=>l.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${h}`)),c>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",c," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=p.useMemo(()=>{const o=[];let i=!0;for(const c of[1,2,3]){const n=t.filter(h=>h.rank===c);n.forEach((h,l)=>{const M=l===0,g=M?`${i?"":" · "}${$[c]} on `:", ";o.push({name:h.name,slug:h.slug,rank:c,isGroupStart:M,measureText:g+h.name})}),n.length>0&&(i=!1)}return o},[t]),x=p.useMemo(()=>[1,2,3].map(o=>t.filter(c=>c.rank===o).map((c,n)=>({name:c.name,slug:c.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${$[o]} on `:", ")+c.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))}):a.length===0?null:e.jsx(F,{units:a,paperHref:s})},K=({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"})]}),_=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)},V=({paperId:t})=>{const s=_(t),r=160,a=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,i=[],c=9+Math.floor(s()*3);for(let k=0;k.3,h=Math.floor(s()*3),l=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:d+(r-d*2)*(1-k)/2,y:z+v*2.4,width:(r-d*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:d+(r-d*2)*(1-o)/2,y:A,width:(r-d*2)*o,height:.9,fill:g,opacity:.7,rx:.2}),e.jsx("rect",{x:d,y:W,width:6,height:1,fill:f,opacity:.6}),i.map((k,v)=>{const y=j+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:N,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:m,y:j,width:u,height:14,fill:"#F0EBE0",stroke:g,strokeWidth:.3,opacity:.9}),h===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${m+2},${j+11} ${m+6},${j+8} ${m+10},${j+9} ${m+14},${j+5} ${m+18},${j+6} ${m+22},${j+3}`})}),h===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:m+u/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:m+2,y:j+11,width:u-4,height:1.5,fill:g})]}),h===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:m+3,y:j+5,width:u-6,height:1,fill:f}),e.jsx("rect",{x:m+6,y:j+8,width:u-12,height:.8,fill:f})]})]}),l.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:m,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`r${v}`)})]})})},q=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[x,o]=p.useState(!1),[i,c]=p.useState(0),[n,h]=p.useState(a),l=p.useRef(null);p.useEffect(()=>{o(!1),c(0)},[r]);const M=p.useMemo(()=>{if(!r)return null;if(i===0)return r;const g=r.includes("?")?"&":"?";return`${r}${g}retry=${i}`},[r,i]);return p.useEffect(()=>{if(a||n)return;const g=l.current;if(!g)return;const f=new IntersectionObserver(([d])=>{d.isIntersecting&&(h(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(g),()=>f.disconnect()},[a,n]),r&&!x?e.jsx("div",{ref:l,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(i<1){c(g=>g+1);return}o(!0)}},M)}):e.jsx(V,{paperId:t})},Y="language-modeling";function w(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Q(t){return w(t.slug)==="large language model"||w(t.name)==="large language model"}function J(t){return t.tags.includes(Y)?t.methods.filter(s=>!Q(s)):t.methods}const X=({name:t,slug:s,logoUrl:r})=>{const[a,x]=p.useState(!1);return!r||a?null:e.jsx(L,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>x(!0)})})},oe=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a})=>{const x=R(),o=`/paper/${t.id}`,i=p.useCallback(()=>{x.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>E.getByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,x]),c=t.authors.slice(0,3).join(", "),n=t.authors.length,h=J(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:o,className:"paper-thumb-wrap",onFocus:i,onMouseEnter:i,children:e.jsx(q,{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.jsxs("h3",{className:"paper-title",children:[e.jsx(L,{to:o,onFocus:i,onMouseEnter:i,children:e.jsx(T,{title:t.title})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(l=>e.jsx(X,{...l},l.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[c,n>3&&e.jsxs("span",{children:[", ","+",n-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[n>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[n>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(P,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:o}),(t.tags.length>0||h.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(l=>e.jsx(G,{slug:l,onClick:a},l)),h.map(l=>e.jsx(O,{method:l},l.id||l.slug||l.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[C(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:l=>l.stopPropagation(),children:[e.jsx(K,{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:"↑"}),ee(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),C(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:l=>l.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 ee(t){return t.toFixed(1)}export{K as I,O as M,oe as P,I as S,G as T,q as a}; diff --git a/assets/dialog-COYv9g-7.js b/assets/dialog-DOTf3B8r.js similarity index 99% rename from assets/dialog-COYv9g-7.js rename to assets/dialog-DOTf3B8r.js index 5487a66141a80e66705ca7a90e287b1b6cf1c0a8..4f3dfe33ec90200dd85572fdcc5a5a1b4dcb8ba3 100644 --- a/assets/dialog-COYv9g-7.js +++ b/assets/dialog-DOTf3B8r.js @@ -1,4 +1,4 @@ -import{r as s,j as i,_ as Z,n as K,Q as R,P as N,a2 as Q,m as D,q as x,t as U,o as h,a3 as X,a4 as Y,a5 as J,a6 as ee,a7 as te,aa as oe,X as ne,v as p}from"./index-CnNiludC.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]=U(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=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=h(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=O;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),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(N,{present:o||r.open,children:i.jsx(Q,{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(N,{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(Y,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(N,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=h(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return X(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=h(t,d);return J(),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,_ as Z,n as K,Q as R,P as N,a2 as Q,m as D,q as x,t as U,o as h,a3 as X,a4 as Y,a5 as J,a6 as ee,a7 as te,aa as oe,X as ne,v as p}from"./index-W0d3uysl.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]=U(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=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=h(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=O;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),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(N,{present:o||r.open,children:i.jsx(Q,{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(N,{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(Y,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(N,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=h(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return X(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=h(t,d);return J(),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/evaluations-imurwG7D.js b/assets/evaluations-ByQ-gfqI.js similarity index 95% rename from assets/evaluations-imurwG7D.js rename to assets/evaluations-ByQ-gfqI.js index 7e0a21e95d1bf3bc705d1c914a9a8a5a986c061b..095b509599f0438a6a6139ca67ac54fa5f2ab499 100644 --- a/assets/evaluations-imurwG7D.js +++ b/assets/evaluations-ByQ-gfqI.js @@ -1 +1 @@ -import{j as a,L as u,ae as h,af as l}from"./index-CnNiludC.js";import{H as c,a as d,b as p}from"./hover-card-CDhcGwFp.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";const y=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function m(r){if(!r)return"Evaluation sourced outside this paper";const e=r.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(r,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return r}}const w=({sourceUrl:r})=>{const e=g(r),t=typeof r=="string"&&r.startsWith("/paper/")?r:null,s=m(r);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${s}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):a.jsxs(a.Fragment,{children:[" ",s,"."]})]})]})};class x{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(s=>s[1]!==void 0).map(([s,n])=>[s,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const s=await this.list({...e,page_size:100}),n=[...s.results];let i=s.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const S=new x(h);export{y as C,w as E,S as e}; +import{j as a,L as u,ae as h,af as l}from"./index-W0d3uysl.js";import{H as c,a as d,b as p}from"./hover-card-CPjdcVfA.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";const y=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function m(r){if(!r)return"Evaluation sourced outside this paper";const e=r.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(r,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return r}}const w=({sourceUrl:r})=>{const e=g(r),t=typeof r=="string"&&r.startsWith("/paper/")?r:null,s=m(r);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${s}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):a.jsxs(a.Fragment,{children:[" ",s,"."]})]})]})};class x{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(s=>s[1]!==void 0).map(([s,n])=>[s,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const s=await this.list({...e,page_size:100}),n=[...s.results];let i=s.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const S=new x(h);export{y as C,w as E,S as e}; diff --git a/assets/external-link-05AgYo3a.js b/assets/external-link-C-XvH9CF.js similarity index 89% rename from assets/external-link-05AgYo3a.js rename to assets/external-link-C-XvH9CF.js index 4ee6720544a4c1ff3b446a429ef3c7e29eb89ae8..a41b2ea3799094bd52091a4acd650930980a4442 100644 --- a/assets/external-link-05AgYo3a.js +++ b/assets/external-link-C-XvH9CF.js @@ -1,4 +1,4 @@ -import{d as a}from"./index-CnNiludC.js";/** +import{d as a}from"./index-W0d3uysl.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-CzoH1JKN.js b/assets/file-text-DmyxYjhS.js similarity index 91% rename from assets/file-text-CzoH1JKN.js rename to assets/file-text-DmyxYjhS.js index 20075c9bfd15fe2f1a7067b0e190971e0c84a2e5..68bcf9fdfd96b17a23f463edb05a21da3e7e2e53 100644 --- a/assets/file-text-CzoH1JKN.js +++ b/assets/file-text-DmyxYjhS.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CnNiludC.js";/** +import{d as e}from"./index-W0d3uysl.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-CRO5e-fY.js b/assets/github-CVlHVGA6.js similarity index 92% rename from assets/github-CRO5e-fY.js rename to assets/github-CVlHVGA6.js index 4f347b7f489a9c93fecd9a9a138a80c7e3d8d276..4ded71d710cd20b907e31580a7af8d957ae987ce 100644 --- a/assets/github-CRO5e-fY.js +++ b/assets/github-CVlHVGA6.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-CnNiludC.js";/** +import{d as c}from"./index-W0d3uysl.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-6FmJETBJ.js b/assets/github-UfpFvTKs.js similarity index 96% rename from assets/github-6FmJETBJ.js rename to assets/github-UfpFvTKs.js index 39d983489302c72384fa0cfa806c956ce47db6b0..8e893bd52136a0e0aaba8b717c94035ee622ea4b 100644 --- a/assets/github-6FmJETBJ.js +++ b/assets/github-UfpFvTKs.js @@ -1 +1 @@ -import{e as l}from"./index-CnNiludC.js";const u=new Set(["github.com","www.github.com"]);function c(o){let n;try{n=new URL(o)}catch{return null}if(n.protocol!=="https:"||!u.has(n.hostname))return null;const r=n.pathname.split("/").filter(Boolean);if(r.length!==2)return null;let e,t;try{e=decodeURIComponent(r[0]),t=decodeURIComponent(r[1]).replace(/\.git$/,"")}catch{return null}if(!/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38})$/.test(e)||!/^[a-zA-Z0-9._-]{1,100}$/.test(t))return null;const i=`${e}/${t}`,s=[e,t].map(encodeURIComponent).join("/");return{owner:e,repository:t,repoId:i,url:`https://github.com/${s}`}}async function h(o,n){const r=[o.owner,o.repository].map(encodeURIComponent).join("/"),e=await fetch(l(`/api/v1/github/repositories/${r}/preview`),{signal:n});if(!e.ok)throw new Error(`GitHub repository lookup failed: ${e.status}`);const t=await e.json();return{description:typeof t.description=="string"?t.description:null,stars:typeof t.stars=="number"?t.stars:0,forks:typeof t.forks=="number"?t.forks:0,language:typeof t.language=="string"?t.language:null,archived:t.archived===!0,avatarUrl:typeof t.avatar_url=="string"?t.avatar_url:""}}function a(o){const n=o.trim();if(!n)return null;let r=n;!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`https://${r}`);try{const e=new URL(r);if(e.hostname.toLowerCase()!=="github.com")return null;const t=e.pathname.split("/").filter(Boolean);if(t.length<2)return null;const i=t[0].toLowerCase();let s=t[1].toLowerCase();return s.endsWith(".git")&&(s=s.slice(0,-4)),`https://github.com/${i}/${s}`}catch{return null}}function f(o,n){const r=a(o),e=a(n);return r&&e?r===e:o.trim()===n.trim()}export{h as f,f as g,a as n,c as p}; +import{e as l}from"./index-W0d3uysl.js";const u=new Set(["github.com","www.github.com"]);function c(o){let n;try{n=new URL(o)}catch{return null}if(n.protocol!=="https:"||!u.has(n.hostname))return null;const r=n.pathname.split("/").filter(Boolean);if(r.length!==2)return null;let e,t;try{e=decodeURIComponent(r[0]),t=decodeURIComponent(r[1]).replace(/\.git$/,"")}catch{return null}if(!/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38})$/.test(e)||!/^[a-zA-Z0-9._-]{1,100}$/.test(t))return null;const i=`${e}/${t}`,s=[e,t].map(encodeURIComponent).join("/");return{owner:e,repository:t,repoId:i,url:`https://github.com/${s}`}}async function h(o,n){const r=[o.owner,o.repository].map(encodeURIComponent).join("/"),e=await fetch(l(`/api/v1/github/repositories/${r}/preview`),{signal:n});if(!e.ok)throw new Error(`GitHub repository lookup failed: ${e.status}`);const t=await e.json();return{description:typeof t.description=="string"?t.description:null,stars:typeof t.stars=="number"?t.stars:0,forks:typeof t.forks=="number"?t.forks:0,language:typeof t.language=="string"?t.language:null,archived:t.archived===!0,avatarUrl:typeof t.avatar_url=="string"?t.avatar_url:""}}function a(o){const n=o.trim();if(!n)return null;let r=n;!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`https://${r}`);try{const e=new URL(r);if(e.hostname.toLowerCase()!=="github.com")return null;const t=e.pathname.split("/").filter(Boolean);if(t.length<2)return null;const i=t[0].toLowerCase();let s=t[1].toLowerCase();return s.endsWith(".git")&&(s=s.slice(0,-4)),`https://github.com/${i}/${s}`}catch{return null}}function f(o,n){const r=a(o),e=a(n);return r&&e?r===e:o.trim()===n.trim()}export{h as f,f as g,a as n,c as p}; diff --git a/assets/hover-card-CDhcGwFp.js b/assets/hover-card-CPjdcVfA.js similarity index 98% rename from assets/hover-card-CDhcGwFp.js rename to assets/hover-card-CPjdcVfA.js index f9f9426d2ea1a0eadba6fb23727c9a04239ff1c5..1da0b02bed1dda4d578cf574282dbae456a10c28 100644 --- a/assets/hover-card-CDhcGwFp.js +++ b/assets/hover-card-CPjdcVfA.js @@ -1 +1 @@ -import{r as n,n as k,j as c,$ as F,a0 as I,m as U,q as l,a1 as T,P as O,a2 as $,t as W,o as z,a7 as B,a8 as G,a9 as K,v as q}from"./index-CnNiludC.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]=k({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]),M=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:M,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,n as k,j as c,$ as F,a0 as I,m as U,q as l,a1 as T,P as O,a2 as $,t as W,o as z,a7 as B,a8 as G,a9 as K,v as q}from"./index-W0d3uysl.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]=k({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]),M=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:M,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-B8BJTSsG.js b/assets/index-B1HJ4Whn.js similarity index 99% rename from assets/index-B8BJTSsG.js rename to assets/index-B1HJ4Whn.js index e46866d8ebd995288ed01b85c77d6c69e84aa316..a9500d5ef1bbd0dde73e3d44e2026d80ccc0048f 100644 --- a/assets/index-B8BJTSsG.js +++ b/assets/index-B1HJ4Whn.js @@ -1,4 +1,4 @@ -import{ac as nn,ad as or,j as pn}from"./index-CnNiludC.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{ac as nn,ad as or,j as pn}from"./index-W0d3uysl.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;++H(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-W0d3uysl.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-CnNiludC.js b/assets/index-W0d3uysl.js similarity index 96% rename from assets/index-CnNiludC.js rename to assets/index-W0d3uysl.js index 27689b2e9e21d41de92baea2f05536c1a247906c..984efb2b732cef0c543790bd444995a993da74b7 100644 --- a/assets/index-CnNiludC.js +++ b/assets/index-W0d3uysl.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-Dv7Ll2yq.js","assets/components-skIcbldg.js","assets/LatexTitle-B1FyT_-3.js","assets/katex.min-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/transform-zlVHQ5aE.js","assets/safeExternalHref-CkBrsh84.js","assets/useIntersectionObserver-BUxW5ZLf.js","assets/chatSessions-B5wJO74B.js","assets/chevron-down-Bjm5Iw9B.js","assets/useQuery-C87uSz9p.js","assets/catalog-D7qk7tAG.js","assets/chatPrompts-CDY3UGU1.js","assets/usePapers-C15Wpgxo.js","assets/useInfiniteQuery-DulZ-zOj.js","assets/usePeriodFilter-CAw9mrm9.js","assets/skeleton-BU3tw6-C.js","assets/alert-CV1yu6Q5.js","assets/ChatView-DRCYIPi4.js","assets/ChatMessage-BqPqQClr.js","assets/hover-card-CDhcGwFp.js","assets/github-6FmJETBJ.js","assets/github-CRO5e-fY.js","assets/PaperPreviewLink-DAFhnDhq.js","assets/index-B8BJTSsG.js","assets/file-text-CzoH1JKN.js","assets/openrouter-CSA2RSTl.js","assets/SharedChatView-DUG-nNC-.js","assets/PapersListView-DpeQT2iM.js","assets/useDebounce-tmUrFXv0.js","assets/PaperDetailView-BEjlwQbA.js","assets/evaluations-imurwG7D.js","assets/evaluations-DXfuqNnO.css","assets/latexPlainText-DI8YEXVe.js","assets/button-Cb-e5tHG.js","assets/index-D0hHQwos.js","assets/textarea-DuxG42Qe.js","assets/dialog-COYv9g-7.js","assets/useMutation-CZOEaG9X.js","assets/SignInToEditDialog-ByW2mx_A.js","assets/loader-circle-3AJg82rJ.js","assets/searchable-select-BV8KO0OB.js","assets/codexAddEvals-DIZEZyhj.js","assets/savedPapersAuth-BGaR1VbQ.js","assets/TagsIndexView-Dnvf32XM.js","assets/TaxonomySuggestionTile-DPjYd5AL.js","assets/TagBrowseView-Dwwqp3GC.js","assets/BenchmarkTrendSparkline-DAxMFKnm.js","assets/MarkdownText-mvLqNfwe.js","assets/MethodsIndexView-BlcIa_fS.js","assets/slug-BpH-Nkvz.js","assets/FrameworksIndexView-CJh-2Pow.js","assets/TrendsView-Dse5C7fn.js","assets/ConferencesIndexView-ESNh5pHs.js","assets/AiDeadlinesView-BG7IjWh-.js","assets/switch-BmJwxg75.js","assets/ConferenceDetailView-BP5drqUx.js","assets/ConferenceTaskView-DeQ10q-x.js","assets/OrganizationsIndexView-DN3ysr-g.js","assets/OrganizationsIndexView-dniuSNch.css","assets/OrganizationDetailView-BbrTMC2j.js","assets/OrganizationPaperFeed-BPCfQF2i.js","assets/OrganizationContributionGraph-CBDgtzLe.js","assets/NotFound-B6qYFFtn.js","assets/OrganizationTaskView-CFdQxMtl.js","assets/AuthorDetailView-BT0wFF7e.js","assets/MethodDetailView-CkUzVx0g.js","assets/BenchmarkDetailView-CJEQANf-.js","assets/BenchmarkDetailView-DS2Mrskn.css","assets/SavedPapersView-CKKGXgM6.js","assets/SettingsView-CwSxZOuD.js","assets/external-link-05AgYo3a.js","assets/PrivacyView-CIEmHSbN.js","assets/SubmitView-oLTX5Nai.js","assets/CronDashboard-Bo73phUc.js","assets/shield-alert-BRQa4qRa.js","assets/circle-check-BO6NSWAF.js","assets/CronDashboard-DwChfW9h.css","assets/SubmissionsDashboard-bmyAR3Ji.js","assets/UserProfileView-DLYWBFmP.js","assets/RateLimitsView-C-wgjf0f.js","assets/SearchOverlay-hqfeEBSl.js","assets/StagingAccessRequestView-DPg61I7V.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-Dd-lH8Q-.js","assets/components-DA5I2P56.js","assets/LatexTitle-CPXUtZtc.js","assets/katex.min-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/transform-a-eujQMz.js","assets/safeExternalHref-CkBrsh84.js","assets/useIntersectionObserver-C1k1BF8O.js","assets/chatSessions-BMqD4j8C.js","assets/chevron-down-CmhJtq6c.js","assets/useQuery-vQc9wuoD.js","assets/catalog-C5kDa2mw.js","assets/chatPrompts-CDY3UGU1.js","assets/usePapers-CQOaIFi3.js","assets/useInfiniteQuery-JgP-qE09.js","assets/usePeriodFilter-D1eMQYtm.js","assets/skeleton-CPsExHBt.js","assets/alert-BKLY_Sey.js","assets/ChatView-CgnMUN-T.js","assets/ChatMessage-CAxQh_v6.js","assets/hover-card-CPjdcVfA.js","assets/github-UfpFvTKs.js","assets/github-CVlHVGA6.js","assets/PaperPreviewLink-CRTwuY7t.js","assets/index-B1HJ4Whn.js","assets/file-text-DmyxYjhS.js","assets/openrouter-HpeJ3LPX.js","assets/SharedChatView-5e3UDn1a.js","assets/PapersListView-U1p3L-FQ.js","assets/useDebounce-CX9U7t5A.js","assets/PaperDetailView-D3_ZsBvI.js","assets/evaluations-ByQ-gfqI.js","assets/evaluations-DXfuqNnO.css","assets/latexPlainText-DI8YEXVe.js","assets/button-BCHGalXc.js","assets/index-C3rnUhi0.js","assets/textarea-D8WJ-V7X.js","assets/dialog-DOTf3B8r.js","assets/useMutation-BMLNTksL.js","assets/SignInToEditDialog-aDxqeILo.js","assets/loader-circle-BkFdIra2.js","assets/searchable-select-C2wKP4v0.js","assets/codexAddEvals-BYyAthFq.js","assets/savedPapersAuth-hSKa9YsO.js","assets/TagsIndexView-XFOoHwb9.js","assets/TaxonomySuggestionTile-C5fAeYBQ.js","assets/TagBrowseView-CEaJ7wkX.js","assets/BenchmarkTrendSparkline-D6Sf06U6.js","assets/MarkdownText-79sq6Tks.js","assets/MethodsIndexView-CKTQ6cDe.js","assets/slug-BpH-Nkvz.js","assets/FrameworksIndexView-Ch67e2Te.js","assets/TrendsView-C5JngdLN.js","assets/ConferencesIndexView-1eSAeZYb.js","assets/AiDeadlinesView-DN11lHYR.js","assets/switch-C5eRfEo5.js","assets/ConferenceDetailView-DYomCgtB.js","assets/ConferenceTaskView-mNatIt13.js","assets/OrganizationsIndexView-BnLo3hfA.js","assets/OrganizationsIndexView-dniuSNch.css","assets/OrganizationDetailView-CwAChot3.js","assets/OrganizationPaperFeed-MkPLSiOD.js","assets/OrganizationContributionGraph-goBBZ8vD.js","assets/NotFound-C0O3bfE-.js","assets/OrganizationTaskView-Dp5482-s.js","assets/AuthorDetailView-DDFAChyR.js","assets/MethodDetailView-CfP7e-SP.js","assets/BenchmarkDetailView-DL9QgA3B.js","assets/BenchmarkDetailView-DS2Mrskn.css","assets/SavedPapersView-VCnhdKfX.js","assets/SettingsView-CDI6bQH7.js","assets/external-link-C-XvH9CF.js","assets/PrivacyView-CTPtZXFS.js","assets/SubmitView-rnoDJcn0.js","assets/CronDashboard-BWvUvwNE.js","assets/shield-alert-DCTkHXsf.js","assets/circle-check-ChtT1K-E.js","assets/CronDashboard-DwChfW9h.css","assets/SubmissionsDashboard-C_oeE-yO.js","assets/UserProfileView-CNXz88Hn.js","assets/RateLimitsView-Bztx-Hl-.js","assets/SearchOverlay-D86Q6M8C.js","assets/StagingAccessRequestView-CaYzuGTH.js"])))=>i.map(i=>d[i]); var i_=Object.defineProperty;var Ch=t=>{throw TypeError(t)};var s_=(t,e,n)=>e in t?i_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Xt=(t,e,n)=>s_(t,typeof e!="symbol"?e+"":e,n),wu=(t,e,n)=>e.has(t)||Ch("Cannot "+n);var N=(t,e,n)=>(wu(t,e,"read from private field"),n?n.call(t):e.get(t)),le=(t,e,n)=>e.has(t)?Ch("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Z=(t,e,n,r)=>(wu(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),He=(t,e,n)=>(wu(t,e,"access private method"),n);var Vs=(t,e,n,r)=>({set _(o){Z(t,e,o,n)},get _(){return N(t,e,r)}});function a_(t,e){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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 IM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ug={exports:{}},Ol={},cg={exports:{}},ae={};/** * @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 QR=cu("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),YR=UR,XR=VR,JR=f.forwardRef(({className:t,inset:e,children:n,...r},o)=>m.jsxs(ex,{ref:o,className:We("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",e&&"pl-8",t),...r,children:[n,m.jsx(GR,{className:"ml-auto h-4 w-4"})]}));JR.displayName=ex.displayName;const eN=f.forwardRef(({className:t,...e},n)=>m.jsx(tx,{ref:n,className:We("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",t),...e}));eN.displayName=tx.displayName;const rx=f.forwardRef(({className:t,sideOffset:e=4,...n},r)=>m.jsx(BR,{children:m.jsx(K0,{ref:r,sideOffset:e,className:We("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",t),...n})}));rx.displayName=K0.displayName;const tn=f.forwardRef(({className:t,inset:e,...n},r)=>m.jsx(Z0,{ref:r,className:We("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",e&&"pl-8",t),...n}));tn.displayName=Z0.displayName;const tN=f.forwardRef(({className:t,children:e,checked:n,...r},o)=>m.jsxs(Q0,{ref:o,className:We("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",t),checked:n,...r,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(X0,{children:m.jsx(KR,{className:"h-4 w-4"})})}),e]}));tN.displayName=Q0.displayName;const nN=f.forwardRef(({className:t,children:e,...n},r)=>m.jsxs(Y0,{ref:r,className:We("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",t),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(X0,{children:m.jsx(ZR,{className:"h-2 w-2 fill-current"})})}),e]}));nN.displayName=Y0.displayName;const ox=f.forwardRef(({className:t,inset:e,...n},r)=>m.jsx(G0,{ref:r,className:We("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));ox.displayName=G0.displayName;const bd=f.forwardRef(({className:t,...e},n)=>m.jsx(J0,{ref:n,className:We("-mx-1 my-1 h-px bg-muted",t),...e}));bd.displayName=J0.displayName;function rN(t){const n=(t.name||t.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 oN=({user:t,onLogout:e})=>m.jsxs(YR,{children:[m.jsx(XR,{asChild:!0,children:m.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:m.jsxs(mw,{className:"h-8 w-8",children:[t.avatar_url&&m.jsx(gw,{src:t.avatar_url,alt:t.username}),m.jsx(vw,{className:"text-xs",children:rN(t)})]})})}),m.jsxs(rx,{align:"end",className:"w-56",children:[m.jsxs(ox,{className:"flex flex-col gap-0.5 py-2",children:[m.jsx("span",{className:"text-sm font-medium leading-tight",children:t.name||t.username}),m.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",t.username]}),t.is_admin&&m.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"}),t.role==="contributor"&&m.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"})]}),m.jsx(bd,{}),m.jsx(tn,{asChild:!0,children:m.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),cl()&&m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/chat",children:"Chat"})}),m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/frameworks",children:"Frameworks"})}),m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/trends",children:"Trends"})}),t.is_admin&&m.jsxs(m.Fragment,{children:[m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/admin-dashboard",children:"Admin dashboard"})}),m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/submissions",children:"Review submissions"})})]}),m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/settings",children:"Settings"})}),m.jsx(bd,{}),m.jsx(tn,{onSelect:n=>{n.preventDefault(),e()},children:"Log out"})]})]}),ix=T.createContext(null),Tm="pwc:auth-stale";async function iN(){if(Os())return null;const t=await fetch($r("/api/v1/auth/me"),{credentials:"include",cache:"no-store"});return t.status===401||!t.ok?null:await t.json()}const sN=({children:t})=>{const[e,n]=T.useState(null),[r,o]=T.useState(!0),i=T.useCallback(async()=>{o(!0);const l=await iN();n(l),o(!1)},[]),s=T.useCallback(async()=>{const l=Jl("/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($r("/api/v1/auth/logout"),{method:"POST",credentials:"include"}),n(null)},[]);T.useEffect(()=>{i()},[i]),T.useEffect(()=>{const l=()=>n(null);return window.addEventListener(Tm,l),()=>window.removeEventListener(Tm,l)},[]);const a=T.useMemo(()=>({user:e,isLoading:r,refresh:i,logout:s}),[e,r,i,s]);return m.jsx(ix.Provider,{value:a,children:t})};function dh(){const t=T.useContext(ix);if(!t)throw new Error("useAuth must be used inside an ");return t}const Ni=({name:t,size:e=14})=>{const n={search:m.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:m.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:m.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:m.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return m.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:n[t]})},Rm="https://github.com/huggingface/paperswithcode-feedback/issues",aN="https://github.com/huggingface/pwc-cli",Nm=[{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}],lN=()=>{if(typeof navigator>"u")return!1;const t=navigator.userAgentData,e=(t==null?void 0:t.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(e)},uN=()=>{const[t,e]=T.useState(!1);return T.useEffect(()=>{e(lN())},[]),m.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},cN=({onOpenSearch:t})=>{const[e,n]=T.useState(!1),r=()=>n(!1),{user:o,logout:i}=dh(),s=Qt(),a=cl()&&(s.pathname==="/chat"||s.pathname.startsWith("/chat/")),l=`${s.pathname}${s.search}`||"/",u=Os();return m.jsxs(m.Fragment,{children:[m.jsxs("header",{className:`app-header${a?" app-header-chat":""}`,children:[m.jsxs("div",{className:"app-header-inner",children:[m.jsxs(Nr,{to:"/",className:"brand",onClick:r,children:[m.jsx("span",{className:"brand-mark"}),m.jsxs("span",{className:"brand-name",children:["Papers ",m.jsx("em",{children:"With Code"})]})]}),m.jsx("nav",{className:"nav",children:Nm.map(({to:c,label:d,end:p})=>m.jsx(Nr,{to:c,end:p,className:({isActive:h})=>`nav-item ${h?"active":""}`,children:d},c))}),m.jsx("div",{className:"header-spacer"}),m.jsx("a",{className:"feedback-link header-feedback-link",href:Rm,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),m.jsxs("button",{className:"search-trigger",onClick:t,children:[m.jsx(Ni,{name:"search",size:13}),m.jsx("span",{children:"Search papers, authors, domains…"}),m.jsx(uN,{})]}),m.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:m.jsx(Ni,{name:"search",size:14})}),!u&&m.jsx(Nr,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:m.jsx(Ni,{name:"bookmark",size:13})}),u?null:o?m.jsx(oN,{user:o,onLogout:i}):m.jsx(Gy,{returnTo:l}),m.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(c=>!c),children:m.jsx(Ni,{name:e?"close":"menu",size:14})})]}),m.jsxs("div",{className:"site-announcement",role:"status",children:[m.jsx("span",{children:"New: Papers with Code CLI and Skill now "}),m.jsx("a",{href:aN,target:"_blank",rel:"noreferrer",children:"available"}),m.jsx("span",{children:" as well as "}),m.jsx(Nr,{to:"/chat",children:"chat"})]})]}),e&&m.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:m.jsxs("div",{className:"mobile-nav-panel",onClick:c=>c.stopPropagation(),children:[m.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),t()},children:[m.jsx(Ni,{name:"search",size:14}),m.jsx("span",{children:"Search papers, authors, domains…"})]}),Nm.map(({to:c,label:d,end:p})=>m.jsx(Nr,{to:c,end:p,className:"mobile-nav-link",onClick:r,children:d},c)),m.jsx("a",{className:"mobile-nav-link",href:Rm,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!u&&m.jsx(Nr,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),!u&&(o==null?void 0:o.is_admin)&&m.jsx(Nr,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:r,children:"Admin dashboard"})]})})]})},dN=()=>{const{pathname:t}=Qt();return t==="/chat"||t.startsWith("/chat/")?null:m.jsx("footer",{className:"site-footer",children:m.jsxs("div",{className:"site-footer-inner",children:[m.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),m.jsx(_n,{to:"/privacy",children:"Privacy"}),m.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},fN=1,hN=1e6;let ac=0;function pN(){return ac=(ac+1)%Number.MAX_SAFE_INTEGER,ac.toString()}const lc=new Map,Om=t=>{if(lc.has(t))return;const e=setTimeout(()=>{lc.delete(t),Gi({type:"REMOVE_TOAST",toastId:t})},hN);lc.set(t,e)},mN=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,fN)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?Om(n):t.toasts.forEach(r=>{Om(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Aa=[];let Ma={toasts:[]};function Gi(t){Ma=mN(Ma,t),Aa.forEach(e=>{e(Ma)})}function gN({...t}){const e=pN(),n=o=>Gi({type:"UPDATE_TOAST",toast:{...o,id:e}}),r=()=>Gi({type:"DISMISS_TOAST",toastId:e});return Gi({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}function vN(){const[t,e]=f.useState(Ma);return f.useEffect(()=>(Aa.push(e),()=>{const n=Aa.indexOf(e);n>-1&&Aa.splice(n,1)}),[t]),{...t,toast:gN,dismiss:n=>Gi({type:"DISMISS_TOAST",toastId:n})}}var yN=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"}),wN="VisuallyHidden",du=f.forwardRef((t,e)=>m.jsx(Te.span,{...t,ref:e,style:{...yN,...t.style}}));du.displayName=wN;var xN=du,fh="ToastProvider",[hh,_N,SN]=Gf("Toast"),[sx]=so("Toast",[SN]),[bN,fu]=sx(fh),ax=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=t,[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 \`${fh}\`. Expected non-empty \`string\`.`),m.jsx(hh.Provider,{scope:e,children:m.jsx(bN,{scope:e,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})})};ax.displayName=fh;var lx="ToastViewport",EN=["F8"],Ed="toast.viewportPause",Cd="toast.viewportResume",ux=f.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=EN,label:o="Notifications ({hotkey})",...i}=t,s=fu(lx,n),a=_N(n),l=f.useRef(null),u=f.useRef(null),c=f.useRef(null),d=f.useRef(null),p=Be(e,d,s.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),S=s.toastCount>0;f.useEffect(()=>{const x=v=>{var w;r.length!==0&&r.every(_=>v[_]||v.code===_)&&((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(S&&x&&v){const g=()=>{if(!s.isClosePausedRef.current){const E=new CustomEvent(Ed);v.dispatchEvent(E),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const E=new CustomEvent(Cd);v.dispatchEvent(E),s.isClosePausedRef.current=!1}},_=E=>{!x.contains(E.relatedTarget)&&w()},b=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",g),x.addEventListener("focusout",_),x.addEventListener("pointermove",g),x.addEventListener("pointerleave",b),window.addEventListener("blur",g),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",g),x.removeEventListener("focusout",_),x.removeEventListener("pointermove",g),x.removeEventListener("pointerleave",b),window.removeEventListener("blur",g),window.removeEventListener("focus",w)}}},[S,s.isClosePausedRef]);const y=f.useCallback(({tabbingDirection:x})=>{const g=a().map(w=>{const _=w.ref.current,b=[_,...$N(_)];return x==="forwards"?b:b.reverse()});return(x==="forwards"?g.reverse():g).flat()},[a]);return f.useEffect(()=>{const x=d.current;if(x){const v=g=>{var b,E,k;const w=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!w){const R=document.activeElement,I=g.shiftKey;if(g.target===x&&I){(b=u.current)==null||b.focus();return}const D=y({tabbingDirection:I?"backwards":"forwards"}),J=D.findIndex($=>$===R);uc(D.slice(J+1))?g.preventDefault():I?(E=u.current)==null||E.focus():(k=c.current)==null||k.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,y]),m.jsxs(nk,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:S?void 0:"none"},children:[S&&m.jsx(kd,{ref:u,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});uc(x)}}),m.jsx(hh.Slot,{scope:n,children:m.jsx(Te.ol,{tabIndex:-1,...i,ref:p})}),S&&m.jsx(kd,{ref:c,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});uc(x)}})]})});ux.displayName=lx;var cx="ToastFocusProxy",kd=f.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=t,i=fu(cx,n);return m.jsx(du,{tabIndex:0,...o,ref:e,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});kd.displayName=cx;var Ls="Toast",CN="toast.swipeStart",kN="toast.swipeMove",PN="toast.swipeCancel",TN="toast.swipeEnd",dx=f.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=t,[a,l]=qf({prop:r,defaultProp:o??!0,onChange:i,caller:Ls});return m.jsx(ao,{present:n||a,children:m.jsx(ON,{open:a,...s,ref:e,onClose:()=>l(!1),onPause:ht(t.onPause),onResume:ht(t.onResume),onSwipeStart:G(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:G(t.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:G(t.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:G(t.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)})})})});dx.displayName=Ls;var[RN,NN]=sx(Ls,{onClose(){}}),ON=f.forwardRef((t,e)=>{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,...S}=t,y=fu(Ls,n),[x,v]=f.useState(null),g=Be(e,$=>v($)),w=f.useRef(null),_=f.useRef(null),b=o||y.duration,E=f.useRef(0),k=f.useRef(b),R=f.useRef(0),{onToastAdd:I,onToastRemove:j}=y,W=ht(()=>{var oe;(x==null?void 0:x.contains(document.activeElement))&&((oe=y.viewport)==null||oe.focus()),s()}),D=f.useCallback($=>{!$||$===1/0||(window.clearTimeout(R.current),E.current=new Date().getTime(),R.current=window.setTimeout(W,$))},[W]);f.useEffect(()=>{const $=y.viewport;if($){const oe=()=>{D(k.current),u==null||u()},q=()=>{const X=new Date().getTime()-E.current;k.current=k.current-X,window.clearTimeout(R.current),l==null||l()};return $.addEventListener(Ed,q),$.addEventListener(Cd,oe),()=>{$.removeEventListener(Ed,q),$.removeEventListener(Cd,oe)}}},[y.viewport,b,l,u,D]),f.useEffect(()=>{i&&!y.isClosePausedRef.current&&D(b)},[i,b,y.isClosePausedRef,D]),f.useEffect(()=>(I(),()=>j()),[I,j]);const J=f.useMemo(()=>x?yx(x):null,[x]);return y.viewport?m.jsxs(m.Fragment,{children:[J&&m.jsx(AN,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:J}),m.jsx(RN,{scope:n,onClose:W,children:Ns.createPortal(m.jsx(hh.ItemSlot,{scope:n,children:m.jsx(tk,{asChild:!0,onEscapeKeyDown:G(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||W(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:m.jsx(Te.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...S,ref:g,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:G(t.onKeyDown,$=>{$.key==="Escape"&&(a==null||a($.nativeEvent),$.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,W()))}),onPointerDown:G(t.onPointerDown,$=>{$.button===0&&(w.current={x:$.clientX,y:$.clientY})}),onPointerMove:G(t.onPointerMove,$=>{if(!w.current)return;const oe=$.clientX-w.current.x,q=$.clientY-w.current.y,X=!!_.current,O=["left","right"].includes(y.swipeDirection),P=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,L=O?P(0,oe):0,K=O?0:P(0,q),V=$.pointerType==="touch"?10:2,te={x:L,y:K},ie={originalEvent:$,delta:te};X?(_.current=te,ha(kN,d,ie,{discrete:!1})):Am(te,y.swipeDirection,V)?(_.current=te,ha(CN,c,ie,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(oe)>V||Math.abs(q)>V)&&(w.current=null)}),onPointerUp:G(t.onPointerUp,$=>{const oe=_.current,q=$.target;if(q.hasPointerCapture($.pointerId)&&q.releasePointerCapture($.pointerId),_.current=null,w.current=null,oe){const X=$.currentTarget,O={originalEvent:$,delta:oe};Am(oe,y.swipeDirection,y.swipeThreshold)?ha(TN,h,O,{discrete:!0}):ha(PN,p,O,{discrete:!0}),X.addEventListener("click",P=>P.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),AN=t=>{const{__scopeToast:e,children:n,...r}=t,o=fu(Ls,e),[i,s]=f.useState(!1),[a,l]=f.useState(!1);return IN(()=>s(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:m.jsx(rh,{asChild:!0,children:m.jsx(du,{...r,children:i&&m.jsxs(m.Fragment,{children:[o.label," ",n]})})})},MN="ToastTitle",fx=f.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return m.jsx(Te.div,{...r,ref:e})});fx.displayName=MN;var jN="ToastDescription",hx=f.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return m.jsx(Te.div,{...r,ref:e})});hx.displayName=jN;var px="ToastAction",mx=f.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?m.jsx(vx,{altText:n,asChild:!0,children:m.jsx(ph,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${px}\`. Expected non-empty \`string\`.`),null)});mx.displayName=px;var gx="ToastClose",ph=f.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,o=NN(gx,n);return m.jsx(vx,{asChild:!0,children:m.jsx(Te.button,{type:"button",...r,ref:e,onClick:G(t.onClick,o.onClose)})})});ph.displayName=gx;var vx=f.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...o}=t;return m.jsx(Te.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:e})});function yx(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),LN(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&&e.push(s)}else e.push(...yx(r))}}),e}function ha(t,e,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?Kf(o,i):o.dispatchEvent(i)}var Am=(t,e,n=0)=>{const r=Math.abs(t.x),o=Math.abs(t.y),i=r>o;return e==="left"||e==="right"?i&&r>n:!i&&o>n};function IN(t=()=>{}){const e=ht(t);Mt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function LN(t){return t.nodeType===t.ELEMENT_NODE}function $N(t){const e=[],n=document.createTreeWalker(t,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();)e.push(n.currentNode);return e}function uc(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var DN=ax,wx=ux,xx=dx,_x=fx,Sx=hx,bx=mx,Ex=ph;const Mm=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,jm=uw,zN=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return jm(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,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=Mm(c)||Mm(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=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:p,...h}=c;return Object.entries(h).every(S=>{let[y,x]=S;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...u,d,p]:u},[]);return jm(t,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},FN=DN,Cx=f.forwardRef(({className:t,...e},n)=>m.jsx(wx,{ref:n,className:We("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]",t),...e}));Cx.displayName=wx.displayName;const UN=zN("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"}}),kx=f.forwardRef(({className:t,variant:e,...n},r)=>m.jsx(xx,{ref:r,className:We(UN({variant:e}),t),...n}));kx.displayName=xx.displayName;const VN=f.forwardRef(({className:t,...e},n)=>m.jsx(bx,{ref:n,className:We("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",t),...e}));VN.displayName=bx.displayName;const Px=f.forwardRef(({className:t,...e},n)=>m.jsx(Ex,{ref:n,className:We("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",t),"toast-close":"",...e,children:m.jsx(QR,{className:"h-4 w-4"})}));Px.displayName=Ex.displayName;const Tx=f.forwardRef(({className:t,...e},n)=>m.jsx(_x,{ref:n,className:We("text-sm font-semibold",t),...e}));Tx.displayName=_x.displayName;const Rx=f.forwardRef(({className:t,...e},n)=>m.jsx(Sx,{ref:n,className:We("text-sm opacity-90",t),...e}));Rx.displayName=Sx.displayName;function BN(){const{toasts:t}=vN();return m.jsxs(FN,{children:[t.map(function({id:e,title:n,description:r,action:o,...i}){return m.jsxs(kx,{...i,children:[m.jsxs("div",{className:"grid gap-1",children:[n&&m.jsx(Tx,{children:n}),r&&m.jsx(Rx,{children:r})]}),o,m.jsx(Px,{})]},e)}),m.jsx(Cx,{})]})}var WN=t=>{switch(t){case"success":return KN;case"info":return ZN;case"warning":return GN;case"error":return QN;default:return null}},HN=Array(12).fill(0),qN=({visible:t,className:e})=>T.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},T.createElement("div",{className:"sonner-spinner"},HN.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),KN=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"})),GN=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"})),ZN=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"})),QN=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"})),YN=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"})),XN=()=>{let[t,e]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},Pd=1,JN=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,o=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:Pd++,i=this.toasts.find(a=>a.id===o),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...t,id:o,title:n}),{...a,...t,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),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(tO(l)&&!l.ok){o=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,c=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:u,description:c})}else if(e.success!==void 0){o=!1;let u=typeof e.success=="function"?await e.success(l):e.success,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){o=!1;let u=typeof e.error=="function"?await e.error(l):e.error,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),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=(t,e)=>{let n=(e==null?void 0:e.id)||Pd++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},at=new JN,eO=(t,e)=>{let n=(e==null?void 0:e.id)||Pd++;return at.addToast({title:t,...e,id:n}),n},tO=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",nO=eO,rO=()=>at.toasts,oO=()=>at.getActiveToasts();Object.assign(nO,{success:at.success,info:at.info,warning:at.warning,error:at.error,custom:at.custom,message:at.message,promise:at.promise,dismiss:at.dismiss,loading:at.loading},{getHistory:rO,getToasts:oO});function iO(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}iO(`: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 pa(t){return t.label!==void 0}var sO=3,aO="32px",lO="16px",Im=4e3,uO=356,cO=14,dO=20,fO=200;function zt(...t){return t.filter(Boolean).join(" ")}function hO(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var pO=t=>{var e,n,r,o,i,s,a,l,u,c,d;let{invert:p,toast:h,unstyled:S,interacting:y,setHeights:x,visibleToasts:v,heights:g,index:w,toasts:_,expanded:b,removeToast:E,defaultRichColors:k,closeButton:R,style:I,cancelButtonStyle:j,actionButtonStyle:W,className:D="",descriptionClassName:J="",duration:$,position:oe,gap:q,loadingIcon:X,expandByDefault:O,classNames:P,icons:L,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:V}=t,[te,ie]=T.useState(null),[be,Re]=T.useState(null),[se,gn]=T.useState(!1),[De,Yt]=T.useState(!1),[Un,co]=T.useState(!1),[Vn,zs]=T.useState(!1),[mu,Fs]=T.useState(!1),[gu,yi]=T.useState(0),[fo,wh]=T.useState(0),wi=T.useRef(h.duration||$||Im),xh=T.useRef(null),Tr=T.useRef(null),Qx=w===0,Yx=w+1<=v,Et=h.type,ho=h.dismissible!==!1,Xx=h.className||"",Jx=h.descriptionClassName||"",Us=T.useMemo(()=>g.findIndex(ee=>ee.toastId===h.id)||0,[g,h.id]),e_=T.useMemo(()=>{var ee;return(ee=h.closeButton)!=null?ee:R},[h.closeButton,R]),_h=T.useMemo(()=>h.duration||$||Im,[h.duration,$]),vu=T.useRef(0),po=T.useRef(0),Sh=T.useRef(0),mo=T.useRef(null),[t_,n_]=oe.split("-"),bh=T.useMemo(()=>g.reduce((ee,me,_e)=>_e>=Us?ee:ee+me.height,0),[g,Us]),Eh=XN(),r_=h.invert||p,yu=Et==="loading";po.current=T.useMemo(()=>Us*q+bh,[Us,bh]),T.useEffect(()=>{wi.current=_h},[_h]),T.useEffect(()=>{gn(!0)},[]),T.useEffect(()=>{let ee=Tr.current;if(ee){let me=ee.getBoundingClientRect().height;return wh(me),x(_e=>[{toastId:h.id,height:me,position:h.position},..._e]),()=>x(_e=>_e.filter(It=>It.toastId!==h.id))}},[x,h.id]),T.useLayoutEffect(()=>{if(!se)return;let ee=Tr.current,me=ee.style.height;ee.style.height="auto";let _e=ee.getBoundingClientRect().height;ee.style.height=me,wh(_e),x(It=>It.find(Lt=>Lt.toastId===h.id)?It.map(Lt=>Lt.toastId===h.id?{...Lt,height:_e}:Lt):[{toastId:h.id,height:_e,position:h.position},...It])},[se,h.title,h.description,x,h.id]);let Bn=T.useCallback(()=>{Yt(!0),yi(po.current),x(ee=>ee.filter(me=>me.toastId!==h.id)),setTimeout(()=>{E(h)},fO)},[h,E,x,po]);T.useEffect(()=>{if(h.promise&&Et==="loading"||h.duration===1/0||h.type==="loading")return;let ee;return b||y||V&&Eh?(()=>{if(Sh.current{var me;(me=h.onAutoClose)==null||me.call(h,h),Bn()},wi.current)),()=>clearTimeout(ee)},[b,y,h,Et,V,Eh,Bn]),T.useEffect(()=>{h.delete&&Bn()},[Bn,h.delete]);function o_(){var ee,me,_e;return L!=null&&L.loading?T.createElement("div",{className:zt(P==null?void 0:P.loader,(ee=h==null?void 0:h.classNames)==null?void 0:ee.loader,"sonner-loader"),"data-visible":Et==="loading"},L.loading):X?T.createElement("div",{className:zt(P==null?void 0:P.loader,(me=h==null?void 0:h.classNames)==null?void 0:me.loader,"sonner-loader"),"data-visible":Et==="loading"},X):T.createElement(qN,{className:zt(P==null?void 0:P.loader,(_e=h==null?void 0:h.classNames)==null?void 0:_e.loader),visible:Et==="loading"})}return T.createElement("li",{tabIndex:0,ref:Tr,className:zt(D,Xx,P==null?void 0:P.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,P==null?void 0:P.default,P==null?void 0:P[Et],(n=h==null?void 0:h.classNames)==null?void 0:n[Et]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:k,"data-styled":!(h.jsx||h.unstyled||S),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":mu,"data-removed":De,"data-visible":Yx,"data-y-position":t_,"data-x-position":n_,"data-index":w,"data-front":Qx,"data-swiping":Un,"data-dismissible":ho,"data-type":Et,"data-invert":r_,"data-swipe-out":Vn,"data-swipe-direction":be,"data-expanded":!!(b||O&&se),style:{"--index":w,"--toasts-before":w,"--z-index":_.length-w,"--offset":`${De?gu:po.current}px`,"--initial-height":O?"auto":`${fo}px`,...I,...h.style},onDragEnd:()=>{co(!1),ie(null),mo.current=null},onPointerDown:ee=>{yu||!ho||(xh.current=new Date,yi(po.current),ee.target.setPointerCapture(ee.pointerId),ee.target.tagName!=="BUTTON"&&(co(!0),mo.current={x:ee.clientX,y:ee.clientY}))},onPointerUp:()=>{var ee,me,_e,It;if(Vn||!ho)return;mo.current=null;let Lt=Number(((ee=Tr.current)==null?void 0:ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Wn=Number(((me=Tr.current)==null?void 0:me.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Rr=new Date().getTime()-((_e=xh.current)==null?void 0:_e.getTime()),$t=te==="x"?Lt:Wn,Hn=Math.abs($t)/Rr;if(Math.abs($t)>=dO||Hn>.11){yi(po.current),(It=h.onDismiss)==null||It.call(h,h),Re(te==="x"?Lt>0?"right":"left":Wn>0?"down":"up"),Bn(),zs(!0),Fs(!1);return}co(!1),ie(null)},onPointerMove:ee=>{var me,_e,It,Lt;if(!mo.current||!ho||((me=window.getSelection())==null?void 0:me.toString().length)>0)return;let Wn=ee.clientY-mo.current.y,Rr=ee.clientX-mo.current.x,$t=(_e=t.swipeDirections)!=null?_e:hO(oe);!te&&(Math.abs(Rr)>1||Math.abs(Wn)>1)&&ie(Math.abs(Rr)>Math.abs(Wn)?"x":"y");let Hn={x:0,y:0};te==="y"?($t.includes("top")||$t.includes("bottom"))&&($t.includes("top")&&Wn<0||$t.includes("bottom")&&Wn>0)&&(Hn.y=Wn):te==="x"&&($t.includes("left")||$t.includes("right"))&&($t.includes("left")&&Rr<0||$t.includes("right")&&Rr>0)&&(Hn.x=Rr),(Math.abs(Hn.x)>0||Math.abs(Hn.y)>0)&&Fs(!0),(It=Tr.current)==null||It.style.setProperty("--swipe-amount-x",`${Hn.x}px`),(Lt=Tr.current)==null||Lt.style.setProperty("--swipe-amount-y",`${Hn.y}px`)}},e_&&!h.jsx?T.createElement("button",{"aria-label":K,"data-disabled":yu,"data-close-button":!0,onClick:yu||!ho?()=>{}:()=>{var ee;Bn(),(ee=h.onDismiss)==null||ee.call(h,h)},className:zt(P==null?void 0:P.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(i=L==null?void 0:L.close)!=null?i:YN):null,h.jsx||f.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:T.createElement(T.Fragment,null,Et||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:zt(P==null?void 0:P.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||o_():null,h.type!=="loading"?h.icon||(L==null?void 0:L[Et])||WN(Et):null):null,T.createElement("div",{"data-content":"",className:zt(P==null?void 0:P.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:zt(P==null?void 0:P.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:zt(J,Jx,P==null?void 0:P.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&&pa(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||j,onClick:ee=>{var me,_e;pa(h.cancel)&&ho&&((_e=(me=h.cancel).onClick)==null||_e.call(me,ee),Bn())},className:zt(P==null?void 0:P.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&&pa(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||W,onClick:ee=>{var me,_e;pa(h.action)&&((_e=(me=h.action).onClick)==null||_e.call(me,ee),!ee.defaultPrevented&&Bn())},className:zt(P==null?void 0:P.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function Lm(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function mO(t,e){let n={};return[t,e].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?lO:aO;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 gO=f.forwardRef(function(t,e){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:S=sO,toastOptions:y,dir:x=Lm(),gap:v=cO,loadingIcon:g,icons:w,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:b}=t,[E,k]=T.useState([]),R=T.useMemo(()=>Array.from(new Set([r].concat(E.filter(V=>V.position).map(V=>V.position)))),[E,r]),[I,j]=T.useState([]),[W,D]=T.useState(!1),[J,$]=T.useState(!1),[oe,q]=T.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=T.useRef(null),O=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=T.useRef(null),L=T.useRef(!1),K=T.useCallback(V=>{k(te=>{var ie;return(ie=te.find(be=>be.id===V.id))!=null&&ie.delete||at.dismiss(V.id),te.filter(({id:be})=>be!==V.id)})},[]);return T.useEffect(()=>at.subscribe(V=>{if(V.dismiss){k(te=>te.map(ie=>ie.id===V.id?{...ie,delete:!0}:ie));return}setTimeout(()=>{_y.flushSync(()=>{k(te=>{let ie=te.findIndex(be=>be.id===V.id);return ie!==-1?[...te.slice(0,ie),{...te[ie],...V},...te.slice(ie+1)]:[V,...te]})})})}),[]),T.useEffect(()=>{if(c!=="system"){q(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:te})=>{q(te?"dark":"light")})}catch{V.addListener(({matches:ie})=>{try{q(ie?"dark":"light")}catch(be){console.error(be)}})}},[c]),T.useEffect(()=>{E.length<=1&&D(!1)},[E]),T.useEffect(()=>{let V=te=>{var ie,be;o.every(Re=>te[Re]||te.code===Re)&&(D(!0),(ie=X.current)==null||ie.focus()),te.code==="Escape"&&(document.activeElement===X.current||(be=X.current)!=null&&be.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[o]),T.useEffect(()=>{if(X.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,L.current=!1)}},[X.current]),T.createElement("section",{ref:e,"aria-label":`${_} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((V,te)=>{var ie;let[be,Re]=V.split("-");return E.length?T.createElement("ol",{key:V,dir:x==="auto"?Lm():x,tabIndex:-1,ref:X,className:a,"data-sonner-toaster":!0,"data-theme":oe,"data-y-position":be,"data-lifted":W&&E.length>1&&!i,"data-x-position":Re,style:{"--front-toast-height":`${((ie=I[0])==null?void 0:ie.height)||0}px`,"--width":`${uO}px`,"--gap":`${v}px`,...h,...mO(l,u)},onBlur:se=>{L.current&&!se.currentTarget.contains(se.relatedTarget)&&(L.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||L.current||(L.current=!0,P.current=se.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{J||D(!1)},onDragEnd:()=>D(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},E.filter(se=>!se.position&&te===0||se.position===V).map((se,gn)=>{var De,Yt;return T.createElement(pO,{key:se.id,icons:w,index:gn,toast:se,defaultRichColors:d,duration:(De=y==null?void 0:y.duration)!=null?De:p,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:S,closeButton:(Yt=y==null?void 0:y.closeButton)!=null?Yt:s,interacting:J,position:V,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:K,toasts:E.filter(Un=>Un.position==se.position),heights:I.filter(Un=>Un.position==se.position),setHeights:j,expandByDefault:i,gap:v,loadingIcon:g,expanded:W,pauseWhenPageIsHidden:b,swipeDirections:t.swipeDirections})})):null}))});const vO=({...t})=>{const{theme:e="system"}=Ib();return m.jsx(gO,{theme:e,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"}},...t})};var yO=Symbol("radix.slottable");function wO(t){const e=({children:n})=>m.jsx(m.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=yO,e}var[hu]=so("Tooltip",[iu]),mh=iu(),Nx="TooltipProvider",xO=700,$m="tooltip.open",[_O,Ox]=hu(Nx),Ax=t=>{const{__scopeTooltip:e,delayDuration:n=xO,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=t,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),m.jsx(_O,{scope:e,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})};Ax.displayName=Nx;var Mx="Tooltip",[QM,pu]=hu(Mx),Td="TooltipTrigger",SO=f.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=pu(Td,n),i=Ox(Td,n),s=mh(n),a=f.useRef(null),l=Be(e,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]),m.jsx(Hw,{asChild:!0,...s,children:m.jsx(Te.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:G(t.onPointerMove,p=>{p.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),c.current=!0)}),onPointerLeave:G(t.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:G(t.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:G(t.onFocus,()=>{u.current||o.onOpen()}),onBlur:G(t.onBlur,o.onClose),onClick:G(t.onClick,o.onClose)})})});SO.displayName=Td;var bO="TooltipPortal",[YM,EO]=hu(bO,{forceMount:void 0}),li="TooltipContent",jx=f.forwardRef((t,e)=>{const n=EO(li,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=t,s=pu(li,t.__scopeTooltip);return m.jsx(ao,{present:r||s.open,children:s.disableHoverableContent?m.jsx(Ix,{side:o,...i,ref:e}):m.jsx(CO,{side:o,...i,ref:e})})}),CO=f.forwardRef((t,e)=>{const n=pu(li,t.__scopeTooltip),r=Ox(li,t.__scopeTooltip),o=f.useRef(null),i=Be(e,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((S,y)=>{const x=S.currentTarget,v={x:S.clientX,y:S.clientY},g=NO(v,x.getBoundingClientRect()),w=OO(v,g),_=AO(y.getBoundingClientRect()),b=jO([...w,..._]);a(b),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(l&&c){const S=x=>h(x,c),y=x=>h(x,l);return l.addEventListener("pointerleave",S),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",S),c.removeEventListener("pointerleave",y)}}},[l,c,h,p]),f.useEffect(()=>{if(s){const S=y=>{const x=y.target,v={x:y.clientX,y:y.clientY},g=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),w=!MO(v,s);g?p():w&&(p(),u())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[l,c,s,u,p]),m.jsx(Ix,{...t,ref:i})}),[kO,PO]=hu(Mx,{isInside:!1}),TO=wO("TooltipContent"),Ix=f.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=t,l=pu(li,n),u=mh(n),{onClose:c}=l;return f.useEffect(()=>(document.addEventListener($m,c),()=>document.removeEventListener($m,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]),m.jsx(eu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:m.jsxs(qw,{"data-state":l.stateAttribute,...u,...a,ref:e,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:[m.jsx(TO,{children:r}),m.jsx(kO,{scope:n,isInside:!0,children:m.jsx(xN,{id:l.contentId,role:"tooltip",children:o||r})})]})})});jx.displayName=li;var Lx="TooltipArrow",RO=f.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=mh(n);return PO(Lx,n).isInside?null:m.jsx(Kw,{...o,...r,ref:e})});RO.displayName=Lx;function NO(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),i=Math.abs(e.left-t.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 OO(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function AO(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function MO(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;ir!=p>r&&n<(d-u)*(r-c)/(p-c)+u&&(o=!o)}return o}function jO(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),IO(e)}function IO(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],s=e[e.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[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(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var LO=Ax,$x=jx;const $O=LO,DO=f.forwardRef(({className:t,sideOffset:e=4,...n},r)=>m.jsx($x,{ref:r,sideOffset:e,className:We("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",t),...n}));DO.displayName=$x.displayName;function zO(){const{pathname:t,hash:e}=Qt();f.useEffect(()=>{e||window.scrollTo(0,0)},[t,e])}const FO="cronAdminToken";function UO(){var t;return typeof window>"u"?"":((t=window.localStorage.getItem(FO))==null?void 0:t.trim())??""}const Dm=!1;class yl extends Error{constructor(n,r){var o;super(`API request failed: ${n.status} ${n.statusText}`);Xt(this,"status");Xt(this,"statusText");Xt(this,"response");Xt(this,"detail");Xt(this,"code");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(o=JSON.parse(r))==null?void 0:o.detail,typeof this.detail=="string"&&(this.message=this.detail),typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const i="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${i}`}}catch{this.detail=void 0}}}class VO{constructor(e){this.baseUrl=e}async request(e,n){const r=`${this.baseUrl}${e}`;try{const{headers:o,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=UO(),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 yl(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 BO(t){try{return await t()}catch(e){throw e instanceof yl&&e.status===401&&e.code!=="fresh_auth_required"&&e.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale")),e}}const WO=new VO(`${Vf()}/api/v1`),$s=(t,e)=>BO(()=>WO.request(t,e));class HO{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}}const zm=new HO($s),ma="pwc:fresh-auth-mutation";function qO(t){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",t);const e=Jl("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class Dx{constructor(e,n=qO){Xt(this,"paperLoads",new Map);Xt(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=n}primePaper(e,n=!1){n&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(o=>{throw this.paperLoads.delete(e),o}),this.paperLoads.set(e,r)),r}primeEvaluations(e,n=!1){n&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(o=>{throw this.evaluationLoads.delete(e),o}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,n,r,o,i){const s=this.paperLoads.get(e);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:${e}:${n}`)}async mutateEvaluations(e,n,r,o){const i=this.evaluationLoads.get(String(e));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:${e}:evaluations`)}async mutate(e,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 yl&&u.status===401&&u.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,n,r,l),this.recoverFreshAuth(e)):u instanceof yl&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:n}}))),u}}freshAuthMutationDraft(){const e=sessionStorage.getItem(ma);if(!e)return null;try{const n=JSON.parse(e);if(!n.endpoint.startsWith("/")||n.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(n.options.method))throw new Error("Invalid saved mutation draft");return n}catch{return sessionStorage.removeItem(ma),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const n=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(ma),sessionStorage.removeItem("pwc:fresh-auth-edit"),n}saveFreshAuthMutation(e,n,r,o){const i=Object.fromEntries(new Headers(o.headers).entries()),s=typeof o.body=="string"?o.body:void 0;sessionStorage.setItem(ma,JSON.stringify({section:e,endpoint:n,payload:r,options:{method:(o.method??"POST").toUpperCase(),body:s,headers:i}}))}idempotencyHeaders(e,n,r){const o=`pwc:mutation:${e}:${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(e){const n=new Headers(e.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 en=new Dx($s);function Oi(t){const e=new URLSearchParams;for(const[r,o]of Object.entries(t??{}))o!==void 0&&o!==""&&e.set(r,String(o));const n=e.toString();return n?`?${n}`:""}class KO{constructor(e){this.request=e}list(e){const n=new URLSearchParams;for(const[o,i]of Object.entries(e??{}))i!==void 0&&i!==""&&n.set(o,String(i));const r=n.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,n=1,r=10,o,i){const s=new URLSearchParams({q:e,page:n.toString(),page_size:r.toString()});return o&&s.set("mode",o),this.request(`/papers/search?${s.toString()}`,{signal:i})}get(e,n=!0){const r=n?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,n=!0){const r=n?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}related(e,n=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${n}`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,n){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(n)})}trending(e){const n=new URLSearchParams;for(const[o,i]of Object.entries(e??{}))i!==void 0&&n.set(o,String(i));const r=n.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,n){return this.request(`/tasks/${e}/papers${Oi(n)}`)}forMethod(e,n){return this.request(`/methods/${encodeURIComponent(e)}/papers${Oi(n)}`)}forConference(e,n){return this.request(`/conferences/${e}/papers${Oi(n)}`)}forOrganization(e,n){return this.request(`/organizations/${e}/papers${Oi(n)}`)}getAuthor(e){return this.request(`/authors/${e}`)}authorPapers(e,n){return this.request(`/authors/${e}/papers${Oi(n)}`)}primeCurationState(e,n=!1){return en.primePaper(e,n)}freshAuthMutationDraft(){return en.freshAuthMutationDraft()}resumeFreshAuthMutation(){return en.resumeFreshAuthMutation()}updateTasks(e,n){const r=new URLSearchParams(n.map(o=>["task_ids",String(o)])).toString();return en.mutatePaper(e,"tasks",n,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,n){const r=new URLSearchParams(n.map(o=>["method_ids",String(o)])).toString();return en.mutatePaper(e,"methods",n,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,n){const r=new URLSearchParams(n.map(o=>["organization_ids",String(o)])).toString();return en.mutatePaper(e,"organizations",n,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,n){return en.mutatePaper(e,"repositories",n,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:n})})}updateProjectPages(e,n){return en.mutatePaper(e,"project_pages",n,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:n})})}updateSourceUrl(e,n){return en.mutatePaper(e,"source_url",n,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:n})})}updateHfArtifacts(e,n){return en.mutatePaper(e,"hf_artifacts",n,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(n)})}}const cc=new KO($s);var de;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},t.getValidEnumValues=o=>{const i=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(const a of i)s[a]=o[a];return t.objectValues(s)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},t.find=(o,i)=>{for(const s of o)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(de||(de={}));var Fm;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Fm||(Fm={}));const U=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jn=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}},M=de.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ln extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;ln.message){const n={},r=[];for(const o of this.issues)if(o.path.length>0){const i=o.path[0];n[i]=n[i]||[],n[i].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ln.create=t=>new Ln(t);const Rd=(t,e)=>{let n;switch(t.code){case M.invalid_type:t.received===U.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case M.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,de.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:n=`Unrecognized key(s) in object: ${de.joinValues(t.keys,", ")}`;break;case M.invalid_union:n="Invalid input";break;case M.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${de.joinValues(t.options)}`;break;case M.invalid_enum_value:n=`Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;break;case M.invalid_arguments:n="Invalid function arguments";break;case M.invalid_return_type:n="Invalid function return type";break;case M.invalid_date:n="Invalid date";break;case M.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:de.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case M.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case M.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case M.custom:n="Invalid input";break;case M.invalid_intersection_types:n="Intersection results could not be merged";break;case M.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case M.not_finite:n="Number must be finite";break;default:n=e.defaultError,de.assertNever(t)}return{message:n}};let GO=Rd;function ZO(){return GO}const QO=t=>{const{data:e,path:n,errorMaps:r,issueData:o}=t,i=[...n,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(s,{data:e,defaultError:a}).message;return{...o,path:i,message:a}};function z(t,e){const n=ZO(),r=QO({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Rd?void 0:Rd].filter(o=>!!o)});t.common.issues.push(r)}class rt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const o of n){if(o.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const o of n){const i=await o.key,s=await o.value;r.push({key:i,value:s})}return rt.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Q;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:e.value,value:r}}}const Q=Object.freeze({status:"aborted"}),Di=t=>({status:"dirty",value:t}),jt=t=>({status:"valid",value:t}),Um=t=>t.status==="aborted",Vm=t=>t.status==="dirty",ui=t=>t.status==="valid",wl=t=>typeof Promise<"u"&&t instanceof Promise;var B;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(B||(B={}));class pn{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Bm=(t,e)=>{if(ui(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ln(t.common.issues);return this._error=n,this._error}}};function re(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:o}}class ue{get description(){return this._def.description}_getType(e){return Jn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new rt,ctx:{common:e.parent.common,data:e.data,parsedType:Jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(wl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)},o=this._parseSync({data:e,path:r.path,parent:r});return Bm(r,o)}"~validate"(e){var r,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return ui(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(o=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>ui(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)},o=this._parse({data:e,path:r.path,parent:r}),i=await(wl(o)?o:Promise.resolve(o));return Bm(r,i)}refine(e,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=e(o),a=()=>i.addIssue({code:M.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new eo({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Tn.create(this,this._def)}nullable(){return to.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this)}promise(){return Cl.create(this,this._def)}or(e){return _l.create([this,e],this._def)}and(e){return Sl.create(this,e,this._def)}transform(e){return new eo({...re(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new kl({...re(this._def),innerType:this,defaultValue:n,typeName:Y.ZodDefault})}brand(){return new Vx({typeName:Y.ZodBranded,type:this,...re(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Pl({...re(this._def),innerType:this,catchValue:n,typeName:Y.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return vh.create(this,e)}readonly(){return Tl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const YO=/^c[^\s-]{8,}$/i,XO=/^[0-9a-z]+$/,JO=/^[0-9A-HJKMNP-TV-Z]{26}$/i,eA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,tA=/^[a-z0-9_-]{21}$/i,nA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rA=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,oA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,iA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let dc;const sA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,aA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,lA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,uA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zx="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fA=new RegExp(`^${zx}$`);function Fx(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function hA(t){return new RegExp(`^${Fx(t)}$`)}function pA(t){let e=`${zx}T${Fx(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function mA(t,e){return!!((e==="v4"||!e)&&sA.test(t)||(e==="v6"||!e)&&lA.test(t))}function gA(t,e){if(!nA.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function vA(t,e){return!!((e==="v4"||!e)&&aA.test(t)||(e==="v6"||!e)&&uA.test(t))}class kn extends ue{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:U.string,received:i.parsedType}),Q}const r=new rt;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.lengthi.value&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,a=e.data.lengthe.test(o),{validation:n,code:M.invalid_string,...B.errToObj(r)})}_addCheck(e){return new kn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...B.errToObj(e)})}url(e){return this._addCheck({kind:"url",...B.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...B.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...B.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...B.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...B.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...B.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...B.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...B.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...B.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...B.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...B.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...B.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...B.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...B.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...B.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...B.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...B.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...B.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...B.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...B.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...B.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...B.errToObj(n)})}nonempty(e){return this.min(1,B.errToObj(e))}trim(){return new kn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new kn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new kn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew kn({checks:[],typeName:Y.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...re(t)});function yA(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(t.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return i%s/10**o}class ci extends ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==U.number){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:U.number,received:i.parsedType}),Q}let r;const o=new rt;for(const i of this._def.checks)i.kind==="int"?de.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?yA(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.not_finite,message:i.message}),o.dirty()):de.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,B.toString(n))}gt(e,n){return this.setLimit("min",e,!1,B.toString(n))}lte(e,n){return this.setLimit("max",e,!0,B.toString(n))}lt(e,n){return this.setLimit("max",e,!1,B.toString(n))}setLimit(e,n,r,o){return new ci({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:B.toString(o)}]})}_addCheck(e){return new ci({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:B.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:B.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:B.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:B.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:B.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuee.kind==="int"||e.kind==="multipleOf"&&de.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.valuenew ci({checks:[],typeName:Y.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class xs extends ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==U.bigint)return this._getInvalidInput(e);let r;const o=new rt;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):de.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return z(n,{code:M.invalid_type,expected:U.bigint,received:n.parsedType}),Q}gte(e,n){return this.setLimit("min",e,!0,B.toString(n))}gt(e,n){return this.setLimit("min",e,!1,B.toString(n))}lte(e,n){return this.setLimit("max",e,!0,B.toString(n))}lt(e,n){return this.setLimit("max",e,!1,B.toString(n))}setLimit(e,n,r,o){return new xs({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:B.toString(o)}]})}_addCheck(e){return new xs({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:B.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew xs({checks:[],typeName:Y.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...re(t)});class Nd extends ue{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.boolean,received:r.parsedType}),Q}return jt(e.data)}}Nd.create=t=>new Nd({typeName:Y.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class xl extends ue{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:U.date,received:i.parsedType}),Q}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_date}),Q}const r=new rt;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()i.value&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):de.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:B.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:B.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew xl({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Y.ZodDate,...re(t)});class Wm extends ue{_parse(e){if(this._getType(e)!==U.symbol){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.symbol,received:r.parsedType}),Q}return jt(e.data)}}Wm.create=t=>new Wm({typeName:Y.ZodSymbol,...re(t)});class Od extends ue{_parse(e){if(this._getType(e)!==U.undefined){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.undefined,received:r.parsedType}),Q}return jt(e.data)}}Od.create=t=>new Od({typeName:Y.ZodUndefined,...re(t)});class Ad extends ue{_parse(e){if(this._getType(e)!==U.null){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.null,received:r.parsedType}),Q}return jt(e.data)}}Ad.create=t=>new Ad({typeName:Y.ZodNull,...re(t)});class Hm extends ue{constructor(){super(...arguments),this._any=!0}_parse(e){return jt(e.data)}}Hm.create=t=>new Hm({typeName:Y.ZodAny,...re(t)});class Md extends ue{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jt(e.data)}}Md.create=t=>new Md({typeName:Y.ZodUnknown,...re(t)});class Er extends ue{_parse(e){const n=this._getOrReturnCtx(e);return z(n,{code:M.invalid_type,expected:U.never,received:n.parsedType}),Q}}Er.create=t=>new Er({typeName:Y.ZodNever,...re(t)});class qm extends ue{_parse(e){if(this._getType(e)!==U.undefined){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.void,received:r.parsedType}),Q}return jt(e.data)}}qm.create=t=>new qm({typeName:Y.ZodVoid,...re(t)});class hn extends ue{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==U.array)return z(n,{code:M.invalid_type,expected:U.array,received:n.parsedType}),Q;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,a=n.data.lengtho.maxLength.value&&(z(n,{code:M.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>o.type._parseAsync(new pn(n,s,n.path,a)))).then(s=>rt.mergeArray(r,s));const i=[...n.data].map((s,a)=>o.type._parseSync(new pn(n,s,n.path,a)));return rt.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:B.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:B.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:B.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...re(e)});function xo(t){if(t instanceof je){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Tn.create(xo(r))}return new je({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:xo(t.element)}):t instanceof Tn?Tn.create(xo(t.unwrap())):t instanceof to?to.create(xo(t.unwrap())):t instanceof Xr?Xr.create(t.items.map(e=>xo(e))):t}class je extends ue{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=de.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==U.object){const u=this._getOrReturnCtx(e);return z(u,{code:M.invalid_type,expected:U.object,received:u.parsedType}),Q}const{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Er&&this._def.unknownKeys==="strip"))for(const u in o.data)s.includes(u)||a.push(u);const l=[];for(const u of s){const c=i[u],d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new pn(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Er){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:o.data[c]}});else if(u==="strict")a.length>0&&(z(o,{code:M.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new pn(o,d,o.path,c)),alwaysSet:c in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,p=await c.value;u.push({key:d,value:p,alwaysSet:c.alwaysSet})}return u}).then(u=>rt.mergeObjectSync(r,u)):rt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return B.errToObj,new je({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s;const o=((s=(i=this._def).errorMap)==null?void 0:s.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:B.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new je({...this._def,unknownKeys:"strip"})}passthrough(){return new je({...this._def,unknownKeys:"passthrough"})}extend(e){return new je({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new je({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Y.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new je({...this._def,catchall:e})}pick(e){const n={};for(const r of de.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new je({...this._def,shape:()=>n})}omit(e){const n={};for(const r of de.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new je({...this._def,shape:()=>n})}deepPartial(){return xo(this)}partial(e){const n={};for(const r of de.objectKeys(this.shape)){const o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new je({...this._def,shape:()=>n})}required(e){const n={};for(const r of de.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Tn;)i=i._def.innerType;n[r]=i}return new je({...this._def,shape:()=>n})}keyof(){return Ux(de.objectKeys(this.shape))}}je.create=(t,e)=>new je({shape:()=>t,unknownKeys:"strip",catchall:Er.create(),typeName:Y.ZodObject,...re(e)});je.strictCreate=(t,e)=>new je({shape:()=>t,unknownKeys:"strict",catchall:Er.create(),typeName:Y.ZodObject,...re(e)});je.lazycreate=(t,e)=>new je({shape:t,unknownKeys:"strip",catchall:Er.create(),typeName:Y.ZodObject,...re(e)});class _l extends ue{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(a=>new Ln(a.ctx.common.issues));return z(n,{code:M.invalid_union,unionErrors:s}),Q}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=s.map(l=>new Ln(l));return z(n,{code:M.invalid_union,unionErrors:a}),Q}}get options(){return this._def.options}}_l.create=(t,e)=>new _l({options:t,typeName:Y.ZodUnion,...re(e)});const wn=t=>t instanceof Id?wn(t.schema):t instanceof eo?wn(t.innerType()):t instanceof El?[t.value]:t instanceof Jr?t.options:t instanceof Ld?de.objectValues(t.enum):t instanceof kl?wn(t._def.innerType):t instanceof Od?[void 0]:t instanceof Ad?[null]:t instanceof Tn?[void 0,...wn(t.unwrap())]:t instanceof to?[null,...wn(t.unwrap())]:t instanceof Vx||t instanceof Tl?wn(t.unwrap()):t instanceof Pl?wn(t._def.innerType):[];class gh extends ue{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return z(n,{code:M.invalid_type,expected:U.object,received:n.parsedType}),Q;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(z(n,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const o=new Map;for(const i of n){const s=wn(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,i)}}return new gh({typeName:Y.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...re(r)})}}function jd(t,e){const n=Jn(t),r=Jn(e);if(t===e)return{valid:!0,data:t};if(n===U.object&&r===U.object){const o=de.objectKeys(e),i=de.objectKeys(t).filter(a=>o.indexOf(a)!==-1),s={...t,...e};for(const a of i){const l=jd(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===U.array&&r===U.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let i=0;i{if(Um(i)||Um(s))return Q;const a=jd(i.value,s.value);return a.valid?((Vm(i)||Vm(s))&&n.dirty(),{status:n.value,value:a.data}):(z(r,{code:M.invalid_intersection_types}),Q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Sl.create=(t,e,n)=>new Sl({left:t,right:e,typeName:Y.ZodIntersection,...re(n)});class Xr extends ue{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.array)return z(r,{code:M.invalid_type,expected:U.array,received:r.parsedType}),Q;if(r.data.lengththis._def.items.length&&(z(r,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new pn(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>rt.mergeArray(n,s)):rt.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Xr({...this._def,rest:e})}}Xr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xr({items:t,typeName:Y.ZodTuple,rest:null,...re(e)})};class bl extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return z(r,{code:M.invalid_type,expected:U.object,received:r.parsedType}),Q;const o=[],i=this._def.keyType,s=this._def.valueType;for(const a in r.data)o.push({key:i._parse(new pn(r,a,r.path,a)),value:s._parse(new pn(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?rt.mergeObjectAsync(n,o):rt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof ue?new bl({keyType:e,valueType:n,typeName:Y.ZodRecord,...re(r)}):new bl({keyType:kn.create(),valueType:e,typeName:Y.ZodRecord,...re(n)})}}class Km extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.map)return z(r,{code:M.invalid_type,expected:U.map,received:r.parsedType}),Q;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:o._parse(new pn(r,a,r.path,[u,"key"])),value:i._parse(new pn(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}}Km.create=(t,e,n)=>new Km({valueType:e,keyType:t,typeName:Y.ZodMap,...re(n)});class _s extends ue{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.set)return z(r,{code:M.invalid_type,expected:U.set,received:r.parsedType}),Q;const o=this._def;o.minSize!==null&&r.data.sizeo.maxSize.value&&(z(r,{code:M.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const u=new Set;for(const c of l){if(c.status==="aborted")return Q;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>i._parse(new pn(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new _s({...this._def,minSize:{value:e,message:B.toString(n)}})}max(e,n){return new _s({...this._def,maxSize:{value:e,message:B.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}_s.create=(t,e)=>new _s({valueType:t,minSize:null,maxSize:null,typeName:Y.ZodSet,...re(e)});class Id extends ue{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Id.create=(t,e)=>new Id({getter:t,typeName:Y.ZodLazy,...re(e)});class El extends ue{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return z(n,{received:n.data,code:M.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}}El.create=(t,e)=>new El({value:t,typeName:Y.ZodLiteral,...re(e)});function Ux(t,e){return new Jr({values:t,typeName:Y.ZodEnum,...re(e)})}class Jr extends ue{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return z(n,{expected:de.joinValues(r),received:n.parsedType,code:M.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return z(n,{received:n.data,code:M.invalid_enum_value,options:r}),Q}return jt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Jr.create(e,{...this._def,...n})}exclude(e,n=this._def){return Jr.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Jr.create=Ux;class Ld extends ue{_parse(e){const n=de.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==U.string&&r.parsedType!==U.number){const o=de.objectValues(n);return z(r,{expected:de.joinValues(o),received:r.parsedType,code:M.invalid_type}),Q}if(this._cache||(this._cache=new Set(de.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=de.objectValues(n);return z(r,{received:r.data,code:M.invalid_enum_value,options:o}),Q}return jt(e.data)}get enum(){return this._def.values}}Ld.create=(t,e)=>new Ld({values:t,typeName:Y.ZodNativeEnum,...re(e)});class Cl extends ue{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.promise&&n.common.async===!1)return z(n,{code:M.invalid_type,expected:U.promise,received:n.parsedType}),Q;const r=n.parsedType===U.promise?n.data:Promise.resolve(n.data);return jt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Cl.create=(t,e)=>new Cl({type:t,typeName:Y.ZodPromise,...re(e)});class eo extends ue{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:s=>{z(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return Q;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Q:l.status==="dirty"||n.value==="dirty"?Di(l.value):l});{if(n.value==="aborted")return Q;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?Q:a.status==="dirty"||n.value==="dirty"?Di(a.value):a}}if(o.type==="refinement"){const s=a=>{const l=o.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Q:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Q:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ui(s))return Q;const a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ui(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:n.value,value:a})):Q);de.assertNever(o)}}eo.create=(t,e,n)=>new eo({schema:t,typeName:Y.ZodEffects,effect:e,...re(n)});eo.createWithPreprocess=(t,e,n)=>new eo({schema:e,effect:{type:"preprocess",transform:t},typeName:Y.ZodEffects,...re(n)});class Tn extends ue{_parse(e){return this._getType(e)===U.undefined?jt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tn.create=(t,e)=>new Tn({innerType:t,typeName:Y.ZodOptional,...re(e)});class to extends ue{_parse(e){return this._getType(e)===U.null?jt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}to.create=(t,e)=>new to({innerType:t,typeName:Y.ZodNullable,...re(e)});class kl extends ue{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===U.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}kl.create=(t,e)=>new kl({innerType:t,typeName:Y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});class Pl extends ue{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return wl(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ln(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ln(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pl.create=(t,e)=>new Pl({innerType:t,typeName:Y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class Gm extends ue{_parse(e){if(this._getType(e)!==U.nan){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.nan,received:r.parsedType}),Q}return{status:"valid",value:e.data}}}Gm.create=t=>new Gm({typeName:Y.ZodNaN,...re(t)});class Vx extends ue{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class vh extends ue{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Q:i.status==="dirty"?(n.dirty(),Di(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Q:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new vh({in:e,out:n,typeName:Y.ZodPipeline})}}class Tl extends ue{_parse(e){const n=this._def.innerType._parse(e),r=o=>(ui(o)&&(o.value=Object.freeze(o.value)),o);return wl(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Tl.create=(t,e)=>new Tl({innerType:t,typeName:Y.ZodReadonly,...re(e)});var Y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Y||(Y={}));const H=kn.create,Ae=ci.create,Rl=Nd.create,wA=Md.create;Er.create;const Ve=hn.create,ve=je.create,xA=_l.create,Bx=gh.create;Sl.create;Xr.create;const Wx=bl.create,ja=El.create,$d=Jr.create;Cl.create;Tn.create;to.create;const Rn=Wx(wA()),yh=ve({id:Ae(),name:H(),slug:H().optional()}).passthrough(),Nl=ve({url:H(),is_official:Rl()}),Dd=ve({task_id:Ae(),dataset_id:Ae(),model_name:H().nullish(),harness:H().nullish(),methodology:H().nullish(),metrics:Wx(xA([H(),Ae()])),uses_additional_data:Rl().optional(),is_open:Rl().optional(),best_rank:Ae().nullish(),best_metric:H().nullish(),evaluated_on:H().nullish(),external_source_url:H().nullish(),num_parameters:Ae().nullish(),hf_model_url:H().nullish()}).passthrough(),_A=Dd.partial().extend({id:Ae().optional()}),SA=Bx("op",[ve({op:ja("create"),data:Dd}),ve({op:ja("update"),evaluation_id:Ae(),data:Dd}),ve({op:ja("delete"),evaluation_id:Ae()})]),Zm=ve({hf_models:Ve(H()),hf_datasets:Ve(H()),hf_spaces:Ve(H())}),Hx=ve({file_name:H(),mime_type:H(),data_url:H().optional(),url:H().optional()}),Ds=ve({name:H(),description:H().optional()}),bA=Ds.extend({image:Hx.optional(),image_credit:H().optional(),parent_id:Ae().optional(),area_id:Ae().optional(),keywords:H().optional()}),EA=Ds.extend({image:Hx.optional(),image_credit:H().optional(),source_paper_id:Ae().optional(),source_url:H().optional(),source_title:H().optional()}),CA=Ds.extend({description:H(),task_ids:Ve(Ae()),full_name:H().optional(),url:H().optional(),hf_url:H().optional(),paper_url:H().optional(),license_name:H().optional(),license_url:H().optional()}),kA=Ds.extend({description:H(),direction:$d(["higher_is_better","lower_is_better"]),full_name:H().optional(),scale:H().optional(),task_id:Ae(),dataset_id:Ae()}),PA=Ds.extend({short_name:H().optional(),venue:H().optional(),location:H().optional(),url:H(),year:Ae(),start_date:H().optional(),end_date:H().optional()}),TA=ve({id:Ae(),paper_id:Ae().nullable(),hf_username:H(),is_author:Rl(),status:$d(["pending","approved","rejected"]),applied_payload:Rn.nullish(),conflict_payload:Rn.nullish(),result_entity_type:H().nullish(),result_entity_id:H().nullish(),admin_note:H().nullish(),user_review_reason:H().nullish(),reviewed_by:H().nullish(),reviewed_by_kind:$d(["human","codex"]).nullish(),review_evidence:Rn.nullish(),created_at:H(),updated_at:H(),reviewed_at:H().nullish()});function pt(t,e,n){return TA.extend({edit_type:ja(t),proposed_payload:e,current_payload:n.nullish()})}const RA=pt("tasks",ve({task_ids:Ve(Ae())}),ve({tasks:Ve(yh)})),NA=pt("methods",ve({method_ids:Ve(Ae())}),ve({methods:Ve(yh)})),OA=pt("evaluations",ve({operations:Ve(SA)}),ve({evaluations:Ve(_A)})),AA=pt("repositories",ve({repositories:Ve(Nl)}),ve({repositories:Ve(Nl)})),MA=pt("project_pages",ve({project_pages:Ve(Nl)}),ve({project_pages:Ve(Nl)})),jA=pt("source_url",ve({source_url:H()}),ve({source_url:H().nullish()})),IA=pt("hf_artifacts",Zm,Zm),LA=pt("organizations",ve({organization_ids:Ve(Ae())}),ve({organizations:Ve(yh)})),$A=pt("new_task",bA,Rn),DA=pt("new_method",EA,Rn),zA=pt("new_benchmark",CA,Rn),FA=pt("new_metric",kA,Rn),UA=pt("new_conference",PA,Rn),VA=pt("new_external_paper",ve({title:H().optional(),source_url:H(),authors:Ve(H()),date_published:H().optional(),abstract:H().optional()}),Rn),qx=Bx("edit_type",[RA,NA,OA,AA,MA,jA,IA,LA,$A,DA,zA,FA,UA,VA]);function XM(t,e,n){return{paper_id:t,edit_type:e,proposed_payload:n}}const BA=ve({count:Ae(),results:Ve(qx)});class WA extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Kx(t,e){const n=t.safeParse(e);if(n.success)return n.data;const r=n.error.issues[0];throw new WA(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const ga=t=>Kx(qx,t),HA=t=>Kx(BA,t);class qA{constructor(e){this.request=e}async submit(e){return ga(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const n=new URLSearchParams;for(const[o,i]of Object.entries(e??{}))i!==void 0&&n.set(o,String(i));const r=n.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(HA)}async get(e){return ga(await this.request(`/admin/paper-edits/${e}`))}async approve(e,n={}){return ga(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(n)}))}async reject(e,n={}){return ga(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(n)}))}}const Ai=new qA($s);class KA{constructor(){Xt(this,"curation");this.curation=new Dx((e,n)=>this.request(e,n))}async request(e,n){return $s(e,n)}async getPapers(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.search&&n.append("search",e.search),e!=null&&e.order_by&&n.append("order_by",e.order_by),e!=null&&e.order_dir&&n.append("order_dir",e.order_dir),e!=null&&e.time&&n.append("time",e.time),e!=null&&e.published_after&&n.append("published_after",e.published_after),e!=null&&e.published_before&&n.append("published_before",e.published_before),e!=null&&e.conference&&n.append("conference",e.conference),(e==null?void 0:e.latest_only)!==void 0&&n.append("latest_only",e.latest_only.toString()),(e==null?void 0:e.include_resources)!==void 0&&n.append("include_resources",e.include_resources.toString()),(e==null?void 0:e.has_code)!==void 0&&n.append("has_code",e.has_code.toString()),(e==null?void 0:e.has_hf_artifacts)!==void 0&&n.append("has_hf_artifacts",e.has_hf_artifacts.toString()),e!=null&&e.framework&&n.append("framework",e.framework),e!=null&&e.repository&&n.append("repository",e.repository);const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(e,n=1,r=10,o,i){return cc.search(e,n,r,o,i)}async getPaper(e,n=!0){return cc.get(e,n)}async getPaperByArxivId(e,n=!0){return cc.getByArxivId(e,n)}async getRelatedPapers(e,n=4){const r=new URLSearchParams({limit:n.toString()});return this.request(`/papers/${encodeURIComponent(e)}/related?${r.toString()}`)}async indexPaperFromArxiv(e){const n=`/papers/index/${e}`;return this.request(n,{method:"POST"})}async submitPaper(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}primePaperCurationState(e,n=!1){return this.curation.primePaper(e,n)}primeEvaluationCurationState(e,n=!1){return this.curation.primeEvaluations(e,n)}freshAuthMutationDraft(){return this.curation.freshAuthMutationDraft()}resumeFreshAuthMutation(){return this.curation.resumeFreshAuthMutation()}async updatePaperTasks(e,n){const r=new URLSearchParams;n.forEach(i=>r.append("task_ids",i.toString()));const o=`/papers/${e}/tasks?${r.toString()}`;return this.curation.mutatePaper(e,"tasks",n,o,{method:"PUT"})}async updatePaperMethods(e,n){const r=new URLSearchParams;n.forEach(i=>r.append("method_ids",i.toString()));const o=`/papers/${e}/methods?${r.toString()}`;return this.curation.mutatePaper(e,"methods",n,o,{method:"PUT"})}async updatePaperOrganizations(e,n){const r=new URLSearchParams;n.forEach(i=>r.append("organization_ids",i.toString()));const o=`/papers/${e}/organizations?${r.toString()}`;return this.curation.mutatePaper(e,"organizations",n,o,{method:"PUT"})}async updatePaperRepositories(e,n){const r=`/papers/${e}/repositories`;return this.curation.mutatePaper(e,"repositories",n,r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(e,n){const r=`/papers/${e}/project-pages`;return this.curation.mutatePaper(e,"project_pages",n,r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(e,n){const r=`/papers/${e}/source-url`;return this.curation.mutatePaper(e,"source_url",n,r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(e,n){const r=`/papers/${e}/hf-artifacts`;return this.curation.mutatePaper(e,"hf_artifacts",n,r,{method:"PUT",body:JSON.stringify(n)})}async getTrendingPapers(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString()),e!=null&&e.max_age_days&&n.append("max_age_days",e.max_age_days.toString()),(e==null?void 0:e.min_velocity)!==void 0&&n.append("min_velocity",e.min_velocity.toString());const r=`/papers/trending${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getRepositoriesForPaper(e){return this.request(`/papers/${e}/repositories`)}async getRepositories(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.owner&&n.append("owner",e.owner),e!=null&&e.official_only&&n.append("official_only",e.official_only.toString()),e!=null&&e.min_stars&&n.append("min_stars",e.min_stars.toString()),e!=null&&e.source&&n.append("source",e.source),e!=null&&e.order_by&&n.append("order_by",e.order_by),e!=null&&e.order_dir&&n.append("order_dir",e.order_dir);const r=`/repositories/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getProjectPagesForPaper(e){return this.request(`/papers/${e}/project-pages`)}async getProjectPages(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.official_only&&n.append("official_only",e.official_only.toString()),e!=null&&e.source&&n.append("source",e.source),e!=null&&e.order_by&&n.append("order_by",e.order_by),e!=null&&e.order_dir&&n.append("order_dir",e.order_dir);const r=`/project-pages/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthors(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString()),e!=null&&e.offset&&n.append("offset",e.offset.toString()),e!=null&&e.search&&n.append("search",e.search),e!=null&&e.sort_by&&n.append("sort_by",e.sort_by),e!=null&&e.sort_order&&n.append("sort_order",e.sort_order);const r=`/authors${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthor(e){return this.request(`/authors/${e}`)}async getAuthorPapers(e,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/${e}/papers${o?`?${o}`:""}`)}async getAreas(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/areas/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getArea(e){return this.request(`/areas/${e}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getConferences(){return this.request("/conferences/")}async getConferenceDeadlines(){return this.request("/conferences/deadlines")}async getConference(e){return this.request(`/conferences/${e}`)}async getConferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}async getConferencePapers(e,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/${e}/papers?${o}`:`/conferences/${e}/papers`;return this.request(i)}async getOrganizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}async getOrganization(e){return this.request(`/organizations/${e}`)}async getOrganizationContributions(e){return this.request(`/organizations/${e}/contributions`)}async getOrganizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}async getOrganizationPapers(e,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/${e}/papers?${o}`:`/organizations/${e}/papers`;return this.request(i)}async getAreaTasks(e,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/${e}/tasks${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTasks(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.area_id&&n.append("area_id",e.area_id.toString()),e!=null&&e.parent_id&&n.append("parent_id",e.parent_id.toString()),(e==null?void 0:e.level)!==void 0&&n.append("level",e.level.toString()),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/tasks/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getTask(e){return this.request(`/tasks/${e}`)}async getFrameworkCatalog(){return this.request("/frameworks/")}async getTopTasks(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString());const r=n.toString(),o=r?`/tasks/top?${r}`:"/tasks/top";return this.request(o)}async getTrendingTasks(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString()),e!=null&&e.recent_days&&n.append("recent_days",e.recent_days.toString()),e!=null&&e.baseline_days&&n.append("baseline_days",e.baseline_days.toString()),(e==null?void 0:e.level)!==void 0&&n.append("level",e.level.toString()),(e==null?void 0:e.min_recent_papers)!==void 0&&n.append("min_recent_papers",e.min_recent_papers.toString()),(e==null?void 0:e.min_baseline_papers)!==void 0&&n.append("min_baseline_papers",e.min_baseline_papers.toString()),(e==null?void 0:e.min_share_lift)!==void 0&&n.append("min_share_lift",e.min_share_lift.toString());const r=n.toString(),o=r?`/tasks/trending?${r}`:"/tasks/trending";return this.request(o)}async getTaskChildren(e,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/${e}/children${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTaskParents(e){return this.request(`/tasks/${e}/parents`)}async getTaskPage(e,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/${e}/page${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTrendingBenchmarks(e,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(e)}/trending-benchmarks${o?`?${o}`:""}`;return this.request(i)}async getTaskPapers(e,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/${e}/papers?${o}`:`/tasks/${e}/papers`;return this.request(i)}async getMethods(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.full_name&&n.append("full_name",e.full_name),e!=null&&e.introduced_year&&n.append("introduced_year",e.introduced_year.toString()),(e==null?void 0:e.area_id)!==void 0&&n.append("area_id",e.area_id.toString()),(e==null?void 0:e.exclude_id)!==void 0&&n.append("exclude_id",e.exclude_id.toString()),(e==null?void 0:e.include_trends)!==void 0&&n.append("include_trends",e.include_trends.toString()),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/methods/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}async getMethodTrend(e,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(e)}/trend${o?`?${o}`:""}`)}async getMethodPapers(e,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(e)}/papers?${o}`:`/methods/${encodeURIComponent(e)}/papers`;return this.request(i)}async getDatasets(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.full_name&&n.append("full_name",e.full_name),e!=null&&e.task&&n.append("task",e.task),e!=null&&e.task_id&&n.append("task",e.task_id.toString()),e!=null&&e.include_descendants&&n.append("include_descendants","true"),(e==null?void 0:e.min_eval_count)!==void 0&&n.append("min_eval_count",e.min_eval_count.toString()),(e==null?void 0:e.is_open)!==void 0&&n.append("is_open",e.is_open.toString()),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/datasets/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getDataset(e){return this.request(`/datasets/${e}`)}async getDatasetBySlug(e,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/${e}${o}`)}async getDatasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async getLeaderboardMetrics(e,n){return(await this.request(`/datasets/${e}/tasks/${n}/metrics`)).metrics}async getEvaluations(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.paper_id&&n.append("paper_id",e.paper_id.toString()),e!=null&&e.task_id&&n.append("task_id",e.task_id.toString()),e!=null&&e.include_descendants&&n.append("include_descendants","true"),e!=null&&e.dataset_id&&n.append("dataset_id",e.dataset_id.toString()),e!=null&&e.best_metric&&n.append("best_metric",e.best_metric),(e==null?void 0:e.external)!==void 0&&n.append("external",String(e.external)),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/evaluations/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getEvaluation(e){return this.request(`/evaluations/${e}`)}async getEvaluationsByPaper(e){const r=parseInt(e),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(e,n){const o=parseInt(e),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(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}async updateEvaluation(e,n){const r=`/evaluations/${e}`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async deleteEvaluation(e){const n=`/evaluations/${e}`;return this.request(n,{method:"DELETE"})}async batchEvaluations(e,n){return this.curation.mutateEvaluations(e,n,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:n})})}async generateThumbnail(e){const n=$r(`/api/thumbnails/generate/${e}`),r=await fetch(n,{method:"POST"});if(!r.ok)throw new Error(`Thumbnail generation failed: ${r.status}`);return await r.json()}async getThumbnailStatus(e){const n=$r(`/api/thumbnails/status/${e}`),r=await fetch(n);if(!r.ok)throw new Error(`Thumbnail status check failed: ${r.status}`);return await r.json()}async healthCheck(){const e=$r("/health"),n=await fetch(e);if(!n.ok)throw new Error(`Health check failed: ${n.status}`);return await n.json()}async getMetrics(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.direction&&n.append("direction",e.direction),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/metrics/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMetric(e){return this.request(`/metrics/${e}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(e){return Ai.submit(e)}async listPendingPaperEdits(e){return Ai.list(e)}async getPendingPaperEdit(e){return Ai.get(e)}async approvePendingPaperEdit(e,n){return Ai.approve(e,n)}async rejectPendingPaperEdit(e,n){return Ai.reject(e,n)}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"POST"})}async removeBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}async getMyPreferences(){return zm.getPreferences()}async updateMyPreferences(e){return zm.updatePreferences(e)}async getOpenRouterUsage(){return this.request("/chat/usage",{cache:"no-store"})}async getChatAvailability(){return this.request("/chat/availability",{cache:"no-store"})}async prewarmChatPaperContext(e){const n=await fetch($r("/api/v1/chat/paper-context/prewarm"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"});if(!n.ok)throw new Error(`Paper context prewarm failed (${n.status})`)}async getChatSandboxSpend(e){const n=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${n}`,{cache:"no-store"})}async getChatWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}async getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}async connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}async setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}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(e){const n=e?`?cursor=${encodeURIComponent(e)}`:"";return this.request(`/contributions${n}`)}async getCatalogAudit(e){const n=e?`?cursor=${encodeURIComponent(e)}`:"";return this.request(`/admin/catalog-audit${n}`)}async acknowledgeCatalogAudit(){await this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}async rollbackCatalogEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const C=new KA;C.getPapers.bind(C);C.getPaper.bind(C);C.getPaperByArxivId.bind(C);C.indexPaperFromArxiv.bind(C);C.submitPaper.bind(C);C.updatePaperTasks.bind(C);C.updatePaperMethods.bind(C);C.updatePaperOrganizations.bind(C);C.updatePaperRepositories.bind(C);C.updatePaperProjectPages.bind(C);C.updatePaperSourceUrl.bind(C);C.updatePaperHfArtifacts.bind(C);C.primePaperCurationState.bind(C);C.primeEvaluationCurationState.bind(C);C.getTrendingPapers.bind(C);C.getRepositoriesForPaper.bind(C);C.getRepositories.bind(C);C.getProjectPagesForPaper.bind(C);C.getProjectPages.bind(C);C.getAuthors.bind(C);C.getAuthor.bind(C);C.getAreas.bind(C);C.getArea.bind(C);C.getAreasWithTasks.bind(C);C.getConferences.bind(C);C.getConferenceDeadlines.bind(C);C.getConference.bind(C);C.getConferenceAreasWithTasks.bind(C);C.getConferencePapers.bind(C);C.getOrganizations.bind(C);C.getOrganization.bind(C);C.getOrganizationContributions.bind(C);C.getOrganizationAreasWithTasks.bind(C);C.getOrganizationPapers.bind(C);C.getAreaTasks.bind(C);C.getTasks.bind(C);C.getTask.bind(C);C.getTopTasks.bind(C);C.getTrendingTasks.bind(C);C.getTaskChildren.bind(C);C.getTaskParents.bind(C);C.getTaskPage.bind(C);C.getTaskPapers.bind(C);C.getMethods.bind(C);C.getMethod.bind(C);C.getMethodPapers.bind(C);C.getDatasets.bind(C);C.getDataset.bind(C);C.getDatasetBySlug.bind(C);C.getDatasetTasks.bind(C);C.getLeaderboardMetrics.bind(C);C.getEvaluations.bind(C);C.getEvaluation.bind(C);C.getEvaluationsByPaper.bind(C);C.getEvaluationsByDataset.bind(C);C.createEvaluation.bind(C);C.updateEvaluation.bind(C);C.deleteEvaluation.bind(C);C.batchEvaluations.bind(C);C.generateThumbnail.bind(C);C.getThumbnailStatus.bind(C);C.getMetrics.bind(C);C.getMetric.bind(C);C.getMetricDirections.bind(C);C.getResearchTrends.bind(C);C.healthCheck.bind(C);C.getMyBookmarkIds.bind(C);C.getMyBookmarks.bind(C);C.addBookmark.bind(C);C.getMyPreferences.bind(C);C.updateMyPreferences.bind(C);C.submitPendingPaperEdit.bind(C);C.listPendingPaperEdits.bind(C);C.getPendingPaperEdit.bind(C);C.approvePendingPaperEdit.bind(C);C.rejectPendingPaperEdit.bind(C);C.removeBookmark.bind(C);const fc={hide_closed_source_evals:!1},Gx=T.createContext(null),GA=({children:t})=>{const{user:e}=dh(),[n,r]=T.useState(fc),[o,i]=T.useState(!1);T.useEffect(()=>{let l=!1;if(!e){r(fc);return}return i(!0),C.getMyPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(fc)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[e]);const s=T.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await C.updateMyPreferences(u);r(c)}catch{r(n)}},[n,e]),a=T.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:o,setHideClosedSourceEvals:s}),[n,e,o,s]);return m.jsx(Gx.Provider,{value:a,children:t})};function JM(){const t=T.useContext(Gx);if(!t)throw new Error("usePreferences must be used inside a ");return t}const Zx=CE(),ZA=Zx?B1:V1;if(!Zx&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const QA=T.lazy(()=>he(()=>import("./FeedView-Dv7Ll2yq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))),YA=T.lazy(()=>he(()=>import("./ChatView-DRCYIPi4.js"),__vite__mapDeps([18,10,19,8,9,3,4,20,21,22,23,24,25,12,26]))),XA=T.lazy(()=>he(()=>import("./SharedChatView-DUG-nNC-.js"),__vite__mapDeps([27,10,19,8,9,3,4,20,21,22,23,24,25]))),JA=T.lazy(()=>he(()=>import("./PapersListView-DpeQT2iM.js"),__vite__mapDeps([28,1,2,3,4,5,6,11,13,10,14,29,15,7,16,17]))),eM=T.lazy(()=>he(()=>import("./PaperDetailView-BEjlwQbA.js"),__vite__mapDeps([30,10,1,2,3,4,5,6,31,20,32,33,13,14,16,17,34,35,36,37,38,11,39,40,41,42,21,22,43,24]))),tM=T.lazy(()=>he(()=>import("./TagsIndexView-Dnvf32XM.js"),__vite__mapDeps([44,10,11,5,16,17,45,39,34,36,37,38,40]))),nM=T.lazy(()=>he(()=>import("./TagBrowseView-Dwwqp3GC.js"),__vite__mapDeps([46,10,1,2,3,4,5,6,47,7,48,23,24,20,11,13,14,16,17,9,22]))),rM=T.lazy(()=>he(()=>import("./MethodsIndexView-BlcIa_fS.js"),__vite__mapDeps([49,10,11,50,16,17,45,39,34,36,37,38,40]))),oM=T.lazy(()=>he(()=>import("./FrameworksIndexView-CJh-2Pow.js"),__vite__mapDeps([51,10,1,2,3,4,5,6,11]))),iM=T.lazy(()=>he(()=>import("./TrendsView-Dse5C7fn.js"),__vite__mapDeps([52,10,17,16]))),sM=T.lazy(()=>he(()=>import("./ConferencesIndexView-ESNh5pHs.js"),__vite__mapDeps([53,10,11,16,17,45,39,34,36,37,38,40]))),aM=T.lazy(()=>he(()=>import("./AiDeadlinesView-BG7IjWh-.js"),__vite__mapDeps([54,10,11,55,35,16,17,6,37]))),lM=T.lazy(()=>he(()=>import("./ConferenceDetailView-BP5drqUx.js"),__vite__mapDeps([56,10,48,3,4,23,24,20,11,5,16,17,6]))),uM=T.lazy(()=>he(()=>import("./ConferenceTaskView-DeQ10q-x.js"),__vite__mapDeps([57,10,1,2,3,4,5,6,7,48,23,24,20,11,13,14,16,17]))),cM=T.lazy(()=>he(()=>import("./OrganizationsIndexView-DN3ysr-g.js"),__vite__mapDeps([58,10,17,16,11,59]))),dM=T.lazy(()=>he(()=>import("./OrganizationDetailView-BbrTMC2j.js"),__vite__mapDeps([60,61,10,1,2,3,4,5,6,48,23,24,20,62,16,11,7,17,41,34,37,40,13,14,63]))),fM=T.lazy(()=>he(()=>import("./OrganizationTaskView-CFdQxMtl.js"),__vite__mapDeps([64,61,10,1,2,3,4,5,6,48,23,24,20,62,16,11,7,17,41,34,37,40,13,14,63]))),hM=T.lazy(()=>he(()=>import("./AuthorDetailView-BT0wFF7e.js"),__vite__mapDeps([65,10,16,63]))),pM=T.lazy(()=>he(()=>import("./MethodDetailView-CkUzVx0g.js"),__vite__mapDeps([66,10,14,1,2,3,4,5,6,7,48,23,24,20,11,50,16,17]))),mM=T.lazy(()=>he(()=>import("./BenchmarkDetailView-CJEQANf-.js"),__vite__mapDeps([67,10,11,31,20,6,32,16,55,35,17,2,3,4,47,1,5,68]))),gM=T.lazy(()=>he(()=>import("./SavedPapersView-CKKGXgM6.js"),__vite__mapDeps([69,10,1,2,3,4,5,6,16,17,43]))),vM=T.lazy(()=>he(()=>import("./SettingsView-CwSxZOuD.js"),__vite__mapDeps([70,38,55,35,33,26,10,71]))),yM=T.lazy(()=>he(()=>import("./PrivacyView-CIEmHSbN.js"),__vite__mapDeps([72,33]))),wM=T.lazy(()=>he(()=>import("./SubmitView-oLTX5Nai.js"),__vite__mapDeps([73,38,17,34,36]))),xM=T.lazy(()=>he(()=>import("./CronDashboard-Bo73phUc.js"),__vite__mapDeps([74,10,42,34,9,25,75,40,76,71,38,14,11,77]))),_M=T.lazy(()=>he(()=>import("./SubmissionsDashboard-bmyAR3Ji.js"),__vite__mapDeps([78,10,38,11,6,75,40,76]))),SM=T.lazy(()=>he(()=>import("./UserProfileView-DLYWBFmP.js"),__vite__mapDeps([79,10,62,16,11]))),bM=T.lazy(()=>he(()=>import("./RateLimitsView-C-wgjf0f.js"),__vite__mapDeps([80,10]))),Qm=T.lazy(()=>he(()=>import("./NotFound-B6qYFFtn.js"),[])),EM=T.lazy(()=>he(()=>import("./SearchOverlay-hqfeEBSl.js"),__vite__mapDeps([81,10,2,3,4,11,29,5]))),CM=T.lazy(()=>he(()=>import("./StagingAccessRequestView-DPg61I7V.js"),__vite__mapDeps([82,76]))),Ym=()=>m.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),m.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),kM=new SE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),PM=()=>{const{arxivId:t}=Oy();return m.jsx(ii,{to:t?`/paper/${t}`:"/papers",replace:!0})},TM=()=>{const{taskSlug:t}=Oy();return m.jsx(ii,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},Xm=({element:t})=>Os()?m.jsx(ii,{to:"/",replace:!0}):m.jsx(m.Fragment,{children:t}),RM=({element:t})=>{const{user:e,isLoading:n}=dh();return Os()?m.jsx(ii,{to:"/",replace:!0}):n?m.jsx("div",{className:"page",children:m.jsx("div",{className:"submission-loading",children:m.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?m.jsx(m.Fragment,{children:t}):m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-empty submission-empty-warn",children:[m.jsx("h1",{children:"Admin access required"}),m.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-empty submission-empty-warn",children:[m.jsx("h1",{children:"Sign in required"}),m.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),m.jsx(Gy,{returnTo:"/admin-dashboard"})]})})},NM=()=>{const t=EE(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return T.useEffect(()=>{e&&window.location.replace(t)},[t,e]),e?m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-loading",children:[m.jsx("span",{children:"Opening the production admin dashboard..."}),m.jsx("a",{href:t,children:"Continue"})]})}):m.jsx(RM,{element:m.jsx(xM,{})})},OM=()=>{const[t,e]=T.useState(!1),n=Qt();return zO(),T.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),T.useEffect(()=>{const r=o=>{(o.metaKey||o.ctrlKey)&&o.key==="k"&&(o.preventDefault(),e(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?m.jsx(T.Suspense,{fallback:m.jsx(Ym,{}),children:m.jsx(CM,{})}):m.jsxs(m.Fragment,{children:[m.jsx(cN,{onOpenSearch:()=>e(!0)}),m.jsx("main",{children:m.jsx(T.Suspense,{fallback:m.jsx(Ym,{}),children:m.jsxs(M1,{children:[m.jsx(ce,{path:"/",element:m.jsx(QA,{})}),m.jsx(ce,{path:"/chat/:sessionId?",element:cl()?m.jsx(YA,{}):m.jsx(ii,{to:"/",replace:!0})}),m.jsx(ce,{path:"/share/:shareId",element:cl()?m.jsx(XA,{}):m.jsx(Qm,{})}),m.jsx(ce,{path:"/papers",element:m.jsx(JA,{})}),m.jsx(ce,{path:"/papers/:arxivId",element:m.jsx(PM,{})}),m.jsx(ce,{path:"/paper/:arxivId",element:m.jsx(eM,{})}),m.jsx(ce,{path:"/tasks",element:m.jsx(tM,{})}),m.jsx(ce,{path:"/tasks/:taskSlug",element:m.jsx(nM,{})}),m.jsx(ce,{path:"/task/:taskSlug",element:m.jsx(TM,{})}),m.jsx(ce,{path:"/methods",element:m.jsx(rM,{})}),m.jsx(ce,{path:"/methods/:methodSlug",element:m.jsx(pM,{})}),m.jsx(ce,{path:"/frameworks",element:m.jsx(oM,{})}),m.jsx(ce,{path:"/trends",element:m.jsx(iM,{})}),m.jsx(ce,{path:"/conferences",element:m.jsx(sM,{})}),m.jsx(ce,{path:"/ai-deadlines",element:m.jsx(aM,{})}),m.jsx(ce,{path:"/conferences/:confSlug",element:m.jsx(lM,{})}),m.jsx(ce,{path:"/conferences/:confSlug/:taskSlug",element:m.jsx(uM,{})}),m.jsx(ce,{path:"/organizations",element:m.jsx(cM,{})}),m.jsx(ce,{path:"/orgs/:orgSlug",element:m.jsx(dM,{})}),m.jsx(ce,{path:"/orgs/:orgSlug/:taskSlug",element:m.jsx(fM,{})}),m.jsx(ce,{path:"/authors/:authorId",element:m.jsx(hM,{})}),m.jsx(ce,{path:"/benchmark/:datasetSlug",element:m.jsx(mM,{})}),m.jsx(ce,{path:"/submit",element:m.jsx(wM,{})}),m.jsx(ce,{path:"/saved",element:m.jsx(Xm,{element:m.jsx(gM,{})})}),m.jsx(ce,{path:"/settings",element:m.jsx(vM,{})}),m.jsx(ce,{path:"/privacy",element:m.jsx(yM,{})}),m.jsx(ce,{path:"/admin-dashboard",element:m.jsx(NM,{})}),m.jsx(ce,{path:"/cron-dashboard",element:m.jsx(ii,{to:"/admin-dashboard",replace:!0})}),m.jsx(ce,{path:"/submissions",element:m.jsx(Xm,{element:m.jsx(_M,{})})}),m.jsx(ce,{path:"/rate-limits",element:m.jsx(bM,{})}),m.jsx(ce,{path:"/:username",element:m.jsx(SM,{})}),m.jsx(ce,{path:"*",element:m.jsx(Qm,{})})]})})}),m.jsx(dN,{}),t&&m.jsx(T.Suspense,{fallback:null,children:m.jsx(EM,{open:t,onClose:()=>e(!1)})})]})},AM=()=>m.jsx(bE,{client:kM,children:m.jsx(sN,{children:m.jsx(GA,{children:m.jsxs($O,{children:[m.jsx(ZA,{children:m.jsx(OM,{})}),m.jsx(BN,{}),m.jsx(vO,{}),!1]})})})});Bb();const MM=Sy(document.getElementById("root"));MM.render(m.jsx(T.StrictMode,{children:m.jsx(Lb,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:m.jsx(Ub,{children:m.jsx(AM,{})})})}));export{kP as $,yl as A,Zw as B,KR as C,ZR as D,Jl as E,qM as F,JM as G,YR as H,VP as I,XR as J,rx as K,_n as L,tn as M,BM as N,KM as O,ao as P,gd as Q,T as R,Mt as S,VN as T,Gf as U,Qy as V,zN as W,QR as X,XM as Y,Gy as Z,io as _,LM as a,Hw as a0,iu as a1,rh as a2,XP as a3,l0 as a4,rk as a5,Sw as a6,eu as a7,qw as a8,Kw as a9,Uy as aA,tE as aB,nE as aC,ud as aD,Dy as aE,vE as aF,sE as aG,GM as aa,DM as ab,IM as ac,lg as ad,$s as ae,en as af,Ib as ag,UM as ah,FM as ai,HM as aj,Xl as ak,tt as al,$M as am,zy as an,Ut as ao,mw as ap,gw as aq,vw as ar,ms as as,wE as at,zM as au,ii as av,Qt as aw,cE as ax,rE as ay,cd as az,WM as b,C as c,cu as d,$r as e,Oy as f,dh as g,vN as h,cl as i,m as j,VM as k,PE as l,Te as m,qf as n,Be as o,cc as p,G as q,f as r,wP as s,so as t,zf as u,We as v,Ai as w,Os as x,yw as y,UP as z}; +`);function pa(t){return t.label!==void 0}var sO=3,aO="32px",lO="16px",Im=4e3,uO=356,cO=14,dO=20,fO=200;function zt(...t){return t.filter(Boolean).join(" ")}function hO(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var pO=t=>{var e,n,r,o,i,s,a,l,u,c,d;let{invert:p,toast:h,unstyled:S,interacting:y,setHeights:x,visibleToasts:v,heights:g,index:w,toasts:_,expanded:b,removeToast:E,defaultRichColors:k,closeButton:R,style:I,cancelButtonStyle:j,actionButtonStyle:W,className:D="",descriptionClassName:J="",duration:$,position:oe,gap:q,loadingIcon:X,expandByDefault:O,classNames:P,icons:L,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:V}=t,[te,ie]=T.useState(null),[be,Re]=T.useState(null),[se,gn]=T.useState(!1),[De,Yt]=T.useState(!1),[Un,co]=T.useState(!1),[Vn,zs]=T.useState(!1),[mu,Fs]=T.useState(!1),[gu,yi]=T.useState(0),[fo,wh]=T.useState(0),wi=T.useRef(h.duration||$||Im),xh=T.useRef(null),Tr=T.useRef(null),Qx=w===0,Yx=w+1<=v,Et=h.type,ho=h.dismissible!==!1,Xx=h.className||"",Jx=h.descriptionClassName||"",Us=T.useMemo(()=>g.findIndex(ee=>ee.toastId===h.id)||0,[g,h.id]),e_=T.useMemo(()=>{var ee;return(ee=h.closeButton)!=null?ee:R},[h.closeButton,R]),_h=T.useMemo(()=>h.duration||$||Im,[h.duration,$]),vu=T.useRef(0),po=T.useRef(0),Sh=T.useRef(0),mo=T.useRef(null),[t_,n_]=oe.split("-"),bh=T.useMemo(()=>g.reduce((ee,me,_e)=>_e>=Us?ee:ee+me.height,0),[g,Us]),Eh=XN(),r_=h.invert||p,yu=Et==="loading";po.current=T.useMemo(()=>Us*q+bh,[Us,bh]),T.useEffect(()=>{wi.current=_h},[_h]),T.useEffect(()=>{gn(!0)},[]),T.useEffect(()=>{let ee=Tr.current;if(ee){let me=ee.getBoundingClientRect().height;return wh(me),x(_e=>[{toastId:h.id,height:me,position:h.position},..._e]),()=>x(_e=>_e.filter(It=>It.toastId!==h.id))}},[x,h.id]),T.useLayoutEffect(()=>{if(!se)return;let ee=Tr.current,me=ee.style.height;ee.style.height="auto";let _e=ee.getBoundingClientRect().height;ee.style.height=me,wh(_e),x(It=>It.find(Lt=>Lt.toastId===h.id)?It.map(Lt=>Lt.toastId===h.id?{...Lt,height:_e}:Lt):[{toastId:h.id,height:_e,position:h.position},...It])},[se,h.title,h.description,x,h.id]);let Bn=T.useCallback(()=>{Yt(!0),yi(po.current),x(ee=>ee.filter(me=>me.toastId!==h.id)),setTimeout(()=>{E(h)},fO)},[h,E,x,po]);T.useEffect(()=>{if(h.promise&&Et==="loading"||h.duration===1/0||h.type==="loading")return;let ee;return b||y||V&&Eh?(()=>{if(Sh.current{var me;(me=h.onAutoClose)==null||me.call(h,h),Bn()},wi.current)),()=>clearTimeout(ee)},[b,y,h,Et,V,Eh,Bn]),T.useEffect(()=>{h.delete&&Bn()},[Bn,h.delete]);function o_(){var ee,me,_e;return L!=null&&L.loading?T.createElement("div",{className:zt(P==null?void 0:P.loader,(ee=h==null?void 0:h.classNames)==null?void 0:ee.loader,"sonner-loader"),"data-visible":Et==="loading"},L.loading):X?T.createElement("div",{className:zt(P==null?void 0:P.loader,(me=h==null?void 0:h.classNames)==null?void 0:me.loader,"sonner-loader"),"data-visible":Et==="loading"},X):T.createElement(qN,{className:zt(P==null?void 0:P.loader,(_e=h==null?void 0:h.classNames)==null?void 0:_e.loader),visible:Et==="loading"})}return T.createElement("li",{tabIndex:0,ref:Tr,className:zt(D,Xx,P==null?void 0:P.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,P==null?void 0:P.default,P==null?void 0:P[Et],(n=h==null?void 0:h.classNames)==null?void 0:n[Et]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:k,"data-styled":!(h.jsx||h.unstyled||S),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":mu,"data-removed":De,"data-visible":Yx,"data-y-position":t_,"data-x-position":n_,"data-index":w,"data-front":Qx,"data-swiping":Un,"data-dismissible":ho,"data-type":Et,"data-invert":r_,"data-swipe-out":Vn,"data-swipe-direction":be,"data-expanded":!!(b||O&&se),style:{"--index":w,"--toasts-before":w,"--z-index":_.length-w,"--offset":`${De?gu:po.current}px`,"--initial-height":O?"auto":`${fo}px`,...I,...h.style},onDragEnd:()=>{co(!1),ie(null),mo.current=null},onPointerDown:ee=>{yu||!ho||(xh.current=new Date,yi(po.current),ee.target.setPointerCapture(ee.pointerId),ee.target.tagName!=="BUTTON"&&(co(!0),mo.current={x:ee.clientX,y:ee.clientY}))},onPointerUp:()=>{var ee,me,_e,It;if(Vn||!ho)return;mo.current=null;let Lt=Number(((ee=Tr.current)==null?void 0:ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Wn=Number(((me=Tr.current)==null?void 0:me.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Rr=new Date().getTime()-((_e=xh.current)==null?void 0:_e.getTime()),$t=te==="x"?Lt:Wn,Hn=Math.abs($t)/Rr;if(Math.abs($t)>=dO||Hn>.11){yi(po.current),(It=h.onDismiss)==null||It.call(h,h),Re(te==="x"?Lt>0?"right":"left":Wn>0?"down":"up"),Bn(),zs(!0),Fs(!1);return}co(!1),ie(null)},onPointerMove:ee=>{var me,_e,It,Lt;if(!mo.current||!ho||((me=window.getSelection())==null?void 0:me.toString().length)>0)return;let Wn=ee.clientY-mo.current.y,Rr=ee.clientX-mo.current.x,$t=(_e=t.swipeDirections)!=null?_e:hO(oe);!te&&(Math.abs(Rr)>1||Math.abs(Wn)>1)&&ie(Math.abs(Rr)>Math.abs(Wn)?"x":"y");let Hn={x:0,y:0};te==="y"?($t.includes("top")||$t.includes("bottom"))&&($t.includes("top")&&Wn<0||$t.includes("bottom")&&Wn>0)&&(Hn.y=Wn):te==="x"&&($t.includes("left")||$t.includes("right"))&&($t.includes("left")&&Rr<0||$t.includes("right")&&Rr>0)&&(Hn.x=Rr),(Math.abs(Hn.x)>0||Math.abs(Hn.y)>0)&&Fs(!0),(It=Tr.current)==null||It.style.setProperty("--swipe-amount-x",`${Hn.x}px`),(Lt=Tr.current)==null||Lt.style.setProperty("--swipe-amount-y",`${Hn.y}px`)}},e_&&!h.jsx?T.createElement("button",{"aria-label":K,"data-disabled":yu,"data-close-button":!0,onClick:yu||!ho?()=>{}:()=>{var ee;Bn(),(ee=h.onDismiss)==null||ee.call(h,h)},className:zt(P==null?void 0:P.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(i=L==null?void 0:L.close)!=null?i:YN):null,h.jsx||f.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:T.createElement(T.Fragment,null,Et||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:zt(P==null?void 0:P.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||o_():null,h.type!=="loading"?h.icon||(L==null?void 0:L[Et])||WN(Et):null):null,T.createElement("div",{"data-content":"",className:zt(P==null?void 0:P.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:zt(P==null?void 0:P.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:zt(J,Jx,P==null?void 0:P.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&&pa(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||j,onClick:ee=>{var me,_e;pa(h.cancel)&&ho&&((_e=(me=h.cancel).onClick)==null||_e.call(me,ee),Bn())},className:zt(P==null?void 0:P.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&&pa(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||W,onClick:ee=>{var me,_e;pa(h.action)&&((_e=(me=h.action).onClick)==null||_e.call(me,ee),!ee.defaultPrevented&&Bn())},className:zt(P==null?void 0:P.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function Lm(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function mO(t,e){let n={};return[t,e].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?lO:aO;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 gO=f.forwardRef(function(t,e){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:S=sO,toastOptions:y,dir:x=Lm(),gap:v=cO,loadingIcon:g,icons:w,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:b}=t,[E,k]=T.useState([]),R=T.useMemo(()=>Array.from(new Set([r].concat(E.filter(V=>V.position).map(V=>V.position)))),[E,r]),[I,j]=T.useState([]),[W,D]=T.useState(!1),[J,$]=T.useState(!1),[oe,q]=T.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=T.useRef(null),O=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=T.useRef(null),L=T.useRef(!1),K=T.useCallback(V=>{k(te=>{var ie;return(ie=te.find(be=>be.id===V.id))!=null&&ie.delete||at.dismiss(V.id),te.filter(({id:be})=>be!==V.id)})},[]);return T.useEffect(()=>at.subscribe(V=>{if(V.dismiss){k(te=>te.map(ie=>ie.id===V.id?{...ie,delete:!0}:ie));return}setTimeout(()=>{_y.flushSync(()=>{k(te=>{let ie=te.findIndex(be=>be.id===V.id);return ie!==-1?[...te.slice(0,ie),{...te[ie],...V},...te.slice(ie+1)]:[V,...te]})})})}),[]),T.useEffect(()=>{if(c!=="system"){q(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:te})=>{q(te?"dark":"light")})}catch{V.addListener(({matches:ie})=>{try{q(ie?"dark":"light")}catch(be){console.error(be)}})}},[c]),T.useEffect(()=>{E.length<=1&&D(!1)},[E]),T.useEffect(()=>{let V=te=>{var ie,be;o.every(Re=>te[Re]||te.code===Re)&&(D(!0),(ie=X.current)==null||ie.focus()),te.code==="Escape"&&(document.activeElement===X.current||(be=X.current)!=null&&be.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[o]),T.useEffect(()=>{if(X.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,L.current=!1)}},[X.current]),T.createElement("section",{ref:e,"aria-label":`${_} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((V,te)=>{var ie;let[be,Re]=V.split("-");return E.length?T.createElement("ol",{key:V,dir:x==="auto"?Lm():x,tabIndex:-1,ref:X,className:a,"data-sonner-toaster":!0,"data-theme":oe,"data-y-position":be,"data-lifted":W&&E.length>1&&!i,"data-x-position":Re,style:{"--front-toast-height":`${((ie=I[0])==null?void 0:ie.height)||0}px`,"--width":`${uO}px`,"--gap":`${v}px`,...h,...mO(l,u)},onBlur:se=>{L.current&&!se.currentTarget.contains(se.relatedTarget)&&(L.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||L.current||(L.current=!0,P.current=se.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{J||D(!1)},onDragEnd:()=>D(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},E.filter(se=>!se.position&&te===0||se.position===V).map((se,gn)=>{var De,Yt;return T.createElement(pO,{key:se.id,icons:w,index:gn,toast:se,defaultRichColors:d,duration:(De=y==null?void 0:y.duration)!=null?De:p,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:S,closeButton:(Yt=y==null?void 0:y.closeButton)!=null?Yt:s,interacting:J,position:V,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:K,toasts:E.filter(Un=>Un.position==se.position),heights:I.filter(Un=>Un.position==se.position),setHeights:j,expandByDefault:i,gap:v,loadingIcon:g,expanded:W,pauseWhenPageIsHidden:b,swipeDirections:t.swipeDirections})})):null}))});const vO=({...t})=>{const{theme:e="system"}=Ib();return m.jsx(gO,{theme:e,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"}},...t})};var yO=Symbol("radix.slottable");function wO(t){const e=({children:n})=>m.jsx(m.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=yO,e}var[hu]=so("Tooltip",[iu]),mh=iu(),Nx="TooltipProvider",xO=700,$m="tooltip.open",[_O,Ox]=hu(Nx),Ax=t=>{const{__scopeTooltip:e,delayDuration:n=xO,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=t,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),m.jsx(_O,{scope:e,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})};Ax.displayName=Nx;var Mx="Tooltip",[QM,pu]=hu(Mx),Td="TooltipTrigger",SO=f.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=pu(Td,n),i=Ox(Td,n),s=mh(n),a=f.useRef(null),l=Be(e,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]),m.jsx(Hw,{asChild:!0,...s,children:m.jsx(Te.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:G(t.onPointerMove,p=>{p.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),c.current=!0)}),onPointerLeave:G(t.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:G(t.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:G(t.onFocus,()=>{u.current||o.onOpen()}),onBlur:G(t.onBlur,o.onClose),onClick:G(t.onClick,o.onClose)})})});SO.displayName=Td;var bO="TooltipPortal",[YM,EO]=hu(bO,{forceMount:void 0}),li="TooltipContent",jx=f.forwardRef((t,e)=>{const n=EO(li,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=t,s=pu(li,t.__scopeTooltip);return m.jsx(ao,{present:r||s.open,children:s.disableHoverableContent?m.jsx(Ix,{side:o,...i,ref:e}):m.jsx(CO,{side:o,...i,ref:e})})}),CO=f.forwardRef((t,e)=>{const n=pu(li,t.__scopeTooltip),r=Ox(li,t.__scopeTooltip),o=f.useRef(null),i=Be(e,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((S,y)=>{const x=S.currentTarget,v={x:S.clientX,y:S.clientY},g=NO(v,x.getBoundingClientRect()),w=OO(v,g),_=AO(y.getBoundingClientRect()),b=jO([...w,..._]);a(b),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(l&&c){const S=x=>h(x,c),y=x=>h(x,l);return l.addEventListener("pointerleave",S),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",S),c.removeEventListener("pointerleave",y)}}},[l,c,h,p]),f.useEffect(()=>{if(s){const S=y=>{const x=y.target,v={x:y.clientX,y:y.clientY},g=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),w=!MO(v,s);g?p():w&&(p(),u())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[l,c,s,u,p]),m.jsx(Ix,{...t,ref:i})}),[kO,PO]=hu(Mx,{isInside:!1}),TO=wO("TooltipContent"),Ix=f.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=t,l=pu(li,n),u=mh(n),{onClose:c}=l;return f.useEffect(()=>(document.addEventListener($m,c),()=>document.removeEventListener($m,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]),m.jsx(eu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:m.jsxs(qw,{"data-state":l.stateAttribute,...u,...a,ref:e,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:[m.jsx(TO,{children:r}),m.jsx(kO,{scope:n,isInside:!0,children:m.jsx(xN,{id:l.contentId,role:"tooltip",children:o||r})})]})})});jx.displayName=li;var Lx="TooltipArrow",RO=f.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=mh(n);return PO(Lx,n).isInside?null:m.jsx(Kw,{...o,...r,ref:e})});RO.displayName=Lx;function NO(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),i=Math.abs(e.left-t.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 OO(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function AO(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function MO(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;ir!=p>r&&n<(d-u)*(r-c)/(p-c)+u&&(o=!o)}return o}function jO(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),IO(e)}function IO(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],s=e[e.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[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(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var LO=Ax,$x=jx;const $O=LO,DO=f.forwardRef(({className:t,sideOffset:e=4,...n},r)=>m.jsx($x,{ref:r,sideOffset:e,className:We("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",t),...n}));DO.displayName=$x.displayName;function zO(){const{pathname:t,hash:e}=Qt();f.useEffect(()=>{e||window.scrollTo(0,0)},[t,e])}const FO="cronAdminToken";function UO(){var t;return typeof window>"u"?"":((t=window.localStorage.getItem(FO))==null?void 0:t.trim())??""}const Dm=!1;class yl extends Error{constructor(n,r){var o;super(`API request failed: ${n.status} ${n.statusText}`);Xt(this,"status");Xt(this,"statusText");Xt(this,"response");Xt(this,"detail");Xt(this,"code");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(o=JSON.parse(r))==null?void 0:o.detail,typeof this.detail=="string"&&(this.message=this.detail),typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const i="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${i}`}}catch{this.detail=void 0}}}class VO{constructor(e){this.baseUrl=e}async request(e,n){const r=`${this.baseUrl}${e}`;try{const{headers:o,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=UO(),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 yl(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 BO(t){try{return await t()}catch(e){throw e instanceof yl&&e.status===401&&e.code!=="fresh_auth_required"&&e.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale")),e}}const WO=new VO(`${Vf()}/api/v1`),$s=(t,e)=>BO(()=>WO.request(t,e));class HO{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}}const zm=new HO($s),ma="pwc:fresh-auth-mutation";function qO(t){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",t);const e=Jl("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class Dx{constructor(e,n=qO){Xt(this,"paperLoads",new Map);Xt(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=n}primePaper(e,n=!1){n&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(o=>{throw this.paperLoads.delete(e),o}),this.paperLoads.set(e,r)),r}primeEvaluations(e,n=!1){n&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(o=>{throw this.evaluationLoads.delete(e),o}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,n,r,o,i){const s=this.paperLoads.get(e);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:${e}:${n}`)}async mutateEvaluations(e,n,r,o){const i=this.evaluationLoads.get(String(e));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:${e}:evaluations`)}async mutate(e,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 yl&&u.status===401&&u.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,n,r,l),this.recoverFreshAuth(e)):u instanceof yl&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:n}}))),u}}freshAuthMutationDraft(){const e=sessionStorage.getItem(ma);if(!e)return null;try{const n=JSON.parse(e);if(!n.endpoint.startsWith("/")||n.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(n.options.method))throw new Error("Invalid saved mutation draft");return n}catch{return sessionStorage.removeItem(ma),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const n=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(ma),sessionStorage.removeItem("pwc:fresh-auth-edit"),n}saveFreshAuthMutation(e,n,r,o){const i=Object.fromEntries(new Headers(o.headers).entries()),s=typeof o.body=="string"?o.body:void 0;sessionStorage.setItem(ma,JSON.stringify({section:e,endpoint:n,payload:r,options:{method:(o.method??"POST").toUpperCase(),body:s,headers:i}}))}idempotencyHeaders(e,n,r){const o=`pwc:mutation:${e}:${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(e){const n=new Headers(e.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 en=new Dx($s);function Oi(t){const e=new URLSearchParams;for(const[r,o]of Object.entries(t??{}))o!==void 0&&o!==""&&e.set(r,String(o));const n=e.toString();return n?`?${n}`:""}class KO{constructor(e){this.request=e}list(e){const n=new URLSearchParams;for(const[o,i]of Object.entries(e??{}))i!==void 0&&i!==""&&n.set(o,String(i));const r=n.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,n=1,r=10,o,i){const s=new URLSearchParams({q:e,page:n.toString(),page_size:r.toString()});return o&&s.set("mode",o),this.request(`/papers/search?${s.toString()}`,{signal:i})}get(e,n=!0){const r=n?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,n=!0){const r=n?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}related(e,n=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${n}`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,n){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(n)})}trending(e){const n=new URLSearchParams;for(const[o,i]of Object.entries(e??{}))i!==void 0&&n.set(o,String(i));const r=n.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,n){return this.request(`/tasks/${e}/papers${Oi(n)}`)}forMethod(e,n){return this.request(`/methods/${encodeURIComponent(e)}/papers${Oi(n)}`)}forConference(e,n){return this.request(`/conferences/${e}/papers${Oi(n)}`)}forOrganization(e,n){return this.request(`/organizations/${e}/papers${Oi(n)}`)}getAuthor(e){return this.request(`/authors/${e}`)}authorPapers(e,n){return this.request(`/authors/${e}/papers${Oi(n)}`)}primeCurationState(e,n=!1){return en.primePaper(e,n)}freshAuthMutationDraft(){return en.freshAuthMutationDraft()}resumeFreshAuthMutation(){return en.resumeFreshAuthMutation()}updateTasks(e,n){const r=new URLSearchParams(n.map(o=>["task_ids",String(o)])).toString();return en.mutatePaper(e,"tasks",n,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,n){const r=new URLSearchParams(n.map(o=>["method_ids",String(o)])).toString();return en.mutatePaper(e,"methods",n,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,n){const r=new URLSearchParams(n.map(o=>["organization_ids",String(o)])).toString();return en.mutatePaper(e,"organizations",n,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,n){return en.mutatePaper(e,"repositories",n,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:n})})}updateProjectPages(e,n){return en.mutatePaper(e,"project_pages",n,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:n})})}updateSourceUrl(e,n){return en.mutatePaper(e,"source_url",n,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:n})})}updateHfArtifacts(e,n){return en.mutatePaper(e,"hf_artifacts",n,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(n)})}}const cc=new KO($s);var de;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},t.getValidEnumValues=o=>{const i=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(const a of i)s[a]=o[a];return t.objectValues(s)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},t.find=(o,i)=>{for(const s of o)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(de||(de={}));var Fm;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Fm||(Fm={}));const U=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jn=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}},M=de.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ln extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;ln.message){const n={},r=[];for(const o of this.issues)if(o.path.length>0){const i=o.path[0];n[i]=n[i]||[],n[i].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ln.create=t=>new Ln(t);const Rd=(t,e)=>{let n;switch(t.code){case M.invalid_type:t.received===U.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case M.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,de.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:n=`Unrecognized key(s) in object: ${de.joinValues(t.keys,", ")}`;break;case M.invalid_union:n="Invalid input";break;case M.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${de.joinValues(t.options)}`;break;case M.invalid_enum_value:n=`Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;break;case M.invalid_arguments:n="Invalid function arguments";break;case M.invalid_return_type:n="Invalid function return type";break;case M.invalid_date:n="Invalid date";break;case M.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:de.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case M.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case M.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case M.custom:n="Invalid input";break;case M.invalid_intersection_types:n="Intersection results could not be merged";break;case M.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case M.not_finite:n="Number must be finite";break;default:n=e.defaultError,de.assertNever(t)}return{message:n}};let GO=Rd;function ZO(){return GO}const QO=t=>{const{data:e,path:n,errorMaps:r,issueData:o}=t,i=[...n,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(s,{data:e,defaultError:a}).message;return{...o,path:i,message:a}};function z(t,e){const n=ZO(),r=QO({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Rd?void 0:Rd].filter(o=>!!o)});t.common.issues.push(r)}class rt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const o of n){if(o.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const o of n){const i=await o.key,s=await o.value;r.push({key:i,value:s})}return rt.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Q;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:e.value,value:r}}}const Q=Object.freeze({status:"aborted"}),Di=t=>({status:"dirty",value:t}),jt=t=>({status:"valid",value:t}),Um=t=>t.status==="aborted",Vm=t=>t.status==="dirty",ui=t=>t.status==="valid",wl=t=>typeof Promise<"u"&&t instanceof Promise;var B;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(B||(B={}));class pn{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Bm=(t,e)=>{if(ui(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ln(t.common.issues);return this._error=n,this._error}}};function re(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:o}}class ue{get description(){return this._def.description}_getType(e){return Jn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new rt,ctx:{common:e.parent.common,data:e.data,parsedType:Jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(wl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)},o=this._parseSync({data:e,path:r.path,parent:r});return Bm(r,o)}"~validate"(e){var r,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return ui(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(o=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>ui(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)},o=this._parse({data:e,path:r.path,parent:r}),i=await(wl(o)?o:Promise.resolve(o));return Bm(r,i)}refine(e,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=e(o),a=()=>i.addIssue({code:M.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new eo({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Tn.create(this,this._def)}nullable(){return to.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this)}promise(){return Cl.create(this,this._def)}or(e){return _l.create([this,e],this._def)}and(e){return Sl.create(this,e,this._def)}transform(e){return new eo({...re(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new kl({...re(this._def),innerType:this,defaultValue:n,typeName:Y.ZodDefault})}brand(){return new Vx({typeName:Y.ZodBranded,type:this,...re(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Pl({...re(this._def),innerType:this,catchValue:n,typeName:Y.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return vh.create(this,e)}readonly(){return Tl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const YO=/^c[^\s-]{8,}$/i,XO=/^[0-9a-z]+$/,JO=/^[0-9A-HJKMNP-TV-Z]{26}$/i,eA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,tA=/^[a-z0-9_-]{21}$/i,nA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rA=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,oA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,iA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let dc;const sA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,aA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,lA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,uA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zx="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fA=new RegExp(`^${zx}$`);function Fx(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function hA(t){return new RegExp(`^${Fx(t)}$`)}function pA(t){let e=`${zx}T${Fx(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function mA(t,e){return!!((e==="v4"||!e)&&sA.test(t)||(e==="v6"||!e)&&lA.test(t))}function gA(t,e){if(!nA.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function vA(t,e){return!!((e==="v4"||!e)&&aA.test(t)||(e==="v6"||!e)&&uA.test(t))}class kn extends ue{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:U.string,received:i.parsedType}),Q}const r=new rt;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.lengthi.value&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,a=e.data.lengthe.test(o),{validation:n,code:M.invalid_string,...B.errToObj(r)})}_addCheck(e){return new kn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...B.errToObj(e)})}url(e){return this._addCheck({kind:"url",...B.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...B.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...B.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...B.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...B.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...B.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...B.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...B.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...B.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...B.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...B.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...B.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...B.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...B.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...B.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...B.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...B.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...B.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...B.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...B.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...B.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...B.errToObj(n)})}nonempty(e){return this.min(1,B.errToObj(e))}trim(){return new kn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new kn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new kn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew kn({checks:[],typeName:Y.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...re(t)});function yA(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(t.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return i%s/10**o}class ci extends ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==U.number){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:U.number,received:i.parsedType}),Q}let r;const o=new rt;for(const i of this._def.checks)i.kind==="int"?de.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?yA(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.not_finite,message:i.message}),o.dirty()):de.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,B.toString(n))}gt(e,n){return this.setLimit("min",e,!1,B.toString(n))}lte(e,n){return this.setLimit("max",e,!0,B.toString(n))}lt(e,n){return this.setLimit("max",e,!1,B.toString(n))}setLimit(e,n,r,o){return new ci({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:B.toString(o)}]})}_addCheck(e){return new ci({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:B.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:B.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:B.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:B.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:B.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuee.kind==="int"||e.kind==="multipleOf"&&de.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.valuenew ci({checks:[],typeName:Y.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class xs extends ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==U.bigint)return this._getInvalidInput(e);let r;const o=new rt;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):de.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return z(n,{code:M.invalid_type,expected:U.bigint,received:n.parsedType}),Q}gte(e,n){return this.setLimit("min",e,!0,B.toString(n))}gt(e,n){return this.setLimit("min",e,!1,B.toString(n))}lte(e,n){return this.setLimit("max",e,!0,B.toString(n))}lt(e,n){return this.setLimit("max",e,!1,B.toString(n))}setLimit(e,n,r,o){return new xs({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:B.toString(o)}]})}_addCheck(e){return new xs({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:B.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew xs({checks:[],typeName:Y.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...re(t)});class Nd extends ue{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.boolean,received:r.parsedType}),Q}return jt(e.data)}}Nd.create=t=>new Nd({typeName:Y.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class xl extends ue{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:U.date,received:i.parsedType}),Q}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_date}),Q}const r=new rt;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()i.value&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):de.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:B.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:B.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew xl({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Y.ZodDate,...re(t)});class Wm extends ue{_parse(e){if(this._getType(e)!==U.symbol){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.symbol,received:r.parsedType}),Q}return jt(e.data)}}Wm.create=t=>new Wm({typeName:Y.ZodSymbol,...re(t)});class Od extends ue{_parse(e){if(this._getType(e)!==U.undefined){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.undefined,received:r.parsedType}),Q}return jt(e.data)}}Od.create=t=>new Od({typeName:Y.ZodUndefined,...re(t)});class Ad extends ue{_parse(e){if(this._getType(e)!==U.null){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.null,received:r.parsedType}),Q}return jt(e.data)}}Ad.create=t=>new Ad({typeName:Y.ZodNull,...re(t)});class Hm extends ue{constructor(){super(...arguments),this._any=!0}_parse(e){return jt(e.data)}}Hm.create=t=>new Hm({typeName:Y.ZodAny,...re(t)});class Md extends ue{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jt(e.data)}}Md.create=t=>new Md({typeName:Y.ZodUnknown,...re(t)});class Er extends ue{_parse(e){const n=this._getOrReturnCtx(e);return z(n,{code:M.invalid_type,expected:U.never,received:n.parsedType}),Q}}Er.create=t=>new Er({typeName:Y.ZodNever,...re(t)});class qm extends ue{_parse(e){if(this._getType(e)!==U.undefined){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.void,received:r.parsedType}),Q}return jt(e.data)}}qm.create=t=>new qm({typeName:Y.ZodVoid,...re(t)});class hn extends ue{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==U.array)return z(n,{code:M.invalid_type,expected:U.array,received:n.parsedType}),Q;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,a=n.data.lengtho.maxLength.value&&(z(n,{code:M.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>o.type._parseAsync(new pn(n,s,n.path,a)))).then(s=>rt.mergeArray(r,s));const i=[...n.data].map((s,a)=>o.type._parseSync(new pn(n,s,n.path,a)));return rt.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:B.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:B.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:B.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...re(e)});function xo(t){if(t instanceof je){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Tn.create(xo(r))}return new je({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:xo(t.element)}):t instanceof Tn?Tn.create(xo(t.unwrap())):t instanceof to?to.create(xo(t.unwrap())):t instanceof Xr?Xr.create(t.items.map(e=>xo(e))):t}class je extends ue{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=de.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==U.object){const u=this._getOrReturnCtx(e);return z(u,{code:M.invalid_type,expected:U.object,received:u.parsedType}),Q}const{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Er&&this._def.unknownKeys==="strip"))for(const u in o.data)s.includes(u)||a.push(u);const l=[];for(const u of s){const c=i[u],d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new pn(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Er){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:o.data[c]}});else if(u==="strict")a.length>0&&(z(o,{code:M.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new pn(o,d,o.path,c)),alwaysSet:c in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,p=await c.value;u.push({key:d,value:p,alwaysSet:c.alwaysSet})}return u}).then(u=>rt.mergeObjectSync(r,u)):rt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return B.errToObj,new je({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s;const o=((s=(i=this._def).errorMap)==null?void 0:s.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:B.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new je({...this._def,unknownKeys:"strip"})}passthrough(){return new je({...this._def,unknownKeys:"passthrough"})}extend(e){return new je({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new je({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Y.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new je({...this._def,catchall:e})}pick(e){const n={};for(const r of de.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new je({...this._def,shape:()=>n})}omit(e){const n={};for(const r of de.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new je({...this._def,shape:()=>n})}deepPartial(){return xo(this)}partial(e){const n={};for(const r of de.objectKeys(this.shape)){const o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new je({...this._def,shape:()=>n})}required(e){const n={};for(const r of de.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Tn;)i=i._def.innerType;n[r]=i}return new je({...this._def,shape:()=>n})}keyof(){return Ux(de.objectKeys(this.shape))}}je.create=(t,e)=>new je({shape:()=>t,unknownKeys:"strip",catchall:Er.create(),typeName:Y.ZodObject,...re(e)});je.strictCreate=(t,e)=>new je({shape:()=>t,unknownKeys:"strict",catchall:Er.create(),typeName:Y.ZodObject,...re(e)});je.lazycreate=(t,e)=>new je({shape:t,unknownKeys:"strip",catchall:Er.create(),typeName:Y.ZodObject,...re(e)});class _l extends ue{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(a=>new Ln(a.ctx.common.issues));return z(n,{code:M.invalid_union,unionErrors:s}),Q}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=s.map(l=>new Ln(l));return z(n,{code:M.invalid_union,unionErrors:a}),Q}}get options(){return this._def.options}}_l.create=(t,e)=>new _l({options:t,typeName:Y.ZodUnion,...re(e)});const wn=t=>t instanceof Id?wn(t.schema):t instanceof eo?wn(t.innerType()):t instanceof El?[t.value]:t instanceof Jr?t.options:t instanceof Ld?de.objectValues(t.enum):t instanceof kl?wn(t._def.innerType):t instanceof Od?[void 0]:t instanceof Ad?[null]:t instanceof Tn?[void 0,...wn(t.unwrap())]:t instanceof to?[null,...wn(t.unwrap())]:t instanceof Vx||t instanceof Tl?wn(t.unwrap()):t instanceof Pl?wn(t._def.innerType):[];class gh extends ue{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return z(n,{code:M.invalid_type,expected:U.object,received:n.parsedType}),Q;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(z(n,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const o=new Map;for(const i of n){const s=wn(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,i)}}return new gh({typeName:Y.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...re(r)})}}function jd(t,e){const n=Jn(t),r=Jn(e);if(t===e)return{valid:!0,data:t};if(n===U.object&&r===U.object){const o=de.objectKeys(e),i=de.objectKeys(t).filter(a=>o.indexOf(a)!==-1),s={...t,...e};for(const a of i){const l=jd(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===U.array&&r===U.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let i=0;i{if(Um(i)||Um(s))return Q;const a=jd(i.value,s.value);return a.valid?((Vm(i)||Vm(s))&&n.dirty(),{status:n.value,value:a.data}):(z(r,{code:M.invalid_intersection_types}),Q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Sl.create=(t,e,n)=>new Sl({left:t,right:e,typeName:Y.ZodIntersection,...re(n)});class Xr extends ue{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.array)return z(r,{code:M.invalid_type,expected:U.array,received:r.parsedType}),Q;if(r.data.lengththis._def.items.length&&(z(r,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new pn(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>rt.mergeArray(n,s)):rt.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Xr({...this._def,rest:e})}}Xr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xr({items:t,typeName:Y.ZodTuple,rest:null,...re(e)})};class bl extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return z(r,{code:M.invalid_type,expected:U.object,received:r.parsedType}),Q;const o=[],i=this._def.keyType,s=this._def.valueType;for(const a in r.data)o.push({key:i._parse(new pn(r,a,r.path,a)),value:s._parse(new pn(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?rt.mergeObjectAsync(n,o):rt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof ue?new bl({keyType:e,valueType:n,typeName:Y.ZodRecord,...re(r)}):new bl({keyType:kn.create(),valueType:e,typeName:Y.ZodRecord,...re(n)})}}class Km extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.map)return z(r,{code:M.invalid_type,expected:U.map,received:r.parsedType}),Q;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:o._parse(new pn(r,a,r.path,[u,"key"])),value:i._parse(new pn(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}}Km.create=(t,e,n)=>new Km({valueType:e,keyType:t,typeName:Y.ZodMap,...re(n)});class _s extends ue{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.set)return z(r,{code:M.invalid_type,expected:U.set,received:r.parsedType}),Q;const o=this._def;o.minSize!==null&&r.data.sizeo.maxSize.value&&(z(r,{code:M.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const u=new Set;for(const c of l){if(c.status==="aborted")return Q;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>i._parse(new pn(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new _s({...this._def,minSize:{value:e,message:B.toString(n)}})}max(e,n){return new _s({...this._def,maxSize:{value:e,message:B.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}_s.create=(t,e)=>new _s({valueType:t,minSize:null,maxSize:null,typeName:Y.ZodSet,...re(e)});class Id extends ue{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Id.create=(t,e)=>new Id({getter:t,typeName:Y.ZodLazy,...re(e)});class El extends ue{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return z(n,{received:n.data,code:M.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}}El.create=(t,e)=>new El({value:t,typeName:Y.ZodLiteral,...re(e)});function Ux(t,e){return new Jr({values:t,typeName:Y.ZodEnum,...re(e)})}class Jr extends ue{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return z(n,{expected:de.joinValues(r),received:n.parsedType,code:M.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return z(n,{received:n.data,code:M.invalid_enum_value,options:r}),Q}return jt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Jr.create(e,{...this._def,...n})}exclude(e,n=this._def){return Jr.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Jr.create=Ux;class Ld extends ue{_parse(e){const n=de.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==U.string&&r.parsedType!==U.number){const o=de.objectValues(n);return z(r,{expected:de.joinValues(o),received:r.parsedType,code:M.invalid_type}),Q}if(this._cache||(this._cache=new Set(de.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=de.objectValues(n);return z(r,{received:r.data,code:M.invalid_enum_value,options:o}),Q}return jt(e.data)}get enum(){return this._def.values}}Ld.create=(t,e)=>new Ld({values:t,typeName:Y.ZodNativeEnum,...re(e)});class Cl extends ue{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.promise&&n.common.async===!1)return z(n,{code:M.invalid_type,expected:U.promise,received:n.parsedType}),Q;const r=n.parsedType===U.promise?n.data:Promise.resolve(n.data);return jt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Cl.create=(t,e)=>new Cl({type:t,typeName:Y.ZodPromise,...re(e)});class eo extends ue{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:s=>{z(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return Q;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Q:l.status==="dirty"||n.value==="dirty"?Di(l.value):l});{if(n.value==="aborted")return Q;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?Q:a.status==="dirty"||n.value==="dirty"?Di(a.value):a}}if(o.type==="refinement"){const s=a=>{const l=o.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Q:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Q:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ui(s))return Q;const a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ui(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:n.value,value:a})):Q);de.assertNever(o)}}eo.create=(t,e,n)=>new eo({schema:t,typeName:Y.ZodEffects,effect:e,...re(n)});eo.createWithPreprocess=(t,e,n)=>new eo({schema:e,effect:{type:"preprocess",transform:t},typeName:Y.ZodEffects,...re(n)});class Tn extends ue{_parse(e){return this._getType(e)===U.undefined?jt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tn.create=(t,e)=>new Tn({innerType:t,typeName:Y.ZodOptional,...re(e)});class to extends ue{_parse(e){return this._getType(e)===U.null?jt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}to.create=(t,e)=>new to({innerType:t,typeName:Y.ZodNullable,...re(e)});class kl extends ue{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===U.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}kl.create=(t,e)=>new kl({innerType:t,typeName:Y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});class Pl extends ue{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return wl(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ln(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ln(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pl.create=(t,e)=>new Pl({innerType:t,typeName:Y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class Gm extends ue{_parse(e){if(this._getType(e)!==U.nan){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.nan,received:r.parsedType}),Q}return{status:"valid",value:e.data}}}Gm.create=t=>new Gm({typeName:Y.ZodNaN,...re(t)});class Vx extends ue{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class vh extends ue{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Q:i.status==="dirty"?(n.dirty(),Di(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Q:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new vh({in:e,out:n,typeName:Y.ZodPipeline})}}class Tl extends ue{_parse(e){const n=this._def.innerType._parse(e),r=o=>(ui(o)&&(o.value=Object.freeze(o.value)),o);return wl(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Tl.create=(t,e)=>new Tl({innerType:t,typeName:Y.ZodReadonly,...re(e)});var Y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Y||(Y={}));const H=kn.create,Ae=ci.create,Rl=Nd.create,wA=Md.create;Er.create;const Ve=hn.create,ve=je.create,xA=_l.create,Bx=gh.create;Sl.create;Xr.create;const Wx=bl.create,ja=El.create,$d=Jr.create;Cl.create;Tn.create;to.create;const Rn=Wx(wA()),yh=ve({id:Ae(),name:H(),slug:H().optional()}).passthrough(),Nl=ve({url:H(),is_official:Rl()}),Dd=ve({task_id:Ae(),dataset_id:Ae(),model_name:H().nullish(),harness:H().nullish(),methodology:H().nullish(),metrics:Wx(xA([H(),Ae()])),uses_additional_data:Rl().optional(),is_open:Rl().optional(),best_rank:Ae().nullish(),best_metric:H().nullish(),evaluated_on:H().nullish(),external_source_url:H().nullish(),num_parameters:Ae().nullish(),hf_model_url:H().nullish()}).passthrough(),_A=Dd.partial().extend({id:Ae().optional()}),SA=Bx("op",[ve({op:ja("create"),data:Dd}),ve({op:ja("update"),evaluation_id:Ae(),data:Dd}),ve({op:ja("delete"),evaluation_id:Ae()})]),Zm=ve({hf_models:Ve(H()),hf_datasets:Ve(H()),hf_spaces:Ve(H())}),Hx=ve({file_name:H(),mime_type:H(),data_url:H().optional(),url:H().optional()}),Ds=ve({name:H(),description:H().optional()}),bA=Ds.extend({image:Hx.optional(),image_credit:H().optional(),parent_id:Ae().optional(),area_id:Ae().optional(),keywords:H().optional()}),EA=Ds.extend({image:Hx.optional(),image_credit:H().optional(),source_paper_id:Ae().optional(),source_url:H().optional(),source_title:H().optional()}),CA=Ds.extend({description:H(),task_ids:Ve(Ae()),full_name:H().optional(),url:H().optional(),hf_url:H().optional(),paper_url:H().optional(),license_name:H().optional(),license_url:H().optional()}),kA=Ds.extend({description:H(),direction:$d(["higher_is_better","lower_is_better"]),full_name:H().optional(),scale:H().optional(),task_id:Ae(),dataset_id:Ae()}),PA=Ds.extend({short_name:H().optional(),venue:H().optional(),location:H().optional(),url:H(),year:Ae(),start_date:H().optional(),end_date:H().optional()}),TA=ve({id:Ae(),paper_id:Ae().nullable(),hf_username:H(),is_author:Rl(),status:$d(["pending","approved","rejected"]),applied_payload:Rn.nullish(),conflict_payload:Rn.nullish(),result_entity_type:H().nullish(),result_entity_id:H().nullish(),admin_note:H().nullish(),user_review_reason:H().nullish(),reviewed_by:H().nullish(),reviewed_by_kind:$d(["human","codex"]).nullish(),review_evidence:Rn.nullish(),created_at:H(),updated_at:H(),reviewed_at:H().nullish()});function pt(t,e,n){return TA.extend({edit_type:ja(t),proposed_payload:e,current_payload:n.nullish()})}const RA=pt("tasks",ve({task_ids:Ve(Ae())}),ve({tasks:Ve(yh)})),NA=pt("methods",ve({method_ids:Ve(Ae())}),ve({methods:Ve(yh)})),OA=pt("evaluations",ve({operations:Ve(SA)}),ve({evaluations:Ve(_A)})),AA=pt("repositories",ve({repositories:Ve(Nl)}),ve({repositories:Ve(Nl)})),MA=pt("project_pages",ve({project_pages:Ve(Nl)}),ve({project_pages:Ve(Nl)})),jA=pt("source_url",ve({source_url:H()}),ve({source_url:H().nullish()})),IA=pt("hf_artifacts",Zm,Zm),LA=pt("organizations",ve({organization_ids:Ve(Ae())}),ve({organizations:Ve(yh)})),$A=pt("new_task",bA,Rn),DA=pt("new_method",EA,Rn),zA=pt("new_benchmark",CA,Rn),FA=pt("new_metric",kA,Rn),UA=pt("new_conference",PA,Rn),VA=pt("new_external_paper",ve({title:H().optional(),source_url:H(),authors:Ve(H()),date_published:H().optional(),abstract:H().optional()}),Rn),qx=Bx("edit_type",[RA,NA,OA,AA,MA,jA,IA,LA,$A,DA,zA,FA,UA,VA]);function XM(t,e,n){return{paper_id:t,edit_type:e,proposed_payload:n}}const BA=ve({count:Ae(),results:Ve(qx)});class WA extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Kx(t,e){const n=t.safeParse(e);if(n.success)return n.data;const r=n.error.issues[0];throw new WA(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const ga=t=>Kx(qx,t),HA=t=>Kx(BA,t);class qA{constructor(e){this.request=e}async submit(e){return ga(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const n=new URLSearchParams;for(const[o,i]of Object.entries(e??{}))i!==void 0&&n.set(o,String(i));const r=n.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(HA)}async get(e){return ga(await this.request(`/admin/paper-edits/${e}`))}async approve(e,n={}){return ga(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(n)}))}async reject(e,n={}){return ga(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(n)}))}}const Ai=new qA($s);class KA{constructor(){Xt(this,"curation");this.curation=new Dx((e,n)=>this.request(e,n))}async request(e,n){return $s(e,n)}async getPapers(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.search&&n.append("search",e.search),e!=null&&e.order_by&&n.append("order_by",e.order_by),e!=null&&e.order_dir&&n.append("order_dir",e.order_dir),e!=null&&e.time&&n.append("time",e.time),e!=null&&e.published_after&&n.append("published_after",e.published_after),e!=null&&e.published_before&&n.append("published_before",e.published_before),e!=null&&e.conference&&n.append("conference",e.conference),(e==null?void 0:e.latest_only)!==void 0&&n.append("latest_only",e.latest_only.toString()),(e==null?void 0:e.include_resources)!==void 0&&n.append("include_resources",e.include_resources.toString()),(e==null?void 0:e.has_code)!==void 0&&n.append("has_code",e.has_code.toString()),(e==null?void 0:e.has_hf_artifacts)!==void 0&&n.append("has_hf_artifacts",e.has_hf_artifacts.toString()),e!=null&&e.framework&&n.append("framework",e.framework),e!=null&&e.repository&&n.append("repository",e.repository);const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(e,n=1,r=10,o,i){return cc.search(e,n,r,o,i)}async getPaper(e,n=!0){return cc.get(e,n)}async getPaperByArxivId(e,n=!0){return cc.getByArxivId(e,n)}async getRelatedPapers(e,n=4){const r=new URLSearchParams({limit:n.toString()});return this.request(`/papers/${encodeURIComponent(e)}/related?${r.toString()}`)}async indexPaperFromArxiv(e){const n=`/papers/index/${e}`;return this.request(n,{method:"POST"})}async submitPaper(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}primePaperCurationState(e,n=!1){return this.curation.primePaper(e,n)}primeEvaluationCurationState(e,n=!1){return this.curation.primeEvaluations(e,n)}freshAuthMutationDraft(){return this.curation.freshAuthMutationDraft()}resumeFreshAuthMutation(){return this.curation.resumeFreshAuthMutation()}async updatePaperTasks(e,n){const r=new URLSearchParams;n.forEach(i=>r.append("task_ids",i.toString()));const o=`/papers/${e}/tasks?${r.toString()}`;return this.curation.mutatePaper(e,"tasks",n,o,{method:"PUT"})}async updatePaperMethods(e,n){const r=new URLSearchParams;n.forEach(i=>r.append("method_ids",i.toString()));const o=`/papers/${e}/methods?${r.toString()}`;return this.curation.mutatePaper(e,"methods",n,o,{method:"PUT"})}async updatePaperOrganizations(e,n){const r=new URLSearchParams;n.forEach(i=>r.append("organization_ids",i.toString()));const o=`/papers/${e}/organizations?${r.toString()}`;return this.curation.mutatePaper(e,"organizations",n,o,{method:"PUT"})}async updatePaperRepositories(e,n){const r=`/papers/${e}/repositories`;return this.curation.mutatePaper(e,"repositories",n,r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(e,n){const r=`/papers/${e}/project-pages`;return this.curation.mutatePaper(e,"project_pages",n,r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(e,n){const r=`/papers/${e}/source-url`;return this.curation.mutatePaper(e,"source_url",n,r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(e,n){const r=`/papers/${e}/hf-artifacts`;return this.curation.mutatePaper(e,"hf_artifacts",n,r,{method:"PUT",body:JSON.stringify(n)})}async getTrendingPapers(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString()),e!=null&&e.max_age_days&&n.append("max_age_days",e.max_age_days.toString()),(e==null?void 0:e.min_velocity)!==void 0&&n.append("min_velocity",e.min_velocity.toString());const r=`/papers/trending${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getRepositoriesForPaper(e){return this.request(`/papers/${e}/repositories`)}async getRepositories(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.owner&&n.append("owner",e.owner),e!=null&&e.official_only&&n.append("official_only",e.official_only.toString()),e!=null&&e.min_stars&&n.append("min_stars",e.min_stars.toString()),e!=null&&e.source&&n.append("source",e.source),e!=null&&e.order_by&&n.append("order_by",e.order_by),e!=null&&e.order_dir&&n.append("order_dir",e.order_dir);const r=`/repositories/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getProjectPagesForPaper(e){return this.request(`/papers/${e}/project-pages`)}async getProjectPages(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.official_only&&n.append("official_only",e.official_only.toString()),e!=null&&e.source&&n.append("source",e.source),e!=null&&e.order_by&&n.append("order_by",e.order_by),e!=null&&e.order_dir&&n.append("order_dir",e.order_dir);const r=`/project-pages/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthors(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString()),e!=null&&e.offset&&n.append("offset",e.offset.toString()),e!=null&&e.search&&n.append("search",e.search),e!=null&&e.sort_by&&n.append("sort_by",e.sort_by),e!=null&&e.sort_order&&n.append("sort_order",e.sort_order);const r=`/authors${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthor(e){return this.request(`/authors/${e}`)}async getAuthorPapers(e,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/${e}/papers${o?`?${o}`:""}`)}async getAreas(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/areas/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getArea(e){return this.request(`/areas/${e}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getConferences(){return this.request("/conferences/")}async getConferenceDeadlines(){return this.request("/conferences/deadlines")}async getConference(e){return this.request(`/conferences/${e}`)}async getConferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}async getConferencePapers(e,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/${e}/papers?${o}`:`/conferences/${e}/papers`;return this.request(i)}async getOrganizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}async getOrganization(e){return this.request(`/organizations/${e}`)}async getOrganizationContributions(e){return this.request(`/organizations/${e}/contributions`)}async getOrganizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}async getOrganizationPapers(e,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/${e}/papers?${o}`:`/organizations/${e}/papers`;return this.request(i)}async getAreaTasks(e,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/${e}/tasks${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTasks(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.area_id&&n.append("area_id",e.area_id.toString()),e!=null&&e.parent_id&&n.append("parent_id",e.parent_id.toString()),(e==null?void 0:e.level)!==void 0&&n.append("level",e.level.toString()),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/tasks/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getTask(e){return this.request(`/tasks/${e}`)}async getFrameworkCatalog(){return this.request("/frameworks/")}async getTopTasks(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString());const r=n.toString(),o=r?`/tasks/top?${r}`:"/tasks/top";return this.request(o)}async getTrendingTasks(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString()),e!=null&&e.recent_days&&n.append("recent_days",e.recent_days.toString()),e!=null&&e.baseline_days&&n.append("baseline_days",e.baseline_days.toString()),(e==null?void 0:e.level)!==void 0&&n.append("level",e.level.toString()),(e==null?void 0:e.min_recent_papers)!==void 0&&n.append("min_recent_papers",e.min_recent_papers.toString()),(e==null?void 0:e.min_baseline_papers)!==void 0&&n.append("min_baseline_papers",e.min_baseline_papers.toString()),(e==null?void 0:e.min_share_lift)!==void 0&&n.append("min_share_lift",e.min_share_lift.toString());const r=n.toString(),o=r?`/tasks/trending?${r}`:"/tasks/trending";return this.request(o)}async getTaskChildren(e,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/${e}/children${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTaskParents(e){return this.request(`/tasks/${e}/parents`)}async getTaskPage(e,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/${e}/page${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTrendingBenchmarks(e,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(e)}/trending-benchmarks${o?`?${o}`:""}`;return this.request(i)}async getTaskPapers(e,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/${e}/papers?${o}`:`/tasks/${e}/papers`;return this.request(i)}async getMethods(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.full_name&&n.append("full_name",e.full_name),e!=null&&e.introduced_year&&n.append("introduced_year",e.introduced_year.toString()),(e==null?void 0:e.area_id)!==void 0&&n.append("area_id",e.area_id.toString()),(e==null?void 0:e.exclude_id)!==void 0&&n.append("exclude_id",e.exclude_id.toString()),(e==null?void 0:e.include_trends)!==void 0&&n.append("include_trends",e.include_trends.toString()),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/methods/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}async getMethodTrend(e,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(e)}/trend${o?`?${o}`:""}`)}async getMethodPapers(e,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(e)}/papers?${o}`:`/methods/${encodeURIComponent(e)}/papers`;return this.request(i)}async getDatasets(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.full_name&&n.append("full_name",e.full_name),e!=null&&e.task&&n.append("task",e.task),e!=null&&e.task_id&&n.append("task",e.task_id.toString()),e!=null&&e.include_descendants&&n.append("include_descendants","true"),(e==null?void 0:e.min_eval_count)!==void 0&&n.append("min_eval_count",e.min_eval_count.toString()),(e==null?void 0:e.is_open)!==void 0&&n.append("is_open",e.is_open.toString()),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/datasets/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getDataset(e){return this.request(`/datasets/${e}`)}async getDatasetBySlug(e,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/${e}${o}`)}async getDatasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async getLeaderboardMetrics(e,n){return(await this.request(`/datasets/${e}/tasks/${n}/metrics`)).metrics}async getEvaluations(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.paper_id&&n.append("paper_id",e.paper_id.toString()),e!=null&&e.task_id&&n.append("task_id",e.task_id.toString()),e!=null&&e.include_descendants&&n.append("include_descendants","true"),e!=null&&e.dataset_id&&n.append("dataset_id",e.dataset_id.toString()),e!=null&&e.best_metric&&n.append("best_metric",e.best_metric),(e==null?void 0:e.external)!==void 0&&n.append("external",String(e.external)),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/evaluations/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getEvaluation(e){return this.request(`/evaluations/${e}`)}async getEvaluationsByPaper(e){const r=parseInt(e),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(e,n){const o=parseInt(e),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(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}async updateEvaluation(e,n){const r=`/evaluations/${e}`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async deleteEvaluation(e){const n=`/evaluations/${e}`;return this.request(n,{method:"DELETE"})}async batchEvaluations(e,n){return this.curation.mutateEvaluations(e,n,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:n})})}async generateThumbnail(e){const n=$r(`/api/thumbnails/generate/${e}`),r=await fetch(n,{method:"POST"});if(!r.ok)throw new Error(`Thumbnail generation failed: ${r.status}`);return await r.json()}async getThumbnailStatus(e){const n=$r(`/api/thumbnails/status/${e}`),r=await fetch(n);if(!r.ok)throw new Error(`Thumbnail status check failed: ${r.status}`);return await r.json()}async healthCheck(){const e=$r("/health"),n=await fetch(e);if(!n.ok)throw new Error(`Health check failed: ${n.status}`);return await n.json()}async getMetrics(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.direction&&n.append("direction",e.direction),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/metrics/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMetric(e){return this.request(`/metrics/${e}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(e){return Ai.submit(e)}async listPendingPaperEdits(e){return Ai.list(e)}async getPendingPaperEdit(e){return Ai.get(e)}async approvePendingPaperEdit(e,n){return Ai.approve(e,n)}async rejectPendingPaperEdit(e,n){return Ai.reject(e,n)}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"POST"})}async removeBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}async getMyPreferences(){return zm.getPreferences()}async updateMyPreferences(e){return zm.updatePreferences(e)}async getOpenRouterUsage(){return this.request("/chat/usage",{cache:"no-store"})}async getChatAvailability(){return this.request("/chat/availability",{cache:"no-store"})}async prewarmChatPaperContext(e){const n=await fetch($r("/api/v1/chat/paper-context/prewarm"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"});if(!n.ok)throw new Error(`Paper context prewarm failed (${n.status})`)}async getChatSandboxSpend(e){const n=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${n}`,{cache:"no-store"})}async getChatWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}async getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}async connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}async setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}async disconnectOpenRouterCredential(){await this.request("/chat/openrouter-key",{method:"DELETE"})}async getCronStatus(e=!1){const n=e?"?force_refresh=true":"";return this.request(`/cron/status${n}`,{cache:"no-store"})}async getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}async getMyContributions(e){const n=e?`?cursor=${encodeURIComponent(e)}`:"";return this.request(`/contributions${n}`)}async getCatalogAudit(e){const n=e?`?cursor=${encodeURIComponent(e)}`:"";return this.request(`/admin/catalog-audit${n}`)}async acknowledgeCatalogAudit(){await this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}async rollbackCatalogEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const C=new KA;C.getPapers.bind(C);C.getPaper.bind(C);C.getPaperByArxivId.bind(C);C.indexPaperFromArxiv.bind(C);C.submitPaper.bind(C);C.updatePaperTasks.bind(C);C.updatePaperMethods.bind(C);C.updatePaperOrganizations.bind(C);C.updatePaperRepositories.bind(C);C.updatePaperProjectPages.bind(C);C.updatePaperSourceUrl.bind(C);C.updatePaperHfArtifacts.bind(C);C.primePaperCurationState.bind(C);C.primeEvaluationCurationState.bind(C);C.getTrendingPapers.bind(C);C.getRepositoriesForPaper.bind(C);C.getRepositories.bind(C);C.getProjectPagesForPaper.bind(C);C.getProjectPages.bind(C);C.getAuthors.bind(C);C.getAuthor.bind(C);C.getAreas.bind(C);C.getArea.bind(C);C.getAreasWithTasks.bind(C);C.getConferences.bind(C);C.getConferenceDeadlines.bind(C);C.getConference.bind(C);C.getConferenceAreasWithTasks.bind(C);C.getConferencePapers.bind(C);C.getOrganizations.bind(C);C.getOrganization.bind(C);C.getOrganizationContributions.bind(C);C.getOrganizationAreasWithTasks.bind(C);C.getOrganizationPapers.bind(C);C.getAreaTasks.bind(C);C.getTasks.bind(C);C.getTask.bind(C);C.getTopTasks.bind(C);C.getTrendingTasks.bind(C);C.getTaskChildren.bind(C);C.getTaskParents.bind(C);C.getTaskPage.bind(C);C.getTaskPapers.bind(C);C.getMethods.bind(C);C.getMethod.bind(C);C.getMethodPapers.bind(C);C.getDatasets.bind(C);C.getDataset.bind(C);C.getDatasetBySlug.bind(C);C.getDatasetTasks.bind(C);C.getLeaderboardMetrics.bind(C);C.getEvaluations.bind(C);C.getEvaluation.bind(C);C.getEvaluationsByPaper.bind(C);C.getEvaluationsByDataset.bind(C);C.createEvaluation.bind(C);C.updateEvaluation.bind(C);C.deleteEvaluation.bind(C);C.batchEvaluations.bind(C);C.generateThumbnail.bind(C);C.getThumbnailStatus.bind(C);C.getMetrics.bind(C);C.getMetric.bind(C);C.getMetricDirections.bind(C);C.getResearchTrends.bind(C);C.healthCheck.bind(C);C.getMyBookmarkIds.bind(C);C.getMyBookmarks.bind(C);C.addBookmark.bind(C);C.getMyPreferences.bind(C);C.updateMyPreferences.bind(C);C.submitPendingPaperEdit.bind(C);C.listPendingPaperEdits.bind(C);C.getPendingPaperEdit.bind(C);C.approvePendingPaperEdit.bind(C);C.rejectPendingPaperEdit.bind(C);C.removeBookmark.bind(C);const fc={hide_closed_source_evals:!1},Gx=T.createContext(null),GA=({children:t})=>{const{user:e}=dh(),[n,r]=T.useState(fc),[o,i]=T.useState(!1);T.useEffect(()=>{let l=!1;if(!e){r(fc);return}return i(!0),C.getMyPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(fc)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[e]);const s=T.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await C.updateMyPreferences(u);r(c)}catch{r(n)}},[n,e]),a=T.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:o,setHideClosedSourceEvals:s}),[n,e,o,s]);return m.jsx(Gx.Provider,{value:a,children:t})};function JM(){const t=T.useContext(Gx);if(!t)throw new Error("usePreferences must be used inside a ");return t}const Zx=CE(),ZA=Zx?B1:V1;if(!Zx&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const QA=T.lazy(()=>he(()=>import("./FeedView-Dd-lH8Q-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))),YA=T.lazy(()=>he(()=>import("./ChatView-CgnMUN-T.js"),__vite__mapDeps([18,10,19,8,9,3,4,20,21,22,23,24,25,12,26]))),XA=T.lazy(()=>he(()=>import("./SharedChatView-5e3UDn1a.js"),__vite__mapDeps([27,10,19,8,9,3,4,20,21,22,23,24,25]))),JA=T.lazy(()=>he(()=>import("./PapersListView-U1p3L-FQ.js"),__vite__mapDeps([28,1,2,3,4,5,6,11,13,10,14,29,15,7,16,17]))),eM=T.lazy(()=>he(()=>import("./PaperDetailView-D3_ZsBvI.js"),__vite__mapDeps([30,10,1,2,3,4,5,6,31,20,32,33,13,14,16,17,34,35,36,37,38,11,39,40,41,42,21,22,43,24]))),tM=T.lazy(()=>he(()=>import("./TagsIndexView-XFOoHwb9.js"),__vite__mapDeps([44,10,11,5,16,17,45,39,34,36,37,38,40]))),nM=T.lazy(()=>he(()=>import("./TagBrowseView-CEaJ7wkX.js"),__vite__mapDeps([46,10,1,2,3,4,5,6,47,7,48,23,24,20,11,13,14,16,17,9,22]))),rM=T.lazy(()=>he(()=>import("./MethodsIndexView-CKTQ6cDe.js"),__vite__mapDeps([49,10,11,50,16,17,45,39,34,36,37,38,40]))),oM=T.lazy(()=>he(()=>import("./FrameworksIndexView-Ch67e2Te.js"),__vite__mapDeps([51,10,1,2,3,4,5,6,11]))),iM=T.lazy(()=>he(()=>import("./TrendsView-C5JngdLN.js"),__vite__mapDeps([52,10,17,16]))),sM=T.lazy(()=>he(()=>import("./ConferencesIndexView-1eSAeZYb.js"),__vite__mapDeps([53,10,11,16,17,45,39,34,36,37,38,40]))),aM=T.lazy(()=>he(()=>import("./AiDeadlinesView-DN11lHYR.js"),__vite__mapDeps([54,10,11,55,35,16,17,6,37]))),lM=T.lazy(()=>he(()=>import("./ConferenceDetailView-DYomCgtB.js"),__vite__mapDeps([56,10,48,3,4,23,24,20,11,5,16,17,6]))),uM=T.lazy(()=>he(()=>import("./ConferenceTaskView-mNatIt13.js"),__vite__mapDeps([57,10,1,2,3,4,5,6,7,48,23,24,20,11,13,14,16,17]))),cM=T.lazy(()=>he(()=>import("./OrganizationsIndexView-BnLo3hfA.js"),__vite__mapDeps([58,10,17,16,11,59]))),dM=T.lazy(()=>he(()=>import("./OrganizationDetailView-CwAChot3.js"),__vite__mapDeps([60,61,10,1,2,3,4,5,6,48,23,24,20,62,16,11,7,17,41,34,37,40,13,14,63]))),fM=T.lazy(()=>he(()=>import("./OrganizationTaskView-Dp5482-s.js"),__vite__mapDeps([64,61,10,1,2,3,4,5,6,48,23,24,20,62,16,11,7,17,41,34,37,40,13,14,63]))),hM=T.lazy(()=>he(()=>import("./AuthorDetailView-DDFAChyR.js"),__vite__mapDeps([65,10,16,63]))),pM=T.lazy(()=>he(()=>import("./MethodDetailView-CfP7e-SP.js"),__vite__mapDeps([66,10,14,1,2,3,4,5,6,7,48,23,24,20,11,50,16,17]))),mM=T.lazy(()=>he(()=>import("./BenchmarkDetailView-DL9QgA3B.js"),__vite__mapDeps([67,10,11,31,20,6,32,16,55,35,17,2,3,4,47,1,5,68]))),gM=T.lazy(()=>he(()=>import("./SavedPapersView-VCnhdKfX.js"),__vite__mapDeps([69,10,1,2,3,4,5,6,16,17,43]))),vM=T.lazy(()=>he(()=>import("./SettingsView-CDI6bQH7.js"),__vite__mapDeps([70,38,55,35,33,26,10,71]))),yM=T.lazy(()=>he(()=>import("./PrivacyView-CTPtZXFS.js"),__vite__mapDeps([72,33]))),wM=T.lazy(()=>he(()=>import("./SubmitView-rnoDJcn0.js"),__vite__mapDeps([73,38,17,34,36]))),xM=T.lazy(()=>he(()=>import("./CronDashboard-BWvUvwNE.js"),__vite__mapDeps([74,10,42,34,9,25,75,40,76,71,38,14,11,77]))),_M=T.lazy(()=>he(()=>import("./SubmissionsDashboard-C_oeE-yO.js"),__vite__mapDeps([78,10,38,11,6,75,40,76]))),SM=T.lazy(()=>he(()=>import("./UserProfileView-CNXz88Hn.js"),__vite__mapDeps([79,10,62,16,11]))),bM=T.lazy(()=>he(()=>import("./RateLimitsView-Bztx-Hl-.js"),__vite__mapDeps([80,10]))),Qm=T.lazy(()=>he(()=>import("./NotFound-C0O3bfE-.js"),[])),EM=T.lazy(()=>he(()=>import("./SearchOverlay-D86Q6M8C.js"),__vite__mapDeps([81,10,2,3,4,11,29,5]))),CM=T.lazy(()=>he(()=>import("./StagingAccessRequestView-CaYzuGTH.js"),__vite__mapDeps([82,76]))),Ym=()=>m.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),m.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),kM=new SE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),PM=()=>{const{arxivId:t}=Oy();return m.jsx(ii,{to:t?`/paper/${t}`:"/papers",replace:!0})},TM=()=>{const{taskSlug:t}=Oy();return m.jsx(ii,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},Xm=({element:t})=>Os()?m.jsx(ii,{to:"/",replace:!0}):m.jsx(m.Fragment,{children:t}),RM=({element:t})=>{const{user:e,isLoading:n}=dh();return Os()?m.jsx(ii,{to:"/",replace:!0}):n?m.jsx("div",{className:"page",children:m.jsx("div",{className:"submission-loading",children:m.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?m.jsx(m.Fragment,{children:t}):m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-empty submission-empty-warn",children:[m.jsx("h1",{children:"Admin access required"}),m.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-empty submission-empty-warn",children:[m.jsx("h1",{children:"Sign in required"}),m.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),m.jsx(Gy,{returnTo:"/admin-dashboard"})]})})},NM=()=>{const t=EE(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return T.useEffect(()=>{e&&window.location.replace(t)},[t,e]),e?m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-loading",children:[m.jsx("span",{children:"Opening the production admin dashboard..."}),m.jsx("a",{href:t,children:"Continue"})]})}):m.jsx(RM,{element:m.jsx(xM,{})})},OM=()=>{const[t,e]=T.useState(!1),n=Qt();return zO(),T.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),T.useEffect(()=>{const r=o=>{(o.metaKey||o.ctrlKey)&&o.key==="k"&&(o.preventDefault(),e(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?m.jsx(T.Suspense,{fallback:m.jsx(Ym,{}),children:m.jsx(CM,{})}):m.jsxs(m.Fragment,{children:[m.jsx(cN,{onOpenSearch:()=>e(!0)}),m.jsx("main",{children:m.jsx(T.Suspense,{fallback:m.jsx(Ym,{}),children:m.jsxs(M1,{children:[m.jsx(ce,{path:"/",element:m.jsx(QA,{})}),m.jsx(ce,{path:"/chat/:sessionId?",element:cl()?m.jsx(YA,{}):m.jsx(ii,{to:"/",replace:!0})}),m.jsx(ce,{path:"/share/:shareId",element:cl()?m.jsx(XA,{}):m.jsx(Qm,{})}),m.jsx(ce,{path:"/papers",element:m.jsx(JA,{})}),m.jsx(ce,{path:"/papers/:arxivId",element:m.jsx(PM,{})}),m.jsx(ce,{path:"/paper/:arxivId",element:m.jsx(eM,{})}),m.jsx(ce,{path:"/tasks",element:m.jsx(tM,{})}),m.jsx(ce,{path:"/tasks/:taskSlug",element:m.jsx(nM,{})}),m.jsx(ce,{path:"/task/:taskSlug",element:m.jsx(TM,{})}),m.jsx(ce,{path:"/methods",element:m.jsx(rM,{})}),m.jsx(ce,{path:"/methods/:methodSlug",element:m.jsx(pM,{})}),m.jsx(ce,{path:"/frameworks",element:m.jsx(oM,{})}),m.jsx(ce,{path:"/trends",element:m.jsx(iM,{})}),m.jsx(ce,{path:"/conferences",element:m.jsx(sM,{})}),m.jsx(ce,{path:"/ai-deadlines",element:m.jsx(aM,{})}),m.jsx(ce,{path:"/conferences/:confSlug",element:m.jsx(lM,{})}),m.jsx(ce,{path:"/conferences/:confSlug/:taskSlug",element:m.jsx(uM,{})}),m.jsx(ce,{path:"/organizations",element:m.jsx(cM,{})}),m.jsx(ce,{path:"/orgs/:orgSlug",element:m.jsx(dM,{})}),m.jsx(ce,{path:"/orgs/:orgSlug/:taskSlug",element:m.jsx(fM,{})}),m.jsx(ce,{path:"/authors/:authorId",element:m.jsx(hM,{})}),m.jsx(ce,{path:"/benchmark/:datasetSlug",element:m.jsx(mM,{})}),m.jsx(ce,{path:"/submit",element:m.jsx(wM,{})}),m.jsx(ce,{path:"/saved",element:m.jsx(Xm,{element:m.jsx(gM,{})})}),m.jsx(ce,{path:"/settings",element:m.jsx(vM,{})}),m.jsx(ce,{path:"/privacy",element:m.jsx(yM,{})}),m.jsx(ce,{path:"/admin-dashboard",element:m.jsx(NM,{})}),m.jsx(ce,{path:"/cron-dashboard",element:m.jsx(ii,{to:"/admin-dashboard",replace:!0})}),m.jsx(ce,{path:"/submissions",element:m.jsx(Xm,{element:m.jsx(_M,{})})}),m.jsx(ce,{path:"/rate-limits",element:m.jsx(bM,{})}),m.jsx(ce,{path:"/:username",element:m.jsx(SM,{})}),m.jsx(ce,{path:"*",element:m.jsx(Qm,{})})]})})}),m.jsx(dN,{}),t&&m.jsx(T.Suspense,{fallback:null,children:m.jsx(EM,{open:t,onClose:()=>e(!1)})})]})},AM=()=>m.jsx(bE,{client:kM,children:m.jsx(sN,{children:m.jsx(GA,{children:m.jsxs($O,{children:[m.jsx(ZA,{children:m.jsx(OM,{})}),m.jsx(BN,{}),m.jsx(vO,{}),!1]})})})});Bb();const MM=Sy(document.getElementById("root"));MM.render(m.jsx(T.StrictMode,{children:m.jsx(Lb,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:m.jsx(Ub,{children:m.jsx(AM,{})})})}));export{kP as $,yl as A,Zw as B,KR as C,ZR as D,Jl as E,qM as F,JM as G,YR as H,VP as I,XR as J,rx as K,_n as L,tn as M,BM as N,KM as O,ao as P,gd as Q,T as R,Mt as S,VN as T,Gf as U,Qy as V,zN as W,QR as X,XM as Y,Gy as Z,io as _,LM as a,Hw as a0,iu as a1,rh as a2,XP as a3,l0 as a4,rk as a5,Sw as a6,eu as a7,qw as a8,Kw as a9,Uy as aA,tE as aB,nE as aC,ud as aD,Dy as aE,vE as aF,sE as aG,GM as aa,DM as ab,IM as ac,lg as ad,$s as ae,en as af,Ib as ag,UM as ah,FM as ai,HM as aj,Xl as ak,tt as al,$M as am,zy as an,Ut as ao,mw as ap,gw as aq,vw as ar,ms as as,wE as at,zM as au,ii as av,Qt as aw,cE as ax,rE as ay,cd as az,WM as b,C as c,cu as d,$r as e,Oy as f,dh as g,vN as h,cl as i,m as j,VM as k,PE as l,Te as m,qf as n,Be as o,cc as p,G as q,f as r,wP as s,so as t,zf as u,We as v,Ai as w,Os as x,yw as y,UP as z}; diff --git a/assets/loader-circle-3AJg82rJ.js b/assets/loader-circle-BkFdIra2.js similarity index 85% rename from assets/loader-circle-3AJg82rJ.js rename to assets/loader-circle-BkFdIra2.js index b6319690e13b3e4ab48047dffdaeaddd86c94fe4..f7d68271c69ab3495ccba843c3ab285b45200c24 100644 --- a/assets/loader-circle-3AJg82rJ.js +++ b/assets/loader-circle-BkFdIra2.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CnNiludC.js";/** +import{d as e}from"./index-W0d3uysl.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-CSA2RSTl.js b/assets/openrouter-HpeJ3LPX.js similarity index 83% rename from assets/openrouter-CSA2RSTl.js rename to assets/openrouter-HpeJ3LPX.js index 6d545bba517b73a98f4c55da44af39f4cc3e6876..fc7ed2a9d957b8cceddcb72e14046f1b7d7d1d14 100644 --- a/assets/openrouter-CSA2RSTl.js +++ b/assets/openrouter-HpeJ3LPX.js @@ -1 +1 @@ -import{u as r}from"./useQuery-C87uSz9p.js";import{c as n}from"./index-CnNiludC.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,c as a,o as b,m as r,s as u}; +import{u as r}from"./useQuery-vQc9wuoD.js";import{c as n}from"./index-W0d3uysl.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,c as a,o as b,m as r,s as u}; diff --git a/assets/savedPapersAuth-BGaR1VbQ.js b/assets/savedPapersAuth-hSKa9YsO.js similarity index 85% rename from assets/savedPapersAuth-BGaR1VbQ.js rename to assets/savedPapersAuth-hSKa9YsO.js index 3438a086fbc054ee1ff4018129b2e44b611a30ae..b8b1b2ebf39ade581f79ad9adf75b1b2a43e80d9 100644 --- a/assets/savedPapersAuth-BGaR1VbQ.js +++ b/assets/savedPapersAuth-hSKa9YsO.js @@ -1 +1 @@ -import{E as i}from"./index-CnNiludC.js";const s="saved_papers_authorized";function u(n=!1){const r=i("/api/v1/auth/hf/login"),o=new URL(r,window.location.origin).origin,t=new URL(window.location.href);n&&t.searchParams.set(s,"1");const a=o===window.location.origin?`${t.pathname}${t.search}${t.hash}`:t.toString(),e=new URLSearchParams({return_to:a,authorize_bucket:"true",bucket_create:"true"});return`${r}?${e.toString()}`}export{s as S,u as s}; +import{E as i}from"./index-W0d3uysl.js";const s="saved_papers_authorized";function u(n=!1){const r=i("/api/v1/auth/hf/login"),o=new URL(r,window.location.origin).origin,t=new URL(window.location.href);n&&t.searchParams.set(s,"1");const a=o===window.location.origin?`${t.pathname}${t.search}${t.hash}`:t.toString(),e=new URLSearchParams({return_to:a,authorize_bucket:"true",bucket_create:"true"});return`${r}?${e.toString()}`}export{s as S,u as s}; diff --git a/assets/searchable-select-BV8KO0OB.js b/assets/searchable-select-C2wKP4v0.js similarity index 98% rename from assets/searchable-select-BV8KO0OB.js rename to assets/searchable-select-C2wKP4v0.js index 2e9f06f76fe5b36a97b33a61e6618f7abcbe4163..bd238f13d95237364ad42036e74d4a42c22ec57a 100644 --- a/assets/searchable-select-BV8KO0OB.js +++ b/assets/searchable-select-C2wKP4v0.js @@ -1,4 +1,4 @@ -import{d as we,r as n,j as f,_ as B,n as Ye,$ as et,Q as $,o as Re,m as A,q as G,a0 as Ee,a1 as Pe,P as Se,a2 as tt,t as rt,a3 as nt,a4 as ot,a5 as at,a6 as lt,a7 as st,a8 as it,a9 as ct,v as _,C as ut}from"./index-CnNiludC.js";import{u as dt}from"./useQuery-C87uSz9p.js";import{B as ft}from"./button-Cb-e5tHG.js";import{R as pt,P as mt,O as vt,C as ht}from"./dialog-COYv9g-7.js";import{L as gt}from"./loader-circle-3AJg82rJ.js";/** +import{d as we,r as n,j as f,_ as B,n as Ye,$ as et,Q as $,o as Re,m as A,q as G,a0 as Ee,a1 as Pe,P as Se,a2 as tt,t as rt,a3 as nt,a4 as ot,a5 as at,a6 as lt,a7 as st,a8 as it,a9 as ct,v as _,C as ut}from"./index-W0d3uysl.js";import{u as dt}from"./useQuery-vQc9wuoD.js";import{B as ft}from"./button-BCHGalXc.js";import{R as pt,P as mt,O as vt,C as ht}from"./dialog-DOTf3B8r.js";import{L as gt}from"./loader-circle-BkFdIra2.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/shield-alert-BRQa4qRa.js b/assets/shield-alert-DCTkHXsf.js similarity index 96% rename from assets/shield-alert-BRQa4qRa.js rename to assets/shield-alert-DCTkHXsf.js index 8304a75ff67fae0386fc0a485e7b1cc9dd1f9b9c..7de1434b3f1ff3c3e2aaaf32148957667a3ba35e 100644 --- a/assets/shield-alert-BRQa4qRa.js +++ b/assets/shield-alert-DCTkHXsf.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CnNiludC.js";/** +import{d as e}from"./index-W0d3uysl.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-BU3tw6-C.js b/assets/skeleton-CPsExHBt.js similarity index 62% rename from assets/skeleton-BU3tw6-C.js rename to assets/skeleton-CPsExHBt.js index 89e095fbae52db627fa6476a536f05805f228b6f..bbb7862b9200fea980b66a0106766549dc7dfcea 100644 --- a/assets/skeleton-BU3tw6-C.js +++ b/assets/skeleton-CPsExHBt.js @@ -1 +1 @@ -import{j as t,v as n}from"./index-CnNiludC.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-W0d3uysl.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-BmJwxg75.js b/assets/switch-C5eRfEo5.js similarity index 94% rename from assets/switch-BmJwxg75.js rename to assets/switch-C5eRfEo5.js index c290bd28fda2f38fb8b92d85dde36cae41a5b341..c7fd09a7fbc367c068a92fdcb696485c3e440806 100644 --- a/assets/switch-BmJwxg75.js +++ b/assets/switch-C5eRfEo5.js @@ -1 +1 @@ -import{r as s,o as C,n as I,j as a,m as y,q as M,s as H,t as q,v as x}from"./index-CnNiludC.js";import{u as A}from"./index-D0hHQwos.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,o as C,n as I,j as a,m as y,q as M,s as H,t as q,v as x}from"./index-W0d3uysl.js";import{u as A}from"./index-C3rnUhi0.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-DuxG42Qe.js b/assets/textarea-D8WJ-V7X.js similarity index 93% rename from assets/textarea-DuxG42Qe.js rename to assets/textarea-D8WJ-V7X.js index 238ee363db98e5f89081549773849b783c037799..bfd3d7a168e9648d2a9bab4f26a52f4425ade21e 100644 --- a/assets/textarea-DuxG42Qe.js +++ b/assets/textarea-D8WJ-V7X.js @@ -1 +1 @@ -import{r as s,j as i,v as t}from"./index-CnNiludC.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-W0d3uysl.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-zlVHQ5aE.js b/assets/transform-a-eujQMz.js similarity index 99% rename from assets/transform-zlVHQ5aE.js rename to assets/transform-a-eujQMz.js index b5b4d0b6894a823f68af43d227efc477b6501b07..019b5c07468406b0083a50bfd5a9ae4a5b524b26 100644 --- a/assets/transform-zlVHQ5aE.js +++ b/assets/transform-a-eujQMz.js @@ -1 +1 @@ -import{N as _}from"./index-CnNiludC.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 F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(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=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function K(t){const e=j(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/I)+1}function Q(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=Q(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/I)+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"},q={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=Q(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=j(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 U(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 U(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"+L(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"+L(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 L(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 U(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 H=(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"})}},X=(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 H(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}}",H(r,e)).replace("{{time}}",X(a,e))},It={p:X,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(q[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=q[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 B(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*A+r*R+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*A+a*R):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 G(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]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(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"?B(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(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,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),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=$.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"]),$=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=$.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{N as _}from"./index-W0d3uysl.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 F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(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=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function K(t){const e=j(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/I)+1}function Q(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=Q(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/I)+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"},q={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=Q(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=j(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 U(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 U(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"+L(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"+L(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 L(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 U(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 H=(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"})}},X=(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 H(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}}",H(r,e)).replace("{{time}}",X(a,e))},It={p:X,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(q[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=q[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 B(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*A+r*R+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*A+a*R):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 G(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]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(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"?B(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(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,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),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=$.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"]),$=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=$.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/useDebounce-tmUrFXv0.js b/assets/useDebounce-CX9U7t5A.js similarity index 66% rename from assets/useDebounce-tmUrFXv0.js rename to assets/useDebounce-CX9U7t5A.js index 6688b268bc5f7f437c3d3281ac5d26f552d7c926..fce4b0013b5242edc36543956be13a68784c2710 100644 --- a/assets/useDebounce-tmUrFXv0.js +++ b/assets/useDebounce-CX9U7t5A.js @@ -1 +1 @@ -import{r as o}from"./index-CnNiludC.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-W0d3uysl.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-DulZ-zOj.js b/assets/useInfiniteQuery-JgP-qE09.js similarity index 89% rename from assets/useInfiniteQuery-DulZ-zOj.js rename to assets/useInfiniteQuery-JgP-qE09.js index 05b6e6d08210701d04aafc51342a72ecae069f1a..b3fa6cef30dc120feecc04d0ebea982b157fd8a4 100644 --- a/assets/useInfiniteQuery-DulZ-zOj.js +++ b/assets/useInfiniteQuery-JgP-qE09.js @@ -1 +1 @@ -import{Q as v,a as p}from"./useQuery-C87uSz9p.js";import{ah as x,ai as b}from"./index-CnNiludC.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 w(e,t){return p(e,l)}export{w as u}; +import{Q as v,a as p}from"./useQuery-vQc9wuoD.js";import{ah as x,ai as b}from"./index-W0d3uysl.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 w(e,t){return p(e,l)}export{w as u}; diff --git a/assets/useIntersectionObserver-BUxW5ZLf.js b/assets/useIntersectionObserver-C1k1BF8O.js similarity index 92% rename from assets/useIntersectionObserver-BUxW5ZLf.js rename to assets/useIntersectionObserver-C1k1BF8O.js index 6c1e22aac7b11f01001063d92c0be67b536351e7..312498d76d2be43a9a3250b3b82fa61dd4dc3563 100644 --- a/assets/useIntersectionObserver-BUxW5ZLf.js +++ b/assets/useIntersectionObserver-C1k1BF8O.js @@ -1 +1 @@ -import{j as e,r as c}from"./index-CnNiludC.js";import{I as d}from"./components-skIcbldg.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-W0d3uysl.js";import{I as d}from"./components-DA5I2P56.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-CZOEaG9X.js b/assets/useMutation-BMLNTksL.js similarity index 97% rename from assets/useMutation-CZOEaG9X.js rename to assets/useMutation-BMLNTksL.js index 75561658a20adf6dec6f9e5e448c0077df892592..38998a11dcc0c3f01a3114ea3dca650af689d96f 100644 --- a/assets/useMutation-CZOEaG9X.js +++ b/assets/useMutation-BMLNTksL.js @@ -1 +1 @@ -var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("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)?R("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{ak as k,am as U,as as j,at as q,al as P,k as L,r as v,ao as A,au as D}from"./index-CnNiludC.js";var a,c,o,h,n,C,S,w,I=(w=class extends k{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,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,a).defaultMutationOptions(t),U(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(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,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=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,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).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,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function z(i,t){const s=L(),[r]=v.useState(()=>new I(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(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{z as u}; +var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("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)?R("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{ak as k,am as U,as as j,at as q,al as P,k as L,r as v,ao as A,au as D}from"./index-W0d3uysl.js";var a,c,o,h,n,C,S,w,I=(w=class extends k{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,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,a).defaultMutationOptions(t),U(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(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,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=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,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).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,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function z(i,t){const s=L(),[r]=v.useState(()=>new I(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(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{z as u}; diff --git a/assets/usePapers-C15Wpgxo.js b/assets/usePapers-CQOaIFi3.js similarity index 93% rename from assets/usePapers-C15Wpgxo.js rename to assets/usePapers-CQOaIFi3.js index 581695810e2b63121eb9f63ed094aa74588d9019..5391a9ca506b2d8288355dd951abf97466139a4b 100644 --- a/assets/usePapers-C15Wpgxo.js +++ b/assets/usePapers-CQOaIFi3.js @@ -1 +1 @@ -import{p,ab as _}from"./index-CnNiludC.js";import{u as m}from"./useQuery-C87uSz9p.js";import{u as g}from"./useInfiniteQuery-DulZ-zOj.js";function x(a,e=!0){return m({queryKey:["paper",a],queryFn:()=>p.get(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:f=!0,include_resources:l=!1,has_code:c=!1,has_hf_artifacts:d=!1,framework:y,repository:P,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:f,include_resources:l,has_code:c,has_hf_artifacts:d,framework:y,repository:P}],queryFn:({pageParam:h=1})=>p.list({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:f,include_resources:l,has_code:c,has_hf_artifacts:d,framework:y,repository:P}),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:f=!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.forTask(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:f&&!!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:f=!1,has_hf_artifacts:l=!1,enabled:c=!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:f,has_hf_artifacts:l}],queryFn:({pageParam:d=1})=>p.forConference(e,{task:r,presentation:t,page:d,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:f,has_hf_artifacts:l}),getNextPageParam:d=>d.next_page,initialPageParam:1,enabled:c&&!!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:f=!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:f}],queryFn:({pageParam:c=1})=>p.forOrganization(e,{task:r,page:c,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:f}),getNextPageParam:c=>c.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{p,ab as _}from"./index-W0d3uysl.js";import{u as m}from"./useQuery-vQc9wuoD.js";import{u as g}from"./useInfiniteQuery-JgP-qE09.js";function x(a,e=!0){return m({queryKey:["paper",a],queryFn:()=>p.get(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:f=!0,include_resources:l=!1,has_code:c=!1,has_hf_artifacts:d=!1,framework:y,repository:P,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:f,include_resources:l,has_code:c,has_hf_artifacts:d,framework:y,repository:P}],queryFn:({pageParam:h=1})=>p.list({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:f,include_resources:l,has_code:c,has_hf_artifacts:d,framework:y,repository:P}),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:f=!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.forTask(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:f&&!!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:f=!1,has_hf_artifacts:l=!1,enabled:c=!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:f,has_hf_artifacts:l}],queryFn:({pageParam:d=1})=>p.forConference(e,{task:r,presentation:t,page:d,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:f,has_hf_artifacts:l}),getNextPageParam:d=>d.next_page,initialPageParam:1,enabled:c&&!!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:f=!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:f}],queryFn:({pageParam:c=1})=>p.forOrganization(e,{task:r,page:c,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:f}),getNextPageParam:c=>c.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-CAw9mrm9.js b/assets/usePeriodFilter-CAw9mrm9.js deleted file mode 100644 index 1a58a585c09edaa79ba2ce308de59d83e9df5999..0000000000000000000000000000000000000000 --- a/assets/usePeriodFilter-CAw9mrm9.js +++ /dev/null @@ -1 +0,0 @@ -import"./index-CnNiludC.js";const e=["Today","This Week","This Month","All Time"];export{e as P}; diff --git a/assets/usePeriodFilter-D1eMQYtm.js b/assets/usePeriodFilter-D1eMQYtm.js new file mode 100644 index 0000000000000000000000000000000000000000..002d6fb5f2e24751db58efcd8f44d5a1a0623b12 --- /dev/null +++ b/assets/usePeriodFilter-D1eMQYtm.js @@ -0,0 +1 @@ +import"./index-W0d3uysl.js";const e=["Today","This Week","This Month","All Time"];export{e as P}; diff --git a/assets/useQuery-C87uSz9p.js b/assets/useQuery-vQc9wuoD.js similarity index 99% rename from assets/useQuery-C87uSz9p.js rename to assets/useQuery-vQc9wuoD.js index abd212614f367558b4be9d5b5b42f292f619f49b..02e8518688d3af3a099f7724ac094c0a840c6287 100644 --- a/assets/useQuery-C87uSz9p.js +++ b/assets/useQuery-vQc9wuoD.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{ak as Tt,ax as gt,ay as S,am as q,az as j,ao as tt,aA as et,aB as mt,aC as Mt,aD as J,aE as Qt,aF as xt,aG as vt,al as Ct,r as O,au as Ot,k as _t}from"./index-CnNiludC.js";var m,a,H,g,x,U,C,w,z,P,L,_,F,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,m);p(this,a);p(this,H);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,F);p(this,T);p(this,N,new Set);this.options=e,u(this,m,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),Rt(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,m).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,m).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,m).getQueryCache().build(i(this,m),t),r=this.createResult(e,t);return Ut(this,r)&&(u(this,g,r),u(this,U,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,m).defaultQueryOptions(t),r=i(this,m).getQueryCache().build(i(this,m),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,U),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),B=!R&&Rt(t,e),V=R&&St(t,r,e,h);(B||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:k,status:v}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&v==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,W=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(v="success",f=vt(o==null?void 0:o.data,R,e),M=!0)}if(e.select&&f!==void 0&&!W)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,z))f=i(this,P);else try{u(this,z,e.select),f=e.select(f),f=vt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),k=Date.now(),v="error");const X=d.fetchStatus==="fetching",Y=v==="pending",Z=v==="error",lt=Y&&X,dt=f!==void 0,I={status:v,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:v==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:k,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,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 R=I.data!==void 0,B=I.status==="error"&&!R,V=K=>{B?K.reject(I.error):R&&K.resolve(I.data)},pt=()=>{const K=u(this,C,I.promise=gt());V(K)},G=i(this,C);switch(G.status){case"pending":t.queryHash===r.queryHash&&V(G);break;case"fulfilled":(B||I.data!==G.value)&&pt();break;case"rejected":(!B||I.error!==G.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,U,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 D=y;return i(this,g)[D]!==t[D]&&c.has(D)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},m=new WeakMap,a=new WeakMap,H=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=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||!mt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.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||!mt(i(this,T))||i(this,T)===0)&&u(this,F,J.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&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,m).getQueryCache().build(i(this,m),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,m).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Dt(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Dt(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 Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),kt=()=>O.useContext(Nt),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))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},jt=({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])),Ht=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))}},zt=(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 Vt(s,t,e){var M,f,Q,k;const r=Pt(),h=kt(),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",Ht(c),Bt(c,h,y),At(h);const D=!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(v=>{const W=d?b.subscribe(Ct.batchCalls(v)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(jt({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((k=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||k.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&zt(E,r)){const v=D?yt(c,b,h):y==null?void 0:y.promise;v==null||v.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Pt as b,kt as c,Bt as d,Ht as e,At as f,yt as g,jt as h,Wt as s,Xt 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{ak as Tt,ax as gt,ay as S,am as q,az as j,ao as tt,aA as et,aB as mt,aC as Mt,aD as J,aE as Qt,aF as xt,aG as vt,al as Ct,r as O,au as Ot,k as _t}from"./index-W0d3uysl.js";var m,a,H,g,x,U,C,w,z,P,L,_,F,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,m);p(this,a);p(this,H);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,F);p(this,T);p(this,N,new Set);this.options=e,u(this,m,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),Rt(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,m).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,m).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,m).getQueryCache().build(i(this,m),t),r=this.createResult(e,t);return Ut(this,r)&&(u(this,g,r),u(this,U,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,m).defaultQueryOptions(t),r=i(this,m).getQueryCache().build(i(this,m),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,U),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),B=!R&&Rt(t,e),V=R&&St(t,r,e,h);(B||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:k,status:v}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&v==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,W=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(v="success",f=vt(o==null?void 0:o.data,R,e),M=!0)}if(e.select&&f!==void 0&&!W)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,z))f=i(this,P);else try{u(this,z,e.select),f=e.select(f),f=vt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),k=Date.now(),v="error");const X=d.fetchStatus==="fetching",Y=v==="pending",Z=v==="error",lt=Y&&X,dt=f!==void 0,I={status:v,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:v==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:k,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,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 R=I.data!==void 0,B=I.status==="error"&&!R,V=K=>{B?K.reject(I.error):R&&K.resolve(I.data)},pt=()=>{const K=u(this,C,I.promise=gt());V(K)},G=i(this,C);switch(G.status){case"pending":t.queryHash===r.queryHash&&V(G);break;case"fulfilled":(B||I.data!==G.value)&&pt();break;case"rejected":(!B||I.error!==G.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,U,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 D=y;return i(this,g)[D]!==t[D]&&c.has(D)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},m=new WeakMap,a=new WeakMap,H=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=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||!mt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.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||!mt(i(this,T))||i(this,T)===0)&&u(this,F,J.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&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,m).getQueryCache().build(i(this,m),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,m).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Dt(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Dt(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 Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),kt=()=>O.useContext(Nt),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))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},jt=({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])),Ht=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))}},zt=(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 Vt(s,t,e){var M,f,Q,k;const r=Pt(),h=kt(),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",Ht(c),Bt(c,h,y),At(h);const D=!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(v=>{const W=d?b.subscribe(Ct.batchCalls(v)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(jt({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((k=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||k.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&zt(E,r)){const v=D?yt(c,b,h):y==null?void 0:y.promise;v==null||v.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Pt as b,kt as c,Bt as d,Ht as e,At as f,yt as g,jt as h,Wt as s,Xt as u}; diff --git a/index.html b/index.html index 9029eb6ab95151b8ecbe7f9db9e65c474369b35f..0d228a3e5b440d05f2771ee8d7c1ccfcec0b44b4 100644 --- a/index.html +++ b/index.html @@ -73,7 +73,7 @@ plausible.init(); })(); - +