diff --git a/assets/AiDeadlinesView-BYtpNDXZ.js b/assets/AiDeadlinesView-DDL8uO29.js similarity index 96% rename from assets/AiDeadlinesView-BYtpNDXZ.js rename to assets/AiDeadlinesView-DDL8uO29.js index d608ad7149d431135639118a54d8bd5904cb7508..20bb7acbfb0f5a2b16506c67951e2b1993df9499 100644 --- a/assets/AiDeadlinesView-BYtpNDXZ.js +++ b/assets/AiDeadlinesView-DDL8uO29.js @@ -1,3 +1,3 @@ -import{r as x,j as t}from"./index-C7DzD1KZ.js";import{u as A}from"./useQuery-C-S9qU90.js";import{c as B}from"./catalog-DU92Rh6k.js";import{S as U}from"./switch-W-detjDD.js";import{S as W}from"./skeleton-BBQyes8J.js";import{A as O,a as V}from"./alert-D1jsfsn6.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-vRXA8k-N.js";import"./index-DacotVUe.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-DB5YVNrt.js";import{u as A}from"./useQuery-gfOJVfRZ.js";import{c as B}from"./catalog-HFAZrKSg.js";import{S as U}from"./switch-CVNSFNdW.js";import{S as W}from"./skeleton-jY-za2d8.js";import{A as O,a as V}from"./alert-BPNeeF4s.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-CSh5S1Qx.js";import"./index-OagizEwS.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/ArtifactWorkspace-BYg5RxLy.js b/assets/ArtifactWorkspace-DGDexY_Q.js similarity index 99% rename from assets/ArtifactWorkspace-BYg5RxLy.js rename to assets/ArtifactWorkspace-DGDexY_Q.js index a90a9b69f07d66c178ef4c9d24cd560b34205285..6b8478bcaaf2594f89a03b545755a2ab81dae4f3 100644 --- a/assets/ArtifactWorkspace-BYg5RxLy.js +++ b/assets/ArtifactWorkspace-DGDexY_Q.js @@ -1,4 +1,4 @@ -var xN=Object.defineProperty;var Mk=n=>{throw TypeError(n)};var EN=(n,e,t)=>e in n?xN(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var re=(n,e,t)=>EN(n,typeof e!="symbol"?e+"":e,t),C0=(n,e,t)=>e.has(n)||Mk("Cannot "+t);var f=(n,e,t)=>(C0(n,e,"read from private field"),t?t.call(n):e.get(n)),R=(n,e,t)=>e.has(n)?Mk("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),E=(n,e,t,s)=>(C0(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),C=(n,e,t)=>(C0(n,e,"access private method"),t);var os=(n,e,t,s)=>({set _(i){E(n,e,i,t)},get _(){return f(n,e,s)}});import{e as bo,r as Q,j as S,z as ee,U as y_,E as nn,_ as zp,V as Ry,L as Ik,X as v_,h as CN,C as $N}from"./index-C7DzD1KZ.js";import{u as sC,P as iC,b as rC,M as TN,R as PN,W as RN,d as b_,A as MN,l as IN,J as ON,K as NN,L as LN,N as oC,O as DN}from"./chatLaunch-CJaFcfv2.js";import"./katex.min-BSBacQyE.js";import{H as My,a as Iy,b as Oy}from"./hover-card-CD-KpVUV.js";import{u as ra}from"./useQuery-C-S9qU90.js";import{f as FN,p as jN,T as zN}from"./github-CBv5TgZv.js";import{G as Ny}from"./github-BPMZ1b4l.js";import{r as HN,a as BN,P as aC}from"./PaperPreviewLink-BVh6NMiG.js";import{M as qN,r as UN,d as VN}from"./index-1iwK_I9Y.js";import{c as Ok}from"./chat-CYCaJ4hM.js";import{F as WN}from"./file-text-BW4Xze_N.js";import{u as Hp}from"./useMutation-m57QFYBa.js";import{E as lC}from"./external-link-DY1V39Iz.js";/** +var xN=Object.defineProperty;var Mk=n=>{throw TypeError(n)};var EN=(n,e,t)=>e in n?xN(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var re=(n,e,t)=>EN(n,typeof e!="symbol"?e+"":e,t),C0=(n,e,t)=>e.has(n)||Mk("Cannot "+t);var f=(n,e,t)=>(C0(n,e,"read from private field"),t?t.call(n):e.get(n)),R=(n,e,t)=>e.has(n)?Mk("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),E=(n,e,t,s)=>(C0(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),C=(n,e,t)=>(C0(n,e,"access private method"),t);var os=(n,e,t,s)=>({set _(i){E(n,e,i,t)},get _(){return f(n,e,s)}});import{e as bo,r as Q,j as S,z as ee,U as y_,E as nn,_ as zp,V as Ry,L as Ik,X as v_,h as CN,C as $N}from"./index-DB5YVNrt.js";import{u as sC,P as iC,b as rC,M as TN,R as PN,W as RN,d as b_,A as MN,l as IN,J as ON,K as NN,L as LN,N as oC,O as DN}from"./chatLaunch-DPlGkVok.js";import"./katex.min-BSBacQyE.js";import{H as My,a as Iy,b as Oy}from"./hover-card-De01BraD.js";import{u as ra}from"./useQuery-gfOJVfRZ.js";import{f as FN,p as jN,T as zN}from"./github-nBYzmzBK.js";import{G as Ny}from"./github-CYSQLKIg.js";import{r as HN,a as BN,P as aC}from"./PaperPreviewLink-Bi7j2lR1.js";import{M as qN,r as UN,d as VN}from"./index-CeWrpp9N.js";import{c as Ok}from"./chat-C792FSN8.js";import{F as WN}from"./file-text-Dqp9ANqN.js";import{u as Hp}from"./useMutation-Bi00GAL7.js";import{E as lC}from"./external-link-CwxK3W8X.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/AuthorDetailView-BYMv-vHA.js b/assets/AuthorDetailView-DsixzDxp.js similarity index 82% rename from assets/AuthorDetailView-BYMv-vHA.js rename to assets/AuthorDetailView-DsixzDxp.js index 167d11cf16cc2193855df83d140c0d945df1adea..cfb9716665b422d2dd0fcb38a4ca4186f12101ae 100644 --- a/assets/AuthorDetailView-BYMv-vHA.js +++ b/assets/AuthorDetailView-DsixzDxp.js @@ -1 +1 @@ -import{u as m,j as e,L as x}from"./index-C7DzD1KZ.js";import{u as h}from"./useQuery-C-S9qU90.js";import{p as d}from"./papers-BNcOWLi8.js";import{S as p}from"./skeleton-BBQyes8J.js";import g from"./NotFound-CpH-pbR-.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=h({queryKey:["author",a],queryFn:()=>d.getAuthor(a),enabled:!!a}),t=h({queryKey:["author-papers",a],queryFn:()=>d.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(g,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(p,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(p,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const c=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(x,{to:`/paper/${c}`,children:s.title})},s.id)})})]})]})};export{_ as default}; +import{u as m,j as e,L as x}from"./index-DB5YVNrt.js";import{u as h}from"./useQuery-gfOJVfRZ.js";import{p as d}from"./papers-CTasJek9.js";import{S as p}from"./skeleton-jY-za2d8.js";import g from"./NotFound-BO9K9saD.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=h({queryKey:["author",a],queryFn:()=>d.getAuthor(a),enabled:!!a}),t=h({queryKey:["author-papers",a],queryFn:()=>d.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(g,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(p,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(p,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const c=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(x,{to:`/paper/${c}`,children:s.title})},s.id)})})]})]})};export{_ as default}; diff --git a/assets/AuthorizePaperEditView-CGKfjdnc.js b/assets/AuthorizePaperEditView-CIbMmWPg.js similarity index 87% rename from assets/AuthorizePaperEditView-CGKfjdnc.js rename to assets/AuthorizePaperEditView-CIbMmWPg.js index e3e2297fa6bf4e02fe1aa290403051ab1774a7cc..e1214fa93b8f007018abdc1085fe15c1832dfbc3 100644 --- a/assets/AuthorizePaperEditView-CGKfjdnc.js +++ b/assets/AuthorizePaperEditView-CIbMmWPg.js @@ -1 +1 @@ -import{u,a as d,j as e,L as l,H as p}from"./index-C7DzD1KZ.js";import{u as c}from"./useQuery-C-S9qU90.js";import{u as h}from"./useMutation-m57QFYBa.js";import{B as m}from"./button-B2L1cddC.js";import{p as n}from"./paperEdits-B067dmC0.js";function b(){const{authorizationId:t=""}=u(),{user:s,isLoading:o}=d(),i=c({queryKey:["paper-edit-authorization",t],queryFn:()=>n.authorization(t),retry:!1}),r=h({mutationFn:()=>n.approve(t)}),a=i.data;return e.jsxs("main",{className:"mx-auto max-w-xl space-y-5 px-6 py-12",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Authorize your agent to edit a paper"}),(i.isLoading||o)&&e.jsx("p",{children:"Loading authorization…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),a&&e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"underline",to:`/paper/${a.paper_id}`,children:a.title}),e.jsxs("p",{children:["Check that your CLI shows this code: ",e.jsx("strong",{className:"font-mono",children:a.user_code})]}),e.jsx("p",{children:"Only approve a request you started. Your agent will be able to publish changes to this paper’s links, tags, and evaluation results for one hour, without further approval."}),e.jsx("p",{children:"Edits appear publicly under your Hugging Face username. You can edit up to 20 distinct papers per UTC day. Evaluation deletion and changes to shared benchmark definitions require an administrator."}),r.isSuccess||a.approved?e.jsx("p",{role:"status",children:"Access approved. Return to your CLI to continue."}):s?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Signed in as ",e.jsxs("strong",{children:["@",s.username]})]}),e.jsx(m,{disabled:r.isPending||!s.can_directly_edit_catalog,onClick:()=>r.mutate(),children:r.isPending?"Authorizing…":"Authorize for one hour"}),!s.can_directly_edit_catalog&&e.jsx("p",{children:"Direct editing is unavailable for this session."})]}):e.jsx(p,{returnTo:`/authorize-paper-edit/${t}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{b as default}; +import{u,a as d,j as e,L as l,H as p}from"./index-DB5YVNrt.js";import{u as c}from"./useQuery-gfOJVfRZ.js";import{u as h}from"./useMutation-Bi00GAL7.js";import{B as m}from"./button-BvgK708w.js";import{p as n}from"./paperEdits-D718tWaT.js";function b(){const{authorizationId:t=""}=u(),{user:s,isLoading:o}=d(),i=c({queryKey:["paper-edit-authorization",t],queryFn:()=>n.authorization(t),retry:!1}),r=h({mutationFn:()=>n.approve(t)}),a=i.data;return e.jsxs("main",{className:"mx-auto max-w-xl space-y-5 px-6 py-12",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Authorize your agent to edit a paper"}),(i.isLoading||o)&&e.jsx("p",{children:"Loading authorization…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),a&&e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"underline",to:`/paper/${a.paper_id}`,children:a.title}),e.jsxs("p",{children:["Check that your CLI shows this code: ",e.jsx("strong",{className:"font-mono",children:a.user_code})]}),e.jsx("p",{children:"Only approve a request you started. Your agent will be able to publish changes to this paper’s links, tags, and evaluation results for one hour, without further approval."}),e.jsx("p",{children:"Edits appear publicly under your Hugging Face username. You can edit up to 20 distinct papers per UTC day. Evaluation deletion and changes to shared benchmark definitions require an administrator."}),r.isSuccess||a.approved?e.jsx("p",{role:"status",children:"Access approved. Return to your CLI to continue."}):s?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Signed in as ",e.jsxs("strong",{children:["@",s.username]})]}),e.jsx(m,{disabled:r.isPending||!s.can_directly_edit_catalog,onClick:()=>r.mutate(),children:r.isPending?"Authorizing…":"Authorize for one hour"}),!s.can_directly_edit_catalog&&e.jsx("p",{children:"Direct editing is unavailable for this session."})]}):e.jsx(p,{returnTo:`/authorize-paper-edit/${t}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{b as default}; diff --git a/assets/AutonomousOperations-CFtp7JHQ.js b/assets/AutonomousOperations-B7IW_M7l.js similarity index 94% rename from assets/AutonomousOperations-CFtp7JHQ.js rename to assets/AutonomousOperations-B7IW_M7l.js index b10211cd0e5b2a91f13415f48dd0750647df9495..6aa20c29a471eb271f28f1ece334150a5025eb67 100644 --- a/assets/AutonomousOperations-CFtp7JHQ.js +++ b/assets/AutonomousOperations-B7IW_M7l.js @@ -1,4 +1,4 @@ -import{e as R,a as B,h as q,r as m,j as e,L as H}from"./index-C7DzD1KZ.js";import{u as I}from"./useQuery-C-S9qU90.js";import{u as Q}from"./useMutation-m57QFYBa.js";import{B as P}from"./badge-a2iv4Ds7.js";import{B as x}from"./button-B2L1cddC.js";import{A as D,C as n,d as i,a as t,b as r,f as h,o as u}from"./operations-DxpN2fk3.js";import{I as j}from"./input-B4Wwo7mm.js";import{S as $}from"./shield-alert-BX1GxHfp.js";/** +import{e as R,a as B,h as q,r as m,j as e,L as H}from"./index-DB5YVNrt.js";import{u as I}from"./useQuery-gfOJVfRZ.js";import{u as Q}from"./useMutation-Bi00GAL7.js";import{B as P}from"./badge-C_UuzwL3.js";import{B as x}from"./button-BvgK708w.js";import{A as D,C as n,d as i,a as t,b as r,f as h,o as u}from"./operations-CJQ0CXcc.js";import{I as j}from"./input-DnxeMTC9.js";import{S as $}from"./shield-alert-TqnwXhnw.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/BenchmarkDetailView--SkpidLo.js b/assets/BenchmarkDetailView-CYzt8vxy.js similarity index 98% rename from assets/BenchmarkDetailView--SkpidLo.js rename to assets/BenchmarkDetailView-CYzt8vxy.js index d24491882d1e278126305b4686f307e684b8bb1f..49cfed9ef4bc65d064a537f5e2c3c097bd24c33c 100644 --- a/assets/BenchmarkDetailView--SkpidLo.js +++ b/assets/BenchmarkDetailView-CYzt8vxy.js @@ -1,2 +1,2 @@ -import{b as Ht,r as b,j as s,t as le,f as Vt,u as Ut,c as qt,g as Ot,L as re}from"./index-C7DzD1KZ.js";import{u as Z}from"./useQuery-C-S9qU90.js";import{c as se}from"./catalog-DU92Rh6k.js";import{C as Wt,E as zt,e as Kt}from"./ExternalSourceEvalBadge-DAotgKUq.js";import{S as Se}from"./skeleton-BBQyes8J.js";import{S as mt}from"./switch-W-detjDD.js";import{A as Gt,a as Qt}from"./alert-D1jsfsn6.js";import{L as Ce}from"./LatexTitle-DuT2lumP.js";import{B as Xt}from"./BenchmarkTrendSparkline-BQbrYdWs.js";import{I as Yt}from"./components-BV3lUGf1.js";import{s as Jt}from"./safeExternalHref-CkBrsh84.js";import{s as Zt}from"./slug-BpH-Nkvz.js";import"./papers-BNcOWLi8.js";import"./hover-card-CD-KpVUV.js";import"./index-DacotVUe.js";import"./katex.min-BSBacQyE.js";import"./transform-Dk33Ziw-.js";function er(e,t,r){const a=t?(e??[]).filter(l=>l.task_id===t):e??[],n=a.filter(l=>l.is_open===!1),i=n.reduce((l,o)=>l?(o.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?o:l:o,null);return{visible:r?a.filter(l=>l.is_open!==!1):a,hiddenClosed:n,topHiddenClosed:i}}function ht(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ie=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ae(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function tr(e,t){if(e===t){const{year:m,month:x}=Ae(e);return[{timestamp:new Date(m,x,1).getTime(),key:`${m}-${x}`,label:`${Ie[x]} ${m}`}]}const r=Ae(e),a=Ae(t);if(r.year===a.year){const m=a.month-r.month+1;let x=1;const h=12;m>h&&(x=Math.ceil(m/h));const y=[];for(let v=r.month;v<=a.month;v+=x)y.push({timestamp:new Date(r.year,v,1).getTime(),key:`${r.year}-${v}`,label:m<=3?`${Ie[v]} ${r.year}`:Ie[v]});return y}const n=a.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const o=[];for(let m=r.year;m<=a.year;m+=i)o.push({timestamp:new Date(m,0,1).getTime(),key:String(m),label:String(m)});return o}const rr=({points:e,metric:t})=>{const r=Ht(),[a,n]=b.useState(null),i=880,l=320,o=60,m=30,x=40,h=50,y=e.map(d=>d.value),v=Math.min(...y),pe=Math.max(...y)-v||1,ge=i-o-m,K=l-x-h,W=e.map(d=>ht(d.date)),_=Math.min(...W),R=Math.max(...W),G=R-_||1,ce=d=>_===R?o+ge/2:o+(d-_)/G*ge,F=e.map((d,p)=>{const g=ce(ht(d.date)),S=(d.value-v)/pe,C=x+K*(1-S);return{x:g,y:C,data:d,idx:p}}),w=F.filter(d=>d.data.isSota);let Q="";if(w.length>=2){Q=`M${w[0].x},${w[0].y}`;for(let d=1;d{const p=d.data.modelName||d.data.paperTitle||"";if(!p)return null;const g=p.length>22?p.slice(0,21)+"…":p,S=g.length*H;let C=d.x-S/2,j=d.x+S/2,I="middle";return Ci-m&&(j=i-m,C=j-S,I="end"),{x:I==="start"?o:I==="end"?i-m:d.x,y:d.y-de,text:g,anchor:I,left:C,right:j}},X=[],V=w.length>0?ue(w[w.length-1]):null;let L=-1/0;for(let d=0;dV.left-ee||(L=p.right,X.push({x:p.x,y:p.y,text:p.text,anchor:p.anchor})))}V&&X.push({x:V.x,y:V.y,text:V.text,anchor:V.anchor});const me=tr(_,R),xe=5,Y=d=>n(p=>p===d?null:p),M=d=>{d&&r(`/paper/${d}`)},be=(d,p)=>{const S=`${d.data.modelName||d.data.paperTitle||"Unknown model"}: ${le(d.data.value)} on ${d.data.dateLabel}`,C=!!d.data.paperRouteId;return s.jsxs("g",{children:[p,s.jsx("circle",{cx:d.x,cy:d.y,r:"10",fill:"transparent",style:{cursor:C?"pointer":"default",outline:"none"},tabIndex:0,role:C?"link":"img","aria-label":S,onMouseEnter:()=>n(d.idx),onMouseLeave:()=>Y(d.idx),onFocus:()=>n(d.idx),onBlur:()=>Y(d.idx),onClick:()=>M(d.data.paperRouteId),onKeyDown:j=>{C&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),M(d.data.paperRouteId))},children:s.jsx("title",{children:S})})]},d.idx)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[s.jsx("text",{x:o-38,y:x+K/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${x+K/2})`,children:t}),Array.from({length:xe}).map((d,p)=>{const g=p/(xe-1),S=x+K*(1-g),C=v+pe*g;return s.jsxs("g",{children:[s.jsx("line",{x1:o,y1:S,x2:i-m,y2:S,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:o-10,y:S+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(C)})]},p)}),me.map(d=>{const p=ce(d.timestamp);return s.jsx("text",{x:p,y:l-h+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:d.label},d.key)}),F.filter(d=>!d.data.isSota).map(d=>{const p=a===d.idx;return be(d,s.jsx("circle",{cx:d.x,cy:d.y,r:p?3:2,fill:"var(--ink-faint)",opacity:p?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),Q&&s.jsx("path",{d:Q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(d=>{const p=a===d.idx;return be(d,s.jsx("circle",{cx:d.x,cy:d.y,r:p?4.5:3,fill:p?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),X.map((d,p)=>s.jsx("text",{x:d.x,y:d.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:d.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:d.text},`label-${p}`)),a!==null&&F[a]&&(()=>{const d=F[a],p=d.data.modelName||d.data.paperTitle||"Unknown model",S=`${p.length>40?p.slice(0,39)+"…":p}: ${le(d.data.value)}`,j=Math.max(120,Math.min(340,S.length*6.6+24)),I=30;let q=d.x-j/2;qi-m&&(q=i-m-j);const ye=d.y-I-14>=x?d.y-I-12:d.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:q,y:ye,width:j,height:I,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),s.jsx("text",{x:q+12,y:ye+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:S})]})})()]})};function sr(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(),a=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(a),r.body.appendChild(n),t&&(a.href=t),n.href=e,n.href}const ar=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function z(e){const t=[];for(let r=0,a=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 cr(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 a=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=a.length,i=new Uint8Array(n);for(let l=0;l{const a=new Image;a.onload=()=>{a.decode().then(()=>{requestAnimationFrame(()=>t(a))})},a.onerror=r,a.crossOrigin="anonymous",a.decoding="async",a.src=e})}async function dr(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ur(e,t,r){const a="http://www.w3.org/2000/svg",n=document.createElementNS(a,"svg"),i=document.createElementNS(a,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.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"),n.appendChild(i),i.appendChild(e),dr(n)}const B=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||B(r,t)};function mr(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function hr(e,t){return kt(t).map(r=>{const a=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${a}${n?" !important":""};`}).join(" ")}function fr(e,t,r,a){const n=`.${e}:${t}`,i=r.cssText?mr(r):hr(r,a);return document.createTextNode(`${n}{${i}}`)}function ft(e,t,r,a){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=ar();try{t.className=`${t.className} ${l}`}catch{return}const o=document.createElement("style");o.appendChild(fr(l,r,n,a)),t.appendChild(o)}function pr(e,t,r){ft(e,t,":before",r),ft(e,t,":after",r)}const pt="application/font-woff",gt="image/jpeg",gr={woff:pt,woff2:pt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:gt,jpeg:gt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function xr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ve(e){const t=xr(e).toLowerCase();return gr[t]||""}function br(e){return e.split(/,/)[1]}function De(e){return e.search(/^(data:)/)!==-1}function yr(e,t){return`data:${t};base64,${e}`}async function Et(e,t,r){const a=await fetch(e,t);if(a.status===404)throw new Error(`Resource "${a.url}" not found`);const n=await a.blob();return new Promise((i,l)=>{const o=new FileReader;o.onerror=l,o.onloadend=()=>{try{i(r({res:a,result:o.result}))}catch(m){l(m)}},o.readAsDataURL(n)})}const Be={};function wr(e,t,r){let a=e.replace(/\?.*/,"");return r&&(a=e),/ttf|otf|eot|woff2?/i.test(a)&&(a=a.replace(/.*\//,"")),t?`[${t}]${a}`:a}async function Ue(e,t,r){const a=wr(e,t,r.includeQueryParams);if(Be[a]!=null)return Be[a];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Et(e,r.fetchRequestInit,({res:l,result:o})=>(t||(t=l.headers.get("Content-Type")||""),br(o)));n=yr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return Be[a]=n,n}async function vr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ne(t)}async function jr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const o=i.toDataURL();return Ne(o)}const r=e.poster,a=Ve(r),n=await Ue(r,a,t);return Ne(n)}async function _r(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await Re(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Sr(e,t){return B(e,HTMLCanvasElement)?vr(e):B(e,HTMLVideoElement)?jr(e,t):B(e,HTMLIFrameElement)?_r(e,t):e.cloneNode(Nt(e))}const kr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Nt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Cr(e,t,r){var a,n;if(Nt(t))return t;let i=[];return kr(e)&&e.assignedNodes?i=z(e.assignedNodes()):B(e,HTMLIFrameElement)&&(!((a=e.contentDocument)===null||a===void 0)&&a.body)?i=z(e.contentDocument.body.childNodes):i=z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||B(e,HTMLVideoElement)||await i.reduce((l,o)=>l.then(()=>Re(o,r)).then(m=>{m&&t.appendChild(m)}),Promise.resolve()),t}function Er(e,t,r){const a=t.style;if(!a)return;const n=window.getComputedStyle(e);n.cssText?(a.cssText=n.cssText,a.transformOrigin=n.transformOrigin):kt(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),B(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),a.setProperty(i,l,n.getPropertyPriority(i))})}function Nr(e,t){B(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),B(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Rr(e,t){if(B(e,HTMLSelectElement)){const r=t,a=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));a&&a.setAttribute("selected","")}}function $r(e,t,r){return B(t,Element)&&(Er(e,t,r),pr(e,t,r),Nr(e,t),Rr(e,t)),t}async function Tr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const a={};for(let i=0;iSr(a,t)).then(a=>Cr(e,a,t)).then(a=>$r(e,a,t)).then(a=>Tr(a,t))}const Rt=/url\((['"]?)([^'"]+?)\1\)/g,Pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Fr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Lr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Mr(e){const t=[];return e.replace(Rt,(r,a,n)=>(t.push(n),r)),t.filter(r=>!De(r))}async function Ir(e,t,r,a,n){try{const i=r?sr(t,r):t,l=Ve(t);let o;return n||(o=await Ue(i,l,a)),e.replace(Lr(t),`$1${o}$3`)}catch{}return e}function Ar(e,{preferredFontFormat:t}){return t?e.replace(Fr,r=>{for(;;){const[a,,n]=Pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${a};`}}):e}function $t(e){return e.search(Rt)!==-1}async function Tt(e,t,r){if(!$t(e))return e;const a=Ar(e,r);return Mr(a).reduce((i,l)=>i.then(o=>Ir(o,l,t,r)),Promise.resolve(a))}async function ne(e,t,r){var a;const n=(a=t.style)===null||a===void 0?void 0:a.getPropertyValue(e);if(n){const i=await Tt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function Br(e,t){await ne("background",e,t)||await ne("background-image",e,t),await ne("mask",e,t)||await ne("-webkit-mask",e,t)||await ne("mask-image",e,t)||await ne("-webkit-mask-image",e,t)}async function Dr(e,t){const r=B(e,HTMLImageElement);if(!(r&&!De(e.src))&&!(B(e,SVGImageElement)&&!De(e.href.baseVal)))return;const a=r?e.src:e.href.baseVal,n=await Ue(a,Ve(a),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...m)=>{try{i(t.onImageErrorHandler(...m))}catch(x){l(x)}}:l;const o=e;o.decode&&(o.decode=i),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function Hr(e,t){const a=z(e.childNodes).map(n=>Pt(n,t));await Promise.all(a).then(()=>e)}async function Pt(e,t){B(e,Element)&&(await Br(e,t),await Dr(e,t),await Hr(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 a=t.style;return a!=null&&Object.keys(a).forEach(n=>{r[n]=a[n]}),e}const xt={};async function bt(e){let t=xt[e];if(t!=null)return t;const a=await(await fetch(e)).text();return t={url:e,cssText:a},xt[e]=t,t}async function yt(e,t){let r=e.cssText;const a=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let o=l.replace(a,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Et(o,t.fetchRequestInit,({result:m})=>(r=r.replace(l,`url(${m})`),[l,m]))});return Promise.all(i).then(()=>r)}function wt(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let a=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const m=n.exec(a);if(m===null)break;t.push(m[0])}a=a.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(l,"gi");for(;;){let m=i.exec(a);if(m===null){if(m=o.exec(a),m===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;t.push(m[0])}return t}async function Ur(e,t){const r=[],a=[];return e.forEach(n=>{if("cssRules"in n)try{z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let o=l+1;const m=i.href,x=bt(m).then(h=>yt(h,t)).then(h=>wt(h).forEach(y=>{try{n.insertRule(y,y.startsWith("@import")?o+=1:n.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:y,error:v})}})).catch(h=>{console.error("Error loading remote css",h.toString())});a.push(x)}})}catch(i){const l=e.find(o=>o.href==null)||document.styleSheets[0];n.href!=null&&a.push(bt(n.href).then(o=>yt(o,t)).then(o=>wt(o).forEach(m=>{l.insertRule(m,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",i)}}),Promise.all(a).then(()=>(e.forEach(n=>{if("cssRules"in n)try{z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function qr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>$t(t.style.getPropertyValue("src")))}async function Or(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=z(e.ownerDocument.styleSheets),a=await Ur(r,t);return qr(a)}function Ft(e){return e.trim().replace(/["']/g,"")}function Wr(e){const t=new Set;function r(a){(a.style.fontFamily||getComputedStyle(a).fontFamily).split(",").forEach(i=>{t.add(Ft(i))}),Array.from(a.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function zr(e,t){const r=await Or(e,t),a=Wr(e);return(await Promise.all(r.filter(i=>a.has(Ft(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return Tt(i.cssText,l,t)}))).join(` +import{b as Ht,r as b,j as s,t as le,f as Vt,u as Ut,c as qt,g as Ot,L as re}from"./index-DB5YVNrt.js";import{u as Z}from"./useQuery-gfOJVfRZ.js";import{c as se}from"./catalog-HFAZrKSg.js";import{C as Wt,E as zt,e as Kt}from"./ExternalSourceEvalBadge-BZEagV7N.js";import{S as Se}from"./skeleton-jY-za2d8.js";import{S as mt}from"./switch-CVNSFNdW.js";import{A as Gt,a as Qt}from"./alert-BPNeeF4s.js";import{L as Ce}from"./LatexTitle-DcOGOHZH.js";import{B as Xt}from"./BenchmarkTrendSparkline-DrH77nK8.js";import{I as Yt}from"./components--1z4Qw5F.js";import{s as Jt}from"./safeExternalHref-CkBrsh84.js";import{s as Zt}from"./slug-BpH-Nkvz.js";import"./papers-CTasJek9.js";import"./hover-card-De01BraD.js";import"./index-OagizEwS.js";import"./katex.min-BSBacQyE.js";import"./transform-CnBvOSlq.js";function er(e,t,r){const a=t?(e??[]).filter(l=>l.task_id===t):e??[],n=a.filter(l=>l.is_open===!1),i=n.reduce((l,o)=>l?(o.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?o:l:o,null);return{visible:r?a.filter(l=>l.is_open!==!1):a,hiddenClosed:n,topHiddenClosed:i}}function ht(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ie=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ae(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function tr(e,t){if(e===t){const{year:m,month:x}=Ae(e);return[{timestamp:new Date(m,x,1).getTime(),key:`${m}-${x}`,label:`${Ie[x]} ${m}`}]}const r=Ae(e),a=Ae(t);if(r.year===a.year){const m=a.month-r.month+1;let x=1;const h=12;m>h&&(x=Math.ceil(m/h));const y=[];for(let v=r.month;v<=a.month;v+=x)y.push({timestamp:new Date(r.year,v,1).getTime(),key:`${r.year}-${v}`,label:m<=3?`${Ie[v]} ${r.year}`:Ie[v]});return y}const n=a.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const o=[];for(let m=r.year;m<=a.year;m+=i)o.push({timestamp:new Date(m,0,1).getTime(),key:String(m),label:String(m)});return o}const rr=({points:e,metric:t})=>{const r=Ht(),[a,n]=b.useState(null),i=880,l=320,o=60,m=30,x=40,h=50,y=e.map(d=>d.value),v=Math.min(...y),pe=Math.max(...y)-v||1,ge=i-o-m,K=l-x-h,W=e.map(d=>ht(d.date)),_=Math.min(...W),R=Math.max(...W),G=R-_||1,ce=d=>_===R?o+ge/2:o+(d-_)/G*ge,F=e.map((d,p)=>{const g=ce(ht(d.date)),S=(d.value-v)/pe,C=x+K*(1-S);return{x:g,y:C,data:d,idx:p}}),w=F.filter(d=>d.data.isSota);let Q="";if(w.length>=2){Q=`M${w[0].x},${w[0].y}`;for(let d=1;d{const p=d.data.modelName||d.data.paperTitle||"";if(!p)return null;const g=p.length>22?p.slice(0,21)+"…":p,S=g.length*H;let C=d.x-S/2,j=d.x+S/2,I="middle";return Ci-m&&(j=i-m,C=j-S,I="end"),{x:I==="start"?o:I==="end"?i-m:d.x,y:d.y-de,text:g,anchor:I,left:C,right:j}},X=[],V=w.length>0?ue(w[w.length-1]):null;let L=-1/0;for(let d=0;dV.left-ee||(L=p.right,X.push({x:p.x,y:p.y,text:p.text,anchor:p.anchor})))}V&&X.push({x:V.x,y:V.y,text:V.text,anchor:V.anchor});const me=tr(_,R),xe=5,Y=d=>n(p=>p===d?null:p),M=d=>{d&&r(`/paper/${d}`)},be=(d,p)=>{const S=`${d.data.modelName||d.data.paperTitle||"Unknown model"}: ${le(d.data.value)} on ${d.data.dateLabel}`,C=!!d.data.paperRouteId;return s.jsxs("g",{children:[p,s.jsx("circle",{cx:d.x,cy:d.y,r:"10",fill:"transparent",style:{cursor:C?"pointer":"default",outline:"none"},tabIndex:0,role:C?"link":"img","aria-label":S,onMouseEnter:()=>n(d.idx),onMouseLeave:()=>Y(d.idx),onFocus:()=>n(d.idx),onBlur:()=>Y(d.idx),onClick:()=>M(d.data.paperRouteId),onKeyDown:j=>{C&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),M(d.data.paperRouteId))},children:s.jsx("title",{children:S})})]},d.idx)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[s.jsx("text",{x:o-38,y:x+K/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${x+K/2})`,children:t}),Array.from({length:xe}).map((d,p)=>{const g=p/(xe-1),S=x+K*(1-g),C=v+pe*g;return s.jsxs("g",{children:[s.jsx("line",{x1:o,y1:S,x2:i-m,y2:S,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:o-10,y:S+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(C)})]},p)}),me.map(d=>{const p=ce(d.timestamp);return s.jsx("text",{x:p,y:l-h+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:d.label},d.key)}),F.filter(d=>!d.data.isSota).map(d=>{const p=a===d.idx;return be(d,s.jsx("circle",{cx:d.x,cy:d.y,r:p?3:2,fill:"var(--ink-faint)",opacity:p?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),Q&&s.jsx("path",{d:Q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(d=>{const p=a===d.idx;return be(d,s.jsx("circle",{cx:d.x,cy:d.y,r:p?4.5:3,fill:p?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),X.map((d,p)=>s.jsx("text",{x:d.x,y:d.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:d.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:d.text},`label-${p}`)),a!==null&&F[a]&&(()=>{const d=F[a],p=d.data.modelName||d.data.paperTitle||"Unknown model",S=`${p.length>40?p.slice(0,39)+"…":p}: ${le(d.data.value)}`,j=Math.max(120,Math.min(340,S.length*6.6+24)),I=30;let q=d.x-j/2;qi-m&&(q=i-m-j);const ye=d.y-I-14>=x?d.y-I-12:d.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:q,y:ye,width:j,height:I,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),s.jsx("text",{x:q+12,y:ye+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:S})]})})()]})};function sr(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(),a=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(a),r.body.appendChild(n),t&&(a.href=t),n.href=e,n.href}const ar=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function z(e){const t=[];for(let r=0,a=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 cr(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 a=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=a.length,i=new Uint8Array(n);for(let l=0;l{const a=new Image;a.onload=()=>{a.decode().then(()=>{requestAnimationFrame(()=>t(a))})},a.onerror=r,a.crossOrigin="anonymous",a.decoding="async",a.src=e})}async function dr(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ur(e,t,r){const a="http://www.w3.org/2000/svg",n=document.createElementNS(a,"svg"),i=document.createElementNS(a,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.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"),n.appendChild(i),i.appendChild(e),dr(n)}const B=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||B(r,t)};function mr(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function hr(e,t){return kt(t).map(r=>{const a=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${a}${n?" !important":""};`}).join(" ")}function fr(e,t,r,a){const n=`.${e}:${t}`,i=r.cssText?mr(r):hr(r,a);return document.createTextNode(`${n}{${i}}`)}function ft(e,t,r,a){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=ar();try{t.className=`${t.className} ${l}`}catch{return}const o=document.createElement("style");o.appendChild(fr(l,r,n,a)),t.appendChild(o)}function pr(e,t,r){ft(e,t,":before",r),ft(e,t,":after",r)}const pt="application/font-woff",gt="image/jpeg",gr={woff:pt,woff2:pt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:gt,jpeg:gt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function xr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ve(e){const t=xr(e).toLowerCase();return gr[t]||""}function br(e){return e.split(/,/)[1]}function De(e){return e.search(/^(data:)/)!==-1}function yr(e,t){return`data:${t};base64,${e}`}async function Et(e,t,r){const a=await fetch(e,t);if(a.status===404)throw new Error(`Resource "${a.url}" not found`);const n=await a.blob();return new Promise((i,l)=>{const o=new FileReader;o.onerror=l,o.onloadend=()=>{try{i(r({res:a,result:o.result}))}catch(m){l(m)}},o.readAsDataURL(n)})}const Be={};function wr(e,t,r){let a=e.replace(/\?.*/,"");return r&&(a=e),/ttf|otf|eot|woff2?/i.test(a)&&(a=a.replace(/.*\//,"")),t?`[${t}]${a}`:a}async function Ue(e,t,r){const a=wr(e,t,r.includeQueryParams);if(Be[a]!=null)return Be[a];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Et(e,r.fetchRequestInit,({res:l,result:o})=>(t||(t=l.headers.get("Content-Type")||""),br(o)));n=yr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return Be[a]=n,n}async function vr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ne(t)}async function jr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const o=i.toDataURL();return Ne(o)}const r=e.poster,a=Ve(r),n=await Ue(r,a,t);return Ne(n)}async function _r(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await Re(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Sr(e,t){return B(e,HTMLCanvasElement)?vr(e):B(e,HTMLVideoElement)?jr(e,t):B(e,HTMLIFrameElement)?_r(e,t):e.cloneNode(Nt(e))}const kr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Nt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Cr(e,t,r){var a,n;if(Nt(t))return t;let i=[];return kr(e)&&e.assignedNodes?i=z(e.assignedNodes()):B(e,HTMLIFrameElement)&&(!((a=e.contentDocument)===null||a===void 0)&&a.body)?i=z(e.contentDocument.body.childNodes):i=z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||B(e,HTMLVideoElement)||await i.reduce((l,o)=>l.then(()=>Re(o,r)).then(m=>{m&&t.appendChild(m)}),Promise.resolve()),t}function Er(e,t,r){const a=t.style;if(!a)return;const n=window.getComputedStyle(e);n.cssText?(a.cssText=n.cssText,a.transformOrigin=n.transformOrigin):kt(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),B(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),a.setProperty(i,l,n.getPropertyPriority(i))})}function Nr(e,t){B(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),B(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Rr(e,t){if(B(e,HTMLSelectElement)){const r=t,a=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));a&&a.setAttribute("selected","")}}function $r(e,t,r){return B(t,Element)&&(Er(e,t,r),pr(e,t,r),Nr(e,t),Rr(e,t)),t}async function Tr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const a={};for(let i=0;iSr(a,t)).then(a=>Cr(e,a,t)).then(a=>$r(e,a,t)).then(a=>Tr(a,t))}const Rt=/url\((['"]?)([^'"]+?)\1\)/g,Pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Fr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Lr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Mr(e){const t=[];return e.replace(Rt,(r,a,n)=>(t.push(n),r)),t.filter(r=>!De(r))}async function Ir(e,t,r,a,n){try{const i=r?sr(t,r):t,l=Ve(t);let o;return n||(o=await Ue(i,l,a)),e.replace(Lr(t),`$1${o}$3`)}catch{}return e}function Ar(e,{preferredFontFormat:t}){return t?e.replace(Fr,r=>{for(;;){const[a,,n]=Pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${a};`}}):e}function $t(e){return e.search(Rt)!==-1}async function Tt(e,t,r){if(!$t(e))return e;const a=Ar(e,r);return Mr(a).reduce((i,l)=>i.then(o=>Ir(o,l,t,r)),Promise.resolve(a))}async function ne(e,t,r){var a;const n=(a=t.style)===null||a===void 0?void 0:a.getPropertyValue(e);if(n){const i=await Tt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function Br(e,t){await ne("background",e,t)||await ne("background-image",e,t),await ne("mask",e,t)||await ne("-webkit-mask",e,t)||await ne("mask-image",e,t)||await ne("-webkit-mask-image",e,t)}async function Dr(e,t){const r=B(e,HTMLImageElement);if(!(r&&!De(e.src))&&!(B(e,SVGImageElement)&&!De(e.href.baseVal)))return;const a=r?e.src:e.href.baseVal,n=await Ue(a,Ve(a),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...m)=>{try{i(t.onImageErrorHandler(...m))}catch(x){l(x)}}:l;const o=e;o.decode&&(o.decode=i),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function Hr(e,t){const a=z(e.childNodes).map(n=>Pt(n,t));await Promise.all(a).then(()=>e)}async function Pt(e,t){B(e,Element)&&(await Br(e,t),await Dr(e,t),await Hr(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 a=t.style;return a!=null&&Object.keys(a).forEach(n=>{r[n]=a[n]}),e}const xt={};async function bt(e){let t=xt[e];if(t!=null)return t;const a=await(await fetch(e)).text();return t={url:e,cssText:a},xt[e]=t,t}async function yt(e,t){let r=e.cssText;const a=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let o=l.replace(a,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Et(o,t.fetchRequestInit,({result:m})=>(r=r.replace(l,`url(${m})`),[l,m]))});return Promise.all(i).then(()=>r)}function wt(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let a=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const m=n.exec(a);if(m===null)break;t.push(m[0])}a=a.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(l,"gi");for(;;){let m=i.exec(a);if(m===null){if(m=o.exec(a),m===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;t.push(m[0])}return t}async function Ur(e,t){const r=[],a=[];return e.forEach(n=>{if("cssRules"in n)try{z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let o=l+1;const m=i.href,x=bt(m).then(h=>yt(h,t)).then(h=>wt(h).forEach(y=>{try{n.insertRule(y,y.startsWith("@import")?o+=1:n.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:y,error:v})}})).catch(h=>{console.error("Error loading remote css",h.toString())});a.push(x)}})}catch(i){const l=e.find(o=>o.href==null)||document.styleSheets[0];n.href!=null&&a.push(bt(n.href).then(o=>yt(o,t)).then(o=>wt(o).forEach(m=>{l.insertRule(m,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",i)}}),Promise.all(a).then(()=>(e.forEach(n=>{if("cssRules"in n)try{z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function qr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>$t(t.style.getPropertyValue("src")))}async function Or(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=z(e.ownerDocument.styleSheets),a=await Ur(r,t);return qr(a)}function Ft(e){return e.trim().replace(/["']/g,"")}function Wr(e){const t=new Set;function r(a){(a.style.fontFamily||getComputedStyle(a).fontFamily).split(",").forEach(i=>{t.add(Ft(i))}),Array.from(a.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function zr(e,t){const r=await Or(e,t),a=Wr(e);return(await Promise.all(r.filter(i=>a.has(Ft(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return Tt(i.cssText,l,t)}))).join(` `)}async function Kr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await zr(e,t);if(r){const a=document.createElement("style"),n=document.createTextNode(r);a.appendChild(n),e.firstChild?e.insertBefore(a,e.firstChild):e.appendChild(a)}}async function Gr(e,t={}){const{width:r,height:a}=Ct(e,t),n=await Re(e,t,!0);return await Kr(n,t),await Pt(n,t),Vr(n,t),await ur(n,r,a)}async function Qr(e,t={}){const{width:r,height:a}=Ct(e,t),n=await Gr(e,t),i=await Ne(n),l=document.createElement("canvas"),o=l.getContext("2d"),m=t.pixelRatio||lr(),x=t.canvasWidth||r,h=t.canvasHeight||a;return l.width=x*m,l.height=h*m,t.skipAutoScale||or(l),l.style.width=`${x}`,l.style.height=`${h}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,l.width,l.height)),o.drawImage(i,0,0,l.width,l.height),l}async function Xr(e,t={}){const r=await Qr(e,t);return await cr(r)}const He="#ffffff";function Yr(){return typeof window>"u"?He:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||He}function Jr(e){if(typeof window>"u")return He;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Yr():t}async function Zr(e){var r,a;if(typeof window>"u"||!((a=(r=window.navigator)==null?void 0:r.clipboard)!=null&&a.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 Xr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Jr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const vt=({targetRef:e,label:t})=>{const{toast:r}=Vt(),[a,n]=b.useState("idle"),i=b.useRef(null);b.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=b.useCallback(async()=>{const m=e.current;if(m){n("copying"),m.classList.add("is-capturing"),m.offsetHeight,await new Promise(x=>window.requestAnimationFrame(()=>x()));try{await Zr(m),n("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(()=>n("idle"),1500)}catch(x){n("idle"),r({title:"Copy failed",description:x instanceof Error&&x.message?x.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{m.classList.remove("is-capturing")}}},[e,t,r]),o=a==="copied"?"Copied":a==="copying"?"Copying…":"Copy image";return s.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:a==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[s.jsx(Yt,{name:"copy",size:11}),o]})};function ie(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}const Lt=[{label:"All",maxParametersExclusive:void 0},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function es(e){const t=e===null?void 0:Number(e);return Lt.some(r=>r.maxParametersExclusive===t)?t:void 0}function ts(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function rs(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function ss(e){const t=new Map;for(const r of e){const a=rs(r),n=t.get(a);if(!n){t.set(a,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}n.metrics={...n.metrics,...r.metrics||{}},n.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(n.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!n.hasParameterConflict&&(n.parameterCount===null?n.parameterCount=r.num_parameters:n.parameterCount!==r.num_parameters&&(n.parameterCount=null,n.hasParameterConflict=!0))}return Array.from(t.values())}function jt(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCount{var oe;const y=ie((oe=h.metrics)==null?void 0:oe[t]),v=h.paper_published_date||"";return{eval:h,value:y,date:v}}).filter(h=>h.value!==null&&!!h.date).sort((h,y)=>h.date.localeCompare(y.date)),n=[];let i=null;for(const h of a){const y=i==null?!0:r==="↓"?h.valuei;y&&(i=h.value),n.push({value:h.value,date:h.date,dateLabel:h.date.slice(0,7),modelName:h.eval.model_name||"",paperTitle:h.eval.paper_title||"",paperRouteId:h.eval.paper_arxiv_id||h.eval.paper_id||null,isSota:y})}const o=e.map(h=>{var y;return{eval:h,value:ie((y=h.metrics)==null?void 0:y[t])}}).filter(h=>h.value!==null).sort((h,y)=>r==="↓"?h.value-y.value:y.value-h.value)[0],m=(o==null?void 0:o.value)??0,x=(o==null?void 0:o.eval.model_name)||(o==null?void 0:o.eval.paper_title)||"";return{points:n,sota:m,sotaModel:x}}function ns(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 a=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(a==null?void 0:a[1])??null}function ke(e,t){return e?s.jsx(Ce,{title:e}):t||"—"}const Ss=()=>{var Ge,Qe,Xe,Ye,Je,Ze,et,tt,rt,st,at,nt,it,lt;const{datasetSlug:e}=Ut(),[t,r]=qt(),a=t.get("task")||void 0,n=t.get("eval")||void 0,i=es(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:o}=Ot(),m=b.useRef(null),x=b.useRef(!1),h=b.useRef(null),y=b.useRef(null),[v,oe]=b.useState(null);b.useEffect(()=>{if(!v)return;const c=()=>{v.classList.toggle("has-horizontal-overflow",v.scrollWidth>v.clientWidth)},f=new ResizeObserver(c);return f.observe(v),v.firstElementChild&&f.observe(v.firstElementChild),c(),()=>f.disconnect()},[v]);const[pe,ge]=b.useState(null),K=`${e}:${a||""}`,W=pe===K,_=Z({queryKey:["dataset",e,"with-paper",a,l.hide_closed_source_evals?"open":"all"],queryFn:()=>se.getDatasetBySlug(e,{include_paper:!0,task:a,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),R=Z({queryKey:["dataset-evals",(Ge=_.data)==null?void 0:Ge.id],queryFn:()=>Kt.byDataset(_.data.id),enabled:!!((Qe=_.data)!=null&&Qe.id),staleTime:5*60*1e3}),G=Z({queryKey:["dataset-tasks",(Xe=_.data)==null?void 0:Xe.id],queryFn:()=>se.datasetTasks(_.data.id),enabled:!!((Ye=_.data)!=null&&Ye.id),staleTime:10*60*1e3}),ce=Z({queryKey:["metric-directions"],queryFn:()=>se.metricDirections(),staleTime:60*60*1e3}),F=b.useMemo(()=>{var c;return!n||!((c=R.data)!=null&&c.length)?null:R.data.find(f=>f.id===n)||null},[n,R.data]),w=b.useMemo(()=>{const c=G.data||[];if(c.length===0)return null;if(F!=null&&F.task_id&&c.some(u=>u.id===F.task_id))return F.task_id;if(a){const u=c.find(N=>N.slug===a);if(u)return u.id}if(c.length===1)return c[0].id;const f=R.data||[];if(f.length>0){const u=new Map;for(const k of f)u.set(k.task_id,(u.get(k.task_id)||0)+1);let N=null,P=-1;for(const k of c){const A=u.get(k.id)||0;A>P&&(P=A,N=k.id)}if(N)return N}return c[0].id},[G.data,R.data,a,F]),Q=Z({queryKey:["task-benchmark-trends",w,l.hide_closed_source_evals?!0:void 0],queryFn:()=>se.trendingBenchmarks(w,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!w&&!!((Je=_.data)!=null&&Je.id),staleTime:10*60*1e3}),H=b.useMemo(()=>{var c;return(((c=Q.data)==null?void 0:c.results)||[]).find(f=>{var u;return f.id===((u=_.data)==null?void 0:u.id)})||null},[Q.data,(Ze=_.data)==null?void 0:Ze.id]),ee=Z({queryKey:["leaderboard-metrics",(et=_.data)==null?void 0:et.id,w],queryFn:()=>se.leaderboardMetrics(_.data.id,w),enabled:!!((tt=_.data)!=null&&tt.id)&&!!w,staleTime:10*60*1e3}),de=b.useMemo(()=>er(R.data,w,l.hide_closed_source_evals),[R.data,w,l.hide_closed_source_evals]),ue=de.visible,X=de.hiddenClosed,V=de.topHiddenClosed,L=b.useMemo(()=>ss(ue),[ue]),me=b.useMemo(()=>jt(L,i),[L,i]),xe=b.useMemo(()=>{const c=new Set;return L.forEach(f=>{f.best_metric&&c.add(f.best_metric),Object.keys(f.metrics||{}).forEach(u=>c.add(u))}),Array.from(c)},[L]),Y=b.useMemo(()=>(ee.data||[]).map(c=>c.metric_name),[ee.data]),M=Y.length?Y:xe,be=b.useMemo(()=>{var N,P;if(L.length===0)return M[0]||"";const c=new Map;for(const k of L){const A=k.best_metric;!A||ie((N=k.metrics)==null?void 0:N[A])===null||Y.length&&!M.includes(A)||c.set(A,(c.get(A)||0)+1)}let f=null,u=0;for(const[k,A]of c)A>u&&(u=A,f=k);return f||M[0]||((P=L[0])==null?void 0:P.best_metric)||""},[L,M,Y]),d=(rt=t.get("metric"))==null?void 0:rt.trim(),g=(d?M.find(c=>c.toLocaleLowerCase()===d.toLocaleLowerCase()):void 0)||(F==null?void 0:F.best_metric)||be,C=(((at=(st=ce.data)==null?void 0:st.directions)==null?void 0:at[g])||"higher_is_better")==="lower_is_better"?"↓":"↑",j=b.useMemo(()=>!g||!M.includes(g)?M:[g,...M.filter(c=>c!==g)],[M,g]),I=b.useMemo(()=>j.length===0?g?[g]:[]:W?j:j.slice(0,1),[j,g,W]),{points:q,sota:qe,sotaModel:ye}=b.useMemo(()=>as(me,g,C),[me,g,C]),O=i===void 0?(nt=_.data)==null?void 0:nt.leaderboard_summary:void 0,he=R.isSuccess&&G.isSuccess&&ce.isSuccess&&(!w||ee.isSuccess),Oe=he?g:O==null?void 0:O.metric,Mt=he?qe:O==null?void 0:O.value,We=he?ye:O==null?void 0:O.model_name,It=!he&&!O,we=i!==void 0&&!he;b.useEffect(()=>{if(x.current||!n||!R.data||R.data.length===0)return;const c=m.current;c&&(x.current=!0,c.scrollIntoView({behavior:"smooth",block:"start"}))},[n,R.data]);const U=b.useMemo(()=>{const c=G.data||[];return w?c.find(f=>f.id===w)||c[0]||null:c[0]||null},[G.data,w]),$e=Z({queryKey:["area",U==null?void 0:U.area_id],queryFn:()=>se.getArea(U.area_id),enabled:!!(U!=null&&U.area_id),staleTime:10*60*1e3});if(_.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(Se,{className:"h-12 w-1/2 mb-6"}),s.jsx(Se,{className:"h-64 w-full"})]});if(_.error||!_.data)return s.jsx("div",{className:"page",children:s.jsx(Gt,{variant:"destructive",children:s.jsx(Qt,{children:"Benchmark not found."})})});const E=_.data,ve=me.slice().sort((c,f)=>{var P,k;const u=ie((P=c.metrics)==null?void 0:P[g]),N=ie((k=f.metrics)==null?void 0:k[g]);return u!==null&&N!==null?C==="↓"?u-N:N-u:u!==null?-1:N!==null?1:St(c,g)-St(f,g)}),je=!!E.supports_harness,Te={parameter_coverage_known:L.filter(c=>c.parameterCount!==null).length,parameter_coverage_total:L.length},ze=Te.parameter_coverage_known>0,At=c=>jt(L,c).length>0,Ke=c=>{r(f=>{const u=new URLSearchParams(f);return c===void 0?u.delete("max_parameters_exclusive"):u.set("max_parameters_exclusive",String(c)),u})},Pe=c=>{r(f=>{const u=new URLSearchParams(f);return u.set("metric",c),u})},$=n&&ve.find(c=>_t(c,n))||null,T=E.introducing_paper??void 0,fe=(T==null?void 0:T.arxiv_id)||(T==null?void 0:T.id)||ns(E.paper_url),J=(T==null?void 0:T.title)||E.introducing_paper_title||null,te=((it=T==null?void 0:T.published)==null?void 0:it.slice(0,4))||E.introduced_year||null,Bt=!!fe||!!E.paper_url||!!J,Dt=T!=null&&T.arxiv_id||(lt=E.paper_url)!=null&<.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${fe}`:`Paper ${fe}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(re,{to:"/tasks",children:"Tasks"}),$e.data&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(re,{to:`/tasks#area-${Zt($e.data.name)}`,children:$e.data.name})]}),U&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(re,{to:`/tasks/${U.slug||U.id}`,children:U.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:E.name})]}),s.jsxs("div",{className:"bm-title-row",children:[s.jsx("h1",{className:"bm-title",children:E.name}),H&&s.jsxs("div",{className:"bm-title-trend","aria-label":`${E.name} reporting trend`,children:[s.jsx(Xt,{history:H.history,benchmarkName:H.name}),s.jsxs("span",{className:"bm-title-trend-summary",children:[s.jsx("strong",{children:H.recent_paper_count})," ",H.recent_paper_count===1?"paper":"papers",H.rate_change==null?H.recent_paper_count>0&&s.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):s.jsxs("span",{className:`benchmark-trend-change ${H.rate_change>=1?"is-up":"is-down"}`,children:[H.rate_change>=1?"↑":"↓"," ",H.rate_change.toFixed(1),"×"]})]})]})]}),s.jsxs("div",{className:"bm-subtitle",children:[It?s.jsx(Se,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):s.jsxs("span",{children:[Oe&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:Oe}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),We?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:le(Mt)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:We})]}):s.jsxs("span",{children:[ve.length," evaluations"]})]}),E.hf_url&&s.jsxs("a",{className:"bm-action-btn",href:E.hf_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),E.description&&s.jsx("p",{className:"bm-description",children:E.description}),l.hide_closed_source_evals&&X.length>0&&s.jsxs("div",{className:"bm-hidden-closed-notice",children:[s.jsxs("span",{children:[X.length," closed-source ",X.length===1?"row is":"rows are"," hidden",V!=null&&V.model_name?s.jsxs(s.Fragment,{children:[", including ",s.jsx("strong",{children:V.model_name})]}):null,"."]}),s.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{o(!1)},children:"Show closed-source"})]}),Bt&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),fe?s.jsxs(re,{to:`/paper/${fe}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:J?s.jsx(Ce,{title:J}):Dt}),te&&s.jsx("span",{className:"method-source-meta",children:te})]}):E.paper_url?s.jsxs("a",{href:Jt(E.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:J?s.jsx(Ce,{title:J}):E.paper_url}),te&&s.jsx("span",{className:"method-source-meta",children:te})]}):s.jsxs("div",{className:"method-source-link is-static",children:[s.jsx("span",{className:"method-source-title",children:J?s.jsx(Ce,{title:J}):null}),te&&s.jsx("span",{className:"method-source-meta",children:te})]})]}),!we&&q.length>0&&s.jsxs("div",{className:"bm-card",ref:h,children:[s.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[s.jsxs("div",{className:"bm-card-screenshot-title",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:E.name})]}),s.jsxs("div",{className:"bm-card-screenshot-brand",children:[s.jsxs("span",{className:"brand",children:[s.jsx("span",{className:"brand-mark"}),s.jsxs("span",{className:"brand-name",children:["Papers ",s.jsx("em",{children:"With Code"})]})]}),s.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),s.jsxs("div",{className:"bm-card-actions",children:[M.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:g,onChange:c=>Pe(c.target.value),children:j.map(c=>s.jsx("option",{value:c,children:c},c))})]}),s.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[s.jsx(mt,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:c=>{o(!c)},"aria-label":"Show closed-source models"}),s.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),s.jsx(vt,{targetRef:h,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(rr,{points:q,metric:g})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),i===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),$&&(()=>{var P,k;const c=$.paper_arxiv_id||$.paper_id,f=$.paper_title||($.paper_arxiv_id?`arXiv:${$.paper_arxiv_id}`:null),u=$.best_metric&&((P=$.metrics)==null?void 0:P[$.best_metric])!==void 0?$.best_metric:g,N=(k=$.metrics)==null?void 0:k[u];return s.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[s.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),s.jsxs("div",{className:"bm-highlight-text",children:[s.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),s.jsxs("span",{className:"bm-highlight-paper",children:[$.model_name||f||"—",$.harness?` · ${$.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[N!==void 0&&u?s.jsxs(s.Fragment,{children:[u,": ",le(N),f?" · ":""]}):null,c?s.jsx(re,{to:`/paper/${c}`,children:ke($.paper_title,f)}):ke($.paper_title,f)]})]})]})})(),s.jsxs("div",{className:"bm-card",ref:y,children:[s.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[s.jsxs("div",{className:"bm-card-screenshot-title",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:E.name})]}),s.jsxs("div",{className:"bm-card-screenshot-brand",children:[s.jsxs("span",{className:"brand",children:[s.jsx("span",{className:"brand-mark"}),s.jsxs("span",{className:"brand-name",children:["Papers ",s.jsx("em",{children:"With Code"})]})]}),s.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),s.jsxs("div",{className:"bm-card-actions",children:[M.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:g,onChange:c=>Pe(c.target.value),children:j.map(c=>s.jsx("option",{value:c,children:c},c))})]}),s.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[s.jsx(mt,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:c=>{o(!c)},"aria-label":"Show closed-source models"}),s.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!we&&!ze&&R.isSuccess?s.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,s.jsx(vt,{targetRef:y,label:"leaderboard"})]})]}),!we&&ze&&s.jsxs("div",{className:"bm-parameter-filter-bar",children:[s.jsx("span",{className:"bm-parameter-filter-label",children:"Parameters Size"}),s.jsx("div",{className:"bm-parameter-filter-options",role:"group","aria-label":"Filter leaderboard by parameter size",children:Lt.map(c=>{const f=i===c.maxParametersExclusive,u=!f&&!At(c.maxParametersExclusive);return s.jsx("button",{type:"button",className:`bm-parameter-filter-option${f?" is-active":""}`,"aria-pressed":f,disabled:u,onClick:()=>Ke(c.maxParametersExclusive),children:c.label},c.label)})}),s.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",Te.parameter_coverage_known," of ",Te.parameter_coverage_total," entries"]})]}),R.isLoading||we?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((c,f)=>s.jsx(Se,{className:"h-10 w-full mb-2"},f))}):ve.length===0?i?s.jsxs("div",{className:"no-results",children:["No known parameter counts match this filter. "," ",s.jsx("button",{type:"button",className:"bm-empty-filter-action",onClick:()=>Ke(void 0),children:"Show all"})]}):s.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):s.jsxs(s.Fragment,{children:[j.length>1&&s.jsxs("div",{className:"bm-metric-columns-control",children:[s.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":W,"aria-controls":"benchmark-leaderboard",onClick:()=>ge(W?null:K),children:W?"Show selected metric only":`Show more metrics (${j.length-1})`}),W&&s.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),s.jsx("div",{ref:oe,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:s.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":I.length,"--bm-harness-count":je?1:0},children:[s.jsxs("colgroup",{children:[s.jsx("col",{className:"bm-width-rank"}),s.jsx("col",{className:"bm-width-model"}),s.jsx("col",{className:"bm-width-parameters"}),je&&s.jsx("col",{className:"bm-width-harness"}),I.map(c=>s.jsx("col",{className:"bm-width-metric"},c)),s.jsx("col",{}),s.jsx("col",{className:"bm-width-year"})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"col-rank",children:"Rank"}),s.jsx("th",{className:"col-model",children:"Model"}),s.jsx("th",{className:"col-parameters",children:"Parameters"}),je&&s.jsx("th",{className:"col-harness",children:"Harness"}),I.map(c=>{const f=c===g;return s.jsx("th",{className:`col-value ${f?"is-active":""}`,"aria-sort":f?C==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>Pe(c),"aria-pressed":f,title:`Sort by ${c}`,children:[c,f?` ${C}`:""]})},c)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let c=null,f=0;return ve.map((u,N)=>{var ot,ct;const P=ie((ot=u.metrics)==null?void 0:ot[g]);let k=null;P!==null&&((c===null||P!==c)&&(f=N+1,c=P),k=f);const A=u.paper_arxiv_id||u.paper_id,Fe=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null),Le=_t(u,n);return s.jsxs("tr",{ref:Le?m:void 0,className:Le?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:k??"—"}),s.jsxs("td",{className:"col-model",children:[Le&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?s.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&s.jsx(Wt,{}),(u.external??u.is_external)&&s.jsx(zt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),s.jsx("td",{className:"col-parameters",title:u.parameterCount===null?void 0:u.parameterCount.toLocaleString("en-US"),"aria-label":u.parameterCount===null?"Parameters unknown":`${u.parameterCount.toLocaleString("en-US")} parameters`,children:u.parameterCount===null?"—":ts(u.parameterCount)}),je&&s.jsx("td",{className:"col-harness",children:u.harness||"—"}),I.map(Me=>{var ut;const dt=Me===g,_e=(ut=u.metrics)==null?void 0:ut[Me];return s.jsx("td",{className:`col-value${dt?" is-active":""}${dt&&k===1?" is-best":""}`,children:_e!=null&&_e!==""?le(_e):"—"},Me)}),s.jsx("td",{className:"col-paper",children:A?s.jsx(re,{to:`/paper/${A}`,title:u.paper_title||Fe||void 0,children:ke(u.paper_title,Fe)}):ke(u.paper_title,Fe)}),s.jsx("td",{className:"col-year",children:((ct=u.paper_published_date)==null?void 0:ct.slice(0,4))||"—"})]},u.id)})})()})]})})]})]})]})})};export{Ss as default}; diff --git a/assets/BenchmarkTrendSparkline-BQbrYdWs.js b/assets/BenchmarkTrendSparkline-DrH77nK8.js similarity index 97% rename from assets/BenchmarkTrendSparkline-BQbrYdWs.js rename to assets/BenchmarkTrendSparkline-DrH77nK8.js index 0e6d23a56b6f50a4979c199acc47429f25ff151a..4d8df8c2b9bb99fb3f9a59b2447470c9551880a4 100644 --- a/assets/BenchmarkTrendSparkline-BQbrYdWs.js +++ b/assets/BenchmarkTrendSparkline-DrH77nK8.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-C7DzD1KZ.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-DB5YVNrt.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/ChatView-BoBPZNMN.js b/assets/ChatView-BSLUlS0a.js similarity index 98% rename from assets/ChatView-BoBPZNMN.js rename to assets/ChatView-BSLUlS0a.js index 6de69ad2f530b91502a1c802db34471f7cbf665c..571d767dcf47be4ddc3b01eb5ef338b673dcab10 100644 --- a/assets/ChatView-BoBPZNMN.js +++ b/assets/ChatView-BSLUlS0a.js @@ -1,4 +1,4 @@ -var Qt=Object.defineProperty;var Xt=(r,t,e)=>t in r?Qt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var je=(r,t,e)=>Xt(r,typeof t!="symbol"?t+"":t,e);import{e as Jt,A as Zt,Q as er,r as c,j as s,X as tr,f as Yt,z as ft,u as rr,b as nr,c as sr,a as ar,h as ir,S as or,L as kt,d as cr}from"./index-C7DzD1KZ.js";import{u as lr}from"./useQuery-C-S9qU90.js";import{C as ur,U as It,b as dr,c as Ve,u as fr,d as pr,A as hr,a as mr}from"./ArtifactWorkspace-BYg5RxLy.js";import{c as Ge}from"./chat-CYCaJ4hM.js";import{e as gr,f as qt,h as yr,T as _r,d as Bt,i as br,j as wr,k as vr,l as $e,m as xr,t as At,n as ct,o as Ut,r as Rr,S as Sr,a as Er,D as Tr,s as kr,v as Ir,w as lt,x as at,y as Ar,z as it,B as ot,E as Or,F as Cr,G as jr,H as pt,I as Dr}from"./chatLaunch-CJaFcfv2.js";import{S as Mr}from"./chatPrompts-CDY3UGU1.js";import{u as Lr,O as Nr}from"./openrouter-CeZ4KorQ.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CD-KpVUV.js";import"./github-CBv5TgZv.js";import"./github-BPMZ1b4l.js";import"./PaperPreviewLink-BVh6NMiG.js";import"./index-1iwK_I9Y.js";import"./papers-BNcOWLi8.js";import"./file-text-BW4Xze_N.js";import"./useMutation-m57QFYBa.js";import"./external-link-DY1V39Iz.js";import"./chevron-down-BVSdU_Yo.js";/** +var Qt=Object.defineProperty;var Xt=(r,t,e)=>t in r?Qt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var je=(r,t,e)=>Xt(r,typeof t!="symbol"?t+"":t,e);import{e as Jt,A as Zt,Q as er,r as c,j as s,X as tr,f as Yt,z as ft,u as rr,b as nr,c as sr,a as ar,h as ir,S as or,L as kt,d as cr}from"./index-DB5YVNrt.js";import{u as lr}from"./useQuery-gfOJVfRZ.js";import{C as ur,U as It,b as dr,c as Ve,u as fr,d as pr,A as hr,a as mr}from"./ArtifactWorkspace-DGDexY_Q.js";import{c as Ge}from"./chat-C792FSN8.js";import{e as gr,f as qt,h as yr,T as _r,d as Bt,i as br,j as wr,k as vr,l as $e,m as xr,t as At,n as ct,o as Ut,r as Rr,S as Sr,a as Er,D as Tr,s as kr,v as Ir,w as lt,x as at,y as Ar,z as it,B as ot,E as Or,F as Cr,G as jr,H as pt,I as Dr}from"./chatLaunch-DPlGkVok.js";import{S as Mr}from"./chatPrompts-CDY3UGU1.js";import{u as Lr,O as Nr}from"./openrouter-DZnDVTdj.js";import"./katex.min-BSBacQyE.js";import"./hover-card-De01BraD.js";import"./github-nBYzmzBK.js";import"./github-CYSQLKIg.js";import"./PaperPreviewLink-Bi7j2lR1.js";import"./index-CeWrpp9N.js";import"./papers-CTasJek9.js";import"./file-text-Dqp9ANqN.js";import"./useMutation-Bi00GAL7.js";import"./external-link-CwxK3W8X.js";import"./chevron-down-CLKJ3Wue.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ConferenceDetailView-CPaA44iW.js b/assets/ConferenceDetailView-BO1fOFQD.js similarity index 93% rename from assets/ConferenceDetailView-CPaA44iW.js rename to assets/ConferenceDetailView-BO1fOFQD.js index 7bf2bc0a23be94897369a13138122f8da89a1820..5a2d1a98ecaddae8c246dd0a7eeec2feb0cc0067 100644 --- a/assets/ConferenceDetailView-CPaA44iW.js +++ b/assets/ConferenceDetailView-BO1fOFQD.js @@ -1 +1 @@ -import{u as L,r as D,j as e,L as p}from"./index-C7DzD1KZ.js";import{u as T}from"./useQuery-C-S9qU90.js";import{M as F}from"./MarkdownText-8HaaKP15.js";import{c as A}from"./catalog-DU92Rh6k.js";import{c as B,h as C,d as E}from"./transform-Dk33Ziw-.js";import{S as f}from"./skeleton-BBQyes8J.js";import{A as P,a as z}from"./alert-D1jsfsn6.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BVh6NMiG.js";import"./index-1iwK_I9Y.js";import"./hover-card-CD-KpVUV.js";import"./papers-BNcOWLi8.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},ee=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?O(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{ee as default}; +import{u as L,r as D,j as e,L as p}from"./index-DB5YVNrt.js";import{u as T}from"./useQuery-gfOJVfRZ.js";import{M as F}from"./MarkdownText-tXCrsggq.js";import{c as A}from"./catalog-HFAZrKSg.js";import{c as B,h as C,d as E}from"./transform-CnBvOSlq.js";import{S as f}from"./skeleton-jY-za2d8.js";import{A as P,a as z}from"./alert-BPNeeF4s.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Bi7j2lR1.js";import"./index-CeWrpp9N.js";import"./hover-card-De01BraD.js";import"./papers-CTasJek9.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},ee=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?O(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{ee as default}; diff --git a/assets/ConferenceTaskView-CfOzYvBh.js b/assets/ConferenceTaskView-CP0FthV6.js similarity index 88% rename from assets/ConferenceTaskView-CfOzYvBh.js rename to assets/ConferenceTaskView-CP0FthV6.js index 6095674cee83bdf72da18ade3bb708a92ecdbf6c..517d36447661ce14427a317a6370271720fb8968 100644 --- a/assets/ConferenceTaskView-CfOzYvBh.js +++ b/assets/ConferenceTaskView-CP0FthV6.js @@ -1 +1 @@ -import{u as $,c as W,r as P,j as e,L as y,z as G}from"./index-C7DzD1KZ.js";import{u as M}from"./useQuery-C-S9qU90.js";import{P as J}from"./components-BV3lUGf1.js";import{b as X,u as Y,P as Z,a as ee,c as se}from"./useIntersectionObserver-CSNffbhV.js";import{M as h}from"./MarkdownText-8HaaKP15.js";import{c as z}from"./catalog-DU92Rh6k.js";import{t as ae,d as te}from"./transform-Dk33Ziw-.js";import{d as re}from"./usePapers-CHyBH3Xk.js";import{S as ne}from"./skeleton-BBQyes8J.js";import{A as ie,a as oe}from"./alert-D1jsfsn6.js";import"./LatexTitle-DuT2lumP.js";import"./katex.min-BSBacQyE.js";import"./papers-BNcOWLi8.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CQWB7HGQ.js";import"./PaperPreviewLink-BVh6NMiG.js";import"./index-1iwK_I9Y.js";import"./hover-card-CD-KpVUV.js";import"./useInfiniteQuery-DZ6ASWY6.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Ce=()=>{var A,L,O,T,B,D;const{confSlug:t,taskSlug:n}=$(),[o,u]=W(),w=le(o.get("order_by")),S=o.get("has_code")==="true",k=o.get("has_hf_artifacts")==="true",x=X(o),I=a=>{const s=new URLSearchParams(o);s.set("order_by",a),u(s)},q=a=>{const s=new URLSearchParams(o);a?s.set("has_code","true"):s.delete("has_code"),u(s)},Q=a=>{const s=new URLSearchParams(o);a?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),u(s)},R=n==="all",N=n==="oral",_=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",f=l||d,p=R||N||_||l||d,K=p?void 0:n,U=N?"oral":_?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",t],queryFn:()=>z.getConference(t),enabled:!!t,staleTime:10*60*1e3}),j=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=re({conferenceSlug:t||"",taskSlug:K,presentation:U,page_size:12,order_by:w,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:k,start_date:x.startDate,end_date:x.endDate,enabled:!!t}),{targetRef:V,isIntersecting:C}=Y({rootMargin:"200px"});P.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),P.useEffect(()=>{window.scrollTo(0,0)},[t,n]);const v=P.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(c=>c.results)},[i.data]),b=P.useMemo(()=>v.map(ae),[v]),g=R?"All papers":N?"Oral papers":_?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":te(((A=j.data)==null?void 0:A.name)||n||"",((L=j.data)==null?void 0:L.slug)||n),F=((T=(O=i.data)==null?void 0:O.pages[0])==null?void 0:T.count)??((B=m.data)==null?void 0:B.paper_count)??0,r=j.data;return m.error||j.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(oe,{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(y,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:`/conferences/${t}`,children:((D=m.data)==null?void 0:D.name)??t}),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&&t==="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&&t==="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&&t==="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:F.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:a=>{var s,c;(c=(s=a.currentTarget.parentElement)==null?void 0:s.parentElement)==null||c.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:f?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",F.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!f&&e.jsx("div",{className:"sort-options",children:ce.map(([a,s])=>e.jsx("button",{className:`sort-btn ${w===a?"active":""}`,onClick:()=>I(a),children:s},a))}),e.jsx(Z,{hasCode:S,hasHfArtifacts:k,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!f})]}),e.jsx(ee,{startDate:x.startDate,endDate:x.endDate,onChange:a=>u(se(o,a))}),!f&&e.jsxs("div",{className:"results-count",children:[b.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,s)=>e.jsx(ne,{className:"h-40 w-full"},s))}):b.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:b.map((a,s)=>{var E;const c=(E=v[s])==null?void 0:E.conference_award,H=c==="outstanding"?"Outstanding Paper":c==="honorable_mention"?"Honorable Mention":c==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(G.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(J,{paper:a,rank:s+1})]},a.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{Ce as default}; +import{u as $,c as W,r as P,j as e,L as y,z as G}from"./index-DB5YVNrt.js";import{u as M}from"./useQuery-gfOJVfRZ.js";import{P as J}from"./components--1z4Qw5F.js";import{b as X,u as Y,P as Z,a as ee,c as se}from"./useIntersectionObserver-CmsvWF1K.js";import{M as h}from"./MarkdownText-tXCrsggq.js";import{c as z}from"./catalog-HFAZrKSg.js";import{t as ae,d as te}from"./transform-CnBvOSlq.js";import{d as re}from"./usePapers-CT5co6TZ.js";import{S as ne}from"./skeleton-jY-za2d8.js";import{A as ie,a as oe}from"./alert-BPNeeF4s.js";import"./LatexTitle-DcOGOHZH.js";import"./katex.min-BSBacQyE.js";import"./papers-CTasJek9.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BqJw3haa.js";import"./PaperPreviewLink-Bi7j2lR1.js";import"./index-CeWrpp9N.js";import"./hover-card-De01BraD.js";import"./useInfiniteQuery-CqugEgpc.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Ce=()=>{var A,L,O,T,B,D;const{confSlug:t,taskSlug:n}=$(),[o,u]=W(),w=le(o.get("order_by")),S=o.get("has_code")==="true",k=o.get("has_hf_artifacts")==="true",x=X(o),I=a=>{const s=new URLSearchParams(o);s.set("order_by",a),u(s)},q=a=>{const s=new URLSearchParams(o);a?s.set("has_code","true"):s.delete("has_code"),u(s)},Q=a=>{const s=new URLSearchParams(o);a?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),u(s)},R=n==="all",N=n==="oral",_=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",f=l||d,p=R||N||_||l||d,K=p?void 0:n,U=N?"oral":_?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",t],queryFn:()=>z.getConference(t),enabled:!!t,staleTime:10*60*1e3}),j=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=re({conferenceSlug:t||"",taskSlug:K,presentation:U,page_size:12,order_by:w,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:k,start_date:x.startDate,end_date:x.endDate,enabled:!!t}),{targetRef:V,isIntersecting:C}=Y({rootMargin:"200px"});P.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),P.useEffect(()=>{window.scrollTo(0,0)},[t,n]);const v=P.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(c=>c.results)},[i.data]),b=P.useMemo(()=>v.map(ae),[v]),g=R?"All papers":N?"Oral papers":_?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":te(((A=j.data)==null?void 0:A.name)||n||"",((L=j.data)==null?void 0:L.slug)||n),F=((T=(O=i.data)==null?void 0:O.pages[0])==null?void 0:T.count)??((B=m.data)==null?void 0:B.paper_count)??0,r=j.data;return m.error||j.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(oe,{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(y,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:`/conferences/${t}`,children:((D=m.data)==null?void 0:D.name)??t}),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&&t==="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&&t==="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&&t==="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:F.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:a=>{var s,c;(c=(s=a.currentTarget.parentElement)==null?void 0:s.parentElement)==null||c.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:f?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",F.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!f&&e.jsx("div",{className:"sort-options",children:ce.map(([a,s])=>e.jsx("button",{className:`sort-btn ${w===a?"active":""}`,onClick:()=>I(a),children:s},a))}),e.jsx(Z,{hasCode:S,hasHfArtifacts:k,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!f})]}),e.jsx(ee,{startDate:x.startDate,endDate:x.endDate,onChange:a=>u(se(o,a))}),!f&&e.jsxs("div",{className:"results-count",children:[b.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,s)=>e.jsx(ne,{className:"h-40 w-full"},s))}):b.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:b.map((a,s)=>{var E;const c=(E=v[s])==null?void 0:E.conference_award,H=c==="outstanding"?"Outstanding Paper":c==="honorable_mention"?"Honorable Mention":c==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(G.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(J,{paper:a,rank:s+1})]},a.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{Ce as default}; diff --git a/assets/ConferencesIndexView-BiodHb35.js b/assets/ConferencesIndexView-CXeV-ywe.js similarity index 85% rename from assets/ConferencesIndexView-BiodHb35.js rename to assets/ConferencesIndexView-CXeV-ywe.js index 3a6e5f4fbf72579cb848121a983e1220f6f02cd8..a57c2b8b98773e3e7f4e55d4ccbb19b7f1e1eb95 100644 --- a/assets/ConferencesIndexView-BiodHb35.js +++ b/assets/ConferencesIndexView-CXeV-ywe.js @@ -1 +1 @@ -import{r as p,j as e,L as d}from"./index-C7DzD1KZ.js";import{u}from"./useQuery-C-S9qU90.js";import{c as f}from"./catalog-DU92Rh6k.js";import{S as m}from"./skeleton-BBQyes8J.js";import{A as h,a as g}from"./alert-D1jsfsn6.js";import{T as x}from"./TaxonomySuggestionTile-CRddUpOR.js";import"./SignInToEditDialog-BrT1YrXZ.js";import"./button-B2L1cddC.js";import"./input-B4Wwo7mm.js";import"./textarea-BWN21nu7.js";import"./searchable-select-B8y6G69L.js";import"./popover-CQWB7HGQ.js";import"./dialog-vRXA8k-N.js";import"./loader-circle-Bp8rZ20U.js";import"./useMutation-m57QFYBa.js";import"./submissions-Du_vtued.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)"},q=()=>{const r=u({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=p.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{q as default}; +import{r as p,j as e,L as d}from"./index-DB5YVNrt.js";import{u}from"./useQuery-gfOJVfRZ.js";import{c as f}from"./catalog-HFAZrKSg.js";import{S as m}from"./skeleton-jY-za2d8.js";import{A as h,a as g}from"./alert-BPNeeF4s.js";import{T as x}from"./TaxonomySuggestionTile-5FXmjrqa.js";import"./SignInToEditDialog-CGuRD5vY.js";import"./button-BvgK708w.js";import"./input-DnxeMTC9.js";import"./textarea-rFUixZHL.js";import"./searchable-select-Bw0OPNzm.js";import"./popover-BqJw3haa.js";import"./dialog-CSh5S1Qx.js";import"./loader-circle-uWjxppt1.js";import"./useMutation-Bi00GAL7.js";import"./submissions-B7ABJ5o_.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)"},q=()=>{const r=u({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=p.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{q as default}; diff --git a/assets/CronDashboard-BXRwEuKL.js b/assets/CronDashboard-BVydZ-r3.js similarity index 98% rename from assets/CronDashboard-BXRwEuKL.js rename to assets/CronDashboard-BVydZ-r3.js index 9c031df6f07596fa64545e86340111b497f57f45..39bd4f96b0b79204d1dbdf9b351e28fd2c0e5f51 100644 --- a/assets/CronDashboard-BXRwEuKL.js +++ b/assets/CronDashboard-BVydZ-r3.js @@ -1,4 +1,4 @@ -import{e as q,r as h,v as ss,l as as,j as e,k as ce,W as rs,R as ns,I as ts,o as me,P as is,q as cs,w as Pe,s as F,h as Re,L as xe,a as ls,d as ds}from"./index-C7DzD1KZ.js";import{u as V}from"./useQuery-C-S9qU90.js";import{f as _,A as te,C as v,a as b,b as y,c as E,d as f,o as ve}from"./operations-DxpN2fk3.js";import{B as C}from"./badge-a2iv4Ds7.js";import{B as S}from"./button-B2L1cddC.js";import{C as os}from"./chevron-down-BVSdU_Yo.js";import{D as fe,r as ms,f as us,h as hs,j as xs,p as ps,k as js}from"./codexAddEvals-Bq9ZcPuq.js";import{F as _e}from"./file-text-BW4Xze_N.js";import{S as Fe}from"./shield-alert-BX1GxHfp.js";import{E as ee}from"./external-link-DY1V39Iz.js";import{C as se,R as Ne}from"./refresh-cw-CUIhAWJ4.js";import{L as M}from"./loader-circle-Bp8rZ20U.js";import{C as pe}from"./circle-check-DYBHjpYw.js";import{u as U}from"./useMutation-m57QFYBa.js";import{u as gs}from"./useInfiniteQuery-DZ6ASWY6.js";import{p as Te}from"./paperEdits-B067dmC0.js";import{c as ue}from"./catalog-DU92Rh6k.js";import{c as be}from"./chat-CYCaJ4hM.js";/** +import{e as q,r as h,v as ss,l as as,j as e,k as ce,W as rs,R as ns,I as ts,o as me,P as is,q as cs,w as Pe,s as F,h as Re,L as xe,a as ls,d as ds}from"./index-DB5YVNrt.js";import{u as V}from"./useQuery-gfOJVfRZ.js";import{f as _,A as te,C as v,a as b,b as y,c as E,d as f,o as ve}from"./operations-CJQ0CXcc.js";import{B as C}from"./badge-C_UuzwL3.js";import{B as S}from"./button-BvgK708w.js";import{C as os}from"./chevron-down-CLKJ3Wue.js";import{D as fe,r as ms,f as us,h as hs,j as xs,p as ps,k as js}from"./codexAddEvals-QYl6p5qH.js";import{F as _e}from"./file-text-Dqp9ANqN.js";import{S as Fe}from"./shield-alert-TqnwXhnw.js";import{E as ee}from"./external-link-CwxK3W8X.js";import{C as se,R as Ne}from"./refresh-cw-HoaNTnTk.js";import{L as M}from"./loader-circle-uWjxppt1.js";import{C as pe}from"./circle-check-BPVxNUGc.js";import{u as U}from"./useMutation-Bi00GAL7.js";import{u as gs}from"./useInfiniteQuery-CqugEgpc.js";import{p as Te}from"./paperEdits-D718tWaT.js";import{c as ue}from"./catalog-HFAZrKSg.js";import{c as be}from"./chat-C792FSN8.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ExternalSourceEvalBadge-DAotgKUq.js b/assets/ExternalSourceEvalBadge-BZEagV7N.js similarity index 94% rename from assets/ExternalSourceEvalBadge-DAotgKUq.js rename to assets/ExternalSourceEvalBadge-BZEagV7N.js index 4c9a0b2da2a32b28ddd9dc1e19a4ac4418342691..c859cbcc2f1476c3d0316cadb636baa3dc49f6cd 100644 --- a/assets/ExternalSourceEvalBadge-DAotgKUq.js +++ b/assets/ExternalSourceEvalBadge-BZEagV7N.js @@ -1 +1 @@ -import{a as l}from"./papers-BNcOWLi8.js";import{$ as h,j as a,L as u}from"./index-C7DzD1KZ.js";import{H as c,a as d,b as p}from"./hover-card-CD-KpVUV.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";class m{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(r=>r[1]!==void 0).map(([r,n])=>[r,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"})}async byLeaderboard(e,t,r={}){return this.allPages({dataset_id:Number(e),task_id:Number(t),ordering:"best_rank",...r})}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 r=await this.list({...e,page_size:100}),n=[...r.results];let i=r.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const w=new m(h),S=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function b(s){if(!s)return"Evaluation sourced outside this paper";const e=s.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(s,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return s}}const j=({sourceUrl:s})=>{const e=g(s),t=typeof s=="string"&&s.startsWith("/paper/")?s:null,r=b(s);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: ${r}`,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:r}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):a.jsxs(a.Fragment,{children:[" ",r,"."]})]})]})};export{S as C,j as E,w as e}; +import{a as l}from"./papers-CTasJek9.js";import{$ as h,j as a,L as u}from"./index-DB5YVNrt.js";import{H as c,a as d,b as p}from"./hover-card-De01BraD.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";class m{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(r=>r[1]!==void 0).map(([r,n])=>[r,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"})}async byLeaderboard(e,t,r={}){return this.allPages({dataset_id:Number(e),task_id:Number(t),ordering:"best_rank",...r})}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 r=await this.list({...e,page_size:100}),n=[...r.results];let i=r.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const w=new m(h),S=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function b(s){if(!s)return"Evaluation sourced outside this paper";const e=s.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(s,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return s}}const j=({sourceUrl:s})=>{const e=g(s),t=typeof s=="string"&&s.startsWith("/paper/")?s:null,r=b(s);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: ${r}`,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:r}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):a.jsxs(a.Fragment,{children:[" ",r,"."]})]})]})};export{S as C,j as E,w as e}; diff --git a/assets/FeedView-B-4sZVtZ.js b/assets/FeedView-LQ-88lWw.js similarity index 91% rename from assets/FeedView-B-4sZVtZ.js rename to assets/FeedView-LQ-88lWw.js index d55cf191fa65e9d195da184fa15355225e4f7c04..58889ea6d7962920b4d6720638ce5b1f747f0878 100644 --- a/assets/FeedView-B-4sZVtZ.js +++ b/assets/FeedView-LQ-88lWw.js @@ -1 +1 @@ -import{b as q,r as c,i as k,j as e,c as $,L as C,d as B}from"./index-C7DzD1KZ.js";import{P as K}from"./components-BV3lUGf1.js";import{r as U,u as z,P as G,a as W,w as Q}from"./useIntersectionObserver-CSNffbhV.js";import{D as V,u as X,P as Y,M as J,S as Z,a as ee,R as se,W as ae,A as te,b as re,q as ie,c as ne}from"./chatLaunch-CJaFcfv2.js";import{c as oe}from"./chat-CYCaJ4hM.js";import{c as M}from"./catalog-DU92Rh6k.js";import{S as _}from"./chatPrompts-CDY3UGU1.js";import{t as le,d as H}from"./transform-Dk33Ziw-.js";import{u as ce}from"./usePapers-CHyBH3Xk.js";import{S as y}from"./skeleton-BBQyes8J.js";import{A as de,a as me}from"./alert-D1jsfsn6.js";import{u as D}from"./useQuery-C-S9qU90.js";import"./LatexTitle-DuT2lumP.js";import"./katex.min-BSBacQyE.js";import"./papers-BNcOWLi8.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CQWB7HGQ.js";import"./chevron-down-BVSdU_Yo.js";import"./useInfiniteQuery-DZ6ASWY6.js";const he=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],R=45,pe=1800,ue=25,ge=350,xe=i=>{const[g,l]=c.useState(_[0].slice(0,1));return c.useEffect(()=>{var v,f;if(!i)return;if((f=(v=window.matchMedia)==null?void 0:v.call(window,"(prefers-reduced-motion: reduce)"))!=null&&f.matches){l(_[0]);return}let m=0,n=1,x=!1,h;l(_[0].slice(0,n));const d=()=>{const p=_[m];if(!x){if(n+=1,l(p.slice(0,n)),n===p.length){x=!0,h=window.setTimeout(d,pe);return}h=window.setTimeout(d,R);return}if(n-=1,l(p.slice(0,n)),n===0){x=!1,m=(m+1)%_.length,h=window.setTimeout(d,ge);return}h=window.setTimeout(d,ue)};return h=window.setTimeout(d,R),()=>window.clearTimeout(h)},[i]),g},fe=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",be=()=>{var s,r;const i=q(),g=B()?Z:ee,[l,m]=c.useState({text:"",paperMentions:[]}),n=l.text,[x,h]=c.useState(0),[d,v]=c.useState(V),[f,p]=c.useState(!1),[o,A]=c.useState("low"),[b,E]=c.useState(!1),L=xe(!n),w=c.useRef(null),S=D({queryKey:["chatAvailability"],queryFn:()=>oe.getAvailability(),retry:!1,enabled:k()}),P=!!((s=S.data)!=null&&s.web_search_available),j=k()&&((r=S.data)==null?void 0:r.paper_mentions_enabled)!==!1,t=X({draft:l,onChange:m,enabled:j,textareaRef:w});c.useLayoutEffect(()=>{const a=w.current;if(!a)return;const u=()=>{if(a.style.height="auto",n){a.style.height=`${Math.min(a.scrollHeight,160)}px`;return}const N=a.placeholder,F=_.reduce((I,O)=>(a.placeholder=O,Math.max(I,a.scrollHeight)),0);a.placeholder=N,a.style.height=`${Math.min(F,160)}px`};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[n]);const T=async(a=l)=>{if(!(!a.text.trim()||b)){E(!0),ie(a,d,{webSearchEnabled:P&&f,reasoningEffort:o});try{const N=await ne(d,o);i(`/chat/${N.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(Y,{text:l.text,mentions:l.paperMentions,scrollTop:x,variant:"home"}),e.jsx("textarea",{ref:w,rows:1,value:n,placeholder:L,"aria-label":"Ask the assistant",disabled:b,onChange:a=>t.updateText(a.target.value,a.target.selectionStart),onSelect:a=>t.refresh(a.currentTarget.selectionStart),onClick:a=>t.refresh(a.currentTarget.selectionStart),onScroll:a=>h(a.currentTarget.scrollTop),onBlur:a=>{var u,N;(N=(u=a.relatedTarget)==null?void 0:u.closest)!=null&&N.call(u,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:a=>{t.keyDown(a)||a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),T())},role:j?"combobox":void 0,"aria-expanded":j?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":j?"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(J,{models:g,selectedModel:d,onModelChange:v}),e.jsx(se,{value:o,onChange:A,disabled:b}),P&&e.jsx(ae,{enabled:f,onChange:p,disabled:b})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:()=>void T(),disabled:!n.trim()||b,"aria-label":"Ask the assistant",children:e.jsx(te,{})})]}),e.jsx(re,{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 S,P,j,t,T;const[i,g]=$(),l=fe(i.get("order_by")),m=U(i),n=i.get("has_code")==="true",x=i.get("has_hf_artifacts")==="true",h=s=>{const r=new URLSearchParams(i);r.set("order_by",s),g(r)},d=s=>{const r=new URLSearchParams(i);s?r.set("has_code","true"):r.delete("has_code"),g(r)},v=s=>{const r=new URLSearchParams(i);s?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),g(r)},f=D({queryKey:["top-tasks-sidebar"],queryFn:()=>M.topTasks(8),staleTime:10*60*1e3}),p=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>M.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),o=ce({page_size:30,order_by:l,order_dir:"desc",start_date:m.startDate,end_date:m.endDate,include_resources:!0,has_code:n,has_hf_artifacts:x}),A=c.useMemo(()=>{var r;return(((r=o.data)==null?void 0:r.pages.flatMap(a=>a.results))||[]).map(le)},[o.data]),{targetRef:b,isIntersecting:E}=z({rootMargin:"400px"});c.useEffect(()=>{E&&o.hasNextPage&&!o.isFetchingNextPage&&o.fetchNextPage()},[E,o.hasNextPage,o.isFetchingNextPage]);const L=o.isLoading,w=o.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 sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),f.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(y,{className:"h-5 w-full"},r))}),(S=f.data)==null?void 0:S.map(s=>e.jsxs(C,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(C,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),p.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(y,{className:"h-5 w-full"},r))}),((j=(P=p.data)==null?void 0:P.results)==null?void 0:j.length)===0&&!p.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(T=(t=p.data)==null?void 0:t.results)==null?void 0:T.map(s=>e.jsxs(C,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{className:"feed-main",children:[k()&&e.jsx("div",{className:"feed-chat",children:e.jsx(be,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:he.map(([s,r])=>e.jsx("button",{className:`sort-btn ${l===s?"active":""}`,onClick:()=>h(s),children:r},s))}),e.jsx(G,{hasCode:n,hasHfArtifacts:x,onHasCodeChange:d,onHasHfArtifactsChange:v})]}),e.jsx(W,{startDate:m.startDate,endDate:m.endDate,onChange:s=>g(Q(i,s))})]}),w&&e.jsx(de,{variant:"destructive",className:"mb-4",children:e.jsx(me,{children:"Failed to load papers. Please try again."})}),L?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(y,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(y,{className:"h-6 w-3/4"}),e.jsx(y,{className:"h-4 w-1/2"}),e.jsx(y,{className:"h-12 w-full"})]})]},r))}):A.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:A.map((s,r)=>e.jsx(K,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:b,style:{height:1}}),o.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{b as q,r as c,i as k,j as e,c as $,L as C,d as B}from"./index-DB5YVNrt.js";import{P as K}from"./components--1z4Qw5F.js";import{r as U,u as z,P as G,a as W,w as Q}from"./useIntersectionObserver-CmsvWF1K.js";import{D as V,u as X,P as Y,M as J,S as Z,a as ee,R as se,W as ae,A as te,b as re,q as ie,c as ne}from"./chatLaunch-DPlGkVok.js";import{c as oe}from"./chat-C792FSN8.js";import{c as M}from"./catalog-HFAZrKSg.js";import{S as _}from"./chatPrompts-CDY3UGU1.js";import{t as le,d as H}from"./transform-CnBvOSlq.js";import{u as ce}from"./usePapers-CT5co6TZ.js";import{S as y}from"./skeleton-jY-za2d8.js";import{A as de,a as me}from"./alert-BPNeeF4s.js";import{u as D}from"./useQuery-gfOJVfRZ.js";import"./LatexTitle-DcOGOHZH.js";import"./katex.min-BSBacQyE.js";import"./papers-CTasJek9.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BqJw3haa.js";import"./chevron-down-CLKJ3Wue.js";import"./useInfiniteQuery-CqugEgpc.js";const he=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],R=45,pe=1800,ue=25,ge=350,xe=i=>{const[g,l]=c.useState(_[0].slice(0,1));return c.useEffect(()=>{var v,f;if(!i)return;if((f=(v=window.matchMedia)==null?void 0:v.call(window,"(prefers-reduced-motion: reduce)"))!=null&&f.matches){l(_[0]);return}let m=0,n=1,x=!1,h;l(_[0].slice(0,n));const d=()=>{const p=_[m];if(!x){if(n+=1,l(p.slice(0,n)),n===p.length){x=!0,h=window.setTimeout(d,pe);return}h=window.setTimeout(d,R);return}if(n-=1,l(p.slice(0,n)),n===0){x=!1,m=(m+1)%_.length,h=window.setTimeout(d,ge);return}h=window.setTimeout(d,ue)};return h=window.setTimeout(d,R),()=>window.clearTimeout(h)},[i]),g},fe=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",be=()=>{var s,r;const i=q(),g=B()?Z:ee,[l,m]=c.useState({text:"",paperMentions:[]}),n=l.text,[x,h]=c.useState(0),[d,v]=c.useState(V),[f,p]=c.useState(!1),[o,A]=c.useState("low"),[b,E]=c.useState(!1),L=xe(!n),w=c.useRef(null),S=D({queryKey:["chatAvailability"],queryFn:()=>oe.getAvailability(),retry:!1,enabled:k()}),P=!!((s=S.data)!=null&&s.web_search_available),j=k()&&((r=S.data)==null?void 0:r.paper_mentions_enabled)!==!1,t=X({draft:l,onChange:m,enabled:j,textareaRef:w});c.useLayoutEffect(()=>{const a=w.current;if(!a)return;const u=()=>{if(a.style.height="auto",n){a.style.height=`${Math.min(a.scrollHeight,160)}px`;return}const N=a.placeholder,F=_.reduce((I,O)=>(a.placeholder=O,Math.max(I,a.scrollHeight)),0);a.placeholder=N,a.style.height=`${Math.min(F,160)}px`};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[n]);const T=async(a=l)=>{if(!(!a.text.trim()||b)){E(!0),ie(a,d,{webSearchEnabled:P&&f,reasoningEffort:o});try{const N=await ne(d,o);i(`/chat/${N.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(Y,{text:l.text,mentions:l.paperMentions,scrollTop:x,variant:"home"}),e.jsx("textarea",{ref:w,rows:1,value:n,placeholder:L,"aria-label":"Ask the assistant",disabled:b,onChange:a=>t.updateText(a.target.value,a.target.selectionStart),onSelect:a=>t.refresh(a.currentTarget.selectionStart),onClick:a=>t.refresh(a.currentTarget.selectionStart),onScroll:a=>h(a.currentTarget.scrollTop),onBlur:a=>{var u,N;(N=(u=a.relatedTarget)==null?void 0:u.closest)!=null&&N.call(u,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:a=>{t.keyDown(a)||a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),T())},role:j?"combobox":void 0,"aria-expanded":j?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":j?"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(J,{models:g,selectedModel:d,onModelChange:v}),e.jsx(se,{value:o,onChange:A,disabled:b}),P&&e.jsx(ae,{enabled:f,onChange:p,disabled:b})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:()=>void T(),disabled:!n.trim()||b,"aria-label":"Ask the assistant",children:e.jsx(te,{})})]}),e.jsx(re,{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 S,P,j,t,T;const[i,g]=$(),l=fe(i.get("order_by")),m=U(i),n=i.get("has_code")==="true",x=i.get("has_hf_artifacts")==="true",h=s=>{const r=new URLSearchParams(i);r.set("order_by",s),g(r)},d=s=>{const r=new URLSearchParams(i);s?r.set("has_code","true"):r.delete("has_code"),g(r)},v=s=>{const r=new URLSearchParams(i);s?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),g(r)},f=D({queryKey:["top-tasks-sidebar"],queryFn:()=>M.topTasks(8),staleTime:10*60*1e3}),p=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>M.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),o=ce({page_size:30,order_by:l,order_dir:"desc",start_date:m.startDate,end_date:m.endDate,include_resources:!0,has_code:n,has_hf_artifacts:x}),A=c.useMemo(()=>{var r;return(((r=o.data)==null?void 0:r.pages.flatMap(a=>a.results))||[]).map(le)},[o.data]),{targetRef:b,isIntersecting:E}=z({rootMargin:"400px"});c.useEffect(()=>{E&&o.hasNextPage&&!o.isFetchingNextPage&&o.fetchNextPage()},[E,o.hasNextPage,o.isFetchingNextPage]);const L=o.isLoading,w=o.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 sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),f.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(y,{className:"h-5 w-full"},r))}),(S=f.data)==null?void 0:S.map(s=>e.jsxs(C,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(C,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),p.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(y,{className:"h-5 w-full"},r))}),((j=(P=p.data)==null?void 0:P.results)==null?void 0:j.length)===0&&!p.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(T=(t=p.data)==null?void 0:t.results)==null?void 0:T.map(s=>e.jsxs(C,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{className:"feed-main",children:[k()&&e.jsx("div",{className:"feed-chat",children:e.jsx(be,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:he.map(([s,r])=>e.jsx("button",{className:`sort-btn ${l===s?"active":""}`,onClick:()=>h(s),children:r},s))}),e.jsx(G,{hasCode:n,hasHfArtifacts:x,onHasCodeChange:d,onHasHfArtifactsChange:v})]}),e.jsx(W,{startDate:m.startDate,endDate:m.endDate,onChange:s=>g(Q(i,s))})]}),w&&e.jsx(de,{variant:"destructive",className:"mb-4",children:e.jsx(me,{children:"Failed to load papers. Please try again."})}),L?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(y,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(y,{className:"h-6 w-3/4"}),e.jsx(y,{className:"h-4 w-1/2"}),e.jsx(y,{className:"h-12 w-full"})]})]},r))}):A.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:A.map((s,r)=>e.jsx(K,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:b,style:{height:1}}),o.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-CXgusf3e.js b/assets/FrameworksIndexView-Db4cbi0M.js similarity index 92% rename from assets/FrameworksIndexView-CXgusf3e.js rename to assets/FrameworksIndexView-Db4cbi0M.js index f138265a64fc4cbd88ef7a27d00c3abcc7e5d9d9..656305d4711017bc9d88c16539ec9d284046023d 100644 --- a/assets/FrameworksIndexView-CXgusf3e.js +++ b/assets/FrameworksIndexView-Db4cbi0M.js @@ -1 +1 @@ -import{b as d,j as e,L as o,z as m}from"./index-C7DzD1KZ.js";import{u as p}from"./useQuery-C-S9qU90.js";import{I as h}from"./components-BV3lUGf1.js";import{c as u}from"./catalog-DU92Rh6k.js";import{c as g,h as f}from"./transform-Dk33Ziw-.js";import"./LatexTitle-DuT2lumP.js";import"./katex.min-BSBacQyE.js";import"./papers-BNcOWLi8.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,E as default}; +import{b as d,j as e,L as o,z as m}from"./index-DB5YVNrt.js";import{u as p}from"./useQuery-gfOJVfRZ.js";import{I as h}from"./components--1z4Qw5F.js";import{c as u}from"./catalog-HFAZrKSg.js";import{c as g,h as f}from"./transform-CnBvOSlq.js";import"./LatexTitle-DcOGOHZH.js";import"./katex.min-BSBacQyE.js";import"./papers-CTasJek9.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,E as default}; diff --git a/assets/LatexTitle-DuT2lumP.js b/assets/LatexTitle-DcOGOHZH.js similarity index 98% rename from assets/LatexTitle-DuT2lumP.js rename to assets/LatexTitle-DcOGOHZH.js index b8918e85716308b8c4207263c94825b7b70d8acf..1c75ddf1d240df5b13c52ce260a0add1873279ca 100644 --- a/assets/LatexTitle-DuT2lumP.js +++ b/assets/LatexTitle-DcOGOHZH.js @@ -1 +1 @@ -import{j as u,r as E}from"./index-C7DzD1KZ.js";import{k as j}from"./katex.min-BSBacQyE.js";const C=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),M={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},_={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},b={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},w={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":M,"`":_,"^":b,'"':w,"~":{n:"ñ",N:"Ñ"}},$={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(n,s){var e;return((e=O[n])==null?void 0:e[s])??null}function N(n){const s=[];let e=0,r="";const t=()=>{r&&(s.push({type:"text",content:r}),r="")};for(;e=n.length)return{name:"",end:e};if(!/[a-zA-Z]/.test(n[e]))return{name:n[e],end:e+1};const r=e;for(;e=n.length)return null;if(n[s+1]==="{"){const r=d(n,s+1);return r?{end:r.end}:null}return/[A-Za-z0-9+\-=.]/.test(n[s+1])?{end:s+2}:null}function L(n,s){let e=s;if(n[e]==="\\"){const{name:o,end:i}=y(n,e);if(!o)return null;if(e=i,n[e]==="{"){const a=d(n,e);a&&(e=a.end)}}else if(/[A-Za-z0-9]/.test(n[e])){let o=e+1;for(;oe.length-s.length)}function z(n,s,e){const r=U(s);if(!r.length)return[n];const t=r.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${t.join("|")})`,"gi");return n.split(o).filter(Boolean).map((i,a)=>r.some(p=>p.toLocaleLowerCase()===i.toLocaleLowerCase())?u.jsx("mark",{children:i},`${e}-mark-${a}`):i)}function m(n,s,e){const r=[];let t=0,o=0;const i=()=>`${s}-${o++}`,a=(p,f)=>p==="strong"?u.jsx("strong",{children:f},i()):u.jsx("em",{children:f},i());for(;tt&&r.push(...z(n.slice(t,f),e,i())),t=f}return r}function g({latex:n,display:s}){const e=E.useMemo(()=>{try{return j.renderToString(n.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[n,s]);return e?u.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:e}}):u.jsx(u.Fragment,{children:s?`$$${n}$$`:`$${n}$`})}function I(n,s){const e=N(n),r=[];return e.forEach((t,o)=>{const i=`latex-${o}`;if(t.type==="text"){const a=m(t.content,i,s);a.length===1?r.push(a[0]):a.length>1&&r.push(u.jsx(E.Fragment,{children:a},i));return}if(t.type==="display"){r.push(u.jsx(g,{latex:t.content,display:!0},i));return}r.push(u.jsx(g,{latex:t.content,display:!1},i))}),r.length===1?r[0]:u.jsx(u.Fragment,{children:r})}const X=({text:n,className:s="",highlight:e})=>{const r=E.useMemo(()=>I(n,e),[n,e]);return u.jsx("span",{className:s,children:r})},D=({title:n,className:s="",highlight:e})=>u.jsx(X,{text:n,className:s,highlight:e});export{D as L,X as a}; +import{j as u,r as E}from"./index-DB5YVNrt.js";import{k as j}from"./katex.min-BSBacQyE.js";const C=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),M={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},_={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},b={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},w={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":M,"`":_,"^":b,'"':w,"~":{n:"ñ",N:"Ñ"}},$={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(n,s){var e;return((e=O[n])==null?void 0:e[s])??null}function N(n){const s=[];let e=0,r="";const t=()=>{r&&(s.push({type:"text",content:r}),r="")};for(;e=n.length)return{name:"",end:e};if(!/[a-zA-Z]/.test(n[e]))return{name:n[e],end:e+1};const r=e;for(;e=n.length)return null;if(n[s+1]==="{"){const r=d(n,s+1);return r?{end:r.end}:null}return/[A-Za-z0-9+\-=.]/.test(n[s+1])?{end:s+2}:null}function L(n,s){let e=s;if(n[e]==="\\"){const{name:o,end:i}=y(n,e);if(!o)return null;if(e=i,n[e]==="{"){const a=d(n,e);a&&(e=a.end)}}else if(/[A-Za-z0-9]/.test(n[e])){let o=e+1;for(;oe.length-s.length)}function z(n,s,e){const r=U(s);if(!r.length)return[n];const t=r.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${t.join("|")})`,"gi");return n.split(o).filter(Boolean).map((i,a)=>r.some(p=>p.toLocaleLowerCase()===i.toLocaleLowerCase())?u.jsx("mark",{children:i},`${e}-mark-${a}`):i)}function m(n,s,e){const r=[];let t=0,o=0;const i=()=>`${s}-${o++}`,a=(p,f)=>p==="strong"?u.jsx("strong",{children:f},i()):u.jsx("em",{children:f},i());for(;tt&&r.push(...z(n.slice(t,f),e,i())),t=f}return r}function g({latex:n,display:s}){const e=E.useMemo(()=>{try{return j.renderToString(n.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[n,s]);return e?u.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:e}}):u.jsx(u.Fragment,{children:s?`$$${n}$$`:`$${n}$`})}function I(n,s){const e=N(n),r=[];return e.forEach((t,o)=>{const i=`latex-${o}`;if(t.type==="text"){const a=m(t.content,i,s);a.length===1?r.push(a[0]):a.length>1&&r.push(u.jsx(E.Fragment,{children:a},i));return}if(t.type==="display"){r.push(u.jsx(g,{latex:t.content,display:!0},i));return}r.push(u.jsx(g,{latex:t.content,display:!1},i))}),r.length===1?r[0]:u.jsx(u.Fragment,{children:r})}const X=({text:n,className:s="",highlight:e})=>{const r=E.useMemo(()=>I(n,e),[n,e]);return u.jsx("span",{className:s,children:r})},D=({title:n,className:s="",highlight:e})=>u.jsx(X,{text:n,className:s,highlight:e});export{D as L,X as a}; diff --git a/assets/MarkdownText-8HaaKP15.js b/assets/MarkdownText-tXCrsggq.js similarity index 85% rename from assets/MarkdownText-8HaaKP15.js rename to assets/MarkdownText-tXCrsggq.js index 8742c9a0bc1332eec582f43184ddcabb7a0f5fad..78c4ea23595404adec2bae6c9625a11e31bef6b8 100644 --- a/assets/MarkdownText-8HaaKP15.js +++ b/assets/MarkdownText-tXCrsggq.js @@ -1 +1 @@ -import{n as l,j as s,L as u}from"./index-C7DzD1KZ.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-BVh6NMiG.js";import{M as d,r as w}from"./index-1iwK_I9Y.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{n as l,j as s,L as u}from"./index-DB5YVNrt.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-Bi7j2lR1.js";import{M as d,r as w}from"./index-CeWrpp9N.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-Cj95bubx.js b/assets/MethodDetailView-D7RjDc12.js similarity index 94% rename from assets/MethodDetailView-Cj95bubx.js rename to assets/MethodDetailView-D7RjDc12.js index 0d4d98ca0fa8984d7b1eda09b0ef7eccbc9ae70a..840ce234b9b361d9ccde877eff35048c743abcbe 100644 --- a/assets/MethodDetailView-Cj95bubx.js +++ b/assets/MethodDetailView-D7RjDc12.js @@ -1 +1 @@ -import{j as e,r as A,u as Z,c as V,L,aa as X}from"./index-C7DzD1KZ.js";import{u as F}from"./useQuery-C-S9qU90.js";import{u as Y}from"./useInfiniteQuery-DZ6ASWY6.js";import{M as J,P as ee}from"./components-BV3lUGf1.js";import{b as te,u as ae,P as se,a as re,c as ne}from"./useIntersectionObserver-CSNffbhV.js";import{r as ie,M as K}from"./MarkdownText-8HaaKP15.js";import{c as N}from"./catalog-DU92Rh6k.js";import{p as le}from"./papers-BNcOWLi8.js";import{s as oe}from"./slug-BpH-Nkvz.js";import{t as ce}from"./transform-Dk33Ziw-.js";import{S as M}from"./skeleton-BBQyes8J.js";import{A as de,a as me}from"./alert-D1jsfsn6.js";import{s as he}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-DuT2lumP.js";import"./katex.min-BSBacQyE.js";import"./popover-CQWB7HGQ.js";import"./PaperPreviewLink-BVh6NMiG.js";import"./index-1iwK_I9Y.js";import"./hover-card-CD-KpVUV.js";const a={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:d,h:m,fill:f,stroke:x,label:p,fontSize:l=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:d,height:m,rx:"3",ry:"3",fill:f,stroke:x,strokeWidth:"1"}),e.jsx("text",{x:t+d/2,y:n+m/2,fontSize:l,fontFamily:"var(--sans)",fill:a.ink,textAnchor:"middle",dominantBaseline:"middle",children:p})]}),pe=()=>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:a.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:a.yellow,stroke:a.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:a.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:a.green,stroke:a.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:a.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:a.purple,stroke:a.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:a.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:a.blue,stroke:a.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:a.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:a.yellow,stroke:a.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:a.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:a.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:a.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:a.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ue=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],xe=()=>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:a.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:a.faint,strokeWidth:"1"}),ue.map(([t,n],d)=>{const m=92+d*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:m,fontSize:"11",fontFamily:"var(--mono)",fill:a.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:m,fontSize:"8.5",fontFamily:"var(--mono)",fill:a.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),ge={attention:pe,"agent-skills":xe},fe=({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:a.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:a.blue,stroke:a.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:a.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:a.orange,stroke:a.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:a.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:a.purple,stroke:a.purpleS,label:"Output",fontSize:12})]}),je=({method:t})=>{const n=(t.slug||"").toLowerCase(),d=ge[n];if(d)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(d,{})});if(t.image_url){const m=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${m}`,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(fe,{method:t})})},C=720,T=138,u={top:8,right:10,bottom:25,left:36},Q=56,_e=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ye=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),z=t=>_e.format(new Date(`${t}T00:00:00Z`)),ve=(t,n)=>{if(t===0)return new Set;const d=t>48?12:t>36?6:t>18?3:2,m=Math.max(1,Math.ceil(Q/n)),f=Math.max(d,m),x=t-1,p=new Set([0,x]);for(let l=f;l=Q&&p.add(l);return p},U=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}`},Se=({history:t,methodName:n})=>{const[d,m]=A.useState(null),f=Math.max(1,...t.map(o=>o.paper_count)),x=C-u.left-u.right,p=T-u.top-u.bottom,l=t.length?x/t.length:x,k=Math.max(2,l*.68),D=ve(t.length,l),h=Array.from(new Set([0,Math.ceil(f/2),f])),_=d==null?null:t[d],g=_?U(_):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${C} ${T}`,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"]}),h.map(o=>{const i=u.top+p-o/f*p;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:C-u.right,y1:i,y2:i}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:i+3,textAnchor:"end",children:o})]},o)}),t.map((o,i)=>{const b=o.paper_count/f*p,y=o.paper_count>0?Math.max(1,b):0,P=u.left+l*i+(l-k)/2,w=u.top+p-y,s=d===i,S=i===t.length-1,v=U(o);return e.jsxs("g",{className:`method-usage-bar${s?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${z(o.start_date)}: ${o.paper_count} ${o.paper_count===1?"paper":"papers"}${v?`. ${v}`:""}`,onMouseEnter:()=>m(i),onMouseLeave:()=>m(null),onFocus:()=>m(i),onBlur:()=>m(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+l*i,y:u.top,width:l,height:p}),e.jsx("rect",{className:"method-usage-bar-mark",x:P,y:w,width:k,height:y,rx:"1.5"})]},o.start_date)}),t.map((o,i)=>D.has(i)?e.jsx("text",{className:"method-usage-x-label",x:u.left+l*(i+.5),y:T-11,textAnchor:"middle",children:t.length>48?ye.format(new Date(`${o.start_date}T00:00:00Z`)):z(o.start_date)},o.start_date):null)]}),_&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:z(_.start_date)}),e.jsxs("span",{children:[_.paper_count," ",_.paper_count===1?"paper":"papers",d===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(_.catalog_share??0).toFixed(2),"% of"," ",(_.catalog_paper_count??0).toLocaleString()," catalog papers"]}),g&&e.jsx("span",{children:g})]})]})},Ne=[["trending","trending"],["new","newest"],["cited","most cited"]],G={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Oe=()=>{var I,B,$,H,R,q;const{methodSlug:t}=Z(),[n,d]=V(),[m,f]=A.useState("trending"),x=n.get("has_code")==="true",p=n.get("has_hf_artifacts")==="true",l=te(n),k=r=>{const c=new URLSearchParams(n);r?c.set("has_code","true"):c.delete("has_code"),d(c)},D=r=>{const c=new URLSearchParams(n);r?c.set("has_hf_artifacts","true"):c.delete("has_hf_artifacts"),d(c)},h=F({queryKey:["method",t],queryFn:()=>N.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),_=F({queryKey:["areas-all"],queryFn:()=>N.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),g=F({queryKey:["method-trend",t],queryFn:()=>N.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),o=m==="trending"?"trending":m==="cited"?"citation_count":"date_published",i=Y({queryKey:["method-papers-infinite",t,o,x,p,l.startDate,l.endDate],queryFn:({pageParam:r=1})=>le.forMethod(t,{page:r,page_size:20,order_by:o,order_dir:"desc",include_resources:!0,has_code:x,has_hf_artifacts:p,start_date:l.startDate,end_date:l.endDate}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:X}),b=F({queryKey:["related-methods",(B=h.data)==null?void 0:B.slug,($=h.data)==null?void 0:$.area_id,(H=h.data)==null?void 0:H.id],queryFn:async()=>{const r=h.data;if(!r)return[];const c=r.slug?G[r.slug]:void 0;return c?Promise.all(c.map(W=>N.getMethod(W))):r.area_id?(await N.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&G[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),y=A.useMemo(()=>{var c;return(((c=i.data)==null?void 0:c.pages.flatMap(O=>O.results))||[]).map(ce)},[i.data]),{targetRef:P,isIntersecting:w}=ae({rootMargin:"200px"});if(A.useEffect(()=>{w&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[w,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(de,{variant:"destructive",children:e.jsx(me,{children:"Method not found."})})});const s=h.data,S=(R=_.data)==null?void 0:R.results.find(r=>r.id===s.area_id),v=ie(s.source_url),E=v?null:he(s.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(L,{to:"/methods",children:"Methods"}),S&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(L,{to:`/methods#area-${oe(S.name)}`,children:S.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:s.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${s.slug==="grokking"||s.slug==="latent-reasoning"||s.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:s.name}),s.full_name&&s.full_name!==s.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:s.full_name}),s.description&&e.jsx(K,{className:"method-description",text:s.description}),s.source_url&&s.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),v?e.jsxs(L,{className:"method-source-link",to:v,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.introduced_year})]}):E?e.jsxs("a",{className:"method-source-link",href:E,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.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:(s.paper_count??0).toLocaleString()})]}),g.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(g.data.recent_paper_count*30/g.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!g.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),s.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:s.introduced_year})]})]}),g.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):g.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:g.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",g.data.recent_days,"d"]})]})]}),e.jsx(Se,{history:g.data.history,methodName:s.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(je,{method:s}),s.image_credit&&e.jsx("figcaption",{children:e.jsx(K,{className:"method-image-credit",text:s.image_credit})})]})]}),(((q=b.data)==null?void 0:q.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),b.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:Ne.map(([r,c])=>e.jsx("button",{className:`sort-btn ${m===r?"active":""}`,onClick:()=>f(r),children:c},r))}),e.jsx(se,{hasCode:x,hasHfArtifacts:p,onHasCodeChange:k,onHasHfArtifactsChange:D})]}),e.jsx(re,{startDate:l.startDate,endDate:l.endDate,onChange:r=>d(ne(n,r))}),e.jsxs("div",{className:"results-count",children:[y.length," papers mentioning ",s.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,c)=>e.jsx(M,{className:"h-40 w-full"},c))}):y.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:y.map((r,c)=>e.jsx(ee,{paper:r,rank:c+1},r.id))}),e.jsx("div",{ref:P,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Oe as default}; +import{j as e,r as A,u as Z,c as V,L,aa as X}from"./index-DB5YVNrt.js";import{u as F}from"./useQuery-gfOJVfRZ.js";import{u as Y}from"./useInfiniteQuery-CqugEgpc.js";import{M as J,P as ee}from"./components--1z4Qw5F.js";import{b as te,u as ae,P as se,a as re,c as ne}from"./useIntersectionObserver-CmsvWF1K.js";import{r as ie,M as K}from"./MarkdownText-tXCrsggq.js";import{c as N}from"./catalog-HFAZrKSg.js";import{p as le}from"./papers-CTasJek9.js";import{s as oe}from"./slug-BpH-Nkvz.js";import{t as ce}from"./transform-CnBvOSlq.js";import{S as M}from"./skeleton-jY-za2d8.js";import{A as de,a as me}from"./alert-BPNeeF4s.js";import{s as he}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-DcOGOHZH.js";import"./katex.min-BSBacQyE.js";import"./popover-BqJw3haa.js";import"./PaperPreviewLink-Bi7j2lR1.js";import"./index-CeWrpp9N.js";import"./hover-card-De01BraD.js";const a={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:d,h:m,fill:f,stroke:x,label:p,fontSize:l=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:d,height:m,rx:"3",ry:"3",fill:f,stroke:x,strokeWidth:"1"}),e.jsx("text",{x:t+d/2,y:n+m/2,fontSize:l,fontFamily:"var(--sans)",fill:a.ink,textAnchor:"middle",dominantBaseline:"middle",children:p})]}),pe=()=>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:a.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:a.yellow,stroke:a.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:a.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:a.green,stroke:a.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:a.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:a.purple,stroke:a.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:a.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:a.blue,stroke:a.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:a.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:a.yellow,stroke:a.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:a.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:a.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:a.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:a.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ue=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],xe=()=>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:a.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:a.faint,strokeWidth:"1"}),ue.map(([t,n],d)=>{const m=92+d*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:m,fontSize:"11",fontFamily:"var(--mono)",fill:a.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:m,fontSize:"8.5",fontFamily:"var(--mono)",fill:a.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),ge={attention:pe,"agent-skills":xe},fe=({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:a.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:a.blue,stroke:a.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:a.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:a.orange,stroke:a.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:a.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:a.purple,stroke:a.purpleS,label:"Output",fontSize:12})]}),je=({method:t})=>{const n=(t.slug||"").toLowerCase(),d=ge[n];if(d)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(d,{})});if(t.image_url){const m=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${m}`,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(fe,{method:t})})},C=720,T=138,u={top:8,right:10,bottom:25,left:36},Q=56,_e=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ye=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),z=t=>_e.format(new Date(`${t}T00:00:00Z`)),ve=(t,n)=>{if(t===0)return new Set;const d=t>48?12:t>36?6:t>18?3:2,m=Math.max(1,Math.ceil(Q/n)),f=Math.max(d,m),x=t-1,p=new Set([0,x]);for(let l=f;l=Q&&p.add(l);return p},U=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}`},Se=({history:t,methodName:n})=>{const[d,m]=A.useState(null),f=Math.max(1,...t.map(o=>o.paper_count)),x=C-u.left-u.right,p=T-u.top-u.bottom,l=t.length?x/t.length:x,k=Math.max(2,l*.68),D=ve(t.length,l),h=Array.from(new Set([0,Math.ceil(f/2),f])),_=d==null?null:t[d],g=_?U(_):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${C} ${T}`,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"]}),h.map(o=>{const i=u.top+p-o/f*p;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:C-u.right,y1:i,y2:i}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:i+3,textAnchor:"end",children:o})]},o)}),t.map((o,i)=>{const b=o.paper_count/f*p,y=o.paper_count>0?Math.max(1,b):0,P=u.left+l*i+(l-k)/2,w=u.top+p-y,s=d===i,S=i===t.length-1,v=U(o);return e.jsxs("g",{className:`method-usage-bar${s?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${z(o.start_date)}: ${o.paper_count} ${o.paper_count===1?"paper":"papers"}${v?`. ${v}`:""}`,onMouseEnter:()=>m(i),onMouseLeave:()=>m(null),onFocus:()=>m(i),onBlur:()=>m(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+l*i,y:u.top,width:l,height:p}),e.jsx("rect",{className:"method-usage-bar-mark",x:P,y:w,width:k,height:y,rx:"1.5"})]},o.start_date)}),t.map((o,i)=>D.has(i)?e.jsx("text",{className:"method-usage-x-label",x:u.left+l*(i+.5),y:T-11,textAnchor:"middle",children:t.length>48?ye.format(new Date(`${o.start_date}T00:00:00Z`)):z(o.start_date)},o.start_date):null)]}),_&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:z(_.start_date)}),e.jsxs("span",{children:[_.paper_count," ",_.paper_count===1?"paper":"papers",d===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(_.catalog_share??0).toFixed(2),"% of"," ",(_.catalog_paper_count??0).toLocaleString()," catalog papers"]}),g&&e.jsx("span",{children:g})]})]})},Ne=[["trending","trending"],["new","newest"],["cited","most cited"]],G={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Oe=()=>{var I,B,$,H,R,q;const{methodSlug:t}=Z(),[n,d]=V(),[m,f]=A.useState("trending"),x=n.get("has_code")==="true",p=n.get("has_hf_artifacts")==="true",l=te(n),k=r=>{const c=new URLSearchParams(n);r?c.set("has_code","true"):c.delete("has_code"),d(c)},D=r=>{const c=new URLSearchParams(n);r?c.set("has_hf_artifacts","true"):c.delete("has_hf_artifacts"),d(c)},h=F({queryKey:["method",t],queryFn:()=>N.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),_=F({queryKey:["areas-all"],queryFn:()=>N.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),g=F({queryKey:["method-trend",t],queryFn:()=>N.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),o=m==="trending"?"trending":m==="cited"?"citation_count":"date_published",i=Y({queryKey:["method-papers-infinite",t,o,x,p,l.startDate,l.endDate],queryFn:({pageParam:r=1})=>le.forMethod(t,{page:r,page_size:20,order_by:o,order_dir:"desc",include_resources:!0,has_code:x,has_hf_artifacts:p,start_date:l.startDate,end_date:l.endDate}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:X}),b=F({queryKey:["related-methods",(B=h.data)==null?void 0:B.slug,($=h.data)==null?void 0:$.area_id,(H=h.data)==null?void 0:H.id],queryFn:async()=>{const r=h.data;if(!r)return[];const c=r.slug?G[r.slug]:void 0;return c?Promise.all(c.map(W=>N.getMethod(W))):r.area_id?(await N.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&G[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),y=A.useMemo(()=>{var c;return(((c=i.data)==null?void 0:c.pages.flatMap(O=>O.results))||[]).map(ce)},[i.data]),{targetRef:P,isIntersecting:w}=ae({rootMargin:"200px"});if(A.useEffect(()=>{w&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[w,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(de,{variant:"destructive",children:e.jsx(me,{children:"Method not found."})})});const s=h.data,S=(R=_.data)==null?void 0:R.results.find(r=>r.id===s.area_id),v=ie(s.source_url),E=v?null:he(s.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(L,{to:"/methods",children:"Methods"}),S&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(L,{to:`/methods#area-${oe(S.name)}`,children:S.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:s.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${s.slug==="grokking"||s.slug==="latent-reasoning"||s.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:s.name}),s.full_name&&s.full_name!==s.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:s.full_name}),s.description&&e.jsx(K,{className:"method-description",text:s.description}),s.source_url&&s.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),v?e.jsxs(L,{className:"method-source-link",to:v,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.introduced_year})]}):E?e.jsxs("a",{className:"method-source-link",href:E,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.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:(s.paper_count??0).toLocaleString()})]}),g.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(g.data.recent_paper_count*30/g.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!g.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),s.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:s.introduced_year})]})]}),g.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):g.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:g.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",g.data.recent_days,"d"]})]})]}),e.jsx(Se,{history:g.data.history,methodName:s.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(je,{method:s}),s.image_credit&&e.jsx("figcaption",{children:e.jsx(K,{className:"method-image-credit",text:s.image_credit})})]})]}),(((q=b.data)==null?void 0:q.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),b.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:Ne.map(([r,c])=>e.jsx("button",{className:`sort-btn ${m===r?"active":""}`,onClick:()=>f(r),children:c},r))}),e.jsx(se,{hasCode:x,hasHfArtifacts:p,onHasCodeChange:k,onHasHfArtifactsChange:D})]}),e.jsx(re,{startDate:l.startDate,endDate:l.endDate,onChange:r=>d(ne(n,r))}),e.jsxs("div",{className:"results-count",children:[y.length," papers mentioning ",s.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,c)=>e.jsx(M,{className:"h-40 w-full"},c))}):y.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:y.map((r,c)=>e.jsx(ee,{paper:r,rank:c+1},r.id))}),e.jsx("div",{ref:P,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Oe as default}; diff --git a/assets/MethodsIndexView-C_pyJkdT.js b/assets/MethodsIndexView-BXUyb9I0.js similarity index 85% rename from assets/MethodsIndexView-C_pyJkdT.js rename to assets/MethodsIndexView-BXUyb9I0.js index 0a9f47be9edb67197df65656faab461f6c4c2dac..b53c5c7a73968a2c37c7ea7ff96326190e2b35c9 100644 --- a/assets/MethodsIndexView-C_pyJkdT.js +++ b/assets/MethodsIndexView-BXUyb9I0.js @@ -1,4 +1,4 @@ -import{e as g,r as d,j as e,L as f}from"./index-C7DzD1KZ.js";import{u as m}from"./useQuery-C-S9qU90.js";import{c as h}from"./catalog-DU92Rh6k.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-BBQyes8J.js";import{A as y,a as v}from"./alert-D1jsfsn6.js";import{T as _}from"./TaxonomySuggestionTile-CRddUpOR.js";import"./SignInToEditDialog-BrT1YrXZ.js";import"./button-B2L1cddC.js";import"./input-B4Wwo7mm.js";import"./textarea-BWN21nu7.js";import"./searchable-select-B8y6G69L.js";import"./popover-CQWB7HGQ.js";import"./dialog-vRXA8k-N.js";import"./loader-circle-Bp8rZ20U.js";import"./useMutation-m57QFYBa.js";import"./submissions-Du_vtued.js";/** +import{e as g,r as d,j as e,L as f}from"./index-DB5YVNrt.js";import{u as m}from"./useQuery-gfOJVfRZ.js";import{c as h}from"./catalog-HFAZrKSg.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-jY-za2d8.js";import{A as y,a as v}from"./alert-BPNeeF4s.js";import{T as _}from"./TaxonomySuggestionTile-5FXmjrqa.js";import"./SignInToEditDialog-CGuRD5vY.js";import"./button-BvgK708w.js";import"./input-DnxeMTC9.js";import"./textarea-rFUixZHL.js";import"./searchable-select-Bw0OPNzm.js";import"./popover-BqJw3haa.js";import"./dialog-CSh5S1Qx.js";import"./loader-circle-uWjxppt1.js";import"./useMutation-Bi00GAL7.js";import"./submissions-B7ABJ5o_.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-CpH-pbR-.js b/assets/NotFound-BO9K9saD.js similarity index 89% rename from assets/NotFound-CpH-pbR-.js rename to assets/NotFound-BO9K9saD.js index deec78b6b9f2236d1d4c049b108fd0a80988e8c2..f15523d32ea7727084ff6f05c63768fad9b26afa 100644 --- a/assets/NotFound-CpH-pbR-.js +++ b/assets/NotFound-BO9K9saD.js @@ -1 +1 @@ -import{aI as o,r as a,j as t,L as s}from"./index-C7DzD1KZ.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{aI as o,r as a,j as t,L as s}from"./index-DB5YVNrt.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-BjrxGtKU.js b/assets/OrganizationContributionGraph-B2Y_Bv62.js similarity index 94% rename from assets/OrganizationContributionGraph-BjrxGtKU.js rename to assets/OrganizationContributionGraph-B2Y_Bv62.js index 9711dab849ecbc23130b0c5c6eb358e01f6dcaf6..771b0ed88a3246927a591c158def871a198e10e1 100644 --- a/assets/OrganizationContributionGraph-BjrxGtKU.js +++ b/assets/OrganizationContributionGraph-B2Y_Bv62.js @@ -1 +1 @@ -import{r as b,j as o}from"./index-C7DzD1KZ.js";import{u as z}from"./useQuery-C-S9qU90.js";import{S as T}from"./skeleton-BBQyes8J.js";import{c as w}from"./catalog-DU92Rh6k.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-DB5YVNrt.js";import{u as z}from"./useQuery-gfOJVfRZ.js";import{S as T}from"./skeleton-jY-za2d8.js";import{c as w}from"./catalog-HFAZrKSg.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-BXFLjDjo.js b/assets/OrganizationDetailView-BXFLjDjo.js deleted file mode 100644 index 8bbc431582154bb427e6c84712f22db3b154f3bf..0000000000000000000000000000000000000000 --- a/assets/OrganizationDetailView-BXFLjDjo.js +++ /dev/null @@ -1 +0,0 @@ -import{u as t,j as r}from"./index-C7DzD1KZ.js";import{O as i}from"./OrganizationPaperFeed-cyJ3sRVZ.js";import m from"./NotFound-CpH-pbR-.js";import"./useQuery-C-S9qU90.js";import"./components-BV3lUGf1.js";import"./LatexTitle-DuT2lumP.js";import"./katex.min-BSBacQyE.js";import"./transform-Dk33Ziw-.js";import"./papers-BNcOWLi8.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-8HaaKP15.js";import"./PaperPreviewLink-BVh6NMiG.js";import"./index-1iwK_I9Y.js";import"./hover-card-CD-KpVUV.js";import"./OrganizationContributionGraph-BjrxGtKU.js";import"./skeleton-BBQyes8J.js";import"./catalog-DU92Rh6k.js";import"./useIntersectionObserver-CSNffbhV.js";import"./popover-CQWB7HGQ.js";import"./alert-D1jsfsn6.js";import"./searchable-select-B8y6G69L.js";import"./button-B2L1cddC.js";import"./dialog-vRXA8k-N.js";import"./loader-circle-Bp8rZ20U.js";import"./usePapers-CHyBH3Xk.js";import"./useInfiniteQuery-DZ6ASWY6.js";const k=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{k as default}; diff --git a/assets/OrganizationDetailView-DuTpsK8_.js b/assets/OrganizationDetailView-DuTpsK8_.js new file mode 100644 index 0000000000000000000000000000000000000000..a271068aed9963405633ec218c9fb74b8bb315d0 --- /dev/null +++ b/assets/OrganizationDetailView-DuTpsK8_.js @@ -0,0 +1 @@ +import{u as t,j as r}from"./index-DB5YVNrt.js";import{O as i}from"./OrganizationPaperFeed-H45zTXDr.js";import m from"./NotFound-BO9K9saD.js";import"./useQuery-gfOJVfRZ.js";import"./components--1z4Qw5F.js";import"./LatexTitle-DcOGOHZH.js";import"./katex.min-BSBacQyE.js";import"./transform-CnBvOSlq.js";import"./papers-CTasJek9.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-tXCrsggq.js";import"./PaperPreviewLink-Bi7j2lR1.js";import"./index-CeWrpp9N.js";import"./hover-card-De01BraD.js";import"./OrganizationContributionGraph-B2Y_Bv62.js";import"./skeleton-jY-za2d8.js";import"./catalog-HFAZrKSg.js";import"./useIntersectionObserver-CmsvWF1K.js";import"./popover-BqJw3haa.js";import"./alert-BPNeeF4s.js";import"./searchable-select-Bw0OPNzm.js";import"./button-BvgK708w.js";import"./dialog-CSh5S1Qx.js";import"./loader-circle-uWjxppt1.js";import"./usePapers-CT5co6TZ.js";import"./useInfiniteQuery-CqugEgpc.js";const k=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{k as default}; diff --git a/assets/OrganizationPaperFeed-cyJ3sRVZ.js b/assets/OrganizationPaperFeed-H45zTXDr.js similarity index 89% rename from assets/OrganizationPaperFeed-cyJ3sRVZ.js rename to assets/OrganizationPaperFeed-H45zTXDr.js index 62612396d1838a2190dc6df91e588e5c9f1383d8..c4cdc40fd8e9edfe66f668fe051e220995703a43 100644 --- a/assets/OrganizationPaperFeed-cyJ3sRVZ.js +++ b/assets/OrganizationPaperFeed-H45zTXDr.js @@ -1 +1 @@ -import{b as E,c as Q,r as d,j as e,L as A}from"./index-C7DzD1KZ.js";import{u as C}from"./useQuery-C-S9qU90.js";import{P as U}from"./components-BV3lUGf1.js";import{M as B}from"./MarkdownText-8HaaKP15.js";import{O as G}from"./OrganizationContributionGraph-BjrxGtKU.js";import{b as K,u as W,P as Z,a as z,c as J}from"./useIntersectionObserver-CSNffbhV.js";import{A as V,a as X}from"./alert-D1jsfsn6.js";import{S as Y}from"./searchable-select-B8y6G69L.js";import{S as $}from"./skeleton-BBQyes8J.js";import{e as ee}from"./usePapers-CHyBH3Xk.js";import{c as D}from"./catalog-DU92Rh6k.js";import{d as R,t as se}from"./transform-Dk33Ziw-.js";import ae from"./NotFound-CpH-pbR-.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],te=n=>n==="date_published"||n==="citation_count"?n:"trending",xe=({organizationSlug:n,taskSlug:p})=>{var y,P,v,F,L,k,w,O;const T=E(),[o,h]=Q(),[I,u]=d.useState(!1),g=te(o.get("order_by")),_=o.get("has_code")==="true",f=o.get("has_hf_artifacts")==="true",m=K(o),x=C({queryKey:["organization",n],queryFn:()=>D.getOrganization(n),staleTime:10*60*1e3}),c=C({queryKey:["organization-areas-with-tasks",n],queryFn:()=>D.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=ee({organizationSlug:n,taskSlug:p,page_size:12,order_by:g,order_dir:"desc",include_resources:!0,has_code:_,has_hf_artifacts:f,start_date:m.startDate,end_date:m.endDate,enabled:!!n}),{targetRef:M,isIntersecting:j}=W({rootMargin:"200px"});d.useEffect(()=>{j&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[j,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{u(!1)},[n,p]);const b=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:R(t.name,t.slug)})))},[c.data]),l=b.find(a=>a.slug===p),N=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(se))},[i.data]),s=x.data??((y=c.data)==null?void 0:y.organization),H=((v=(P=i.data)==null?void 0:P.pages[0])==null?void 0:v.count)??0;if(((F=x.error)==null?void 0:F.status)===404||((L=c.error)==null?void 0:L.status)===404||((k=i.error)==null?void 0:k.status)===404)return e.jsx(ae,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(V,{variant:"destructive",children:e.jsx(X,{children:"Failed to load organization papers. Please try again."})})});const S=a=>{const r=a.trim().toLocaleLowerCase();return b.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},q=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=o.toString();T({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(A,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:R(l.name,l.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&&!I?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>u(!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($,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((w=s.paper_count)==null?void 0:w.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(Y,{value:p??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:l?{value:l.slug,label:l.label,description:`${l.paper_count.toLocaleString()} ${l.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...S(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${g===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(o);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(Z,{hasCode:_,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(o);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(o);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsx(z,{startDate:m.startDate,endDate:m.endDate,onChange:a=>h(J(o,a))}),e.jsxs("div",{className:"results-count",children:[H.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx($,{className:"h-40 w-full"},r))}):N.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:N.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:M,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{xe as O}; +import{b as E,c as Q,r as d,j as e,L as A}from"./index-DB5YVNrt.js";import{u as C}from"./useQuery-gfOJVfRZ.js";import{P as U}from"./components--1z4Qw5F.js";import{M as B}from"./MarkdownText-tXCrsggq.js";import{O as G}from"./OrganizationContributionGraph-B2Y_Bv62.js";import{b as K,u as W,P as Z,a as z,c as J}from"./useIntersectionObserver-CmsvWF1K.js";import{A as V,a as X}from"./alert-BPNeeF4s.js";import{S as Y}from"./searchable-select-Bw0OPNzm.js";import{S as $}from"./skeleton-jY-za2d8.js";import{e as ee}from"./usePapers-CT5co6TZ.js";import{c as D}from"./catalog-HFAZrKSg.js";import{d as R,t as se}from"./transform-CnBvOSlq.js";import ae from"./NotFound-BO9K9saD.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],te=n=>n==="date_published"||n==="citation_count"?n:"trending",xe=({organizationSlug:n,taskSlug:p})=>{var y,P,v,F,L,k,w,O;const T=E(),[o,h]=Q(),[I,u]=d.useState(!1),g=te(o.get("order_by")),_=o.get("has_code")==="true",f=o.get("has_hf_artifacts")==="true",m=K(o),x=C({queryKey:["organization",n],queryFn:()=>D.getOrganization(n),staleTime:10*60*1e3}),c=C({queryKey:["organization-areas-with-tasks",n],queryFn:()=>D.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=ee({organizationSlug:n,taskSlug:p,page_size:12,order_by:g,order_dir:"desc",include_resources:!0,has_code:_,has_hf_artifacts:f,start_date:m.startDate,end_date:m.endDate,enabled:!!n}),{targetRef:M,isIntersecting:j}=W({rootMargin:"200px"});d.useEffect(()=>{j&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[j,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{u(!1)},[n,p]);const b=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:R(t.name,t.slug)})))},[c.data]),l=b.find(a=>a.slug===p),N=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(se))},[i.data]),s=x.data??((y=c.data)==null?void 0:y.organization),H=((v=(P=i.data)==null?void 0:P.pages[0])==null?void 0:v.count)??0;if(((F=x.error)==null?void 0:F.status)===404||((L=c.error)==null?void 0:L.status)===404||((k=i.error)==null?void 0:k.status)===404)return e.jsx(ae,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(V,{variant:"destructive",children:e.jsx(X,{children:"Failed to load organization papers. Please try again."})})});const S=a=>{const r=a.trim().toLocaleLowerCase();return b.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},q=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=o.toString();T({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(A,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:R(l.name,l.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&&!I?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>u(!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($,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((w=s.paper_count)==null?void 0:w.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(Y,{value:p??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:l?{value:l.slug,label:l.label,description:`${l.paper_count.toLocaleString()} ${l.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...S(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${g===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(o);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(Z,{hasCode:_,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(o);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(o);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsx(z,{startDate:m.startDate,endDate:m.endDate,onChange:a=>h(J(o,a))}),e.jsxs("div",{className:"results-count",children:[H.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx($,{className:"h-40 w-full"},r))}):N.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:N.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:M,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{xe as O}; diff --git a/assets/OrganizationTaskView-CaRpjxan.js b/assets/OrganizationTaskView-CaRpjxan.js new file mode 100644 index 0000000000000000000000000000000000000000..a76ebf5d9ca18ab0df3b04706f0c5bb64ae7ed30 --- /dev/null +++ b/assets/OrganizationTaskView-CaRpjxan.js @@ -0,0 +1 @@ +import{u as i,j as t}from"./index-DB5YVNrt.js";import{O as m}from"./OrganizationPaperFeed-H45zTXDr.js";import p from"./NotFound-BO9K9saD.js";import"./useQuery-gfOJVfRZ.js";import"./components--1z4Qw5F.js";import"./LatexTitle-DcOGOHZH.js";import"./katex.min-BSBacQyE.js";import"./transform-CnBvOSlq.js";import"./papers-CTasJek9.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-tXCrsggq.js";import"./PaperPreviewLink-Bi7j2lR1.js";import"./index-CeWrpp9N.js";import"./hover-card-De01BraD.js";import"./OrganizationContributionGraph-B2Y_Bv62.js";import"./skeleton-jY-za2d8.js";import"./catalog-HFAZrKSg.js";import"./useIntersectionObserver-CmsvWF1K.js";import"./popover-BqJw3haa.js";import"./alert-BPNeeF4s.js";import"./searchable-select-Bw0OPNzm.js";import"./button-BvgK708w.js";import"./dialog-CSh5S1Qx.js";import"./loader-circle-uWjxppt1.js";import"./usePapers-CT5co6TZ.js";import"./useInfiniteQuery-CqugEgpc.js";const q=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{q as default}; diff --git a/assets/OrganizationTaskView-Dw5RMMvy.js b/assets/OrganizationTaskView-Dw5RMMvy.js deleted file mode 100644 index 5701bd457c84e18475c6b13d4504d80e91302c7b..0000000000000000000000000000000000000000 --- a/assets/OrganizationTaskView-Dw5RMMvy.js +++ /dev/null @@ -1 +0,0 @@ -import{u as i,j as t}from"./index-C7DzD1KZ.js";import{O as m}from"./OrganizationPaperFeed-cyJ3sRVZ.js";import p from"./NotFound-CpH-pbR-.js";import"./useQuery-C-S9qU90.js";import"./components-BV3lUGf1.js";import"./LatexTitle-DuT2lumP.js";import"./katex.min-BSBacQyE.js";import"./transform-Dk33Ziw-.js";import"./papers-BNcOWLi8.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-8HaaKP15.js";import"./PaperPreviewLink-BVh6NMiG.js";import"./index-1iwK_I9Y.js";import"./hover-card-CD-KpVUV.js";import"./OrganizationContributionGraph-BjrxGtKU.js";import"./skeleton-BBQyes8J.js";import"./catalog-DU92Rh6k.js";import"./useIntersectionObserver-CSNffbhV.js";import"./popover-CQWB7HGQ.js";import"./alert-D1jsfsn6.js";import"./searchable-select-B8y6G69L.js";import"./button-B2L1cddC.js";import"./dialog-vRXA8k-N.js";import"./loader-circle-Bp8rZ20U.js";import"./usePapers-CHyBH3Xk.js";import"./useInfiniteQuery-DZ6ASWY6.js";const q=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{q as default}; diff --git a/assets/OrganizationsIndexView-Bltu6jBn.js b/assets/OrganizationsIndexView-C1qkT5g2.js similarity index 94% rename from assets/OrganizationsIndexView-Bltu6jBn.js rename to assets/OrganizationsIndexView-C1qkT5g2.js index 718655774cd2a88d9f484d9778a1dfb69c3f2d41..e66089415c3b53d017d783ff211e6c372fb9404e 100644 --- a/assets/OrganizationsIndexView-Bltu6jBn.js +++ b/assets/OrganizationsIndexView-C1qkT5g2.js @@ -1 +1 @@ -import{c as u,r as g,j as e,L as x}from"./index-C7DzD1KZ.js";import{u as j}from"./useQuery-C-S9qU90.js";import{A as y,a as f}from"./alert-D1jsfsn6.js";import{S as _}from"./skeleton-BBQyes8J.js";import{c as N}from"./catalog-DU92Rh6k.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.organizationIndex(),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 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{c as u,r as g,j as e,L as x}from"./index-DB5YVNrt.js";import{u as j}from"./useQuery-gfOJVfRZ.js";import{A as y,a as f}from"./alert-BPNeeF4s.js";import{S as _}from"./skeleton-jY-za2d8.js";import{c as N}from"./catalog-HFAZrKSg.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.organizationIndex(),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 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-CKIW1kLN.js b/assets/PaperDetailView-CGlbwKQ5.js similarity index 90% rename from assets/PaperDetailView-CKIW1kLN.js rename to assets/PaperDetailView-CGlbwKQ5.js index 4a8646c8ce5e42878de99ba15c137f212b133cf6..caaeaec6dae646c003e7a67a40af2ba0e9beadf3 100644 --- a/assets/PaperDetailView-CKIW1kLN.js +++ b/assets/PaperDetailView-CGlbwKQ5.js @@ -1,4 +1,4 @@ -import{e as ut,n as Ns,b as Bt,f as ie,g as Cs,r as h,j as e,C as de,h as ue,P as Dt,k as xe,l as Ht,m as Ce,o as _e,p as Mt,q as mt,s as $e,X as ht,L as le,t as Es,v as Ss,R as Ps,I as Is,w as zt,x as $s,y as As,T as Ls,A as rt,a as Le,z as Ae,B as nt,D as qt,E as Rs,u as Fs,F as Ts,d as Us,G as Bs,J as Ds,K as Hs,M as Ms,N as zs}from"./index-C7DzD1KZ.js";import{I as J,T as qs,M as Os,S as Ks,a as Gs}from"./components-BV3lUGf1.js";import{L as Ie,a as Qs}from"./LatexTitle-DuT2lumP.js";import{e as Re,C as Vs,E as Js}from"./ExternalSourceEvalBadge-DAotgKUq.js";import{p as V}from"./papers-BNcOWLi8.js";import{s as ce}from"./safeExternalHref-CkBrsh84.js";import{u as re}from"./useQuery-C-S9qU90.js";import{b as Xs}from"./usePapers-CHyBH3Xk.js";import{f as Zs,D as Ws}from"./latexPlainText-DI8YEXVe.js";import{s as Ys}from"./transform-Dk33Ziw-.js";import{S as ke}from"./skeleton-BBQyes8J.js";import{A as ea,a as ta}from"./alert-D1jsfsn6.js";import{B as D}from"./button-B2L1cddC.js";import{D as W,a as Y,b as ee,c as te,d as se,e as oe}from"./dialog-vRXA8k-N.js";import{u as sa}from"./useInfiniteQuery-DZ6ASWY6.js";import{p as aa}from"./paperEdits-B067dmC0.js";import{I as X}from"./input-B4Wwo7mm.js";import{S as Ct,a as Ne}from"./searchable-select-B8y6G69L.js";import{u as me}from"./useMutation-m57QFYBa.js";import{c as ge}from"./catalog-DU92Rh6k.js";import{s as pe}from"./submissions-Du_vtued.js";import{P as Fe,S as pt,L as ae,a as ra}from"./SignInToEditDialog-BrT1YrXZ.js";import{L as ne}from"./loader-circle-Bp8rZ20U.js";import{T as Te,n as Oe,g as Et}from"./github-CBv5TgZv.js";import{D as na,c as ia,g as oa,s as la,a as ca,b as da,d as ua,i as ma,e as ha}from"./codexAddEvals-Bq9ZcPuq.js";import{u as Ot}from"./index-DacotVUe.js";import{B as Kt}from"./badge-a2iv4Ds7.js";import{G as St}from"./github-BPMZ1b4l.js";import{M as pa,r as fa}from"./index-1iwK_I9Y.js";import{S as Pt,s as ga}from"./savedPapersAuth-Da0dU9fE.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CD-KpVUV.js";import"./popover-CQWB7HGQ.js";import"./textarea-BWN21nu7.js";/** +import{e as ut,n as Ns,b as Bt,f as ie,g as Cs,r as h,j as e,C as de,h as ue,P as Dt,k as xe,l as Ht,m as Ee,o as Ne,p as Mt,q as mt,s as $e,X as ht,L as le,t as Es,v as Ss,R as Ps,I as Is,w as zt,x as $s,y as As,T as Ls,A as rt,a as Le,z as Ae,B as nt,D as qt,E as Rs,u as Fs,F as Ts,d as Us,G as Bs,J as Ds,K as Hs,M as Ms,N as zs}from"./index-DB5YVNrt.js";import{I as V,T as qs,M as Os,S as Ks,a as Gs}from"./components--1z4Qw5F.js";import{L as Ie,a as Qs}from"./LatexTitle-DcOGOHZH.js";import{e as Re,C as Vs,E as Js}from"./ExternalSourceEvalBadge-BZEagV7N.js";import{p as J}from"./papers-CTasJek9.js";import{s as ce}from"./safeExternalHref-CkBrsh84.js";import{u as re}from"./useQuery-gfOJVfRZ.js";import{b as Xs}from"./usePapers-CT5co6TZ.js";import{f as Zs,D as Ws}from"./latexPlainText-DI8YEXVe.js";import{s as Ys}from"./transform-CnBvOSlq.js";import{S as _e}from"./skeleton-jY-za2d8.js";import{A as ea,a as ta}from"./alert-BPNeeF4s.js";import{B as D}from"./button-BvgK708w.js";import{D as W,a as Y,b as ee,c as te,d as se,e as oe}from"./dialog-CSh5S1Qx.js";import{u as sa}from"./useInfiniteQuery-CqugEgpc.js";import{p as aa}from"./paperEdits-D718tWaT.js";import{I as X}from"./input-DnxeMTC9.js";import{S as Ct,a as Ce}from"./searchable-select-Bw0OPNzm.js";import{u as me}from"./useMutation-Bi00GAL7.js";import{c as ge}from"./catalog-HFAZrKSg.js";import{s as pe}from"./submissions-B7ABJ5o_.js";import{P as Fe,S as pt,L as ae,a as ra}from"./SignInToEditDialog-CGuRD5vY.js";import{L as ne}from"./loader-circle-uWjxppt1.js";import{T as Te,n as Oe,g as Et}from"./github-nBYzmzBK.js";import{D as na,c as ia,g as oa,s as la,a as ca,b as da,d as ua,i as ma,e as ha}from"./codexAddEvals-QYl6p5qH.js";import{u as Ot}from"./index-OagizEwS.js";import{B as Kt}from"./badge-C_UuzwL3.js";import{G as St}from"./github-CYSQLKIg.js";import{M as pa,r as fa}from"./index-CeWrpp9N.js";import{S as Pt,s as ga}from"./savedPapersAuth-Ca15fo9W.js";import"./katex.min-BSBacQyE.js";import"./hover-card-De01BraD.js";import"./popover-BqJw3haa.js";import"./textarea-rFUixZHL.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -25,5 +25,5 @@ import{e as ut,n as Ns,b as Bt,f as ie,g as Cs,r as h,j as e,C as de,h as ue,P a author=${l}, year={{${i}}}, url={{${t.source_url||t.url_abs||""}}} -}`;return{citationDisplay:d(s,`{{${a}}}`),citationCopy:d(t.title,`{${r}}`)}}function Ia(t,s,a){var j,y,_,w;const r={models:t.hf_models??[],datasets:t.hf_datasets??[],spaces:t.hf_spaces??[]},i={models:Qe(r.models,s==null?void 0:s.modelUrls,"Model"),datasets:Qe(r.datasets,s==null?void 0:s.datasetUrls,"Dataset"),spaces:Qe(r.spaces,s==null?void 0:s.spaceUrls,"Space")},d={models:i.models.map(({href:b})=>b),datasets:i.datasets.map(({href:b})=>b),spaces:i.spaces.map(({href:b})=>b)},o=((j=t.arxiv_id)==null?void 0:j.replace(/v\d+$/,""))??null,l=t.arxiv_id?{isLoading:a,paperHref:`https://huggingface.co/papers/${o}`,rows:[{label:"Models",href:Xe(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,r.models),count:Ve(r.models,s==null?void 0:s.modelUrls,s==null?void 0:s.models),isLimited:s==null?void 0:s.isLimited,links:i.models},{label:"Datasets",href:Xe(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,r.datasets),count:Ve(r.datasets,s==null?void 0:s.datasetUrls,s==null?void 0:s.datasets),isLimited:s==null?void 0:s.isLimited,links:i.datasets},{label:"Spaces",href:Xe(`https://huggingface.co/papers/${o}`,r.spaces),count:Ve(r.spaces,s==null?void 0:s.spaceUrls,s==null?void 0:s.spaces),isLimited:s==null?void 0:s.isLimited,links:i.spaces}],footer:`Cite arxiv.org/abs/${o} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:Je(r.models),count:r.models.length,links:i.models},{label:"Datasets",href:Je(r.datasets),count:r.datasets.length,links:i.datasets},{label:"Spaces",href:Je(r.spaces),count:r.spaces.length,links:i.spaces}],footer:null},c=(t.methods??[]).filter(({source_paper_id:b})=>b===t.id),p=t.introduced_benchmarks??[],g=t.introduced_frameworks??[],n=[c.length&&(c.length===1?"this method":"these methods"),p.length&&(p.length===1?"this benchmark":"these benchmarks"),g.length&&(g.length===1?"this framework":"these frameworks")].filter(b=>!!b);return{...Pa(t),allHfArtifactUrls:d,authorEntries:t.authors.map((b,L)=>{var A,T,C,v;return{name:b,id:((T=(A=t.author_links)==null?void 0:A[L])==null?void 0:T.id)??null,hf_username:((v=(C=t.author_links)==null?void 0:C[L])==null?void 0:v.hf_username)??null}}),copyableRanks:va(t.leaderboard_ranks),hasIntroducedItems:n.length>0,hasLineageItems:!!((y=t.predecessor_papers)!=null&&y.length||(_=t.successor_papers)!=null&&_.length),hfArtifactViewer:l,hfPaperExists:!!(s!=null&&s.paperExists),introducedBenchmarks:p,introducedFrameworks:g,introducedMethods:c,introducedSummary:n.join(" and "),numPages:t.num_pages||null,paperSourceLabel:t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",predecessorPapers:t.predecessor_papers??[],projectPages:((w=t.project_pages)==null?void 0:w.filter(({url:b})=>b).map(b=>({...b,safeHref:ce(b.url)})))??[],repoSummary:Ys(t.repositories),safeAbstractUrl:ce(t.url_abs),safeConferenceUrl:ce(t.conference_url_abs),safePdfUrl:ce(t.url_pdf),sourceActionLabel:t.source==="external"?"Source page":"arXiv page",successorPapers:t.successor_papers??[]}}const $a=["tldr","abstract","tasks","methods","results"];function Aa(t){if(!t)return{section:null,resultsTaskSlug:null};const[s,a]=t.split("?",2);if(!$a.includes(s))return{section:null,resultsTaskSlug:null};const r=s;return r!=="results"||!a?{section:r,resultsTaskSlug:null}:{section:r,resultsTaskSlug:new URLSearchParams(a).get("task")}}const Vt=t=>`results-task-${t}`,La=t=>`#results?task=${encodeURIComponent(t)}`;function Ra(t,s){return t&&!!s}function Fa({direct:t,paperId:s,refetchEvaluations:a,refetchPaper:r}){r(),a(),!(!t||!s)&&(V.primeCurationState(s,!0).catch(()=>{}),Re.primeCurationState(s,!0).catch(()=>{}))}function Ta(t,s){const a=t?Ns(t):"",r=Bt(),{toast:i}=ie(),{preferences:d}=Cs(),o=Xs(a,!!a),l=o.data,[c,p]=h.useState(!1);h.useEffect(()=>{!t||t===a||r(`/paper/${a}${window.location.search}${window.location.hash}`,{replace:!0})},[a,r,t]),h.useEffect(()=>{if(l!=null&&l.title)return document.title=Zs(l.title),()=>{document.title=Ws}},[l==null?void 0:l.title]),h.useEffect(()=>{if(p(!1),!(l!=null&&l.id))return;const C=window.setTimeout(()=>p(!0),0);return()=>window.clearTimeout(C)},[l==null?void 0:l.id]);const g=Ra(c,l==null?void 0:l.id),n=Ea(c?l==null?void 0:l.arxiv_id:void 0),j=ka(l==null?void 0:l.id,g),y=re({queryKey:["paper-versions",l==null?void 0:l.arxiv_id],queryFn:()=>V.versions(l.arxiv_id.replace(/v\d+$/,"")),enabled:g&&!!(l!=null&&l.arxiv_id),staleTime:10*60*1e3}),_=re({queryKey:["related-papers",l==null?void 0:l.id],queryFn:()=>V.related(l.arxiv_id||l.id,4),enabled:g,staleTime:10*60*1e3});h.useEffect(()=>{const C=()=>{Fa({direct:s==="direct",paperId:l==null?void 0:l.id,refetchEvaluations:j.refetch,refetchPaper:o.refetch}),i({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",C),()=>window.removeEventListener("pwc:catalog-conflict",C)},[s,j.refetch,l==null?void 0:l.id,o.refetch,i]);const w=h.useMemo(()=>{const C=j.data;return!C||!d.hide_closed_source_evals?C:C.filter(v=>v.is_open!==!1)},[j.data,d.hide_closed_source_evals]),b=h.useMemo(()=>{if(!w)return[];const C=new Map;for(const v of w){const u=C.get(v.task_id);u?u.rows.push(v):C.set(v.task_id,{taskId:v.task_id,taskName:v.task_name||"—",taskSlug:v.task_slug,rows:[v]})}return[...C.values()]},[w]),L=h.useMemo(()=>b.map(({taskSlug:C})=>C??"").join("|"),[b]),A=h.useMemo(()=>l?Ia(l,n.data,n.isLoading):null,[n.data,n.isLoading,l]),T=h.useRef(!1);return h.useEffect(()=>{T.current=!1},[a]),h.useEffect(()=>{let C=0;const v=(f=!1,N=!1)=>{const{section:I,resultsTaskSlug:B}=Aa(window.location.hash.slice(1));if(!I||!l||I==="tldr"&&!l.tldr||I==="results"&&(!g||j.isLoading)||!f&&T.current)return;let H=I==="results"&&B?document.getElementById(Vt(B)):document.getElementById(I);if(!H&&I==="results"&&B){if(b.some(({taskSlug:K})=>K===B))return;H=document.getElementById("results")}H&&(C=window.requestAnimationFrame(()=>{T.current=!0,H.scrollIntoView({block:"start",behavior:N?"smooth":"auto"})}))};v();const u=()=>{T.current=!1,v(!0,!0)};return window.addEventListener("hashchange",u),()=>{window.removeEventListener("hashchange",u),C&&window.cancelAnimationFrame(C)}},[b,j.isLoading,l,L,g]),{arxivId:a,evaluations:j.data,evaluationsByTask:b,evaluationsLoading:j.isLoading,hfLoading:n.isLoading,hfRepos:n.data,paper:l,paperError:o.error,paperLoading:o.isLoading,presentation:A,refetchEvaluations:j.refetch,refetchPaper:o.refetch,relatedQuery:_,versions:y.data??[],visibleEvaluations:w}}const Ua={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url"};function Ba(t){return Ua[t]??null}function Da(){const[t,s]=h.useState(null),a=h.useCallback(i=>{s(i)},[]),r=h.useCallback((i,d)=>{s(o=>d?i:o===i?null:o)},[]);return{activeEditor:t,openEditor:a,setEditorOpen:r}}const Ha="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",Ma="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",za="data:image/svg+xml,%3csvg%20fill='%23111'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",qa="data:image/svg+xml,%3csvg%20fill='%23fff'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",Oa="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",Ka="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_dark__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_dark__st0{fill:%23edecec}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_dark__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",Ga="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23FDFCFC'/%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%23E6E5E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='%2317181C'/%3e%3c/svg%3e",Qa="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='512'%20height='512'%3e%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'%3e%3c/rect%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%235A5858'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='white'%3e%3c/path%3e%3c/svg%3e%3cstyle%3e@media%20(prefers-color-scheme:%20light)%20{%20:root%20{%20filter:%20none;%20}%20}%20@media%20(prefers-color-scheme:%20dark)%20{%20:root%20{%20filter:%20none;%20}%20}%20%3c/style%3e%3c/svg%3e",Va=[{name:"Claude",light:Ha,dark:Ma},{name:"Codex",light:za,dark:qa},{name:"Cursor",light:Oa,dark:Ka},{name:"OpenCode",light:Ga,dark:Qa}];function Ja(){return e.jsx("span",{className:"ml-1 inline-flex shrink-0 items-center gap-1.5","aria-hidden":"true",children:Va.map(({name:t,light:s,dark:a})=>e.jsxs("span",{title:t,className:"inline-flex h-[18px] w-[18px]",children:[e.jsx("img",{src:s,alt:"",width:18,height:18,className:"h-full w-full object-contain dark:hidden"}),e.jsx("img",{src:a,alt:"",width:18,height:18,className:"hidden h-full w-full object-contain dark:block"})]},t))})}function Xa({paperId:t,isAdmin:s}){var g;const[a,r]=h.useState(!1),[i,d]=h.useState(!1),[o,l]=h.useState(()=>window.location.hash.startsWith("#edit")),c=sa({queryKey:["paper-edit-history",t],queryFn:({pageParam:n})=>aa.history(t,n),initialPageParam:void 0,getNextPageParam:n=>n.next_cursor??void 0,enabled:s&&o}),p=`Help me edit https://paperswithcode.co/paper/${t} using the public pwc CLI from https://github.com/huggingface/pwc-cli. Install or update the CLI following its README, then run pwc skills add to load its instructions. Run pwc auth login --paper ${t}; I will authorize this paper in my browser. Export with pwc paper edit export ${t} --output edits.json, make explicit operations for the corrections I request, and preview before submitting. For organization changes, use an organizations operation with payload {"organization_ids": [existing organization IDs]}; this replaces the paper’s organization links and publishes directly. Use existing organizations, benchmark and metric definitions, preserve unrelated entries, and cite source URLs where available. Never print or copy credentials. Ask me what to change if I have not specified it.`;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"action-btn",title:"Copy an edit prompt for Claude, Codex, Cursor, or OpenCode",onClick:async()=>{try{await navigator.clipboard.writeText(p),r(!0),d(!1)}catch{d(!0)}},children:[a&&e.jsx(de,{size:12}),a?"Prompt copied":"Edit with your agent",e.jsx(Ja,{})]}),s&&e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>l(!0),children:[e.jsx(xa,{size:12})," View edit history"]}),e.jsx(W,{open:i,onOpenChange:d,children:e.jsxs(Y,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Copy the edit prompt"}),e.jsx(se,{children:"Paste these instructions into your coding agent."})]}),e.jsx("textarea",{"aria-label":"Paper edit prompt",readOnly:!0,value:p,className:"h-64 w-full rounded border p-3 text-sm",onFocus:n=>n.currentTarget.select()})]})}),e.jsx(W,{open:s&&o,onOpenChange:l,children:e.jsxs(Y,{className:"max-h-[85vh] max-w-3xl overflow-y-auto",id:"edit-history",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Paper edit history"}),e.jsx(se,{children:"Published changes and their contributors."})]}),e.jsxs("div",{className:"space-y-3",children:[c.isLoading&&e.jsx("p",{children:"Loading edit history…"}),c.error&&e.jsx("p",{role:"alert",children:"Could not load edit history."}),c.data&&!c.data.pages[0].events.length&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"No edits have been recorded here yet."}),(g=c.data)==null?void 0:g.pages.flatMap(n=>n.events).map(n=>e.jsxs("article",{id:`edit-${n.id}`,className:"rounded border p-3",children:[e.jsxs("p",{className:"text-sm",children:[n.actor_username?e.jsxs("a",{className:"underline",href:`https://huggingface.co/${encodeURIComponent(n.actor_username)}`,children:["@",n.actor_username]}):"Catalog administrator"," · ",new Date(n.created_at).toLocaleString()," · ",n.operation==="rollback"?"Reverted an edit":"Updated this paper"]}),e.jsxs("details",{children:[e.jsx("summary",{className:"cursor-pointer text-sm",children:"View changes"}),e.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap text-xs",children:JSON.stringify({before:n.before,after:n.after},null,2)})]})]},n.id)),c.hasNextPage&&e.jsx(D,{variant:"outline",disabled:c.isFetchingNextPage,onClick:()=>void c.fetchNextPage(),children:"Load older edits"})]})]})})]})}function Za(t){const s=t==null?void 0:t.trim();if(!s)return;const a=Number(s);return Number.isFinite(a)?Math.trunc(a):void 0}function $t(t){const s=t.trim();if(!s)return null;const a=Number(s);return Number.isFinite(a)&&a>=0?Math.trunc(a):null}function Ze(t){return t.trim()||null}function Wa(t){const s=Number.parseInt(t.task_id,10),a=Number.parseInt(t.dataset_id,10);return Number.isFinite(s)&&Number.isFinite(a)?{taskId:s,datasetId:a}:null}function Ya(t,s){const a=[];for(const r of t){if(r.operation==="delete"&&r.id){a.push({kind:"delete",evaluationId:Number.parseInt(r.id,10)});continue}if(r.operation!=="create"&&r.operation!=="update")continue;const i=Wa(r),d=r.metric_name.trim();if(!i||!d||!r.metric_value.trim())continue;const o=s(r.task_id,r.dataset_id),l={task_id:i.taskId,dataset_id:i.datasetId,metrics:{[d]:r.metric_value},best_metric:d,is_open:r.is_open},c=r.model_name.trim(),p=Za(r.best_rank);if(r.operation==="create"){const g=$t(r.num_parameters),n=Ze(r.hf_model_url);a.push({kind:"create",data:{...l,...c?{model_name:c}:{},...o&&r.harness.trim()?{harness:r.harness.trim()}:{},...p!==void 0?{best_rank:p}:{},...g!==null?{num_parameters:g}:{},...n!==null?{hf_model_url:n}:{}}});continue}r.id&&a.push({kind:"update",evaluationId:Number.parseInt(r.id,10),data:{...l,...c?{model_name:c}:{},harness:o?Ze(r.harness):null,...p!==void 0?{best_rank:p}:{},num_parameters:$t(r.num_parameters),hf_model_url:Ze(r.hf_model_url)}})}return a}function er(t,s){return s.map(a=>a.kind==="delete"?{operation:"delete",evaluation_id:a.evaluationId}:{operation:a.kind,...a.kind==="update"?{evaluation_id:a.evaluationId}:{},payload:a.kind==="create"?{paper_id:t,...a.data}:a.data})}function tr(t){return t.map(s=>s.kind==="delete"?{op:"delete",evaluation_id:s.evaluationId}:s.kind==="update"?{op:"update",evaluation_id:s.evaluationId,data:s.data}:{op:"create",data:s.data})}function fe({isAuthor:t=!1}){const s=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:s?"Test-only: this change stays on staging.":"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:s?"This exercises staging-local pending behavior and is not queued for production review.":t?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}const We=100;function sr(t){return(t??[]).some(s=>s.slug==="coding-agents"||s.name.trim().toLowerCase()==="coding agents")}function ar(t){return t.map(s=>{const a=s.best_metric||Object.keys(s.metrics)[0],r=s.metrics[a];return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:a||"",metric_value:String(r||""),best_rank:s.best_rank?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",hf_model_url:s.hf_model_url||"",is_open:s.is_open!==!1,operation:"unchanged"}})}function rr(t){const s=new Map;return t.forEach(a=>{a.task_id&&a.task_name&&s.set(a.task_id,{id:a.task_id,name:a.task_name,slug:a.task_slug,level:0})}),s}function nr(t){const s=new Map;return t.forEach(a=>{a.dataset_id&&a.dataset_name&&s.set(a.dataset_id,{id:a.dataset_id,name:a.dataset_name,slug:a.dataset_slug})}),s}function At(t,s){return`${t}:${s}`}function ir({open:t,onOpenChange:s,paperId:a,arxivId:r,initialEvaluations:i,paperTasks:d,onSuccess:o,submitMode:l="direct",isAdmin:c=!1,isAuthor:p=!1}){const g=sr(d),[n,j]=h.useState([]),[y,_]=h.useState(null),[w,b]=h.useState(new Map),[L,A]=h.useState(new Map),T=ue(),{toast:C}=ie(),v=h.useRef(!1),u=h.useRef(!1);h.useEffect(()=>{if(!t){v.current=!1,u.current=!1;return}v.current||u.current||i.length!==0&&(v.current=!0,j(ar(i)),b(rr(i)),A(nr(i)))},[t,i]);const f=h.useMemo(()=>Array.from(new Set(n.map(x=>x.task_id).filter(x=>x&&x!==""))),[n]),N=h.useMemo(()=>{const x=new Set;return n.forEach(P=>{P.task_id&&P.dataset_id&&x.add(At(P.task_id,P.dataset_id))}),Array.from(x)},[n]),I=re({queryKey:["datasets-by-tasks-for-eval-edit",f,t],queryFn:async()=>{const x={};return await Promise.all(f.map(async P=>{try{const R=await ge.listDatasets({task_id:parseInt(P),page_size:We});x[P]=R.results}catch(R){console.error(`Error fetching datasets for task ${P}:`,R),x[P]=[]}})),x},enabled:t&&f.length>0});h.useEffect(()=>{I.data&&A(x=>{const P=new Map(x);return Object.values(I.data).forEach(R=>{R.forEach(U=>{P.set(U.id,U)})}),P})},[I.data]);const B=re({queryKey:["leaderboard-metrics-for-eval-edit",N,t],queryFn:async()=>{const x={};return await Promise.all(N.map(async P=>{const[R,U]=P.split(":");try{x[P]=await ge.leaderboardMetrics(U,R)}catch(M){console.error(`Error fetching metrics for leaderboard ${P}:`,M),x[P]=[]}})),x},enabled:t&&N.length>0}),H=async x=>{const P=await ge.listTasks({page_size:We,...x?{q:x}:{}});return b(R=>{const U=new Map(R);return P.results.forEach(M=>U.set(M.id,M)),U}),P.results.map(R=>{var U;return{value:R.id,label:R.name,description:(U=R.description)==null?void 0:U.slice(0,100)}})},K=x=>async P=>{const R=await ge.listDatasets({task_id:parseInt(x),page_size:We,...P?{q:P}:{}});return A(U=>{const M=new Map(U);return R.results.forEach(Q=>M.set(Q.id,Q)),M}),R.results.map(U=>({value:U.id,label:U.name,description:U.full_name}))},G=(x,P)=>{if(!x||!P)return!1;const R=L.get(P);return!!(R!=null&&R.supports_harness)},m=(x,P,R)=>{var Q;if(!x||!P)return[];const M=(((Q=B.data)==null?void 0:Q[At(x,P)])||[]).map(z=>({value:z.metric_name,label:z.metric_name,description:z.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return R&&!M.some(z=>z.value===R)&&M.unshift({value:R,label:`${R} (legacy)`}),M},E=me({mutationFn:async({paperId:x,evaluations:P})=>{const R=Ya(P,G);if(!c&&l==="direct"&&R.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");if(R.length===0)return{submitted:!1};const U=Number.parseInt(x,10);return l==="pending"?await pe.submit({paper_id:U,edit_type:"evaluations",proposed_payload:{operations:tr(R)}}):await Re.batch(U,er(U,R)),{submitted:!0}},onSuccess:x=>{if(l==="pending"){x!=null&&x.submitted?C({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):C({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),o==null||o(),s(!1);return}T.invalidateQueries({queryKey:["paper-arxiv",r]}),T.invalidateQueries({queryKey:["evaluations","paper",a]}),o==null||o(),s(!1)},onError:x=>{var U;const P=x;let R=P.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(P.response)try{const M=JSON.parse(P.response);typeof(M==null?void 0:M.detail)=="string"?R=M.detail:Array.isArray(M==null?void 0:M.detail)&&((U=M.detail[0])!=null&&U.msg)&&(R=M.detail[0].msg)}catch{R=P.response}C({title:l==="pending"?"Could not submit edit":"Could not save evaluations",description:R,variant:"destructive"})}}),$=()=>{u.current=!0,j([...n,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},F=x=>{if(u.current=!0,n[x].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;j(n.map((R,U)=>U===x?{...R,operation:"delete"}:R))}else j(n.filter((R,U)=>U!==x))},S=(x,P,R)=>{u.current=!0,j(n.map((U,M)=>{if(M!==x)return U;const Q={...U,[P]:R};return P==="task_id"&&(Q.dataset_id="",Q.metric_name="",Q.harness=""),P==="dataset_id"&&(Q.metric_name="",R&&!G(Q.task_id,R)&&(Q.harness="")),U.operation==="unchanged"&&(Q.operation="update"),Q}))},O=(x,P)=>{u.current=!0,j(n.map((R,U)=>{if(U!==x)return R;const M={...R,is_open:P};return R.operation==="unchanged"&&(M.operation="update"),M}))},Z=()=>{const x=n.filter(P=>P.operation!=="delete"||P.id);E.mutate({paperId:a,evaluations:x})};return e.jsxs(W,{open:t,onOpenChange:s,children:[e.jsxs(Y,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Evaluation Results"}),e.jsx(se,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),l==="pending"&&e.jsx(fe,{isAuthor:p}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[n.filter(x=>x.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:`text-left py-2 px-2 font-medium text-sm ${g?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),g&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:n.map((x,P)=>{if(x.operation==="delete")return null;const R=w.get(x.task_id),U=L.get(x.dataset_id),M=m(x.task_id,x.dataset_id,x.metric_name),Q=!!(x.task_id&&x.dataset_id)&&B.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(Ct,{value:x.task_id,onChange:z=>S(P,"task_id",z),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:R?{value:R.id,label:R.name}:null,queryKey:["eval-edit-task-search"],queryFn:H,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Ct,{value:x.dataset_id,onChange:z=>S(P,"dataset_id",z),placeholder:x.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:x.task_id?"No datasets found for this task.":"Select a task first.",disabled:!x.task_id,selectedOption:U?{value:U.id,label:U.name}:null,queryKey:["eval-edit-dataset-search",x.task_id],queryFn:K(x.task_id),enabled:t&&!!x.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(X,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:x.model_name,onChange:z=>S(P,"model_name",z.target.value)})}),g&&e.jsx("td",{className:"py-2 px-2",children:G(x.task_id,x.dataset_id)?e.jsx(X,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:x.harness,onChange:z=>S(P,"harness",z.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!x.task_id||!x.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):Q?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(ne,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):M.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:x.metric_name,onChange:z=>S(P,"metric_name",z.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),M.map(z=>e.jsx("option",{value:z.value,children:z.label},z.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(X,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:x.metric_value,onChange:z=>S(P,"metric_value",z.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(X,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:x.num_parameters,onChange:z=>S(P,"num_parameters",z.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(X,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:x.hf_model_url,onChange:z=>S(P,"hf_model_url",z.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:x.is_open,onChange:z=>O(P,z.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>F(P),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:x.id&&!c?"Only administrators can delete published results":"Remove row",disabled:!!x.id&&!c,children:e.jsx(Te,{className:"w-4 h-4"})})})]},P)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(na,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(D,{variant:"outline",size:"sm",onClick:$,className:"flex items-center space-x-2",children:[e.jsx(Fe,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(oe,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(D,{variant:"ghost",onClick:()=>_("benchmark"),children:"Suggest a new benchmark"}),e.jsx(D,{variant:"ghost",onClick:()=>_("metric"),children:"Suggest a new metric"})]}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:Z,disabled:E.isPending,children:E.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(pt,{open:y!==null,onOpenChange:x=>{x||_(null)},paperId:a,kind:y??"benchmark"})]})}function or(t,s,a){if(!t)return t;const r=i=>i.paper_id!==s||i.paper_title===a?i:{...i,paper_title:a};if(Array.isArray(t)){const i=t.map(r);return i.some((o,l)=>o!==t[l])?i:t}if(Array.isArray(t.results)){const i=t.results.map(r);return i.some((o,l)=>o!==t.results[l])?{...t,results:i}:t}return t}function ve(t,s,a){new Set([...a,s.id,s.arxiv_id].filter(o=>!!o)).forEach(o=>{t.setQueryData(["paper",o],s),t.setQueryData(["paper-arxiv",o],s)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const i=String(s.id),d=o=>or(o,i,s.title);t.setQueriesData({queryKey:["evaluations"]},d),t.setQueriesData({queryKey:["dataset-evals"]},d),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}const Ye=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function Lt(t){return t.map(s=>s.trim()).filter(Boolean)}function et(t,s){const a=Lt(t).sort(),r=Lt(s).sort();return a.length!==r.length?!1:a.every((i,d)=>i===r[d])}function lr(t,s){return et(t.hf_models,s.hf_models)&&et(t.hf_datasets,s.hf_datasets)&&et(t.hf_spaces,s.hf_spaces)}function cr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialArtifacts:i,onSuccess:d,submitMode:o="direct",isAuthor:l=!1}){const[c,p]=h.useState(i),[g,n]=h.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),j=ue(),{toast:y}=ie(),_=h.useRef(!1);h.useEffect(()=>{if(!t){_.current=!1;return}_.current||(_.current=!0,p(i),n({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,i]);const w=me({mutationFn:async({paperId:v,artifacts:u})=>o==="pending"?(await pe.submit({paper_id:parseInt(v),edit_type:"hf_artifacts",proposed_payload:u}),null):V.updateHfArtifacts(v,u),onSuccess:v=>{if(o==="pending"){y({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),d==null||d(),s(!1),n({hf_models:"",hf_datasets:"",hf_spaces:""});return}v&&ve(j,v,[a,r]),d==null||d(),s(!1),n({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:v=>{var N;const u=v;let f=u.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");if(u.response)try{const I=JSON.parse(u.response);typeof(I==null?void 0:I.detail)=="string"?f=I.detail:Array.isArray(I==null?void 0:I.detail)&&((N=I.detail[0])!=null&&N.msg)&&(f=I.detail[0].msg)}catch{f=u.response}y({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:f,variant:"destructive"})}}),b=()=>{const v={hf_models:[...c.hf_models],hf_datasets:[...c.hf_datasets],hf_spaces:[...c.hf_spaces]};for(const{key:u}of Ye){const f=g[u].trim();if(f){if(v[u].some(N=>N.trim()===f))return alert(`This ${u.replace("hf_","")} URL is already added`),null;v[u]=[...v[u],f]}}return v},L=v=>{const u=g[v].trim();if(u){if(c[v].some(f=>f.trim()===u)){alert(`This ${v.replace("hf_","")} URL is already added`);return}p(f=>({...f,[v]:[...f[v],u]})),n(f=>({...f,[v]:""}))}},A=(v,u)=>{p(f=>({...f,[v]:f[v].filter(N=>N!==u)}))},T=()=>{const v=b();if(v===null)return;const u=Object.keys(i).some(f=>i[f].some(N=>!v[f].includes(N)));o==="direct"&&u&&!window.confirm("Remove one or more Hugging Face artifact links?")||w.mutate({paperId:a,artifacts:v})},C=h.useMemo(()=>{const v={hf_models:[...c.hf_models],hf_datasets:[...c.hf_datasets],hf_spaces:[...c.hf_spaces]};for(const{key:u}of Ye){const f=g[u].trim();if(f){if(v[u].some(N=>N.trim()===f))return!1;v[u]=[...v[u],f]}}return!lr(v,i)},[c,g,i]);return e.jsx(W,{open:t,onOpenChange:s,children:e.jsxs(Y,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Hugging Face Artifacts"}),e.jsx(se,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(fe,{isAuthor:l}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:Ye.map(({key:v,label:u,placeholder:f})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:u}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(X,{type:"url",placeholder:f,value:g[v],onChange:N=>n(I=>({...I,[v]:N.target.value})),onKeyPress:N=>{N.key==="Enter"&&(N.preventDefault(),L(v))},className:"flex-1"}),e.jsxs(D,{onClick:()=>L(v),size:"sm",disabled:!g[v].trim(),children:[e.jsx(Fe,{className:"w-4 h-4 mr-1"}),"Add"]})]}),c[v].length>0?e.jsx("div",{className:"space-y-2",children:c[v].map(N=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:N}),e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>A(v,N),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${u.toLowerCase()} URL`,children:e.jsx(Te,{className:"w-4 h-4"})})]},N))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",u.toLowerCase()," linked yet."]})]},v))}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:T,disabled:w.isPending||!C,children:w.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}var Ue="Checkbox",[dr]=mt(Ue),[ur,ft]=dr(Ue);function mr(t){const{__scopeCheckbox:s,checked:a,children:r,defaultChecked:i,disabled:d,form:o,name:l,onCheckedChange:c,required:p,value:g="on",internal_do_not_use_render:n}=t,[j,y]=Ht({prop:a,defaultProp:i??!1,onChange:c,caller:Ue}),[_,w]=h.useState(null),[b,L]=h.useState(null),A=h.useRef(!1),T=_?!!o||!!_.closest("form"):!0,C={checked:j,disabled:d,setChecked:y,control:_,setControl:w,name:l,form:o,value:g,hasConsumerStoppedPropagationRef:A,required:p,defaultChecked:he(i)?!1:i,isFormControl:T,bubbleInput:b,setBubbleInput:L};return e.jsx(ur,{scope:s,...C,children:hr(n)?n(C):r})}var Jt="CheckboxTrigger",Xt=h.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:a,...r},i)=>{const{control:d,value:o,disabled:l,checked:c,required:p,setControl:g,setChecked:n,hasConsumerStoppedPropagationRef:j,isFormControl:y,bubbleInput:_}=ft(Jt,t),w=Ce(i,g),b=h.useRef(c);return h.useEffect(()=>{const L=d==null?void 0:d.form;if(L){const A=()=>n(b.current);return L.addEventListener("reset",A),()=>L.removeEventListener("reset",A)}},[d,n]),e.jsx(xe.button,{type:"button",role:"checkbox","aria-checked":he(c)?"mixed":c,"aria-required":p,"data-state":ts(c),"data-disabled":l?"":void 0,disabled:l,value:o,...r,ref:w,onKeyDown:_e(s,L=>{L.key==="Enter"&&L.preventDefault()}),onClick:_e(a,L=>{n(A=>he(A)?!0:!A),_&&y&&(j.current=L.isPropagationStopped(),j.current||L.stopPropagation())})})});Xt.displayName=Jt;var gt=h.forwardRef((t,s)=>{const{__scopeCheckbox:a,name:r,checked:i,defaultChecked:d,required:o,disabled:l,value:c,onCheckedChange:p,form:g,...n}=t;return e.jsx(mr,{__scopeCheckbox:a,checked:i,defaultChecked:d,disabled:l,required:o,onCheckedChange:p,name:r,form:g,value:c,internal_do_not_use_render:({isFormControl:j})=>e.jsxs(e.Fragment,{children:[e.jsx(Xt,{...n,ref:s,__scopeCheckbox:a}),j&&e.jsx(es,{__scopeCheckbox:a})]})})});gt.displayName=Ue;var Zt="CheckboxIndicator",Wt=h.forwardRef((t,s)=>{const{__scopeCheckbox:a,forceMount:r,...i}=t,d=ft(Zt,a);return e.jsx(Dt,{present:r||he(d.checked)||d.checked===!0,children:e.jsx(xe.span,{"data-state":ts(d.checked),"data-disabled":d.disabled?"":void 0,...i,ref:s,style:{pointerEvents:"none",...t.style}})})});Wt.displayName=Zt;var Yt="CheckboxBubbleInput",es=h.forwardRef(({__scopeCheckbox:t,...s},a)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:d,defaultChecked:o,required:l,disabled:c,name:p,value:g,form:n,bubbleInput:j,setBubbleInput:y}=ft(Yt,t),_=Ce(a,y),w=Ot(d),b=Mt(r);h.useEffect(()=>{const A=j;if(!A)return;const T=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(T,"checked").set,u=!i.current;if(w!==d&&v){const f=new Event("click",{bubbles:u});A.indeterminate=he(d),v.call(A,he(d)?!1:d),A.dispatchEvent(f)}},[j,w,d,i]);const L=h.useRef(he(d)?!1:d);return e.jsx(xe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??L.current,required:l,disabled:c,name:p,value:g,form:n,...s,tabIndex:-1,ref:_,style:{...s.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});es.displayName=Yt;function hr(t){return typeof t=="function"}function he(t){return t==="indeterminate"}function ts(t){return he(t)?"indeterminate":t?"checked":"unchecked"}const Be=h.forwardRef(({className:t,style:s,...a},r)=>e.jsx(gt,{ref:r,className:$e("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...a,children:e.jsx(Wt,{className:$e("flex items-center justify-center text-current"),children:e.jsx(de,{className:"h-4 w-4"})})}));Be.displayName=gt.displayName;const pr=250,fr=100;function gr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialMethodIds:i,initialMethods:d,onSuccess:o,submitMode:l="direct",isAuthor:c=!1}){const[p,g]=h.useState(i),[n,j]=h.useState(!1),[y,_]=h.useState(""),[w,b]=h.useState(""),[L,A]=h.useState(new Map),T=ue(),{toast:C}=ie(),v=h.useRef(!1);h.useEffect(()=>{if(!t){v.current=!1;return}if(v.current)return;v.current=!0,g(i),_(""),b("");const m=new Map;(d||[]).forEach(E=>{const $=parseInt(E.id);Number.isNaN($)||m.set($,E)}),A(m)},[t,i,d]),h.useEffect(()=>{const m=window.setTimeout(()=>{b(y.trim())},pr);return()=>window.clearTimeout(m)},[y]);const{data:u,isFetching:f}=re({queryKey:["methods-search",w],queryFn:()=>ge.listMethods({page_size:fr,...w?{q:w}:{}}),enabled:t});h.useEffect(()=>{var m;(m=u==null?void 0:u.results)!=null&&m.length&&A(E=>{const $=new Map(E);return u.results.forEach(F=>{const S=parseInt(F.id);Number.isNaN(S)||$.set(S,F)}),$})},[u]);const N=h.useMemo(()=>{const m=(u==null?void 0:u.results)||[],E=new Set,$=[];return p.forEach(F=>{if(E.has(F))return;const S=L.get(F);S&&($.push(S),E.add(F))}),m.forEach(F=>{const S=parseInt(F.id);Number.isNaN(S)||E.has(S)||($.push(F),E.add(S))}),$},[u,p,L]),I=me({mutationFn:async({paperId:m,methodIds:E})=>l==="pending"?(await pe.submit({paper_id:parseInt(m),edit_type:"methods",proposed_payload:{method_ids:E}}),null):V.updateMethods(m,E),onSuccess:m=>{if(l==="pending"){C({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),o==null||o(),s(!1);return}m&&ve(T,m,[a,r]),C({title:"Methods updated",description:`Saved ${p.length} method${p.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1)},onError:m=>{var F;const E=m;let $=E.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(E.response)try{const S=JSON.parse(E.response);typeof(S==null?void 0:S.detail)=="string"?$=S.detail:Array.isArray(S==null?void 0:S.detail)&&((F=S.detail[0])!=null&&F.msg)&&($=S.detail[0].msg)}catch{$=E.response}C({title:l==="pending"?"Could not submit edit":"Could not save methods",description:$,variant:"destructive"})}}),B=()=>{l==="direct"&&i.some(m=>!p.includes(m))&&!window.confirm("Remove one or more method links from this paper?")||I.mutate({paperId:a,methodIds:p})},H=h.useMemo(()=>{if(p.length!==i.length)return!0;const m=new Set(i);return p.some(E=>!m.has(E))},[p,i]),K=(m,E)=>{g($=>E?$.includes(m)?$:[...$,m]:$.filter(F=>F!==m))},G=()=>_("");return e.jsxs(W,{open:t,onOpenChange:s,children:[e.jsxs(Y,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Paper Methods"}),e.jsx(se,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),l==="pending"&&e.jsx(fe,{isAuthor:c}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ne,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(X,{type:"text",placeholder:"Search methods...",value:y,onChange:m=>_(m.target.value),className:"pl-9 pr-9"}),y&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(ht,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:N.length>0?e.jsx("div",{className:"space-y-2",children:N.map(m=>{const E=parseInt(m.id),$=p.includes(E);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Be,{id:`method-${m.id}`,checked:$,onCheckedChange:F=>K(E,F===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${m.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[m.name,m.full_name&&m.full_name!==m.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:m.full_name}),m.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[m.description.substring(0,100),m.description.length>100?"...":""]})]})]},m.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ne,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:w?`No methods found matching "${w}"`:"No methods available"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"ghost",className:"sm:mr-auto",onClick:()=>j(!0),children:"Suggest a new method"}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:B,disabled:I.isPending||!H,children:I.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(pt,{open:n,onOpenChange:j,paperId:a,kind:"method"})]})}const xr=({open:t,onOpenChange:s,paperId:a,initialOrganizationIds:r,submitMode:i,isAuthor:d})=>{var _;const[o,l]=h.useState(r),[c,p]=h.useState(""),g=ue();h.useEffect(()=>{t&&(l(r),p(""))},[r,t]);const n=re({queryKey:["organizations","curation"],queryFn:()=>ge.organizations(!1),enabled:t}),j=h.useMemo(()=>{var b,L;const w=c.trim().toLocaleLowerCase();return w?(((L=n.data)==null?void 0:L.results)??[]).filter(A=>A.name.toLocaleLowerCase().includes(w)):((b=n.data)==null?void 0:b.results)??[]},[(_=n.data)==null?void 0:_.results,c]),y=me({mutationFn:async()=>{r.some(b=>!o.includes(b))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")||(i==="pending"?await pe.submit({paper_id:Number(a),edit_type:"organizations",proposed_payload:{organization_ids:o}}):await V.updateOrganizations(a,o))},onSuccess:()=>{g.invalidateQueries({queryKey:["paper-arxiv"]}),s(!1)}});return e.jsx(W,{open:t,onOpenChange:s,children:e.jsxs(Y,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit organizations"}),e.jsx(se,{children:"Associate existing organizations with this paper. Organization creation remains admin-only."})]}),i==="pending"&&e.jsx(fe,{isAuthor:d}),e.jsxs("div",{className:"relative",children:[e.jsx(Ne,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(X,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:c,onChange:w=>p(w.target.value),className:"pl-9 pr-9"}),c&&e.jsx("button",{type:"button",onClick:()=>p(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear organization search",children:e.jsx(ht,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[j.map(w=>{const b=Number(w.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes(b),onChange:L=>l(A=>L.target.checked?[...A,b]:A.filter(T=>T!==b))}),w.name]},w.id)}),!n.isLoading&&j.length===0&&e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:c.trim()?`No organizations found matching "${c.trim()}"`:"No organizations available"})]}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:()=>y.mutate(),disabled:y.isPending,children:i==="pending"?"Submit test edit":"Save changes"})]})]})})};function br({open:t,onOpenChange:s,paperId:a,arxivId:r,initialProjectPages:i,onSuccess:d,submitMode:o="direct",isAuthor:l=!1}){const[c,p]=h.useState(i),[g,n]=h.useState(""),j=ue(),{toast:y}=ie(),_=h.useRef(!1);h.useEffect(()=>{if(!t){_.current=!1;return}_.current||(_.current=!0,p(i),n(""))},[t,i]);const w=me({mutationFn:async({paperId:u,projectPages:f})=>o==="pending"?(await pe.submit({paper_id:parseInt(u),edit_type:"project_pages",proposed_payload:{project_pages:f}}),null):V.updateProjectPages(u,f),onSuccess:u=>{if(o==="pending"){y({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),d==null||d(),s(!1),n("");return}u&&ve(j,u,[a,r]),d==null||d(),s(!1),n("")},onError:u=>{var I;const f=u;let N=f.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(f.response)try{const B=JSON.parse(f.response);typeof(B==null?void 0:B.detail)=="string"?N=B.detail:Array.isArray(B==null?void 0:B.detail)&&((I=B.detail[0])!=null&&I.msg)&&(N=B.detail[0].msg)}catch{N=f.response}y({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:N,variant:"destructive"})}}),b=()=>{const u=g.trim();return u?c.some(f=>f.url===u)?(alert("This project page URL is already added"),null):[...c,{url:u,is_official:!1}]:c},L=()=>{const u=b();u!==null&&u.length!==c.length&&(p(u),n(""))},A=u=>{p(c.filter(f=>f.url!==u))},T=u=>{p(c.map(f=>f.url===u?{...f,is_official:!f.is_official}:f))},C=()=>{const u=b();u!==null&&(o==="direct"&&i.some(f=>!u.some(N=>N.url===f.url))&&!window.confirm("Remove one or more project pages from this paper?")||w.mutate({paperId:a,projectPages:u}))},v=h.useMemo(()=>{const u=g.trim(),f=u?[...c,{url:u,is_official:!1}]:c;if(f.length!==i.length)return!0;const N=new Map(i.map(I=>[I.url.trim(),!!I.is_official]));return f.some(I=>{const B=N.get(I.url.trim());return B===void 0||B!==!!I.is_official})},[c,g,i]);return e.jsx(W,{open:t,onOpenChange:s,children:e.jsxs(Y,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Paper Project Pages"}),e.jsx(se,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(fe,{isAuthor:l}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(X,{type:"url",placeholder:"https://example.com/project",value:g,onChange:u=>n(u.target.value),onKeyPress:u=>{u.key==="Enter"&&(u.preventDefault(),L())},className:"flex-1"}),e.jsxs(D,{onClick:L,size:"sm",disabled:!g.trim(),children:[e.jsx(Fe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:c.length>0?e.jsx("div",{className:"space-y-2",children:c.map((u,f)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(It,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:u.url}),u.is_official&&e.jsx(Kt,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(D,{variant:u.is_official?"default":"outline",size:"sm",onClick:()=>T(u.url),className:"h-8 px-2 text-xs",title:u.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(Gt,{className:`w-3.5 h-3.5 mr-1 ${u.is_official?"fill-current":""}`}),u.is_official?"Official":"Mark official"]}),e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>A(u.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},f))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(It,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:C,disabled:w.isPending||!v,children:w.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function vr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialRepositories:i,onSuccess:d,submitMode:o="direct",isAuthor:l=!1}){const[c,p]=h.useState(i),[g,n]=h.useState(""),j=ue(),{toast:y}=ie(),_=h.useRef(!1);h.useEffect(()=>{if(!t){_.current=!1;return}_.current||(_.current=!0,p(i),n(""))},[t,i]);const w=me({mutationFn:async({paperId:f,repositories:N})=>o==="pending"?(await pe.submit({paper_id:parseInt(f),edit_type:"repositories",proposed_payload:{repositories:N}}),null):V.updateRepositories(f,N),onSuccess:f=>{if(o==="pending"){y({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),d==null||d(),s(!1),n("");return}f&&ve(j,f,[a,r]),d==null||d(),s(!1),n("")},onError:f=>{var B;const N=f;let I=N.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(N.response)try{const H=JSON.parse(N.response);typeof(H==null?void 0:H.detail)=="string"?I=H.detail:Array.isArray(H==null?void 0:H.detail)&&((B=H.detail[0])!=null&&B.msg)&&(I=H.detail[0].msg)}catch{I=N.response}y({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:I,variant:"destructive"})}}),b=f=>{const N=[];for(const I of f){const B=N.find(H=>Et(H.url,I.url));if(B)B.is_official=B.is_official||I.is_official;else{const H=Oe(I.url);N.push({url:H??I.url.trim(),is_official:I.is_official})}}return N},L=()=>{const f=g.trim(),N=f?[...c,{url:f,is_official:!1}]:c;return f&&c.some(I=>Et(I.url,f))?(alert("This repository URL is already added"),null):b(N)},A=()=>{const f=L();f!==null&&f.length!==c.length&&(p(f),n(""))},T=f=>{p(c.filter(N=>N.url!==f))},C=f=>{p(c.map(N=>N.url===f?{...N,is_official:!N.is_official}:N))},v=()=>{const f=L();f!==null&&(o==="direct"&&i.some(N=>!f.some(I=>I.url===N.url))&&!window.confirm("Remove one or more repositories from this paper?")||w.mutate({paperId:a,repositories:f}))},u=h.useMemo(()=>{const f=g.trim(),N=f?[...c,{url:f,is_official:!1}]:c;if(N.length!==i.length)return!0;const I=b(i),B=b(N);if(B.length!==I.length)return!0;const H=new Map(I.map(K=>[Oe(K.url)??K.url.trim(),!!K.is_official]));return B.some(K=>{const G=Oe(K.url)??K.url.trim(),m=H.get(G);return m===void 0||m!==!!K.is_official})},[c,g,i]);return e.jsx(W,{open:t,onOpenChange:s,children:e.jsxs(Y,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Paper Repositories"}),e.jsx(se,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(fe,{isAuthor:l}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(X,{type:"url",placeholder:"https://github.com/owner/repo",value:g,onChange:f=>n(f.target.value),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),A())},className:"flex-1"}),e.jsxs(D,{onClick:A,size:"sm",disabled:!g.trim(),children:[e.jsx(Fe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:c.length>0?e.jsx("div",{className:"space-y-2",children:c.map((f,N)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(St,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:f.url}),f.is_official&&e.jsx(Kt,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(D,{variant:f.is_official?"default":"outline",size:"sm",onClick:()=>C(f.url),className:"h-8 px-2 text-xs",title:f.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(Gt,{className:`w-3.5 h-3.5 mr-1 ${f.is_official?"fill-current":""}`}),f.is_official?"Official":"Mark official"]}),e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>T(f.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},N))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(St,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:v,disabled:w.isPending||!u,children:w.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function jr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrl:i,onSuccess:d,submitMode:o="direct",isAuthor:l=!1}){const[c,p]=h.useState(i),g=ue(),{toast:n}=ie(),j=h.useRef(!1);h.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,p(i))},[t,i]);const y=me({mutationFn:async({paperId:A,sourceUrl:T})=>o==="pending"?(await pe.submit({paper_id:parseInt(A),edit_type:"source_url",proposed_payload:{source_url:T}}),null):V.updateSourceUrl(A,T),onSuccess:A=>{if(o==="pending"){n({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),d==null||d(),s(!1);return}A&&ve(g,A,[a,r]),d==null||d(),s(!1)},onError:A=>{var v;const T=A;let C=T.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(T.response)try{const u=JSON.parse(T.response);typeof(u==null?void 0:u.detail)=="string"?C=u.detail:Array.isArray(u==null?void 0:u.detail)&&((v=u.detail[0])!=null&&v.msg)&&(C=u.detail[0].msg)}catch{C=T.response}n({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:C,variant:"destructive"})}}),_=c.trim(),w=/^https?:\/\//i.test(_),b=_!==(i||"").trim(),L=()=>{w&&y.mutate({paperId:a,sourceUrl:_})};return e.jsx(W,{open:t,onOpenChange:s,children:e.jsxs(Y,{className:"max-w-2xl",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Source URL"}),e.jsxs(se,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(fe,{isAuthor:l}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(X,{type:"url",placeholder:"https://example.com/paper",value:c,onChange:A=>p(A.target.value),onKeyPress:A=>{A.key==="Enter"&&w&&b&&(A.preventDefault(),L())}}),!w&&_.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:L,disabled:y.isPending||!w||!b,children:y.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const yr=250,wr=100;function kr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialTaskIds:i,initialTasks:d,onSuccess:o,submitMode:l="direct",isAuthor:c=!1}){const[p,g]=h.useState(i),[n,j]=h.useState(!1),[y,_]=h.useState(""),[w,b]=h.useState(""),[L,A]=h.useState(new Map),T=ue(),{toast:C}=ie(),v=h.useRef(!1);h.useEffect(()=>{if(!t){v.current=!1;return}if(v.current)return;v.current=!0,g(i),_(""),b("");const m=new Map;(d||[]).forEach(E=>{const $=parseInt(E.id);Number.isNaN($)||m.set($,E)}),A(m)},[t,i,d]),h.useEffect(()=>{const m=window.setTimeout(()=>{b(y.trim())},yr);return()=>window.clearTimeout(m)},[y]);const{data:u,isFetching:f}=re({queryKey:["tasks-search",w],queryFn:()=>ge.listTasks({page_size:wr,...w?{q:w}:{}}),enabled:t});h.useEffect(()=>{var m;(m=u==null?void 0:u.results)!=null&&m.length&&A(E=>{const $=new Map(E);return u.results.forEach(F=>{const S=parseInt(F.id);Number.isNaN(S)||$.set(S,F)}),$})},[u]);const N=h.useMemo(()=>{const m=(u==null?void 0:u.results)||[],E=new Set,$=[];return p.forEach(F=>{if(E.has(F))return;const S=L.get(F);S&&($.push(S),E.add(F))}),m.forEach(F=>{const S=parseInt(F.id);Number.isNaN(S)||E.has(S)||($.push(F),E.add(S))}),$},[u,p,L]),I=me({mutationFn:async({paperId:m,taskIds:E})=>l==="pending"?(await pe.submit({paper_id:parseInt(m),edit_type:"tasks",proposed_payload:{task_ids:E}}),null):V.updateTasks(m,E),onMutate:async({taskIds:m})=>{if(l==="pending")return{snapshots:[]};const E=m.map(S=>L.get(S)).filter(S=>!!S).map(S=>({id:S.id,name:S.name,slug:S.slug})).sort((S,O)=>S.name.localeCompare(O.name)),$=Array.from(new Set([a,r].filter(S=>!!S)));await Promise.all($.flatMap(S=>[T.cancelQueries({queryKey:["paper",S]}),T.cancelQueries({queryKey:["paper-arxiv",S]})]));const F=[];return $.forEach(S=>{["paper","paper-arxiv"].forEach(O=>{const Z=[O,S],x=T.getQueryData(Z);F.push({key:Z,data:x}),x&&T.setQueryData(Z,{...x,tasks:E})})}),C({title:"Tasks updated",description:`Saved ${m.length} task${m.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1),{snapshots:F}},onSuccess:m=>{if(l==="pending"){C({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),o==null||o(),s(!1);return}m&&ve(T,m,[a,r])},onError:(m,E,$)=>{var O,Z;(O=$==null?void 0:$.snapshots)==null||O.forEach(({key:x,data:P})=>{T.setQueryData(x,P)});const F=m;let S=F.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(F.response)try{const x=JSON.parse(F.response);typeof(x==null?void 0:x.detail)=="string"?S=x.detail:Array.isArray(x==null?void 0:x.detail)&&((Z=x.detail[0])!=null&&Z.msg)&&(S=x.detail[0].msg)}catch{S=F.response}C({title:l==="pending"?"Could not submit edit":"Could not save tasks",description:S,variant:"destructive"})}}),B=()=>{l==="direct"&&i.some(m=>!p.includes(m))&&!window.confirm("Remove one or more task links from this paper?")||I.mutate({paperId:a,taskIds:p})},H=h.useMemo(()=>{if(p.length!==i.length)return!0;const m=new Set(i);return p.some(E=>!m.has(E))},[p,i]),K=(m,E)=>{g($=>E?$.includes(m)?$:[...$,m]:$.filter(F=>F!==m))},G=()=>_("");return e.jsxs(W,{open:t,onOpenChange:s,children:[e.jsxs(Y,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Paper Tasks"}),e.jsx(se,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),l==="pending"&&e.jsx(fe,{isAuthor:c}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ne,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(X,{type:"text",placeholder:"Search tasks...",value:y,onChange:m=>_(m.target.value),className:"pl-9 pr-9"}),y&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(ht,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:N.length>0?e.jsx("div",{className:"space-y-2",children:N.map(m=>{const E=parseInt(m.id),$=p.includes(E);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Be,{id:`task-${m.id}`,checked:$,onCheckedChange:F=>K(E,F===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${m.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[m.name,m.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[m.description.substring(0,100),m.description.length>100?"...":""]})]})]},m.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ne,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:w?`No tasks found matching "${w}"`:"No tasks available"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"ghost",className:"sm:mr-auto",onClick:()=>j(!0),children:"Suggest a new task"}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:B,disabled:I.isPending||!H,children:I.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(pt,{open:n,onOpenChange:j,paperId:a,kind:"task"})]})}function _r({activeEditor:t,arxivId:s,editSubmitMode:a,evaluations:r,isAdmin:i,isLinkedAuthor:d,onOpenChange:o,paper:l}){if(!t)return null;const c={open:!0,paperId:l.id,arxivId:s,submitMode:a,isAuthor:d},p=n=>j=>o(n,j);return{tasks:()=>{var n;return e.jsx(kr,{...c,onOpenChange:p("tasks"),initialTaskIds:((n=l.tasks)==null?void 0:n.map(j=>Number(j.id)))??[],initialTasks:l.tasks??[]})},methods:()=>{var n;return e.jsx(gr,{...c,onOpenChange:p("methods"),initialMethodIds:((n=l.methods)==null?void 0:n.map(j=>Number(j.id)))??[],initialMethods:l.methods??[]})},repositories:()=>{var n;return e.jsx(vr,{...c,onOpenChange:p("repositories"),initialRepositories:((n=l.repositories)==null?void 0:n.map(({url:j,is_official:y})=>({url:j,is_official:!!y})))??[]})},"project-pages":()=>{var n;return e.jsx(br,{...c,onOpenChange:p("project-pages"),initialProjectPages:((n=l.project_pages)==null?void 0:n.map(({url:j,is_official:y})=>({url:j,is_official:!!y})))??[]})},results:()=>e.jsx(ir,{...c,onOpenChange:p("results"),initialEvaluations:r,paperTasks:l.tasks??[],isAdmin:i}),"source-url":()=>e.jsx(jr,{...c,onOpenChange:p("source-url"),initialUrl:l.source_url??l.url_abs??""}),"hf-artifacts":()=>e.jsx(cr,{...c,onOpenChange:p("hf-artifacts"),initialArtifacts:{hf_models:l.hf_models??[],hf_datasets:l.hf_datasets??[],hf_spaces:l.hf_spaces??[]}}),organizations:()=>e.jsx(xr,{open:!0,paperId:l.id,onOpenChange:p("organizations"),initialOrganizationIds:(l.organizations??[]).map(({id:n})=>Number(n)),submitMode:a,isAuthor:d})}[t]()}const Nr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals",start:ua,get:da,cancel:ca},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper",start:la,get:oa,cancel:ia}};function Cr({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(pa,{remarkPlugins:[fa],components:{a:({children:s,...a})=>e.jsx("a",{...a,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:s}),p:({children:s})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:s}),ul:({children:s})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:s}),ol:({children:s})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:s}),h1:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h2:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h3:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),code:({children:s})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:s}),pre:({children:s})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:s})},children:t})})}function ss({kind:t,paperId:s,paperTitle:a,triggerClassName:r,onComplete:i}){const d=Nr[t],[o,l]=h.useState(!1),[c,p]=h.useState(null),[g,n]=h.useState(!1),[j,y]=h.useState(null),_=h.useRef(null),w=(c==null?void 0:c.status)==="queued"||(c==null?void 0:c.status)==="dispatching"||(c==null?void 0:c.status)==="running",b=c==null?void 0:c.id;h.useEffect(()=>{if(!w||!b)return;let C=!1;const v=window.setInterval(async()=>{try{const u=await d.get(b);C||(p(u),y(null))}catch(u){C||y(u instanceof Error?u.message:"Could not check job status.")}},2e3);return()=>{C=!0,window.clearInterval(v)}},[w,d,b]),h.useEffect(()=>{(c==null?void 0:c.status)!=="completed"||_.current===c.id||(_.current=c.id,i())},[c,i]);const L=async()=>{n(!0),y(null);try{p(await d.start(s))}catch(C){y(C instanceof Error?C.message:"Could not start Codex.")}finally{n(!1)}},A=()=>{p(null),y(null),_.current=null},T=async()=>{if(c){y(null);try{p(await d.cancel(c.id))}catch(C){y(C instanceof Error?C.message:"Could not cancel Codex.")}}};return e.jsxs(W,{open:o,onOpenChange:l,children:[e.jsx("button",{type:"button",className:r,onClick:()=>l(!0),children:w?d.running:(c==null?void 0:c.status)==="completed"?d.complete:d.trigger}),e.jsxs(Y,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(ee,{className:"min-w-0",children:[e.jsx(te,{children:d.title}),e.jsx(se,{children:d.description(a)})]}),c?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",c.status]}),c.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:c.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),w&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[c.status==="queued"?"This job is queued and will start after the current Codex job finishes.":d.progress," ","This can take several minutes; you can close this window and return."]}),c.report&&e.jsx(Cr,{report:c.report}),c.error&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:c.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:d.notice}),j&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:j}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>l(!1),children:w?"Close":"Cancel"}),w&&e.jsx(D,{variant:"outline",onClick:()=>void T(),children:"Cancel job"}),!c&&e.jsx(D,{onClick:L,disabled:g,children:g?"Starting…":d.action}),c&&!w&&e.jsx(D,{variant:"outline",onClick:A,children:"Run again"})]})]})]})}function Er(t){return e.jsx(ss,{...t,kind:"add-evals",triggerClassName:"edit-link"})}function ye({accent:t,id:s,label:a}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:s,children:[e.jsx("span",{children:e.jsx("a",{href:`#${s}`,className:"section-anchor-link",children:a})}),t]})}function Sr({canCopyBadge:t,canEdit:s,evaluationsByTask:a,evaluationsLoading:r,isAdmin:i,onCopyBadge:d,onEdit:o,onRefresh:l,paper:c,visibleEvaluationCount:p}){return e.jsxs(e.Fragment,{children:[e.jsx(ye,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[p," benchmarks",t&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:d,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(J,{name:"copy",size:10})," Copy PwC badge"]}),i&&ma()&&e.jsx(Er,{paperId:Number(c.id),paperTitle:c.title,onComplete:l}),s&&e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})}),r?e.jsx(ke,{className:"h-32 w-full"}):a.length>0?a.map(g=>e.jsxs("div",{className:g.taskSlug?"paper-section-anchor":void 0,id:g.taskSlug?Vt(g.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:g.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(le,{to:`/tasks/${g.taskSlug}`,children:g.taskName}),e.jsx("a",{href:La(g.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${g.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):g.taskName}),e.jsxs("span",{className:"accent",children:[g.rows.length," ",g.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:g.rows.map(n=>{var j;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:n.dataset_slug?e.jsx(le,{to:`/benchmark/${n.dataset_slug}`,children:n.dataset_name||"—"}):n.dataset_name||"—"}),e.jsxs("td",{className:"model",title:n.model_name||void 0,children:[n.hf_model_url?e.jsx("a",{href:n.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${n.model_name||"model"} on Hugging Face`,children:n.model_name||"—"}):n.model_name||"—",n.is_open===!1&&e.jsx(Vs,{}),(n.external??n.is_external)&&e.jsx(Js,{sourceUrl:n.source_url||n.external_source_url||n.result_url})]}),e.jsx("td",{className:"metric",children:n.best_metric}),e.jsx("td",{className:"value",children:Es((j=n.metrics)==null?void 0:j[n.best_metric||""])}),e.jsx("td",{className:"rank",children:n.best_rank!=null?`#${n.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:n.dataset_slug&&e.jsx(le,{to:`/benchmark/${n.dataset_slug}?${[n.task_slug?`task=${encodeURIComponent(n.task_slug)}`:"",`eval=${encodeURIComponent(n.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},n.id)})})]})]},g.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]})}var xt="Radio",[Pr,as]=mt(xt),[Ir,$r]=Pr(xt),rs=h.forwardRef((t,s)=>{const{__scopeRadio:a,name:r,checked:i=!1,required:d,disabled:o,value:l="on",onCheck:c,form:p,...g}=t,[n,j]=h.useState(null),y=Ce(s,b=>j(b)),_=h.useRef(!1),w=n?p||!!n.closest("form"):!0;return e.jsxs(Ir,{scope:a,checked:i,disabled:o,children:[e.jsx(xe.button,{type:"button",role:"radio","aria-checked":i,"data-state":ls(i),"data-disabled":o?"":void 0,disabled:o,value:l,...g,ref:y,onClick:_e(t.onClick,b=>{i||c==null||c(),w&&(_.current=b.isPropagationStopped(),_.current||b.stopPropagation())})}),w&&e.jsx(os,{control:n,bubbles:!_.current,name:r,value:l,checked:i,required:d,disabled:o,form:p,style:{transform:"translateX(-100%)"}})]})});rs.displayName=xt;var ns="RadioIndicator",is=h.forwardRef((t,s)=>{const{__scopeRadio:a,forceMount:r,...i}=t,d=$r(ns,a);return e.jsx(Dt,{present:r||d.checked,children:e.jsx(xe.span,{"data-state":ls(d.checked),"data-disabled":d.disabled?"":void 0,...i,ref:s})})});is.displayName=ns;var Ar="RadioBubbleInput",os=h.forwardRef(({__scopeRadio:t,control:s,checked:a,bubbles:r=!0,...i},d)=>{const o=h.useRef(null),l=Ce(o,d),c=Ot(a),p=Mt(s);return h.useEffect(()=>{const g=o.current;if(!g)return;const n=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(n,"checked").set;if(c!==a&&y){const _=new Event("click",{bubbles:r});y.call(g,a),g.dispatchEvent(_)}},[c,a,r]),e.jsx(xe.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:l,style:{...i.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});os.displayName=Ar;function ls(t){return t?"checked":"unchecked"}var Lr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],De="RadioGroup",[Rr]=mt(De,[zt,as]),cs=zt(),ds=as(),[Fr,Tr]=Rr(De),us=h.forwardRef((t,s)=>{const{__scopeRadioGroup:a,name:r,defaultValue:i,value:d,required:o=!1,disabled:l=!1,orientation:c,dir:p,loop:g=!0,onValueChange:n,...j}=t,y=cs(a),_=Ss(p),[w,b]=Ht({prop:d,defaultProp:i??null,onChange:n,caller:De});return e.jsx(Fr,{scope:a,name:r,required:o,disabled:l,value:w,onValueChange:b,children:e.jsx(Ps,{asChild:!0,...y,orientation:c,dir:_,loop:g,children:e.jsx(xe.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:_,...j,ref:s})})})});us.displayName=De;var ms="RadioGroupItem",hs=h.forwardRef((t,s)=>{const{__scopeRadioGroup:a,disabled:r,...i}=t,d=Tr(ms,a),o=d.disabled||r,l=cs(a),c=ds(a),p=h.useRef(null),g=Ce(s,p),n=d.value===i.value,j=h.useRef(!1);return h.useEffect(()=>{const y=w=>{Lr.includes(w.key)&&(j.current=!0)},_=()=>j.current=!1;return document.addEventListener("keydown",y),document.addEventListener("keyup",_),()=>{document.removeEventListener("keydown",y),document.removeEventListener("keyup",_)}},[]),e.jsx(Is,{asChild:!0,...l,focusable:!o,active:n,children:e.jsx(rs,{disabled:o,required:d.required,checked:n,...c,...i,name:d.name,ref:g,onCheck:()=>d.onValueChange(i.value),onKeyDown:_e(y=>{y.key==="Enter"&&y.preventDefault()}),onFocus:_e(i.onFocus,()=>{var y;j.current&&((y=p.current)==null||y.click())})})})});hs.displayName=ms;var Ur="RadioGroupIndicator",ps=h.forwardRef((t,s)=>{const{__scopeRadioGroup:a,...r}=t,i=ds(a);return e.jsx(is,{...i,...r,ref:s})});ps.displayName=Ur;var fs=us,gs=hs,Br=ps;const it=h.forwardRef(({className:t,...s},a)=>e.jsx(fs,{className:$e("grid gap-2",t),...s,ref:a}));it.displayName=fs.displayName;const we=h.forwardRef(({className:t,...s},a)=>e.jsx(gs,{ref:a,className:$e("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(Br,{className:"flex items-center justify-center",children:e.jsx($s,{className:"h-2.5 w-2.5 fill-current text-current"})})}));we.displayName=gs.displayName;const Dr={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},ot=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,Hr=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,Mr=20,lt="copy_to_bucket";function zr(t){const s=t.trim();if(!Hr.test(s))return null;const[a,r]=s.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(a)}/${encodeURIComponent(r)}`}function ct(t){return`pwc:bucket-copy:${t}`}function qr(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(lt)!==t)return null;try{const a=window.sessionStorage.getItem(ct(t));if(!a)return null;const r=JSON.parse(a);return r.paperId!==t||typeof r.bucketId!="string"||!["new","existing"].includes(r.destinationMode)||!["public","private"].includes(r.visibility)||!Array.isArray(r.selectedIds)||r.selectedIds.some(i=>typeof i!="string")?null:r}catch{return null}}function Or(t,s=Mr){if(s<1)throw new Error("Bucket copy batch size must be positive");const a=[];for(let r=0;r!ot.test(c)))return null;const o=d.join("/"),l=s==="model"?"":`${s}s/`;return{id:`${s}:${o}`,kind:s,label:o,url:`https://huggingface.co/${l}${o}`,source:`hf://${l}${o}/`,destination:`${s}s/${o}/`,repoId:o}}catch{return null}}function Kr(t){try{const s=new URL(t);if(s.hostname!=="github.com"&&s.hostname!=="www.github.com")return null;const a=s.pathname.split("/").filter(Boolean);if(a.length<2)return null;const r=a[0],i=a[1].replace(/\.git$/,"");if(!ot.test(r)||!ot.test(i))return null;const d=`${r}/${i}`;return{id:`github:${d}`,kind:"github",label:d,url:`https://github.com/${d}`,source:`https://github.com/${d}.git`,destination:`github/${d}/`}}catch{return null}}function Gr({githubUrls:t,hfModelUrls:s,hfDatasetUrls:a,hfSpaceUrls:r,paperId:i,pdfName:d,pdfUrl:o}){const l=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${d||i}.pdf`}:null,...s.map(p=>tt(p,"model")),...a.map(p=>tt(p,"dataset")),...r.map(p=>tt(p,"space")),...t.map(Kr)],c=new Set;return l.filter(p=>!p||c.has(p.id)?!1:(c.add(p.id),!0))}function Qr(t,s,a){const r=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${Pe(t.trim())}`];a.create&&r.push(`hf buckets create "$HF_BUCKET" --exist-ok${a.isPrivate?" --private":""}`);for(const o of s.filter(l=>l.kind!=="github"&&l.kind!=="pdf"))r.push(`hf cp ${Pe(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const i=s.find(o=>o.kind==="pdf");i&&r.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${Pe(i.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${i.destination}"`);const d=s.filter(o=>o.kind==="github");if(d.length){r.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of d){const l=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;r.push(`git clone --depth 1 -- ${Pe(o.source)} "${l}"`,`hf sync "${l}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return r.join(` -`)}function Vr(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function Jr(t){const{toast:s}=ie(),a=h.useMemo(()=>Gr({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),r=h.useMemo(()=>qr(t.paperId),[t.paperId]),[i,d]=h.useState(!!r),[o,l]=h.useState((r==null?void 0:r.destinationMode)??"new"),[c,p]=h.useState((r==null?void 0:r.bucketId)??""),[g,n]=h.useState((r==null?void 0:r.visibility)??"public"),[j,y]=h.useState(()=>new Set((r==null?void 0:r.selectedIds)??a.map(m=>m.id))),[_,w]=h.useState(!1),[b,L]=h.useState(null),[A,T]=h.useState(!!r),C=a.filter(m=>j.has(m.id)),v=C.length===a.length,u=zr(c),f=u!==null,N=Qr(c,C,{create:o==="new",isPrivate:g==="private"}),I=(m,E)=>{y($=>{const F=new Set($);return E?F.add(m):F.delete(m),F})},B=async()=>{try{await navigator.clipboard.writeText(N),s({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{s({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},H=h.useCallback(()=>{const m=As("/api/v1/auth/hf/login"),E=new URL(window.location.href);E.searchParams.set(lt,t.paperId),window.sessionStorage.setItem(ct(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:c.trim(),destinationMode:o,visibility:g,selectedIds:Array.from(j)}));const $=new URLSearchParams({return_to:E.toString(),authorize_bucket:"true"});o==="new"&&$.set("bucket_create","true"),window.location.assign(`${m}?${$.toString()}`)},[c,o,t.paperId,j,g]),K=h.useCallback(async()=>{if(!t.isSignedIn){H();return}w(!0);let m=0,E=0;try{const $=C.filter(O=>O.kind!=="pdf"&&O.kind!=="github"&&!!O.repoId).map(O=>({kind:O.kind,repo_id:O.repoId})),F=Or($);F.length||F.push([]);for(const[O,Z]of F.entries()){L({current:O+1,total:F.length});const x=await V.copyToBucket(t.paperId,{bucket_id:c.trim(),create:O===0&&o==="new",private:g==="private",include_pdf:O===0&&C.some(P=>P.kind==="pdf"),artifacts:Z});m+=x.copied.length,E+=x.errors.length}const S=C.filter(O=>O.kind==="github").length;s({title:E?"Bucket copy partially completed":"Copied to bucket",description:[`${m} item${m===1?"":"s"} copied.`,E?`${E} item${E===1?"":"s"} failed.`:"",S?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:E?"destructive":void 0,action:u?e.jsx(Ls,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!E&&!S&&d(!1)}catch($){if($ instanceof rt&&$.code==="bucket_authorization_required"){H();return}s({title:m?"Bucket copy partially completed":"Bucket copy failed",description:m?`${m} item${m===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:$ instanceof rt&&typeof $.detail=="string"?$.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{w(!1),L(null)}},[H,c,u,o,t.isSignedIn,t.paperId,C,s,g]);h.useEffect(()=>{if(!A||!t.isSignedIn)return;T(!1),window.sessionStorage.removeItem(ct(t.paperId));const m=new URL(window.location.href);m.searchParams.delete(lt),window.history.replaceState({},"",`${m.pathname}${m.search}${m.hash}`),K()},[K,t.isSignedIn,t.paperId,A]);const G=()=>{y(new Set(a.map(m=>m.id))),!c&&t.suggestedBucketId&&p(t.suggestedBucketId),d(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:G,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:a.length?`${a.length} linked artifact${a.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(W,{open:i,onOpenChange:d,children:e.jsxs(Y,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(ee,{children:[e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(se,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),e.jsx("div",{className:"-mx-6 min-h-0 overflow-y-auto px-6",children:a.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Choose your destination"}),e.jsxs(it,{value:o,onValueChange:m=>l(m),className:"grid grid-cols-2 gap-2",children:[e.jsxs(ae,{className:"bucket-choice",children:[e.jsx(we,{value:"new"}),"New bucket"]}),e.jsxs(ae,{className:"bucket-choice",children:[e.jsx(we,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(X,{id:"bucket-id",value:c,onChange:m=>p(m.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":c.length>0&&!f}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."}),u&&e.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(J,{name:"external",size:10})]})]})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Bucket visibility"}),e.jsxs(it,{value:g,onValueChange:m=>n(m),className:"flex gap-5",children:[e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx(we,{value:"public"}),"Public"]}),e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx(we,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(ae,{children:"Artifacts"}),e.jsx(D,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>y(v?new Set:new Set(a.map(m=>m.id))),children:v?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:a.map(m=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(Be,{id:`bucket-artifact-${m.id}`,checked:j.has(m.id),onCheckedChange:E=>I(m.id,E===!0)}),e.jsxs(ae,{htmlFor:`bucket-artifact-${m.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:Dr[m.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:m.label})]}),e.jsxs("a",{href:ce(m.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(J,{name:"external",size:10})]})]},m.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:f?N:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."})}),e.jsxs(oe,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(D,{type:"button",onClick:B,variant:"outline",disabled:!f||C.length===0,children:[e.jsx(J,{name:"copy",size:12}),"Copy commands"]}),e.jsx(D,{type:"button",onClick:K,disabled:_||t.isSignedIn&&(!f||!C.some(m=>m.kind!=="github")),children:_?b&&b.total>1?`Copying ${b.current}/${b.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}function Xr({isLoading:t,papers:s}){return t?e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}):s!=null&&s.length?e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),s.map(a=>e.jsxs(le,{to:`/paper/${a.arxiv_id||a.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Ie,{title:a.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:a.arxiv_id?`arXiv:${a.arxiv_id}`:"External resource"}),a.citation_count!=null&&e.jsxs("span",{children:[a.citation_count.toLocaleString()," cites"]})]})]},a.id))]}):null}const st=3,Rt=3;function Zr(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Wr({allHfArtifactUrls:t,citationCopied:s,citationDisplay:a,hfArtifactViewer:r,onCopyCitation:i,onEditHfArtifacts:d,onEditRepositories:o,paper:l,relatedIsLoading:c,relatedPapers:p,user:g}){var w;const[n,j]=h.useState(!1),y=[...l.repositories??[]].sort((b,L)=>Number(L.is_official)-Number(b.is_official)||(L.num_stars||0)-(b.num_stars||0)),_=(n?y:y.slice(0,st)).map(b=>({...b,safeHref:ce(b.url)}));return e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[y.length," repo",y.length===1?"":"s",e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})]}),_.filter(({safeHref:b})=>b).map(b=>e.jsxs("a",{href:b.safeHref??void 0,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(J,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[b.owner,"/",b.name]}),b.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",Zr(b.num_stars)]})]},b.id)),y.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),y.length>st&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>j(b=>!b),children:n?"− show top 3":`+ show ${y.length-st} more repos`})]}),e.jsx(Yr,{viewer:r,onEdit:d}),e.jsx(Jr,{githubUrls:y.map(({url:b})=>b),hfModelUrls:t.models,hfDatasetUrls:t.datasets,hfSpaceUrls:t.spaces,paperId:l.id,pdfName:((w=l.arxiv_id)==null?void 0:w.replace("/","-"))||l.id,pdfUrl:l.url_pdf,isSignedIn:!!g,suggestedBucketId:g?`${g.username}/${Vr(l.title)}`:void 0}),e.jsx(Xr,{isLoading:c,papers:p}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:i,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(J,{name:"copy",size:11}),s?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:a})]})]})}function Yr({onEdit:t,viewer:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]}),s.isLoading?e.jsx(ke,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(en,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]})}function en({count:t,href:s,isLimited:a,label:r,links:i}){const[d,o]=h.useState(!1),l=((i==null?void 0:i.length)??0)>Rt,c=d?i:i==null?void 0:i.slice(0,Rt),p=t!=null?`${t}${a?"+":""}`:"—";return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:r}),t?e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:p}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:p})]}),c!=null&&c.length?e.jsxs("div",{className:"hf-artifact-links",children:[c.map(g=>e.jsx("a",{href:g.href,target:"_blank",rel:"noopener noreferrer",children:g.label},g.href)),l&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":d,onClick:()=>o(g=>!g),children:d?"Show fewer":`View all ${i.length}`})]}):null]})}const Ft=360;function tn({canEdit:t,onEditMethods:s,onEditTasks:a,paper:r}){var p,g;const[i,d]=h.useState(!1),o=r.abstract||"",l=o.length>Ft,c=i||!l?o:`${o.slice(0,Ft)}…`;return e.jsxs(e.Fragment,{children:[r.tldr&&e.jsxs(e.Fragment,{children:[e.jsx(ye,{id:"tldr",label:"TL;DR · AI-generated"}),e.jsx("div",{className:"tldr-box",children:r.tldr})]}),e.jsx(ye,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Qs,{text:c})}),l&&e.jsx("button",{type:"button",className:"read-full",onClick:()=>d(n=>!n),children:i?"− collapse abstract":"+ read full abstract"}),e.jsx(ye,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((p=r.tasks)==null?void 0:p.length)||0," tagged",t&&e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(r.tasks??[]).map(n=>e.jsx(qs,{slug:n.slug||"",label:n.name},n.id))}),e.jsx(ye,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((g=r.methods)==null?void 0:g.length)||0," used",t&&e.jsx("button",{type:"button",onClick:s,className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(r.methods??[]).map(n=>e.jsx(Os,{method:n},n.id))})]})}const be=["my-bookmark-ids"],dt="pwc:pending-bookmark";function sn(t){window.sessionStorage.setItem(dt,JSON.stringify(t)),window.location.assign(ga(!0))}function an(){var r,i;const{user:t}=Le(),s=re({queryKey:be,queryFn:()=>nt.getBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),a=Ae.useMemo(()=>{var d;return new Set(((d=s.data)==null?void 0:d.paper_ids)??[])},[(r=s.data)==null?void 0:r.paper_ids]);return{ids:((i=s.data)==null?void 0:i.paper_ids)??[],idSet:a,isLoading:s.isLoading,isError:s.isError}}function rn(){const{user:t}=Le(),s=ue(),a=me({mutationFn:async({paperId:i,isBookmarked:d})=>{d?await nt.removeBookmark(i):await nt.addBookmark(i)},onMutate:async({paperId:i,isBookmarked:d})=>{await s.cancelQueries({queryKey:be});const o=s.getQueryData(be),l=typeof i=="string"?Number(i):i,c=(o==null?void 0:o.paper_ids)??[],p=d?c.filter(g=>g!==l):[l,...c.filter(g=>g!==l)];return s.setQueryData(be,{paper_ids:p}),{previous:o}},onError:(i,d,o)=>{o!=null&&o.previous&&s.setQueryData(be,o.previous),i instanceof rt&&i.code==="saved_papers_bucket_authorization_required"&&sn(d)},onSettled:()=>{s.invalidateQueries({queryKey:be}),s.invalidateQueries({queryKey:["my-bookmarks"]})}});return Ae.useEffect(()=>{if(!t||a.isPending)return;const i=new URL(window.location.href);if(i.searchParams.get(Pt)!=="1")return;i.searchParams.delete(Pt),window.history.replaceState({},"",`${i.pathname}${i.search}${i.hash}`);const d=window.sessionStorage.getItem(dt);if(d){window.sessionStorage.removeItem(dt);try{const o=JSON.parse(d);(typeof o.paperId=="number"||typeof o.paperId=="string")&&typeof o.isBookmarked=="boolean"&&a.mutate(o)}catch{}}},[a,t]),{toggle:Ae.useCallback((i,d)=>{if(!t){if(qt())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=Rs(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}a.mutate({paperId:i,isBookmarked:d})},[a,t]),isPending:a.isPending}}const nn=({paperId:t})=>{const{user:s}=Le(),{idSet:a}=an(),{toggle:r,isPending:i}=rn();if(qt())return null;const d=Number(t),o=!!s&&a.has(d),l=()=>{Number.isFinite(d)&&r(d,o)},c=s&&o?"Saved":"Save",p=s?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:l,disabled:i,"aria-pressed":o,"aria-label":p,title:p,children:[e.jsx(J,{name:"bookmark",size:12}),c]})};function at({children:t,showEdit:s=!1,onEdit:a,editAriaLabel:r}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:a,"aria-label":r,children:"edit"})]}):t}function on(t){return e.jsx(ss,{...t,kind:"enrich-paper",triggerClassName:"action-btn"})}const ln={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL"};function Tt(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Ut(t,s){try{const a=new URL(t),i=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return i?i.replace(/[-_]+/g," "):a.hostname.replace(/^www\./,"")}catch{return s}}const qn=()=>{const{arxivId:t}=Fs(),s=Bt(),{toast:a}=ie(),{user:r}=Le(),i=(r==null?void 0:r.is_admin)??!1,d=!!r,o=ba(r),{arxivId:l,evaluations:c,evaluationsByTask:p,evaluationsLoading:g,paper:n,paperError:j,paperLoading:y,presentation:_,refetchEvaluations:w,refetchPaper:b,relatedQuery:L,versions:A,visibleEvaluations:T}=Ta(t,o),[C,v]=h.useState(!1),{activeEditor:u,openEditor:f,setEditorOpen:N}=Da();h.useEffect(()=>{o!=="direct"||!(n!=null&&n.id)||(u&&u!=="results"&&V.primeCurationState(n.id).catch(()=>{}),u==="results"&&Re.primeCurationState(n.id).catch(()=>{}))},[u,o,n==null?void 0:n.id]);const[I,B]=h.useState(null),H=h.useRef(!1);h.useEffect(()=>{if(!r||!n||H.current)return;const k=sessionStorage.getItem("pwc:fresh-auth-edit");if(!k)return;H.current=!0;const q=Ba(k);if(!V.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),q&&f(q);return}if(!window.confirm("You signed in again. Apply the saved destructive catalog edit now? The server will recheck the current catalog version before changing anything.")){a({title:"Edit kept locally",description:"Nothing was changed. Reload this paper when you are ready to confirm the saved edit."});return}V.resumeFreshAuthMutation().then(()=>{a({title:"Edit applied",description:"The restored catalog edit was applied."}),window.location.reload()}).catch(Nt=>{a({variant:"destructive",title:"Could not apply the saved edit",description:Nt instanceof Error?Nt.message:"Please reload and review the edit again."})})},[f,n,a,r]);const K=h.useMemo(()=>{if(!r||!(n!=null&&n.author_links))return!1;const k=r.username.toLowerCase();return n.author_links.some(q=>!!q.hf_username&&q.hf_username.toLowerCase()===k)},[r,n==null?void 0:n.author_links]),G=k=>{if(!d){B(k);return}f(k)},[m,E]=h.useState("idle"),[$,F]=h.useState(null),[S,O]=h.useState(null),Z=async()=>{if(l){E("indexing"),F(null),O(null);try{await V.indexFromArxiv(l),a({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>b(),1200),E("idle")}catch(k){const q=k;let je=q.message||"Failed to index paper";if(q.response)try{je=JSON.parse(q.response).detail||je}catch{je=q.response}F(je),(q.status===429||q.status===503)&&O("Try again later after arXiv has lifted the temporary limit."),E("idle")}}},x=(_==null?void 0:_.citationCopy)??"",P=(_==null?void 0:_.copyableRanks)??[],[R,U]=h.useState(!1),M=async()=>{if(x)try{await navigator.clipboard.writeText(x),U(!0),a({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>U(!1),1500)}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},Q=async()=>{if(!n)return;const k=n.arxiv_id||n.id,q=ja(k,P);if(q)try{await navigator.clipboard.writeText(q),a({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(y)return e.jsxs("div",{className:"page",children:[e.jsx(ke,{className:"h-12 w-3/4 mb-4"}),e.jsx(ke,{className:"h-6 w-1/3 mb-8"}),e.jsx(ke,{className:"h-64 w-full"})]});if(j||!n)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(le,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",l]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",l]})," in the database. You can index it from arXiv right now."]}),$&&e.jsx(ea,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(ta,{children:[e.jsx("div",{children:$}),S&&e.jsx("div",{className:"mt-2",children:S})]})}),e.jsxs("div",{className:"action-row",children:[i&&e.jsxs("button",{className:"action-btn",onClick:Z,disabled:m==="indexing",children:[e.jsx(J,{name:"sparkle",size:12}),m==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(D,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});if(!_)return null;const{allHfArtifactUrls:z,authorEntries:He,citationDisplay:xs,hasIntroducedItems:bs,hasLineageItems:vs,hfArtifactViewer:js,introducedBenchmarks:ys,introducedFrameworks:bt,introducedMethods:ws,introducedSummary:ks,numPages:vt,paperSourceLabel:jt,predecessorPapers:Me,projectPages:Ee,safeAbstractUrl:yt,safeConferenceUrl:wt,safePdfUrl:kt,sourceActionLabel:_s,successorPapers:ze}=_,Se=12,qe=wa(n,l),_t=C||He.length<=Se?He:He.slice(0,Se);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(le,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:jt})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsx("h1",{className:"detail-title",children:e.jsx(Ie,{title:n.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:jt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",Tt(n.published)]}),vt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[vt," pages"]})]}),n.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[n.citation_count.toLocaleString()," citations"]})]}),(n.proceeding||n.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),n.conference_slug?e.jsx("a",{href:`/conferences/${n.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(n.proceeding||n.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:n.proceeding.replace(/\s+\d{1,2}$/,"")})]}),A.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:n.version,onChange:k=>{const q=k.target.value;n.arxiv_id&&s(`/paper/${n.arxiv_id.replace(/v\d+$/,"")}${q?`?version=${q}`:""}`)},children:A.map(k=>e.jsxs("option",{value:k.version,children:[k.version," — ",Tt(k.published)]},k.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[_t.map((k,q)=>e.jsxs(Ae.Fragment,{children:[k.id?e.jsx(le,{to:`/authors/${k.id}`,children:k.name}):k.hf_username?e.jsx("a",{href:`https://huggingface.co/${k.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${k.hf_username} on Hugging Face`,children:k.name}):e.jsx("a",{children:k.name}),q<_t.length-1?", ":""]},q)),n.authors.length>Se&&e.jsx("button",{className:"show-more-authors",onClick:()=>v(k=>!k),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:C?"show fewer":`+${n.authors.length-Se} more`})]}),e.jsxs("div",{className:"action-row",children:[qe&&Ts()&&(!Us()||r!=null&&r.is_admin)?e.jsxs(le,{className:"action-btn",to:qe,onClick:()=>{const k=qe.slice(5);sessionStorage.removeItem(`pwc:reader:session:${k}`),sessionStorage.removeItem(`pwc:reader:assistant-collapsed:${k}`),sessionStorage.removeItem(`pwc:reader:page:${k}`)},children:[e.jsx(J,{name:"pdf",size:12})," Read paper",e.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:"New"})]}):kt?e.jsxs("a",{className:"action-btn",href:kt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"pdf",size:12})," View PDF"]}):null,yt&&e.jsx(at,{showEdit:n.source==="external",onEdit:()=>G("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:n.source==="external"?"action-btn-segment action-btn-main":"action-btn",href:yt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"external",size:12})," ",_s]})}),Ee.length===1?e.jsx(at,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Ee[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"globe",size:12})," Project page"]})}):null,Ee.length>1?e.jsx(at,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(Bs,{children:[e.jsx(Ds,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(J,{name:"globe",size:12})," Project page"]})}),e.jsx(Hs,{align:"start",className:"project-page-menu",children:Ee.map((k,q)=>e.jsx(Ms,{asChild:!0,children:k.safeHref?e.jsx("a",{href:k.safeHref,target:"_blank",rel:"noopener noreferrer",children:Ut(k.url,`Project page ${q+1}`)}):e.jsx("span",{children:Ut(k.url,`Project page ${q+1}`)})},k.url))})]})}):null,wt&&e.jsxs("a",{className:"action-btn",href:wt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"external",size:12})," Conference"]}),(n.organizations||[]).map(k=>e.jsxs(le,{to:`/orgs/${k.slug}`,className:"action-btn",title:k.name,"aria-label":k.name,children:[k.logo_url&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:16,width:16,borderRadius:3,overflow:"hidden"},children:e.jsx("img",{src:k.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:q=>{q.currentTarget.style.display="none"}})}),k.name]},k.id)),e.jsx(Xa,{paperId:Number(n.id),isAdmin:i}),i&&ha()&&e.jsx(on,{paperId:Number(n.id),paperTitle:n.title,onComplete:()=>void b()}),e.jsx(nn,{paperId:n.id})]}),n.leaderboard_ranks&&n.leaderboard_ranks.length>0&&e.jsx(Ks,{wrap:!0,paperHref:`/paper/${n.arxiv_id||n.id}`,ranks:n.leaderboard_ranks.filter(k=>k.best_rank>=1&&k.best_rank<=3).map(k=>({name:k.dataset_name,slug:k.dataset_slug||null,rank:k.best_rank}))})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Gs,{paperId:n.arxiv_id||n.id,title:n.title,thumbnailUrl:zs(n.thumbnail_url),priority:!0})})]}),bs&&e.jsxs("div",{className:`introduced-banner${bt.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[ws.map(k=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${k.slug||k.id}`),children:[k.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${k.id}`)),ys.map(k=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${k.slug||k.id}`),children:[k.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${k.id}`)),bt.map(k=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/frameworks#framework-${k.slug}`),children:[k.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${k.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",ks,"."]})]}),vs&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[ze.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:ze.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:ze.map(k=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${k.route_identifier}`),children:[e.jsx(Ie,{title:k.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${k.id}`))})]}),Me.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Me.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Me.map(k=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${k.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Ie,{title:k.title})]},`predecessor-${k.id}`))})]})]}),e.jsx(tn,{canEdit:!0,onEditMethods:()=>G("methods"),onEditTasks:()=>G("tasks"),paper:n}),e.jsx(Sr,{canCopyBadge:P.length>0,canEdit:!0,evaluationsByTask:p,evaluationsLoading:g,isAdmin:i,onCopyBadge:Q,onEdit:()=>G("results"),onRefresh:()=>void w(),paper:n,visibleEvaluationCount:(T==null?void 0:T.length)??0})]}),e.jsx(Wr,{allHfArtifactUrls:z,citationCopied:R,citationDisplay:xs,hfArtifactViewer:js,onCopyCitation:M,onEditHfArtifacts:()=>G("hf-artifacts"),onEditRepositories:()=>G("repositories"),paper:n,relatedIsLoading:L.isLoading,relatedPapers:L.data,user:r})]}),e.jsx(_r,{activeEditor:u,arxivId:l,editSubmitMode:o,evaluations:c??[],isAdmin:i,isLinkedAuthor:K,onOpenChange:N,paper:n}),e.jsx(ra,{open:I!==null,onOpenChange:k=>{k||B(null)},sectionLabel:I?ln[I]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})};export{qn as default}; +}`;return{citationDisplay:d(s,`{{${a}}}`),citationCopy:d(t.title,`{${r}}`)}}function Ia(t,s,a){var j,y,_,w;const r={models:t.hf_models??[],datasets:t.hf_datasets??[],spaces:t.hf_spaces??[]},i={models:Qe(r.models,s==null?void 0:s.modelUrls,"Model"),datasets:Qe(r.datasets,s==null?void 0:s.datasetUrls,"Dataset"),spaces:Qe(r.spaces,s==null?void 0:s.spaceUrls,"Space")},d={models:i.models.map(({href:b})=>b),datasets:i.datasets.map(({href:b})=>b),spaces:i.spaces.map(({href:b})=>b)},o=((j=t.arxiv_id)==null?void 0:j.replace(/v\d+$/,""))??null,l=t.arxiv_id?{isLoading:a,paperHref:`https://huggingface.co/papers/${o}`,rows:[{label:"Models",href:Xe(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,r.models),count:Ve(r.models,s==null?void 0:s.modelUrls,s==null?void 0:s.models),isLimited:s==null?void 0:s.isLimited,links:i.models},{label:"Datasets",href:Xe(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,r.datasets),count:Ve(r.datasets,s==null?void 0:s.datasetUrls,s==null?void 0:s.datasets),isLimited:s==null?void 0:s.isLimited,links:i.datasets},{label:"Spaces",href:Xe(`https://huggingface.co/papers/${o}`,r.spaces),count:Ve(r.spaces,s==null?void 0:s.spaceUrls,s==null?void 0:s.spaces),isLimited:s==null?void 0:s.isLimited,links:i.spaces}],footer:`Cite arxiv.org/abs/${o} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:Je(r.models),count:r.models.length,links:i.models},{label:"Datasets",href:Je(r.datasets),count:r.datasets.length,links:i.datasets},{label:"Spaces",href:Je(r.spaces),count:r.spaces.length,links:i.spaces}],footer:null},c=(t.methods??[]).filter(({source_paper_id:b})=>b===t.id),p=t.introduced_benchmarks??[],g=t.introduced_frameworks??[],n=[c.length&&(c.length===1?"this method":"these methods"),p.length&&(p.length===1?"this benchmark":"these benchmarks"),g.length&&(g.length===1?"this framework":"these frameworks")].filter(b=>!!b);return{...Pa(t),allHfArtifactUrls:d,authorEntries:t.authors.map((b,L)=>{var A,T,C,v;return{name:b,id:((T=(A=t.author_links)==null?void 0:A[L])==null?void 0:T.id)??null,hf_username:((v=(C=t.author_links)==null?void 0:C[L])==null?void 0:v.hf_username)??null}}),copyableRanks:va(t.leaderboard_ranks),hasIntroducedItems:n.length>0,hasLineageItems:!!((y=t.predecessor_papers)!=null&&y.length||(_=t.successor_papers)!=null&&_.length),hfArtifactViewer:l,hfPaperExists:!!(s!=null&&s.paperExists),introducedBenchmarks:p,introducedFrameworks:g,introducedMethods:c,introducedSummary:n.join(" and "),numPages:t.num_pages||null,paperSourceLabel:t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",predecessorPapers:t.predecessor_papers??[],projectPages:((w=t.project_pages)==null?void 0:w.filter(({url:b})=>b).map(b=>({...b,safeHref:ce(b.url)})))??[],repoSummary:Ys(t.repositories),safeAbstractUrl:ce(t.url_abs),safeConferenceUrl:ce(t.conference_url_abs),safePdfUrl:ce(t.url_pdf),sourceActionLabel:t.source==="external"?"Source page":"arXiv page",successorPapers:t.successor_papers??[]}}const $a=["tldr","abstract","tasks","methods","results"];function Aa(t){if(!t)return{section:null,resultsTaskSlug:null};const[s,a]=t.split("?",2);if(!$a.includes(s))return{section:null,resultsTaskSlug:null};const r=s;return r!=="results"||!a?{section:r,resultsTaskSlug:null}:{section:r,resultsTaskSlug:new URLSearchParams(a).get("task")}}const Vt=t=>`results-task-${t}`,La=t=>`#results?task=${encodeURIComponent(t)}`;function Ra(t,s){return t&&!!s}function Fa({direct:t,paperId:s,refetchEvaluations:a,refetchPaper:r}){r(),a(),!(!t||!s)&&(J.primeCurationState(s,!0).catch(()=>{}),Re.primeCurationState(s,!0).catch(()=>{}))}function Ta(t,s){const a=t?Ns(t):"",r=Bt(),{toast:i}=ie(),{preferences:d}=Cs(),o=Xs(a,!!a),l=o.data,[c,p]=h.useState(!1);h.useEffect(()=>{!t||t===a||r(`/paper/${a}${window.location.search}${window.location.hash}`,{replace:!0})},[a,r,t]),h.useEffect(()=>{if(l!=null&&l.title)return document.title=Zs(l.title),()=>{document.title=Ws}},[l==null?void 0:l.title]),h.useEffect(()=>{if(p(!1),!(l!=null&&l.id))return;const C=window.setTimeout(()=>p(!0),0);return()=>window.clearTimeout(C)},[l==null?void 0:l.id]);const g=Ra(c,l==null?void 0:l.id),n=Ea(c?l==null?void 0:l.arxiv_id:void 0),j=ka(l==null?void 0:l.id,g),y=re({queryKey:["paper-versions",l==null?void 0:l.arxiv_id],queryFn:()=>J.versions(l.arxiv_id.replace(/v\d+$/,"")),enabled:g&&!!(l!=null&&l.arxiv_id),staleTime:10*60*1e3}),_=re({queryKey:["related-papers",l==null?void 0:l.id],queryFn:()=>J.related(l.arxiv_id||l.id,4),enabled:g,staleTime:10*60*1e3});h.useEffect(()=>{const C=()=>{Fa({direct:s==="direct",paperId:l==null?void 0:l.id,refetchEvaluations:j.refetch,refetchPaper:o.refetch}),i({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",C),()=>window.removeEventListener("pwc:catalog-conflict",C)},[s,j.refetch,l==null?void 0:l.id,o.refetch,i]);const w=h.useMemo(()=>{const C=j.data;return!C||!d.hide_closed_source_evals?C:C.filter(v=>v.is_open!==!1)},[j.data,d.hide_closed_source_evals]),b=h.useMemo(()=>{if(!w)return[];const C=new Map;for(const v of w){const u=C.get(v.task_id);u?u.rows.push(v):C.set(v.task_id,{taskId:v.task_id,taskName:v.task_name||"—",taskSlug:v.task_slug,rows:[v]})}return[...C.values()]},[w]),L=h.useMemo(()=>b.map(({taskSlug:C})=>C??"").join("|"),[b]),A=h.useMemo(()=>l?Ia(l,n.data,n.isLoading):null,[n.data,n.isLoading,l]),T=h.useRef(!1);return h.useEffect(()=>{T.current=!1},[a]),h.useEffect(()=>{let C=0;const v=(f=!1,N=!1)=>{const{section:I,resultsTaskSlug:B}=Aa(window.location.hash.slice(1));if(!I||!l||I==="tldr"&&!l.tldr||I==="results"&&(!g||j.isLoading)||!f&&T.current)return;let H=I==="results"&&B?document.getElementById(Vt(B)):document.getElementById(I);if(!H&&I==="results"&&B){if(b.some(({taskSlug:G})=>G===B))return;H=document.getElementById("results")}H&&(C=window.requestAnimationFrame(()=>{T.current=!0,H.scrollIntoView({block:"start",behavior:N?"smooth":"auto"})}))};v();const u=()=>{T.current=!1,v(!0,!0)};return window.addEventListener("hashchange",u),()=>{window.removeEventListener("hashchange",u),C&&window.cancelAnimationFrame(C)}},[b,j.isLoading,l,L,g]),{arxivId:a,evaluations:j.data,evaluationsByTask:b,evaluationsLoading:j.isLoading,hfLoading:n.isLoading,hfRepos:n.data,paper:l,paperError:o.error,paperLoading:o.isLoading,presentation:A,refetchEvaluations:j.refetch,refetchPaper:o.refetch,relatedQuery:_,versions:y.data??[],visibleEvaluations:w}}const Ua={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url"};function Ba(t){return Ua[t]??null}function Da(){const[t,s]=h.useState(null),a=h.useCallback(i=>{s(i)},[]),r=h.useCallback((i,d)=>{s(o=>d?i:o===i?null:o)},[]);return{activeEditor:t,openEditor:a,setEditorOpen:r}}const Ha="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",Ma="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",za="data:image/svg+xml,%3csvg%20fill='%23111'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",qa="data:image/svg+xml,%3csvg%20fill='%23fff'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",Oa="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",Ka="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_dark__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_dark__st0{fill:%23edecec}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_dark__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",Ga="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23FDFCFC'/%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%23E6E5E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='%2317181C'/%3e%3c/svg%3e",Qa="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='512'%20height='512'%3e%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'%3e%3c/rect%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%235A5858'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='white'%3e%3c/path%3e%3c/svg%3e%3cstyle%3e@media%20(prefers-color-scheme:%20light)%20{%20:root%20{%20filter:%20none;%20}%20}%20@media%20(prefers-color-scheme:%20dark)%20{%20:root%20{%20filter:%20none;%20}%20}%20%3c/style%3e%3c/svg%3e",Va=[{name:"Claude",light:Ha,dark:Ma},{name:"Codex",light:za,dark:qa},{name:"Cursor",light:Oa,dark:Ka},{name:"OpenCode",light:Ga,dark:Qa}];function Ja(){return e.jsx("span",{className:"ml-1 inline-flex shrink-0 items-center gap-1.5","aria-hidden":"true",children:Va.map(({name:t,light:s,dark:a})=>e.jsxs("span",{title:t,className:"inline-flex h-[18px] w-[18px]",children:[e.jsx("img",{src:s,alt:"",width:18,height:18,className:"h-full w-full object-contain dark:hidden"}),e.jsx("img",{src:a,alt:"",width:18,height:18,className:"hidden h-full w-full object-contain dark:block"})]},t))})}function Xa({paperId:t,isAdmin:s}){var g;const[a,r]=h.useState(!1),[i,d]=h.useState(!1),[o,l]=h.useState(()=>window.location.hash.startsWith("#edit")),c=sa({queryKey:["paper-edit-history",t],queryFn:({pageParam:n})=>aa.history(t,n),initialPageParam:void 0,getNextPageParam:n=>n.next_cursor??void 0,enabled:s&&o}),p=`Help me edit https://paperswithcode.co/paper/${t} using the public pwc CLI from https://github.com/huggingface/pwc-cli. Install or update the CLI following its README, then run pwc skills add to load its instructions. Run pwc auth login --paper ${t}; I will authorize this paper in my browser. Export with pwc paper edit export ${t} --output edits.json, make explicit operations for the corrections I request, and preview before submitting. For organization changes, use an organizations operation with payload {"organization_ids": [existing organization IDs]}; this replaces the paper’s organization links and publishes directly. Use existing organizations, benchmark and metric definitions, preserve unrelated entries, and cite source URLs where available. Never print or copy credentials. Ask me what to change if I have not specified it.`;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"action-btn",title:"Copy an edit prompt for Claude, Codex, Cursor, or OpenCode",onClick:async()=>{try{await navigator.clipboard.writeText(p),r(!0),d(!1)}catch{d(!0)}},children:[a&&e.jsx(de,{size:12}),a?"Prompt copied":"Edit with your agent",e.jsx(Ja,{})]}),s&&e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>l(!0),children:[e.jsx(xa,{size:12})," View edit history"]}),e.jsx(W,{open:i,onOpenChange:d,children:e.jsxs(Y,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Copy the edit prompt"}),e.jsx(se,{children:"Paste these instructions into your coding agent."})]}),e.jsx("textarea",{"aria-label":"Paper edit prompt",readOnly:!0,value:p,className:"h-64 w-full rounded border p-3 text-sm",onFocus:n=>n.currentTarget.select()})]})}),e.jsx(W,{open:s&&o,onOpenChange:l,children:e.jsxs(Y,{className:"max-h-[85vh] max-w-3xl overflow-y-auto",id:"edit-history",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Paper edit history"}),e.jsx(se,{children:"Published changes and their contributors."})]}),e.jsxs("div",{className:"space-y-3",children:[c.isLoading&&e.jsx("p",{children:"Loading edit history…"}),c.error&&e.jsx("p",{role:"alert",children:"Could not load edit history."}),c.data&&!c.data.pages[0].events.length&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"No edits have been recorded here yet."}),(g=c.data)==null?void 0:g.pages.flatMap(n=>n.events).map(n=>e.jsxs("article",{id:`edit-${n.id}`,className:"rounded border p-3",children:[e.jsxs("p",{className:"text-sm",children:[n.actor_username?e.jsxs("a",{className:"underline",href:`https://huggingface.co/${encodeURIComponent(n.actor_username)}`,children:["@",n.actor_username]}):"Catalog administrator"," · ",new Date(n.created_at).toLocaleString()," · ",n.operation==="rollback"?"Reverted an edit":"Updated this paper"]}),e.jsxs("details",{children:[e.jsx("summary",{className:"cursor-pointer text-sm",children:"View changes"}),e.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap text-xs",children:JSON.stringify({before:n.before,after:n.after},null,2)})]})]},n.id)),c.hasNextPage&&e.jsx(D,{variant:"outline",disabled:c.isFetchingNextPage,onClick:()=>void c.fetchNextPage(),children:"Load older edits"})]})]})})]})}function Za(t){const s=t==null?void 0:t.trim();if(!s)return;const a=Number(s);return Number.isFinite(a)?Math.trunc(a):void 0}function $t(t){const s=t.trim();if(!s)return null;const a=Number(s);return Number.isFinite(a)&&a>=0?Math.trunc(a):null}function Ze(t){return t.trim()||null}function Wa(t){const s=Number.parseInt(t.task_id,10),a=Number.parseInt(t.dataset_id,10);return Number.isFinite(s)&&Number.isFinite(a)?{taskId:s,datasetId:a}:null}function Ya(t,s){const a=[];for(const r of t){if(r.operation==="delete"&&r.id){a.push({kind:"delete",evaluationId:Number.parseInt(r.id,10)});continue}if(r.operation!=="create"&&r.operation!=="update")continue;const i=Wa(r),d=r.metric_name.trim();if(!i||!d||!r.metric_value.trim())continue;const o=s(r.task_id,r.dataset_id),l={task_id:i.taskId,dataset_id:i.datasetId,metrics:{[d]:r.metric_value},best_metric:d,is_open:r.is_open},c=r.model_name.trim(),p=Za(r.best_rank);if(r.operation==="create"){const g=$t(r.num_parameters),n=Ze(r.hf_model_url);a.push({kind:"create",data:{...l,...c?{model_name:c}:{},...o&&r.harness.trim()?{harness:r.harness.trim()}:{},...p!==void 0?{best_rank:p}:{},...g!==null?{num_parameters:g}:{},...n!==null?{hf_model_url:n}:{}}});continue}r.id&&a.push({kind:"update",evaluationId:Number.parseInt(r.id,10),data:{...l,...c?{model_name:c}:{},harness:o?Ze(r.harness):null,...p!==void 0?{best_rank:p}:{},num_parameters:$t(r.num_parameters),hf_model_url:Ze(r.hf_model_url)}})}return a}function er(t,s){return s.map(a=>a.kind==="delete"?{operation:"delete",evaluation_id:a.evaluationId}:{operation:a.kind,...a.kind==="update"?{evaluation_id:a.evaluationId}:{},payload:a.kind==="create"?{paper_id:t,...a.data}:a.data})}function tr(t){return t.map(s=>s.kind==="delete"?{op:"delete",evaluation_id:s.evaluationId}:s.kind==="update"?{op:"update",evaluation_id:s.evaluationId,data:s.data}:{op:"create",data:s.data})}function fe({isAuthor:t=!1}){const s=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:s?"Test-only: this change stays on staging.":"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:s?"This exercises staging-local pending behavior and is not queued for production review.":t?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}const We=100;function sr(t){return(t??[]).some(s=>s.slug==="coding-agents"||s.name.trim().toLowerCase()==="coding agents")}function ar(t){return t.map(s=>{const a=s.best_metric||Object.keys(s.metrics)[0],r=s.metrics[a];return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:a||"",metric_value:String(r||""),best_rank:s.best_rank?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",hf_model_url:s.hf_model_url||"",is_open:s.is_open!==!1,operation:"unchanged"}})}function rr(t){const s=new Map;return t.forEach(a=>{a.task_id&&a.task_name&&s.set(a.task_id,{id:a.task_id,name:a.task_name,slug:a.task_slug,level:0})}),s}function nr(t){const s=new Map;return t.forEach(a=>{a.dataset_id&&a.dataset_name&&s.set(a.dataset_id,{id:a.dataset_id,name:a.dataset_name,slug:a.dataset_slug})}),s}function At(t,s){return`${t}:${s}`}function ir({open:t,onOpenChange:s,paperId:a,arxivId:r,initialEvaluations:i,paperTasks:d,onSuccess:o,submitMode:l="direct",isAdmin:c=!1,isAuthor:p=!1}){const g=sr(d),[n,j]=h.useState([]),[y,_]=h.useState(null),[w,b]=h.useState(new Map),[L,A]=h.useState(new Map),T=ue(),{toast:C}=ie(),v=h.useRef(!1),u=h.useRef(!1);h.useEffect(()=>{if(!t){v.current=!1,u.current=!1;return}v.current||u.current||i.length!==0&&(v.current=!0,j(ar(i)),b(rr(i)),A(nr(i)))},[t,i]);const f=h.useMemo(()=>Array.from(new Set(n.map(x=>x.task_id).filter(x=>x&&x!==""))),[n]),N=h.useMemo(()=>{const x=new Set;return n.forEach(P=>{P.task_id&&P.dataset_id&&x.add(At(P.task_id,P.dataset_id))}),Array.from(x)},[n]),I=re({queryKey:["datasets-by-tasks-for-eval-edit",f,t],queryFn:async()=>{const x={};return await Promise.all(f.map(async P=>{try{const R=await ge.listDatasets({task_id:parseInt(P),page_size:We});x[P]=R.results}catch(R){console.error(`Error fetching datasets for task ${P}:`,R),x[P]=[]}})),x},enabled:t&&f.length>0});h.useEffect(()=>{I.data&&A(x=>{const P=new Map(x);return Object.values(I.data).forEach(R=>{R.forEach(U=>{P.set(U.id,U)})}),P})},[I.data]);const B=re({queryKey:["leaderboard-metrics-for-eval-edit",N,t],queryFn:async()=>{const x={};return await Promise.all(N.map(async P=>{const[R,U]=P.split(":");try{x[P]=await ge.leaderboardMetrics(U,R)}catch(M){console.error(`Error fetching metrics for leaderboard ${P}:`,M),x[P]=[]}})),x},enabled:t&&N.length>0}),H=async x=>{const P=await ge.listTasks({page_size:We,...x?{q:x}:{}});return b(R=>{const U=new Map(R);return P.results.forEach(M=>U.set(M.id,M)),U}),P.results.map(R=>{var U;return{value:R.id,label:R.name,description:(U=R.description)==null?void 0:U.slice(0,100)}})},G=x=>async P=>{const R=await ge.listDatasets({task_id:parseInt(x),page_size:We,...P?{q:P}:{}});return A(U=>{const M=new Map(U);return R.results.forEach(Q=>M.set(Q.id,Q)),M}),R.results.map(U=>({value:U.id,label:U.name,description:U.full_name}))},K=(x,P)=>{if(!x||!P)return!1;const R=L.get(P);return!!(R!=null&&R.supports_harness)},m=(x,P,R)=>{var Q;if(!x||!P)return[];const M=(((Q=B.data)==null?void 0:Q[At(x,P)])||[]).map(z=>({value:z.metric_name,label:z.metric_name,description:z.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return R&&!M.some(z=>z.value===R)&&M.unshift({value:R,label:`${R} (legacy)`}),M},E=me({mutationFn:async({paperId:x,evaluations:P})=>{const R=Ya(P,K);if(!c&&l==="direct"&&R.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");if(R.length===0)return{submitted:!1};const U=Number.parseInt(x,10);return l==="pending"?await pe.submit({paper_id:U,edit_type:"evaluations",proposed_payload:{operations:tr(R)}}):await Re.batch(U,er(U,R)),{submitted:!0}},onSuccess:x=>{if(l==="pending"){x!=null&&x.submitted?C({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):C({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),o==null||o(),s(!1);return}T.invalidateQueries({queryKey:["paper-arxiv",r]}),T.invalidateQueries({queryKey:["evaluations","paper",a]}),o==null||o(),s(!1)},onError:x=>{var U;const P=x;let R=P.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(P.response)try{const M=JSON.parse(P.response);typeof(M==null?void 0:M.detail)=="string"?R=M.detail:Array.isArray(M==null?void 0:M.detail)&&((U=M.detail[0])!=null&&U.msg)&&(R=M.detail[0].msg)}catch{R=P.response}C({title:l==="pending"?"Could not submit edit":"Could not save evaluations",description:R,variant:"destructive"})}}),$=()=>{u.current=!0,j([...n,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},F=x=>{if(u.current=!0,n[x].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;j(n.map((R,U)=>U===x?{...R,operation:"delete"}:R))}else j(n.filter((R,U)=>U!==x))},S=(x,P,R)=>{u.current=!0,j(n.map((U,M)=>{if(M!==x)return U;const Q={...U,[P]:R};return P==="task_id"&&(Q.dataset_id="",Q.metric_name="",Q.harness=""),P==="dataset_id"&&(Q.metric_name="",R&&!K(Q.task_id,R)&&(Q.harness="")),U.operation==="unchanged"&&(Q.operation="update"),Q}))},O=(x,P)=>{u.current=!0,j(n.map((R,U)=>{if(U!==x)return R;const M={...R,is_open:P};return R.operation==="unchanged"&&(M.operation="update"),M}))},Z=()=>{const x=n.filter(P=>P.operation!=="delete"||P.id);E.mutate({paperId:a,evaluations:x})};return e.jsxs(W,{open:t,onOpenChange:s,children:[e.jsxs(Y,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Evaluation Results"}),e.jsx(se,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),l==="pending"&&e.jsx(fe,{isAuthor:p}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[n.filter(x=>x.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:`text-left py-2 px-2 font-medium text-sm ${g?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),g&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:n.map((x,P)=>{if(x.operation==="delete")return null;const R=w.get(x.task_id),U=L.get(x.dataset_id),M=m(x.task_id,x.dataset_id,x.metric_name),Q=!!(x.task_id&&x.dataset_id)&&B.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(Ct,{value:x.task_id,onChange:z=>S(P,"task_id",z),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:R?{value:R.id,label:R.name}:null,queryKey:["eval-edit-task-search"],queryFn:H,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Ct,{value:x.dataset_id,onChange:z=>S(P,"dataset_id",z),placeholder:x.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:x.task_id?"No datasets found for this task.":"Select a task first.",disabled:!x.task_id,selectedOption:U?{value:U.id,label:U.name}:null,queryKey:["eval-edit-dataset-search",x.task_id],queryFn:G(x.task_id),enabled:t&&!!x.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(X,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:x.model_name,onChange:z=>S(P,"model_name",z.target.value)})}),g&&e.jsx("td",{className:"py-2 px-2",children:K(x.task_id,x.dataset_id)?e.jsx(X,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:x.harness,onChange:z=>S(P,"harness",z.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!x.task_id||!x.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):Q?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(ne,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):M.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:x.metric_name,onChange:z=>S(P,"metric_name",z.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),M.map(z=>e.jsx("option",{value:z.value,children:z.label},z.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(X,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:x.metric_value,onChange:z=>S(P,"metric_value",z.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(X,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:x.num_parameters,onChange:z=>S(P,"num_parameters",z.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(X,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:x.hf_model_url,onChange:z=>S(P,"hf_model_url",z.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:x.is_open,onChange:z=>O(P,z.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>F(P),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:x.id&&!c?"Only administrators can delete published results":"Remove row",disabled:!!x.id&&!c,children:e.jsx(Te,{className:"w-4 h-4"})})})]},P)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(na,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(D,{variant:"outline",size:"sm",onClick:$,className:"flex items-center space-x-2",children:[e.jsx(Fe,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(oe,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(D,{variant:"ghost",onClick:()=>_("benchmark"),children:"Suggest a new benchmark"}),e.jsx(D,{variant:"ghost",onClick:()=>_("metric"),children:"Suggest a new metric"})]}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:Z,disabled:E.isPending,children:E.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(pt,{open:y!==null,onOpenChange:x=>{x||_(null)},paperId:a,kind:y??"benchmark"})]})}function or(t,s,a){if(!t)return t;const r=i=>i.paper_id!==s||i.paper_title===a?i:{...i,paper_title:a};if(Array.isArray(t)){const i=t.map(r);return i.some((o,l)=>o!==t[l])?i:t}if(Array.isArray(t.results)){const i=t.results.map(r);return i.some((o,l)=>o!==t.results[l])?{...t,results:i}:t}return t}function ve(t,s,a){new Set([...a,s.id,s.arxiv_id].filter(o=>!!o)).forEach(o=>{t.setQueryData(["paper",o],s),t.setQueryData(["paper-arxiv",o],s)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const i=String(s.id),d=o=>or(o,i,s.title);t.setQueriesData({queryKey:["evaluations"]},d),t.setQueriesData({queryKey:["dataset-evals"]},d),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}const Ye=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function Lt(t){return t.map(s=>s.trim()).filter(Boolean)}function et(t,s){const a=Lt(t).sort(),r=Lt(s).sort();return a.length!==r.length?!1:a.every((i,d)=>i===r[d])}function lr(t,s){return et(t.hf_models,s.hf_models)&&et(t.hf_datasets,s.hf_datasets)&&et(t.hf_spaces,s.hf_spaces)}function cr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialArtifacts:i,onSuccess:d,submitMode:o="direct",isAuthor:l=!1}){const[c,p]=h.useState(i),[g,n]=h.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),j=ue(),{toast:y}=ie(),_=h.useRef(!1);h.useEffect(()=>{if(!t){_.current=!1;return}_.current||(_.current=!0,p(i),n({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,i]);const w=me({mutationFn:async({paperId:v,artifacts:u})=>o==="pending"?(await pe.submit({paper_id:parseInt(v),edit_type:"hf_artifacts",proposed_payload:u}),null):J.updateHfArtifacts(v,u),onSuccess:v=>{if(o==="pending"){y({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),d==null||d(),s(!1),n({hf_models:"",hf_datasets:"",hf_spaces:""});return}v&&ve(j,v,[a,r]),d==null||d(),s(!1),n({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:v=>{var N;const u=v;let f=u.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");if(u.response)try{const I=JSON.parse(u.response);typeof(I==null?void 0:I.detail)=="string"?f=I.detail:Array.isArray(I==null?void 0:I.detail)&&((N=I.detail[0])!=null&&N.msg)&&(f=I.detail[0].msg)}catch{f=u.response}y({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:f,variant:"destructive"})}}),b=()=>{const v={hf_models:[...c.hf_models],hf_datasets:[...c.hf_datasets],hf_spaces:[...c.hf_spaces]};for(const{key:u}of Ye){const f=g[u].trim();if(f){if(v[u].some(N=>N.trim()===f))return alert(`This ${u.replace("hf_","")} URL is already added`),null;v[u]=[...v[u],f]}}return v},L=v=>{const u=g[v].trim();if(u){if(c[v].some(f=>f.trim()===u)){alert(`This ${v.replace("hf_","")} URL is already added`);return}p(f=>({...f,[v]:[...f[v],u]})),n(f=>({...f,[v]:""}))}},A=(v,u)=>{p(f=>({...f,[v]:f[v].filter(N=>N!==u)}))},T=()=>{const v=b();if(v===null)return;const u=Object.keys(i).some(f=>i[f].some(N=>!v[f].includes(N)));o==="direct"&&u&&!window.confirm("Remove one or more Hugging Face artifact links?")||w.mutate({paperId:a,artifacts:v})},C=h.useMemo(()=>{const v={hf_models:[...c.hf_models],hf_datasets:[...c.hf_datasets],hf_spaces:[...c.hf_spaces]};for(const{key:u}of Ye){const f=g[u].trim();if(f){if(v[u].some(N=>N.trim()===f))return!1;v[u]=[...v[u],f]}}return!lr(v,i)},[c,g,i]);return e.jsx(W,{open:t,onOpenChange:s,children:e.jsxs(Y,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Hugging Face Artifacts"}),e.jsx(se,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(fe,{isAuthor:l}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:Ye.map(({key:v,label:u,placeholder:f})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:u}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(X,{type:"url",placeholder:f,value:g[v],onChange:N=>n(I=>({...I,[v]:N.target.value})),onKeyPress:N=>{N.key==="Enter"&&(N.preventDefault(),L(v))},className:"flex-1"}),e.jsxs(D,{onClick:()=>L(v),size:"sm",disabled:!g[v].trim(),children:[e.jsx(Fe,{className:"w-4 h-4 mr-1"}),"Add"]})]}),c[v].length>0?e.jsx("div",{className:"space-y-2",children:c[v].map(N=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:N}),e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>A(v,N),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${u.toLowerCase()} URL`,children:e.jsx(Te,{className:"w-4 h-4"})})]},N))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",u.toLowerCase()," linked yet."]})]},v))}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:T,disabled:w.isPending||!C,children:w.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}var Ue="Checkbox",[dr]=mt(Ue),[ur,ft]=dr(Ue);function mr(t){const{__scopeCheckbox:s,checked:a,children:r,defaultChecked:i,disabled:d,form:o,name:l,onCheckedChange:c,required:p,value:g="on",internal_do_not_use_render:n}=t,[j,y]=Ht({prop:a,defaultProp:i??!1,onChange:c,caller:Ue}),[_,w]=h.useState(null),[b,L]=h.useState(null),A=h.useRef(!1),T=_?!!o||!!_.closest("form"):!0,C={checked:j,disabled:d,setChecked:y,control:_,setControl:w,name:l,form:o,value:g,hasConsumerStoppedPropagationRef:A,required:p,defaultChecked:he(i)?!1:i,isFormControl:T,bubbleInput:b,setBubbleInput:L};return e.jsx(ur,{scope:s,...C,children:hr(n)?n(C):r})}var Jt="CheckboxTrigger",Xt=h.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:a,...r},i)=>{const{control:d,value:o,disabled:l,checked:c,required:p,setControl:g,setChecked:n,hasConsumerStoppedPropagationRef:j,isFormControl:y,bubbleInput:_}=ft(Jt,t),w=Ee(i,g),b=h.useRef(c);return h.useEffect(()=>{const L=d==null?void 0:d.form;if(L){const A=()=>n(b.current);return L.addEventListener("reset",A),()=>L.removeEventListener("reset",A)}},[d,n]),e.jsx(xe.button,{type:"button",role:"checkbox","aria-checked":he(c)?"mixed":c,"aria-required":p,"data-state":ts(c),"data-disabled":l?"":void 0,disabled:l,value:o,...r,ref:w,onKeyDown:Ne(s,L=>{L.key==="Enter"&&L.preventDefault()}),onClick:Ne(a,L=>{n(A=>he(A)?!0:!A),_&&y&&(j.current=L.isPropagationStopped(),j.current||L.stopPropagation())})})});Xt.displayName=Jt;var gt=h.forwardRef((t,s)=>{const{__scopeCheckbox:a,name:r,checked:i,defaultChecked:d,required:o,disabled:l,value:c,onCheckedChange:p,form:g,...n}=t;return e.jsx(mr,{__scopeCheckbox:a,checked:i,defaultChecked:d,disabled:l,required:o,onCheckedChange:p,name:r,form:g,value:c,internal_do_not_use_render:({isFormControl:j})=>e.jsxs(e.Fragment,{children:[e.jsx(Xt,{...n,ref:s,__scopeCheckbox:a}),j&&e.jsx(es,{__scopeCheckbox:a})]})})});gt.displayName=Ue;var Zt="CheckboxIndicator",Wt=h.forwardRef((t,s)=>{const{__scopeCheckbox:a,forceMount:r,...i}=t,d=ft(Zt,a);return e.jsx(Dt,{present:r||he(d.checked)||d.checked===!0,children:e.jsx(xe.span,{"data-state":ts(d.checked),"data-disabled":d.disabled?"":void 0,...i,ref:s,style:{pointerEvents:"none",...t.style}})})});Wt.displayName=Zt;var Yt="CheckboxBubbleInput",es=h.forwardRef(({__scopeCheckbox:t,...s},a)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:d,defaultChecked:o,required:l,disabled:c,name:p,value:g,form:n,bubbleInput:j,setBubbleInput:y}=ft(Yt,t),_=Ee(a,y),w=Ot(d),b=Mt(r);h.useEffect(()=>{const A=j;if(!A)return;const T=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(T,"checked").set,u=!i.current;if(w!==d&&v){const f=new Event("click",{bubbles:u});A.indeterminate=he(d),v.call(A,he(d)?!1:d),A.dispatchEvent(f)}},[j,w,d,i]);const L=h.useRef(he(d)?!1:d);return e.jsx(xe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??L.current,required:l,disabled:c,name:p,value:g,form:n,...s,tabIndex:-1,ref:_,style:{...s.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});es.displayName=Yt;function hr(t){return typeof t=="function"}function he(t){return t==="indeterminate"}function ts(t){return he(t)?"indeterminate":t?"checked":"unchecked"}const Be=h.forwardRef(({className:t,style:s,...a},r)=>e.jsx(gt,{ref:r,className:$e("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...a,children:e.jsx(Wt,{className:$e("flex items-center justify-center text-current"),children:e.jsx(de,{className:"h-4 w-4"})})}));Be.displayName=gt.displayName;const pr=250,fr=100;function gr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialMethodIds:i,initialMethods:d,onSuccess:o,submitMode:l="direct",isAuthor:c=!1}){const[p,g]=h.useState(i),[n,j]=h.useState(!1),[y,_]=h.useState(""),[w,b]=h.useState(""),[L,A]=h.useState(new Map),T=ue(),{toast:C}=ie(),v=h.useRef(!1);h.useEffect(()=>{if(!t){v.current=!1;return}if(v.current)return;v.current=!0,g(i),_(""),b("");const m=new Map;(d||[]).forEach(E=>{const $=parseInt(E.id);Number.isNaN($)||m.set($,E)}),A(m)},[t,i,d]),h.useEffect(()=>{const m=window.setTimeout(()=>{b(y.trim())},pr);return()=>window.clearTimeout(m)},[y]);const{data:u,isFetching:f}=re({queryKey:["methods-search",w],queryFn:()=>ge.listMethods({page_size:fr,...w?{q:w}:{}}),enabled:t});h.useEffect(()=>{var m;(m=u==null?void 0:u.results)!=null&&m.length&&A(E=>{const $=new Map(E);return u.results.forEach(F=>{const S=parseInt(F.id);Number.isNaN(S)||$.set(S,F)}),$})},[u]);const N=h.useMemo(()=>{const m=(u==null?void 0:u.results)||[],E=new Set,$=[];return p.forEach(F=>{if(E.has(F))return;const S=L.get(F);S&&($.push(S),E.add(F))}),m.forEach(F=>{const S=parseInt(F.id);Number.isNaN(S)||E.has(S)||($.push(F),E.add(S))}),$},[u,p,L]),I=me({mutationFn:async({paperId:m,methodIds:E})=>l==="pending"?(await pe.submit({paper_id:parseInt(m),edit_type:"methods",proposed_payload:{method_ids:E}}),null):J.updateMethods(m,E),onSuccess:m=>{if(l==="pending"){C({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),o==null||o(),s(!1);return}m&&ve(T,m,[a,r]),C({title:"Methods updated",description:`Saved ${p.length} method${p.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1)},onError:m=>{var F;const E=m;let $=E.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(E.response)try{const S=JSON.parse(E.response);typeof(S==null?void 0:S.detail)=="string"?$=S.detail:Array.isArray(S==null?void 0:S.detail)&&((F=S.detail[0])!=null&&F.msg)&&($=S.detail[0].msg)}catch{$=E.response}C({title:l==="pending"?"Could not submit edit":"Could not save methods",description:$,variant:"destructive"})}}),B=()=>{l==="direct"&&i.some(m=>!p.includes(m))&&!window.confirm("Remove one or more method links from this paper?")||I.mutate({paperId:a,methodIds:p})},H=h.useMemo(()=>{if(p.length!==i.length)return!0;const m=new Set(i);return p.some(E=>!m.has(E))},[p,i]),G=(m,E)=>{g($=>E?$.includes(m)?$:[...$,m]:$.filter(F=>F!==m))},K=()=>_("");return e.jsxs(W,{open:t,onOpenChange:s,children:[e.jsxs(Y,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Paper Methods"}),e.jsx(se,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),l==="pending"&&e.jsx(fe,{isAuthor:c}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ce,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(X,{type:"text",placeholder:"Search methods...",value:y,onChange:m=>_(m.target.value),className:"pl-9 pr-9"}),y&&e.jsx("button",{type:"button",onClick:K,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(ht,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:N.length>0?e.jsx("div",{className:"space-y-2",children:N.map(m=>{const E=parseInt(m.id),$=p.includes(E);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Be,{id:`method-${m.id}`,checked:$,onCheckedChange:F=>G(E,F===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${m.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[m.name,m.full_name&&m.full_name!==m.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:m.full_name}),m.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[m.description.substring(0,100),m.description.length>100?"...":""]})]})]},m.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ce,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:w?`No methods found matching "${w}"`:"No methods available"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"ghost",className:"sm:mr-auto",onClick:()=>j(!0),children:"Suggest a new method"}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:B,disabled:I.isPending||!H,children:I.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(pt,{open:n,onOpenChange:j,paperId:a,kind:"method"})]})}const xr=({open:t,onOpenChange:s,paperId:a,initialOrganizationIds:r,submitMode:i,isAuthor:d})=>{var _;const[o,l]=h.useState(r),[c,p]=h.useState(""),g=ue();h.useEffect(()=>{t&&(l(r),p(""))},[r,t]);const n=re({queryKey:["organizations","curation"],queryFn:()=>ge.organizations(!1),enabled:t}),j=h.useMemo(()=>{var b,L;const w=c.trim().toLocaleLowerCase();return w?(((L=n.data)==null?void 0:L.results)??[]).filter(A=>A.name.toLocaleLowerCase().includes(w)):((b=n.data)==null?void 0:b.results)??[]},[(_=n.data)==null?void 0:_.results,c]),y=me({mutationFn:async()=>{r.some(b=>!o.includes(b))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")||(i==="pending"?await pe.submit({paper_id:Number(a),edit_type:"organizations",proposed_payload:{organization_ids:o}}):await J.updateOrganizations(a,o))},onSuccess:()=>{g.invalidateQueries({queryKey:["paper-arxiv"]}),s(!1)}});return e.jsx(W,{open:t,onOpenChange:s,children:e.jsxs(Y,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit organizations"}),e.jsx(se,{children:"Associate existing organizations with this paper. Organization creation remains admin-only."})]}),i==="pending"&&e.jsx(fe,{isAuthor:d}),e.jsxs("div",{className:"relative",children:[e.jsx(Ce,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(X,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:c,onChange:w=>p(w.target.value),className:"pl-9 pr-9"}),c&&e.jsx("button",{type:"button",onClick:()=>p(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear organization search",children:e.jsx(ht,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[j.map(w=>{const b=Number(w.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes(b),onChange:L=>l(A=>L.target.checked?[...A,b]:A.filter(T=>T!==b))}),w.name]},w.id)}),!n.isLoading&&j.length===0&&e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:c.trim()?`No organizations found matching "${c.trim()}"`:"No organizations available"})]}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:()=>y.mutate(),disabled:y.isPending,children:i==="pending"?"Submit test edit":"Save changes"})]})]})})};function br({open:t,onOpenChange:s,paperId:a,arxivId:r,initialProjectPages:i,onSuccess:d,submitMode:o="direct",isAuthor:l=!1}){const[c,p]=h.useState(i),[g,n]=h.useState(""),j=ue(),{toast:y}=ie(),_=h.useRef(!1);h.useEffect(()=>{if(!t){_.current=!1;return}_.current||(_.current=!0,p(i),n(""))},[t,i]);const w=me({mutationFn:async({paperId:u,projectPages:f})=>o==="pending"?(await pe.submit({paper_id:parseInt(u),edit_type:"project_pages",proposed_payload:{project_pages:f}}),null):J.updateProjectPages(u,f),onSuccess:u=>{if(o==="pending"){y({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),d==null||d(),s(!1),n("");return}u&&ve(j,u,[a,r]),d==null||d(),s(!1),n("")},onError:u=>{var I;const f=u;let N=f.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(f.response)try{const B=JSON.parse(f.response);typeof(B==null?void 0:B.detail)=="string"?N=B.detail:Array.isArray(B==null?void 0:B.detail)&&((I=B.detail[0])!=null&&I.msg)&&(N=B.detail[0].msg)}catch{N=f.response}y({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:N,variant:"destructive"})}}),b=()=>{const u=g.trim();return u?c.some(f=>f.url===u)?(alert("This project page URL is already added"),null):[...c,{url:u,is_official:!1}]:c},L=()=>{const u=b();u!==null&&u.length!==c.length&&(p(u),n(""))},A=u=>{p(c.filter(f=>f.url!==u))},T=u=>{p(c.map(f=>f.url===u?{...f,is_official:!f.is_official}:f))},C=()=>{const u=b();u!==null&&(o==="direct"&&i.some(f=>!u.some(N=>N.url===f.url))&&!window.confirm("Remove one or more project pages from this paper?")||w.mutate({paperId:a,projectPages:u}))},v=h.useMemo(()=>{const u=g.trim(),f=u?[...c,{url:u,is_official:!1}]:c;if(f.length!==i.length)return!0;const N=new Map(i.map(I=>[I.url.trim(),!!I.is_official]));return f.some(I=>{const B=N.get(I.url.trim());return B===void 0||B!==!!I.is_official})},[c,g,i]);return e.jsx(W,{open:t,onOpenChange:s,children:e.jsxs(Y,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Paper Project Pages"}),e.jsx(se,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(fe,{isAuthor:l}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(X,{type:"url",placeholder:"https://example.com/project",value:g,onChange:u=>n(u.target.value),onKeyPress:u=>{u.key==="Enter"&&(u.preventDefault(),L())},className:"flex-1"}),e.jsxs(D,{onClick:L,size:"sm",disabled:!g.trim(),children:[e.jsx(Fe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:c.length>0?e.jsx("div",{className:"space-y-2",children:c.map((u,f)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(It,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:u.url}),u.is_official&&e.jsx(Kt,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(D,{variant:u.is_official?"default":"outline",size:"sm",onClick:()=>T(u.url),className:"h-8 px-2 text-xs",title:u.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(Gt,{className:`w-3.5 h-3.5 mr-1 ${u.is_official?"fill-current":""}`}),u.is_official?"Official":"Mark official"]}),e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>A(u.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},f))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(It,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:C,disabled:w.isPending||!v,children:w.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function vr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialRepositories:i,onSuccess:d,submitMode:o="direct",isAuthor:l=!1}){const[c,p]=h.useState(i),[g,n]=h.useState(""),j=ue(),{toast:y}=ie(),_=h.useRef(!1);h.useEffect(()=>{if(!t){_.current=!1;return}_.current||(_.current=!0,p(i),n(""))},[t,i]);const w=me({mutationFn:async({paperId:f,repositories:N})=>o==="pending"?(await pe.submit({paper_id:parseInt(f),edit_type:"repositories",proposed_payload:{repositories:N}}),null):J.updateRepositories(f,N),onSuccess:f=>{if(o==="pending"){y({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),d==null||d(),s(!1),n("");return}f&&ve(j,f,[a,r]),d==null||d(),s(!1),n("")},onError:f=>{var B;const N=f;let I=N.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(N.response)try{const H=JSON.parse(N.response);typeof(H==null?void 0:H.detail)=="string"?I=H.detail:Array.isArray(H==null?void 0:H.detail)&&((B=H.detail[0])!=null&&B.msg)&&(I=H.detail[0].msg)}catch{I=N.response}y({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:I,variant:"destructive"})}}),b=f=>{const N=[];for(const I of f){const B=N.find(H=>Et(H.url,I.url));if(B)B.is_official=B.is_official||I.is_official;else{const H=Oe(I.url);N.push({url:H??I.url.trim(),is_official:I.is_official})}}return N},L=()=>{const f=g.trim(),N=f?[...c,{url:f,is_official:!1}]:c;return f&&c.some(I=>Et(I.url,f))?(alert("This repository URL is already added"),null):b(N)},A=()=>{const f=L();f!==null&&f.length!==c.length&&(p(f),n(""))},T=f=>{p(c.filter(N=>N.url!==f))},C=f=>{p(c.map(N=>N.url===f?{...N,is_official:!N.is_official}:N))},v=()=>{const f=L();f!==null&&(o==="direct"&&i.some(N=>!f.some(I=>I.url===N.url))&&!window.confirm("Remove one or more repositories from this paper?")||w.mutate({paperId:a,repositories:f}))},u=h.useMemo(()=>{const f=g.trim(),N=f?[...c,{url:f,is_official:!1}]:c;if(N.length!==i.length)return!0;const I=b(i),B=b(N);if(B.length!==I.length)return!0;const H=new Map(I.map(G=>[Oe(G.url)??G.url.trim(),!!G.is_official]));return B.some(G=>{const K=Oe(G.url)??G.url.trim(),m=H.get(K);return m===void 0||m!==!!G.is_official})},[c,g,i]);return e.jsx(W,{open:t,onOpenChange:s,children:e.jsxs(Y,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Paper Repositories"}),e.jsx(se,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(fe,{isAuthor:l}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(X,{type:"url",placeholder:"https://github.com/owner/repo",value:g,onChange:f=>n(f.target.value),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),A())},className:"flex-1"}),e.jsxs(D,{onClick:A,size:"sm",disabled:!g.trim(),children:[e.jsx(Fe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:c.length>0?e.jsx("div",{className:"space-y-2",children:c.map((f,N)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(St,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:f.url}),f.is_official&&e.jsx(Kt,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(D,{variant:f.is_official?"default":"outline",size:"sm",onClick:()=>C(f.url),className:"h-8 px-2 text-xs",title:f.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(Gt,{className:`w-3.5 h-3.5 mr-1 ${f.is_official?"fill-current":""}`}),f.is_official?"Official":"Mark official"]}),e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>T(f.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},N))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(St,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:v,disabled:w.isPending||!u,children:w.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function jr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrl:i,onSuccess:d,submitMode:o="direct",isAuthor:l=!1}){const[c,p]=h.useState(i),g=ue(),{toast:n}=ie(),j=h.useRef(!1);h.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,p(i))},[t,i]);const y=me({mutationFn:async({paperId:A,sourceUrl:T})=>o==="pending"?(await pe.submit({paper_id:parseInt(A),edit_type:"source_url",proposed_payload:{source_url:T}}),null):J.updateSourceUrl(A,T),onSuccess:A=>{if(o==="pending"){n({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),d==null||d(),s(!1);return}A&&ve(g,A,[a,r]),d==null||d(),s(!1)},onError:A=>{var v;const T=A;let C=T.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(T.response)try{const u=JSON.parse(T.response);typeof(u==null?void 0:u.detail)=="string"?C=u.detail:Array.isArray(u==null?void 0:u.detail)&&((v=u.detail[0])!=null&&v.msg)&&(C=u.detail[0].msg)}catch{C=T.response}n({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:C,variant:"destructive"})}}),_=c.trim(),w=/^https?:\/\//i.test(_),b=_!==(i||"").trim(),L=()=>{w&&y.mutate({paperId:a,sourceUrl:_})};return e.jsx(W,{open:t,onOpenChange:s,children:e.jsxs(Y,{className:"max-w-2xl",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Source URL"}),e.jsxs(se,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(fe,{isAuthor:l}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(X,{type:"url",placeholder:"https://example.com/paper",value:c,onChange:A=>p(A.target.value),onKeyPress:A=>{A.key==="Enter"&&w&&b&&(A.preventDefault(),L())}}),!w&&_.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:L,disabled:y.isPending||!w||!b,children:y.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const yr=250,wr=100;function kr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialTaskIds:i,initialTasks:d,onSuccess:o,submitMode:l="direct",isAuthor:c=!1}){const[p,g]=h.useState(i),[n,j]=h.useState(!1),[y,_]=h.useState(""),[w,b]=h.useState(""),[L,A]=h.useState(new Map),T=ue(),{toast:C}=ie(),v=h.useRef(!1);h.useEffect(()=>{if(!t){v.current=!1;return}if(v.current)return;v.current=!0,g(i),_(""),b("");const m=new Map;(d||[]).forEach(E=>{const $=parseInt(E.id);Number.isNaN($)||m.set($,E)}),A(m)},[t,i,d]),h.useEffect(()=>{const m=window.setTimeout(()=>{b(y.trim())},yr);return()=>window.clearTimeout(m)},[y]);const{data:u,isFetching:f}=re({queryKey:["tasks-search",w],queryFn:()=>ge.listTasks({page_size:wr,...w?{q:w}:{}}),enabled:t});h.useEffect(()=>{var m;(m=u==null?void 0:u.results)!=null&&m.length&&A(E=>{const $=new Map(E);return u.results.forEach(F=>{const S=parseInt(F.id);Number.isNaN(S)||$.set(S,F)}),$})},[u]);const N=h.useMemo(()=>{const m=(u==null?void 0:u.results)||[],E=new Set,$=[];return p.forEach(F=>{if(E.has(F))return;const S=L.get(F);S&&($.push(S),E.add(F))}),m.forEach(F=>{const S=parseInt(F.id);Number.isNaN(S)||E.has(S)||($.push(F),E.add(S))}),$},[u,p,L]),I=me({mutationFn:async({paperId:m,taskIds:E})=>l==="pending"?(await pe.submit({paper_id:parseInt(m),edit_type:"tasks",proposed_payload:{task_ids:E}}),null):J.updateTasks(m,E),onMutate:async({taskIds:m})=>{if(l==="pending")return{snapshots:[]};const E=m.map(S=>L.get(S)).filter(S=>!!S).map(S=>({id:S.id,name:S.name,slug:S.slug})).sort((S,O)=>S.name.localeCompare(O.name)),$=Array.from(new Set([a,r].filter(S=>!!S)));await Promise.all($.flatMap(S=>[T.cancelQueries({queryKey:["paper",S]}),T.cancelQueries({queryKey:["paper-arxiv",S]})]));const F=[];return $.forEach(S=>{["paper","paper-arxiv"].forEach(O=>{const Z=[O,S],x=T.getQueryData(Z);F.push({key:Z,data:x}),x&&T.setQueryData(Z,{...x,tasks:E})})}),C({title:"Tasks updated",description:`Saved ${m.length} task${m.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1),{snapshots:F}},onSuccess:m=>{if(l==="pending"){C({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),o==null||o(),s(!1);return}m&&ve(T,m,[a,r])},onError:(m,E,$)=>{var O,Z;(O=$==null?void 0:$.snapshots)==null||O.forEach(({key:x,data:P})=>{T.setQueryData(x,P)});const F=m;let S=F.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(F.response)try{const x=JSON.parse(F.response);typeof(x==null?void 0:x.detail)=="string"?S=x.detail:Array.isArray(x==null?void 0:x.detail)&&((Z=x.detail[0])!=null&&Z.msg)&&(S=x.detail[0].msg)}catch{S=F.response}C({title:l==="pending"?"Could not submit edit":"Could not save tasks",description:S,variant:"destructive"})}}),B=()=>{l==="direct"&&i.some(m=>!p.includes(m))&&!window.confirm("Remove one or more task links from this paper?")||I.mutate({paperId:a,taskIds:p})},H=h.useMemo(()=>{if(p.length!==i.length)return!0;const m=new Set(i);return p.some(E=>!m.has(E))},[p,i]),G=(m,E)=>{g($=>E?$.includes(m)?$:[...$,m]:$.filter(F=>F!==m))},K=()=>_("");return e.jsxs(W,{open:t,onOpenChange:s,children:[e.jsxs(Y,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ee,{children:[e.jsx(te,{children:"Edit Paper Tasks"}),e.jsx(se,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),l==="pending"&&e.jsx(fe,{isAuthor:c}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ce,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(X,{type:"text",placeholder:"Search tasks...",value:y,onChange:m=>_(m.target.value),className:"pl-9 pr-9"}),y&&e.jsx("button",{type:"button",onClick:K,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(ht,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:N.length>0?e.jsx("div",{className:"space-y-2",children:N.map(m=>{const E=parseInt(m.id),$=p.includes(E);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Be,{id:`task-${m.id}`,checked:$,onCheckedChange:F=>G(E,F===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${m.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[m.name,m.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[m.description.substring(0,100),m.description.length>100?"...":""]})]})]},m.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ne,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ce,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:w?`No tasks found matching "${w}"`:"No tasks available"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"ghost",className:"sm:mr-auto",onClick:()=>j(!0),children:"Suggest a new task"}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:B,disabled:I.isPending||!H,children:I.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(pt,{open:n,onOpenChange:j,paperId:a,kind:"task"})]})}function _r({activeEditor:t,arxivId:s,editSubmitMode:a,evaluations:r,isAdmin:i,isLinkedAuthor:d,onOpenChange:o,paper:l}){if(!t)return null;const c={open:!0,paperId:l.id,arxivId:s,submitMode:a,isAuthor:d},p=n=>j=>o(n,j);return{tasks:()=>{var n;return e.jsx(kr,{...c,onOpenChange:p("tasks"),initialTaskIds:((n=l.tasks)==null?void 0:n.map(j=>Number(j.id)))??[],initialTasks:l.tasks??[]})},methods:()=>{var n;return e.jsx(gr,{...c,onOpenChange:p("methods"),initialMethodIds:((n=l.methods)==null?void 0:n.map(j=>Number(j.id)))??[],initialMethods:l.methods??[]})},repositories:()=>{var n;return e.jsx(vr,{...c,onOpenChange:p("repositories"),initialRepositories:((n=l.repositories)==null?void 0:n.map(({url:j,is_official:y})=>({url:j,is_official:!!y})))??[]})},"project-pages":()=>{var n;return e.jsx(br,{...c,onOpenChange:p("project-pages"),initialProjectPages:((n=l.project_pages)==null?void 0:n.map(({url:j,is_official:y})=>({url:j,is_official:!!y})))??[]})},results:()=>e.jsx(ir,{...c,onOpenChange:p("results"),initialEvaluations:r,paperTasks:l.tasks??[],isAdmin:i}),"source-url":()=>e.jsx(jr,{...c,onOpenChange:p("source-url"),initialUrl:l.source_url??l.url_abs??""}),"hf-artifacts":()=>e.jsx(cr,{...c,onOpenChange:p("hf-artifacts"),initialArtifacts:{hf_models:l.hf_models??[],hf_datasets:l.hf_datasets??[],hf_spaces:l.hf_spaces??[]}}),organizations:()=>e.jsx(xr,{open:!0,paperId:l.id,onOpenChange:p("organizations"),initialOrganizationIds:(l.organizations??[]).map(({id:n})=>Number(n)),submitMode:a,isAuthor:d})}[t]()}const Nr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals",start:ua,get:da,cancel:ca},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper",start:la,get:oa,cancel:ia}};function Cr({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(pa,{remarkPlugins:[fa],components:{a:({children:s,...a})=>e.jsx("a",{...a,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:s}),p:({children:s})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:s}),ul:({children:s})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:s}),ol:({children:s})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:s}),h1:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h2:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h3:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),code:({children:s})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:s}),pre:({children:s})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:s})},children:t})})}function ss({kind:t,paperId:s,paperTitle:a,triggerClassName:r,onComplete:i}){const d=Nr[t],[o,l]=h.useState(!1),[c,p]=h.useState(null),[g,n]=h.useState(!1),[j,y]=h.useState(null),_=h.useRef(null),w=(c==null?void 0:c.status)==="queued"||(c==null?void 0:c.status)==="dispatching"||(c==null?void 0:c.status)==="running",b=c==null?void 0:c.id;h.useEffect(()=>{if(!w||!b)return;let C=!1;const v=window.setInterval(async()=>{try{const u=await d.get(b);C||(p(u),y(null))}catch(u){C||y(u instanceof Error?u.message:"Could not check job status.")}},2e3);return()=>{C=!0,window.clearInterval(v)}},[w,d,b]),h.useEffect(()=>{(c==null?void 0:c.status)!=="completed"||_.current===c.id||(_.current=c.id,i())},[c,i]);const L=async()=>{n(!0),y(null);try{p(await d.start(s))}catch(C){y(C instanceof Error?C.message:"Could not start Codex.")}finally{n(!1)}},A=()=>{p(null),y(null),_.current=null},T=async()=>{if(c){y(null);try{p(await d.cancel(c.id))}catch(C){y(C instanceof Error?C.message:"Could not cancel Codex.")}}};return e.jsxs(W,{open:o,onOpenChange:l,children:[e.jsx("button",{type:"button",className:r,onClick:()=>l(!0),children:w?d.running:(c==null?void 0:c.status)==="completed"?d.complete:d.trigger}),e.jsxs(Y,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(ee,{className:"min-w-0",children:[e.jsx(te,{children:d.title}),e.jsx(se,{children:d.description(a)})]}),c?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",c.status]}),c.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:c.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),w&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[c.status==="queued"?"This job is queued and will start after the current Codex job finishes.":d.progress," ","This can take several minutes; you can close this window and return."]}),c.report&&e.jsx(Cr,{report:c.report}),c.error&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:c.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:d.notice}),j&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:j}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>l(!1),children:w?"Close":"Cancel"}),w&&e.jsx(D,{variant:"outline",onClick:()=>void T(),children:"Cancel job"}),!c&&e.jsx(D,{onClick:L,disabled:g,children:g?"Starting…":d.action}),c&&!w&&e.jsx(D,{variant:"outline",onClick:A,children:"Run again"})]})]})]})}function Er(t){return e.jsx(ss,{...t,kind:"add-evals",triggerClassName:"edit-link"})}function we({accent:t,id:s,label:a}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:s,children:[e.jsx("span",{children:e.jsx("a",{href:`#${s}`,className:"section-anchor-link",children:a})}),t]})}function Sr({canCopyBadge:t,canEdit:s,evaluationsByTask:a,evaluationsLoading:r,isAdmin:i,onCopyBadge:d,onEdit:o,onRefresh:l,paper:c,visibleEvaluationCount:p}){return e.jsxs(e.Fragment,{children:[e.jsx(we,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[p," benchmarks",t&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:d,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(V,{name:"copy",size:10})," Copy PwC badge"]}),i&&ma()&&e.jsx(Er,{paperId:Number(c.id),paperTitle:c.title,onComplete:l}),s&&e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})}),r?e.jsx(_e,{className:"h-32 w-full"}):a.length>0?a.map(g=>e.jsxs("div",{className:g.taskSlug?"paper-section-anchor":void 0,id:g.taskSlug?Vt(g.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:g.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(le,{to:`/tasks/${g.taskSlug}`,children:g.taskName}),e.jsx("a",{href:La(g.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${g.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):g.taskName}),e.jsxs("span",{className:"accent",children:[g.rows.length," ",g.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:g.rows.map(n=>{var j;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:n.dataset_slug?e.jsx(le,{to:`/benchmark/${n.dataset_slug}`,children:n.dataset_name||"—"}):n.dataset_name||"—"}),e.jsxs("td",{className:"model",title:n.model_name||void 0,children:[n.hf_model_url?e.jsx("a",{href:n.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${n.model_name||"model"} on Hugging Face`,children:n.model_name||"—"}):n.model_name||"—",n.is_open===!1&&e.jsx(Vs,{}),(n.external??n.is_external)&&e.jsx(Js,{sourceUrl:n.source_url||n.external_source_url||n.result_url})]}),e.jsx("td",{className:"metric",children:n.best_metric}),e.jsx("td",{className:"value",children:Es((j=n.metrics)==null?void 0:j[n.best_metric||""])}),e.jsx("td",{className:"rank",children:n.best_rank!=null?`#${n.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:n.dataset_slug&&e.jsx(le,{to:`/benchmark/${n.dataset_slug}?${[n.task_slug?`task=${encodeURIComponent(n.task_slug)}`:"",`eval=${encodeURIComponent(n.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},n.id)})})]})]},g.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]})}var xt="Radio",[Pr,as]=mt(xt),[Ir,$r]=Pr(xt),rs=h.forwardRef((t,s)=>{const{__scopeRadio:a,name:r,checked:i=!1,required:d,disabled:o,value:l="on",onCheck:c,form:p,...g}=t,[n,j]=h.useState(null),y=Ee(s,b=>j(b)),_=h.useRef(!1),w=n?p||!!n.closest("form"):!0;return e.jsxs(Ir,{scope:a,checked:i,disabled:o,children:[e.jsx(xe.button,{type:"button",role:"radio","aria-checked":i,"data-state":ls(i),"data-disabled":o?"":void 0,disabled:o,value:l,...g,ref:y,onClick:Ne(t.onClick,b=>{i||c==null||c(),w&&(_.current=b.isPropagationStopped(),_.current||b.stopPropagation())})}),w&&e.jsx(os,{control:n,bubbles:!_.current,name:r,value:l,checked:i,required:d,disabled:o,form:p,style:{transform:"translateX(-100%)"}})]})});rs.displayName=xt;var ns="RadioIndicator",is=h.forwardRef((t,s)=>{const{__scopeRadio:a,forceMount:r,...i}=t,d=$r(ns,a);return e.jsx(Dt,{present:r||d.checked,children:e.jsx(xe.span,{"data-state":ls(d.checked),"data-disabled":d.disabled?"":void 0,...i,ref:s})})});is.displayName=ns;var Ar="RadioBubbleInput",os=h.forwardRef(({__scopeRadio:t,control:s,checked:a,bubbles:r=!0,...i},d)=>{const o=h.useRef(null),l=Ee(o,d),c=Ot(a),p=Mt(s);return h.useEffect(()=>{const g=o.current;if(!g)return;const n=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(n,"checked").set;if(c!==a&&y){const _=new Event("click",{bubbles:r});y.call(g,a),g.dispatchEvent(_)}},[c,a,r]),e.jsx(xe.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:l,style:{...i.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});os.displayName=Ar;function ls(t){return t?"checked":"unchecked"}var Lr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],De="RadioGroup",[Rr]=mt(De,[zt,as]),cs=zt(),ds=as(),[Fr,Tr]=Rr(De),us=h.forwardRef((t,s)=>{const{__scopeRadioGroup:a,name:r,defaultValue:i,value:d,required:o=!1,disabled:l=!1,orientation:c,dir:p,loop:g=!0,onValueChange:n,...j}=t,y=cs(a),_=Ss(p),[w,b]=Ht({prop:d,defaultProp:i??null,onChange:n,caller:De});return e.jsx(Fr,{scope:a,name:r,required:o,disabled:l,value:w,onValueChange:b,children:e.jsx(Ps,{asChild:!0,...y,orientation:c,dir:_,loop:g,children:e.jsx(xe.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:_,...j,ref:s})})})});us.displayName=De;var ms="RadioGroupItem",hs=h.forwardRef((t,s)=>{const{__scopeRadioGroup:a,disabled:r,...i}=t,d=Tr(ms,a),o=d.disabled||r,l=cs(a),c=ds(a),p=h.useRef(null),g=Ee(s,p),n=d.value===i.value,j=h.useRef(!1);return h.useEffect(()=>{const y=w=>{Lr.includes(w.key)&&(j.current=!0)},_=()=>j.current=!1;return document.addEventListener("keydown",y),document.addEventListener("keyup",_),()=>{document.removeEventListener("keydown",y),document.removeEventListener("keyup",_)}},[]),e.jsx(Is,{asChild:!0,...l,focusable:!o,active:n,children:e.jsx(rs,{disabled:o,required:d.required,checked:n,...c,...i,name:d.name,ref:g,onCheck:()=>d.onValueChange(i.value),onKeyDown:Ne(y=>{y.key==="Enter"&&y.preventDefault()}),onFocus:Ne(i.onFocus,()=>{var y;j.current&&((y=p.current)==null||y.click())})})})});hs.displayName=ms;var Ur="RadioGroupIndicator",ps=h.forwardRef((t,s)=>{const{__scopeRadioGroup:a,...r}=t,i=ds(a);return e.jsx(is,{...i,...r,ref:s})});ps.displayName=Ur;var fs=us,gs=hs,Br=ps;const it=h.forwardRef(({className:t,...s},a)=>e.jsx(fs,{className:$e("grid gap-2",t),...s,ref:a}));it.displayName=fs.displayName;const ke=h.forwardRef(({className:t,...s},a)=>e.jsx(gs,{ref:a,className:$e("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(Br,{className:"flex items-center justify-center",children:e.jsx($s,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ke.displayName=gs.displayName;const Dr={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},ot=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,Hr=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,Mr=20,lt="copy_to_bucket";function zr(t){const s=t.trim();if(!Hr.test(s))return null;const[a,r]=s.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(a)}/${encodeURIComponent(r)}`}function ct(t){return`pwc:bucket-copy:${t}`}function qr(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(lt)!==t)return null;try{const a=window.sessionStorage.getItem(ct(t));if(!a)return null;const r=JSON.parse(a);return r.paperId!==t||typeof r.bucketId!="string"||!["new","existing"].includes(r.destinationMode)||!["public","private"].includes(r.visibility)||!Array.isArray(r.selectedIds)||r.selectedIds.some(i=>typeof i!="string")?null:r}catch{return null}}function Or(t,s=Mr){if(s<1)throw new Error("Bucket copy batch size must be positive");const a=[];for(let r=0;r!ot.test(c)))return null;const o=d.join("/"),l=s==="model"?"":`${s}s/`;return{id:`${s}:${o}`,kind:s,label:o,url:`https://huggingface.co/${l}${o}`,source:`hf://${l}${o}/`,destination:`${s}s/${o}/`,repoId:o}}catch{return null}}function Kr(t){try{const s=new URL(t);if(s.hostname!=="github.com"&&s.hostname!=="www.github.com")return null;const a=s.pathname.split("/").filter(Boolean);if(a.length<2)return null;const r=a[0],i=a[1].replace(/\.git$/,"");if(!ot.test(r)||!ot.test(i))return null;const d=`${r}/${i}`;return{id:`github:${d}`,kind:"github",label:d,url:`https://github.com/${d}`,source:`https://github.com/${d}.git`,destination:`github/${d}/`}}catch{return null}}function Gr({githubUrls:t,hfModelUrls:s,hfDatasetUrls:a,hfSpaceUrls:r,paperId:i,pdfName:d,pdfUrl:o}){const l=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${d||i}.pdf`}:null,...s.map(p=>tt(p,"model")),...a.map(p=>tt(p,"dataset")),...r.map(p=>tt(p,"space")),...t.map(Kr)],c=new Set;return l.filter(p=>!p||c.has(p.id)?!1:(c.add(p.id),!0))}function Qr(t,s,a){const r=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${Pe(t.trim())}`];a.create&&r.push(`hf buckets create "$HF_BUCKET" --exist-ok${a.isPrivate?" --private":""}`);for(const o of s.filter(l=>l.kind!=="github"&&l.kind!=="pdf"))r.push(`hf cp ${Pe(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const i=s.find(o=>o.kind==="pdf");i&&r.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${Pe(i.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${i.destination}"`);const d=s.filter(o=>o.kind==="github");if(d.length){r.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of d){const l=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;r.push(`git clone --depth 1 -- ${Pe(o.source)} "${l}"`,`hf sync "${l}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return r.join(` +`)}function Vr(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function Jr(t){const{toast:s}=ie(),a=h.useMemo(()=>Gr({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),r=h.useMemo(()=>qr(t.paperId),[t.paperId]),[i,d]=h.useState(!!r),[o,l]=h.useState((r==null?void 0:r.destinationMode)??"new"),[c,p]=h.useState((r==null?void 0:r.bucketId)??""),[g,n]=h.useState((r==null?void 0:r.visibility)??"public"),[j,y]=h.useState(()=>new Set((r==null?void 0:r.selectedIds)??a.map(m=>m.id))),[_,w]=h.useState(!1),[b,L]=h.useState(null),[A,T]=h.useState(!!r),C=a.filter(m=>j.has(m.id)),v=C.length===a.length,u=zr(c),f=u!==null,N=Qr(c,C,{create:o==="new",isPrivate:g==="private"}),I=(m,E)=>{y($=>{const F=new Set($);return E?F.add(m):F.delete(m),F})},B=async()=>{try{await navigator.clipboard.writeText(N),s({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{s({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},H=h.useCallback(()=>{const m=As("/api/v1/auth/hf/login"),E=new URL(window.location.href);E.searchParams.set(lt,t.paperId),window.sessionStorage.setItem(ct(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:c.trim(),destinationMode:o,visibility:g,selectedIds:Array.from(j)}));const $=new URLSearchParams({return_to:E.toString(),authorize_bucket:"true"});o==="new"&&$.set("bucket_create","true"),window.location.assign(`${m}?${$.toString()}`)},[c,o,t.paperId,j,g]),G=h.useCallback(async()=>{if(!t.isSignedIn){H();return}w(!0);let m=0,E=0;try{const $=C.filter(O=>O.kind!=="pdf"&&O.kind!=="github"&&!!O.repoId).map(O=>({kind:O.kind,repo_id:O.repoId})),F=Or($);F.length||F.push([]);for(const[O,Z]of F.entries()){L({current:O+1,total:F.length});const x=await J.copyToBucket(t.paperId,{bucket_id:c.trim(),create:O===0&&o==="new",private:g==="private",include_pdf:O===0&&C.some(P=>P.kind==="pdf"),artifacts:Z});m+=x.copied.length,E+=x.errors.length}const S=C.filter(O=>O.kind==="github").length;s({title:E?"Bucket copy partially completed":"Copied to bucket",description:[`${m} item${m===1?"":"s"} copied.`,E?`${E} item${E===1?"":"s"} failed.`:"",S?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:E?"destructive":void 0,action:u?e.jsx(Ls,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!E&&!S&&d(!1)}catch($){if($ instanceof rt&&$.code==="bucket_authorization_required"){H();return}s({title:m?"Bucket copy partially completed":"Bucket copy failed",description:m?`${m} item${m===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:$ instanceof rt&&typeof $.detail=="string"?$.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{w(!1),L(null)}},[H,c,u,o,t.isSignedIn,t.paperId,C,s,g]);h.useEffect(()=>{if(!A||!t.isSignedIn)return;T(!1),window.sessionStorage.removeItem(ct(t.paperId));const m=new URL(window.location.href);m.searchParams.delete(lt),window.history.replaceState({},"",`${m.pathname}${m.search}${m.hash}`),G()},[G,t.isSignedIn,t.paperId,A]);const K=()=>{y(new Set(a.map(m=>m.id))),!c&&t.suggestedBucketId&&p(t.suggestedBucketId),d(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:K,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:a.length?`${a.length} linked artifact${a.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(W,{open:i,onOpenChange:d,children:e.jsxs(Y,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(ee,{children:[e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(se,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),e.jsx("div",{className:"-mx-6 min-h-0 overflow-y-auto px-6",children:a.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Choose your destination"}),e.jsxs(it,{value:o,onValueChange:m=>l(m),className:"grid grid-cols-2 gap-2",children:[e.jsxs(ae,{className:"bucket-choice",children:[e.jsx(ke,{value:"new"}),"New bucket"]}),e.jsxs(ae,{className:"bucket-choice",children:[e.jsx(ke,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(X,{id:"bucket-id",value:c,onChange:m=>p(m.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":c.length>0&&!f}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."}),u&&e.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(V,{name:"external",size:10})]})]})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Bucket visibility"}),e.jsxs(it,{value:g,onValueChange:m=>n(m),className:"flex gap-5",children:[e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx(ke,{value:"public"}),"Public"]}),e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx(ke,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(ae,{children:"Artifacts"}),e.jsx(D,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>y(v?new Set:new Set(a.map(m=>m.id))),children:v?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:a.map(m=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(Be,{id:`bucket-artifact-${m.id}`,checked:j.has(m.id),onCheckedChange:E=>I(m.id,E===!0)}),e.jsxs(ae,{htmlFor:`bucket-artifact-${m.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:Dr[m.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:m.label})]}),e.jsxs("a",{href:ce(m.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(V,{name:"external",size:10})]})]},m.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:f?N:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."})}),e.jsxs(oe,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(D,{type:"button",onClick:B,variant:"outline",disabled:!f||C.length===0,children:[e.jsx(V,{name:"copy",size:12}),"Copy commands"]}),e.jsx(D,{type:"button",onClick:G,disabled:_||t.isSignedIn&&(!f||!C.some(m=>m.kind!=="github")),children:_?b&&b.total>1?`Copying ${b.current}/${b.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}function Xr({isLoading:t,papers:s}){return t?e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}):s!=null&&s.length?e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),s.map(a=>e.jsxs(le,{to:`/paper/${a.arxiv_id||a.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Ie,{title:a.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:a.arxiv_id?`arXiv:${a.arxiv_id}`:"External resource"}),a.citation_count!=null&&e.jsxs("span",{children:[a.citation_count.toLocaleString()," cites"]})]})]},a.id))]}):null}const st=3,Rt=3;function Zr(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Wr({allHfArtifactUrls:t,citationCopied:s,citationDisplay:a,hfArtifactViewer:r,onCopyCitation:i,onEditHfArtifacts:d,onEditRepositories:o,paper:l,relatedIsLoading:c,relatedPapers:p,user:g}){var w;const[n,j]=h.useState(!1),y=[...l.repositories??[]].sort((b,L)=>Number(L.is_official)-Number(b.is_official)||(L.num_stars||0)-(b.num_stars||0)),_=(n?y:y.slice(0,st)).map(b=>({...b,safeHref:ce(b.url)}));return e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[y.length," repo",y.length===1?"":"s",e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})]}),_.filter(({safeHref:b})=>b).map(b=>e.jsxs("a",{href:b.safeHref??void 0,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(V,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[b.owner,"/",b.name]}),b.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",Zr(b.num_stars)]})]},b.id)),y.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),y.length>st&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>j(b=>!b),children:n?"− show top 3":`+ show ${y.length-st} more repos`})]}),e.jsx(Yr,{viewer:r,onEdit:d}),e.jsx(Jr,{githubUrls:y.map(({url:b})=>b),hfModelUrls:t.models,hfDatasetUrls:t.datasets,hfSpaceUrls:t.spaces,paperId:l.id,pdfName:((w=l.arxiv_id)==null?void 0:w.replace("/","-"))||l.id,pdfUrl:l.url_pdf,isSignedIn:!!g,suggestedBucketId:g?`${g.username}/${Vr(l.title)}`:void 0}),e.jsx(Xr,{isLoading:c,papers:p}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:i,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(V,{name:"copy",size:11}),s?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:a})]})]})}function Yr({onEdit:t,viewer:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]}),s.isLoading?e.jsx(_e,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(en,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]})}function en({count:t,href:s,isLimited:a,label:r,links:i}){const[d,o]=h.useState(!1),l=((i==null?void 0:i.length)??0)>Rt,c=d?i:i==null?void 0:i.slice(0,Rt),p=t!=null?`${t}${a?"+":""}`:"—";return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:r}),t?e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:p}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:p})]}),c!=null&&c.length?e.jsxs("div",{className:"hf-artifact-links",children:[c.map(g=>e.jsx("a",{href:g.href,target:"_blank",rel:"noopener noreferrer",children:g.label},g.href)),l&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":d,onClick:()=>o(g=>!g),children:d?"Show fewer":`View all ${i.length}`})]}):null]})}const Ft=360;function tn({canEdit:t,onEditMethods:s,onEditTasks:a,paper:r}){var p,g;const[i,d]=h.useState(!1),o=r.abstract||"",l=o.length>Ft,c=i||!l?o:`${o.slice(0,Ft)}…`;return e.jsxs(e.Fragment,{children:[r.tldr&&e.jsxs(e.Fragment,{children:[e.jsx(we,{id:"tldr",label:"TL;DR · AI-generated"}),e.jsx("div",{className:"tldr-box",children:r.tldr})]}),e.jsx(we,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Qs,{text:c})}),l&&e.jsx("button",{type:"button",className:"read-full",onClick:()=>d(n=>!n),children:i?"− collapse abstract":"+ read full abstract"}),e.jsx(we,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((p=r.tasks)==null?void 0:p.length)||0," tagged",t&&e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(r.tasks??[]).map(n=>e.jsx(qs,{slug:n.slug||"",label:n.name},n.id))}),e.jsx(we,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((g=r.methods)==null?void 0:g.length)||0," used",t&&e.jsx("button",{type:"button",onClick:s,className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(r.methods??[]).map(n=>e.jsx(Os,{method:n},n.id))})]})}const be=["my-bookmark-ids"],dt="pwc:pending-bookmark";function sn(t){window.sessionStorage.setItem(dt,JSON.stringify(t)),window.location.assign(ga(!0))}function an(){var r,i;const{user:t}=Le(),s=re({queryKey:be,queryFn:()=>nt.getBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),a=Ae.useMemo(()=>{var d;return new Set(((d=s.data)==null?void 0:d.paper_ids)??[])},[(r=s.data)==null?void 0:r.paper_ids]);return{ids:((i=s.data)==null?void 0:i.paper_ids)??[],idSet:a,isLoading:s.isLoading,isError:s.isError}}function rn(){const{user:t}=Le(),s=ue(),a=me({mutationFn:async({paperId:i,isBookmarked:d})=>{d?await nt.removeBookmark(i):await nt.addBookmark(i)},onMutate:async({paperId:i,isBookmarked:d})=>{await s.cancelQueries({queryKey:be});const o=s.getQueryData(be),l=typeof i=="string"?Number(i):i,c=(o==null?void 0:o.paper_ids)??[],p=d?c.filter(g=>g!==l):[l,...c.filter(g=>g!==l)];return s.setQueryData(be,{paper_ids:p}),{previous:o}},onError:(i,d,o)=>{o!=null&&o.previous&&s.setQueryData(be,o.previous),i instanceof rt&&i.code==="saved_papers_bucket_authorization_required"&&sn(d)},onSettled:()=>{s.invalidateQueries({queryKey:be}),s.invalidateQueries({queryKey:["my-bookmarks"]})}});return Ae.useEffect(()=>{if(!t||a.isPending)return;const i=new URL(window.location.href);if(i.searchParams.get(Pt)!=="1")return;i.searchParams.delete(Pt),window.history.replaceState({},"",`${i.pathname}${i.search}${i.hash}`);const d=window.sessionStorage.getItem(dt);if(d){window.sessionStorage.removeItem(dt);try{const o=JSON.parse(d);(typeof o.paperId=="number"||typeof o.paperId=="string")&&typeof o.isBookmarked=="boolean"&&a.mutate(o)}catch{}}},[a,t]),{toggle:Ae.useCallback((i,d)=>{if(!t){if(qt())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=Rs(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}a.mutate({paperId:i,isBookmarked:d})},[a,t]),isPending:a.isPending}}const nn=({paperId:t})=>{const{user:s}=Le(),{idSet:a}=an(),{toggle:r,isPending:i}=rn();if(qt())return null;const d=Number(t),o=!!s&&a.has(d),l=()=>{Number.isFinite(d)&&r(d,o)},c=s&&o?"Saved":"Save",p=s?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:l,disabled:i,"aria-pressed":o,"aria-label":p,title:p,children:[e.jsx(V,{name:"bookmark",size:12}),c]})};function at({children:t,showEdit:s=!1,onEdit:a,editAriaLabel:r}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:a,"aria-label":r,children:"edit"})]}):t}function on(t){return e.jsx(ss,{...t,kind:"enrich-paper",triggerClassName:"action-btn"})}const ln={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL"};function Tt(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Ut(t,s){try{const a=new URL(t),i=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return i?i.replace(/[-_]+/g," "):a.hostname.replace(/^www\./,"")}catch{return s}}const qn=()=>{const{arxivId:t}=Fs(),s=Bt(),{toast:a}=ie(),{user:r}=Le(),i=(r==null?void 0:r.is_admin)??!1,d=!!r,o=ba(r),{arxivId:l,evaluations:c,evaluationsByTask:p,evaluationsLoading:g,paper:n,paperError:j,paperLoading:y,presentation:_,refetchEvaluations:w,refetchPaper:b,relatedQuery:L,versions:A,visibleEvaluations:T}=Ta(t,o),[C,v]=h.useState(!1),{activeEditor:u,openEditor:f,setEditorOpen:N}=Da();h.useEffect(()=>{o!=="direct"||!(n!=null&&n.id)||(u&&u!=="results"&&J.primeCurationState(n.id).catch(()=>{}),u==="results"&&Re.primeCurationState(n.id).catch(()=>{}))},[u,o,n==null?void 0:n.id]);const[I,B]=h.useState(null),H=h.useRef(!1);h.useEffect(()=>{if(!r||!n||H.current)return;const k=sessionStorage.getItem("pwc:fresh-auth-edit");if(!k)return;H.current=!0;const q=Ba(k);if(!J.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),q&&f(q);return}if(!window.confirm("You signed in again. Apply the saved destructive catalog edit now? The server will recheck the current catalog version before changing anything.")){a({title:"Edit kept locally",description:"Nothing was changed. Reload this paper when you are ready to confirm the saved edit."});return}J.resumeFreshAuthMutation().then(()=>{a({title:"Edit applied",description:"The restored catalog edit was applied."}),window.location.reload()}).catch(Nt=>{a({variant:"destructive",title:"Could not apply the saved edit",description:Nt instanceof Error?Nt.message:"Please reload and review the edit again."})})},[f,n,a,r]);const G=h.useMemo(()=>{if(!r||!(n!=null&&n.author_links))return!1;const k=r.username.toLowerCase();return n.author_links.some(q=>!!q.hf_username&&q.hf_username.toLowerCase()===k)},[r,n==null?void 0:n.author_links]),K=k=>{if(!d){B(k);return}f(k)},[m,E]=h.useState("idle"),[$,F]=h.useState(null),[S,O]=h.useState(null),Z=async()=>{if(l){E("indexing"),F(null),O(null);try{await J.indexFromArxiv(l),a({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>b(),1200),E("idle")}catch(k){const q=k;let ye=q.message||"Failed to index paper";if(q.response)try{ye=JSON.parse(q.response).detail||ye}catch{ye=q.response}F(ye),(q.status===429||q.status===503)&&O("Try again later after arXiv has lifted the temporary limit."),E("idle")}}},x=(_==null?void 0:_.citationCopy)??"",P=(_==null?void 0:_.copyableRanks)??[],[R,U]=h.useState(!1),M=async()=>{if(x)try{await navigator.clipboard.writeText(x),U(!0),a({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>U(!1),1500)}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},Q=async()=>{if(!n)return;const k=n.arxiv_id||n.id,q=ja(k,P);if(q)try{await navigator.clipboard.writeText(q),a({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(y)return e.jsxs("div",{className:"page",children:[e.jsx(_e,{className:"h-12 w-3/4 mb-4"}),e.jsx(_e,{className:"h-6 w-1/3 mb-8"}),e.jsx(_e,{className:"h-64 w-full"})]});if(j||!n)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(le,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",l]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",l]})," in the database. You can index it from arXiv right now."]}),$&&e.jsx(ea,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(ta,{children:[e.jsx("div",{children:$}),S&&e.jsx("div",{className:"mt-2",children:S})]})}),e.jsxs("div",{className:"action-row",children:[i&&e.jsxs("button",{className:"action-btn",onClick:Z,disabled:m==="indexing",children:[e.jsx(V,{name:"sparkle",size:12}),m==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(D,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});if(!_)return null;const{allHfArtifactUrls:z,authorEntries:He,citationDisplay:xs,hasIntroducedItems:bs,hasLineageItems:vs,hfArtifactViewer:js,introducedBenchmarks:ys,introducedFrameworks:bt,introducedMethods:ws,introducedSummary:ks,numPages:vt,paperSourceLabel:jt,predecessorPapers:Me,projectPages:je,safeAbstractUrl:yt,safeConferenceUrl:wt,safePdfUrl:kt,sourceActionLabel:_s,successorPapers:ze}=_,Se=12,qe=wa(n,l),_t=C||He.length<=Se?He:He.slice(0,Se);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(le,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:jt})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsx("h1",{className:"detail-title",children:e.jsx(Ie,{title:n.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:jt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",Tt(n.published)]}),vt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[vt," pages"]})]}),n.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[n.citation_count.toLocaleString()," citations"]})]}),(n.proceeding||n.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),n.conference_slug?e.jsx("a",{href:`/conferences/${n.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(n.proceeding||n.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:n.proceeding.replace(/\s+\d{1,2}$/,"")})]}),A.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:n.version,onChange:k=>{const q=k.target.value;n.arxiv_id&&s(`/paper/${n.arxiv_id.replace(/v\d+$/,"")}${q?`?version=${q}`:""}`)},children:A.map(k=>e.jsxs("option",{value:k.version,children:[k.version," — ",Tt(k.published)]},k.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[_t.map((k,q)=>e.jsxs(Ae.Fragment,{children:[k.id?e.jsx(le,{to:`/authors/${k.id}`,children:k.name}):k.hf_username?e.jsx("a",{href:`https://huggingface.co/${k.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${k.hf_username} on Hugging Face`,children:k.name}):e.jsx("a",{children:k.name}),q<_t.length-1?", ":""]},q)),n.authors.length>Se&&e.jsx("button",{className:"show-more-authors",onClick:()=>v(k=>!k),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:C?"show fewer":`+${n.authors.length-Se} more`})]}),e.jsxs("div",{className:"action-row",children:[qe&&Ts()&&(!Us()||r!=null&&r.is_admin)?e.jsxs(le,{className:"action-btn",to:qe,onClick:()=>{const k=qe.slice(5);sessionStorage.removeItem(`pwc:reader:session:${k}`),sessionStorage.removeItem(`pwc:reader:assistant-collapsed:${k}`),sessionStorage.removeItem(`pwc:reader:page:${k}`)},children:[e.jsx(V,{name:"pdf",size:12})," Read paper",e.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:"New"})]}):kt?e.jsxs("a",{className:"action-btn",href:kt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"pdf",size:12})," View PDF"]}):null,yt&&e.jsx(at,{showEdit:n.source==="external",onEdit:()=>K("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:n.source==="external"?"action-btn-segment action-btn-main":"action-btn",href:yt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," ",_s]})}),je.length===1?e.jsx(at,{showEdit:!0,onEdit:()=>K("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:je[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}):null,je.length>1?e.jsx(at,{showEdit:!0,onEdit:()=>K("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(Bs,{children:[e.jsx(Ds,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}),e.jsx(Hs,{align:"start",className:"project-page-menu",children:je.map((k,q)=>e.jsx(Ms,{asChild:!0,children:k.safeHref?e.jsx("a",{href:k.safeHref,target:"_blank",rel:"noopener noreferrer",children:Ut(k.url,`Project page ${q+1}`)}):e.jsx("span",{children:Ut(k.url,`Project page ${q+1}`)})},k.url))})]})}):null,je.length===0&&d?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>K("project-pages"),title:"Add project page",children:[e.jsx(V,{name:"globe",size:12})," Add project page"]}):null,wt&&e.jsxs("a",{className:"action-btn",href:wt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Conference"]}),(n.organizations||[]).map(k=>e.jsxs(le,{to:`/orgs/${k.slug}`,className:"action-btn",title:k.name,"aria-label":k.name,children:[k.logo_url&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:16,width:16,borderRadius:3,overflow:"hidden"},children:e.jsx("img",{src:k.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:q=>{q.currentTarget.style.display="none"}})}),k.name]},k.id)),e.jsx("button",{type:"button",className:"action-btn",onClick:()=>K("organizations"),children:"Edit organizations"}),e.jsx(Xa,{paperId:Number(n.id),isAdmin:i}),i&&ha()&&e.jsx(on,{paperId:Number(n.id),paperTitle:n.title,onComplete:()=>void b()}),e.jsx(nn,{paperId:n.id})]}),n.leaderboard_ranks&&n.leaderboard_ranks.length>0&&e.jsx(Ks,{wrap:!0,paperHref:`/paper/${n.arxiv_id||n.id}`,ranks:n.leaderboard_ranks.filter(k=>k.best_rank>=1&&k.best_rank<=3).map(k=>({name:k.dataset_name,slug:k.dataset_slug||null,rank:k.best_rank}))})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Gs,{paperId:n.arxiv_id||n.id,title:n.title,thumbnailUrl:zs(n.thumbnail_url),priority:!0})})]}),bs&&e.jsxs("div",{className:`introduced-banner${bt.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[ws.map(k=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${k.slug||k.id}`),children:[k.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${k.id}`)),ys.map(k=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${k.slug||k.id}`),children:[k.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${k.id}`)),bt.map(k=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/frameworks#framework-${k.slug}`),children:[k.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${k.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",ks,"."]})]}),vs&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[ze.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:ze.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:ze.map(k=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${k.route_identifier}`),children:[e.jsx(Ie,{title:k.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${k.id}`))})]}),Me.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Me.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Me.map(k=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${k.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Ie,{title:k.title})]},`predecessor-${k.id}`))})]})]}),e.jsx(tn,{canEdit:!0,onEditMethods:()=>K("methods"),onEditTasks:()=>K("tasks"),paper:n}),e.jsx(Sr,{canCopyBadge:P.length>0,canEdit:!0,evaluationsByTask:p,evaluationsLoading:g,isAdmin:i,onCopyBadge:Q,onEdit:()=>K("results"),onRefresh:()=>void w(),paper:n,visibleEvaluationCount:(T==null?void 0:T.length)??0})]}),e.jsx(Wr,{allHfArtifactUrls:z,citationCopied:R,citationDisplay:xs,hfArtifactViewer:js,onCopyCitation:M,onEditHfArtifacts:()=>K("hf-artifacts"),onEditRepositories:()=>K("repositories"),paper:n,relatedIsLoading:L.isLoading,relatedPapers:L.data,user:r})]}),e.jsx(_r,{activeEditor:u,arxivId:l,editSubmitMode:o,evaluations:c??[],isAdmin:i,isLinkedAuthor:G,onOpenChange:N,paper:n}),e.jsx(ra,{open:I!==null,onOpenChange:k=>{k||B(null)},sectionLabel:I?ln[I]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})};export{qn as default}; diff --git a/assets/PaperPreviewLink-BVh6NMiG.js b/assets/PaperPreviewLink-Bi7j2lR1.js similarity index 98% rename from assets/PaperPreviewLink-BVh6NMiG.js rename to assets/PaperPreviewLink-Bi7j2lR1.js index 73b1dedcbc043ba47b73bf08af17d95903e92e1c..3daea176f534e3c4077db9bfca08aea859b357e4 100644 --- a/assets/PaperPreviewLink-BVh6NMiG.js +++ b/assets/PaperPreviewLink-Bi7j2lR1.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 z,h as ie,s as ae,c as oe,v as se,S as le}from"./index-1iwK_I9Y.js";import{k as L}from"./katex.min-BSBacQyE.js";import{j as f,z as T,N as ce,n as ue,L as he}from"./index-C7DzD1KZ.js";import{u as pe}from"./useQuery-C-S9qU90.js";import{H as me,a as fe,b as de}from"./hover-card-CD-KpVUV.js";import{p as ge}from"./papers-BNcOWLi8.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 z,h as ie,s as ae,c as oe,v as se,S as le}from"./index-CeWrpp9N.js";import{k as L}from"./katex.min-BSBacQyE.js";import{j as f,z as T,N as ce,n as ue,L as he}from"./index-DB5YVNrt.js";import{u as pe}from"./useQuery-gfOJVfRZ.js";import{H as me,a as fe,b as de}from"./hover-card-De01BraD.js";import{p as ge}from"./papers-CTasJek9.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/PaperReaderView-DhBihPaZ.js b/assets/PaperReaderView-CkWbXoez.js similarity index 91% rename from assets/PaperReaderView-DhBihPaZ.js rename to assets/PaperReaderView-CkWbXoez.js index 46c2543a61f8899adb6e6a2423b740a3425c73c4..e15afa5cd2b6b9a33dc1deebe49a9c660d69162f 100644 --- a/assets/PaperReaderView-DhBihPaZ.js +++ b/assets/PaperReaderView-CkWbXoez.js @@ -1 +1 @@ -import{u as ie,j as i,b as Ce,n as _e,N as je,r as s,O as Ie,L as B}from"./index-C7DzD1KZ.js";import{u as $e}from"./useQuery-C-S9qU90.js";import{A as ke,u as Ae,a as Ne,P as Ee}from"./ArtifactWorkspace-BYg5RxLy.js";import{b as Te}from"./usePapers-CHyBH3Xk.js";import{c as ze}from"./chat-CYCaJ4hM.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as Le}from"./ChatView-BoBPZNMN.js";import"./chatLaunch-CJaFcfv2.js";import"./chevron-down-BVSdU_Yo.js";import"./papers-BNcOWLi8.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CD-KpVUV.js";import"./github-CBv5TgZv.js";import"./github-BPMZ1b4l.js";import"./PaperPreviewLink-BVh6NMiG.js";import"./index-1iwK_I9Y.js";import"./file-text-BW4Xze_N.js";import"./useMutation-m57QFYBa.js";import"./external-link-DY1V39Iz.js";import"./useInfiniteQuery-DZ6ASWY6.js";import"./chatPrompts-CDY3UGU1.js";import"./openrouter-CeZ4KorQ.js";const oe=66,Me=240,O="pwc:reader:split-ratio",k=r=>`pwc:reader:session:${r}`,U=r=>`pwc:reader:assistant-collapsed:${r}`,ce=r=>`pwc:reader:page:${r}`;function q(r){const o=Number(sessionStorage.getItem(ce(r)));return Number.isInteger(o)&&o>0?o:1}function Fe(){const r=Number(localStorage.getItem(O));return Number.isFinite(r)&&r>=45&&r<=75?r:oe}function We(r){const o=D(r);if(!o)return null;const n=new URL(o);return(n.hostname==="arxiv.org"||n.hostname==="www.arxiv.org")&&n.pathname.startsWith("/pdf/")&&n.pathname.endsWith(".pdf")&&(n.pathname=n.pathname.slice(0,-4)),n.href}function He(r){return new URL(r).hostname.replace(/^www\./,"")}function Ke(r){if(!r)return{};const o={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=D(d.url);if(!t)continue;const b=new URL(t),A=b.pathname.split("/").filter(Boolean);if((b.hostname==="github.com"||b.hostname==="www.github.com")&&A.length>=2){o.repository={href:t,stars:d.num_stars||0};break}}const n=[...r.project_pages??[]].sort((d,t)=>Number(t.is_official)-Number(d.is_official));for(const d of n){const t=D(d.url);if(t){o.projectPage={href:t,label:He(t)};break}}const g=r.hf_artifact_summary?r.hf_artifact_summary.model_count+r.hf_artifact_summary.dataset_count+r.hf_artifact_summary.space_count:new Set([...r.hf_models??[],...r.hf_datasets??[],...r.hf_spaces??[]]).size;return g>0&&r.arxiv_id&&(o.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:g}),o}function Be(){var re,ae,se,ne;const r=Ce(),{paperId:o}=ie(),n=_e(o??"").replace(/v\d+$/i,""),g=Te(n,!!n),d=$e({queryKey:["chatAvailability"],queryFn:()=>ze.getAvailability(),refetchInterval:3e4,retry:!1}),t=g.data,b=(t==null?void 0:t.source)==="external"?je(`/paper-assets/external/${t.id}/paper.pdf`):We(t==null?void 0:t.url_pdf),A=Ke(t),f=((re=t==null?void 0:t.arxiv_id)==null?void 0:re.replace(/v\d+$/i,""))||n,le=s.useCallback(()=>r(`/paper/${f}`),[f,r]),[P,N]=s.useState(()=>sessionStorage.getItem(k(n))||void 0),[w,E]=s.useState(Fe),[p,V]=s.useState(()=>sessionStorage.getItem(U(n))==="1"),[m,y]=s.useState("paper"),[T,R]=s.useState(),[ue,v]=s.useState(""),[de,pe]=s.useState(()=>q(n)),[S,fe]=s.useState(0),[X,Q]=s.useState(!1),[me,z]=s.useState(!1),C=s.useRef(null),L=s.useRef(null),M=s.useRef(null),Y=s.useRef(null),_=s.useRef(!1),j=s.useRef(0),h=s.useRef(0),F=s.useRef(0),x=s.useRef(w),W=s.useRef(q(n)),H=s.useRef(t==null?void 0:t.version),G=Ae().reset,J=s.useRef(`${n}:${P??"new"}`),c=S>=840;s.useEffect(()=>{const e=`${n}:${P??"new"}`;J.current!==e&&(J.current=e,G())},[P,G,n]),s.useEffect(()=>{t!=null&&t.version&&H.current&&t.version!==H.current&&(R(void 0),v("")),H.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(j.current),z(!1);const e=sessionStorage.getItem(k(n));N(e||void 0),V(sessionStorage.getItem(U(n))==="1"),y("paper"),R(void 0),v("");const a=q(n);W.current=a,pe(a)},[n]),s.useEffect(()=>()=>{window.clearTimeout(j.current),cancelAnimationFrame(h.current)},[]),s.useLayoutEffect(()=>{const e=C.current;if(!e)return;const a=()=>fe(e.clientWidth);a();const l=new ResizeObserver(a);return l.observe(e),()=>l.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const a=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const l=e.content;e.content="noindex, nofollow";let u=document.querySelector('link[rel="canonical"]');const Pe=!u;u||(u=document.createElement("link"),u.rel="canonical",document.head.appendChild(u));const ye=u.href;return u.href=`${window.location.origin}/paper/${f}`,()=>{document.title="Papers With Code",a?e==null||e.remove():e&&(e.content=l),Pe?u==null||u.remove():u&&(u.href=ye)}},[f,t]);const I=s.useCallback(e=>{if(!S)return Math.max(45,Math.min(75,e));const a=480/S*100,l=100-360/S*100;return Math.max(a,Math.min(l,e))},[S]);s.useEffect(()=>E(e=>{const a=I(e);return x.current=a,a}),[I]);const $=e=>{const a=I(e);x.current=a,E(a),localStorage.setItem(O,String(a))},Z=e=>{var l;const a=I(e);x.current=a,L.current&&(L.current.style.width=`${a}%`),M.current&&(M.current.style.width=`${100-a}%`),(l=Y.current)==null||l.setAttribute("aria-valuenow",String(Math.round(a)))},ee=e=>{F.current=e,!h.current&&(h.current=requestAnimationFrame(()=>{var l;h.current=0;const a=(l=C.current)==null?void 0:l.getBoundingClientRect();a!=null&&a.width&&Z((F.current-a.left)/a.width*100)}))},he=e=>{_.current=!0,Q(!0),e.currentTarget.setPointerCapture(e.pointerId),ee(e.clientX)},K=()=>{var e;if(_.current){if(h.current){cancelAnimationFrame(h.current),h.current=0;const a=(e=C.current)==null?void 0:e.getBoundingClientRect();a!=null&&a.width&&Z((F.current-a.left)/a.width*100)}_.current=!1,E(x.current),localStorage.setItem(O,String(x.current)),Q(!1)}},te=e=>{window.clearTimeout(j.current),z(!0),V(e),sessionStorage.setItem(U(n),e?"1":"0"),j.current=window.setTimeout(()=>z(!1),Me+40)},ge=e=>{N(e),sessionStorage.setItem(k(n),e)},be=()=>{N(void 0),sessionStorage.removeItem(k(n)),R(void 0),v("")},ve=((ae=d.data)==null?void 0:ae.paper_reader_selection_enabled)===!0,we=e=>{R(e),v(`Selection from page ${e.page} added to chat`),c&&p&&te(!1)},Re=s.useCallback(e=>{R(e),e||v("")},[]),Se=Ie()&&((se=d.data)==null?void 0:se.paper_reader_chat_enabled)!==!1,xe=t&&Se?i.jsx(Le,{mode:"paper",routeSessionId:P,primaryPaper:{id:t.id,routeId:f,title:t.title},currentPage:()=>W.current,paperSelection:T,onPaperSelectionChange:Re,onSessionId:ge,onReaderSubmit:()=>y("assistant"),onReaderNewChat:be}):i.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return g.isLoading?i.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):g.error||!t?i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"Paper not found."}),i.jsx(B,{to:"/papers",children:"Browse papers"})]}):((ne=d.data)==null?void 0:ne.native_pdf_reader_enabled)===!1?i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"The native reader is currently unavailable."}),i.jsx(B,{to:`/paper/${f}`,children:"Back to paper"})]}):b?i.jsxs("div",{className:"paper-reader-shell",children:[!c&&i.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":m==="paper",onClick:()=>y("paper"),children:"Paper"}),i.jsxs("button",{type:"button",role:"tab","aria-selected":m==="assistant","aria-label":T&&m!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>y("assistant"),children:["Chat",T&&m!=="assistant"&&i.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),i.jsx(Ne,{variant:"reader",children:i.jsxs("div",{ref:C,className:`reader-workspace${c?" is-desktop":" is-tabs"}${p?" is-assistant-collapsed":""}${X?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[i.jsx("section",{ref:L,className:`reader-paper-pane${!c&&m!=="paper"?" is-hidden":""}`,style:c?{width:p?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!c&&m!=="paper",children:i.jsx(Ee,{url:b,paperKey:f,paperTitle:t.title,paperHref:`/paper/${f}`,onClose:le,resources:A,initialPage:de,resizeActive:X||me,selectionEnabled:ve,paperVersion:t.version,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:we,onPaperSelectionError:v,onPageChange:e=>{W.current=e,sessionStorage.setItem(ce(n),String(e))}})}),c&&!p&&i.jsx("div",{ref:Y,className:"reader-resize-handle",role:"separator","aria-label":"Resize paper and Chat panels","aria-orientation":"vertical","aria-valuemin":45,"aria-valuemax":75,"aria-valuenow":Math.round(w),tabIndex:0,onPointerDown:he,onPointerMove:e=>{_.current&&ee(e.clientX)},onPointerUp:K,onPointerCancel:K,onLostPointerCapture:K,onDoubleClick:()=>$(oe),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),$(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&$(45),e.key==="End"&&$(75)}}),i.jsx("aside",{ref:M,id:"reader-chat-panel",className:`reader-assistant-pane${!c&&m!=="assistant"?" is-hidden":""}${c&&p?" is-collapsed":""}`,style:c?{width:p?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!c&&m!=="assistant"||p,children:xe}),i.jsx("div",{className:"sr-only","aria-live":"polite",children:ue}),c&&i.jsx("button",{type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!p,onClick:()=>te(!p),children:p?"Open chat":"Hide chat"})]})})]}):i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"Native reading is unavailable for this resource."}),i.jsx(B,{to:`/paper/${f}`,children:"Back to paper"})]})}function pt(){const{paperId:r=""}=ie();return i.jsx(ke,{workspaceKey:`reader:${r}`,children:i.jsx(Be,{})})}export{pt as default,Ke as readerToolbarResources}; +import{u as ie,j as i,b as Ce,n as _e,N as je,r as s,O as Ie,L as B}from"./index-DB5YVNrt.js";import{u as $e}from"./useQuery-gfOJVfRZ.js";import{A as ke,u as Ae,a as Ne,P as Ee}from"./ArtifactWorkspace-DGDexY_Q.js";import{b as Te}from"./usePapers-CT5co6TZ.js";import{c as ze}from"./chat-C792FSN8.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as Le}from"./ChatView-BSLUlS0a.js";import"./chatLaunch-DPlGkVok.js";import"./chevron-down-CLKJ3Wue.js";import"./papers-CTasJek9.js";import"./katex.min-BSBacQyE.js";import"./hover-card-De01BraD.js";import"./github-nBYzmzBK.js";import"./github-CYSQLKIg.js";import"./PaperPreviewLink-Bi7j2lR1.js";import"./index-CeWrpp9N.js";import"./file-text-Dqp9ANqN.js";import"./useMutation-Bi00GAL7.js";import"./external-link-CwxK3W8X.js";import"./useInfiniteQuery-CqugEgpc.js";import"./chatPrompts-CDY3UGU1.js";import"./openrouter-DZnDVTdj.js";const oe=66,Me=240,O="pwc:reader:split-ratio",k=r=>`pwc:reader:session:${r}`,U=r=>`pwc:reader:assistant-collapsed:${r}`,ce=r=>`pwc:reader:page:${r}`;function q(r){const o=Number(sessionStorage.getItem(ce(r)));return Number.isInteger(o)&&o>0?o:1}function Fe(){const r=Number(localStorage.getItem(O));return Number.isFinite(r)&&r>=45&&r<=75?r:oe}function We(r){const o=D(r);if(!o)return null;const n=new URL(o);return(n.hostname==="arxiv.org"||n.hostname==="www.arxiv.org")&&n.pathname.startsWith("/pdf/")&&n.pathname.endsWith(".pdf")&&(n.pathname=n.pathname.slice(0,-4)),n.href}function He(r){return new URL(r).hostname.replace(/^www\./,"")}function Ke(r){if(!r)return{};const o={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=D(d.url);if(!t)continue;const b=new URL(t),A=b.pathname.split("/").filter(Boolean);if((b.hostname==="github.com"||b.hostname==="www.github.com")&&A.length>=2){o.repository={href:t,stars:d.num_stars||0};break}}const n=[...r.project_pages??[]].sort((d,t)=>Number(t.is_official)-Number(d.is_official));for(const d of n){const t=D(d.url);if(t){o.projectPage={href:t,label:He(t)};break}}const g=r.hf_artifact_summary?r.hf_artifact_summary.model_count+r.hf_artifact_summary.dataset_count+r.hf_artifact_summary.space_count:new Set([...r.hf_models??[],...r.hf_datasets??[],...r.hf_spaces??[]]).size;return g>0&&r.arxiv_id&&(o.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:g}),o}function Be(){var re,ae,se,ne;const r=Ce(),{paperId:o}=ie(),n=_e(o??"").replace(/v\d+$/i,""),g=Te(n,!!n),d=$e({queryKey:["chatAvailability"],queryFn:()=>ze.getAvailability(),refetchInterval:3e4,retry:!1}),t=g.data,b=(t==null?void 0:t.source)==="external"?je(`/paper-assets/external/${t.id}/paper.pdf`):We(t==null?void 0:t.url_pdf),A=Ke(t),f=((re=t==null?void 0:t.arxiv_id)==null?void 0:re.replace(/v\d+$/i,""))||n,le=s.useCallback(()=>r(`/paper/${f}`),[f,r]),[P,N]=s.useState(()=>sessionStorage.getItem(k(n))||void 0),[w,E]=s.useState(Fe),[p,V]=s.useState(()=>sessionStorage.getItem(U(n))==="1"),[m,y]=s.useState("paper"),[T,R]=s.useState(),[ue,v]=s.useState(""),[de,pe]=s.useState(()=>q(n)),[S,fe]=s.useState(0),[X,Q]=s.useState(!1),[me,z]=s.useState(!1),C=s.useRef(null),L=s.useRef(null),M=s.useRef(null),Y=s.useRef(null),_=s.useRef(!1),j=s.useRef(0),h=s.useRef(0),F=s.useRef(0),x=s.useRef(w),W=s.useRef(q(n)),H=s.useRef(t==null?void 0:t.version),G=Ae().reset,J=s.useRef(`${n}:${P??"new"}`),c=S>=840;s.useEffect(()=>{const e=`${n}:${P??"new"}`;J.current!==e&&(J.current=e,G())},[P,G,n]),s.useEffect(()=>{t!=null&&t.version&&H.current&&t.version!==H.current&&(R(void 0),v("")),H.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(j.current),z(!1);const e=sessionStorage.getItem(k(n));N(e||void 0),V(sessionStorage.getItem(U(n))==="1"),y("paper"),R(void 0),v("");const a=q(n);W.current=a,pe(a)},[n]),s.useEffect(()=>()=>{window.clearTimeout(j.current),cancelAnimationFrame(h.current)},[]),s.useLayoutEffect(()=>{const e=C.current;if(!e)return;const a=()=>fe(e.clientWidth);a();const l=new ResizeObserver(a);return l.observe(e),()=>l.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const a=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const l=e.content;e.content="noindex, nofollow";let u=document.querySelector('link[rel="canonical"]');const Pe=!u;u||(u=document.createElement("link"),u.rel="canonical",document.head.appendChild(u));const ye=u.href;return u.href=`${window.location.origin}/paper/${f}`,()=>{document.title="Papers With Code",a?e==null||e.remove():e&&(e.content=l),Pe?u==null||u.remove():u&&(u.href=ye)}},[f,t]);const I=s.useCallback(e=>{if(!S)return Math.max(45,Math.min(75,e));const a=480/S*100,l=100-360/S*100;return Math.max(a,Math.min(l,e))},[S]);s.useEffect(()=>E(e=>{const a=I(e);return x.current=a,a}),[I]);const $=e=>{const a=I(e);x.current=a,E(a),localStorage.setItem(O,String(a))},Z=e=>{var l;const a=I(e);x.current=a,L.current&&(L.current.style.width=`${a}%`),M.current&&(M.current.style.width=`${100-a}%`),(l=Y.current)==null||l.setAttribute("aria-valuenow",String(Math.round(a)))},ee=e=>{F.current=e,!h.current&&(h.current=requestAnimationFrame(()=>{var l;h.current=0;const a=(l=C.current)==null?void 0:l.getBoundingClientRect();a!=null&&a.width&&Z((F.current-a.left)/a.width*100)}))},he=e=>{_.current=!0,Q(!0),e.currentTarget.setPointerCapture(e.pointerId),ee(e.clientX)},K=()=>{var e;if(_.current){if(h.current){cancelAnimationFrame(h.current),h.current=0;const a=(e=C.current)==null?void 0:e.getBoundingClientRect();a!=null&&a.width&&Z((F.current-a.left)/a.width*100)}_.current=!1,E(x.current),localStorage.setItem(O,String(x.current)),Q(!1)}},te=e=>{window.clearTimeout(j.current),z(!0),V(e),sessionStorage.setItem(U(n),e?"1":"0"),j.current=window.setTimeout(()=>z(!1),Me+40)},ge=e=>{N(e),sessionStorage.setItem(k(n),e)},be=()=>{N(void 0),sessionStorage.removeItem(k(n)),R(void 0),v("")},ve=((ae=d.data)==null?void 0:ae.paper_reader_selection_enabled)===!0,we=e=>{R(e),v(`Selection from page ${e.page} added to chat`),c&&p&&te(!1)},Re=s.useCallback(e=>{R(e),e||v("")},[]),Se=Ie()&&((se=d.data)==null?void 0:se.paper_reader_chat_enabled)!==!1,xe=t&&Se?i.jsx(Le,{mode:"paper",routeSessionId:P,primaryPaper:{id:t.id,routeId:f,title:t.title},currentPage:()=>W.current,paperSelection:T,onPaperSelectionChange:Re,onSessionId:ge,onReaderSubmit:()=>y("assistant"),onReaderNewChat:be}):i.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return g.isLoading?i.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):g.error||!t?i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"Paper not found."}),i.jsx(B,{to:"/papers",children:"Browse papers"})]}):((ne=d.data)==null?void 0:ne.native_pdf_reader_enabled)===!1?i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"The native reader is currently unavailable."}),i.jsx(B,{to:`/paper/${f}`,children:"Back to paper"})]}):b?i.jsxs("div",{className:"paper-reader-shell",children:[!c&&i.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":m==="paper",onClick:()=>y("paper"),children:"Paper"}),i.jsxs("button",{type:"button",role:"tab","aria-selected":m==="assistant","aria-label":T&&m!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>y("assistant"),children:["Chat",T&&m!=="assistant"&&i.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),i.jsx(Ne,{variant:"reader",children:i.jsxs("div",{ref:C,className:`reader-workspace${c?" is-desktop":" is-tabs"}${p?" is-assistant-collapsed":""}${X?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[i.jsx("section",{ref:L,className:`reader-paper-pane${!c&&m!=="paper"?" is-hidden":""}`,style:c?{width:p?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!c&&m!=="paper",children:i.jsx(Ee,{url:b,paperKey:f,paperTitle:t.title,paperHref:`/paper/${f}`,onClose:le,resources:A,initialPage:de,resizeActive:X||me,selectionEnabled:ve,paperVersion:t.version,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:we,onPaperSelectionError:v,onPageChange:e=>{W.current=e,sessionStorage.setItem(ce(n),String(e))}})}),c&&!p&&i.jsx("div",{ref:Y,className:"reader-resize-handle",role:"separator","aria-label":"Resize paper and Chat panels","aria-orientation":"vertical","aria-valuemin":45,"aria-valuemax":75,"aria-valuenow":Math.round(w),tabIndex:0,onPointerDown:he,onPointerMove:e=>{_.current&&ee(e.clientX)},onPointerUp:K,onPointerCancel:K,onLostPointerCapture:K,onDoubleClick:()=>$(oe),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),$(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&$(45),e.key==="End"&&$(75)}}),i.jsx("aside",{ref:M,id:"reader-chat-panel",className:`reader-assistant-pane${!c&&m!=="assistant"?" is-hidden":""}${c&&p?" is-collapsed":""}`,style:c?{width:p?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!c&&m!=="assistant"||p,children:xe}),i.jsx("div",{className:"sr-only","aria-live":"polite",children:ue}),c&&i.jsx("button",{type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!p,onClick:()=>te(!p),children:p?"Open chat":"Hide chat"})]})})]}):i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"Native reading is unavailable for this resource."}),i.jsx(B,{to:`/paper/${f}`,children:"Back to paper"})]})}function pt(){const{paperId:r=""}=ie();return i.jsx(ke,{workspaceKey:`reader:${r}`,children:i.jsx(Be,{})})}export{pt as default,Ke as readerToolbarResources}; diff --git a/assets/PapersListView-BzkXSjia.js b/assets/PapersListView-Dr9p0OKb.js similarity index 91% rename from assets/PapersListView-BzkXSjia.js rename to assets/PapersListView-Dr9p0OKb.js index 9a9b91edf77047ad69b1121fe79cd17cc0c0b097..8e8b27e8c27c3001fd34ab56074a2e1e52e0409d 100644 --- a/assets/PapersListView-BzkXSjia.js +++ b/assets/PapersListView-Dr9p0OKb.js @@ -1 +1 @@ -import{c as X,r as x,A as J,j as e,L as j,i as W}from"./index-C7DzD1KZ.js";import{I as U,T as Y,P as Z}from"./components-BV3lUGf1.js";import{c as ee}from"./catalog-DU92Rh6k.js";import{t as se,d as ae}from"./transform-Dk33Ziw-.js";import{u as re,a as te}from"./usePapers-CHyBH3Xk.js";import{u as ne}from"./useDebounce-PKwJyb-p.js";import{b as ie,u as oe,a as ce,c as le,P as de}from"./useIntersectionObserver-CSNffbhV.js";import{S as _}from"./skeleton-BBQyes8J.js";import{A as me,a as he}from"./alert-D1jsfsn6.js";import{u as pe}from"./useQuery-C-S9qU90.js";import"./LatexTitle-DuT2lumP.js";import"./katex.min-BSBacQyE.js";import"./papers-BNcOWLi8.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-DZ6ASWY6.js";import"./popover-CQWB7HGQ.js";const v=360;function ue(a,o){const m=a.toLocaleLowerCase();return o.trim().split(/\s+/).filter(Boolean).reduce((c,t)=>{const l=m.indexOf(t.toLocaleLowerCase());return l>=0&&(c<0||l=0?t+1:o}function fe(a,o){if(a.length<=v)return a;const m=ue(a,o);if(m<0||m0?"…":""}${a.slice(c,t).trim()}${tnew Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),$e=()=>{var I,$,T,O,B,H,M,q,G;const[a,o]=X(),m=a.get("framework")||void 0,c=a.get("repository")||void 0,t=!!(m||c),l=a.get("search")||"",[F,C]=x.useState(l),p=ne(F,300),n=!t&&l.trim().length>0;x.useEffect(()=>C(l),[l]),x.useEffect(()=>{if(p===l)return;const s=new URLSearchParams(a);p?s.set("search",p):s.delete("search"),o(s,{replace:!0})},[p]),x.useEffect(()=>{const s=a.get("order_by"),i=new URLSearchParams(a);n&&!["relevance","date_published","citation_count"].includes(s||"")?(i.set("order_by","relevance"),o(i,{replace:!0})):!n&&s==="relevance"&&(i.delete("order_by"),o(i,{replace:!0}))},[n,a,o]);const L=a.get("order_by"),g=L==="citation_count"?"cited":L==="date_published"?"new":n?"relevance":"trending",u=ie(a),w=a.get("has_hf_artifacts")==="true",k=!t&&a.get("has_code")==="true",y=(s,i)=>{const h=new URLSearchParams(a);i?h.set(s,i):h.delete(s),o(h)},Q=s=>{y("order_by",s==="cited"?"citation_count":s==="new"?"date_published":s)},b=re({page_size:20,order_by:g==="trending"?"trending":g==="cited"?"citation_count":"date_published",order_dir:"desc",search:t&&p||void 0,start_date:u.startDate,end_date:u.endDate,include_resources:!0,conference:a.get("conference")||void 0,latest_only:a.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:m,repository:c,enabled:!n}),R=te({q:p.trim(),order_by:g==="cited"?"citation_count":g==="new"?"date_published":"relevance",start_date:u.startDate,end_date:u.endDate,has_code:k,has_hf_artifacts:w,enabled:n}),d=n?R:b,A=pe({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),enabled:!t&&!n,staleTime:10*60*1e3}),N=x.useMemo(()=>{var i;return(((i=d.data)==null?void 0:i.pages.flatMap(h=>h.results))||[]).map(h=>{const S=se(h);return n?{...S,abstract:fe(S.abstract,l)}:S})},[d.data,n,l]),{targetRef:K,isIntersecting:D}=oe({rootMargin:"200px"});x.useEffect(()=>{D&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[D,d.hasNextPage,d.isFetchingNextPage]);const f=((T=($=(I=b.data)==null?void 0:I.pages)==null?void 0:$[0])==null?void 0:T.count)??0,r=(H=(B=(O=b.data)==null?void 0:O.pages)==null?void 0:B[0])==null?void 0:H.scope,P=(q=(M=R.data)==null?void 0:M.pages)==null?void 0:q.at(-1),E=m&&d.error instanceof J&&d.error.status===404,V=(r==null?void 0:r.kind)==="framework"?r.framework_name:r==null?void 0:r.repository;return e.jsxs("div",{className:"page",children:[(r==null?void 0:r.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(j,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(j,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:r.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:t?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:V||m||c})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",l,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:t?(r==null?void 0:r.kind)==="framework"?f>0&&`${f.toLocaleString()} papers.`:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",f>0&&`${f.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${N.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",f>0&&`${f.toLocaleString()} papers indexed.`]})}),t&&r&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:r.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(U,{name:"github",size:13}),r.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r.repository||"GitHub"}),r.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",je(r.num_stars)]})]}):"GitHub"]}),r.kind==="framework"&&r.introducing_paper_arxiv_id&&e.jsx(j,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),r.kind==="framework"&&r.recommended_tasks&&r.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:r.recommended_tasks.map(s=>s.slug?e.jsx(Y,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx(ce,{startDate:u.startDate,endDate:u.endDate,onChange:s=>o(le(a,s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(U,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:F,onChange:s=>C(s.target.value)})]})}),e.jsxs("div",{className:t||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!t&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(_,{className:"h-5 w-full"},i))}),(G=A.data)==null?void 0:G.map(s=>e.jsxs(j,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ae(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:(n?ge:xe).map(([s,i])=>e.jsx("button",{className:`sort-btn ${g===s?"active":""}`,onClick:()=>Q(s),children:i},s))}),e.jsx(de,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>y("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>y("has_hf_artifacts",s?"true":void 0),showHasCode:!t})]}),e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})]}),E?e.jsx("div",{className:"no-results",children:"Framework not found."}):d.error&&e.jsx(me,{variant:"destructive",className:"mb-4",children:e.jsx(he,{children:"Failed to load papers. Please try again."})}),!E&&(d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(_,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},i))}):N.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("p",{children:"No matching papers."}),n&&W()&&e.jsx(j,{to:`/chat?q=${encodeURIComponent(l.trim())}`,children:"Ask the assistant instead"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,i)=>e.jsx(Z,{paper:s,rank:i+1,highlightQuery:n?l:void 0},s.id))}),e.jsx("div",{ref:K,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),!d.hasNextPage&&!d.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:P!=null&&P.cap_reached?"End of the top 100 results":"End of results"})]}))]})]})]})};export{$e as default}; +import{c as X,r as x,A as J,j as e,L as j,i as W}from"./index-DB5YVNrt.js";import{I as U,T as Y,P as Z}from"./components--1z4Qw5F.js";import{c as ee}from"./catalog-HFAZrKSg.js";import{t as se,d as ae}from"./transform-CnBvOSlq.js";import{u as re,a as te}from"./usePapers-CT5co6TZ.js";import{u as ne}from"./useDebounce-CbVfyok_.js";import{b as ie,u as oe,a as ce,c as le,P as de}from"./useIntersectionObserver-CmsvWF1K.js";import{S as _}from"./skeleton-jY-za2d8.js";import{A as me,a as he}from"./alert-BPNeeF4s.js";import{u as pe}from"./useQuery-gfOJVfRZ.js";import"./LatexTitle-DcOGOHZH.js";import"./katex.min-BSBacQyE.js";import"./papers-CTasJek9.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-CqugEgpc.js";import"./popover-BqJw3haa.js";const v=360;function ue(a,o){const m=a.toLocaleLowerCase();return o.trim().split(/\s+/).filter(Boolean).reduce((c,t)=>{const l=m.indexOf(t.toLocaleLowerCase());return l>=0&&(c<0||l=0?t+1:o}function fe(a,o){if(a.length<=v)return a;const m=ue(a,o);if(m<0||m0?"…":""}${a.slice(c,t).trim()}${tnew Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),$e=()=>{var I,$,T,O,B,H,M,q,G;const[a,o]=X(),m=a.get("framework")||void 0,c=a.get("repository")||void 0,t=!!(m||c),l=a.get("search")||"",[F,C]=x.useState(l),p=ne(F,300),n=!t&&l.trim().length>0;x.useEffect(()=>C(l),[l]),x.useEffect(()=>{if(p===l)return;const s=new URLSearchParams(a);p?s.set("search",p):s.delete("search"),o(s,{replace:!0})},[p]),x.useEffect(()=>{const s=a.get("order_by"),i=new URLSearchParams(a);n&&!["relevance","date_published","citation_count"].includes(s||"")?(i.set("order_by","relevance"),o(i,{replace:!0})):!n&&s==="relevance"&&(i.delete("order_by"),o(i,{replace:!0}))},[n,a,o]);const L=a.get("order_by"),g=L==="citation_count"?"cited":L==="date_published"?"new":n?"relevance":"trending",u=ie(a),w=a.get("has_hf_artifacts")==="true",k=!t&&a.get("has_code")==="true",y=(s,i)=>{const h=new URLSearchParams(a);i?h.set(s,i):h.delete(s),o(h)},Q=s=>{y("order_by",s==="cited"?"citation_count":s==="new"?"date_published":s)},b=re({page_size:20,order_by:g==="trending"?"trending":g==="cited"?"citation_count":"date_published",order_dir:"desc",search:t&&p||void 0,start_date:u.startDate,end_date:u.endDate,include_resources:!0,conference:a.get("conference")||void 0,latest_only:a.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:m,repository:c,enabled:!n}),R=te({q:p.trim(),order_by:g==="cited"?"citation_count":g==="new"?"date_published":"relevance",start_date:u.startDate,end_date:u.endDate,has_code:k,has_hf_artifacts:w,enabled:n}),d=n?R:b,A=pe({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),enabled:!t&&!n,staleTime:10*60*1e3}),N=x.useMemo(()=>{var i;return(((i=d.data)==null?void 0:i.pages.flatMap(h=>h.results))||[]).map(h=>{const S=se(h);return n?{...S,abstract:fe(S.abstract,l)}:S})},[d.data,n,l]),{targetRef:K,isIntersecting:D}=oe({rootMargin:"200px"});x.useEffect(()=>{D&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[D,d.hasNextPage,d.isFetchingNextPage]);const f=((T=($=(I=b.data)==null?void 0:I.pages)==null?void 0:$[0])==null?void 0:T.count)??0,r=(H=(B=(O=b.data)==null?void 0:O.pages)==null?void 0:B[0])==null?void 0:H.scope,P=(q=(M=R.data)==null?void 0:M.pages)==null?void 0:q.at(-1),E=m&&d.error instanceof J&&d.error.status===404,V=(r==null?void 0:r.kind)==="framework"?r.framework_name:r==null?void 0:r.repository;return e.jsxs("div",{className:"page",children:[(r==null?void 0:r.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(j,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(j,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:r.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:t?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:V||m||c})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",l,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:t?(r==null?void 0:r.kind)==="framework"?f>0&&`${f.toLocaleString()} papers.`:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",f>0&&`${f.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${N.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",f>0&&`${f.toLocaleString()} papers indexed.`]})}),t&&r&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:r.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(U,{name:"github",size:13}),r.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r.repository||"GitHub"}),r.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",je(r.num_stars)]})]}):"GitHub"]}),r.kind==="framework"&&r.introducing_paper_arxiv_id&&e.jsx(j,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),r.kind==="framework"&&r.recommended_tasks&&r.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:r.recommended_tasks.map(s=>s.slug?e.jsx(Y,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx(ce,{startDate:u.startDate,endDate:u.endDate,onChange:s=>o(le(a,s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(U,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:F,onChange:s=>C(s.target.value)})]})}),e.jsxs("div",{className:t||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!t&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(_,{className:"h-5 w-full"},i))}),(G=A.data)==null?void 0:G.map(s=>e.jsxs(j,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ae(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:(n?ge:xe).map(([s,i])=>e.jsx("button",{className:`sort-btn ${g===s?"active":""}`,onClick:()=>Q(s),children:i},s))}),e.jsx(de,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>y("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>y("has_hf_artifacts",s?"true":void 0),showHasCode:!t})]}),e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})]}),E?e.jsx("div",{className:"no-results",children:"Framework not found."}):d.error&&e.jsx(me,{variant:"destructive",className:"mb-4",children:e.jsx(he,{children:"Failed to load papers. Please try again."})}),!E&&(d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(_,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},i))}):N.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("p",{children:"No matching papers."}),n&&W()&&e.jsx(j,{to:`/chat?q=${encodeURIComponent(l.trim())}`,children:"Ask the assistant instead"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,i)=>e.jsx(Z,{paper:s,rank:i+1,highlightQuery:n?l:void 0},s.id))}),e.jsx("div",{ref:K,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),!d.hasNextPage&&!d.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:P!=null&&P.cap_reached?"End of the top 100 results":"End of results"})]}))]})]})]})};export{$e as default}; diff --git a/assets/PrivacyView-FlPj-oYG.js b/assets/PrivacyView-CJulinZK.js similarity index 99% rename from assets/PrivacyView-FlPj-oYG.js rename to assets/PrivacyView-CJulinZK.js index ef2727b830e251928ae918d7c5edd5add2e1d03d..9e3063da8a7af69ae94b18aa30137a2cb3c15f68 100644 --- a/assets/PrivacyView-FlPj-oYG.js +++ b/assets/PrivacyView-CJulinZK.js @@ -1 +1 @@ -import{z as s,j as e}from"./index-C7DzD1KZ.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{z as s,j as e}from"./index-DB5YVNrt.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-5vz6Q6uj.js b/assets/RateLimitsView-Dnm4htYe.js similarity index 87% rename from assets/RateLimitsView-5vz6Q6uj.js rename to assets/RateLimitsView-Dnm4htYe.js index 5840fd13360cf3b56ae82bc5e0817d457e4b8719..9bd6a0c9d421d5854991fd5269c7cfc20ba94aec 100644 --- a/assets/RateLimitsView-5vz6Q6uj.js +++ b/assets/RateLimitsView-Dnm4htYe.js @@ -1 +1 @@ -import{j as e,B as t}from"./index-C7DzD1KZ.js";import{u as s}from"./useQuery-C-S9qU90.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default}; +import{j as e,B as t}from"./index-DB5YVNrt.js";import{u as s}from"./useQuery-gfOJVfRZ.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default}; diff --git a/assets/SavedPapersView-CjwpavHL.js b/assets/SavedPapersView-DlTA25Xb.js similarity index 89% rename from assets/SavedPapersView-CjwpavHL.js rename to assets/SavedPapersView-DlTA25Xb.js index 6b813ef806940b7d6087477572a0d3d7136c6715..cd3c14be8a5fe8ad485d511e3deb418af85314e2 100644 --- a/assets/SavedPapersView-CjwpavHL.js +++ b/assets/SavedPapersView-DlTA25Xb.js @@ -1 +1 @@ -import{a as h,A as g,j as e,H as v,L as x,B as j}from"./index-C7DzD1KZ.js";import{u as N}from"./useQuery-C-S9qU90.js";import{T as b,P as f}from"./components-BV3lUGf1.js";import{S as r}from"./skeleton-BBQyes8J.js";import{A as k,a as y}from"./alert-D1jsfsn6.js";import{t as w}from"./transform-Dk33Ziw-.js";import{s as A}from"./savedPapersAuth-Da0dU9fE.js";import"./LatexTitle-DuT2lumP.js";import"./katex.min-BSBacQyE.js";import"./papers-BNcOWLi8.js";import"./safeExternalHref-CkBrsh84.js";const z=()=>{var d,o;const{user:t,isLoading:u}=h(),a=N({queryKey:["my-bookmarks"],queryFn:()=>j.getBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{z as default}; +import{a as h,A as g,j as e,H as v,L as x,B as j}from"./index-DB5YVNrt.js";import{u as N}from"./useQuery-gfOJVfRZ.js";import{T as b,P as f}from"./components--1z4Qw5F.js";import{S as r}from"./skeleton-jY-za2d8.js";import{A as k,a as y}from"./alert-BPNeeF4s.js";import{t as w}from"./transform-CnBvOSlq.js";import{s as A}from"./savedPapersAuth-Ca15fo9W.js";import"./LatexTitle-DcOGOHZH.js";import"./katex.min-BSBacQyE.js";import"./papers-CTasJek9.js";import"./safeExternalHref-CkBrsh84.js";const z=()=>{var d,o;const{user:t,isLoading:u}=h(),a=N({queryKey:["my-bookmarks"],queryFn:()=>j.getBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{z as default}; diff --git a/assets/SearchOverlay-DXqc280z.js b/assets/SearchOverlay-HhaSArDa.js similarity index 92% rename from assets/SearchOverlay-DXqc280z.js rename to assets/SearchOverlay-HhaSArDa.js index f3f3a28c5064a1d24895c58a2fc17d3d23b95575..456c9e7ffb064602b31f62cfe4069df569171e96 100644 --- a/assets/SearchOverlay-DXqc280z.js +++ b/assets/SearchOverlay-HhaSArDa.js @@ -1 +1 @@ -import{r as E,b as P,z as Q,i as $,j as e}from"./index-C7DzD1KZ.js";import{u as m}from"./useQuery-C-S9qU90.js";import{L as A}from"./LatexTitle-DuT2lumP.js";import{c as x}from"./catalog-DU92Rh6k.js";import{p as K}from"./papers-BNcOWLi8.js";import{u as L}from"./useDebounce-PKwJyb-p.js";import{c as S,h as D,d as z}from"./transform-Dk33Ziw-.js";import"./katex.min-BSBacQyE.js";const I=10,Z=({open:t,onClose:l})=>{var b,_,F,q;const j=E.useRef(null),w=P(),[n,C]=Q.useState(""),a=L(n,200),u=n.trim(),p=$();E.useEffect(()=>{var r;if(!t)return;(r=j.current)==null||r.focus();const s=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),l())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,l]);const y=m({queryKey:["search-papers",a],queryFn:()=>K.search(a,1,I),enabled:t&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>x.listTasks({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),v=m({queryKey:["search-methods",a],queryFn:()=>x.listMethods({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>x.listDatasets({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4});if(!t)return null;const i=((b=k.data)==null?void 0:b.results)||[],h=((_=v.data)==null?void 0:_.results)||[],o=((F=N.data)==null?void 0:F.results)||[],d=((q=y.data)==null?void 0:q.results)||[],T=y.isFetching||k.isFetching||v.isFetching||N.isFetching,R=i.length||d.length||h.length||o.length,c=s=>{l(),w(s)},f=()=>{const s=n.trim();s&&c(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:l,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:j,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:n,onChange:s=>C(s.target.value),onKeyDown:s=>{p&&s.key==="Enter"&&(s.preventDefault(),f())}}),e.jsxs("div",{className:"search-results",children:[p&&n.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:f,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",n.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",p&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!T&&!R&&e.jsxs("div",{className:"search-empty",children:['No matches for "',n,'"']}),i.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",i.length]}),i.map(s=>{const r=S(D(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>c(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),e.jsx("span",{className:"name",children:z(s.name,s.slug)}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id)})]}),h.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Methods · ",h.length]}),h.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>c(`/methods/${s.slug||s.id}`),children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:s.name}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",o.length]}),o.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>c(`/benchmark/${s.slug||s.id}`),children:[e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," entries"]})]},s.id))]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",d.length]}),d.map(s=>{var r;return e.jsxs("div",{className:"search-result",onClick:()=>c(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(A,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((r=s.authors)==null?void 0:r[0])&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.authors[0],s.authors.length>1?" et al.":""]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["↑ ",s.citation_count.toLocaleString()]})]})]})]},s.id)})]}),u.length>=2&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>c(`/papers?search=${encodeURIComponent(u)}`),children:["View all paper results for “",u,"”"]})]})]})})};export{Z as default}; +import{r as E,b as P,z as Q,i as $,j as e}from"./index-DB5YVNrt.js";import{u as m}from"./useQuery-gfOJVfRZ.js";import{L as A}from"./LatexTitle-DcOGOHZH.js";import{c as x}from"./catalog-HFAZrKSg.js";import{p as K}from"./papers-CTasJek9.js";import{u as L}from"./useDebounce-CbVfyok_.js";import{c as S,h as D,d as z}from"./transform-CnBvOSlq.js";import"./katex.min-BSBacQyE.js";const I=10,Z=({open:t,onClose:l})=>{var b,_,F,q;const j=E.useRef(null),w=P(),[n,C]=Q.useState(""),a=L(n,200),u=n.trim(),p=$();E.useEffect(()=>{var r;if(!t)return;(r=j.current)==null||r.focus();const s=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),l())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,l]);const y=m({queryKey:["search-papers",a],queryFn:()=>K.search(a,1,I),enabled:t&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>x.listTasks({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),v=m({queryKey:["search-methods",a],queryFn:()=>x.listMethods({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>x.listDatasets({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4});if(!t)return null;const i=((b=k.data)==null?void 0:b.results)||[],h=((_=v.data)==null?void 0:_.results)||[],o=((F=N.data)==null?void 0:F.results)||[],d=((q=y.data)==null?void 0:q.results)||[],T=y.isFetching||k.isFetching||v.isFetching||N.isFetching,R=i.length||d.length||h.length||o.length,c=s=>{l(),w(s)},f=()=>{const s=n.trim();s&&c(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:l,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:j,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:n,onChange:s=>C(s.target.value),onKeyDown:s=>{p&&s.key==="Enter"&&(s.preventDefault(),f())}}),e.jsxs("div",{className:"search-results",children:[p&&n.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:f,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",n.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",p&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!T&&!R&&e.jsxs("div",{className:"search-empty",children:['No matches for "',n,'"']}),i.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",i.length]}),i.map(s=>{const r=S(D(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>c(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),e.jsx("span",{className:"name",children:z(s.name,s.slug)}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id)})]}),h.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Methods · ",h.length]}),h.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>c(`/methods/${s.slug||s.id}`),children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:s.name}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",o.length]}),o.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>c(`/benchmark/${s.slug||s.id}`),children:[e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," entries"]})]},s.id))]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",d.length]}),d.map(s=>{var r;return e.jsxs("div",{className:"search-result",onClick:()=>c(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(A,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((r=s.authors)==null?void 0:r[0])&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.authors[0],s.authors.length>1?" et al.":""]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["↑ ",s.citation_count.toLocaleString()]})]})]})]},s.id)})]}),u.length>=2&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>c(`/papers?search=${encodeURIComponent(u)}`),children:["View all paper results for “",u,"”"]})]})]})})};export{Z as default}; diff --git a/assets/SettingsView-DZ94ErYq.js b/assets/SettingsView--d7NFlEH.js similarity index 97% rename from assets/SettingsView-DZ94ErYq.js rename to assets/SettingsView--d7NFlEH.js index 0aca881ff0775ecbbdc19c89178ab153f0640241..373d5287a4c791644506c83ad006f1409f7fef38 100644 --- a/assets/SettingsView-DZ94ErYq.js +++ b/assets/SettingsView--d7NFlEH.js @@ -1,4 +1,4 @@ -import{e as _,a as ee,g as se,ah as ne,i as te,z as c,h as ae,j as e,H as v,A as Q}from"./index-C7DzD1KZ.js";import{u as L}from"./useQuery-C-S9qU90.js";import{u as y}from"./useMutation-m57QFYBa.js";import{S as B}from"./switch-W-detjDD.js";import{c as r}from"./chat-CYCaJ4hM.js";import{f as ie,D as le}from"./latexPlainText-DI8YEXVe.js";import{a as oe,u as re,r as ce,O as C}from"./openrouter-CeZ4KorQ.js";import{E as Y}from"./external-link-DY1V39Iz.js";import"./index-DacotVUe.js";/** +import{e as _,a as ee,g as se,ah as ne,i as te,z as c,h as ae,j as e,H as v,A as Q}from"./index-DB5YVNrt.js";import{u as L}from"./useQuery-gfOJVfRZ.js";import{u as y}from"./useMutation-Bi00GAL7.js";import{S as B}from"./switch-CVNSFNdW.js";import{c as r}from"./chat-C792FSN8.js";import{f as ie,D as le}from"./latexPlainText-DI8YEXVe.js";import{a as oe,u as re,r as ce,O as C}from"./openrouter-DZnDVTdj.js";import{E as Y}from"./external-link-CwxK3W8X.js";import"./index-OagizEwS.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SharedChatView-Cc0NvRQ0.js b/assets/SharedChatView-DR9rp5FK.js similarity index 84% rename from assets/SharedChatView-Cc0NvRQ0.js rename to assets/SharedChatView-DR9rp5FK.js index 5d6086153f40b3a1a5560524bdd7ffa8c14cb0b4..c707b16d18815dfc9d9bac87955c59edbc7f4b68 100644 --- a/assets/SharedChatView-Cc0NvRQ0.js +++ b/assets/SharedChatView-DR9rp5FK.js @@ -1 +1 @@ -import{u as f,b as x,r as h,j as e,d as g}from"./index-C7DzD1KZ.js";import{u as v}from"./useQuery-C-S9qU90.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-BYg5RxLy.js";import{C as m,d as w,p as N,q as C,g as q}from"./chatLaunch-CJaFcfv2.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CD-KpVUV.js";import"./github-CBv5TgZv.js";import"./github-BPMZ1b4l.js";import"./PaperPreviewLink-BVh6NMiG.js";import"./index-1iwK_I9Y.js";import"./papers-BNcOWLi8.js";import"./chat-CYCaJ4hM.js";import"./file-text-BW4Xze_N.js";import"./useMutation-m57QFYBa.js";import"./external-link-DY1V39Iz.js";import"./chevron-down-BVSdU_Yo.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},G=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?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."})]}):t.isError||!t.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 t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.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"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),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."}),l&&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(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{G as default}; +import{u as f,b as x,r as h,j as e,d as g}from"./index-DB5YVNrt.js";import{u as v}from"./useQuery-gfOJVfRZ.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-DGDexY_Q.js";import{C as m,d as w,p as N,q as C,g as q}from"./chatLaunch-DPlGkVok.js";import"./katex.min-BSBacQyE.js";import"./hover-card-De01BraD.js";import"./github-nBYzmzBK.js";import"./github-CYSQLKIg.js";import"./PaperPreviewLink-Bi7j2lR1.js";import"./index-CeWrpp9N.js";import"./papers-CTasJek9.js";import"./chat-C792FSN8.js";import"./file-text-Dqp9ANqN.js";import"./useMutation-Bi00GAL7.js";import"./external-link-CwxK3W8X.js";import"./chevron-down-CLKJ3Wue.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},G=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?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."})]}):t.isError||!t.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 t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.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"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),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."}),l&&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(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{G as default}; diff --git a/assets/SignInToEditDialog-BrT1YrXZ.js b/assets/SignInToEditDialog-CGuRD5vY.js similarity index 96% rename from assets/SignInToEditDialog-BrT1YrXZ.js rename to assets/SignInToEditDialog-CGuRD5vY.js index ea374f3105e6d8fa2cadc60ede6df5e6c20e27cd..cf67ddbbf60fc1adc36fac50f4e7031ad17e2ab4 100644 --- a/assets/SignInToEditDialog-BrT1YrXZ.js +++ b/assets/SignInToEditDialog-CGuRD5vY.js @@ -1,4 +1,4 @@ -import{e as ce,r,j as e,a0 as Ne,s as Se,a1 as we,f as _e,X as ke,C as Ce,H as De}from"./index-C7DzD1KZ.js";import{B as A}from"./button-B2L1cddC.js";import{I as m}from"./input-B4Wwo7mm.js";import{T as Ie}from"./textarea-BWN21nu7.js";import{S as re}from"./searchable-select-B8y6G69L.js";import{D as de,a as ue,b as me,c as ge,d as he,e as Ee}from"./dialog-vRXA8k-N.js";import{u as Me}from"./useMutation-m57QFYBa.js";import{s as f,p as j}from"./submissions-Du_vtued.js";import{c as ne}from"./catalog-DU92Rh6k.js";import{L as Pe}from"./loader-circle-Bp8rZ20U.js";/** +import{e as ce,r,j as e,a0 as Ne,s as Se,a1 as we,f as _e,X as ke,C as Ce,H as De}from"./index-DB5YVNrt.js";import{B as A}from"./button-BvgK708w.js";import{I as m}from"./input-DnxeMTC9.js";import{T as Ie}from"./textarea-rFUixZHL.js";import{S as re}from"./searchable-select-Bw0OPNzm.js";import{D as de,a as ue,b as me,c as ge,d as he,e as Ee}from"./dialog-CSh5S1Qx.js";import{u as Me}from"./useMutation-Bi00GAL7.js";import{s as f,p as j}from"./submissions-B7ABJ5o_.js";import{c as ne}from"./catalog-HFAZrKSg.js";import{L as Pe}from"./loader-circle-uWjxppt1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/StagingAccessRequestView-tW2mnJ1L.js b/assets/StagingAccessRequestView-Dfhd_TCr.js similarity index 95% rename from assets/StagingAccessRequestView-tW2mnJ1L.js rename to assets/StagingAccessRequestView-Dfhd_TCr.js index adcbb1b1213dc09bdbf5caa8ea20bb8ba78fa4eb..f2a7f67c84acb3cddadbae196a38d0c1ff214818 100644 --- a/assets/StagingAccessRequestView-tW2mnJ1L.js +++ b/assets/StagingAccessRequestView-Dfhd_TCr.js @@ -1 +1 @@ -import{a as m,z as a,j as e,H as g,aJ as p}from"./index-C7DzD1KZ.js";import{C as j}from"./circle-check-DYBHjpYw.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default}; +import{a as m,z as a,j as e,H as g,aJ as p}from"./index-DB5YVNrt.js";import{C as j}from"./circle-check-BPVxNUGc.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default}; diff --git a/assets/SubmissionsDashboard-oHtFlnA-.js b/assets/SubmissionsDashboard-BRy4uEhT.js similarity index 98% rename from assets/SubmissionsDashboard-oHtFlnA-.js rename to assets/SubmissionsDashboard-BRy4uEhT.js index 060b540967013ef80b8c33312e8459e73f0a344e..c5faacb09c81be5ff1f7661cb790b7a59327a104 100644 --- a/assets/SubmissionsDashboard-oHtFlnA-.js +++ b/assets/SubmissionsDashboard-BRy4uEhT.js @@ -1,4 +1,4 @@ -var ge=s=>{throw TypeError(s)};var se=(s,t,i)=>t.has(s)||ge("Cannot "+i);var b=(s,t,i)=>(se(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?ge("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(se(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),O=(s,t,i)=>(se(s,t,"access private method"),i);import{am as Re,an as ie,ao as Ce,ap as Oe,h as ke,r as B,aq as Me,e as Te,j as e,N as Ae,z as w,s as F,a as qe,f as we,ar as Ie,as as Fe,at as Qe}from"./index-C7DzD1KZ.js";import{Q as Se,b as Ue,c as Le,e as De,d as $e,f as ze,s as xe,g as Be,h as He,u as ne}from"./useQuery-C-S9qU90.js";import{u as je}from"./useMutation-m57QFYBa.js";import{c as Q}from"./catalog-DU92Rh6k.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{p as Ke}from"./papers-BNcOWLi8.js";import{s as J}from"./submissions-Du_vtued.js";import{R as Je,C as Pe}from"./refresh-cw-CUIhAWJ4.js";import{L as P}from"./loader-circle-Bp8rZ20U.js";import{S as Ge}from"./shield-alert-BX1GxHfp.js";import{C as Ve}from"./circle-check-DYBHjpYw.js";function ve(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 D,E,$,U,R,I,G,V,Y,W,y,re,ae,Ee,oe,le,ce,Ne,We=(Ne=class extends Re{constructor(t,i,n){super();C(this,y);C(this,D);C(this,E);C(this,$);C(this,U);C(this,R);C(this,I);C(this,G);C(this,V);C(this,Y);C(this,W,[]);k(this,D,t),k(this,U,n),k(this,$,[]),k(this,R,[]),k(this,E,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&b(this,R).forEach(t=>{t.subscribe(i=>{O(this,y,le).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,b(this,R).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,$,t),k(this,U,i),ie.batch(()=>{const n=b(this,R),a=O(this,y,oe).call(this,b(this,$));a.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const l=a.map(r=>r.observer),o=l.map(r=>r.getCurrentResult()),d=n.length!==l.length,p=l.some((r,m)=>r!==n[m]),f=d||p,x=f?!0:o.some((r,m)=>{const c=b(this,E)[m];return!c||!Ce(r,c)});!f&&!x||(f&&(k(this,W,a),k(this,R,l)),k(this,E,o),this.hasListeners()&&(f&&(ve(n,l).forEach(r=>{r.destroy()}),ve(l,n).forEach(r=>{r.subscribe(m=>{O(this,y,le).call(this,r,m)})})),O(this,y,ce).call(this)))})}getCurrentResult(){return b(this,E)}getQueries(){return b(this,R).map(t=>t.getCurrentQuery())}getObservers(){return b(this,R)}getOptimisticResult(t,i){const n=O(this,y,oe).call(this,t),a=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>O(this,y,ae).call(this,o??a,i,l),()=>O(this,y,re).call(this,a,n)]}},D=new WeakMap,E=new WeakMap,$=new WeakMap,U=new WeakMap,R=new WeakMap,I=new WeakMap,G=new WeakMap,V=new WeakMap,Y=new WeakMap,W=new WeakMap,y=new WeakSet,re=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)})})})},ae=function(t,i,n){if(i){const a=b(this,Y),l=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((o,d)=>o!==a[d]));return(!b(this,I)||b(this,E)!==b(this,V)||l||i!==b(this,G))&&(k(this,G,i),k(this,V,b(this,E)),n!==void 0&&k(this,Y,n),k(this,I,Oe(b(this,I),i(t)))),b(this,I)}return t},Ee=function(){var t;return((t=b(this,U))==null?void 0:t.combine)!==void 0&&b(this,R).some((i,n)=>{var a;return i.options.suspense&&((a=b(this,E)[n])==null?void 0:a.data)===void 0})},oe=function(t){const i=new Map;b(this,R).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const n=[];return t.forEach(a=>{var p;const l=b(this,D).defaultQueryOptions(a),d=((p=i.get(l.queryHash))==null?void 0:p.shift())??new Se(b(this,D),l);n.push({defaultedQueryOptions:l,observer:d})}),n},le=function(t,i){const n=b(this,R).indexOf(t);n!==-1&&(k(this,E,Ye(b(this,E),n,i)),O(this,y,ce).call(this))},ce=function(){var t;if(this.hasListeners()){const i=O(this,y,re).call(this,b(this,E),b(this,W)),n=O(this,y,Ee).call(this),a=b(this,I),l=n?a:O(this,y,ae).call(this,i,(t=b(this,U))==null?void 0:t.combine);(n||a!==l)&&ie.batch(()=>{this.listeners.forEach(o=>{o(b(this,E))})})}},Ne);function Z({queries:s,...t},i){const n=ke(),a=Ue(),l=Le(),o=B.useMemo(()=>s.map(u=>{const j=n.defaultQueryOptions(u);return j._optimisticResults=a?"isRestoring":"optimistic",j}),[s,n,a]);o.forEach(u=>{De(u);const j=n.getQueryCache().get(u.queryHash);$e(u,l,j)}),ze(l);const[d]=B.useState(()=>new We(n,o,t)),[p,f,x]=d.getOptimisticResult(o,t.combine),r=!a&&t.subscribed!==!1;B.useSyncExternalStore(B.useCallback(u=>r?d.subscribe(ie.batchCalls(u)):Me,[d,r]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),B.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=p.some((u,j)=>xe(o[j],u))?p.flatMap((u,j)=>{const S=o[j];if(S&&xe(S,u)){const M=new Se(n,S);return Be(S,M,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const h=p.find((u,j)=>{const S=o[j];return S&&He({result:u,errorResetBoundary:l,throwOnError:S.throwOnError,query:n.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(h!=null&&h.error)throw h.error;return f(x())}/** +var ge=s=>{throw TypeError(s)};var se=(s,t,i)=>t.has(s)||ge("Cannot "+i);var b=(s,t,i)=>(se(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?ge("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(se(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),O=(s,t,i)=>(se(s,t,"access private method"),i);import{am as Re,an as ie,ao as Ce,ap as Oe,h as ke,r as B,aq as Me,e as Te,j as e,N as Ae,z as w,s as F,a as qe,f as we,ar as Ie,as as Fe,at as Qe}from"./index-DB5YVNrt.js";import{Q as Se,b as Ue,c as Le,e as De,d as $e,f as ze,s as xe,g as Be,h as He,u as ne}from"./useQuery-gfOJVfRZ.js";import{u as je}from"./useMutation-Bi00GAL7.js";import{c as Q}from"./catalog-HFAZrKSg.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{p as Ke}from"./papers-CTasJek9.js";import{s as J}from"./submissions-B7ABJ5o_.js";import{R as Je,C as Pe}from"./refresh-cw-HoaNTnTk.js";import{L as P}from"./loader-circle-uWjxppt1.js";import{S as Ge}from"./shield-alert-TqnwXhnw.js";import{C as Ve}from"./circle-check-BPVxNUGc.js";function ve(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 D,E,$,U,R,I,G,V,Y,W,y,re,ae,Ee,oe,le,ce,Ne,We=(Ne=class extends Re{constructor(t,i,n){super();C(this,y);C(this,D);C(this,E);C(this,$);C(this,U);C(this,R);C(this,I);C(this,G);C(this,V);C(this,Y);C(this,W,[]);k(this,D,t),k(this,U,n),k(this,$,[]),k(this,R,[]),k(this,E,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&b(this,R).forEach(t=>{t.subscribe(i=>{O(this,y,le).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,b(this,R).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,$,t),k(this,U,i),ie.batch(()=>{const n=b(this,R),a=O(this,y,oe).call(this,b(this,$));a.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const l=a.map(r=>r.observer),o=l.map(r=>r.getCurrentResult()),d=n.length!==l.length,p=l.some((r,m)=>r!==n[m]),f=d||p,x=f?!0:o.some((r,m)=>{const c=b(this,E)[m];return!c||!Ce(r,c)});!f&&!x||(f&&(k(this,W,a),k(this,R,l)),k(this,E,o),this.hasListeners()&&(f&&(ve(n,l).forEach(r=>{r.destroy()}),ve(l,n).forEach(r=>{r.subscribe(m=>{O(this,y,le).call(this,r,m)})})),O(this,y,ce).call(this)))})}getCurrentResult(){return b(this,E)}getQueries(){return b(this,R).map(t=>t.getCurrentQuery())}getObservers(){return b(this,R)}getOptimisticResult(t,i){const n=O(this,y,oe).call(this,t),a=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>O(this,y,ae).call(this,o??a,i,l),()=>O(this,y,re).call(this,a,n)]}},D=new WeakMap,E=new WeakMap,$=new WeakMap,U=new WeakMap,R=new WeakMap,I=new WeakMap,G=new WeakMap,V=new WeakMap,Y=new WeakMap,W=new WeakMap,y=new WeakSet,re=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)})})})},ae=function(t,i,n){if(i){const a=b(this,Y),l=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((o,d)=>o!==a[d]));return(!b(this,I)||b(this,E)!==b(this,V)||l||i!==b(this,G))&&(k(this,G,i),k(this,V,b(this,E)),n!==void 0&&k(this,Y,n),k(this,I,Oe(b(this,I),i(t)))),b(this,I)}return t},Ee=function(){var t;return((t=b(this,U))==null?void 0:t.combine)!==void 0&&b(this,R).some((i,n)=>{var a;return i.options.suspense&&((a=b(this,E)[n])==null?void 0:a.data)===void 0})},oe=function(t){const i=new Map;b(this,R).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const n=[];return t.forEach(a=>{var p;const l=b(this,D).defaultQueryOptions(a),d=((p=i.get(l.queryHash))==null?void 0:p.shift())??new Se(b(this,D),l);n.push({defaultedQueryOptions:l,observer:d})}),n},le=function(t,i){const n=b(this,R).indexOf(t);n!==-1&&(k(this,E,Ye(b(this,E),n,i)),O(this,y,ce).call(this))},ce=function(){var t;if(this.hasListeners()){const i=O(this,y,re).call(this,b(this,E),b(this,W)),n=O(this,y,Ee).call(this),a=b(this,I),l=n?a:O(this,y,ae).call(this,i,(t=b(this,U))==null?void 0:t.combine);(n||a!==l)&&ie.batch(()=>{this.listeners.forEach(o=>{o(b(this,E))})})}},Ne);function Z({queries:s,...t},i){const n=ke(),a=Ue(),l=Le(),o=B.useMemo(()=>s.map(u=>{const j=n.defaultQueryOptions(u);return j._optimisticResults=a?"isRestoring":"optimistic",j}),[s,n,a]);o.forEach(u=>{De(u);const j=n.getQueryCache().get(u.queryHash);$e(u,l,j)}),ze(l);const[d]=B.useState(()=>new We(n,o,t)),[p,f,x]=d.getOptimisticResult(o,t.combine),r=!a&&t.subscribed!==!1;B.useSyncExternalStore(B.useCallback(u=>r?d.subscribe(ie.batchCalls(u)):Me,[d,r]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),B.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=p.some((u,j)=>xe(o[j],u))?p.flatMap((u,j)=>{const S=o[j];if(S&&xe(S,u)){const M=new Se(n,S);return Be(S,M,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const h=p.find((u,j)=>{const S=o[j];return S&&He({result:u,errorResetBoundary:l,throwOnError:S.throwOnError,query:n.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(h!=null&&h.error)throw h.error;return f(x())}/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmitView-DFtR3Fk8.js b/assets/SubmitView-BUMlU8NL.js similarity index 94% rename from assets/SubmitView-DFtR3Fk8.js rename to assets/SubmitView-BUMlU8NL.js index 6a82f0c9dc72fa7c43a38849077a5ec2a2e765a1..cae9e9ad38cf880362e7840aef888889cdb3c514 100644 --- a/assets/SubmitView-DFtR3Fk8.js +++ b/assets/SubmitView-BUMlU8NL.js @@ -1 +1 @@ -import{b as D,h as k,f as C,a as E,z as d,j as e,y as z}from"./index-C7DzD1KZ.js";import{u as L}from"./useMutation-m57QFYBa.js";import{A as F,a as X}from"./alert-D1jsfsn6.js";import{B as _}from"./button-B2L1cddC.js";import{I as g}from"./input-B4Wwo7mm.js";import{T as q}from"./textarea-BWN21nu7.js";import{p as N}from"./papers-BNcOWLi8.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(m=>m.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const G=()=>{const n=D(),i=k(),{toast:a}=C(),{user:s,isLoading:o}=E(),[l,p]=d.useState(""),[u,m]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[b,w]=d.useState(""),[I,y]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),m(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const h=A(l),R=h==="external",c=L({mutationFn:t=>N.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(J(t))}}),T=t=>{if(t.preventDefault(),y(null),h==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:b}));const P=z("/api/v1/auth/hf/login");window.location.assign(`${P}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:b});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(g,{id:"submit-input",value:l,onChange:t=>p(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:h==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":h==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),R&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(g,{id:"submit-title",value:u,onChange:t=>m(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(q,{id:"submit-abstract",value:f,onChange:t=>S(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(g,{id:"submit-authors",value:x,onChange:t=>j(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(g,{id:"submit-date",type:"date",value:b,onChange:t=>w(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),I&&e.jsx(F,{variant:"destructive",children:e.jsx(X,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{G as default}; +import{b as D,h as k,f as C,a as E,z as d,j as e,y as z}from"./index-DB5YVNrt.js";import{u as L}from"./useMutation-Bi00GAL7.js";import{A as F,a as X}from"./alert-BPNeeF4s.js";import{B as _}from"./button-BvgK708w.js";import{I as g}from"./input-DnxeMTC9.js";import{T as q}from"./textarea-rFUixZHL.js";import{p as N}from"./papers-CTasJek9.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(m=>m.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const G=()=>{const n=D(),i=k(),{toast:a}=C(),{user:s,isLoading:o}=E(),[l,p]=d.useState(""),[u,m]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[b,w]=d.useState(""),[I,y]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),m(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const h=A(l),R=h==="external",c=L({mutationFn:t=>N.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(J(t))}}),T=t=>{if(t.preventDefault(),y(null),h==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:b}));const P=z("/api/v1/auth/hf/login");window.location.assign(`${P}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:b});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(g,{id:"submit-input",value:l,onChange:t=>p(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:h==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":h==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),R&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(g,{id:"submit-title",value:u,onChange:t=>m(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(q,{id:"submit-abstract",value:f,onChange:t=>S(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(g,{id:"submit-authors",value:x,onChange:t=>j(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(g,{id:"submit-date",type:"date",value:b,onChange:t=>w(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),I&&e.jsx(F,{variant:"destructive",children:e.jsx(X,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{G as default}; diff --git a/assets/TagBrowseView-B0gD_2LJ.js b/assets/TagBrowseView-MvhMQ4qP.js similarity index 95% rename from assets/TagBrowseView-B0gD_2LJ.js rename to assets/TagBrowseView-MvhMQ4qP.js index 73305f0b7d465ba879c4618ecbf5558af39d7a45..f0e28a1561b8096e88ba316be9c3fd19982782ab 100644 --- a/assets/TagBrowseView-B0gD_2LJ.js +++ b/assets/TagBrowseView-MvhMQ4qP.js @@ -1,4 +1,4 @@ -import{e as je,r as h,l as X,j as e,k as O,W as _e,o as ve,P as ss,q as Ne,m as ke,Y as as,z as j,Z as ts,v as rs,s as ee,L as k,u as ns,b as os,c as is,g as cs,N as ls}from"./index-C7DzD1KZ.js";import{u as be}from"./useQuery-C-S9qU90.js";import{P as ds,M as ms}from"./components-BV3lUGf1.js";import{B as ps}from"./BenchmarkTrendSparkline-BQbrYdWs.js";import{b as hs,u as us,P as gs,a as xs,c as bs}from"./useIntersectionObserver-CSNffbhV.js";import{M as Y}from"./MarkdownText-8HaaKP15.js";import{c as fe}from"./catalog-DU92Rh6k.js";import{s as fs}from"./slug-BpH-Nkvz.js";import{d as H,t as js}from"./transform-Dk33Ziw-.js";import{c as _s}from"./usePapers-CHyBH3Xk.js";import{S as q}from"./skeleton-BBQyes8J.js";import{A as vs,a as Ns}from"./alert-D1jsfsn6.js";import{C as ks}from"./chevron-down-BVSdU_Yo.js";import{G as ws}from"./github-BPMZ1b4l.js";import"./LatexTitle-DuT2lumP.js";import"./katex.min-BSBacQyE.js";import"./papers-BNcOWLi8.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CQWB7HGQ.js";import"./PaperPreviewLink-BVh6NMiG.js";import"./index-1iwK_I9Y.js";import"./hover-card-CD-KpVUV.js";import"./useInfiniteQuery-DZ6ASWY6.js";/** +import{e as je,r as h,l as X,j as e,k as O,W as _e,o as ve,P as ss,q as Ne,m as ke,Y as as,z as j,Z as ts,v as rs,s as ee,L as k,u as ns,b as os,c as is,g as cs,N as ls}from"./index-DB5YVNrt.js";import{u as be}from"./useQuery-gfOJVfRZ.js";import{P as ds,M as ms}from"./components--1z4Qw5F.js";import{B as ps}from"./BenchmarkTrendSparkline-DrH77nK8.js";import{b as hs,u as us,P as gs,a as xs,c as bs}from"./useIntersectionObserver-CmsvWF1K.js";import{M as Y}from"./MarkdownText-tXCrsggq.js";import{c as fe}from"./catalog-HFAZrKSg.js";import{s as fs}from"./slug-BpH-Nkvz.js";import{d as H,t as js}from"./transform-CnBvOSlq.js";import{c as _s}from"./usePapers-CT5co6TZ.js";import{S as q}from"./skeleton-jY-za2d8.js";import{A as vs,a as Ns}from"./alert-BPNeeF4s.js";import{C as ks}from"./chevron-down-CLKJ3Wue.js";import{G as ws}from"./github-CYSQLKIg.js";import"./LatexTitle-DcOGOHZH.js";import"./katex.min-BSBacQyE.js";import"./papers-CTasJek9.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BqJw3haa.js";import"./PaperPreviewLink-Bi7j2lR1.js";import"./index-CeWrpp9N.js";import"./hover-card-De01BraD.js";import"./useInfiniteQuery-CqugEgpc.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TagsIndexView-CugP0IZX.js b/assets/TagsIndexView-rZIkfOik.js similarity index 79% rename from assets/TagsIndexView-CugP0IZX.js rename to assets/TagsIndexView-rZIkfOik.js index fcb6dc1594aa9c0140e3b627246970e7ceb507ab..6a1cfcfb02d1515247cdc7175af509de57227762 100644 --- a/assets/TagsIndexView-CugP0IZX.js +++ b/assets/TagsIndexView-rZIkfOik.js @@ -1 +1 @@ -import{r as c,j as s,L as p}from"./index-C7DzD1KZ.js";import{u as h}from"./useQuery-C-S9qU90.js";import{c as g}from"./catalog-DU92Rh6k.js";import{c as x,h as f,d as u}from"./transform-Dk33Ziw-.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as d}from"./skeleton-BBQyes8J.js";import{A as y,a as k}from"./alert-D1jsfsn6.js";import{T as v}from"./TaxonomySuggestionTile-CRddUpOR.js";import"./SignInToEditDialog-BrT1YrXZ.js";import"./button-B2L1cddC.js";import"./input-B4Wwo7mm.js";import"./textarea-BWN21nu7.js";import"./searchable-select-B8y6G69L.js";import"./popover-CQWB7HGQ.js";import"./dialog-vRXA8k-N.js";import"./loader-circle-Bp8rZ20U.js";import"./useMutation-m57QFYBa.js";import"./submissions-Du_vtued.js";const N=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",P=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),n=c.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},t=o=>e[N(o)]??999;return[...r.data.results].sort((o,a)=>{const i=t(o.name),l=t(a.name);return i!==l?i-l:o.name.localeCompare(a.name)})},[r.data]),m=c.useMemo(()=>n.reduce((e,t)=>e+t.tasks.length,0),[n]);return r.error?s.jsx("div",{className:"page",children:s.jsx(y,{variant:"destructive",children:s.jsx(k,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,t)=>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((o,a)=>s.jsx(d,{className:"h-24"},a))})]},t))}):n.map(e=>{const t=e.tasks;if(t.length===0)return null;const o=t.reduce((a,i)=>a+(i.paper_count||0),0);return s.jsxs("section",{id:`area-${j(e.name)}`,style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),s.jsx(v,{kind:"task"})]})]},e.id)}),m>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[m," tasks across ",n.filter(e=>e.tasks.length>0).length," areas."]})]})};export{P as default}; +import{r as c,j as s,L as p}from"./index-DB5YVNrt.js";import{u as h}from"./useQuery-gfOJVfRZ.js";import{c as g}from"./catalog-HFAZrKSg.js";import{c as x,h as f,d as u}from"./transform-CnBvOSlq.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as d}from"./skeleton-jY-za2d8.js";import{A as y,a as k}from"./alert-BPNeeF4s.js";import{T as v}from"./TaxonomySuggestionTile-5FXmjrqa.js";import"./SignInToEditDialog-CGuRD5vY.js";import"./button-BvgK708w.js";import"./input-DnxeMTC9.js";import"./textarea-rFUixZHL.js";import"./searchable-select-Bw0OPNzm.js";import"./popover-BqJw3haa.js";import"./dialog-CSh5S1Qx.js";import"./loader-circle-uWjxppt1.js";import"./useMutation-Bi00GAL7.js";import"./submissions-B7ABJ5o_.js";const N=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",P=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),n=c.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},t=o=>e[N(o)]??999;return[...r.data.results].sort((o,a)=>{const i=t(o.name),l=t(a.name);return i!==l?i-l:o.name.localeCompare(a.name)})},[r.data]),m=c.useMemo(()=>n.reduce((e,t)=>e+t.tasks.length,0),[n]);return r.error?s.jsx("div",{className:"page",children:s.jsx(y,{variant:"destructive",children:s.jsx(k,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,t)=>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((o,a)=>s.jsx(d,{className:"h-24"},a))})]},t))}):n.map(e=>{const t=e.tasks;if(t.length===0)return null;const o=t.reduce((a,i)=>a+(i.paper_count||0),0);return s.jsxs("section",{id:`area-${j(e.name)}`,style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),s.jsx(v,{kind:"task"})]})]},e.id)}),m>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[m," tasks across ",n.filter(e=>e.tasks.length>0).length," areas."]})]})};export{P as default}; diff --git a/assets/TaxonomySuggestionTile-CRddUpOR.js b/assets/TaxonomySuggestionTile-5FXmjrqa.js similarity index 83% rename from assets/TaxonomySuggestionTile-CRddUpOR.js rename to assets/TaxonomySuggestionTile-5FXmjrqa.js index 2c19dc6b70b5cc53167833ea61c9146fb526041f..3a264d7e48b569ad676dcfda46f2dbc39ab0739a 100644 --- a/assets/TaxonomySuggestionTile-CRddUpOR.js +++ b/assets/TaxonomySuggestionTile-5FXmjrqa.js @@ -1 +1 @@ -import{a as u,r as o,j as e}from"./index-C7DzD1KZ.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-BrT1YrXZ.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T}; +import{a as u,r as o,j as e}from"./index-DB5YVNrt.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-CGuRD5vY.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T}; diff --git a/assets/TrendsView-C7rcdOkr.js b/assets/TrendsView-DSNVxz_8.js similarity index 97% rename from assets/TrendsView-C7rcdOkr.js rename to assets/TrendsView-DSNVxz_8.js index cc877a68a4d57b795d6f322ad5afd13fa410aca3..cc24c338b462a4ba6545a56e227898a07c0dc18c 100644 --- a/assets/TrendsView-C7rcdOkr.js +++ b/assets/TrendsView-DSNVxz_8.js @@ -1 +1 @@ -import{$ as I,z as X,j as e}from"./index-C7DzD1KZ.js";import{u as G}from"./useQuery-C-S9qU90.js";import{A as J,a as E}from"./alert-D1jsfsn6.js";import{S as P}from"./skeleton-BBQyes8J.js";class Q{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const V=new Q(I),m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},Y=()=>V.trends(),f=980,j=400,x=62,B=26,g=30,K=58,u=f-x-B,A=j-g-K,v=g+A,Z=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s{const[a,y]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=Z(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:z,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:z,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:W,children:o}),e.jsx("text",{transform:`translate(16 ${g+A/2}) rotate(-90)`,textAnchor:"middle",style:W,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(r[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:s,display:"inline-block"}}),r[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},re=()=>{const t=G({queryKey:["research-trends"],queryFn:Y,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(J,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:M,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:M,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{re as default}; +import{$ as I,z as X,j as e}from"./index-DB5YVNrt.js";import{u as G}from"./useQuery-gfOJVfRZ.js";import{A as J,a as E}from"./alert-BPNeeF4s.js";import{S as P}from"./skeleton-jY-za2d8.js";class Q{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const V=new Q(I),m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},Y=()=>V.trends(),f=980,j=400,x=62,B=26,g=30,K=58,u=f-x-B,A=j-g-K,v=g+A,Z=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s{const[a,y]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=Z(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:z,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:z,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:W,children:o}),e.jsx("text",{transform:`translate(16 ${g+A/2}) rotate(-90)`,textAnchor:"middle",style:W,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(r[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:s,display:"inline-block"}}),r[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},re=()=>{const t=G({queryKey:["research-trends"],queryFn:Y,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(J,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:M,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:M,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{re as default}; diff --git a/assets/UserProfileView-CJ4f8yIj.js b/assets/UserProfileView-lUDzgohd.js similarity index 87% rename from assets/UserProfileView-CJ4f8yIj.js rename to assets/UserProfileView-lUDzgohd.js index f6750874c17f400705fd70cab2aff454b4a43849..4c74f379afdf086fa7590ea633f4aacacd168503 100644 --- a/assets/UserProfileView-CJ4f8yIj.js +++ b/assets/UserProfileView-lUDzgohd.js @@ -1 +1 @@ -import{ak as i,A as n,u as o,j as e,ax as d}from"./index-C7DzD1KZ.js";import{u as l}from"./useQuery-C-S9qU90.js";import{C as c}from"./OrganizationContributionGraph-BjrxGtKU.js";import"./skeleton-BBQyes8J.js";import"./catalog-DU92Rh6k.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},f=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(c,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default}; +import{ak as i,A as n,u as o,j as e,ax as d}from"./index-DB5YVNrt.js";import{u as l}from"./useQuery-gfOJVfRZ.js";import{C as c}from"./OrganizationContributionGraph-B2Y_Bv62.js";import"./skeleton-jY-za2d8.js";import"./catalog-HFAZrKSg.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},f=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(c,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default}; diff --git a/assets/alert-D1jsfsn6.js b/assets/alert-BPNeeF4s.js similarity index 92% rename from assets/alert-D1jsfsn6.js rename to assets/alert-BPNeeF4s.js index 4324c4d3dcdce3088da6f1de2ba1b90d0d063d14..8c0db2ddedde13e9f15897ccf1bb489f3f52918a 100644 --- a/assets/alert-D1jsfsn6.js +++ b/assets/alert-BPNeeF4s.js @@ -1 +1 @@ -import{r as a,j as s,s as l,a1 as i}from"./index-C7DzD1KZ.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,s as l,a1 as i}from"./index-DB5YVNrt.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/badge-a2iv4Ds7.js b/assets/badge-C_UuzwL3.js similarity index 90% rename from assets/badge-a2iv4Ds7.js rename to assets/badge-C_UuzwL3.js index 5a08a074181098868f01af5b9135a179e4f5852b..87dee3feb82a8c010d3e802c9887b4729cc24eb8 100644 --- a/assets/badge-a2iv4Ds7.js +++ b/assets/badge-C_UuzwL3.js @@ -1 +1 @@ -import{j as n,s as o,a1 as a}from"./index-C7DzD1KZ.js";const s=a("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function d({className:r,variant:e,...t}){return n.jsx("div",{className:o(s({variant:e}),r),...t})}export{d as B}; +import{j as n,s as o,a1 as a}from"./index-DB5YVNrt.js";const s=a("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function d({className:r,variant:e,...t}){return n.jsx("div",{className:o(s({variant:e}),r),...t})}export{d as B}; diff --git a/assets/button-B2L1cddC.js b/assets/button-BvgK708w.js similarity index 89% rename from assets/button-B2L1cddC.js rename to assets/button-BvgK708w.js index 987185115805e3160f4fb2c0a51ddf69cd69054c..228711fa906763c93780ed189328b956a95f3cd7 100644 --- a/assets/button-B2L1cddC.js +++ b/assets/button-BvgK708w.js @@ -1 +1 @@ -import{r as a,j as d,al as u,s as c,a1 as f}from"./index-C7DzD1KZ.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"}}),l=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})});l.displayName="Button";export{l as B}; +import{r as a,j as d,al as u,s as c,a1 as f}from"./index-DB5YVNrt.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"}}),l=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})});l.displayName="Button";export{l as B}; diff --git a/assets/catalog-DU92Rh6k.js b/assets/catalog-HFAZrKSg.js similarity index 97% rename from assets/catalog-DU92Rh6k.js rename to assets/catalog-HFAZrKSg.js index 639a8edaba01133cb90b577c6ba769137d10f332..93b1c1d87c236bcaa28cb5cb594d780afd990ca6 100644 --- a/assets/catalog-DU92Rh6k.js +++ b/assets/catalog-HFAZrKSg.js @@ -1 +1 @@ -import{$ as o}from"./index-C7DzD1KZ.js";function s(a,e){const t=new URLSearchParams;for(const[i,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(i,String(n));const r=t.toString();return`${a}${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))}methodIndex(){return this.request("/methods/index/cards")}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":""}`)}organizationIndex(){return this.request("/organizations/index/cards")}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 c=new u(o);export{c}; +import{$ as o}from"./index-DB5YVNrt.js";function s(a,e){const t=new URLSearchParams;for(const[i,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(i,String(n));const r=t.toString();return`${a}${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))}methodIndex(){return this.request("/methods/index/cards")}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":""}`)}organizationIndex(){return this.request("/organizations/index/cards")}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 c=new u(o);export{c}; diff --git a/assets/chat-CYCaJ4hM.js b/assets/chat-C792FSN8.js similarity index 97% rename from assets/chat-CYCaJ4hM.js rename to assets/chat-C792FSN8.js index e49c4ceccc1fc0d026ab775e824005b8e1078085..64d615746c69b32ae1a678f9951262afaae3b5bc 100644 --- a/assets/chat-CYCaJ4hM.js +++ b/assets/chat-C792FSN8.js @@ -1 +1 @@ -import{$ as n,ak as r}from"./index-C7DzD1KZ.js";class o{constructor(e){this.request=e}listSessions(e){const t=new URLSearchParams({limit:"50"});return e&&t.set("cursor",e),this.request(`/chat/sessions?${t.toString()}`)}createSession(e,t="low"){return this.request("/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:t})})}getSession(e){return this.request(`/chat/sessions/${e}`)}updateSession(e,t){return this.request(`/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(t)})}removeSession(e){return this.request(`/chat/sessions/${e}`,{method:"DELETE"})}archiveOldChats(){return this.request("/chat/sessions/archive-old",{method:"POST"})}archiveOldestChats(){return this.request("/chat/sessions/archive-oldest",{method:"POST"})}cancelSession(e){return this.request(`/chat/sessions/${e}/cancel`,{method:"POST"})}createOrRefreshShare(e){return this.request(`/chat/sessions/${e}/share`,{method:"POST"})}getSharedChat(e){return this.request(`/chat/shares/${encodeURIComponent(e)}`,{credentials:"omit"})}getModels(){return this.request("/chat/models")}getUsage(){return this.request("/chat/usage",{cache:"no-store"})}getAvailability(){return this.request("/chat/availability",{cache:"no-store"})}getInferenceBilling(){return this.request("/me/inference-billing",{cache:"no-store"})}selectInferenceBillingAccount(e){return this.request("/me/inference-billing",{method:"PATCH",body:JSON.stringify({bill_to:e})})}prewarmPaperContext(e){return this.request("/chat/paper-context/prewarm",{method:"POST",body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"})}getSandboxSpend(e){const t=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${t}`,{cache:"no-store"})}getWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}disconnectOpenRouterCredential(){return this.request("/chat/openrouter-key",{method:"DELETE"})}reportLatency(e,t){return r(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,s){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...s?{comment:s}:{}})})}stream(e,t){return r("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,s){return r(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...s&&s>0?{"Last-Event-ID":String(s)}:{}},signal:t})}}const h=new o(n);export{h as c}; +import{$ as n,ak as r}from"./index-DB5YVNrt.js";class o{constructor(e){this.request=e}listSessions(e){const t=new URLSearchParams({limit:"50"});return e&&t.set("cursor",e),this.request(`/chat/sessions?${t.toString()}`)}createSession(e,t="low"){return this.request("/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:t})})}getSession(e){return this.request(`/chat/sessions/${e}`)}updateSession(e,t){return this.request(`/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(t)})}removeSession(e){return this.request(`/chat/sessions/${e}`,{method:"DELETE"})}archiveOldChats(){return this.request("/chat/sessions/archive-old",{method:"POST"})}archiveOldestChats(){return this.request("/chat/sessions/archive-oldest",{method:"POST"})}cancelSession(e){return this.request(`/chat/sessions/${e}/cancel`,{method:"POST"})}createOrRefreshShare(e){return this.request(`/chat/sessions/${e}/share`,{method:"POST"})}getSharedChat(e){return this.request(`/chat/shares/${encodeURIComponent(e)}`,{credentials:"omit"})}getModels(){return this.request("/chat/models")}getUsage(){return this.request("/chat/usage",{cache:"no-store"})}getAvailability(){return this.request("/chat/availability",{cache:"no-store"})}getInferenceBilling(){return this.request("/me/inference-billing",{cache:"no-store"})}selectInferenceBillingAccount(e){return this.request("/me/inference-billing",{method:"PATCH",body:JSON.stringify({bill_to:e})})}prewarmPaperContext(e){return this.request("/chat/paper-context/prewarm",{method:"POST",body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"})}getSandboxSpend(e){const t=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${t}`,{cache:"no-store"})}getWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}disconnectOpenRouterCredential(){return this.request("/chat/openrouter-key",{method:"DELETE"})}reportLatency(e,t){return r(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,s){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...s?{comment:s}:{}})})}stream(e,t){return r("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,s){return r(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...s&&s>0?{"Last-Event-ID":String(s)}:{}},signal:t})}}const h=new o(n);export{h as c}; diff --git a/assets/chatLaunch-CJaFcfv2.js b/assets/chatLaunch-DPlGkVok.js similarity index 99% rename from assets/chatLaunch-CJaFcfv2.js rename to assets/chatLaunch-DPlGkVok.js index f23fd8088e879b411e35c285c7da468b4571bd95..b63ce9ce34acf6aaabf0fad1b99890bf9af52ea9 100644 --- a/assets/chatLaunch-CJaFcfv2.js +++ b/assets/chatLaunch-DPlGkVok.js @@ -1,4 +1,4 @@ -import{e as ie,j as a,A as ae,r as P,C as ce,z as d}from"./index-C7DzD1KZ.js";import{c as m}from"./chat-CYCaJ4hM.js";import{C as le}from"./chevron-down-BVSdU_Yo.js";import{u as ue}from"./useQuery-C-S9qU90.js";import{p as pe}from"./papers-BNcOWLi8.js";/** +import{e as ie,j as a,A as ae,r as P,C as ce,z as d}from"./index-DB5YVNrt.js";import{c as m}from"./chat-C792FSN8.js";import{C as le}from"./chevron-down-CLKJ3Wue.js";import{u as ue}from"./useQuery-gfOJVfRZ.js";import{p as pe}from"./papers-CTasJek9.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/chevron-down-BVSdU_Yo.js b/assets/chevron-down-CLKJ3Wue.js similarity index 85% rename from assets/chevron-down-BVSdU_Yo.js rename to assets/chevron-down-CLKJ3Wue.js index 11f54069a0902c7964b12b37d2d8155abb6bbf14..d785a77a5082e27b1fc24a7a4474377a3c71d533 100644 --- a/assets/chevron-down-BVSdU_Yo.js +++ b/assets/chevron-down-CLKJ3Wue.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-C7DzD1KZ.js";/** +import{e as o}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-DYBHjpYw.js b/assets/circle-check-BPVxNUGc.js similarity index 87% rename from assets/circle-check-DYBHjpYw.js rename to assets/circle-check-BPVxNUGc.js index 84265422bda1a11d37c8adc510622947f6c318ff..84ddf01084cab9d4622969cc1ffe2aefa5f6c5e6 100644 --- a/assets/circle-check-DYBHjpYw.js +++ b/assets/circle-check-BPVxNUGc.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-C7DzD1KZ.js";/** +import{e as c}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codexAddEvals-Bq9ZcPuq.js b/assets/codexAddEvals-QYl6p5qH.js similarity index 98% rename from assets/codexAddEvals-Bq9ZcPuq.js rename to assets/codexAddEvals-QYl6p5qH.js index 928956d6595868c7ade91fd3f0a60e18d6314730..2f2fa9cd62e382d64e8601747e3a13aa0082a579 100644 --- a/assets/codexAddEvals-Bq9ZcPuq.js +++ b/assets/codexAddEvals-QYl6p5qH.js @@ -1,4 +1,4 @@ -import{e as d,E as t}from"./index-C7DzD1KZ.js";/** +import{e as d,E as t}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/components-BV3lUGf1.js b/assets/components--1z4Qw5F.js similarity index 98% rename from assets/components-BV3lUGf1.js rename to assets/components--1z4Qw5F.js index 1e3b595b8e50a4465c409aa19cfdda316737bacd..f7d47d2ec3c12216cf83b7d69180bb33f973fedc 100644 --- a/assets/components-BV3lUGf1.js +++ b/assets/components--1z4Qw5F.js @@ -1 +1 @@ -import{h as E,z as m,j as e,L as y,b as S}from"./index-C7DzD1KZ.js";import{L as R,a as T}from"./LatexTitle-DuT2lumP.js";import{h as P,d as Z,a as H,c as B}from"./transform-Dk33Ziw-.js";import{p as D}from"./papers-BNcOWLi8.js";import{s as C}from"./safeExternalHref-CkBrsh84.js";const G=({slug:t,label:s,onClick:r})=>{const n=S(),x=P(t),a=B(x),h=i=>{if(i.stopPropagation(),r){r(t);return}n(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:a.bg,color:a.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:a.dot}}),Z(s||H(t),t)]})},O=({method:t,onClick:s})=>{const r=S(),n=t.slug||t.id||"";if(!n)return null;const x=a=>{if(a.stopPropagation(),s){s(n);return}r(`/methods/${n}`)};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=m.useRef(null),n=m.useRef(null),[x,a]=m.useState(t.length);if(m.useLayoutEffect(()=>{const o=r.current,c=n.current;if(!o||!c||t.length===0)return;const f=p=>(c.textContent=p,c.scrollWidth),l=()=>{const p=o.clientWidth;if(p<=0)return;let d=0,u=0;for(const N of t){const j=f(N.measureText);if(d+j<=p)d+=j,u+=1;else break}if(u0&&d+f(` · +${t.length-u} more`)>p;)u-=1,d-=f(t[u].measureText);u===0&&(u=1)}a(u)};l();const g=new ResizeObserver(l);return g.observe(o),()=>g.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:n,className:"paper-sota-measure","aria-hidden":"true"}),h.map((o,c)=>e.jsxs(m.Fragment,{children:[o.isGroupStart?e.jsxs(e.Fragment,{children:[c>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${o.rank===1?" paper-sota-label--sota":""}`,children:$[o.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),o.slug?e.jsx(y,{to:`/benchmark/${o.slug}`,className:"paper-sota-name",onClick:f=>f.stopPropagation(),children:o.name}):e.jsx("span",{className:"paper-sota-name",children:o.name})]},`${o.slug||o.name}-${c}`)),i>0&&e.jsxs(y,{to:`${s}#results`,className:"paper-sota-more",onClick:o=>o.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const n=m.useMemo(()=>{const a=[];let h=!0;for(const i of[1,2,3]){const o=t.filter(c=>c.rank===i);o.forEach((c,f)=>{const l=f===0,g=l?`${h?"":" · "}${$[i]} on `:", ";a.push({name:c.name,slug:c.slug,rank:i,isGroupStart:l,measureText:g+c.name})}),o.length>0&&(h=!1)}return a},[t]),x=m.useMemo(()=>[1,2,3].map(a=>t.filter(i=>i.rank===a).map((i,o)=>({name:i.name,slug:i.slug,rank:a,isGroupStart:o===0,measureText:(o===0?`${$[a]} on `:", ")+i.name}))).filter(a=>a.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(a=>e.jsx(F,{units:a,paperHref:s},a[0].rank))}):n.length===0?null:e.jsx(F,{units:n,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,n=220,x=[.85+s()*.1,.55+s()*.25],a=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let M=0;M.3,c=Math.floor(s()*3),f=[],l=6+Math.floor(s()*3);for(let M=0;Me.jsx("rect",{x:d+(r-d*2)*(1-M)/2,y:z+v*2.4,width:(r-d*2)*M,height:1.4,fill:p,rx:.3},`t${v}`)),e.jsx("rect",{x:d+(r-d*2)*(1-a)/2,y:W,width:(r-d*2)*a,height:.9,fill:g,opacity:.7,rx:.2}),e.jsx("rect",{x:d,y:A,width:6,height:1,fill:p,opacity:.6}),h.map((M,v)=>{const L=k+v*2.1;return L>n-d-1?null:e.jsx("rect",{x:N,y:L,width:u*M,height:.8,fill:g,opacity:.55,rx:.2},`l${v}`)}),o&&e.jsxs("g",{children:[e.jsx("rect",{x:j,y:k,width:u,height:14,fill:"#F0EBE0",stroke:g,strokeWidth:.3,opacity:.9}),c===0&&e.jsx("g",{stroke:p,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${j+2},${k+11} ${j+6},${k+8} ${j+10},${k+9} ${j+14},${k+5} ${j+18},${k+6} ${j+22},${k+3}`})}),c===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:j+u/2,cy:k+7,r:3.5,fill:p}),e.jsx("rect",{x:j+2,y:k+11,width:u-4,height:1.5,fill:g})]}),c===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:j+3,y:k+5,width:u-6,height:1,fill:p}),e.jsx("rect",{x:j+6,y:k+8,width:u-12,height:.8,fill:p})]})]}),f.map((M,v)=>{const L=k+(o?16:0)+v*2.1;return L>n-d-1?null:e.jsx("rect",{x:j,y:L,width:u*M,height:.8,fill:g,opacity:.55,rx:.2},`r${v}`)})]})})},q=({paperId:t,title:s,thumbnailUrl:r,priority:n=!1})=>{const[x,a]=m.useState(!1),[h,i]=m.useState(0),[o,c]=m.useState(n),f=m.useRef(null);m.useEffect(()=>{a(!1),i(0)},[r]);const l=m.useMemo(()=>{if(!r)return null;if(h===0)return r;const g=r.includes("?")?"&":"?";return`${r}${g}retry=${h}`},[r,h]);return m.useEffect(()=>{if(n||o)return;const g=f.current;if(!g)return;const p=new IntersectionObserver(([d])=>{d.isIntersecting&&(c(!0),p.disconnect())},{rootMargin:"250px"});return p.observe(g),()=>p.disconnect()},[n,o]),r&&!x?e.jsx("div",{ref:f,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:(n||o)&&l&&e.jsx("img",{src:l,alt:`Thumbnail for ${s}`,loading:n?"eager":"lazy",decoding:"async",fetchPriority:n?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(g=>g+1);return}a(!0)}},l)}):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[n,x]=m.useState(!1);return!r||n?null:e.jsx(y,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>x(!0)})})},ae=({paper:t,rank:s,showInstitution:r=!0,onClickTag:n,highlightQuery:x})=>{const a=E(),h=`/paper/${t.id}`,i=m.useCallback(()=>{a.prefetchQuery({queryKey:["paper-route",t.id],queryFn:()=>D.get(t.id,!0),staleTime:10*60*1e3})},[t.id,a]),o=t.authors.slice(0,3).join(", "),c=t.authors.length,f=J(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(y,{to:h,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(y,{to:h,onFocus:i,onMouseEnter:i,children:e.jsx(R,{title:t.title,highlight:x})}),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:[o,c>3&&e.jsxs("span",{children:[", ","+",c-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[c>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[c>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(T,{text:t.abstract,highlight:x})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:h}),(t.tags.length>0||f.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(l=>e.jsx(G,{slug:l,onClick:n},l)),f.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,ae as P,I as S,G as T,q as a}; +import{h as E,z as m,j as e,L as y,b as S}from"./index-DB5YVNrt.js";import{L as R,a as T}from"./LatexTitle-DcOGOHZH.js";import{h as P,d as Z,a as H,c as B}from"./transform-CnBvOSlq.js";import{p as D}from"./papers-CTasJek9.js";import{s as C}from"./safeExternalHref-CkBrsh84.js";const G=({slug:t,label:s,onClick:r})=>{const n=S(),x=P(t),a=B(x),h=i=>{if(i.stopPropagation(),r){r(t);return}n(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:a.bg,color:a.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:a.dot}}),Z(s||H(t),t)]})},O=({method:t,onClick:s})=>{const r=S(),n=t.slug||t.id||"";if(!n)return null;const x=a=>{if(a.stopPropagation(),s){s(n);return}r(`/methods/${n}`)};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=m.useRef(null),n=m.useRef(null),[x,a]=m.useState(t.length);if(m.useLayoutEffect(()=>{const o=r.current,c=n.current;if(!o||!c||t.length===0)return;const f=p=>(c.textContent=p,c.scrollWidth),l=()=>{const p=o.clientWidth;if(p<=0)return;let d=0,u=0;for(const N of t){const j=f(N.measureText);if(d+j<=p)d+=j,u+=1;else break}if(u0&&d+f(` · +${t.length-u} more`)>p;)u-=1,d-=f(t[u].measureText);u===0&&(u=1)}a(u)};l();const g=new ResizeObserver(l);return g.observe(o),()=>g.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:n,className:"paper-sota-measure","aria-hidden":"true"}),h.map((o,c)=>e.jsxs(m.Fragment,{children:[o.isGroupStart?e.jsxs(e.Fragment,{children:[c>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${o.rank===1?" paper-sota-label--sota":""}`,children:$[o.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),o.slug?e.jsx(y,{to:`/benchmark/${o.slug}`,className:"paper-sota-name",onClick:f=>f.stopPropagation(),children:o.name}):e.jsx("span",{className:"paper-sota-name",children:o.name})]},`${o.slug||o.name}-${c}`)),i>0&&e.jsxs(y,{to:`${s}#results`,className:"paper-sota-more",onClick:o=>o.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const n=m.useMemo(()=>{const a=[];let h=!0;for(const i of[1,2,3]){const o=t.filter(c=>c.rank===i);o.forEach((c,f)=>{const l=f===0,g=l?`${h?"":" · "}${$[i]} on `:", ";a.push({name:c.name,slug:c.slug,rank:i,isGroupStart:l,measureText:g+c.name})}),o.length>0&&(h=!1)}return a},[t]),x=m.useMemo(()=>[1,2,3].map(a=>t.filter(i=>i.rank===a).map((i,o)=>({name:i.name,slug:i.slug,rank:a,isGroupStart:o===0,measureText:(o===0?`${$[a]} on `:", ")+i.name}))).filter(a=>a.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(a=>e.jsx(F,{units:a,paperHref:s},a[0].rank))}):n.length===0?null:e.jsx(F,{units:n,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,n=220,x=[.85+s()*.1,.55+s()*.25],a=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let M=0;M.3,c=Math.floor(s()*3),f=[],l=6+Math.floor(s()*3);for(let M=0;Me.jsx("rect",{x:d+(r-d*2)*(1-M)/2,y:z+v*2.4,width:(r-d*2)*M,height:1.4,fill:p,rx:.3},`t${v}`)),e.jsx("rect",{x:d+(r-d*2)*(1-a)/2,y:W,width:(r-d*2)*a,height:.9,fill:g,opacity:.7,rx:.2}),e.jsx("rect",{x:d,y:A,width:6,height:1,fill:p,opacity:.6}),h.map((M,v)=>{const L=k+v*2.1;return L>n-d-1?null:e.jsx("rect",{x:N,y:L,width:u*M,height:.8,fill:g,opacity:.55,rx:.2},`l${v}`)}),o&&e.jsxs("g",{children:[e.jsx("rect",{x:j,y:k,width:u,height:14,fill:"#F0EBE0",stroke:g,strokeWidth:.3,opacity:.9}),c===0&&e.jsx("g",{stroke:p,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${j+2},${k+11} ${j+6},${k+8} ${j+10},${k+9} ${j+14},${k+5} ${j+18},${k+6} ${j+22},${k+3}`})}),c===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:j+u/2,cy:k+7,r:3.5,fill:p}),e.jsx("rect",{x:j+2,y:k+11,width:u-4,height:1.5,fill:g})]}),c===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:j+3,y:k+5,width:u-6,height:1,fill:p}),e.jsx("rect",{x:j+6,y:k+8,width:u-12,height:.8,fill:p})]})]}),f.map((M,v)=>{const L=k+(o?16:0)+v*2.1;return L>n-d-1?null:e.jsx("rect",{x:j,y:L,width:u*M,height:.8,fill:g,opacity:.55,rx:.2},`r${v}`)})]})})},q=({paperId:t,title:s,thumbnailUrl:r,priority:n=!1})=>{const[x,a]=m.useState(!1),[h,i]=m.useState(0),[o,c]=m.useState(n),f=m.useRef(null);m.useEffect(()=>{a(!1),i(0)},[r]);const l=m.useMemo(()=>{if(!r)return null;if(h===0)return r;const g=r.includes("?")?"&":"?";return`${r}${g}retry=${h}`},[r,h]);return m.useEffect(()=>{if(n||o)return;const g=f.current;if(!g)return;const p=new IntersectionObserver(([d])=>{d.isIntersecting&&(c(!0),p.disconnect())},{rootMargin:"250px"});return p.observe(g),()=>p.disconnect()},[n,o]),r&&!x?e.jsx("div",{ref:f,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:(n||o)&&l&&e.jsx("img",{src:l,alt:`Thumbnail for ${s}`,loading:n?"eager":"lazy",decoding:"async",fetchPriority:n?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(g=>g+1);return}a(!0)}},l)}):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[n,x]=m.useState(!1);return!r||n?null:e.jsx(y,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>x(!0)})})},ae=({paper:t,rank:s,showInstitution:r=!0,onClickTag:n,highlightQuery:x})=>{const a=E(),h=`/paper/${t.id}`,i=m.useCallback(()=>{a.prefetchQuery({queryKey:["paper-route",t.id],queryFn:()=>D.get(t.id,!0),staleTime:10*60*1e3})},[t.id,a]),o=t.authors.slice(0,3).join(", "),c=t.authors.length,f=J(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(y,{to:h,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(y,{to:h,onFocus:i,onMouseEnter:i,children:e.jsx(R,{title:t.title,highlight:x})}),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:[o,c>3&&e.jsxs("span",{children:[", ","+",c-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[c>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[c>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(T,{text:t.abstract,highlight:x})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:h}),(t.tags.length>0||f.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(l=>e.jsx(G,{slug:l,onClick:n},l)),f.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,ae as P,I as S,G as T,q as a}; diff --git a/assets/dialog-vRXA8k-N.js b/assets/dialog-CSh5S1Qx.js similarity index 99% rename from assets/dialog-vRXA8k-N.js rename to assets/dialog-CSh5S1Qx.js index 66f544c3336e603679c6086f10be4e63cb2248e1..16b81f4195835db9019b80425dab635d343d08e0 100644 --- a/assets/dialog-vRXA8k-N.js +++ b/assets/dialog-CSh5S1Qx.js @@ -1,4 +1,4 @@ -import{r as s,j as i,a2 as Z,l as K,W as R,P as N,a3 as U,k as D,o as x,q as X,m as h,a4 as Y,a5 as J,a6 as Q,a7 as ee,a8 as te,a9 as oe,X as ne,s as p}from"./index-C7DzD1KZ.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?Z(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=X(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=K({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};P.displayName=C;var O="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(O,o),r=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(U,{asChild:!0,container:n,children:l})}))})};w.displayName=E;var y="DialogOverlay",A=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(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(J,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(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 Y(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=h(t,d);return Q(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",F=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});F.displayName=_;var M="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(M,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=M;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. +import{r as s,j as i,a2 as Z,l as K,W as R,P as N,a3 as U,k as D,o as x,q as X,m as h,a4 as Y,a5 as J,a6 as Q,a7 as ee,a8 as te,a9 as oe,X as ne,s as p}from"./index-DB5YVNrt.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?Z(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=X(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=K({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};P.displayName=C;var O="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(O,o),r=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(U,{asChild:!0,container:n,children:l})}))})};w.displayName=E;var y="DialogOverlay",A=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(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(J,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(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 Y(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=h(t,d);return Q(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",F=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});F.displayName=_;var M="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(M,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=M;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. diff --git a/assets/external-link-DY1V39Iz.js b/assets/external-link-CwxK3W8X.js similarity index 89% rename from assets/external-link-DY1V39Iz.js rename to assets/external-link-CwxK3W8X.js index f52279d7289a34fc20c9ce2e4490df7cb16566ce..d2df29eea79da75811689d6ce37d038fca691ea5 100644 --- a/assets/external-link-DY1V39Iz.js +++ b/assets/external-link-CwxK3W8X.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-C7DzD1KZ.js";/** +import{e as a}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-BW4Xze_N.js b/assets/file-text-Dqp9ANqN.js similarity index 92% rename from assets/file-text-BW4Xze_N.js rename to assets/file-text-Dqp9ANqN.js index 0d251e0c0b3c1a8e7f1f47704d37e288f298a8cf..968e2a00a2cfc383a87325fb4d5fbc45acda714b 100644 --- a/assets/file-text-BW4Xze_N.js +++ b/assets/file-text-Dqp9ANqN.js @@ -1,4 +1,4 @@ -import{e}from"./index-C7DzD1KZ.js";/** +import{e}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-BPMZ1b4l.js b/assets/github-CYSQLKIg.js similarity index 92% rename from assets/github-BPMZ1b4l.js rename to assets/github-CYSQLKIg.js index a8f37c7f501b6e68216536d1f7a956a4c97cb17b..03ae3095889c0082ce5be58748d14bec0c056899 100644 --- a/assets/github-BPMZ1b4l.js +++ b/assets/github-CYSQLKIg.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-C7DzD1KZ.js";/** +import{e as c}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-CBv5TgZv.js b/assets/github-nBYzmzBK.js similarity index 97% rename from assets/github-CBv5TgZv.js rename to assets/github-nBYzmzBK.js index 709d3aa7a4315af14a103c723dd484cfa11ff047..e8f30a20d10c084bdc91d970764647b6df6b7b6f 100644 --- a/assets/github-CBv5TgZv.js +++ b/assets/github-nBYzmzBK.js @@ -1,4 +1,4 @@ -import{e as l,E as u}from"./index-C7DzD1KZ.js";/** +import{e as l,E as u}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-CD-KpVUV.js b/assets/hover-card-De01BraD.js similarity index 98% rename from assets/hover-card-CD-KpVUV.js rename to assets/hover-card-De01BraD.js index a898e6fe25195e557b917bb903181194766cb61a..8c82490256eca8dcf51d0bc65f0e48e6df7b16ce 100644 --- a/assets/hover-card-CD-KpVUV.js +++ b/assets/hover-card-De01BraD.js @@ -1 +1 @@ -import{r as n,l as M,j as c,ab as F,ac as I,k as U,o as l,ad as T,P as O,a3 as $,q as W,m as z,a8 as B,ae as G,af as K,s as q}from"./index-C7DzD1KZ.js";var E,g="HoverCard",[y]=W(g,[T]),w=T(),[V,S]=y(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=M({prop:s,defaultProp:a??!1,onChange:i,caller:g}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),k=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:k,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=w(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(J,{scope:o,forceMount:r,children:c.jsx(O,{present:r||i.open,children:c.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=S(R,e.__scopeHoverCard);return c.jsx(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,b(i.onOpen)),onPointerLeave:l(e.onPointerLeave,b(i.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=S(R,r),C=w(r),u=n.useRef(null),h=z(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),c.jsx(B,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(i,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function b(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.jsx(L,{ref:a,align:o,sideOffset:r,className:q("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ce as a,ne as b}; +import{r as n,l as M,j as c,ab as F,ac as I,k as U,o as l,ad as T,P as O,a3 as $,q as W,m as z,a8 as B,ae as G,af as K,s as q}from"./index-DB5YVNrt.js";var E,g="HoverCard",[y]=W(g,[T]),w=T(),[V,S]=y(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=M({prop:s,defaultProp:a??!1,onChange:i,caller:g}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),k=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:k,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=w(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(J,{scope:o,forceMount:r,children:c.jsx(O,{present:r||i.open,children:c.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=S(R,e.__scopeHoverCard);return c.jsx(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,b(i.onOpen)),onPointerLeave:l(e.onPointerLeave,b(i.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=S(R,r),C=w(r),u=n.useRef(null),h=z(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),c.jsx(B,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(i,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function b(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.jsx(L,{ref:a,align:o,sideOffset:r,className:q("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ce as a,ne as b}; diff --git a/assets/index-1iwK_I9Y.js b/assets/index-CeWrpp9N.js similarity index 99% rename from assets/index-1iwK_I9Y.js rename to assets/index-CeWrpp9N.js index d8b536a1e62b6fcec11897819fe1f0a1bd7e81e3..bcfc53d642b74cc95c112a8b5fac7a8aabf56f52 100644 --- a/assets/index-1iwK_I9Y.js +++ b/assets/index-CeWrpp9N.js @@ -1,4 +1,4 @@ -import{ag as nn,U as or,j as pn}from"./index-C7DzD1KZ.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{ag as nn,U as or,j as pn}from"./index-DB5YVNrt.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;++Hi.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-CIbMmWPg.js","assets/useQuery-gfOJVfRZ.js","assets/useMutation-Bi00GAL7.js","assets/button-BvgK708w.js","assets/paperEdits-D718tWaT.js","assets/FeedView-LQ-88lWw.js","assets/components--1z4Qw5F.js","assets/LatexTitle-DcOGOHZH.js","assets/katex.min-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/transform-CnBvOSlq.js","assets/papers-CTasJek9.js","assets/safeExternalHref-CkBrsh84.js","assets/useIntersectionObserver-CmsvWF1K.js","assets/popover-BqJw3haa.js","assets/chatLaunch-DPlGkVok.js","assets/chat-C792FSN8.js","assets/chevron-down-CLKJ3Wue.js","assets/catalog-HFAZrKSg.js","assets/chatPrompts-CDY3UGU1.js","assets/usePapers-CT5co6TZ.js","assets/useInfiniteQuery-CqugEgpc.js","assets/skeleton-jY-za2d8.js","assets/alert-BPNeeF4s.js","assets/ChatView-BSLUlS0a.js","assets/ArtifactWorkspace-DGDexY_Q.js","assets/hover-card-De01BraD.js","assets/github-nBYzmzBK.js","assets/github-CYSQLKIg.js","assets/PaperPreviewLink-Bi7j2lR1.js","assets/index-CeWrpp9N.js","assets/file-text-Dqp9ANqN.js","assets/external-link-CwxK3W8X.js","assets/ArtifactWorkspace-Lr_OJaUk.css","assets/openrouter-DZnDVTdj.js","assets/SharedChatView-DR9rp5FK.js","assets/PapersListView-Dr9p0OKb.js","assets/useDebounce-CbVfyok_.js","assets/PaperDetailView-CGlbwKQ5.js","assets/ExternalSourceEvalBadge-BZEagV7N.js","assets/ExternalSourceEvalBadge-DXfuqNnO.css","assets/latexPlainText-DI8YEXVe.js","assets/dialog-CSh5S1Qx.js","assets/input-DnxeMTC9.js","assets/searchable-select-Bw0OPNzm.js","assets/loader-circle-uWjxppt1.js","assets/submissions-B7ABJ5o_.js","assets/SignInToEditDialog-CGuRD5vY.js","assets/textarea-rFUixZHL.js","assets/codexAddEvals-QYl6p5qH.js","assets/index-OagizEwS.js","assets/badge-C_UuzwL3.js","assets/savedPapersAuth-Ca15fo9W.js","assets/PaperDetailView-BZHxkTed.css","assets/PaperReaderView-CkWbXoez.js","assets/TagsIndexView-rZIkfOik.js","assets/slug-BpH-Nkvz.js","assets/TaxonomySuggestionTile-5FXmjrqa.js","assets/TagBrowseView-MvhMQ4qP.js","assets/BenchmarkTrendSparkline-DrH77nK8.js","assets/MarkdownText-tXCrsggq.js","assets/MethodsIndexView-BXUyb9I0.js","assets/FrameworksIndexView-Db4cbi0M.js","assets/TrendsView-DSNVxz_8.js","assets/ConferencesIndexView-CXeV-ywe.js","assets/AiDeadlinesView-DDL8uO29.js","assets/switch-CVNSFNdW.js","assets/ConferenceDetailView-BO1fOFQD.js","assets/ConferenceTaskView-CP0FthV6.js","assets/OrganizationsIndexView-C1qkT5g2.js","assets/OrganizationsIndexView-dniuSNch.css","assets/OrganizationDetailView-DuTpsK8_.js","assets/OrganizationPaperFeed-H45zTXDr.js","assets/OrganizationContributionGraph-B2Y_Bv62.js","assets/NotFound-BO9K9saD.js","assets/OrganizationTaskView-CaRpjxan.js","assets/AuthorDetailView-DsixzDxp.js","assets/MethodDetailView-D7RjDc12.js","assets/BenchmarkDetailView-CYzt8vxy.js","assets/BenchmarkDetailView-DZ1SdnW-.css","assets/SavedPapersView-DlTA25Xb.js","assets/SettingsView--d7NFlEH.js","assets/PrivacyView-CJulinZK.js","assets/SubmitView-BUMlU8NL.js","assets/CronDashboard-BVydZ-r3.js","assets/operations-CJQ0CXcc.js","assets/shield-alert-TqnwXhnw.js","assets/refresh-cw-HoaNTnTk.js","assets/circle-check-BPVxNUGc.js","assets/CronDashboard-DwChfW9h.css","assets/AutonomousOperations-B7IW_M7l.js","assets/SubmissionsDashboard-BRy4uEhT.js","assets/SubmissionsDashboard-2iSRk_ue.css","assets/UserProfileView-lUDzgohd.js","assets/RateLimitsView-Dnm4htYe.js","assets/SearchOverlay-HhaSArDa.js","assets/StagingAccessRequestView-Dfhd_TCr.js"])))=>i.map(i=>d[i]); var RC=Object.defineProperty;var nm=t=>{throw TypeError(t)};var IC=(t,e,r)=>e in t?RC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var xs=(t,e,r)=>IC(t,typeof e!="symbol"?e+"":e,r),Rd=(t,e,r)=>e.has(t)||nm("Cannot "+r);var A=(t,e,r)=>(Rd(t,e,"read from private field"),r?r.call(t):e.get(t)),ce=(t,e,r)=>e.has(t)?nm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),re=(t,e,r,n)=>(Rd(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),ut=(t,e,r)=>(Rd(t,e,"access private method"),r);var El=(t,e,r,n)=>({set _(s){re(t,e,s,r)},get _(){return A(t,e,n)}});function OC(t,e){for(var r=0;rn[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var ez=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function G0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var K0={exports:{}},zc={},Q0={exports:{}},ue={};/** * @license React * react.production.min.js @@ -156,4 +156,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 vj=bd("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),gj=oj,mj=aj,yj=y.forwardRef(({className:t,inset:e,children:r,...n},s)=>x.jsxs(Ok,{ref:s,className:at("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),...n,children:[r,x.jsx(hj,{className:"ml-auto h-4 w-4"})]}));yj.displayName=Ok.displayName;const _j=y.forwardRef(({className:t,...e},r)=>x.jsx(Mk,{ref:r,className:at("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}));_j.displayName=Mk.displayName;const Ak=y.forwardRef(({className:t,sideOffset:e=4,...r},n)=>x.jsx(lj,{children:x.jsx(Sk,{ref:n,sideOffset:e,className:at("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),...r})}));Ak.displayName=Sk.displayName;const sn=y.forwardRef(({className:t,inset:e,...r},n)=>x.jsx(Ck,{ref:n,className:at("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),...r}));sn.displayName=Ck.displayName;const wj=y.forwardRef(({className:t,children:e,checked:r,...n},s)=>x.jsxs(Pk,{ref:s,className:at("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:r,...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(Rk,{children:x.jsx(fj,{className:"h-4 w-4"})})}),e]}));wj.displayName=Pk.displayName;const xj=y.forwardRef(({className:t,children:e,...r},n)=>x.jsxs(Tk,{ref:n,className:at("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),...r,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(Rk,{children:x.jsx(pj,{className:"h-2 w-2 fill-current"})})}),e]}));xj.displayName=Tk.displayName;const $k=y.forwardRef(({className:t,inset:e,...r},n)=>x.jsx(kk,{ref:n,className:at("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));$k.displayName=kk.displayName;const Xp=y.forwardRef(({className:t,...e},r)=>x.jsx(Ik,{ref:r,className:at("-mx-1 my-1 h-px bg-muted",t),...e}));Xp.displayName=Ik.displayName;function bj(t){const r=(t.name||t.username||"?").trim().split(/\s+/).filter(Boolean);return r.length===0?"?":r.length===1?r[0][0].toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}const Ej=({user:t,onLogout:e})=>x.jsxs(gj,{children:[x.jsx(mj,{asChild:!0,children:x.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:x.jsxs(W1,{className:"h-8 w-8",children:[t.avatar_url&&x.jsx(G1,{src:t.avatar_url,alt:t.username}),x.jsx(K1,{className:"text-xs",children:bj(t)})]})})}),x.jsxs(Ak,{align:"end",className:"w-56",children:[x.jsxs($k,{className:"flex flex-col gap-0.5 py-2",children:[x.jsx("span",{className:"text-sm font-medium leading-tight",children:t.name||t.username}),x.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",t.username]}),t.is_admin&&x.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"&&x.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"})]}),x.jsx(Xp,{}),x.jsx(sn,{asChild:!0,children:x.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),x.jsx(sn,{asChild:!0,children:x.jsx(qn,{to:"/frameworks",children:"Frameworks"})}),x.jsx(sn,{asChild:!0,children:x.jsx(qn,{to:"/trends",children:"Trends"})}),t.is_admin&&x.jsxs(x.Fragment,{children:[x.jsx(sn,{asChild:!0,children:x.jsx(qn,{to:"/admin-dashboard",children:"Admin dashboard"})}),x.jsx(sn,{asChild:!0,children:x.jsx(qn,{to:"/submissions",children:"Review submissions"})})]}),x.jsx(sn,{asChild:!0,children:x.jsx(qn,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),x.jsx(sn,{asChild:!0,children:x.jsx(qn,{to:"/settings",children:"Settings"})}),x.jsx(Xp,{}),x.jsx(sn,{onSelect:r=>{r.preventDefault(),e()},children:"Log out"})]})]}),Sj="cronAdminToken";function kj(){var t;return typeof window>"u"?"":((t=window.localStorage.getItem(Sj))==null?void 0:t.trim())??""}const Cj=!1;class Lk extends Error{constructor(r,n){var s;super(`API request failed: ${r.status} ${r.statusText}`);xs(this,"status");xs(this,"statusText");xs(this,"response");xs(this,"detail");xs(this,"code");this.name="ApiError",this.status=r.status,this.statusText=r.statusText,this.response=n;try{if(this.detail=(s=JSON.parse(n))==null?void 0:s.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 Pj{constructor(e){this.baseUrl=e}async fetch(e,r){const n=`${this.baseUrl}${e}`;try{const{headers:s,...i}=r??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=kj(),u=new Headers(s);return u.has("Content-Type")||u.set("Content-Type","application/json"),l&&!u.has("X-Admin-Token")&&u.set("X-Admin-Token",l),await fetch(n,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:u})}catch(s){throw console.error(`[API] Request to ${n} failed:`,s),s}}async request(e,r){const n=await this.fetch(e,r);if(!n.ok){const i=new Lk(n,await n.text());throw console.error("[API] Error response:",i.response),i}return n.status===204?void 0:await n.json()}}function Tj(t){t instanceof Lk&&t.status===401&&t.code!=="fresh_auth_required"&&t.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"))}async function Rj(t){try{return await t()}catch(e){throw Tj(e),e}}const Fk=new Pj(`${Sg()}/api/v1`),Ij=(t,e)=>Fk.fetch(t,e),Jp=(t,e)=>Rj(()=>Fk.request(t,e)),E0={async getCurrentUser(){if(gl())return null;const t=await Ij("/auth/me",{cache:"no-store"});return t.status===401||!t.ok?null:t.json()},async logout(){await Jp("/auth/logout",{method:"POST"})},async requestStagingAccess(){await Jp("/staging-access-request",{method:"POST"})}},jk=I.createContext(null),S0="pwc:auth-stale",Oj=({children:t})=>{const[e,r]=I.useState(null),[n,s]=I.useState(!0),i=I.useCallback(async()=>{s(!0);const l=await E0.getCurrentUser();r(l),s(!1)},[]),o=I.useCallback(async()=>{const l=kg("/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 E0.logout(),r(null)},[]);I.useEffect(()=>{i()},[i]),I.useEffect(()=>{},[e]),I.useEffect(()=>{const l=()=>{r(null)};return window.addEventListener(S0,l),()=>window.removeEventListener(S0,l)},[]);const a=I.useMemo(()=>({user:e,isLoading:n,refresh:i,logout:o}),[e,n,i,o]);return x.jsx(jk.Provider,{value:a,children:t})};function Kg(){const t=I.useContext(jk);if(!t)throw new Error("useAuth must be used inside an ");return t}const Ei=({name:t,size:e=14})=>{const r={search:x.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:x.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:x.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:x.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return x.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:r[t]})},k0="https://github.com/huggingface/paperswithcode-feedback/issues",Mj="https://github.com/huggingface/pwc-cli",C0="pwc:announcement:pwc-cli:v1:dismissed",Yf=[{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}],Nj=()=>{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)},Aj=()=>{const[t,e]=I.useState(!1);return I.useEffect(()=>{e(Nj())},[]),x.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},P0=({onOpenSearch:t})=>{const[e,r]=I.useState(!1),[n,s]=I.useState(()=>localStorage.getItem(C0)!=="1"),i=I.useRef(null),o=I.useRef(null),a=()=>r(!1),{user:l,logout:u}=Kg(),c=Nr(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",h=gl(),_=Mc()?[Yf[0],{to:"/chat",label:"Chat",end:!1,badge:"New"},...Yf.slice(1)]:Yf;return I.useLayoutEffect(()=>{var E;const p=i.current,m=o.current;if(!p||!m)return;let v=!1;const g=()=>{if(v)return;const S=p.querySelector(".nav-item.active"),C=(S==null?void 0:S.offsetWidth)??0;m.style.width=`${C}px`,m.style.transform=`translateX(${(S==null?void 0:S.offsetLeft)??0}px)`,m.style.opacity=C>0?"1":"0"};g();const w=window.requestAnimationFrame(()=>{m.classList.add("nav-indicator-ready")}),b=typeof ResizeObserver>"u"?null:new ResizeObserver(g);return b==null||b.observe(p),window.addEventListener("resize",g),(E=document.fonts)==null||E.ready.then(g),()=>{v=!0,window.cancelAnimationFrame(w),b==null||b.disconnect(),window.removeEventListener("resize",g)}},[c.pathname,_.length]),x.jsxs(x.Fragment,{children:[x.jsxs("header",{className:"app-header",children:[x.jsxs("div",{className:"app-header-inner",children:[x.jsxs(_i,{to:"/",className:"brand",onClick:a,children:[x.jsx("span",{className:"brand-mark"}),x.jsxs("span",{className:"brand-name",children:["Papers ",x.jsx("em",{children:"With Code"})]})]}),x.jsxs("nav",{className:"nav",ref:i,children:[_.map(({to:p,label:m,end:v,badge:g})=>x.jsxs(_i,{to:p,end:v,className:({isActive:w})=>`nav-item${g?" nav-item-with-badge":""}${w?" active":""}`,children:[x.jsx("span",{children:m}),g&&x.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:g})]},p)),x.jsx("span",{ref:o,className:"nav-indicator","aria-hidden":"true"})]}),x.jsx("div",{className:"header-spacer"}),x.jsx("a",{className:"feedback-link header-feedback-link",href:k0,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),x.jsxs("button",{className:"search-trigger",onClick:t,children:[x.jsx(Ei,{name:"search",size:13}),x.jsx("span",{children:"Search papers, authors, domains…"}),x.jsx(Aj,{})]}),x.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:x.jsx(Ei,{name:"search",size:14})}),!h&&x.jsx(_i,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:x.jsx(Ei,{name:"bookmark",size:13})}),h?null:l?x.jsx(Ej,{user:l,onLogout:u}):x.jsx(k1,{returnTo:f}),x.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>r(p=>!p),children:x.jsx(Ei,{name:e?"close":"menu",size:14})})]}),!d&&n&&x.jsxs("div",{className:"site-announcement",role:"status",children:[x.jsx("span",{children:"New: Papers with Code CLI and Skill now "}),x.jsx("a",{href:Mj,target:"_blank",rel:"noreferrer",children:"available"}),x.jsx("button",{type:"button",className:"site-announcement-close","aria-label":"Dismiss announcement",onClick:()=>{localStorage.setItem(C0,"1"),s(!1)},children:x.jsx(Ei,{name:"close",size:11})})]})]}),e&&x.jsx("div",{className:"mobile-nav-drawer",onClick:a,children:x.jsxs("div",{className:"mobile-nav-panel",onClick:p=>p.stopPropagation(),children:[x.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),t()},children:[x.jsx(Ei,{name:"search",size:14}),x.jsx("span",{children:"Search papers, authors, domains…"})]}),_.map(({to:p,label:m,end:v,badge:g})=>x.jsxs(_i,{to:p,end:v,className:`mobile-nav-link${g?" mobile-nav-link-with-badge":""}`,onClick:a,children:[x.jsx("span",{children:m}),g&&x.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:g})]},p)),x.jsx("a",{className:"mobile-nav-link",href:k0,target:"_blank",rel:"noreferrer",onClick:a,children:"Submit feedback"}),!h&&x.jsx(_i,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!h&&(l==null?void 0:l.is_admin)&&x.jsx(_i,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})]})},$j=()=>{const{pathname:t}=Nr();return t==="/chat"||t.startsWith("/chat/")||t.startsWith("/pdf/")?null:x.jsx("footer",{className:"site-footer",children:x.jsxs("div",{className:"site-footer-inner",children:[x.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),x.jsx(qn,{to:"/privacy",children:"Privacy"}),x.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},Lj=1,Fj=1e6;let Xf=0;function jj(){return Xf=(Xf+1)%Number.MAX_SAFE_INTEGER,Xf.toString()}const Jf=new Map,T0=t=>{if(Jf.has(t))return;const e=setTimeout(()=>{Jf.delete(t),Pa({type:"REMOVE_TOAST",toastId:t})},Fj);Jf.set(t,e)},Dj=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Lj)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?T0(r):t.toasts.forEach(n=>{T0(n.id)}),{...t,toasts:t.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},Iu=[];let Ou={toasts:[]};function Pa(t){Ou=Dj(Ou,t),Iu.forEach(e=>{e(Ou)})}function zj({...t}){const e=jj(),r=s=>Pa({type:"UPDATE_TOAST",toast:{...s,id:e}}),n=()=>Pa({type:"DISMISS_TOAST",toastId:e});return Pa({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||n()}}}),{id:e,dismiss:n,update:r}}function Bj(){const[t,e]=y.useState(Ou);return y.useEffect(()=>(Iu.push(e),()=>{const r=Iu.indexOf(e);r>-1&&Iu.splice(r,1)}),[t]),{...t,toast:zj,dismiss:r=>Pa({type:"DISMISS_TOAST",toastId:r})}}var Uj=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"}),Vj="VisuallyHidden",Ed=y.forwardRef((t,e)=>x.jsx(qe.span,{...t,ref:e,style:{...Uj,...t.style}}));Ed.displayName=Vj;var qj=Ed,Qg="ToastProvider",[Yg,Hj,Wj]=Og("Toast"),[Dk]=oi("Toast",[Wj]),[Gj,Sd]=Dk(Qg),zk=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=y.useState(null),[u,c]=y.useState(0),d=y.useRef(!1),f=y.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Qg}\`. Expected non-empty \`string\`.`),x.jsx(Yg.Provider,{scope:e,children:x.jsx(Gj,{scope:e,label:r,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:y.useCallback(()=>c(h=>h+1),[]),onToastRemove:y.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};zk.displayName=Qg;var Bk="ToastViewport",Kj=["F8"],Zp="toast.viewportPause",ev="toast.viewportResume",Uk=y.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=Kj,label:s="Notifications ({hotkey})",...i}=t,o=Sd(Bk,r),a=Hj(r),l=y.useRef(null),u=y.useRef(null),c=y.useRef(null),d=y.useRef(null),f=ot(e,d,o.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;y.useEffect(()=>{const m=v=>{var w;n.length!==0&&n.every(b=>v[b]||v.code===b)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[n]),y.useEffect(()=>{const m=l.current,v=d.current;if(_&&m&&v){const g=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(Zp);v.dispatchEvent(S),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(ev);v.dispatchEvent(S),o.isClosePausedRef.current=!1}},b=S=>{!m.contains(S.relatedTarget)&&w()},E=()=>{m.contains(document.activeElement)||w()};return m.addEventListener("focusin",g),m.addEventListener("focusout",b),m.addEventListener("pointermove",g),m.addEventListener("pointerleave",E),window.addEventListener("blur",g),window.addEventListener("focus",w),()=>{m.removeEventListener("focusin",g),m.removeEventListener("focusout",b),m.removeEventListener("pointermove",g),m.removeEventListener("pointerleave",E),window.removeEventListener("blur",g),window.removeEventListener("focus",w)}}},[_,o.isClosePausedRef]);const p=y.useCallback(({tabbingDirection:m})=>{const g=a().map(w=>{const b=w.ref.current,E=[b,...aD(b)];return m==="forwards"?E:E.reverse()});return(m==="forwards"?g.reverse():g).flat()},[a]);return y.useEffect(()=>{const m=d.current;if(m){const v=g=>{var E,S,C;const w=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!w){const k=document.activeElement,R=g.shiftKey;if(g.target===m&&R){(E=u.current)==null||E.focus();return}const N=p({tabbingDirection:R?"backwards":"forwards"}),B=N.findIndex(F=>F===k);Zf(N.slice(B+1))?g.preventDefault():R?(S=u.current)==null||S.focus():(C=c.current)==null||C.focus()}};return m.addEventListener("keydown",v),()=>m.removeEventListener("keydown",v)}},[a,p]),x.jsxs(x$,{ref:l,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&x.jsx(tv,{ref:u,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"forwards"});Zf(m)}}),x.jsx(Yg.Slot,{scope:r,children:x.jsx(qe.ol,{tabIndex:-1,...i,ref:f})}),_&&x.jsx(tv,{ref:c,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"backwards"});Zf(m)}})]})});Uk.displayName=Bk;var Vk="ToastFocusProxy",tv=y.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=t,i=Sd(Vk,r);return x.jsx(Ed,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&n()}})});tv.displayName=Vk;var xl="Toast",Qj="toast.swipeStart",Yj="toast.swipeMove",Xj="toast.swipeCancel",Jj="toast.swipeEnd",qk=y.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=Rg({prop:n,defaultProp:s??!0,onChange:i,caller:xl});return x.jsx(ai,{present:r||a,children:x.jsx(tD,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Bt(t.onPause),onResume:Bt(t.onResume),onSwipeStart:Z(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Z(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:Z(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:Z(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)})})})});qk.displayName=xl;var[Zj,eD]=Dk(xl,{onClose(){}}),tD=y.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,..._}=t,p=Sd(xl,r),[m,v]=y.useState(null),g=ot(e,F=>v(F)),w=y.useRef(null),b=y.useRef(null),E=s||p.duration,S=y.useRef(0),C=y.useRef(E),k=y.useRef(0),{onToastAdd:R,onToastRemove:P}=p,$=Bt(()=>{var W;(m==null?void 0:m.contains(document.activeElement))&&((W=p.viewport)==null||W.focus()),o()}),N=y.useCallback(F=>{!F||F===1/0||(window.clearTimeout(k.current),S.current=new Date().getTime(),k.current=window.setTimeout($,F))},[$]);y.useEffect(()=>{const F=p.viewport;if(F){const W=()=>{N(C.current),u==null||u()},q=()=>{const G=new Date().getTime()-S.current;C.current=C.current-G,window.clearTimeout(k.current),l==null||l()};return F.addEventListener(Zp,q),F.addEventListener(ev,W),()=>{F.removeEventListener(Zp,q),F.removeEventListener(ev,W)}}},[p.viewport,E,l,u,N]),y.useEffect(()=>{i&&!p.isClosePausedRef.current&&N(E)},[i,E,p.isClosePausedRef,N]),y.useEffect(()=>(R(),()=>P()),[R,P]);const B=y.useMemo(()=>m?Xk(m):null,[m]);return p.viewport?x.jsxs(x.Fragment,{children:[B&&x.jsx(rD,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite",children:B}),x.jsx(Zj,{scope:r,onClose:$,children:pl.createPortal(x.jsx(Yg.ItemSlot,{scope:r,children:x.jsx(w$,{asChild:!0,onEscapeKeyDown:Z(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||$(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:x.jsx(qe.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,..._,ref:g,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Z(t.onKeyDown,F=>{F.key==="Escape"&&(a==null||a(F.nativeEvent),F.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:Z(t.onPointerDown,F=>{F.button===0&&(w.current={x:F.clientX,y:F.clientY})}),onPointerMove:Z(t.onPointerMove,F=>{if(!w.current)return;const W=F.clientX-w.current.x,q=F.clientY-w.current.y,G=!!b.current,M=["left","right"].includes(p.swipeDirection),T=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,z=M?T(0,W):0,K=M?0:T(0,q),H=F.pointerType==="touch"?10:2,Q={x:z,y:K},X={originalEvent:F,delta:Q};G?(b.current=Q,ou(Yj,d,X,{discrete:!1})):R0(Q,p.swipeDirection,H)?(b.current=Q,ou(Qj,c,X,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(W)>H||Math.abs(q)>H)&&(w.current=null)}),onPointerUp:Z(t.onPointerUp,F=>{const W=b.current,q=F.target;if(q.hasPointerCapture(F.pointerId)&&q.releasePointerCapture(F.pointerId),b.current=null,w.current=null,W){const G=F.currentTarget,M={originalEvent:F,delta:W};R0(W,p.swipeDirection,p.swipeThreshold)?ou(Jj,h,M,{discrete:!0}):ou(Xj,f,M,{discrete:!0}),G.addEventListener("click",T=>T.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),rD=t=>{const{__scopeToast:e,children:r,...n}=t,s=Sd(xl,e),[i,o]=y.useState(!1),[a,l]=y.useState(!1);return iD(()=>o(!0)),y.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:x.jsx(zg,{asChild:!0,children:x.jsx(Ed,{...n,children:i&&x.jsxs(x.Fragment,{children:[s.label," ",r]})})})},nD="ToastTitle",Hk=y.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return x.jsx(qe.div,{...n,ref:e})});Hk.displayName=nD;var sD="ToastDescription",Wk=y.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return x.jsx(qe.div,{...n,ref:e})});Wk.displayName=sD;var Gk="ToastAction",Kk=y.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?x.jsx(Yk,{altText:r,asChild:!0,children:x.jsx(Xg,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${Gk}\`. Expected non-empty \`string\`.`),null)});Kk.displayName=Gk;var Qk="ToastClose",Xg=y.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,s=eD(Qk,r);return x.jsx(Yk,{asChild:!0,children:x.jsx(qe.button,{type:"button",...n,ref:e,onClick:Z(t.onClick,s.onClose)})})});Xg.displayName=Qk;var Yk=y.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...s}=t;return x.jsx(qe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:e})});function Xk(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),oD(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...Xk(n))}}),e}function ou(t,e,r,{discrete:n}){const s=r.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?Ig(s,i):s.dispatchEvent(i)}var R0=(t,e,r=0)=>{const n=Math.abs(t.x),s=Math.abs(t.y),i=n>s;return e==="left"||e==="right"?i&&n>r:!i&&s>r};function iD(t=()=>{}){const e=Bt(t);hr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function oD(t){return t.nodeType===t.ELEMENT_NODE}function aD(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Zf(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var lD=zk,Jk=Uk,Zk=qk,eC=Hk,tC=Wk,rC=Kk,nC=Xg;const I0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,O0=z1,uD=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return O0(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const c=r==null?void 0:r[u],d=i==null?void 0:i[u];if(c===null)return null;const f=I0(c)||I0(d);return s[u][f]}),a=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(_=>{let[p,m]=_;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...u,d,f]:u},[]);return O0(t,o,l,r==null?void 0:r.class,r==null?void 0:r.className)},cD=lD,sC=y.forwardRef(({className:t,...e},r)=>x.jsx(Jk,{ref:r,className:at("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}));sC.displayName=Jk.displayName;const dD=uD("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"}}),iC=y.forwardRef(({className:t,variant:e,...r},n)=>x.jsx(Zk,{ref:n,className:at(dD({variant:e}),t),...r}));iC.displayName=Zk.displayName;const fD=y.forwardRef(({className:t,...e},r)=>x.jsx(rC,{ref:r,className:at("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}));fD.displayName=rC.displayName;const oC=y.forwardRef(({className:t,...e},r)=>x.jsx(nC,{ref:r,className:at("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:x.jsx(vj,{className:"h-4 w-4"})}));oC.displayName=nC.displayName;const aC=y.forwardRef(({className:t,...e},r)=>x.jsx(eC,{ref:r,className:at("text-sm font-semibold",t),...e}));aC.displayName=eC.displayName;const lC=y.forwardRef(({className:t,...e},r)=>x.jsx(tC,{ref:r,className:at("text-sm opacity-90",t),...e}));lC.displayName=tC.displayName;function hD(){const{toasts:t}=Bj();return x.jsxs(cD,{children:[t.map(function({id:e,title:r,description:n,action:s,...i}){return x.jsxs(iC,{...i,children:[x.jsxs("div",{className:"grid gap-1",children:[r&&x.jsx(aC,{children:r}),n&&x.jsx(lC,{children:n})]}),s,x.jsx(oC,{})]},e)}),x.jsx(sC,{})]})}var pD=t=>{switch(t){case"success":return mD;case"info":return _D;case"warning":return yD;case"error":return wD;default:return null}},vD=Array(12).fill(0),gD=({visible:t,className:e})=>I.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},I.createElement("div",{className:"sonner-spinner"},vD.map((r,n)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),mD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),yD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.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"})),_D=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),wD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),xD=I.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"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),bD=()=>{let[t,e]=I.useState(document.hidden);return I.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},rv=1,ED=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:r,...n}=t,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:rv++,i=this.toasts.find(a=>a.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...t,id:s,title:r}),{...a,...t,id:s,dismissible:o,title:r}):a):this.addToast({title:r,...n,dismissible:o,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(r=>r({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 r;e.loading!==void 0&&(r=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=t instanceof Promise?t:t(),s=r!==void 0,i,o=n.then(async l=>{if(i=["resolve",l],I.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(kD(l)&&!l.ok){s=!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:r,type:"error",message:u,description:c})}else if(e.success!==void 0){s=!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:r,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){s=!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:r,type:"error",message:u,description:c})}}).finally(()=>{var l;s&&(this.dismiss(r),r=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,u)=>o.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:a}:Object.assign(r,{unwrap:a})},this.custom=(t,e)=>{let r=(e==null?void 0:e.id)||rv++;return this.create({jsx:t(r),id:r,...e}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Nt=new ED,SD=(t,e)=>{let r=(e==null?void 0:e.id)||rv++;return Nt.addToast({title:t,...e,id:r}),r},kD=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",CD=SD,PD=()=>Nt.toasts,TD=()=>Nt.getActiveToasts();Object.assign(CD,{success:Nt.success,info:Nt.info,warning:Nt.warning,error:Nt.error,custom:Nt.custom,message:Nt.message,promise:Nt.promise,dismiss:Nt.dismiss,loading:Nt.loading},{getHistory:PD,getToasts:TD});function RD(t,{insertAt:e}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}RD(`: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 au(t){return t.label!==void 0}var ID=3,OD="32px",MD="16px",M0=4e3,ND=356,AD=14,$D=20,LD=200;function wr(...t){return t.filter(Boolean).join(" ")}function FD(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var jD=t=>{var e,r,n,s,i,o,a,l,u,c,d;let{invert:f,toast:h,unstyled:_,interacting:p,setHeights:m,visibleToasts:v,heights:g,index:w,toasts:b,expanded:E,removeToast:S,defaultRichColors:C,closeButton:k,style:R,cancelButtonStyle:P,actionButtonStyle:$,className:N="",descriptionClassName:B="",duration:F,position:W,gap:q,loadingIcon:G,expandByDefault:M,classNames:T,icons:z,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:H}=t,[Q,X]=I.useState(null),[ie,pe]=I.useState(null),[se,ve]=I.useState(!1),[_e,Je]=I.useState(!1),[Ot,Ze]=I.useState(!1),[De,Jr]=I.useState(!1),[Tn,lt]=I.useState(!1),[Rn,tr]=I.useState(0),[Ut,In]=I.useState(0),On=I.useRef(h.duration||F||M0),Fo=I.useRef(null),pr=I.useRef(null),wC=w===0,xC=w+1<=v,rr=h.type,ci=h.dismissible!==!1,bC=h.className||"",EC=h.descriptionClassName||"",bl=I.useMemo(()=>g.findIndex(oe=>oe.toastId===h.id)||0,[g,h.id]),SC=I.useMemo(()=>{var oe;return(oe=h.closeButton)!=null?oe:k},[h.closeButton,k]),Zg=I.useMemo(()=>h.duration||F||M0,[h.duration,F]),Pd=I.useRef(0),di=I.useRef(0),em=I.useRef(0),fi=I.useRef(null),[kC,CC]=W.split("-"),tm=I.useMemo(()=>g.reduce((oe,Se,Le)=>Le>=bl?oe:oe+Se.height,0),[g,bl]),rm=bD(),PC=h.invert||f,Td=rr==="loading";di.current=I.useMemo(()=>bl*q+tm,[bl,tm]),I.useEffect(()=>{On.current=Zg},[Zg]),I.useEffect(()=>{ve(!0)},[]),I.useEffect(()=>{let oe=pr.current;if(oe){let Se=oe.getBoundingClientRect().height;return In(Se),m(Le=>[{toastId:h.id,height:Se,position:h.position},...Le]),()=>m(Le=>Le.filter(vr=>vr.toastId!==h.id))}},[m,h.id]),I.useLayoutEffect(()=>{if(!se)return;let oe=pr.current,Se=oe.style.height;oe.style.height="auto";let Le=oe.getBoundingClientRect().height;oe.style.height=Se,In(Le),m(vr=>vr.find(gr=>gr.toastId===h.id)?vr.map(gr=>gr.toastId===h.id?{...gr,height:Le}:gr):[{toastId:h.id,height:Le,position:h.position},...vr])},[se,h.title,h.description,m,h.id]);let Mn=I.useCallback(()=>{Je(!0),tr(di.current),m(oe=>oe.filter(Se=>Se.toastId!==h.id)),setTimeout(()=>{S(h)},LD)},[h,S,m,di]);I.useEffect(()=>{if(h.promise&&rr==="loading"||h.duration===1/0||h.type==="loading")return;let oe;return E||p||H&&rm?(()=>{if(em.current{var Se;(Se=h.onAutoClose)==null||Se.call(h,h),Mn()},On.current)),()=>clearTimeout(oe)},[E,p,h,rr,H,rm,Mn]),I.useEffect(()=>{h.delete&&Mn()},[Mn,h.delete]);function TC(){var oe,Se,Le;return z!=null&&z.loading?I.createElement("div",{className:wr(T==null?void 0:T.loader,(oe=h==null?void 0:h.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":rr==="loading"},z.loading):G?I.createElement("div",{className:wr(T==null?void 0:T.loader,(Se=h==null?void 0:h.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":rr==="loading"},G):I.createElement(gD,{className:wr(T==null?void 0:T.loader,(Le=h==null?void 0:h.classNames)==null?void 0:Le.loader),visible:rr==="loading"})}return I.createElement("li",{tabIndex:0,ref:pr,className:wr(N,bC,T==null?void 0:T.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,T==null?void 0:T.default,T==null?void 0:T[rr],(r=h==null?void 0:h.classNames)==null?void 0:r[rr]),"data-sonner-toast":"","data-rich-colors":(n=h.richColors)!=null?n:C,"data-styled":!(h.jsx||h.unstyled||_),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":Tn,"data-removed":_e,"data-visible":xC,"data-y-position":kC,"data-x-position":CC,"data-index":w,"data-front":wC,"data-swiping":Ot,"data-dismissible":ci,"data-type":rr,"data-invert":PC,"data-swipe-out":De,"data-swipe-direction":ie,"data-expanded":!!(E||M&&se),style:{"--index":w,"--toasts-before":w,"--z-index":b.length-w,"--offset":`${_e?Rn:di.current}px`,"--initial-height":M?"auto":`${Ut}px`,...R,...h.style},onDragEnd:()=>{Ze(!1),X(null),fi.current=null},onPointerDown:oe=>{Td||!ci||(Fo.current=new Date,tr(di.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(Ze(!0),fi.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Se,Le,vr;if(De||!ci)return;fi.current=null;let gr=Number(((oe=pr.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Nn=Number(((Se=pr.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ws=new Date().getTime()-((Le=Fo.current)==null?void 0:Le.getTime()),mr=Q==="x"?gr:Nn,An=Math.abs(mr)/ws;if(Math.abs(mr)>=$D||An>.11){tr(di.current),(vr=h.onDismiss)==null||vr.call(h,h),pe(Q==="x"?gr>0?"right":"left":Nn>0?"down":"up"),Mn(),Jr(!0),lt(!1);return}Ze(!1),X(null)},onPointerMove:oe=>{var Se,Le,vr,gr;if(!fi.current||!ci||((Se=window.getSelection())==null?void 0:Se.toString().length)>0)return;let Nn=oe.clientY-fi.current.y,ws=oe.clientX-fi.current.x,mr=(Le=t.swipeDirections)!=null?Le:FD(W);!Q&&(Math.abs(ws)>1||Math.abs(Nn)>1)&&X(Math.abs(ws)>Math.abs(Nn)?"x":"y");let An={x:0,y:0};Q==="y"?(mr.includes("top")||mr.includes("bottom"))&&(mr.includes("top")&&Nn<0||mr.includes("bottom")&&Nn>0)&&(An.y=Nn):Q==="x"&&(mr.includes("left")||mr.includes("right"))&&(mr.includes("left")&&ws<0||mr.includes("right")&&ws>0)&&(An.x=ws),(Math.abs(An.x)>0||Math.abs(An.y)>0)&<(!0),(vr=pr.current)==null||vr.style.setProperty("--swipe-amount-x",`${An.x}px`),(gr=pr.current)==null||gr.style.setProperty("--swipe-amount-y",`${An.y}px`)}},SC&&!h.jsx?I.createElement("button",{"aria-label":K,"data-disabled":Td,"data-close-button":!0,onClick:Td||!ci?()=>{}:()=>{var oe;Mn(),(oe=h.onDismiss)==null||oe.call(h,h)},className:wr(T==null?void 0:T.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=z==null?void 0:z.close)!=null?i:xD):null,h.jsx||y.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:I.createElement(I.Fragment,null,rr||h.icon||h.promise?I.createElement("div",{"data-icon":"",className:wr(T==null?void 0:T.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||TC():null,h.type!=="loading"?h.icon||(z==null?void 0:z[rr])||pD(rr):null):null,I.createElement("div",{"data-content":"",className:wr(T==null?void 0:T.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},I.createElement("div",{"data-title":"",className:wr(T==null?void 0:T.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?I.createElement("div",{"data-description":"",className:wr(B,EC,T==null?void 0:T.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),y.isValidElement(h.cancel)?h.cancel:h.cancel&&au(h.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:oe=>{var Se,Le;au(h.cancel)&&ci&&((Le=(Se=h.cancel).onClick)==null||Le.call(Se,oe),Mn())},className:wr(T==null?void 0:T.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,y.isValidElement(h.action)?h.action:h.action&&au(h.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:oe=>{var Se,Le;au(h.action)&&((Le=(Se=h.action).onClick)==null||Le.call(Se,oe),!oe.defaultPrevented&&Mn())},className:wr(T==null?void 0:T.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function N0(){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 DD(t,e){let r={};return[t,e].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?MD:OD;function l(u){["top","right","bottom","left"].forEach(c=>{r[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=a:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(a)}),r}var zD=y.forwardRef(function(t,e){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:f,style:h,visibleToasts:_=ID,toastOptions:p,dir:m=N0(),gap:v=AD,loadingIcon:g,icons:w,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:E}=t,[S,C]=I.useState([]),k=I.useMemo(()=>Array.from(new Set([n].concat(S.filter(H=>H.position).map(H=>H.position)))),[S,n]),[R,P]=I.useState([]),[$,N]=I.useState(!1),[B,F]=I.useState(!1),[W,q]=I.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=I.useRef(null),M=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=I.useRef(null),z=I.useRef(!1),K=I.useCallback(H=>{C(Q=>{var X;return(X=Q.find(ie=>ie.id===H.id))!=null&&X.delete||Nt.dismiss(H.id),Q.filter(({id:ie})=>ie!==H.id)})},[]);return I.useEffect(()=>Nt.subscribe(H=>{if(H.dismiss){C(Q=>Q.map(X=>X.id===H.id?{...X,delete:!0}:X));return}setTimeout(()=>{ob.flushSync(()=>{C(Q=>{let X=Q.findIndex(ie=>ie.id===H.id);return X!==-1?[...Q.slice(0,X),{...Q[X],...H},...Q.slice(X+1)]:[H,...Q]})})})}),[]),I.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 H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{H.addListener(({matches:X})=>{try{q(X?"dark":"light")}catch(ie){console.error(ie)}})}},[c]),I.useEffect(()=>{S.length<=1&&N(!1)},[S]),I.useEffect(()=>{let H=Q=>{var X,ie;s.every(pe=>Q[pe]||Q.code===pe)&&(N(!0),(X=G.current)==null||X.focus()),Q.code==="Escape"&&(document.activeElement===G.current||(ie=G.current)!=null&&ie.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[s]),I.useEffect(()=>{if(G.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,z.current=!1)}},[G.current]),I.createElement("section",{ref:e,"aria-label":`${b} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((H,Q)=>{var X;let[ie,pe]=H.split("-");return S.length?I.createElement("ol",{key:H,dir:m==="auto"?N0():m,tabIndex:-1,ref:G,className:a,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":ie,"data-lifted":$&&S.length>1&&!i,"data-x-position":pe,style:{"--front-toast-height":`${((X=R[0])==null?void 0:X.height)||0}px`,"--width":`${ND}px`,"--gap":`${v}px`,...h,...DD(l,u)},onBlur:se=>{z.current&&!se.currentTarget.contains(se.relatedTarget)&&(z.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||z.current||(z.current=!0,T.current=se.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{B||N(!1)},onDragEnd:()=>N(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},S.filter(se=>!se.position&&Q===0||se.position===H).map((se,ve)=>{var _e,Je;return I.createElement(jD,{key:se.id,icons:w,index:ve,toast:se,defaultRichColors:d,duration:(_e=p==null?void 0:p.duration)!=null?_e:f,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:r,visibleToasts:_,closeButton:(Je=p==null?void 0:p.closeButton)!=null?Je:o,interacting:B,position:H,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:K,toasts:S.filter(Ot=>Ot.position==se.position),heights:R.filter(Ot=>Ot.position==se.position),setHeights:P,expandByDefault:i,gap:v,loadingIcon:g,expanded:$,pauseWhenPageIsHidden:E,swipeDirections:t.swipeDirections})})):null}))});const BD=({...t})=>{const{theme:e="system"}=iR();return x.jsx(zD,{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 UD=Symbol("radix.slottable");function VD(t){const e=({children:r})=>x.jsx(x.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=UD,e}var[kd]=oi("Tooltip",[md]),Jg=md(),uC="TooltipProvider",qD=700,A0="tooltip.open",[HD,cC]=kd(uC),dC=t=>{const{__scopeTooltip:e,delayDuration:r=qD,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=t,o=y.useRef(!0),a=y.useRef(!1),l=y.useRef(0);return y.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),x.jsx(HD,{scope:e,isOpenDelayedRef:o,delayDuration:r,onOpen:y.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:y.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};dC.displayName=uC;var fC="Tooltip",[gz,Cd]=kd(fC),nv="TooltipTrigger",WD=y.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Cd(nv,r),i=cC(nv,r),o=Jg(r),a=y.useRef(null),l=ot(e,a,s.onTriggerChange),u=y.useRef(!1),c=y.useRef(!1),d=y.useCallback(()=>u.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),x.jsx(bS,{asChild:!0,...o,children:x.jsx(qe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:Z(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:Z(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:Z(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Z(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Z(t.onBlur,s.onClose),onClick:Z(t.onClick,s.onClose)})})});WD.displayName=nv;var GD="TooltipPortal",[mz,KD]=kd(GD,{forceMount:void 0}),Ro="TooltipContent",hC=y.forwardRef((t,e)=>{const r=KD(Ro,t.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=t,o=Cd(Ro,t.__scopeTooltip);return x.jsx(ai,{present:n||o.open,children:o.disableHoverableContent?x.jsx(pC,{side:s,...i,ref:e}):x.jsx(QD,{side:s,...i,ref:e})})}),QD=y.forwardRef((t,e)=>{const r=Cd(Ro,t.__scopeTooltip),n=cC(Ro,t.__scopeTooltip),s=y.useRef(null),i=ot(e,s),[o,a]=y.useState(null),{trigger:l,onClose:u}=r,c=s.current,{onPointerInTransitChange:d}=n,f=y.useCallback(()=>{a(null),d(!1)},[d]),h=y.useCallback((_,p)=>{const m=_.currentTarget,v={x:_.clientX,y:_.clientY},g=e3(v,m.getBoundingClientRect()),w=t3(v,g),b=r3(p.getBoundingClientRect()),E=s3([...w,...b]);a(E),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(l&&c){const _=m=>h(m,c),p=m=>h(m,l);return l.addEventListener("pointerleave",_),c.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",_),c.removeEventListener("pointerleave",p)}}},[l,c,h,f]),y.useEffect(()=>{if(o){const _=p=>{const m=p.target,v={x:p.clientX,y:p.clientY},g=(l==null?void 0:l.contains(m))||(c==null?void 0:c.contains(m)),w=!n3(v,o);g?f():w&&(f(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[l,c,o,u,f]),x.jsx(pC,{...t,ref:i})}),[YD,XD]=kd(fC,{isInside:!1}),JD=VD("TooltipContent"),pC=y.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Cd(Ro,r),u=Jg(r),{onClose:c}=l;return y.useEffect(()=>(document.addEventListener(A0,c),()=>document.removeEventListener(A0,c)),[c]),y.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),x.jsx(fd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:x.jsxs(ES,{"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:[x.jsx(JD,{children:n}),x.jsx(YD,{scope:r,isInside:!0,children:x.jsx(qj,{id:l.contentId,role:"tooltip",children:s||n})})]})})});hC.displayName=Ro;var vC="TooltipArrow",ZD=y.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Jg(r);return XD(vC,r).isInside?null:x.jsx(SS,{...s,...n,ref:e})});ZD.displayName=vC;function e3(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function t3(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function r3(t){const{top:e,right:r,bottom:n,left:s}=t;return[{x:s,y:e},{x:r,y:e},{x:r,y:n},{x:s,y:n}]}function n3(t,e){const{x:r,y:n}=t;let s=!1;for(let i=0,o=e.length-1;in!=f>n&&r<(d-u)*(n-c)/(f-c)+u&&(s=!s)}return s}function s3(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),i3(e)}function i3(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const s=t[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var o3=dC,gC=hC;const a3=o3,l3=y.forwardRef(({className:t,sideOffset:e=4,...r},n)=>x.jsx(gC,{ref:n,sideOffset:e,className:at("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),...r}));l3.displayName=gC.displayName;function u3(){const{pathname:t,hash:e}=Nr();y.useEffect(()=>{e||window.scrollTo(0,0)},[t,e])}class c3{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}getRateLimitPolicy(){return this.request("/rate-limits",{credentials:"omit"})}getBookmarkIds(){return this.request("/me/bookmarks/ids")}getBookmarks(){return this.request("/me/bookmarks")}addBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"POST"})}removeBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const $0=new c3(Jp),eh={hide_closed_source_evals:!1},mC=I.createContext(null),d3=({children:t})=>{const{user:e}=Kg(),[r,n]=I.useState(eh),[s,i]=I.useState(!1);I.useEffect(()=>{let l=!1;if(!e){n(eh);return}return i(!0),$0.getPreferences().then(u=>{l||n(u)}).catch(()=>{l||n(eh)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[e]);const o=I.useCallback(async l=>{const u={...r,hide_closed_source_evals:l};if(n(u),!!e)try{const c=await $0.updatePreferences(u);n(c)}catch{n(r)}},[r,e]),a=I.useMemo(()=>({preferences:r,canPersist:!!e,isLoading:s,setHideClosedSourceEvals:o}),[r,e,s,o]);return x.jsx(mC.Provider,{value:a,children:t})};function yz(){const t=I.useContext(mC);if(!t)throw new Error("usePreferences must be used inside a ");return t}const yC=qN(),f3=yC?oN:iN;if(!yC&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const h3=I.lazy(()=>he(()=>import("./AuthorizePaperEditView-CGKfjdnc.js"),__vite__mapDeps([0,1,2,3,4]))),p3=I.lazy(()=>he(()=>import("./FeedView-B-4sZVtZ.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,1,18,19,20,21,22,23]))),v3=I.lazy(()=>he(()=>import("./ChatView-BoBPZNMN.js"),__vite__mapDeps([24,1,25,15,16,17,11,8,9,26,27,28,29,30,31,2,32,33,19,34]))),g3=I.lazy(()=>he(()=>import("./SharedChatView-Cc0NvRQ0.js"),__vite__mapDeps([35,1,25,15,16,17,11,8,9,26,27,28,29,30,31,2,32,33]))),m3=I.lazy(()=>he(()=>import("./PapersListView-BzkXSjia.js"),__vite__mapDeps([36,6,7,8,9,10,11,12,18,20,1,21,37,13,14,22,23]))),y3=I.lazy(()=>he(()=>import("./PaperDetailView-CKIW1kLN.js"),__vite__mapDeps([38,6,7,8,9,10,11,12,39,26,40,1,20,21,41,22,23,3,42,4,43,44,14,45,2,18,46,47,48,27,49,50,51,28,30,52,53]))),_3=I.lazy(()=>he(()=>import("./PaperReaderView-DhBihPaZ.js"),__vite__mapDeps([54,1,25,15,16,17,11,8,9,26,27,28,29,30,31,2,32,33,20,21,12,24,19,34]))),w3=I.lazy(()=>he(()=>import("./TagsIndexView-CugP0IZX.js"),__vite__mapDeps([55,1,18,10,56,22,23,57,47,3,43,48,44,14,42,45,2,46]))),x3=I.lazy(()=>he(()=>import("./TagBrowseView-B0gD_2LJ.js"),__vite__mapDeps([58,1,6,7,8,9,10,11,12,59,13,14,60,29,30,26,18,56,20,21,22,23,17,28]))),b3=I.lazy(()=>he(()=>import("./MethodsIndexView-C_pyJkdT.js"),__vite__mapDeps([61,1,18,56,22,23,57,47,3,43,48,44,14,42,45,2,46]))),E3=I.lazy(()=>he(()=>import("./FrameworksIndexView-CXgusf3e.js"),__vite__mapDeps([62,1,6,7,8,9,10,11,12,18]))),S3=I.lazy(()=>he(()=>import("./TrendsView-C7rcdOkr.js"),__vite__mapDeps([63,1,23,22]))),k3=I.lazy(()=>he(()=>import("./ConferencesIndexView-BiodHb35.js"),__vite__mapDeps([64,1,18,22,23,57,47,3,43,48,44,14,42,45,2,46]))),C3=I.lazy(()=>he(()=>import("./AiDeadlinesView-BYtpNDXZ.js"),__vite__mapDeps([65,1,18,66,50,22,23,12,42]))),P3=I.lazy(()=>he(()=>import("./ConferenceDetailView-CPaA44iW.js"),__vite__mapDeps([67,1,60,8,9,29,30,26,11,18,10,22,23,12]))),T3=I.lazy(()=>he(()=>import("./ConferenceTaskView-CfOzYvBh.js"),__vite__mapDeps([68,1,6,7,8,9,10,11,12,13,14,60,29,30,26,18,20,21,22,23]))),R3=I.lazy(()=>he(()=>import("./OrganizationsIndexView-Bltu6jBn.js"),__vite__mapDeps([69,1,23,22,18,70]))),I3=I.lazy(()=>he(()=>import("./OrganizationDetailView-BXFLjDjo.js"),__vite__mapDeps([71,72,1,6,7,8,9,10,11,12,60,29,30,26,73,22,18,13,14,23,44,3,42,45,20,21,74]))),O3=I.lazy(()=>he(()=>import("./OrganizationTaskView-Dw5RMMvy.js"),__vite__mapDeps([75,72,1,6,7,8,9,10,11,12,60,29,30,26,73,22,18,13,14,23,44,3,42,45,20,21,74]))),M3=I.lazy(()=>he(()=>import("./AuthorDetailView-BYMv-vHA.js"),__vite__mapDeps([76,1,11,22,74]))),N3=I.lazy(()=>he(()=>import("./MethodDetailView-Cj95bubx.js"),__vite__mapDeps([77,1,21,6,7,8,9,10,11,12,13,14,60,29,30,26,18,56,22,23]))),A3=I.lazy(()=>he(()=>import("./BenchmarkDetailView--SkpidLo.js"),__vite__mapDeps([78,1,18,39,11,26,12,40,22,66,50,23,7,8,9,59,6,10,56,79]))),$3=I.lazy(()=>he(()=>import("./SavedPapersView-CjwpavHL.js"),__vite__mapDeps([80,1,6,7,8,9,10,11,12,22,23,52]))),L3=I.lazy(()=>he(()=>import("./SettingsView-DZ94ErYq.js"),__vite__mapDeps([81,1,2,66,50,16,41,34,32]))),F3=I.lazy(()=>he(()=>import("./PrivacyView-FlPj-oYG.js"),__vite__mapDeps([82,41]))),j3=I.lazy(()=>he(()=>import("./SubmitView-DFtR3Fk8.js"),__vite__mapDeps([83,2,23,3,43,48,11]))),D3=I.lazy(()=>he(()=>import("./CronDashboard-BXRwEuKL.js"),__vite__mapDeps([84,1,85,51,3,17,49,31,86,32,87,45,88,2,21,4,18,16,89]))),z3=I.lazy(()=>he(()=>import("./AutonomousOperations-CFtp7JHQ.js"),__vite__mapDeps([90,1,2,51,3,85,43,86]))),B3=I.lazy(()=>he(()=>import("./SubmissionsDashboard-oHtFlnA-.js"),__vite__mapDeps([91,1,2,18,12,11,46,87,45,86,88,92]))),U3=I.lazy(()=>he(()=>import("./UserProfileView-CJ4f8yIj.js"),__vite__mapDeps([93,1,73,22,18]))),V3=I.lazy(()=>he(()=>import("./RateLimitsView-5vz6Q6uj.js"),__vite__mapDeps([94,1]))),th=I.lazy(()=>he(()=>import("./NotFound-CpH-pbR-.js"),[])),L0=I.lazy(()=>he(()=>import("./SearchOverlay-DXqc280z.js"),__vite__mapDeps([95,1,7,8,9,18,11,37,10]))),q3=I.lazy(()=>he(()=>import("./StagingAccessRequestView-tW2mnJ1L.js"),__vite__mapDeps([96,88]))),rh=()=>x.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[x.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),x.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),x.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[x.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),x.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),x.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),H3=new DN({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),W3=()=>{const{arxivId:t}=a1();return x.jsx(Co,{to:t?`/paper/${t}`:"/papers",replace:!0})},G3=()=>{const{taskSlug:t}=a1();return x.jsx(Co,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},F0=({element:t})=>gl()?x.jsx(Co,{to:"/",replace:!0}):x.jsx(x.Fragment,{children:t}),_C=({element:t})=>{const{user:e,isLoading:r}=Kg();return gl()?x.jsx(Co,{to:"/",replace:!0}):r?x.jsx("div",{className:"page",children:x.jsx("div",{className:"submission-loading",children:x.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?x.jsx(x.Fragment,{children:t}):x.jsx("div",{className:"page",children:x.jsxs("div",{className:"submission-empty submission-empty-warn",children:[x.jsx("h1",{children:"Admin access required"}),x.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):x.jsx("div",{className:"page",children:x.jsxs("div",{className:"submission-empty submission-empty-warn",children:[x.jsx("h1",{children:"Sign in required"}),x.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),x.jsx(k1,{returnTo:"/admin-dashboard"})]})})},K3=()=>{const t=UN(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return I.useEffect(()=>{e&&window.location.replace(t)},[t,e]),e?x.jsx("div",{className:"page",children:x.jsxs("div",{className:"submission-loading",children:[x.jsx("span",{children:"Opening the production admin dashboard..."}),x.jsx("a",{href:t,children:"Continue"})]})}):x.jsx(_C,{element:x.jsx(D3,{})})},Q3=()=>{const[t,e]=I.useState(!1),r=Nr();return u3(),I.useLayoutEffect(()=>{var n;(n=document.getElementById("initial-discovery-footer"))==null||n.remove()},[]),I.useEffect(()=>{const n=s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"&&(s.preventDefault(),e(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),r.pathname==="/request-access"?x.jsx(I.Suspense,{fallback:x.jsx(rh,{}),children:x.jsx(q3,{})}):r.pathname.startsWith("/pdf/")?x.jsxs("div",{className:"reader-route-shell",children:[x.jsx(P0,{onOpenSearch:()=>e(!0)}),x.jsx("div",{className:"reader-route-content",children:x.jsx(I.Suspense,{fallback:x.jsx(rh,{}),children:x.jsx(j_,{children:x.jsx(de,{path:"/pdf/:paperId",element:VN()?x.jsx(_3,{}):x.jsx(th,{})})})})}),t&&x.jsx(I.Suspense,{fallback:null,children:x.jsx(L0,{open:t,onClose:()=>e(!1)})})]}):x.jsxs(x.Fragment,{children:[x.jsx(P0,{onOpenSearch:()=>e(!0)}),x.jsx("main",{children:x.jsx(I.Suspense,{fallback:x.jsx(rh,{}),children:x.jsxs(j_,{children:[x.jsx(de,{path:"/",element:x.jsx(p3,{})}),x.jsx(de,{path:"/chat/:sessionId?",element:Mc()?x.jsx(v3,{}):x.jsx(Co,{to:"/",replace:!0})}),x.jsx(de,{path:"/share/:shareId",element:Mc()?x.jsx(g3,{}):x.jsx(th,{})}),x.jsx(de,{path:"/papers",element:x.jsx(m3,{})}),x.jsx(de,{path:"/papers/:arxivId",element:x.jsx(W3,{})}),x.jsx(de,{path:"/paper/:arxivId",element:x.jsx(y3,{})}),x.jsx(de,{path:"/tasks",element:x.jsx(w3,{})}),x.jsx(de,{path:"/tasks/:taskSlug",element:x.jsx(x3,{})}),x.jsx(de,{path:"/task/:taskSlug",element:x.jsx(G3,{})}),x.jsx(de,{path:"/methods",element:x.jsx(b3,{})}),x.jsx(de,{path:"/methods/:methodSlug",element:x.jsx(N3,{})}),x.jsx(de,{path:"/frameworks",element:x.jsx(E3,{})}),x.jsx(de,{path:"/trends",element:x.jsx(S3,{})}),x.jsx(de,{path:"/conferences",element:x.jsx(k3,{})}),x.jsx(de,{path:"/ai-deadlines",element:x.jsx(C3,{})}),x.jsx(de,{path:"/conferences/:confSlug",element:x.jsx(P3,{})}),x.jsx(de,{path:"/conferences/:confSlug/:taskSlug",element:x.jsx(T3,{})}),x.jsx(de,{path:"/organizations",element:x.jsx(R3,{})}),x.jsx(de,{path:"/orgs/:orgSlug",element:x.jsx(I3,{})}),x.jsx(de,{path:"/orgs/:orgSlug/:taskSlug",element:x.jsx(O3,{})}),x.jsx(de,{path:"/authors/:authorId",element:x.jsx(M3,{})}),x.jsx(de,{path:"/benchmark/:datasetSlug",element:x.jsx(A3,{})}),x.jsx(de,{path:"/authorize-paper-edit/:authorizationId",element:x.jsx(h3,{})}),x.jsx(de,{path:"/submit",element:x.jsx(j3,{})}),x.jsx(de,{path:"/saved",element:x.jsx(F0,{element:x.jsx($3,{})})}),x.jsx(de,{path:"/settings",element:x.jsx(L3,{})}),x.jsx(de,{path:"/privacy",element:x.jsx(F3,{})}),x.jsx(de,{path:"/admin-dashboard",element:x.jsx(K3,{})}),x.jsx(de,{path:"/autonomous-operations",element:x.jsx(_C,{element:x.jsx(z3,{})})}),x.jsx(de,{path:"/cron-dashboard",element:x.jsx(Co,{to:"/admin-dashboard",replace:!0})}),x.jsx(de,{path:"/submissions",element:x.jsx(F0,{element:x.jsx(B3,{})})}),x.jsx(de,{path:"/rate-limits",element:x.jsx(V3,{})}),x.jsx(de,{path:"/:username",element:x.jsx(U3,{})}),x.jsx(de,{path:"*",element:x.jsx(th,{})})]})})}),x.jsx($j,{}),t&&x.jsx(I.Suspense,{fallback:null,children:x.jsx(L0,{open:t,onClose:()=>e(!1)})})]})},Y3=()=>x.jsx(zN,{client:H3,children:x.jsx(Oj,{children:x.jsx(d3,{children:x.jsxs(a3,{children:[x.jsx(f3,{children:x.jsx(Q3,{})}),x.jsx(hD,{}),x.jsx(BD,{}),!1]})})})});aM();const X3=x.jsx(oR,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:x.jsx(iM,{children:x.jsx(Y3,{})})}),J3=ab(document.getElementById("root"));J3.render(x.jsx(I.StrictMode,{children:X3}));export{Jp as $,Lk as A,$0 as B,fj as C,gl as D,BN as E,VN as F,gj as G,k1 as H,aF as I,mj as J,Ak as K,qn as L,sn as M,lz as N,uz as O,ai as P,Tj as Q,oF as R,WN as S,fD as T,G0 as U,z1 as V,qp as W,vj as X,hr as Y,Og as Z,he as _,Kg as a,P1 as a0,uD as a1,ii as a2,zg as a3,mF as a4,DS as a5,b$ as a6,Z1 as a7,fd as a8,pz as a9,jp as aA,m1 as aB,yN as aC,_N as aD,Fp as aE,p1 as aF,AN as aG,EN as aH,Nr as aI,E0 as aJ,nz as aa,HL as ab,bS as ac,md as ad,ES as ae,SS as af,ez as ag,iR as ah,oz as ai,iz as aj,Ij as ak,dz as al,dd as am,kt as an,rz as ao,v1 as ap,Er as aq,W1 as ar,G1 as as,K1 as at,tl as au,LN as av,sz as aw,Co as ax,PN as ay,wN as az,xg as b,tz as c,cz as d,bd as e,Bj as f,yz as g,az as h,Mc as i,x as j,qe as k,Rg as l,ot as m,fz as n,Z as o,jL as p,oi as q,y as r,at as s,hz as t,a1 as u,Q1 as v,CS as w,pj as x,kg as y,I as z}; +`);function au(t){return t.label!==void 0}var ID=3,OD="32px",MD="16px",M0=4e3,ND=356,AD=14,$D=20,LD=200;function wr(...t){return t.filter(Boolean).join(" ")}function FD(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var jD=t=>{var e,r,n,s,i,o,a,l,u,c,d;let{invert:f,toast:h,unstyled:_,interacting:p,setHeights:m,visibleToasts:v,heights:g,index:w,toasts:b,expanded:E,removeToast:S,defaultRichColors:C,closeButton:k,style:R,cancelButtonStyle:P,actionButtonStyle:$,className:N="",descriptionClassName:B="",duration:F,position:W,gap:q,loadingIcon:G,expandByDefault:M,classNames:T,icons:z,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:H}=t,[Q,X]=I.useState(null),[ie,pe]=I.useState(null),[se,ve]=I.useState(!1),[_e,Je]=I.useState(!1),[Ot,Ze]=I.useState(!1),[De,Jr]=I.useState(!1),[Tn,lt]=I.useState(!1),[Rn,tr]=I.useState(0),[Ut,In]=I.useState(0),On=I.useRef(h.duration||F||M0),Fo=I.useRef(null),pr=I.useRef(null),wC=w===0,xC=w+1<=v,rr=h.type,ci=h.dismissible!==!1,bC=h.className||"",EC=h.descriptionClassName||"",bl=I.useMemo(()=>g.findIndex(oe=>oe.toastId===h.id)||0,[g,h.id]),SC=I.useMemo(()=>{var oe;return(oe=h.closeButton)!=null?oe:k},[h.closeButton,k]),Zg=I.useMemo(()=>h.duration||F||M0,[h.duration,F]),Pd=I.useRef(0),di=I.useRef(0),em=I.useRef(0),fi=I.useRef(null),[kC,CC]=W.split("-"),tm=I.useMemo(()=>g.reduce((oe,Se,Le)=>Le>=bl?oe:oe+Se.height,0),[g,bl]),rm=bD(),PC=h.invert||f,Td=rr==="loading";di.current=I.useMemo(()=>bl*q+tm,[bl,tm]),I.useEffect(()=>{On.current=Zg},[Zg]),I.useEffect(()=>{ve(!0)},[]),I.useEffect(()=>{let oe=pr.current;if(oe){let Se=oe.getBoundingClientRect().height;return In(Se),m(Le=>[{toastId:h.id,height:Se,position:h.position},...Le]),()=>m(Le=>Le.filter(vr=>vr.toastId!==h.id))}},[m,h.id]),I.useLayoutEffect(()=>{if(!se)return;let oe=pr.current,Se=oe.style.height;oe.style.height="auto";let Le=oe.getBoundingClientRect().height;oe.style.height=Se,In(Le),m(vr=>vr.find(gr=>gr.toastId===h.id)?vr.map(gr=>gr.toastId===h.id?{...gr,height:Le}:gr):[{toastId:h.id,height:Le,position:h.position},...vr])},[se,h.title,h.description,m,h.id]);let Mn=I.useCallback(()=>{Je(!0),tr(di.current),m(oe=>oe.filter(Se=>Se.toastId!==h.id)),setTimeout(()=>{S(h)},LD)},[h,S,m,di]);I.useEffect(()=>{if(h.promise&&rr==="loading"||h.duration===1/0||h.type==="loading")return;let oe;return E||p||H&&rm?(()=>{if(em.current{var Se;(Se=h.onAutoClose)==null||Se.call(h,h),Mn()},On.current)),()=>clearTimeout(oe)},[E,p,h,rr,H,rm,Mn]),I.useEffect(()=>{h.delete&&Mn()},[Mn,h.delete]);function TC(){var oe,Se,Le;return z!=null&&z.loading?I.createElement("div",{className:wr(T==null?void 0:T.loader,(oe=h==null?void 0:h.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":rr==="loading"},z.loading):G?I.createElement("div",{className:wr(T==null?void 0:T.loader,(Se=h==null?void 0:h.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":rr==="loading"},G):I.createElement(gD,{className:wr(T==null?void 0:T.loader,(Le=h==null?void 0:h.classNames)==null?void 0:Le.loader),visible:rr==="loading"})}return I.createElement("li",{tabIndex:0,ref:pr,className:wr(N,bC,T==null?void 0:T.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,T==null?void 0:T.default,T==null?void 0:T[rr],(r=h==null?void 0:h.classNames)==null?void 0:r[rr]),"data-sonner-toast":"","data-rich-colors":(n=h.richColors)!=null?n:C,"data-styled":!(h.jsx||h.unstyled||_),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":Tn,"data-removed":_e,"data-visible":xC,"data-y-position":kC,"data-x-position":CC,"data-index":w,"data-front":wC,"data-swiping":Ot,"data-dismissible":ci,"data-type":rr,"data-invert":PC,"data-swipe-out":De,"data-swipe-direction":ie,"data-expanded":!!(E||M&&se),style:{"--index":w,"--toasts-before":w,"--z-index":b.length-w,"--offset":`${_e?Rn:di.current}px`,"--initial-height":M?"auto":`${Ut}px`,...R,...h.style},onDragEnd:()=>{Ze(!1),X(null),fi.current=null},onPointerDown:oe=>{Td||!ci||(Fo.current=new Date,tr(di.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(Ze(!0),fi.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Se,Le,vr;if(De||!ci)return;fi.current=null;let gr=Number(((oe=pr.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Nn=Number(((Se=pr.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ws=new Date().getTime()-((Le=Fo.current)==null?void 0:Le.getTime()),mr=Q==="x"?gr:Nn,An=Math.abs(mr)/ws;if(Math.abs(mr)>=$D||An>.11){tr(di.current),(vr=h.onDismiss)==null||vr.call(h,h),pe(Q==="x"?gr>0?"right":"left":Nn>0?"down":"up"),Mn(),Jr(!0),lt(!1);return}Ze(!1),X(null)},onPointerMove:oe=>{var Se,Le,vr,gr;if(!fi.current||!ci||((Se=window.getSelection())==null?void 0:Se.toString().length)>0)return;let Nn=oe.clientY-fi.current.y,ws=oe.clientX-fi.current.x,mr=(Le=t.swipeDirections)!=null?Le:FD(W);!Q&&(Math.abs(ws)>1||Math.abs(Nn)>1)&&X(Math.abs(ws)>Math.abs(Nn)?"x":"y");let An={x:0,y:0};Q==="y"?(mr.includes("top")||mr.includes("bottom"))&&(mr.includes("top")&&Nn<0||mr.includes("bottom")&&Nn>0)&&(An.y=Nn):Q==="x"&&(mr.includes("left")||mr.includes("right"))&&(mr.includes("left")&&ws<0||mr.includes("right")&&ws>0)&&(An.x=ws),(Math.abs(An.x)>0||Math.abs(An.y)>0)&<(!0),(vr=pr.current)==null||vr.style.setProperty("--swipe-amount-x",`${An.x}px`),(gr=pr.current)==null||gr.style.setProperty("--swipe-amount-y",`${An.y}px`)}},SC&&!h.jsx?I.createElement("button",{"aria-label":K,"data-disabled":Td,"data-close-button":!0,onClick:Td||!ci?()=>{}:()=>{var oe;Mn(),(oe=h.onDismiss)==null||oe.call(h,h)},className:wr(T==null?void 0:T.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=z==null?void 0:z.close)!=null?i:xD):null,h.jsx||y.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:I.createElement(I.Fragment,null,rr||h.icon||h.promise?I.createElement("div",{"data-icon":"",className:wr(T==null?void 0:T.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||TC():null,h.type!=="loading"?h.icon||(z==null?void 0:z[rr])||pD(rr):null):null,I.createElement("div",{"data-content":"",className:wr(T==null?void 0:T.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},I.createElement("div",{"data-title":"",className:wr(T==null?void 0:T.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?I.createElement("div",{"data-description":"",className:wr(B,EC,T==null?void 0:T.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),y.isValidElement(h.cancel)?h.cancel:h.cancel&&au(h.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:oe=>{var Se,Le;au(h.cancel)&&ci&&((Le=(Se=h.cancel).onClick)==null||Le.call(Se,oe),Mn())},className:wr(T==null?void 0:T.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,y.isValidElement(h.action)?h.action:h.action&&au(h.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:oe=>{var Se,Le;au(h.action)&&((Le=(Se=h.action).onClick)==null||Le.call(Se,oe),!oe.defaultPrevented&&Mn())},className:wr(T==null?void 0:T.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function N0(){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 DD(t,e){let r={};return[t,e].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?MD:OD;function l(u){["top","right","bottom","left"].forEach(c=>{r[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=a:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(a)}),r}var zD=y.forwardRef(function(t,e){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:f,style:h,visibleToasts:_=ID,toastOptions:p,dir:m=N0(),gap:v=AD,loadingIcon:g,icons:w,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:E}=t,[S,C]=I.useState([]),k=I.useMemo(()=>Array.from(new Set([n].concat(S.filter(H=>H.position).map(H=>H.position)))),[S,n]),[R,P]=I.useState([]),[$,N]=I.useState(!1),[B,F]=I.useState(!1),[W,q]=I.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=I.useRef(null),M=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=I.useRef(null),z=I.useRef(!1),K=I.useCallback(H=>{C(Q=>{var X;return(X=Q.find(ie=>ie.id===H.id))!=null&&X.delete||Nt.dismiss(H.id),Q.filter(({id:ie})=>ie!==H.id)})},[]);return I.useEffect(()=>Nt.subscribe(H=>{if(H.dismiss){C(Q=>Q.map(X=>X.id===H.id?{...X,delete:!0}:X));return}setTimeout(()=>{ob.flushSync(()=>{C(Q=>{let X=Q.findIndex(ie=>ie.id===H.id);return X!==-1?[...Q.slice(0,X),{...Q[X],...H},...Q.slice(X+1)]:[H,...Q]})})})}),[]),I.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 H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{H.addListener(({matches:X})=>{try{q(X?"dark":"light")}catch(ie){console.error(ie)}})}},[c]),I.useEffect(()=>{S.length<=1&&N(!1)},[S]),I.useEffect(()=>{let H=Q=>{var X,ie;s.every(pe=>Q[pe]||Q.code===pe)&&(N(!0),(X=G.current)==null||X.focus()),Q.code==="Escape"&&(document.activeElement===G.current||(ie=G.current)!=null&&ie.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[s]),I.useEffect(()=>{if(G.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,z.current=!1)}},[G.current]),I.createElement("section",{ref:e,"aria-label":`${b} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((H,Q)=>{var X;let[ie,pe]=H.split("-");return S.length?I.createElement("ol",{key:H,dir:m==="auto"?N0():m,tabIndex:-1,ref:G,className:a,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":ie,"data-lifted":$&&S.length>1&&!i,"data-x-position":pe,style:{"--front-toast-height":`${((X=R[0])==null?void 0:X.height)||0}px`,"--width":`${ND}px`,"--gap":`${v}px`,...h,...DD(l,u)},onBlur:se=>{z.current&&!se.currentTarget.contains(se.relatedTarget)&&(z.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||z.current||(z.current=!0,T.current=se.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{B||N(!1)},onDragEnd:()=>N(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},S.filter(se=>!se.position&&Q===0||se.position===H).map((se,ve)=>{var _e,Je;return I.createElement(jD,{key:se.id,icons:w,index:ve,toast:se,defaultRichColors:d,duration:(_e=p==null?void 0:p.duration)!=null?_e:f,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:r,visibleToasts:_,closeButton:(Je=p==null?void 0:p.closeButton)!=null?Je:o,interacting:B,position:H,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:K,toasts:S.filter(Ot=>Ot.position==se.position),heights:R.filter(Ot=>Ot.position==se.position),setHeights:P,expandByDefault:i,gap:v,loadingIcon:g,expanded:$,pauseWhenPageIsHidden:E,swipeDirections:t.swipeDirections})})):null}))});const BD=({...t})=>{const{theme:e="system"}=iR();return x.jsx(zD,{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 UD=Symbol("radix.slottable");function VD(t){const e=({children:r})=>x.jsx(x.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=UD,e}var[kd]=oi("Tooltip",[md]),Jg=md(),uC="TooltipProvider",qD=700,A0="tooltip.open",[HD,cC]=kd(uC),dC=t=>{const{__scopeTooltip:e,delayDuration:r=qD,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=t,o=y.useRef(!0),a=y.useRef(!1),l=y.useRef(0);return y.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),x.jsx(HD,{scope:e,isOpenDelayedRef:o,delayDuration:r,onOpen:y.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:y.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};dC.displayName=uC;var fC="Tooltip",[gz,Cd]=kd(fC),nv="TooltipTrigger",WD=y.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Cd(nv,r),i=cC(nv,r),o=Jg(r),a=y.useRef(null),l=ot(e,a,s.onTriggerChange),u=y.useRef(!1),c=y.useRef(!1),d=y.useCallback(()=>u.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),x.jsx(bS,{asChild:!0,...o,children:x.jsx(qe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:Z(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:Z(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:Z(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Z(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Z(t.onBlur,s.onClose),onClick:Z(t.onClick,s.onClose)})})});WD.displayName=nv;var GD="TooltipPortal",[mz,KD]=kd(GD,{forceMount:void 0}),Ro="TooltipContent",hC=y.forwardRef((t,e)=>{const r=KD(Ro,t.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=t,o=Cd(Ro,t.__scopeTooltip);return x.jsx(ai,{present:n||o.open,children:o.disableHoverableContent?x.jsx(pC,{side:s,...i,ref:e}):x.jsx(QD,{side:s,...i,ref:e})})}),QD=y.forwardRef((t,e)=>{const r=Cd(Ro,t.__scopeTooltip),n=cC(Ro,t.__scopeTooltip),s=y.useRef(null),i=ot(e,s),[o,a]=y.useState(null),{trigger:l,onClose:u}=r,c=s.current,{onPointerInTransitChange:d}=n,f=y.useCallback(()=>{a(null),d(!1)},[d]),h=y.useCallback((_,p)=>{const m=_.currentTarget,v={x:_.clientX,y:_.clientY},g=e3(v,m.getBoundingClientRect()),w=t3(v,g),b=r3(p.getBoundingClientRect()),E=s3([...w,...b]);a(E),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(l&&c){const _=m=>h(m,c),p=m=>h(m,l);return l.addEventListener("pointerleave",_),c.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",_),c.removeEventListener("pointerleave",p)}}},[l,c,h,f]),y.useEffect(()=>{if(o){const _=p=>{const m=p.target,v={x:p.clientX,y:p.clientY},g=(l==null?void 0:l.contains(m))||(c==null?void 0:c.contains(m)),w=!n3(v,o);g?f():w&&(f(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[l,c,o,u,f]),x.jsx(pC,{...t,ref:i})}),[YD,XD]=kd(fC,{isInside:!1}),JD=VD("TooltipContent"),pC=y.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Cd(Ro,r),u=Jg(r),{onClose:c}=l;return y.useEffect(()=>(document.addEventListener(A0,c),()=>document.removeEventListener(A0,c)),[c]),y.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),x.jsx(fd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:x.jsxs(ES,{"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:[x.jsx(JD,{children:n}),x.jsx(YD,{scope:r,isInside:!0,children:x.jsx(qj,{id:l.contentId,role:"tooltip",children:s||n})})]})})});hC.displayName=Ro;var vC="TooltipArrow",ZD=y.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Jg(r);return XD(vC,r).isInside?null:x.jsx(SS,{...s,...n,ref:e})});ZD.displayName=vC;function e3(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function t3(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function r3(t){const{top:e,right:r,bottom:n,left:s}=t;return[{x:s,y:e},{x:r,y:e},{x:r,y:n},{x:s,y:n}]}function n3(t,e){const{x:r,y:n}=t;let s=!1;for(let i=0,o=e.length-1;in!=f>n&&r<(d-u)*(n-c)/(f-c)+u&&(s=!s)}return s}function s3(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),i3(e)}function i3(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const s=t[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var o3=dC,gC=hC;const a3=o3,l3=y.forwardRef(({className:t,sideOffset:e=4,...r},n)=>x.jsx(gC,{ref:n,sideOffset:e,className:at("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),...r}));l3.displayName=gC.displayName;function u3(){const{pathname:t,hash:e}=Nr();y.useEffect(()=>{e||window.scrollTo(0,0)},[t,e])}class c3{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}getRateLimitPolicy(){return this.request("/rate-limits",{credentials:"omit"})}getBookmarkIds(){return this.request("/me/bookmarks/ids")}getBookmarks(){return this.request("/me/bookmarks")}addBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"POST"})}removeBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const $0=new c3(Jp),eh={hide_closed_source_evals:!1},mC=I.createContext(null),d3=({children:t})=>{const{user:e}=Kg(),[r,n]=I.useState(eh),[s,i]=I.useState(!1);I.useEffect(()=>{let l=!1;if(!e){n(eh);return}return i(!0),$0.getPreferences().then(u=>{l||n(u)}).catch(()=>{l||n(eh)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[e]);const o=I.useCallback(async l=>{const u={...r,hide_closed_source_evals:l};if(n(u),!!e)try{const c=await $0.updatePreferences(u);n(c)}catch{n(r)}},[r,e]),a=I.useMemo(()=>({preferences:r,canPersist:!!e,isLoading:s,setHideClosedSourceEvals:o}),[r,e,s,o]);return x.jsx(mC.Provider,{value:a,children:t})};function yz(){const t=I.useContext(mC);if(!t)throw new Error("usePreferences must be used inside a ");return t}const yC=qN(),f3=yC?oN:iN;if(!yC&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const h3=I.lazy(()=>he(()=>import("./AuthorizePaperEditView-CIbMmWPg.js"),__vite__mapDeps([0,1,2,3,4]))),p3=I.lazy(()=>he(()=>import("./FeedView-LQ-88lWw.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,1,18,19,20,21,22,23]))),v3=I.lazy(()=>he(()=>import("./ChatView-BSLUlS0a.js"),__vite__mapDeps([24,1,25,15,16,17,11,8,9,26,27,28,29,30,31,2,32,33,19,34]))),g3=I.lazy(()=>he(()=>import("./SharedChatView-DR9rp5FK.js"),__vite__mapDeps([35,1,25,15,16,17,11,8,9,26,27,28,29,30,31,2,32,33]))),m3=I.lazy(()=>he(()=>import("./PapersListView-Dr9p0OKb.js"),__vite__mapDeps([36,6,7,8,9,10,11,12,18,20,1,21,37,13,14,22,23]))),y3=I.lazy(()=>he(()=>import("./PaperDetailView-CGlbwKQ5.js"),__vite__mapDeps([38,6,7,8,9,10,11,12,39,26,40,1,20,21,41,22,23,3,42,4,43,44,14,45,2,18,46,47,48,27,49,50,51,28,30,52,53]))),_3=I.lazy(()=>he(()=>import("./PaperReaderView-CkWbXoez.js"),__vite__mapDeps([54,1,25,15,16,17,11,8,9,26,27,28,29,30,31,2,32,33,20,21,12,24,19,34]))),w3=I.lazy(()=>he(()=>import("./TagsIndexView-rZIkfOik.js"),__vite__mapDeps([55,1,18,10,56,22,23,57,47,3,43,48,44,14,42,45,2,46]))),x3=I.lazy(()=>he(()=>import("./TagBrowseView-MvhMQ4qP.js"),__vite__mapDeps([58,1,6,7,8,9,10,11,12,59,13,14,60,29,30,26,18,56,20,21,22,23,17,28]))),b3=I.lazy(()=>he(()=>import("./MethodsIndexView-BXUyb9I0.js"),__vite__mapDeps([61,1,18,56,22,23,57,47,3,43,48,44,14,42,45,2,46]))),E3=I.lazy(()=>he(()=>import("./FrameworksIndexView-Db4cbi0M.js"),__vite__mapDeps([62,1,6,7,8,9,10,11,12,18]))),S3=I.lazy(()=>he(()=>import("./TrendsView-DSNVxz_8.js"),__vite__mapDeps([63,1,23,22]))),k3=I.lazy(()=>he(()=>import("./ConferencesIndexView-CXeV-ywe.js"),__vite__mapDeps([64,1,18,22,23,57,47,3,43,48,44,14,42,45,2,46]))),C3=I.lazy(()=>he(()=>import("./AiDeadlinesView-DDL8uO29.js"),__vite__mapDeps([65,1,18,66,50,22,23,12,42]))),P3=I.lazy(()=>he(()=>import("./ConferenceDetailView-BO1fOFQD.js"),__vite__mapDeps([67,1,60,8,9,29,30,26,11,18,10,22,23,12]))),T3=I.lazy(()=>he(()=>import("./ConferenceTaskView-CP0FthV6.js"),__vite__mapDeps([68,1,6,7,8,9,10,11,12,13,14,60,29,30,26,18,20,21,22,23]))),R3=I.lazy(()=>he(()=>import("./OrganizationsIndexView-C1qkT5g2.js"),__vite__mapDeps([69,1,23,22,18,70]))),I3=I.lazy(()=>he(()=>import("./OrganizationDetailView-DuTpsK8_.js"),__vite__mapDeps([71,72,1,6,7,8,9,10,11,12,60,29,30,26,73,22,18,13,14,23,44,3,42,45,20,21,74]))),O3=I.lazy(()=>he(()=>import("./OrganizationTaskView-CaRpjxan.js"),__vite__mapDeps([75,72,1,6,7,8,9,10,11,12,60,29,30,26,73,22,18,13,14,23,44,3,42,45,20,21,74]))),M3=I.lazy(()=>he(()=>import("./AuthorDetailView-DsixzDxp.js"),__vite__mapDeps([76,1,11,22,74]))),N3=I.lazy(()=>he(()=>import("./MethodDetailView-D7RjDc12.js"),__vite__mapDeps([77,1,21,6,7,8,9,10,11,12,13,14,60,29,30,26,18,56,22,23]))),A3=I.lazy(()=>he(()=>import("./BenchmarkDetailView-CYzt8vxy.js"),__vite__mapDeps([78,1,18,39,11,26,12,40,22,66,50,23,7,8,9,59,6,10,56,79]))),$3=I.lazy(()=>he(()=>import("./SavedPapersView-DlTA25Xb.js"),__vite__mapDeps([80,1,6,7,8,9,10,11,12,22,23,52]))),L3=I.lazy(()=>he(()=>import("./SettingsView--d7NFlEH.js"),__vite__mapDeps([81,1,2,66,50,16,41,34,32]))),F3=I.lazy(()=>he(()=>import("./PrivacyView-CJulinZK.js"),__vite__mapDeps([82,41]))),j3=I.lazy(()=>he(()=>import("./SubmitView-BUMlU8NL.js"),__vite__mapDeps([83,2,23,3,43,48,11]))),D3=I.lazy(()=>he(()=>import("./CronDashboard-BVydZ-r3.js"),__vite__mapDeps([84,1,85,51,3,17,49,31,86,32,87,45,88,2,21,4,18,16,89]))),z3=I.lazy(()=>he(()=>import("./AutonomousOperations-B7IW_M7l.js"),__vite__mapDeps([90,1,2,51,3,85,43,86]))),B3=I.lazy(()=>he(()=>import("./SubmissionsDashboard-BRy4uEhT.js"),__vite__mapDeps([91,1,2,18,12,11,46,87,45,86,88,92]))),U3=I.lazy(()=>he(()=>import("./UserProfileView-lUDzgohd.js"),__vite__mapDeps([93,1,73,22,18]))),V3=I.lazy(()=>he(()=>import("./RateLimitsView-Dnm4htYe.js"),__vite__mapDeps([94,1]))),th=I.lazy(()=>he(()=>import("./NotFound-BO9K9saD.js"),[])),L0=I.lazy(()=>he(()=>import("./SearchOverlay-HhaSArDa.js"),__vite__mapDeps([95,1,7,8,9,18,11,37,10]))),q3=I.lazy(()=>he(()=>import("./StagingAccessRequestView-Dfhd_TCr.js"),__vite__mapDeps([96,88]))),rh=()=>x.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[x.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),x.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),x.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[x.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),x.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),x.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),H3=new DN({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),W3=()=>{const{arxivId:t}=a1();return x.jsx(Co,{to:t?`/paper/${t}`:"/papers",replace:!0})},G3=()=>{const{taskSlug:t}=a1();return x.jsx(Co,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},F0=({element:t})=>gl()?x.jsx(Co,{to:"/",replace:!0}):x.jsx(x.Fragment,{children:t}),_C=({element:t})=>{const{user:e,isLoading:r}=Kg();return gl()?x.jsx(Co,{to:"/",replace:!0}):r?x.jsx("div",{className:"page",children:x.jsx("div",{className:"submission-loading",children:x.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?x.jsx(x.Fragment,{children:t}):x.jsx("div",{className:"page",children:x.jsxs("div",{className:"submission-empty submission-empty-warn",children:[x.jsx("h1",{children:"Admin access required"}),x.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):x.jsx("div",{className:"page",children:x.jsxs("div",{className:"submission-empty submission-empty-warn",children:[x.jsx("h1",{children:"Sign in required"}),x.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),x.jsx(k1,{returnTo:"/admin-dashboard"})]})})},K3=()=>{const t=UN(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return I.useEffect(()=>{e&&window.location.replace(t)},[t,e]),e?x.jsx("div",{className:"page",children:x.jsxs("div",{className:"submission-loading",children:[x.jsx("span",{children:"Opening the production admin dashboard..."}),x.jsx("a",{href:t,children:"Continue"})]})}):x.jsx(_C,{element:x.jsx(D3,{})})},Q3=()=>{const[t,e]=I.useState(!1),r=Nr();return u3(),I.useLayoutEffect(()=>{var n;(n=document.getElementById("initial-discovery-footer"))==null||n.remove()},[]),I.useEffect(()=>{const n=s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"&&(s.preventDefault(),e(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),r.pathname==="/request-access"?x.jsx(I.Suspense,{fallback:x.jsx(rh,{}),children:x.jsx(q3,{})}):r.pathname.startsWith("/pdf/")?x.jsxs("div",{className:"reader-route-shell",children:[x.jsx(P0,{onOpenSearch:()=>e(!0)}),x.jsx("div",{className:"reader-route-content",children:x.jsx(I.Suspense,{fallback:x.jsx(rh,{}),children:x.jsx(j_,{children:x.jsx(de,{path:"/pdf/:paperId",element:VN()?x.jsx(_3,{}):x.jsx(th,{})})})})}),t&&x.jsx(I.Suspense,{fallback:null,children:x.jsx(L0,{open:t,onClose:()=>e(!1)})})]}):x.jsxs(x.Fragment,{children:[x.jsx(P0,{onOpenSearch:()=>e(!0)}),x.jsx("main",{children:x.jsx(I.Suspense,{fallback:x.jsx(rh,{}),children:x.jsxs(j_,{children:[x.jsx(de,{path:"/",element:x.jsx(p3,{})}),x.jsx(de,{path:"/chat/:sessionId?",element:Mc()?x.jsx(v3,{}):x.jsx(Co,{to:"/",replace:!0})}),x.jsx(de,{path:"/share/:shareId",element:Mc()?x.jsx(g3,{}):x.jsx(th,{})}),x.jsx(de,{path:"/papers",element:x.jsx(m3,{})}),x.jsx(de,{path:"/papers/:arxivId",element:x.jsx(W3,{})}),x.jsx(de,{path:"/paper/:arxivId",element:x.jsx(y3,{})}),x.jsx(de,{path:"/tasks",element:x.jsx(w3,{})}),x.jsx(de,{path:"/tasks/:taskSlug",element:x.jsx(x3,{})}),x.jsx(de,{path:"/task/:taskSlug",element:x.jsx(G3,{})}),x.jsx(de,{path:"/methods",element:x.jsx(b3,{})}),x.jsx(de,{path:"/methods/:methodSlug",element:x.jsx(N3,{})}),x.jsx(de,{path:"/frameworks",element:x.jsx(E3,{})}),x.jsx(de,{path:"/trends",element:x.jsx(S3,{})}),x.jsx(de,{path:"/conferences",element:x.jsx(k3,{})}),x.jsx(de,{path:"/ai-deadlines",element:x.jsx(C3,{})}),x.jsx(de,{path:"/conferences/:confSlug",element:x.jsx(P3,{})}),x.jsx(de,{path:"/conferences/:confSlug/:taskSlug",element:x.jsx(T3,{})}),x.jsx(de,{path:"/organizations",element:x.jsx(R3,{})}),x.jsx(de,{path:"/orgs/:orgSlug",element:x.jsx(I3,{})}),x.jsx(de,{path:"/orgs/:orgSlug/:taskSlug",element:x.jsx(O3,{})}),x.jsx(de,{path:"/authors/:authorId",element:x.jsx(M3,{})}),x.jsx(de,{path:"/benchmark/:datasetSlug",element:x.jsx(A3,{})}),x.jsx(de,{path:"/authorize-paper-edit/:authorizationId",element:x.jsx(h3,{})}),x.jsx(de,{path:"/submit",element:x.jsx(j3,{})}),x.jsx(de,{path:"/saved",element:x.jsx(F0,{element:x.jsx($3,{})})}),x.jsx(de,{path:"/settings",element:x.jsx(L3,{})}),x.jsx(de,{path:"/privacy",element:x.jsx(F3,{})}),x.jsx(de,{path:"/admin-dashboard",element:x.jsx(K3,{})}),x.jsx(de,{path:"/autonomous-operations",element:x.jsx(_C,{element:x.jsx(z3,{})})}),x.jsx(de,{path:"/cron-dashboard",element:x.jsx(Co,{to:"/admin-dashboard",replace:!0})}),x.jsx(de,{path:"/submissions",element:x.jsx(F0,{element:x.jsx(B3,{})})}),x.jsx(de,{path:"/rate-limits",element:x.jsx(V3,{})}),x.jsx(de,{path:"/:username",element:x.jsx(U3,{})}),x.jsx(de,{path:"*",element:x.jsx(th,{})})]})})}),x.jsx($j,{}),t&&x.jsx(I.Suspense,{fallback:null,children:x.jsx(L0,{open:t,onClose:()=>e(!1)})})]})},Y3=()=>x.jsx(zN,{client:H3,children:x.jsx(Oj,{children:x.jsx(d3,{children:x.jsxs(a3,{children:[x.jsx(f3,{children:x.jsx(Q3,{})}),x.jsx(hD,{}),x.jsx(BD,{}),!1]})})})});aM();const X3=x.jsx(oR,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:x.jsx(iM,{children:x.jsx(Y3,{})})}),J3=ab(document.getElementById("root"));J3.render(x.jsx(I.StrictMode,{children:X3}));export{Jp as $,Lk as A,$0 as B,fj as C,gl as D,BN as E,VN as F,gj as G,k1 as H,aF as I,mj as J,Ak as K,qn as L,sn as M,lz as N,uz as O,ai as P,Tj as Q,oF as R,WN as S,fD as T,G0 as U,z1 as V,qp as W,vj as X,hr as Y,Og as Z,he as _,Kg as a,P1 as a0,uD as a1,ii as a2,zg as a3,mF as a4,DS as a5,b$ as a6,Z1 as a7,fd as a8,pz as a9,jp as aA,m1 as aB,yN as aC,_N as aD,Fp as aE,p1 as aF,AN as aG,EN as aH,Nr as aI,E0 as aJ,nz as aa,HL as ab,bS as ac,md as ad,ES as ae,SS as af,ez as ag,iR as ah,oz as ai,iz as aj,Ij as ak,dz as al,dd as am,kt as an,rz as ao,v1 as ap,Er as aq,W1 as ar,G1 as as,K1 as at,tl as au,LN as av,sz as aw,Co as ax,PN as ay,wN as az,xg as b,tz as c,cz as d,bd as e,Bj as f,yz as g,az as h,Mc as i,x as j,qe as k,Rg as l,ot as m,fz as n,Z as o,jL as p,oi as q,y as r,at as s,hz as t,a1 as u,Q1 as v,CS as w,pj as x,kg as y,I as z}; diff --git a/assets/index-DacotVUe.js b/assets/index-OagizEwS.js similarity index 72% rename from assets/index-DacotVUe.js rename to assets/index-OagizEwS.js index 271a0b54508be37bd26fb72e3b100e45e7b8e1e8..b4e6f39c590265b5632001d14bd1bc7f0d9d028f 100644 --- a/assets/index-DacotVUe.js +++ b/assets/index-OagizEwS.js @@ -1 +1 @@ -import{r as u}from"./index-C7DzD1KZ.js";function o(r){const e=u.useRef({value:r,previous:r});return u.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; +import{r as u}from"./index-DB5YVNrt.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/input-B4Wwo7mm.js b/assets/input-DnxeMTC9.js similarity index 88% rename from assets/input-B4Wwo7mm.js rename to assets/input-DnxeMTC9.js index 8c2842c9e25219649481c5dbf40c479f424ca6cd..c99f96fbae046bbd90443fcdc509bfbe3cb9746b 100644 --- a/assets/input-B4Wwo7mm.js +++ b/assets/input-DnxeMTC9.js @@ -1 +1 @@ -import{r as s,j as i,s as n}from"./index-C7DzD1KZ.js";const d=s.forwardRef(({className:e,type:r,...o},t)=>i.jsx("input",{type:r,className:n("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:t,...o}));d.displayName="Input";export{d as I}; +import{r as s,j as i,s as n}from"./index-DB5YVNrt.js";const d=s.forwardRef(({className:e,type:r,...o},t)=>i.jsx("input",{type:r,className:n("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:t,...o}));d.displayName="Input";export{d as I}; diff --git a/assets/loader-circle-Bp8rZ20U.js b/assets/loader-circle-uWjxppt1.js similarity index 87% rename from assets/loader-circle-Bp8rZ20U.js rename to assets/loader-circle-uWjxppt1.js index 2ba2233c76ec9049c2ad3efeb6bbbd26a9575821..7e9908aa71c7c3ee12d03f93d14681d444b9fd3e 100644 --- a/assets/loader-circle-Bp8rZ20U.js +++ b/assets/loader-circle-uWjxppt1.js @@ -1,4 +1,4 @@ -import{e}from"./index-C7DzD1KZ.js";/** +import{e}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-CeZ4KorQ.js b/assets/openrouter-DZnDVTdj.js similarity index 82% rename from assets/openrouter-CeZ4KorQ.js rename to assets/openrouter-DZnDVTdj.js index f0ffdbcb7cc0779845964d4f2570ec862d7742ff..70ee8d3dbc40892299475412d725fbe1c1d5e030 100644 --- a/assets/openrouter-CeZ4KorQ.js +++ b/assets/openrouter-DZnDVTdj.js @@ -1 +1 @@ -import{u as r}from"./useQuery-C-S9qU90.js";import{c as n}from"./chat-CYCaJ4hM.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getUsage(),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{o as O,s as a,m as r,c as u}; +import{u as r}from"./useQuery-gfOJVfRZ.js";import{c as n}from"./chat-C792FSN8.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getUsage(),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{o as O,s as a,m as r,c as u}; diff --git a/assets/operations-DxpN2fk3.js b/assets/operations-CJQ0CXcc.js similarity index 97% rename from assets/operations-DxpN2fk3.js rename to assets/operations-CJQ0CXcc.js index 99f418920098896f803a4b131fcd707f77246c37..02323fbf8774378a9fd5a0f89cba369c40aab64d 100644 --- a/assets/operations-DxpN2fk3.js +++ b/assets/operations-CJQ0CXcc.js @@ -1,4 +1,4 @@ -import{e as c,r as a,j as r,s as n,$ as u}from"./index-C7DzD1KZ.js";/** +import{e as c,r as a,j as r,s as n,$ as u}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/paperEdits-B067dmC0.js b/assets/paperEdits-D718tWaT.js similarity index 87% rename from assets/paperEdits-B067dmC0.js rename to assets/paperEdits-D718tWaT.js index ee573eeebb71c779683c11d026b139b6bf5d5e29..e9d9d9f7340498e90a662e0b29c6166b97dd1294 100644 --- a/assets/paperEdits-B067dmC0.js +++ b/assets/paperEdits-D718tWaT.js @@ -1 +1 @@ -import{$ as p}from"./index-C7DzD1KZ.js";const i={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),history:(e,o)=>p(`/papers/${e}/edit-history${o?`?cursor=${encodeURIComponent(o)}`:""}`),digest:(e,o)=>p(`/admin/paper-edit-digest?day=${e}&page=${o}`),suspend:(e,o)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:o})})};export{i as p}; +import{$ as p}from"./index-DB5YVNrt.js";const i={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),history:(e,o)=>p(`/papers/${e}/edit-history${o?`?cursor=${encodeURIComponent(o)}`:""}`),digest:(e,o)=>p(`/admin/paper-edit-digest?day=${e}&page=${o}`),suspend:(e,o)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:o})})};export{i as p}; diff --git a/assets/papers-BNcOWLi8.js b/assets/papers-CTasJek9.js similarity index 99% rename from assets/papers-BNcOWLi8.js rename to assets/papers-CTasJek9.js index b3ef09169fd1a8436e3b14ca532dbd3a164932c3..d26e28431965d57d48e387161f1dc2104136e72d 100644 --- a/assets/papers-BNcOWLi8.js +++ b/assets/papers-CTasJek9.js @@ -1 +1 @@ -var y=Object.defineProperty;var w=(i,e,t)=>e in i?y(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var m=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);import{A as f,y as S,$ as l}from"./index-C7DzD1KZ.js";const d="pwc:fresh-auth-mutation";function $(i){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",i);const e=S("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class v{constructor(e,t=$){m(this,"paperLoads",new Map);m(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(s=>{throw this.paperLoads.delete(e),s}),this.paperLoads.set(e,r)),r}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(s=>{throw this.evaluationLoads.delete(e),s}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,t,r,s,o){const a=this.paperLoads.get(e);if(!a)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const n=(await a).sections[t];if(!n)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,s,r,n,o,`paper:${e}:${t}`)}async mutateEvaluations(e,t,r,s){const o=this.evaluationLoads.get(String(e));if(!o)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const a=(await o).version;return this.mutate("evaluations",r,t,a,s,`paper:${e}:evaluations`)}async mutate(e,t,r,s,o,a){const n=new Headers(o.headers);Object.entries(this.idempotencyHeaders(a,r,s)).forEach(([u,g])=>n.set(u,g));const p={...o,headers:n};try{const u=await this.request(t,p);return this.clearAttempt(p),u}catch(u){throw u instanceof f&&u.status===401&&u.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,r,p),this.recoverFreshAuth(e)):u instanceof f&&u.status===409&&(this.clearAttempt(p),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),u}}freshAuthMutationDraft(){const e=sessionStorage.getItem(d);if(!e)return null;try{const t=JSON.parse(e);if(!t.endpoint.startsWith("/")||t.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(t.options.method))throw new Error("Invalid saved mutation draft");return t}catch{return sessionStorage.removeItem(d),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const t=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(d),sessionStorage.removeItem("pwc:fresh-auth-edit"),t}saveFreshAuthMutation(e,t,r,s){const o=Object.fromEntries(new Headers(s.headers).entries()),a=typeof s.body=="string"?s.body:void 0;sessionStorage.setItem(d,JSON.stringify({section:e,endpoint:t,payload:r,options:{method:(s.method??"POST").toUpperCase(),body:a,headers:o}}))}idempotencyHeaders(e,t,r){const s=`pwc:mutation:${e}:${JSON.stringify(t)}`,o=sessionStorage.getItem(s);if(o){const n=JSON.parse(o);return{"Idempotency-Key":n.key,"If-Match":n.version}}const a=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:a,version:r})),sessionStorage.setItem(`pwc:mutation-key:${a}`,s),{"Idempotency-Key":a,"If-Match":r}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const r=sessionStorage.getItem(`pwc:mutation-key:${t}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const h=new v(l);function c(i){const e=new URLSearchParams;for(const[r,s]of Object.entries(i??{}))s!==void 0&&s!==""&&e.set(r,String(s));const t=e.toString();return t?`?${t}`:""}class P{constructor(e){this.request=e}list(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&o!==""&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,o,a){const n=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&n.set("mode",s),a!=null&&a.start_date&&n.set("start_date",a.start_date),a!=null&&a.end_date&&n.set("end_date",a.end_date),this.request(`/papers/search?${n.toString()}`,{signal:o})}searchFeed(e){return this.request(`/papers/search/feed${c(e)}`,{cache:"no-cache"})}get(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}related(e,t=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${t}`)}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,t){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}trending(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,t){return this.request(`/tasks/${e}/papers${c(t)}`)}forMethod(e,t){return this.request(`/methods/${encodeURIComponent(e)}/papers${c(t)}`)}forConference(e,t){return this.request(`/conferences/${e}/papers${c(t)}`)}forOrganization(e,t){return this.request(`/organizations/${e}/papers${c(t)}`)}getAuthor(e){return this.request(`/authors/${e}`)}authorPapers(e,t){return this.request(`/authors/${e}/papers${c(t)}`)}primeCurationState(e,t=!1){return h.primePaper(e,t)}freshAuthMutationDraft(){return h.freshAuthMutationDraft()}resumeFreshAuthMutation(){return h.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return h.mutatePaper(e,"tasks",t,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,t){const r=new URLSearchParams(t.map(s=>["method_ids",String(s)])).toString();return h.mutatePaper(e,"methods",t,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,t){const r=new URLSearchParams(t.map(s=>["organization_ids",String(s)])).toString();return h.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return h.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return h.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateSourceUrl(e,t){return h.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return h.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const O=new P(l);export{h as a,O as p}; +var y=Object.defineProperty;var w=(i,e,t)=>e in i?y(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var m=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);import{A as f,y as S,$ as l}from"./index-DB5YVNrt.js";const d="pwc:fresh-auth-mutation";function $(i){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",i);const e=S("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class v{constructor(e,t=$){m(this,"paperLoads",new Map);m(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(s=>{throw this.paperLoads.delete(e),s}),this.paperLoads.set(e,r)),r}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(s=>{throw this.evaluationLoads.delete(e),s}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,t,r,s,o){const a=this.paperLoads.get(e);if(!a)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const n=(await a).sections[t];if(!n)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,s,r,n,o,`paper:${e}:${t}`)}async mutateEvaluations(e,t,r,s){const o=this.evaluationLoads.get(String(e));if(!o)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const a=(await o).version;return this.mutate("evaluations",r,t,a,s,`paper:${e}:evaluations`)}async mutate(e,t,r,s,o,a){const n=new Headers(o.headers);Object.entries(this.idempotencyHeaders(a,r,s)).forEach(([u,g])=>n.set(u,g));const p={...o,headers:n};try{const u=await this.request(t,p);return this.clearAttempt(p),u}catch(u){throw u instanceof f&&u.status===401&&u.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,r,p),this.recoverFreshAuth(e)):u instanceof f&&u.status===409&&(this.clearAttempt(p),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),u}}freshAuthMutationDraft(){const e=sessionStorage.getItem(d);if(!e)return null;try{const t=JSON.parse(e);if(!t.endpoint.startsWith("/")||t.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(t.options.method))throw new Error("Invalid saved mutation draft");return t}catch{return sessionStorage.removeItem(d),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const t=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(d),sessionStorage.removeItem("pwc:fresh-auth-edit"),t}saveFreshAuthMutation(e,t,r,s){const o=Object.fromEntries(new Headers(s.headers).entries()),a=typeof s.body=="string"?s.body:void 0;sessionStorage.setItem(d,JSON.stringify({section:e,endpoint:t,payload:r,options:{method:(s.method??"POST").toUpperCase(),body:a,headers:o}}))}idempotencyHeaders(e,t,r){const s=`pwc:mutation:${e}:${JSON.stringify(t)}`,o=sessionStorage.getItem(s);if(o){const n=JSON.parse(o);return{"Idempotency-Key":n.key,"If-Match":n.version}}const a=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:a,version:r})),sessionStorage.setItem(`pwc:mutation-key:${a}`,s),{"Idempotency-Key":a,"If-Match":r}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const r=sessionStorage.getItem(`pwc:mutation-key:${t}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const h=new v(l);function c(i){const e=new URLSearchParams;for(const[r,s]of Object.entries(i??{}))s!==void 0&&s!==""&&e.set(r,String(s));const t=e.toString();return t?`?${t}`:""}class P{constructor(e){this.request=e}list(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&o!==""&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,o,a){const n=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&n.set("mode",s),a!=null&&a.start_date&&n.set("start_date",a.start_date),a!=null&&a.end_date&&n.set("end_date",a.end_date),this.request(`/papers/search?${n.toString()}`,{signal:o})}searchFeed(e){return this.request(`/papers/search/feed${c(e)}`,{cache:"no-cache"})}get(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}related(e,t=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${t}`)}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,t){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}trending(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,t){return this.request(`/tasks/${e}/papers${c(t)}`)}forMethod(e,t){return this.request(`/methods/${encodeURIComponent(e)}/papers${c(t)}`)}forConference(e,t){return this.request(`/conferences/${e}/papers${c(t)}`)}forOrganization(e,t){return this.request(`/organizations/${e}/papers${c(t)}`)}getAuthor(e){return this.request(`/authors/${e}`)}authorPapers(e,t){return this.request(`/authors/${e}/papers${c(t)}`)}primeCurationState(e,t=!1){return h.primePaper(e,t)}freshAuthMutationDraft(){return h.freshAuthMutationDraft()}resumeFreshAuthMutation(){return h.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return h.mutatePaper(e,"tasks",t,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,t){const r=new URLSearchParams(t.map(s=>["method_ids",String(s)])).toString();return h.mutatePaper(e,"methods",t,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,t){const r=new URLSearchParams(t.map(s=>["organization_ids",String(s)])).toString();return h.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return h.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return h.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateSourceUrl(e,t){return h.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return h.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const O=new P(l);export{h as a,O as p}; diff --git a/assets/popover-CQWB7HGQ.js b/assets/popover-BqJw3haa.js similarity index 98% rename from assets/popover-CQWB7HGQ.js rename to assets/popover-BqJw3haa.js index 47ad2404e757207a1da4d289672af3493acdd507..75fed314251e57614b5638eed80f9378d1f0f7f6 100644 --- a/assets/popover-CQWB7HGQ.js +++ b/assets/popover-BqJw3haa.js @@ -1 +1 @@ -import{r as a,j as l,a2 as V,l as W,ab as $,W as L,m as A,k as O,o as h,ac as E,ad as y,P as _,a3 as H,q as z,a4 as G,a5 as B,a6 as K,a7 as Z,a8 as q,ae as U,af as J,s as Q}from"./index-C7DzD1KZ.js";function X(e){const t=Y(e),r=a.forwardRef((n,o)=>{const{children:s,...c}=n,i=a.Children.toArray(s),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:a.isValidElement(u)?a.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=a.forwardRef((r,n)=>{const{children:o,...s}=r;if(a.isValidElement(o)){const c=re(o),i=te(s,o.props);return o.type!==a.Fragment&&(i.ref=n?V(n,c):c),a.cloneElement(o,i)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ee}function te(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const p=s(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function re(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C="Popover",[b]=z(C,[y]),m=y(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,i=m(t),p=a.useRef(null),[u,P]=a.useState(!1),[f,v]=W({prop:n,defaultProp:o??!1,onChange:s,caller:C});return l.jsx($,{...i,children:l.jsx(ne,{scope:t,contentId:L(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>P(!0),[]),onCustomAnchorRemove:a.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",se=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),s=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return a.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...s,...n,ref:t})});se.displayName=w;var S="PopoverTrigger",N=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),s=m(r),c=A(t,o.triggerRef),i=l.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":M(o.open),...n,ref:c,onClick:h(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(E,{asChild:!0,...s,children:i})});N.displayName=S;var R="PopoverPortal",[ae,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=d(R,t);return l.jsx(ae,{scope:t,forceMount:r,children:l.jsx(_,{present:r||s.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=a.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=d(g,e.__scopePopover);return l.jsx(_,{present:n||s.open,children:s.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=a.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=a.useRef(null),o=A(t,n),s=a.useRef(!1);return a.useEffect(()=>{const c=n.current;if(c)return G(c)},[]),l.jsx(B,{as:ie,allowPinchZoom:!0,children:l.jsx(I,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),s.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=a.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=a.useRef(!1),o=a.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),I=a.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return K(),l.jsx(Z,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(q,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:P,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(U,{"data-state":M(v.open),role:"dialog",id:v.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ue=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(O.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(J,{...o,...n,ref:t})});fe.displayName=de;function M(e){return e?"open":"closed"}var ve=j,Pe=N,ge=F,k=D;const Ce=ve,xe=Pe,he=a.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>l.jsx(ge,{children:l.jsx(k,{ref:o,align:t,sideOffset:r,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));he.displayName=k.displayName;export{Ce as P,xe as a,he as b}; +import{r as a,j as l,a2 as V,l as W,ab as $,W as L,m as A,k as O,o as h,ac as E,ad as y,P as _,a3 as H,q as z,a4 as G,a5 as B,a6 as K,a7 as Z,a8 as q,ae as U,af as J,s as Q}from"./index-DB5YVNrt.js";function X(e){const t=Y(e),r=a.forwardRef((n,o)=>{const{children:s,...c}=n,i=a.Children.toArray(s),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:a.isValidElement(u)?a.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=a.forwardRef((r,n)=>{const{children:o,...s}=r;if(a.isValidElement(o)){const c=re(o),i=te(s,o.props);return o.type!==a.Fragment&&(i.ref=n?V(n,c):c),a.cloneElement(o,i)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ee}function te(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const p=s(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function re(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C="Popover",[b]=z(C,[y]),m=y(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,i=m(t),p=a.useRef(null),[u,P]=a.useState(!1),[f,v]=W({prop:n,defaultProp:o??!1,onChange:s,caller:C});return l.jsx($,{...i,children:l.jsx(ne,{scope:t,contentId:L(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>P(!0),[]),onCustomAnchorRemove:a.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",se=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),s=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return a.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...s,...n,ref:t})});se.displayName=w;var S="PopoverTrigger",N=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),s=m(r),c=A(t,o.triggerRef),i=l.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":M(o.open),...n,ref:c,onClick:h(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(E,{asChild:!0,...s,children:i})});N.displayName=S;var R="PopoverPortal",[ae,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=d(R,t);return l.jsx(ae,{scope:t,forceMount:r,children:l.jsx(_,{present:r||s.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=a.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=d(g,e.__scopePopover);return l.jsx(_,{present:n||s.open,children:s.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=a.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=a.useRef(null),o=A(t,n),s=a.useRef(!1);return a.useEffect(()=>{const c=n.current;if(c)return G(c)},[]),l.jsx(B,{as:ie,allowPinchZoom:!0,children:l.jsx(I,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),s.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=a.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=a.useRef(!1),o=a.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),I=a.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return K(),l.jsx(Z,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(q,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:P,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(U,{"data-state":M(v.open),role:"dialog",id:v.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ue=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(O.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(J,{...o,...n,ref:t})});fe.displayName=de;function M(e){return e?"open":"closed"}var ve=j,Pe=N,ge=F,k=D;const Ce=ve,xe=Pe,he=a.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>l.jsx(ge,{children:l.jsx(k,{ref:o,align:t,sideOffset:r,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));he.displayName=k.displayName;export{Ce as P,xe as a,he as b}; diff --git a/assets/refresh-cw-CUIhAWJ4.js b/assets/refresh-cw-HoaNTnTk.js similarity index 95% rename from assets/refresh-cw-CUIhAWJ4.js rename to assets/refresh-cw-HoaNTnTk.js index a6dbbc8ad3e5fc3215833221845d37c8c7b3bbb8..dafc01b36e851f0dc528523a7ff1d23081f215af 100644 --- a/assets/refresh-cw-CUIhAWJ4.js +++ b/assets/refresh-cw-HoaNTnTk.js @@ -1,4 +1,4 @@ -import{e}from"./index-C7DzD1KZ.js";/** +import{e}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/savedPapersAuth-Da0dU9fE.js b/assets/savedPapersAuth-Ca15fo9W.js similarity index 85% rename from assets/savedPapersAuth-Da0dU9fE.js rename to assets/savedPapersAuth-Ca15fo9W.js index 93b21bdd1a234893e8dcd7a7f9e1ffd4a8a956b7..2d8902f5a24808f721ac5a5d26bb7823a785d46c 100644 --- a/assets/savedPapersAuth-Da0dU9fE.js +++ b/assets/savedPapersAuth-Ca15fo9W.js @@ -1 +1 @@ -import{y as i}from"./index-C7DzD1KZ.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{y as i}from"./index-DB5YVNrt.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-B8y6G69L.js b/assets/searchable-select-Bw0OPNzm.js similarity index 98% rename from assets/searchable-select-B8y6G69L.js rename to assets/searchable-select-Bw0OPNzm.js index f7d275bc5069f1028567c0c751bedecb9d6c0f1c..39aa0810e789e244ffeb7baa0a98ac9bc8151f44 100644 --- a/assets/searchable-select-B8y6G69L.js +++ b/assets/searchable-select-Bw0OPNzm.js @@ -1,4 +1,4 @@ -import{e as he,r as a,W as Q,k as L,a2 as W,j as p,s as D,C as Me}from"./index-C7DzD1KZ.js";import{u as De}from"./useQuery-C-S9qU90.js";import{B as $e}from"./button-B2L1cddC.js";import{P as Le,a as Pe,b as Fe}from"./popover-CQWB7HGQ.js";import{R as qe,P as Ke,O as Ve,C as Be}from"./dialog-vRXA8k-N.js";import{L as Ue}from"./loader-circle-Bp8rZ20U.js";/** +import{e as he,r as a,W as Q,k as L,a2 as W,j as p,s as D,C as Me}from"./index-DB5YVNrt.js";import{u as De}from"./useQuery-gfOJVfRZ.js";import{B as $e}from"./button-BvgK708w.js";import{P as Le,a as Pe,b as Fe}from"./popover-BqJw3haa.js";import{R as qe,P as Ke,O as Ve,C as Be}from"./dialog-CSh5S1Qx.js";import{L as Ue}from"./loader-circle-uWjxppt1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/shield-alert-BX1GxHfp.js b/assets/shield-alert-TqnwXhnw.js similarity index 92% rename from assets/shield-alert-BX1GxHfp.js rename to assets/shield-alert-TqnwXhnw.js index c6e4a1a534c6a4fd48546e3124d6771955eeee0b..21abfec57a93d91284184c82c01782d37d017fce 100644 --- a/assets/shield-alert-BX1GxHfp.js +++ b/assets/shield-alert-TqnwXhnw.js @@ -1,4 +1,4 @@ -import{e}from"./index-C7DzD1KZ.js";/** +import{e}from"./index-DB5YVNrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-BBQyes8J.js b/assets/skeleton-jY-za2d8.js similarity index 62% rename from assets/skeleton-BBQyes8J.js rename to assets/skeleton-jY-za2d8.js index 3d169b11e44a3870af6de1b414fa526a60233af0..418df44e968139f166185737f2532dc92a0f8e9b 100644 --- a/assets/skeleton-BBQyes8J.js +++ b/assets/skeleton-jY-za2d8.js @@ -1 +1 @@ -import{j as t,s as n}from"./index-C7DzD1KZ.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,s as n}from"./index-DB5YVNrt.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/submissions-Du_vtued.js b/assets/submissions-B7ABJ5o_.js similarity index 99% rename from assets/submissions-Du_vtued.js rename to assets/submissions-B7ABJ5o_.js index 86d3bc6c2b533b09c7ce96811a38d98572c3eee2..da5d0e150b23862a340031834ea8bf0e332d7e8d 100644 --- a/assets/submissions-Du_vtued.js +++ b/assets/submissions-B7ABJ5o_.js @@ -1 +1 @@ -import{$ as qe}from"./index-C7DzD1KZ.js";var v;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},s.getValidEnumValues=n=>{const a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(const i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(v||(v={}));var we;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(we||(we={}));const u=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?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(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=v.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 I 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 t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;ft.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const ue=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,v.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:v.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(s)}return{message:t}};let Fe=ue;function We(){return Fe}const Je=s=>{const{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const f=r.filter(p=>!!p).slice().reverse();for(const p of f)o=p(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function c(s,e){const t=We(),r=Je({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===ue?void 0:ue].filter(n=>!!n)});s.common.issues.push(r)}class S{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const a=await n.key,i=await n.value;r.push({key:a,value:i})}return S.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),F=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Te=s=>s.status==="aborted",Se=s=>s.status==="dirty",U=s=>s.status==="valid",Q=s=>typeof Promise<"u"&&s instanceof Promise;var l;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(l||(l={}));class A{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}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 Ce=(s,e)=>{if(U(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(s.common.issues);return this._error=t,this._error}}};function y(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:n}}class g{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Q(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Ce(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return U(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>U(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Q(n)?n:Promise.resolve(n));return Ce(r,a)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new z({schema:this,typeName:_.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:t=>this["~validate"](t)}}optional(){return E.create(this,this._def)}nullable(){return L.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return re.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return ee.create(this,e,this._def)}transform(e){return new z({...y(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...y(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new Pe({typeName:_.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ae({...y(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ke.create(this,e)}readonly(){return ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ye=/^c[^\s-]{8,}$/i,He=/^[0-9a-z]+$/,Ge=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qe=/^[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,Xe=/^[a-z0-9_-]{21}$/i,Ke=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,et=/^[-+]?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)?)??$/,tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,st="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ce;const rt=/^(?:(?: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])$/,nt=/^(?:(?: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])$/,at=/^(([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]))$/,it=/^(([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])$/,ot=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,je="((\\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])))",ct=new RegExp(`^${je}$`);function Ie(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ut(s){return new RegExp(`^${Ie(s)}$`)}function lt(s){let e=`${je}T${Ie(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ht(s,e){return!!((e==="v4"||!e)&&rt.test(s)||(e==="v6"||!e)&&at.test(s))}function ft(s,e){if(!Ke.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function pt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&it.test(s))}class R extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.string,received:a.parsedType}),m}const r=new S;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:d.invalid_string,...l.errToObj(r)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...l.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...l.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...l.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,...l.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,...l.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...l.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...l.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errToObj(t)})}nonempty(e){return this.min(1,l.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew R({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});function mt(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=Number.parseInt(s.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class B extends g{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 a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.number,received:a.parsedType}),m}let r;const n=new S;for(const a of this._def.checks)a.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?mt(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew B({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class W extends g{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 n=new S;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new W({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew W({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});class le extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return O(e.data)}}le.create=s=>new le({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class X extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_date}),m}const r=new S;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):v.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew X({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...y(s)});class Oe extends g{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return O(e.data)}}Oe.create=s=>new Oe({typeName:_.ZodSymbol,...y(s)});class he extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodUndefined,...y(s)});class fe extends g{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodNull,...y(s)});class Ne extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ne.create=s=>new Ne({typeName:_.ZodAny,...y(s)});class pe extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodUnknown,...y(s)});class P extends g{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...y(s)});class Ae extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodVoid,...y(s)});class N extends g{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(c(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new A(t,i,t.path,o)))).then(i=>S.mergeArray(r,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new A(t,i,t.path,o)));return S.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:l.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:l.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:l.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(s,e)=>new N({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...y(e)});function D(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=E.create(D(r))}return new w({...s._def,shape:()=>e})}else return s instanceof N?new N({...s._def,type:D(s.element)}):s instanceof E?E.create(D(s.unwrap())):s instanceof L?L.create(D(s.unwrap())):s instanceof M?M.create(s.items.map(e=>D(e))):s}class w extends g{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(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:u.object,received:p.parsedType}),m}const{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in n.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const x=a[p],q=n.data[p];f.push({key:{status:"valid",value:p},value:x._parse(new A(n,q,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:n.data[x]}});else if(p==="strict")o.length>0&&(c(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const x of o){const q=n.data[x];f.push({key:{status:"valid",value:x},value:p._parse(new A(n,q,n.path,x)),alwaysSet:x in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const p=[];for(const x of f){const q=await x.key,Be=await x.value;p.push({key:q,value:Be,alwaysSet:x.alwaysSet})}return p}).then(p=>S.mergeObjectSync(r,p)):S.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return l.errToObj,new w({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:l.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new w({...this._def,unknownKeys:"strip"})}passthrough(){return new w({...this._def,unknownKeys:"passthrough"})}extend(e){return new w({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w({...this._def,catchall:e})}pick(e){const t={};for(const r of v.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}omit(e){const t={};for(const r of v.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}deepPartial(){return D(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new w({...this._def,shape:()=>t})}required(e){const t={};for(const r of v.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof E;)a=a._def.innerType;t[r]=a}return new w({...this._def,shape:()=>t})}keyof(){return $e(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});class K extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new I(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},x=f._parseSync({data:t.data,path:t.path,parent:p});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new I(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}K.create=(s,e)=>new K({options:s,typeName:_.ZodUnion,...y(e)});const Z=s=>s instanceof _e?Z(s.schema):s instanceof z?Z(s.innerType()):s instanceof se?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?Z(s._def.innerType):s instanceof he?[void 0]:s instanceof fe?[null]:s instanceof E?[void 0,...Z(s.unwrap())]:s instanceof L?[null,...Z(s.unwrap())]:s instanceof Pe||s instanceof ie?Z(s.unwrap()):s instanceof ae?Z(s._def.innerType):[];class xe extends g{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return c(t,{code:d.invalid_type,expected:u.object,received:t.parsedType}),m;const r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const i=Z(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new xe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(r)})}}function me(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const n=v.objectKeys(e),a=v.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(const o of a){const f=me(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(Te(a)||Te(i))return m;const o=me(a.value,i.value);return o.valid?((Se(a)||Se(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};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(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ee.create=(s,e,t)=>new ee({left:s,right:e,typeName:_.ZodIntersection,...y(t)});class M extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new A(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>S.mergeArray(t,i)):S.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new M({...this._def,rest:e})}}M.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new M({items:s,typeName:_.ZodTuple,rest:null,...y(e)})};class te extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:d.invalid_type,expected:u.object,received:r.parsedType}),m;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in r.data)n.push({key:a._parse(new A(r,o,r.path,o)),value:i._parse(new A(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?S.mergeObjectAsync(t,n):S.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof g?new te({keyType:e,valueType:t,typeName:_.ZodRecord,...y(r)}):new te({keyType:R.create(),valueType:e,typeName:_.ZodRecord,...y(t)})}}class Ze extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:n._parse(new A(r,o,r.path,[p,"key"])),value:a._parse(new A(r,f,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const p=await f.key,x=await f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,x=f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}}}}Ze.create=(s,e,t)=>new Ze({valueType:e,keyType:s,typeName:_.ZodMap,...y(t)});class J extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const n=this._def;n.minSize!==null&&r.data.sizen.maxSize.value&&(c(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const p=new Set;for(const x of f){if(x.status==="aborted")return m;x.status==="dirty"&&t.dirty(),p.add(x.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>a._parse(new A(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new J({...this._def,minSize:{value:e,message:l.toString(t)}})}max(e,t){return new J({...this._def,maxSize:{value:e,message:l.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}J.create=(s,e)=>new J({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...y(e)});class _e extends g{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(s,e)=>new _e({getter:s,typeName:_.ZodLazy,...y(e)});class se extends g{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(s,e)=>new se({value:s,typeName:_.ZodLiteral,...y(e)});function $e(s,e){return new V({values:s,typeName:_.ZodEnum,...y(e)})}class V extends g{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:v.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}V.create=$e;class ye extends g{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const n=v.objectValues(t);return c(r,{expected:v.joinValues(n),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:n}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...y(e)});class re extends g{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return O(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}re.create=(s,e)=>new re({type:s,typeName:_.ZodPromise,...y(e)});class z extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?F(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?F(o.value):o}}if(n.type==="refinement"){const i=o=>{const f=n.refinement(o,a);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!U(i))return m;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>U(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):m);v.assertNever(n)}}z.create=(s,e,t)=>new z({schema:s,typeName:_.ZodEffects,effect:e,...y(t)});z.createWithPreprocess=(s,e,t)=>new z({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...y(t)});class E extends g{_parse(e){return this._getType(e)===u.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}E.create=(s,e)=>new E({innerType:s,typeName:_.ZodOptional,...y(e)});class L extends g{_parse(e){return this._getType(e)===u.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}L.create=(s,e)=>new L({innerType:s,typeName:_.ZodNullable,...y(e)});class ne extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ae extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Q(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ae.create=(s,e)=>new ae({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class Re extends g{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}Re.create=s=>new Re({typeName:_.ZodNaN,...y(s)});class Pe extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ke extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),F(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new ke({in:e,out:t,typeName:_.ZodPipeline})}}class ie extends g{_parse(e){const t=this._def.innerType._parse(e),r=n=>(U(n)&&(n.value=Object.freeze(n.value)),n);return Q(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodReadonly,...y(e)});var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const h=R.create,b=B.create,oe=le.create,_t=pe.create;P.create;const T=N.create,k=w.create,Me=K.create,Ve=xe.create;ee.create;M.create;const ze=te.create,G=se.create,ge=V.create;re.create;E.create;L.create;const j=ze(_t()),be=k({id:b(),name:h(),slug:h().optional()}).passthrough(),de=k({url:h(),is_official:oe()}),ve=k({task_id:b(),dataset_id:b(),model_name:h().nullish(),harness:h().nullish(),methodology:h().nullish(),metrics:ze(Me([h(),b()])),uses_additional_data:oe().optional(),is_open:oe().optional(),best_rank:b().nullish(),best_metric:h().nullish(),evaluated_on:h().nullish(),external_source_url:h().nullish(),num_parameters:b().nullish(),hf_model_url:h().nullish()}).passthrough(),yt=ve.partial().extend({id:b().optional()}),gt=Ve("op",[k({op:G("create"),data:ve}),k({op:G("update"),evaluation_id:b(),data:ve}),k({op:G("delete"),evaluation_id:b()})]),Ee=k({hf_models:T(h()),hf_datasets:T(h()),hf_spaces:T(h())}),Le=k({file_name:h(),mime_type:h(),data_url:h().optional(),url:h().optional()}),Y=k({name:h(),description:h().optional()}),vt=Y.extend({image:Le.optional(),image_credit:h().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:h().optional()}),xt=Y.extend({image:Le.optional(),image_credit:h().optional(),source_paper_id:b().optional(),source_url:h().optional(),source_title:h().optional()}),kt=Me([k({benchmark:h(),task:h(),description:h()}),Y.extend({description:h(),task_ids:T(b()),full_name:h().optional(),url:h().optional(),hf_url:h().optional(),paper_url:h().optional(),license_name:h().optional(),license_url:h().optional()})]),bt=Y.extend({description:h(),direction:ge(["higher_is_better","lower_is_better"]),full_name:h().optional(),scale:h().optional(),task_id:b(),dataset_id:b()}),wt=Y.extend({short_name:h().optional(),venue:h().optional(),location:h().optional(),url:h(),year:b(),start_date:h().optional(),end_date:h().optional()}),Tt=k({id:b(),paper_id:b().nullable(),hf_username:h(),is_author:oe(),status:ge(["pending","approved","rejected"]),applied_payload:j.nullish(),conflict_payload:j.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:ge(["human","codex"]).nullish(),review_evidence:j.nullish(),created_at:h(),updated_at:h(),reviewed_at:h().nullish()});function C(s,e,t){return Tt.extend({edit_type:G(s),proposed_payload:e,current_payload:t.nullish()})}const St=C("tasks",k({task_ids:T(b())}),k({tasks:T(be)})),Ct=C("methods",k({method_ids:T(b())}),k({methods:T(be)})),Ot=C("evaluations",k({operations:T(gt)}),k({evaluations:T(yt)})),Nt=C("repositories",k({repositories:T(de)}),k({repositories:T(de)})),At=C("project_pages",k({project_pages:T(de)}),k({project_pages:T(de)})),Zt=C("source_url",k({source_url:h()}),k({source_url:h().nullish()})),Rt=C("hf_artifacts",Ee,Ee),Et=C("organizations",k({organization_ids:T(b())}),k({organizations:T(be)})),jt=C("new_task",vt,j),It=C("new_method",xt,j),$t=C("new_benchmark",kt,j),Pt=C("new_metric",bt,j),Mt=C("new_conference",wt,j),Vt=C("new_external_paper",k({title:h().optional(),source_url:h(),authors:T(h()),date_published:h().optional(),abstract:h().optional()}),j),De=Ve("edit_type",[St,Ct,Ot,Nt,At,Zt,Rt,Et,jt,It,$t,Pt,Mt,Vt]);function qt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const zt=k({count:b(),results:T(De)});class Lt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Ue(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new Lt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const H=s=>Ue(De,s),Dt=s=>Ue(zt,s);class Ut{constructor(e){this.request=e}async submit(e){return H(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[n,a]of Object.entries(e??{}))a!==void 0&&t.set(n,String(a));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(Dt)}async get(e){return H(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Ft=new Ut(qe);export{qt as p,Ft as s}; +import{$ as qe}from"./index-DB5YVNrt.js";var v;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},s.getValidEnumValues=n=>{const a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(const i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(v||(v={}));var we;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(we||(we={}));const u=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?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(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=v.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 I 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 t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;ft.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const ue=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,v.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:v.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(s)}return{message:t}};let Fe=ue;function We(){return Fe}const Je=s=>{const{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const f=r.filter(p=>!!p).slice().reverse();for(const p of f)o=p(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function c(s,e){const t=We(),r=Je({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===ue?void 0:ue].filter(n=>!!n)});s.common.issues.push(r)}class S{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const a=await n.key,i=await n.value;r.push({key:a,value:i})}return S.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),F=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Te=s=>s.status==="aborted",Se=s=>s.status==="dirty",U=s=>s.status==="valid",Q=s=>typeof Promise<"u"&&s instanceof Promise;var l;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(l||(l={}));class A{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}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 Ce=(s,e)=>{if(U(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(s.common.issues);return this._error=t,this._error}}};function y(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:n}}class g{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Q(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Ce(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return U(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>U(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Q(n)?n:Promise.resolve(n));return Ce(r,a)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new z({schema:this,typeName:_.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:t=>this["~validate"](t)}}optional(){return E.create(this,this._def)}nullable(){return L.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return re.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return ee.create(this,e,this._def)}transform(e){return new z({...y(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...y(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new Pe({typeName:_.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ae({...y(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ke.create(this,e)}readonly(){return ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ye=/^c[^\s-]{8,}$/i,He=/^[0-9a-z]+$/,Ge=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qe=/^[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,Xe=/^[a-z0-9_-]{21}$/i,Ke=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,et=/^[-+]?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)?)??$/,tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,st="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ce;const rt=/^(?:(?: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])$/,nt=/^(?:(?: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])$/,at=/^(([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]))$/,it=/^(([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])$/,ot=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,je="((\\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])))",ct=new RegExp(`^${je}$`);function Ie(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ut(s){return new RegExp(`^${Ie(s)}$`)}function lt(s){let e=`${je}T${Ie(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ht(s,e){return!!((e==="v4"||!e)&&rt.test(s)||(e==="v6"||!e)&&at.test(s))}function ft(s,e){if(!Ke.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function pt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&it.test(s))}class R extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.string,received:a.parsedType}),m}const r=new S;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:d.invalid_string,...l.errToObj(r)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...l.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...l.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...l.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,...l.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,...l.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...l.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...l.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errToObj(t)})}nonempty(e){return this.min(1,l.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew R({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});function mt(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=Number.parseInt(s.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class B extends g{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 a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.number,received:a.parsedType}),m}let r;const n=new S;for(const a of this._def.checks)a.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?mt(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew B({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class W extends g{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 n=new S;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new W({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew W({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});class le extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return O(e.data)}}le.create=s=>new le({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class X extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_date}),m}const r=new S;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):v.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew X({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...y(s)});class Oe extends g{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return O(e.data)}}Oe.create=s=>new Oe({typeName:_.ZodSymbol,...y(s)});class he extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodUndefined,...y(s)});class fe extends g{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodNull,...y(s)});class Ne extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ne.create=s=>new Ne({typeName:_.ZodAny,...y(s)});class pe extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodUnknown,...y(s)});class P extends g{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...y(s)});class Ae extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodVoid,...y(s)});class N extends g{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(c(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new A(t,i,t.path,o)))).then(i=>S.mergeArray(r,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new A(t,i,t.path,o)));return S.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:l.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:l.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:l.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(s,e)=>new N({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...y(e)});function D(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=E.create(D(r))}return new w({...s._def,shape:()=>e})}else return s instanceof N?new N({...s._def,type:D(s.element)}):s instanceof E?E.create(D(s.unwrap())):s instanceof L?L.create(D(s.unwrap())):s instanceof M?M.create(s.items.map(e=>D(e))):s}class w extends g{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(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:u.object,received:p.parsedType}),m}const{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in n.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const x=a[p],q=n.data[p];f.push({key:{status:"valid",value:p},value:x._parse(new A(n,q,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:n.data[x]}});else if(p==="strict")o.length>0&&(c(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const x of o){const q=n.data[x];f.push({key:{status:"valid",value:x},value:p._parse(new A(n,q,n.path,x)),alwaysSet:x in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const p=[];for(const x of f){const q=await x.key,Be=await x.value;p.push({key:q,value:Be,alwaysSet:x.alwaysSet})}return p}).then(p=>S.mergeObjectSync(r,p)):S.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return l.errToObj,new w({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:l.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new w({...this._def,unknownKeys:"strip"})}passthrough(){return new w({...this._def,unknownKeys:"passthrough"})}extend(e){return new w({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w({...this._def,catchall:e})}pick(e){const t={};for(const r of v.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}omit(e){const t={};for(const r of v.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}deepPartial(){return D(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new w({...this._def,shape:()=>t})}required(e){const t={};for(const r of v.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof E;)a=a._def.innerType;t[r]=a}return new w({...this._def,shape:()=>t})}keyof(){return $e(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});class K extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new I(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},x=f._parseSync({data:t.data,path:t.path,parent:p});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new I(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}K.create=(s,e)=>new K({options:s,typeName:_.ZodUnion,...y(e)});const Z=s=>s instanceof _e?Z(s.schema):s instanceof z?Z(s.innerType()):s instanceof se?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?Z(s._def.innerType):s instanceof he?[void 0]:s instanceof fe?[null]:s instanceof E?[void 0,...Z(s.unwrap())]:s instanceof L?[null,...Z(s.unwrap())]:s instanceof Pe||s instanceof ie?Z(s.unwrap()):s instanceof ae?Z(s._def.innerType):[];class xe extends g{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return c(t,{code:d.invalid_type,expected:u.object,received:t.parsedType}),m;const r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const i=Z(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new xe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(r)})}}function me(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const n=v.objectKeys(e),a=v.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(const o of a){const f=me(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(Te(a)||Te(i))return m;const o=me(a.value,i.value);return o.valid?((Se(a)||Se(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};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(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ee.create=(s,e,t)=>new ee({left:s,right:e,typeName:_.ZodIntersection,...y(t)});class M extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new A(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>S.mergeArray(t,i)):S.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new M({...this._def,rest:e})}}M.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new M({items:s,typeName:_.ZodTuple,rest:null,...y(e)})};class te extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:d.invalid_type,expected:u.object,received:r.parsedType}),m;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in r.data)n.push({key:a._parse(new A(r,o,r.path,o)),value:i._parse(new A(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?S.mergeObjectAsync(t,n):S.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof g?new te({keyType:e,valueType:t,typeName:_.ZodRecord,...y(r)}):new te({keyType:R.create(),valueType:e,typeName:_.ZodRecord,...y(t)})}}class Ze extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:n._parse(new A(r,o,r.path,[p,"key"])),value:a._parse(new A(r,f,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const p=await f.key,x=await f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,x=f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}}}}Ze.create=(s,e,t)=>new Ze({valueType:e,keyType:s,typeName:_.ZodMap,...y(t)});class J extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const n=this._def;n.minSize!==null&&r.data.sizen.maxSize.value&&(c(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const p=new Set;for(const x of f){if(x.status==="aborted")return m;x.status==="dirty"&&t.dirty(),p.add(x.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>a._parse(new A(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new J({...this._def,minSize:{value:e,message:l.toString(t)}})}max(e,t){return new J({...this._def,maxSize:{value:e,message:l.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}J.create=(s,e)=>new J({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...y(e)});class _e extends g{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(s,e)=>new _e({getter:s,typeName:_.ZodLazy,...y(e)});class se extends g{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(s,e)=>new se({value:s,typeName:_.ZodLiteral,...y(e)});function $e(s,e){return new V({values:s,typeName:_.ZodEnum,...y(e)})}class V extends g{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:v.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}V.create=$e;class ye extends g{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const n=v.objectValues(t);return c(r,{expected:v.joinValues(n),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:n}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...y(e)});class re extends g{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return O(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}re.create=(s,e)=>new re({type:s,typeName:_.ZodPromise,...y(e)});class z extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?F(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?F(o.value):o}}if(n.type==="refinement"){const i=o=>{const f=n.refinement(o,a);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!U(i))return m;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>U(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):m);v.assertNever(n)}}z.create=(s,e,t)=>new z({schema:s,typeName:_.ZodEffects,effect:e,...y(t)});z.createWithPreprocess=(s,e,t)=>new z({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...y(t)});class E extends g{_parse(e){return this._getType(e)===u.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}E.create=(s,e)=>new E({innerType:s,typeName:_.ZodOptional,...y(e)});class L extends g{_parse(e){return this._getType(e)===u.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}L.create=(s,e)=>new L({innerType:s,typeName:_.ZodNullable,...y(e)});class ne extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ae extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Q(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ae.create=(s,e)=>new ae({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class Re extends g{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}Re.create=s=>new Re({typeName:_.ZodNaN,...y(s)});class Pe extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ke extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),F(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new ke({in:e,out:t,typeName:_.ZodPipeline})}}class ie extends g{_parse(e){const t=this._def.innerType._parse(e),r=n=>(U(n)&&(n.value=Object.freeze(n.value)),n);return Q(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodReadonly,...y(e)});var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const h=R.create,b=B.create,oe=le.create,_t=pe.create;P.create;const T=N.create,k=w.create,Me=K.create,Ve=xe.create;ee.create;M.create;const ze=te.create,G=se.create,ge=V.create;re.create;E.create;L.create;const j=ze(_t()),be=k({id:b(),name:h(),slug:h().optional()}).passthrough(),de=k({url:h(),is_official:oe()}),ve=k({task_id:b(),dataset_id:b(),model_name:h().nullish(),harness:h().nullish(),methodology:h().nullish(),metrics:ze(Me([h(),b()])),uses_additional_data:oe().optional(),is_open:oe().optional(),best_rank:b().nullish(),best_metric:h().nullish(),evaluated_on:h().nullish(),external_source_url:h().nullish(),num_parameters:b().nullish(),hf_model_url:h().nullish()}).passthrough(),yt=ve.partial().extend({id:b().optional()}),gt=Ve("op",[k({op:G("create"),data:ve}),k({op:G("update"),evaluation_id:b(),data:ve}),k({op:G("delete"),evaluation_id:b()})]),Ee=k({hf_models:T(h()),hf_datasets:T(h()),hf_spaces:T(h())}),Le=k({file_name:h(),mime_type:h(),data_url:h().optional(),url:h().optional()}),Y=k({name:h(),description:h().optional()}),vt=Y.extend({image:Le.optional(),image_credit:h().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:h().optional()}),xt=Y.extend({image:Le.optional(),image_credit:h().optional(),source_paper_id:b().optional(),source_url:h().optional(),source_title:h().optional()}),kt=Me([k({benchmark:h(),task:h(),description:h()}),Y.extend({description:h(),task_ids:T(b()),full_name:h().optional(),url:h().optional(),hf_url:h().optional(),paper_url:h().optional(),license_name:h().optional(),license_url:h().optional()})]),bt=Y.extend({description:h(),direction:ge(["higher_is_better","lower_is_better"]),full_name:h().optional(),scale:h().optional(),task_id:b(),dataset_id:b()}),wt=Y.extend({short_name:h().optional(),venue:h().optional(),location:h().optional(),url:h(),year:b(),start_date:h().optional(),end_date:h().optional()}),Tt=k({id:b(),paper_id:b().nullable(),hf_username:h(),is_author:oe(),status:ge(["pending","approved","rejected"]),applied_payload:j.nullish(),conflict_payload:j.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:ge(["human","codex"]).nullish(),review_evidence:j.nullish(),created_at:h(),updated_at:h(),reviewed_at:h().nullish()});function C(s,e,t){return Tt.extend({edit_type:G(s),proposed_payload:e,current_payload:t.nullish()})}const St=C("tasks",k({task_ids:T(b())}),k({tasks:T(be)})),Ct=C("methods",k({method_ids:T(b())}),k({methods:T(be)})),Ot=C("evaluations",k({operations:T(gt)}),k({evaluations:T(yt)})),Nt=C("repositories",k({repositories:T(de)}),k({repositories:T(de)})),At=C("project_pages",k({project_pages:T(de)}),k({project_pages:T(de)})),Zt=C("source_url",k({source_url:h()}),k({source_url:h().nullish()})),Rt=C("hf_artifacts",Ee,Ee),Et=C("organizations",k({organization_ids:T(b())}),k({organizations:T(be)})),jt=C("new_task",vt,j),It=C("new_method",xt,j),$t=C("new_benchmark",kt,j),Pt=C("new_metric",bt,j),Mt=C("new_conference",wt,j),Vt=C("new_external_paper",k({title:h().optional(),source_url:h(),authors:T(h()),date_published:h().optional(),abstract:h().optional()}),j),De=Ve("edit_type",[St,Ct,Ot,Nt,At,Zt,Rt,Et,jt,It,$t,Pt,Mt,Vt]);function qt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const zt=k({count:b(),results:T(De)});class Lt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Ue(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new Lt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const H=s=>Ue(De,s),Dt=s=>Ue(zt,s);class Ut{constructor(e){this.request=e}async submit(e){return H(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[n,a]of Object.entries(e??{}))a!==void 0&&t.set(n,String(a));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(Dt)}async get(e){return H(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Ft=new Ut(qe);export{qt as p,Ft as s}; diff --git a/assets/switch-W-detjDD.js b/assets/switch-CVNSFNdW.js similarity index 97% rename from assets/switch-W-detjDD.js rename to assets/switch-CVNSFNdW.js index 5dbdbb2b678729d98ffe61e845e68f8fe2d10d1c..f5b253851d44a712e83561cc0560f54eec1bcd33 100644 --- a/assets/switch-W-detjDD.js +++ b/assets/switch-CVNSFNdW.js @@ -1 +1 @@ -import{r as s,m as C,l as I,j as a,k as y,o as M,p as H,q,s as x}from"./index-C7DzD1KZ.js";import{u as A}from"./index-DacotVUe.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:l="on",onCheckedChange:v,form:i,...w}=t,[u,p]=s.useState(null),k=C(o,h=>p(h)),S=s.useRef(!1),g=u?i||!!u.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:l,...w,ref:k,onClick:M(t.onClick,h=>{B(T=>!T),g&&(S.current=h.isPropagationStopped(),S.current||h.stopPropagation())})}),g&&a.jsx(N,{control:u,bubbles:!S.current,name:n,value:l,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),l=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(l!==e&&p){const k=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(k)}},[l,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,m as C,l as I,j as a,k as y,o as M,p as H,q,s as x}from"./index-DB5YVNrt.js";import{u as A}from"./index-OagizEwS.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:l="on",onCheckedChange:v,form:i,...w}=t,[u,p]=s.useState(null),k=C(o,h=>p(h)),S=s.useRef(!1),g=u?i||!!u.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:l,...w,ref:k,onClick:M(t.onClick,h=>{B(T=>!T),g&&(S.current=h.isPropagationStopped(),S.current||h.stopPropagation())})}),g&&a.jsx(N,{control:u,bubbles:!S.current,name:n,value:l,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),l=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(l!==e&&p){const k=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(k)}},[l,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-BWN21nu7.js b/assets/textarea-rFUixZHL.js similarity index 86% rename from assets/textarea-BWN21nu7.js rename to assets/textarea-rFUixZHL.js index babea270818b14463bd186b68442a25ecec85d93..85f4d7b6277344e0a59d6a00613bcee0f6b37a99 100644 --- a/assets/textarea-BWN21nu7.js +++ b/assets/textarea-rFUixZHL.js @@ -1 +1 @@ -import{r as s,j as a,s as t}from"./index-C7DzD1KZ.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; +import{r as s,j as a,s as t}from"./index-DB5YVNrt.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; diff --git a/assets/transform-Dk33Ziw-.js b/assets/transform-CnBvOSlq.js similarity index 99% rename from assets/transform-Dk33Ziw-.js rename to assets/transform-CnBvOSlq.js index cff66df43e423e88eca054c779d1f379e030e691..1d56602234c6f82b315ea8b20375188b1444c5f6 100644 --- a/assets/transform-Dk33Ziw-.js +++ b/assets/transform-CnBvOSlq.js @@ -1 +1 @@ -import{N as _}from"./index-C7DzD1KZ.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 Z(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),S(n)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!K(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 C(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:C({formats:at,defaultWidth:"full"}),time:C({formats:it,defaultWidth:"full"}),dateTime:C({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 p(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:p({values:dt,defaultWidth:"wide"}),quarter:p({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:p({values:ft,defaultWidth:"wide"}),day:p({values:ht,defaultWidth:"wide"}),dayPeriod:p({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function O(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 kt=/^(\d+)(th|st|nd|rd)?/i,pt=/\d+/i,Ot={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]},Ct={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},Nt={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:kt,parsePattern:pt,valueCallback:t=>parseInt(t,10)}),era:O({matchPatterns:Ot,defaultMatchWidth:"wide",parsePatterns:Pt,defaultParseWidth:"any"}),quarter:O({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:O({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:O({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:O({matchPatterns:Ct,defaultMatchWidth:"any",parsePatterns:Nt,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=+S(e)-+Z(e);return Math.round(n/A)+1}function Q(t,e){var f,g,l,k;const n=w(t),r=n.getFullYear(),a=W(),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??((k=(l=a.locale)==null?void 0:l.options)==null?void 0:k.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 Ut(t,e){var s,u,d,f;const n=W(),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 Lt(t,e){const n=w(t),r=+x(n,e)-+Ut(n,e);return Math.round(r/A)+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=Lt(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+U(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"+U(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 U(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const 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))},At={p:X,P:Ht},It=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return It.test(t)}function Xt(t){return Rt.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,Zt=/[a-zA-Z]/;function Kt(t,e,n){var f,g,l,k;const r=W(),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??((k=(l=r.locale)==null?void 0:l.options)==null?void 0:k.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 Y=At[h];return Y(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(Zt))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 Y=q[h[0]];return Y(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*R+r*I+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function 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 Kt(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 ke(t){const e=$.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return T.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const T=new Set(["AI","OCR"]),$=new Map([["3d-tracking","3D Tracking"],["point-tracking","2D Point Tracking"],["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||ke(e||""),r=$.get((e==null?void 0:e.toLowerCase())||pe(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&&T.has(a)||T.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()).replace(/\b[A-Za-z0-9]+\b/g,s=>T.has(s.toUpperCase())?s.toUpperCase():s)}function pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{ke as a,xe as c,Te as d,Pe as h,be as s,ve as t}; +import{N as _}from"./index-DB5YVNrt.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 Z(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),S(n)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!K(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 C(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:C({formats:at,defaultWidth:"full"}),time:C({formats:it,defaultWidth:"full"}),dateTime:C({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 p(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:p({values:dt,defaultWidth:"wide"}),quarter:p({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:p({values:ft,defaultWidth:"wide"}),day:p({values:ht,defaultWidth:"wide"}),dayPeriod:p({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function O(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 kt=/^(\d+)(th|st|nd|rd)?/i,pt=/\d+/i,Ot={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]},Ct={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},Nt={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:kt,parsePattern:pt,valueCallback:t=>parseInt(t,10)}),era:O({matchPatterns:Ot,defaultMatchWidth:"wide",parsePatterns:Pt,defaultParseWidth:"any"}),quarter:O({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:O({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:O({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:O({matchPatterns:Ct,defaultMatchWidth:"any",parsePatterns:Nt,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=+S(e)-+Z(e);return Math.round(n/A)+1}function Q(t,e){var f,g,l,k;const n=w(t),r=n.getFullYear(),a=W(),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??((k=(l=a.locale)==null?void 0:l.options)==null?void 0:k.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 Ut(t,e){var s,u,d,f;const n=W(),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 Lt(t,e){const n=w(t),r=+x(n,e)-+Ut(n,e);return Math.round(r/A)+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=Lt(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+U(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"+U(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 U(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const 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))},At={p:X,P:Ht},It=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return It.test(t)}function Xt(t){return Rt.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,Zt=/[a-zA-Z]/;function Kt(t,e,n){var f,g,l,k;const r=W(),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??((k=(l=r.locale)==null?void 0:l.options)==null?void 0:k.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 Y=At[h];return Y(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(Zt))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 Y=q[h[0]];return Y(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*R+r*I+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function 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 Kt(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 ke(t){const e=$.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return T.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const T=new Set(["AI","OCR"]),$=new Map([["3d-tracking","3D Tracking"],["point-tracking","2D Point Tracking"],["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||ke(e||""),r=$.get((e==null?void 0:e.toLowerCase())||pe(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&&T.has(a)||T.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()).replace(/\b[A-Za-z0-9]+\b/g,s=>T.has(s.toUpperCase())?s.toUpperCase():s)}function pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{ke as a,xe as c,Te as d,Pe as h,be as s,ve as t}; diff --git a/assets/useDebounce-PKwJyb-p.js b/assets/useDebounce-CbVfyok_.js similarity index 66% rename from assets/useDebounce-PKwJyb-p.js rename to assets/useDebounce-CbVfyok_.js index e1abc6c90720cd871323f1b38bbef575d7ad1652..8f68e519b654e63752bd06940cad911478cdfdb2 100644 --- a/assets/useDebounce-PKwJyb-p.js +++ b/assets/useDebounce-CbVfyok_.js @@ -1 +1 @@ -import{r as o}from"./index-C7DzD1KZ.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-DB5YVNrt.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-DZ6ASWY6.js b/assets/useInfiniteQuery-CqugEgpc.js similarity index 89% rename from assets/useInfiniteQuery-DZ6ASWY6.js rename to assets/useInfiniteQuery-CqugEgpc.js index 8f3ae5a77904076b54d1118f0704fd5ebab64314..3a76093ac5b4f6a421338142969283de19a8496c 100644 --- a/assets/useInfiniteQuery-DZ6ASWY6.js +++ b/assets/useInfiniteQuery-CqugEgpc.js @@ -1 +1 @@ -import{Q as v,a as p}from"./useQuery-C-S9qU90.js";import{ai as x,aj as b}from"./index-C7DzD1KZ.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-gfOJVfRZ.js";import{ai as x,aj as b}from"./index-DB5YVNrt.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-CSNffbhV.js b/assets/useIntersectionObserver-CmsvWF1K.js similarity index 97% rename from assets/useIntersectionObserver-CSNffbhV.js rename to assets/useIntersectionObserver-CmsvWF1K.js index de93c4dcaf09b69c53cc85d752824d10b27b3952..ccd0ead261d2ef282403be655a758adf1950828e 100644 --- a/assets/useIntersectionObserver-CSNffbhV.js +++ b/assets/useIntersectionObserver-CmsvWF1K.js @@ -1 +1 @@ -import{j as n,r as u}from"./index-C7DzD1KZ.js";import{I as z}from"./components-BV3lUGf1.js";import{P as G,a as Q,b as J}from"./popover-CQWB7HGQ.js";const K=()=>n.jsxs("span",{className:"hf-resource-logo",children:[n.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),n.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),_=({checked:e,icon:t,label:a,onChange:s})=>n.jsxs("button",{type:"button",className:`paper-feed-filter ${e?"active":""}`,"aria-pressed":e,onClick:()=>s(!e),children:[n.jsxs("span",{className:"paper-feed-filter-content",children:[n.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:t}),a]}),e&&n.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),de=({hasCode:e,hasHfArtifacts:t,onHasCodeChange:a,onHasHfArtifactsChange:s,showDivider:i=!0,showHasCode:r=!0})=>n.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[i&&n.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),n.jsxs("div",{className:"paper-feed-filter-options",children:[r&&n.jsx(_,{checked:e,icon:n.jsx(z,{name:"github",size:14}),label:"Has code",onChange:a}),n.jsx(_,{checked:t,icon:n.jsx(K,{}),label:"Has artifacts",onChange:s})]})]}),k=(e,t)=>{const a=new Date(t),s=new Date(a);return s.setUTCDate(a.getUTCDate()-(e==="week"?6:29)),{startDate:s.toISOString().slice(0,10),endDate:a.toISOString().slice(0,10)}},X=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),ue=(e,t=new Date)=>{const a=X(e);if(a.startDate||a.endDate||e.get("time")==="all_time")return a;const s=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));return k("week",s)},ee=(e,t)=>{const a=new URLSearchParams(e);return t.startDate?a.set("start_date",t.startDate):a.delete("start_date"),t.endDate?a.set("end_date",t.endDate):a.delete("end_date"),a.delete("time"),a},pe=(e,t)=>{const a=ee(e,t);return!t.startDate&&!t.endDate&&a.set("time","all_time"),a},te=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),O=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),L="(max-width: 640px)",ae=()=>{const[e,t]=u.useState(()=>typeof window<"u"&&window.matchMedia(L).matches);return u.useEffect(()=>{const a=window.matchMedia(L),s=i=>t(i.matches);return t(a.matches),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e},V=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ne=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},R=(e,t)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),v=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),se=(e,t)=>new Date(Date.UTC(t,e.getUTCMonth(),1)),M=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate,re=(e,t)=>{const a=b(e),s=b(t),i=O.format(a),r=O.format(s),p=a.getUTCDate(),d=s.getUTCDate(),o=a.getUTCFullYear(),h=s.getUTCFullYear();return e===t?`${i} ${p}, ${o}`:o===h&&a.getUTCMonth()===s.getUTCMonth()?`${i} ${p}–${d}, ${o}`:o===h?`${i} ${p}–${r} ${d}, ${o}`:`${i} ${p}, ${o}–${r} ${d}, ${h}`},oe=e=>{const t=e.getUTCFullYear(),a=e.getUTCMonth(),s=new Date(Date.UTC(t,a,1)),i=(s.getUTCDay()+6)%7,r=new Date(s);return r.setUTCDate(s.getUTCDate()-i),Array.from({length:42},(p,d)=>{const o=new Date(r);return o.setUTCDate(r.getUTCDate()+d),{iso:V(o),day:o.getUTCDate(),outsideMonth:o.getUTCMonth()!==a}})},H=({month:e,today:t,startDate:a,endDate:s,onSelect:i,yearLabel:r,yearValue:p,onYearChange:d,secondary:o=!1})=>{const h=u.useMemo(()=>oe(e),[e]);return n.jsxs("section",{className:`paper-date-calendar${o?" paper-date-calendar-secondary":""}`,children:[n.jsxs("label",{className:"paper-date-year",children:[n.jsx("span",{children:r}),n.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:t.slice(0,4),step:"1",value:p,onChange:c=>d(c.target.value)})]}),n.jsx("h3",{children:te.format(e)}),n.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(c=>n.jsx("span",{children:c},c))}),n.jsx("div",{className:"paper-date-days",children:h.map(c=>{const g=c.iso===a||c.iso===s,C=!!(a&&s&&c.iso>a&&c.isot;return n.jsx("button",{type:"button","aria-label":c.iso,"aria-selected":g,disabled:m,className:["paper-date-day",c.outsideMonth?"outside":"",g?"selected":"",C?"in-range":"",c.iso===t?"today":""].filter(Boolean).join(" "),onClick:()=>i(c.iso),children:c.day},c.iso)})})]})},A=({calendar:e,onPrevious:t,onNext:a,secondary:s=!1})=>n.jsxs("div",{className:`paper-date-navigation-group${s?" paper-date-navigation-group-secondary":""}`,children:[n.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:t,children:"←"}),n.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:a,children:"→"})]}),he=({startDate:e,endDate:t,onChange:a,currentDate:s})=>{const i=ae(),r=s?b(s):ne(),[p,d]=u.useState(!1),[o,h]=u.useState(),[c,g]=u.useState(),[C,m]=u.useState(()=>v(r)),[N,T]=u.useState(()=>R(v(r),1)),[B,j]=u.useState(()=>String(r.getUTCFullYear())),[Z,D]=u.useState(()=>String(r.getUTCFullYear())),y={startDate:e,endDate:t},w=k("week",r),$=k("month",r),E=V(r),Y=!!(e&&t&&!M(y,w)&&!M(y,$)),W=()=>{h(e),g(t);const l=v(e?b(e):r),f=v(t?b(t):R(l,1));m(l),T(f),j(String(l.getUTCFullYear())),D(String(f.getUTCFullYear())),d(!0)},P=(l,f,F)=>{if(f(l),!/^\d{4}$/.test(l))return;const x=Number(l);x>=1900&&x<=r.getUTCFullYear()&&F(S=>se(S,x))},U=(l,f,F,x)=>{const S=R(l,f);F(S),x(String(S.getUTCFullYear()))},I=l=>{!o||c?(h(l),g(void 0)):l{a({}),d(!1)};return n.jsxs("div",{className:`paper-date-filter${i?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${M(y,w)?" active":""}`,onClick:()=>a(w),children:"Last Week"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${M(y,$)?" active":""}`,onClick:()=>a($),children:"Last Month"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!t?" active":""}`,onClick:()=>a({}),children:"All Time"}),n.jsxs(G,{open:p,onOpenChange:l=>{l?W():d(!1)},children:[n.jsx(Q,{asChild:!0,children:n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${Y?" active":""}`,"aria-label":Y?"Change date range":"Select a range",children:Y&&e&&t?re(e,t):"Select a range"})}),n.jsxs(J,{align:"end",className:`paper-date-popover${i?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[n.jsxs("div",{className:"paper-date-popover-header",children:[n.jsx("h2",{children:"Select a date range"}),n.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),n.jsxs("div",{className:"paper-date-navigation",children:[n.jsx(A,{calendar:"start",onPrevious:()=>U(C,-1,m,j),onNext:()=>U(C,1,m,j)}),!i&&n.jsx(A,{calendar:"end",onPrevious:()=>U(N,-1,T,D),onNext:()=>U(N,1,T,D),secondary:!0})]}),n.jsxs("div",{className:"paper-date-calendars",children:[n.jsx(H,{month:C,today:E,startDate:o,endDate:c,onSelect:I,yearLabel:i?"Year":"Start year",yearValue:B,onYearChange:l=>P(l,j,m)}),!i&&n.jsx(H,{month:N,today:E,startDate:o,endDate:c,onSelect:I,yearLabel:"End year",yearValue:Z,onYearChange:l=>P(l,D,T),secondary:!0})]}),n.jsxs("div",{className:"paper-date-actions",children:[n.jsx("button",{type:"button",className:"paper-date-clear",onClick:q,children:"Clear range"}),n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:()=>d(!1),children:"Cancel"}),n.jsx("button",{type:"button",className:"paper-date-apply",disabled:!o||!c,onClick:()=>{o&&c&&a({startDate:o,endDate:c}),d(!1)},children:"Apply"})]})]})]})]})]})};function ge(e={}){const{threshold:t=0,rootMargin:a="0px"}=e,[s,i]=u.useState(!1),r=u.useRef(null),p=u.useCallback(d=>{if(r.current&&(r.current.disconnect(),r.current=null),!d){i(!1);return}const o=new IntersectionObserver(([h])=>i(h.isIntersecting),{threshold:t,rootMargin:a});o.observe(d),r.current=o},[t,a]);return u.useEffect(()=>()=>{r.current&&(r.current.disconnect(),r.current=null)},[]),{targetRef:p,isIntersecting:s}}export{de as P,he as a,X as b,ee as c,ue as r,ge as u,pe as w}; +import{j as n,r as u}from"./index-DB5YVNrt.js";import{I as z}from"./components--1z4Qw5F.js";import{P as G,a as Q,b as J}from"./popover-BqJw3haa.js";const K=()=>n.jsxs("span",{className:"hf-resource-logo",children:[n.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),n.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),_=({checked:e,icon:t,label:a,onChange:s})=>n.jsxs("button",{type:"button",className:`paper-feed-filter ${e?"active":""}`,"aria-pressed":e,onClick:()=>s(!e),children:[n.jsxs("span",{className:"paper-feed-filter-content",children:[n.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:t}),a]}),e&&n.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),de=({hasCode:e,hasHfArtifacts:t,onHasCodeChange:a,onHasHfArtifactsChange:s,showDivider:i=!0,showHasCode:r=!0})=>n.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[i&&n.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),n.jsxs("div",{className:"paper-feed-filter-options",children:[r&&n.jsx(_,{checked:e,icon:n.jsx(z,{name:"github",size:14}),label:"Has code",onChange:a}),n.jsx(_,{checked:t,icon:n.jsx(K,{}),label:"Has artifacts",onChange:s})]})]}),k=(e,t)=>{const a=new Date(t),s=new Date(a);return s.setUTCDate(a.getUTCDate()-(e==="week"?6:29)),{startDate:s.toISOString().slice(0,10),endDate:a.toISOString().slice(0,10)}},X=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),ue=(e,t=new Date)=>{const a=X(e);if(a.startDate||a.endDate||e.get("time")==="all_time")return a;const s=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));return k("week",s)},ee=(e,t)=>{const a=new URLSearchParams(e);return t.startDate?a.set("start_date",t.startDate):a.delete("start_date"),t.endDate?a.set("end_date",t.endDate):a.delete("end_date"),a.delete("time"),a},pe=(e,t)=>{const a=ee(e,t);return!t.startDate&&!t.endDate&&a.set("time","all_time"),a},te=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),O=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),L="(max-width: 640px)",ae=()=>{const[e,t]=u.useState(()=>typeof window<"u"&&window.matchMedia(L).matches);return u.useEffect(()=>{const a=window.matchMedia(L),s=i=>t(i.matches);return t(a.matches),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e},V=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ne=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},R=(e,t)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),v=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),se=(e,t)=>new Date(Date.UTC(t,e.getUTCMonth(),1)),M=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate,re=(e,t)=>{const a=b(e),s=b(t),i=O.format(a),r=O.format(s),p=a.getUTCDate(),d=s.getUTCDate(),o=a.getUTCFullYear(),h=s.getUTCFullYear();return e===t?`${i} ${p}, ${o}`:o===h&&a.getUTCMonth()===s.getUTCMonth()?`${i} ${p}–${d}, ${o}`:o===h?`${i} ${p}–${r} ${d}, ${o}`:`${i} ${p}, ${o}–${r} ${d}, ${h}`},oe=e=>{const t=e.getUTCFullYear(),a=e.getUTCMonth(),s=new Date(Date.UTC(t,a,1)),i=(s.getUTCDay()+6)%7,r=new Date(s);return r.setUTCDate(s.getUTCDate()-i),Array.from({length:42},(p,d)=>{const o=new Date(r);return o.setUTCDate(r.getUTCDate()+d),{iso:V(o),day:o.getUTCDate(),outsideMonth:o.getUTCMonth()!==a}})},H=({month:e,today:t,startDate:a,endDate:s,onSelect:i,yearLabel:r,yearValue:p,onYearChange:d,secondary:o=!1})=>{const h=u.useMemo(()=>oe(e),[e]);return n.jsxs("section",{className:`paper-date-calendar${o?" paper-date-calendar-secondary":""}`,children:[n.jsxs("label",{className:"paper-date-year",children:[n.jsx("span",{children:r}),n.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:t.slice(0,4),step:"1",value:p,onChange:c=>d(c.target.value)})]}),n.jsx("h3",{children:te.format(e)}),n.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(c=>n.jsx("span",{children:c},c))}),n.jsx("div",{className:"paper-date-days",children:h.map(c=>{const g=c.iso===a||c.iso===s,C=!!(a&&s&&c.iso>a&&c.isot;return n.jsx("button",{type:"button","aria-label":c.iso,"aria-selected":g,disabled:m,className:["paper-date-day",c.outsideMonth?"outside":"",g?"selected":"",C?"in-range":"",c.iso===t?"today":""].filter(Boolean).join(" "),onClick:()=>i(c.iso),children:c.day},c.iso)})})]})},A=({calendar:e,onPrevious:t,onNext:a,secondary:s=!1})=>n.jsxs("div",{className:`paper-date-navigation-group${s?" paper-date-navigation-group-secondary":""}`,children:[n.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:t,children:"←"}),n.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:a,children:"→"})]}),he=({startDate:e,endDate:t,onChange:a,currentDate:s})=>{const i=ae(),r=s?b(s):ne(),[p,d]=u.useState(!1),[o,h]=u.useState(),[c,g]=u.useState(),[C,m]=u.useState(()=>v(r)),[N,T]=u.useState(()=>R(v(r),1)),[B,j]=u.useState(()=>String(r.getUTCFullYear())),[Z,D]=u.useState(()=>String(r.getUTCFullYear())),y={startDate:e,endDate:t},w=k("week",r),$=k("month",r),E=V(r),Y=!!(e&&t&&!M(y,w)&&!M(y,$)),W=()=>{h(e),g(t);const l=v(e?b(e):r),f=v(t?b(t):R(l,1));m(l),T(f),j(String(l.getUTCFullYear())),D(String(f.getUTCFullYear())),d(!0)},P=(l,f,F)=>{if(f(l),!/^\d{4}$/.test(l))return;const x=Number(l);x>=1900&&x<=r.getUTCFullYear()&&F(S=>se(S,x))},U=(l,f,F,x)=>{const S=R(l,f);F(S),x(String(S.getUTCFullYear()))},I=l=>{!o||c?(h(l),g(void 0)):l{a({}),d(!1)};return n.jsxs("div",{className:`paper-date-filter${i?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${M(y,w)?" active":""}`,onClick:()=>a(w),children:"Last Week"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${M(y,$)?" active":""}`,onClick:()=>a($),children:"Last Month"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!t?" active":""}`,onClick:()=>a({}),children:"All Time"}),n.jsxs(G,{open:p,onOpenChange:l=>{l?W():d(!1)},children:[n.jsx(Q,{asChild:!0,children:n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${Y?" active":""}`,"aria-label":Y?"Change date range":"Select a range",children:Y&&e&&t?re(e,t):"Select a range"})}),n.jsxs(J,{align:"end",className:`paper-date-popover${i?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[n.jsxs("div",{className:"paper-date-popover-header",children:[n.jsx("h2",{children:"Select a date range"}),n.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),n.jsxs("div",{className:"paper-date-navigation",children:[n.jsx(A,{calendar:"start",onPrevious:()=>U(C,-1,m,j),onNext:()=>U(C,1,m,j)}),!i&&n.jsx(A,{calendar:"end",onPrevious:()=>U(N,-1,T,D),onNext:()=>U(N,1,T,D),secondary:!0})]}),n.jsxs("div",{className:"paper-date-calendars",children:[n.jsx(H,{month:C,today:E,startDate:o,endDate:c,onSelect:I,yearLabel:i?"Year":"Start year",yearValue:B,onYearChange:l=>P(l,j,m)}),!i&&n.jsx(H,{month:N,today:E,startDate:o,endDate:c,onSelect:I,yearLabel:"End year",yearValue:Z,onYearChange:l=>P(l,D,T),secondary:!0})]}),n.jsxs("div",{className:"paper-date-actions",children:[n.jsx("button",{type:"button",className:"paper-date-clear",onClick:q,children:"Clear range"}),n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:()=>d(!1),children:"Cancel"}),n.jsx("button",{type:"button",className:"paper-date-apply",disabled:!o||!c,onClick:()=>{o&&c&&a({startDate:o,endDate:c}),d(!1)},children:"Apply"})]})]})]})]})]})};function ge(e={}){const{threshold:t=0,rootMargin:a="0px"}=e,[s,i]=u.useState(!1),r=u.useRef(null),p=u.useCallback(d=>{if(r.current&&(r.current.disconnect(),r.current=null),!d){i(!1);return}const o=new IntersectionObserver(([h])=>i(h.isIntersecting),{threshold:t,rootMargin:a});o.observe(d),r.current=o},[t,a]);return u.useEffect(()=>()=>{r.current&&(r.current.disconnect(),r.current=null)},[]),{targetRef:p,isIntersecting:s}}export{de as P,he as a,X as b,ee as c,ue as r,ge as u,pe as w}; diff --git a/assets/useMutation-m57QFYBa.js b/assets/useMutation-Bi00GAL7.js similarity index 97% rename from assets/useMutation-m57QFYBa.js rename to assets/useMutation-Bi00GAL7.js index 319689257a22e91b65a5a5bc1f1e4d549dfb836a..e93882ed6125e50b3ab1da38eeff9bac744186cc 100644 --- a/assets/useMutation-m57QFYBa.js +++ b/assets/useMutation-Bi00GAL7.js @@ -1 +1 @@ -var w=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||w("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?w("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),v=(i,t,s)=>(E(i,t,"access private method"),s);import{am as q,ao as U,au as R,av as k,an as P,h as L,r as y,aq as A,aw as D}from"./index-C7DzD1KZ.js";var h,c,o,a,n,C,S,j,I=(j=class extends q{constructor(t,s){super();b(this,n);b(this,h);b(this,c);b(this,o);b(this,a);p(this,h,t),this.setOptions(s),this.bindMethods(),v(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,h).defaultMutationOptions(t),U(this.options,s)||e(this,h).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&R(s.mutationKey)!==R(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){v(this,n,C).call(this),v(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),v(this,n,C).call(this),v(this,n,S).call(this)}mutate(t,s){var r;return p(this,a,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,h).getMutationCache().build(e(this,h),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},h=new WeakMap,c=new WeakMap,o=new WeakMap,a=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??k();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,a)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,h),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,a)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,a)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,a)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,a)).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))})})},j);function z(i,t){const s=L(),[r]=y.useState(()=>new I(s,i));y.useEffect(()=>{r.setOptions(i)},[r,i]);const u=y.useSyncExternalStore(y.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=y.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 w=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||w("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?w("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),v=(i,t,s)=>(E(i,t,"access private method"),s);import{am as q,ao as U,au as R,av as k,an as P,h as L,r as y,aq as A,aw as D}from"./index-DB5YVNrt.js";var h,c,o,a,n,C,S,j,I=(j=class extends q{constructor(t,s){super();b(this,n);b(this,h);b(this,c);b(this,o);b(this,a);p(this,h,t),this.setOptions(s),this.bindMethods(),v(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,h).defaultMutationOptions(t),U(this.options,s)||e(this,h).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&R(s.mutationKey)!==R(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){v(this,n,C).call(this),v(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),v(this,n,C).call(this),v(this,n,S).call(this)}mutate(t,s){var r;return p(this,a,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,h).getMutationCache().build(e(this,h),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},h=new WeakMap,c=new WeakMap,o=new WeakMap,a=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??k();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,a)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,h),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,a)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,a)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,a)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,a)).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))})})},j);function z(i,t){const s=L(),[r]=y.useState(()=>new I(s,i));y.useEffect(()=>{r.setOptions(i)},[r,i]);const u=y.useSyncExternalStore(y.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=y.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-CHyBH3Xk.js b/assets/usePapers-CT5co6TZ.js similarity index 94% rename from assets/usePapers-CHyBH3Xk.js rename to assets/usePapers-CT5co6TZ.js index b9868257bbfab43f7b59d844bc89609c19c6dcb8..44d6f5ff8887a1eb40f348e738bc08d54dc47dd6 100644 --- a/assets/usePapers-CHyBH3Xk.js +++ b/assets/usePapers-CT5co6TZ.js @@ -1 +1 @@ -import{aa as h}from"./index-C7DzD1KZ.js";import{u as P}from"./useQuery-C-S9qU90.js";import{u as y}from"./useInfiniteQuery-DZ6ASWY6.js";import{p as _}from"./papers-BNcOWLi8.js";function q(a,e=!0){return P({queryKey:["paper",a],queryFn:()=>_.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function z(a={}){const{page_size:e=20,search:t,order_by:n="date_published",order_dir:s="desc",start_date:i,end_date:o,conference:r,latest_only:u=!0,include_resources:l=!1,has_code:d=!1,has_hf_artifacts:f=!1,framework:c,repository:p,enabled:g=!0}=a;return y({queryKey:["papers-infinite",{page_size:e,search:t,order_by:n,order_dir:s,start_date:i,end_date:o,conference:r,latest_only:u,include_resources:l,has_code:d,has_hf_artifacts:f,framework:c,repository:p}],queryFn:({pageParam:m=1})=>_.list({page:m,page_size:e,search:t,order_by:n,order_dir:s,start_date:i,end_date:o,conference:r,latest_only:u,include_resources:l,has_code:d,has_hf_artifacts:f,framework:c,repository:p}),getNextPageParam:m=>m.next_page,initialPageParam:1,enabled:g,staleTime:5*60*1e3,placeholderData:h,refetchOnWindowFocus:!1})}function O({q:a,order_by:e="relevance",start_date:t,end_date:n,has_code:s=!1,has_hf_artifacts:i=!1,enabled:o=!0}){return y({queryKey:["paper-search-feed",{q:a,order_by:e,start_date:t,end_date:n,has_code:s,has_hf_artifacts:i}],queryFn:({pageParam:r=1})=>_.searchFeed({q:a,page:r,page_size:20,order_by:e,start_date:t,end_date:n,has_code:s,has_hf_artifacts:i,mode:"hybrid"}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:o&&a.trim().length>0,staleTime:5*60*1e3,placeholderData:h,refetchOnWindowFocus:!1})}function T(a){const{taskId:e,page_size:t=20,order_by:n="date_published",order_dir:s="desc",latest_only:i=!0,include_resources:o=!0,has_code:r=!1,has_hf_artifacts:u=!1,start_date:l,end_date:d,enabled:f=!0}=a;return y({queryKey:["task-papers-infinite",e,{page_size:t,order_by:n,order_dir:s,latest_only:i,include_resources:o,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}],queryFn:({pageParam:c=1})=>_.forTask(e,{page:c,page_size:t,order_by:n,order_dir:s,latest_only:i,include_resources:o,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}),getNextPageParam:c=>c.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:h,refetchOnWindowFocus:!1})}function w(a){const{conferenceSlug:e,taskSlug:t,presentation:n,page_size:s=20,order_by:i="date_published",order_dir:o="desc",latest_only:r=!0,include_resources:u=!0,has_code:l=!1,has_hf_artifacts:d=!1,start_date:f,end_date:c,enabled:p=!0}=a;return y({queryKey:["conference-papers-infinite",e,t,n,{page_size:s,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:f,end_date:c}],queryFn:({pageParam:g=1})=>_.forConference(e,{task:t,presentation:n,page:g,page_size:s,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:f,end_date:c}),getNextPageParam:g=>g.next_page,initialPageParam:1,enabled:p&&!!e,staleTime:5*60*1e3,placeholderData:h,refetchOnWindowFocus:!1})}function I(a){const{organizationSlug:e,taskSlug:t,page_size:n=20,order_by:s="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:r=!0,has_code:u=!1,has_hf_artifacts:l=!1,start_date:d,end_date:f,enabled:c=!0}=a;return y({queryKey:["organization-papers-infinite",e,t,{page_size:n,order_by:s,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:f}],queryFn:({pageParam:p=1})=>_.forOrganization(e,{task:t,page:p,page_size:n,order_by:s,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:f}),getNextPageParam:p=>p.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:h,refetchOnWindowFocus:!1})}export{O as a,q as b,T as c,w as d,I as e,z as u}; +import{aa as h}from"./index-DB5YVNrt.js";import{u as P}from"./useQuery-gfOJVfRZ.js";import{u as y}from"./useInfiniteQuery-CqugEgpc.js";import{p as _}from"./papers-CTasJek9.js";function q(a,e=!0){return P({queryKey:["paper",a],queryFn:()=>_.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function z(a={}){const{page_size:e=20,search:t,order_by:n="date_published",order_dir:s="desc",start_date:i,end_date:o,conference:r,latest_only:u=!0,include_resources:l=!1,has_code:d=!1,has_hf_artifacts:f=!1,framework:c,repository:p,enabled:g=!0}=a;return y({queryKey:["papers-infinite",{page_size:e,search:t,order_by:n,order_dir:s,start_date:i,end_date:o,conference:r,latest_only:u,include_resources:l,has_code:d,has_hf_artifacts:f,framework:c,repository:p}],queryFn:({pageParam:m=1})=>_.list({page:m,page_size:e,search:t,order_by:n,order_dir:s,start_date:i,end_date:o,conference:r,latest_only:u,include_resources:l,has_code:d,has_hf_artifacts:f,framework:c,repository:p}),getNextPageParam:m=>m.next_page,initialPageParam:1,enabled:g,staleTime:5*60*1e3,placeholderData:h,refetchOnWindowFocus:!1})}function O({q:a,order_by:e="relevance",start_date:t,end_date:n,has_code:s=!1,has_hf_artifacts:i=!1,enabled:o=!0}){return y({queryKey:["paper-search-feed",{q:a,order_by:e,start_date:t,end_date:n,has_code:s,has_hf_artifacts:i}],queryFn:({pageParam:r=1})=>_.searchFeed({q:a,page:r,page_size:20,order_by:e,start_date:t,end_date:n,has_code:s,has_hf_artifacts:i,mode:"hybrid"}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:o&&a.trim().length>0,staleTime:5*60*1e3,placeholderData:h,refetchOnWindowFocus:!1})}function T(a){const{taskId:e,page_size:t=20,order_by:n="date_published",order_dir:s="desc",latest_only:i=!0,include_resources:o=!0,has_code:r=!1,has_hf_artifacts:u=!1,start_date:l,end_date:d,enabled:f=!0}=a;return y({queryKey:["task-papers-infinite",e,{page_size:t,order_by:n,order_dir:s,latest_only:i,include_resources:o,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}],queryFn:({pageParam:c=1})=>_.forTask(e,{page:c,page_size:t,order_by:n,order_dir:s,latest_only:i,include_resources:o,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}),getNextPageParam:c=>c.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:h,refetchOnWindowFocus:!1})}function w(a){const{conferenceSlug:e,taskSlug:t,presentation:n,page_size:s=20,order_by:i="date_published",order_dir:o="desc",latest_only:r=!0,include_resources:u=!0,has_code:l=!1,has_hf_artifacts:d=!1,start_date:f,end_date:c,enabled:p=!0}=a;return y({queryKey:["conference-papers-infinite",e,t,n,{page_size:s,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:f,end_date:c}],queryFn:({pageParam:g=1})=>_.forConference(e,{task:t,presentation:n,page:g,page_size:s,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:f,end_date:c}),getNextPageParam:g=>g.next_page,initialPageParam:1,enabled:p&&!!e,staleTime:5*60*1e3,placeholderData:h,refetchOnWindowFocus:!1})}function I(a){const{organizationSlug:e,taskSlug:t,page_size:n=20,order_by:s="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:r=!0,has_code:u=!1,has_hf_artifacts:l=!1,start_date:d,end_date:f,enabled:c=!0}=a;return y({queryKey:["organization-papers-infinite",e,t,{page_size:n,order_by:s,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:f}],queryFn:({pageParam:p=1})=>_.forOrganization(e,{task:t,page:p,page_size:n,order_by:s,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:f}),getNextPageParam:p=>p.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:h,refetchOnWindowFocus:!1})}export{O as a,q as b,T as c,w as d,I as e,z as u}; diff --git a/assets/useQuery-C-S9qU90.js b/assets/useQuery-gfOJVfRZ.js similarity index 99% rename from assets/useQuery-C-S9qU90.js rename to assets/useQuery-gfOJVfRZ.js index 8b73dc8f2647aab2034b011352da145f67668937..82268a9694aaff0ee9c6e605321c7495aea8f922 100644 --- a/assets/useQuery-C-S9qU90.js +++ b/assets/useQuery-gfOJVfRZ.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{am as Tt,ay as gt,az as S,ao as q,aA as H,aq as tt,aB as et,aC as mt,aD as Mt,aE as J,aF as Qt,aG as xt,aH as vt,an as Ct,r as O,aw as Ot,h as _t}from"./index-C7DzD1KZ.js";var m,a,j,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,j);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))||H(this.options.staleTime,i(this,a))!==H(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,j),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,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),B=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:B,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,k=I.status==="error"&&!R,V=K=>{k?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":(k||I.data!==G.value)&&pt();break;case"rejected":(!k||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,j=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=H(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,j,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&&H(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(H(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()),Bt=()=>O.useContext(Nt),kt=(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])},Ht=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),jt=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},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,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jt(c),kt(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(Ht({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&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,Bt as c,kt as d,jt as e,At as f,yt as g,Ht 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{am as Tt,ay as gt,az as S,ao as q,aA as H,aq as tt,aB as et,aC as mt,aD as Mt,aE as J,aF as Qt,aG as xt,aH as vt,an as Ct,r as O,aw as Ot,h as _t}from"./index-DB5YVNrt.js";var m,a,j,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,j);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))||H(this.options.staleTime,i(this,a))!==H(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,j),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,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),B=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:B,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,k=I.status==="error"&&!R,V=K=>{k?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":(k||I.data!==G.value)&&pt();break;case"rejected":(!k||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,j=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=H(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,j,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&&H(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(H(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()),Bt=()=>O.useContext(Nt),kt=(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])},Ht=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),jt=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},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,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jt(c),kt(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(Ht({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&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,Bt as c,kt as d,jt as e,At as f,yt as g,Ht as h,Wt as s,Xt as u}; diff --git a/index.html b/index.html index b35d8a4774e624b557ac04c5acea13a53fc0f5a4..f13355bc2a291b78445a7177e3b6568696e528bc 100644 --- a/index.html +++ b/index.html @@ -73,7 +73,7 @@ plausible.init(); })(); - +